Click here to Skip to main content
15,115,261 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: How do I create xy plots with WPF APP (.NET Framework)? Pin
Member 1539432815-Oct-21 10:28
MemberMember 1539432815-Oct-21 10:28 
GeneralRe: How do I create xy plots with WPF APP (.NET Framework)? Pin
Gerry Schmitz15-Oct-21 11:03
mveGerry Schmitz15-Oct-21 11:03 
GeneralRe: How do I create xy plots with WPF APP (.NET Framework)? Pin
Member 1539432816-Oct-21 2:40
MemberMember 1539432816-Oct-21 2:40 
GeneralRe: How do I create xy plots with WPF APP (.NET Framework)? Pin
Eddy Vluggen16-Oct-21 4:13
professionalEddy Vluggen16-Oct-21 4:13 
GeneralRe: How do I create xy plots with WPF APP (.NET Framework)? Pin
Gerry Schmitz16-Oct-21 10:46
mveGerry Schmitz16-Oct-21 10:46 
GeneralRe: How do I create xy plots with WPF APP (.NET Framework)? --- Solved Pin
Member 1539432817-Oct-21 5:44
MemberMember 1539432817-Oct-21 5:44 
GeneralRe: How do I create xy plots with WPF APP (.NET Framework)? Pin
Gerry Schmitz17-Oct-21 12:30
mveGerry Schmitz17-Oct-21 12:30 
Question(xaml, wpf) ScrollViewer Binding confusion (beginner) Pin
Maximilien7-Oct-21 9:46
MemberMaximilien7-Oct-21 9:46 
(shrug, should have posted this here before, newbie error)

I have a UI with a scrollviewer like this:

I want to scroll the viewer to the top when the ItemSource changes.
<ScrollViewer x:Name="Scroller" Grid.Row="2" Margin="0,0">
    <StackPanel>
        <ItemsControl x:Name="containers"
            ItemsSource="{Binding Whatever, NotifyOnTargetUpdated=True}"
            TargetUpdated="Containers_OnTargetUpdated">
        </ItemsControl>
    <StackPanel>
<ScrollViewer>
C#
public partial class MyPage: UserControl
{
    public MyPage()
    {
        InitializeComponent();
    }

    private void Containers_OnTargetUpdated(object? Sender, DataTransferEventArgs E)
    {
        var MyScroller = (ScrollViewer) this.FindName("Scroller");
        MyScroller.ScrollToHome();
    }
}

This works but it's probably not the best way to do it (ie. finding a control by name).

Can I pass the ScrollViewer "object" to the TargetUpdated callback/event ? so that I don't have to referencing it by name?

It seems clunky.

I don't know exactly what magic incantations I need to google for.

Thanks. M.
CI/CD = Continuous Impediment/Continuous Despair

AnswerRe: (xaml, wpf) ScrollViewer Binding confusion (beginner) Pin
Richard Deeming7-Oct-21 22:47
mveRichard Deeming7-Oct-21 22:47 
AnswerRe: (xaml, wpf) ScrollViewer Binding confusion (beginner) Pin
Gerry Schmitz8-Oct-21 10:57
mveGerry Schmitz8-Oct-21 10:57 
QuestionCurrency Entry Issue Pin
Kevin Marois7-Oct-21 8:23
professionalKevin Marois7-Oct-21 8:23 
AnswerRe: Currency Entry Issue Pin
Richard Deeming7-Oct-21 22:44
mveRichard Deeming7-Oct-21 22:44 
GeneralRe: Currency Entry Issue Pin
Kevin Marois8-Oct-21 7:03
professionalKevin Marois8-Oct-21 7:03 
QuestionQuick MVVM Design Question Pin
Kevin Marois5-Oct-21 8:34
professionalKevin Marois5-Oct-21 8:34 
AnswerRe: Quick MVVM Design Question Pin
Mycroft Holmes5-Oct-21 14:39
professionalMycroft Holmes5-Oct-21 14:39 
AnswerRe: Quick MVVM Design Question Pin
Pete O'Hanlon5-Oct-21 21:26
mvePete O'Hanlon5-Oct-21 21:26 
GeneralRe: Quick MVVM Design Question Pin
Richard Deeming5-Oct-21 22:34
mveRichard Deeming5-Oct-21 22:34 
GeneralRe: Quick MVVM Design Question Pin
Gerry Schmitz6-Oct-21 10:52
mveGerry Schmitz6-Oct-21 10:52 
AnswerRe: Quick MVVM Design Question Pin
#realJSOP10-Nov-21 0:37
mva#realJSOP10-Nov-21 0:37 
QuestionPage/Frame Pin
michaelbarb23-Sep-21 11:12
Membermichaelbarb23-Sep-21 11:12 
AnswerRe: Page/Frame Pin
Gerry Schmitz24-Sep-21 13:48
mveGerry Schmitz24-Sep-21 13:48 
GeneralRe: Page/Frame Pin
michaelbarb24-Sep-21 14:24
Membermichaelbarb24-Sep-21 14:24 
QuestionStuck with Weird Exceptions Pin
Kevin Marois7-Sep-21 14:51
professionalKevin Marois7-Sep-21 14:51 
AnswerRe: Stuck with Weird Exceptions Pin
Richard Deeming7-Sep-21 22:28
mveRichard Deeming7-Sep-21 22:28 
GeneralRe: Stuck with Weird Exceptions Pin
Kevin Marois8-Sep-21 5:58
professionalKevin Marois8-Sep-21 5:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.