© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
15 replies
Will Pittenger

❔ WPF Binding to collection in static instance not updating list

I have a collection in a static member of a class that's being changed. It should be firing
PropertyChanged
PropertyChanged
for the property shown below. But the list never updates.
dgPredefined.SetBinding(System.Windows.Controls.ItemsControl.ItemsSourceProperty, new System
    .Windows.Data.Binding("AllItemsSortedByName")
    {
        Source = Data.NetworkMgr.mgr,
        NotifyOnTargetUpdated = true,
    });
dgPredefined.SetBinding(System.Windows.Controls.ItemsControl.ItemsSourceProperty, new System
    .Windows.Data.Binding("AllItemsSortedByName")
    {
        Source = Data.NetworkMgr.mgr,
        NotifyOnTargetUpdated = true,
    });

The original plan was to declare it in the XAML, but I haven't figured out the equivalent syntax. Can someone tell me what I'm doing wrong? I tried both
NotifyOnTargetUpdated
NotifyOnTargetUpdated
as shown above and
NotifyOnSourceUpdated
NotifyOnSourceUpdated
. My orignal impression was the latter is for when the control needs to be notified the source has changed. But after reading the documentation, it looks like it's the other way around. With
Data.NetworkMgr.mgr
Data.NetworkMgr.mgr
,
Data
Data
is a namespace,
NetworkMgr
NetworkMgr
is a class, and
mgr
mgr
is the static instance of
Data.NetworkMgr
Data.NetworkMgr
.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ WPF - Binding to last child of collection
C#CC# / help
3y ago
WPF User control and updating binding
C#CC# / help
12mo ago
WPF binding
C#CC# / help
13mo ago
WPF MVVM PropertyChangedEventHandler always null - Not updating Binding [Answered]
C#CC# / help
4y ago