Questions tagged [propertychanged]

221 questions
4
votes
1 answer

Calculate result of two values on Property Changed MVVM

I am trying to Calculate the "NetAmount" by the following simple formula in MVVM GrossAmount + Carriage - Discount = NetAmount I am using MVVM Light Toolkit and declared properties as follows public const string DiscountPropertyName =…
Thr3e
  • 358
  • 1
  • 6
  • 22
3
votes
2 answers

jFormattedTextField's Formatter.setCommitsOnValidEdit(true) doesn't work at first focus

I have a jFormattedTextField and I set setCommitsOnValidEdit to true then I added an event listener to "property change" on "value" property. At first focus of that jFormattedTextField it doesn't call event listener method when typing in it. But on…
Ariyan
  • 14,760
  • 31
  • 112
  • 175
3
votes
1 answer

Silverlight: Setting property directly removes data binding?

I am modifying a Silverlight project which heavily uses the code behind for setting properties and such. This was created a few years back and was more or less ported over from a WinForms project. The problem I noticed is that when I set a data…
Telavian
  • 3,752
  • 6
  • 36
  • 60
3
votes
0 answers

Fody.Propertychanged preventing Edit and Continue when used with MVVMLight

I understand that using AOP tooling could/should interfere with edit and continue for a class that is weaved. But I have a case where simply using MVVMLight and Fody.PropertyChanged in the same project prevents edit and continue anywhere if there…
3
votes
1 answer

Evaluation of value in setter not even being checked

I have a property in a composite control that checks to see if the value has changed prior to actually setting the related private field and doing a few other things. However, it appears that it is never evaluating the statement. Here is the code…
Amanda Kitson
  • 5,477
  • 12
  • 49
  • 73
3
votes
1 answer

How to create a property changed event when the property has only a getter in C#

Let's say I have this class (which is really for demonstration purposes): class Person { public string FirstName { get; set; } public string LastName { get; set; } public string IdNumber { get; set; } // CheckPopulationRegistry()…
Michael Haddad
  • 4,085
  • 7
  • 42
  • 82
3
votes
1 answer

Locking strategy with PropertyChangeListener

I've defined a class with a number of "observable" properties. Internally the class contains a single thread that performs I/O; e.g. public class Foo { private final PropertyChangeSupport support; private State state; public Foo() {…
Adamski
  • 54,009
  • 15
  • 113
  • 152
3
votes
3 answers

WebBrowser OnPropertyChange event is not firing

I have a webpage, and an input button on it. Clicking on this button, in a specific div are loaded some data. My problem is that I can't catch this data. The following code is my attempt to solve this problem, but without success. private void…
3
votes
1 answer

Dependency Properties' PropertyChangedCallback not getting called

If have an own user control with a DependencyProperty and the corresponding callback method like below: public partial class PieChart : UserControl { public static readonly DependencyProperty RatesProperty = DependencyProperty.Register("Rates",…
schoola
  • 704
  • 6
  • 12
2
votes
1 answer

Overriding methods with actions as parameters

I have a set of methods that allows users to easily user the PropertHasChanged event and allows then to do some extra processing. Here is the method: public virtual void SetPropertyValue(ref T currentValue, T newValue, Action extraFunction =…
The Sheek Geek
  • 4,126
  • 6
  • 38
  • 48
2
votes
1 answer

How do I find out who has subscribed to an event field?

I want to find out when the PropertyChanged event handler is set in my base class. Both Debug.Print("Is Null") and Debug.Print("not null") get hit. So it must get set somewhere. How do I find that out? A search for PropertyChanged does not reveal…
Kirsten
  • 15,730
  • 41
  • 179
  • 318
2
votes
1 answer

WPF Catch ObservableCollection's item property changes

Hi I was trying a few ways of doing this but either wasn't successful or it wasn't ideal. I simply want to catch the PropertyChanged event of any item in the collection. I have wired it up manually at the moment but am wondering if there is a more…
Dominic
  • 62,658
  • 20
  • 139
  • 163
2
votes
1 answer

Change referenceequals to equals in reference.cs

I have a wpf app that uses a wcf webservice. Its my webservice and app, so I can make changes to either side. In the Reference.cs file that gets automatically genereated by visual studio it uses this code for the property changed…
odyth
  • 4,324
  • 3
  • 37
  • 45
2
votes
1 answer

Converter not firing after collection update

I have ran into a issue with the converters... They are not triggering once the bound collection is updated although they trigger when the collection is first populated. I would like to have them fire whenever there is a change in the collection.…
VladT
  • 25
  • 5
1 2
3
14 15