Questions tagged [propertychanged]
221 questions
53
votes
2 answers
In WPF, why doesn't TemplateBinding work where Binding does?
Ok... this is leaving me scratching my head. I have two WPF controls--one's a user control and the other's a custom control. Let's call them UserFoo and CustomFoo. In the control template for CustomFoo, I use an instance of UserFoo which is a…

Mark A. Donohoe
- 28,442
- 25
- 137
- 286
29
votes
4 answers
List INotifyPropertyChanged event
I have a simple class with a string property and a List property and I have the INofityPropertyChanged event implemented, but when I do an .Add to the string List this event is not hit so my Converter to display in the ListView is not hit. I am…

theDoke
- 553
- 1
- 7
- 18
22
votes
1 answer
How to use PropertyChangedCallBack
I have a TextBox Binded to a dependancy property, I have implemented a PropertyChangedCallBack function, when the text changes I need to call textbox.ScrollToEnd() but I cant since the PropertChanged function need to be static, is there a way around…

Eamonn McEvoy
- 8,876
- 14
- 53
- 83
20
votes
3 answers
how does PropertyChangedEventHandler work?
This is a really simple question, but I was wondering if someone could explain what the 4th line is actually doing? so the first line gives an event to the handler. I don't really know in what circumstances handler will return null or what the last…

James Joshua Street
- 3,259
- 10
- 42
- 80
18
votes
4 answers
Why can't I invoke PropertyChanged event from an Extension Method?
I've tried to code a class to avoid a method like "RaisePropertyChanged". I know that I can inherit from a class that has that implementation but in some cases I can't. I've tried with a Extension Method but Visual Studio complain.
public static…

Vitor Canova
- 3,918
- 5
- 31
- 55
16
votes
2 answers
Why am i using UpdateSourceTrigger=PropertyChanged ,TwoWay is not enough?
hi; there are Source and target textbox txttarget has a binding to txtsource. when writing something in txtsource, txttarget is changed.Everything is good. But writing on txttarget, i dont see any changes at txttarget? there is TwoWay mode. Twoway…

loki
- 2,926
- 8
- 62
- 115
13
votes
2 answers
Monitor a change in the property of a Telerik ScheduleView control in WPF
I have 2 properties to a class (WPF control): HorizontalOffset and VerticalOffset (both public Double's). I would like to call a method whenever these properties change. How can I do this? I know of one way - but I'm pretty sure it's not the right…
user1017882
13
votes
1 answer
Text on TextBox with UpdateSourceTrigger=PropertyChanged is not updated when coercion of text input results in unchanged source value
I have a text box whose Text property has a TwoWay MultiBinding with UpdateSourceTrigger set to PropertyChanged. The first Binding is to a dependency property (Value) which has a PropertyChangedCallBack function that rounds the value to one decimal…

Neo
- 4,145
- 6
- 53
- 76
11
votes
2 answers
TextBox bound to Decimal with UpdateSourceTrigger=PropertyChanged
I've been battling this issue for a while now and seem not to be able to come up with a concrete workaround - I have a TextBox which is bound to a decimal, and the binding has UpdateSourceTrigger set to PropertyChanged and is so by necessity…

Aaj
- 259
- 3
- 16
11
votes
4 answers
ObservableCollection PropertyChanged event
I want to subclass ObservableCollection to add a property to it. Unfortunately, the PropertyChanged event is protected. Basically, I want to subclass it to have a SelectedItem that I can bind to for lists in my MVVM WPF app.
Here's the skeleton of…

Jose
- 10,891
- 19
- 67
- 89
10
votes
4 answers
WPF: PropertyChangedCallback triggered only once
I have a user control, which exposes a DependencyProperty called VisibileItems
Every time that property gets updated, i need to trigger another event.
To achieve that, i added a FrameworkPropertyMetadata with PropertyChangedCallback event.
For…

Sonic Soul
- 23,855
- 37
- 130
- 196
10
votes
1 answer
WPF CustomControl: OnApplyTemplate called after PropertyChangedCallback
I am creating a WPF CustomControl that has a dependency property with PropertyChangedCallback. In that Callback method I try to set values on some of the control's parts that I retrieve from OnApplyMethod using the GetTemplateChild() method.
The…
Albert Hofmann
9
votes
3 answers
WPF application hang by PropertyChangedEventManager in concurrent environments
I'm working on a complex WPF application which hangs in production once several days. There's a thread other than GUI thread filling data to models bind to the grid and triggers INotifyPropertyChanged.PropertyChanged event. I wrote a script to…

Jeffrey Zhao
- 4,923
- 4
- 30
- 52
8
votes
1 answer
Is there a way to get didSet to work when changing a property in a class?
I have a class as property with a property observer. If I change something in that class, is there a way to trigger didSet as shown in the example:
class Foo {
var items = [1,2,3,4,5]
var number: Int = 0 {
didSet {
items…

Henny Lee
- 2,970
- 3
- 20
- 37
8
votes
3 answers
WPF Update Binding when Bound directly to DataContext w/ Converter
Normally when you want a databound control to 'update,' you use the "PropertyChanged" event to signal to the interface that the data has changed behind the scenes.
For instance, you could have a textblock that is bound to the datacontext with a…

Adam
- 1,202
- 11
- 25