inotifypropertychanged

C#: ObservableCollection not noticing when Item in it changes (even with INotifyPropertyChanged)

Hello, does anyone know why this code doesn't work: public class CollectionViewModel : ViewModelBase { public ObservableCollection<EntityViewModel> ContentList { get { return _contentList; } set { _contentList = value; RaisePropertyChanged("ContentList"); //I wan...

WPF PropertyChange does not cascade - animating one custom class dependencyproperty changes other properties - PropertyChange only fires for first

Hi all! Very simplified, this is my problem: (solution in the bottom) I have a custom class, inheriting Animatable and INotifyPropertyChange, containing one DependencyProperty (which I animate, say from 1 to 10) and one extra property (which I want to use from the XAML with a binding): MyClass : Animatable, INotifyPropertyChanged { ...

Is INotifyPropertyChanged supported by Mono?

I'm currently developing an application that should be able to run under the standard .Net Framework as well as under Mono. I was wondering if I could safely implement INotifyPropertyChanged in my business model and that the Mono Framework would pick it up without extra effort? Is the support of data binding good enough in the Mono Fram...

C# WPF OnPropertyChanged Within a foreach loop

I have been trying to learn and take advantage of WPF and databinding. I have a listview that has a column that will display one of three images as shown in this snippet: <GridViewColumn Header="Status" Width="50"> <GridViewColumn.CellTemplate> <DataTemplate> <Image x:Name="TheImage" Height="18"/> <DataTemplate.Trig...

Notify changes on an XML file

I created this simple textpad program in WPF/VB.NET 2008 that automatically saves the content of the forms to an XML file on every keystroke. Now, I'm trying to make the program see the changes on the XML file in realtime.. example, If I open two of my textpads, when I write on the first one, it will automatically reflect on the other t...

Implementing INotifyPropertyChanged or similar custom event in base class

Is there a way to do this: I need to develop the easiest way to support registering to property changes of some class. Apart from manual way of adding INotifyProperyChanged support, is there a way to do it like this: class Base ... // all notification logic here class Child { public string Name { get; set; } public int SomeNu...

C# WPF PropertyChanged event always null

I have the following (abbreviated) xaml: <TextBlock Text="{Binding Path=statusMsg, UpdateSourceTrigger=PropertyChanged}"/> I have a singleton class: public class StatusMessage : INotifyPropertyChanged { private static StatusMessage instance = new StatusMessage(); private StatusMessage() { } public static StatusMessag...

PropertyChanged Event, raise when OnClick???

Hi, I have a WinForms application with some business objects which implement INotifyPropertyChanged and hook the PropertyChanged event via some controls & BindingSource on the form which raises an event back to my business objects layer... There's just one issue - everything works fine, except only when the control loses focus. E.G., t...

How to implement DataTable property with INotifyPropertyChanged

I have created WPF MVVM application, and set WPFToolkit DataGrid binding to DataTable so I want to know how to implement DataTable property to notify changed. Currently my code is like below. public DataTable Test { get { return this.testTable; } set { ... ... base.OnPropertyChanged("Test"); } }...

WPF INotifyPropertyChanged not updating on an array property?

I created a small example to demonstrate the issue I'm having. First my class: public class DisplayRow : INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; private int?[] values; private string title; public string Title { get { return title; } set { ...

Enforcing the correct implementation of INotifyPropertyChanged with CodeContracts - "requires unproven"

I'm looking for an easy way to enforce the correct implementation of INotifyPropertyChanged i.e. when PropertyChanged is raised it must reference a property that is actually defined. I tried doing this with the new CodeContract tools from Microsoft, but I keep getting the warning "CodeContracts: requires unproven". Here is my code... pu...

DataBound UserControl and PropertyNameChanged Event problem in .net winforms.

I have a UserControl, with a TextBox and a databound property - Value. Value can be any object such as a Color, Array, Font etc. Any time the text changes, the property Value is changed as long as it is valid. Looking at the msdn article: How to: Apply the PropertyNameChanged Pattern , it says I should use the PropertyNameChanged Event...

.net propertychange notification handlers - strings vs. expressions

Using WPF has made me a fan of INotifyPropertyChanged. I like to use a helper that takes an expression and returns the name as a string (see example code below). In lots of applications I see by very proficient programmers, however, I see code that handles the strings raw (see 2nd example below). By proficient I mean MVP types who know h...

Silverlight, Unity and INotifyPropertyChanged

I'm starting a new Silverlight project at the moment, and I'm having issues where by Unity is throwing an exception if my ViewModel (which it is instantiating for me) contains the RaisePropertyChanged event. I looks like this: public class AddNewClientViewModel : ViewModelBase { private Visibility _extraClientFieldsVisible; pu...

F#: Using INotifyPropertyChanged for data binding

How would one implement INotifyPropertyChanged for use in an F# type? Thanks! ...

Why does .NET read values of unaffected properties on reception of INotifyPropertyChanged.PropertyChanged event?

Hi everyone! I'm new to data binding and encountered the following oddity today which I fail to understand: I have a form with two labels (labelA and labelB) and two buttons (buttonA and buttonB). The form hosts an object (called "formState") with two properties (CountA and CountB). labelA.Text is data-bound to formState.CountA, labelB...

Bind Winform control property to a property on User Control using INotifyPropertyChanged

Hi there! Please advise me. Winforms app, C#. I have a user control (UC) that contains a DataGridView. Firstly, I have a boolean public property in the UC called "IsComplete". in the RowEnter event of my DGV, Im able to set the property accordingly. Secondly, I successfully instantiate and load this UC into its designated area in ...

Why is UpdateSourceTrigger=PropertyChanged not triggering an element changed?

I have this WPF Window: public Window1() { InitializeComponent(); this.Content = new TheForm(); } Which loads this UserControl: <UserControl x:Class="TestAutomaticUpdate82828.TheForm" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Height="30...

ObservableCollection<T> in Winforms and possible alternatives

Hey there! Winforms .net 3.5 app. In my app I have a generic class that looks like so: public class FilterItem { public FilterItem() { } public string FilterProperty { get; set; } public bool FilterPropertyChecked { get; set; } public ComparitiveOperator FilterOperator { get; set; } public string FilterValue { get; set; } } ...

C#/WPF: PropertyChanged for all Properties in ViewModel?

Hello, I've a class like this: public class PersonViewModel : ViewModelBase //Here is the INotifyPropertyChanged Stuff { public PersonViewModel(Person person) { PersonEntity = person; } public Person PersonEntity { get { return PersonEntity.Name; } private set { PersonEntity.Name = value; Raise...