inotifypropertychanged

WPF DataBinding, CollectionViewSource, INotifyPropertyChanged

First time when I tried to do something in WPF, I was puzzled with WPF DataBinding. Then I studied thorougly next example on MSDN: http://msdn.microsoft.com/en-us/library/ms771319(v=VS.90).aspx Now, I quite understand how to use Master-Detail paradigm for a form which takes data from one source (one table) - both for master and detailed...

Automatically Raise PropertyChanged when an inner object property got changed

I got a scenario like this Class Parent { Property A; } Class A { Property X } How can I get PropertyChangedNotification on Property A when X changes? I don’t want to refer ‘Parent’ in class A or any kind of event which spoils my decoupling. What I basically want is to make the Parent.IsDirty=true. This is avery simp...

Implementing INotifyPropertyChanged with PostSharp 1.5

Hello all. Im new to .NET and WPF so i hope i will ask the question correctly. I am using INotifyPropertyChanged implemented using PostSharp 1.5: [Serializable, DebuggerNonUserCode, AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class, AllowMultiple = false, Inherited = false), MulticastAttributeUsage(MulticastTargets.Clas...

Implement INotifyPropertyChanged on DataContext in WPF?

When doing databinding does one have to implement INotifyPropertyChanged on the datacontext in WPF? ...

Handle property change event listeners (lots of them) more elegantly (dictionary?)

hELLO ! Here i have a simple class example with three fields of type class B and some other stuff. As you can see im listening on every child object change. Since i could need alot of properties of type class B i wonder if there is a way of shrinking the code. Creating a listener + a method for each seems like i will have ALOT of code. ...

Injecting (INotifyPropertyChanged functionality) to an instance of an class

Hi ! I have a class that implements INotifyPropertyChanged. I create an instance of a class in some viewModel. Is it possible to remove this functionality from the class and inject it after the instance was created? I heard that ICustomTypeDescriptor would make this happen, but i dont know how to use it. public class C : ICustomNotifyP...

Value Object and View Model Property

I am working on a solution that used DDD for architecture. I have a property in my ViewModel which points to a ValueObject, the view model also implements INotifyPropertyChanged interface. The value of the ValueObject will change as a user enters data on the front end. The problem I am running into is the value object is suppose to be...

WPF: Soft deletes and binding?

I have custom objects which implement INotifyProperyChanged and now I'm wondering if it is possible to implement soft delete which would play nicely with binding? Each object would have a IsDeleted property and if this property would be set to true than it would not be displayed in GUI. I was thinking about making a custom markup extensi...

Backend raising (INotify)PropertyChanged events to all connected clients?

One of our 'frontend' developers keeps requesting from us backend developers that the backend notifies all connected clients (it's a client/server environment) of changes to objects. As in: whenever one user makes a change, all other connected clients must be notified immediately of the change. At the moment our architecture does not ha...

GridViewColumn not subscribing to PropertyChanged event in a ListView

I have a ListView with a GridView that's bound to the properties of a class that implements INotifyPropertyChanged, like this: <ListView Name="SubscriptionView" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="2" ItemsSource="{Binding Path=Subscriptions}"> <ListView.View> <GridView> <GridViewColumn Width="24" CellTe...

EntityFramework EntityState and databinding along with INotifyPropertyChanged

Hello, all! I have a WPF view that displays a Shipment entity. I have a textblock that contains an asterisk which will alert a user that the record is changed but unsaved. I originally hoped to bind the visibility of this (with converter) to the Shipment.EntityState property. If value = EntityState.Modified Then Return Visibility...

Why would the VB.NET compiler think an interface isn't implemented when it is?

Update I don't think I was clear enough when I originally posted this quesion. Take a look at these screenshots. (Link to bigger screenshot here) Notice the portions I've boxed in red. The class displayed here does implement INotifyPropertyChanged, but the VB compiler seems to think that the PropertyChanged event as declared does no...

Should a setter return immediately if assigned the same value?

In classes that implement INotifyPropertyChanged I often see this pattern : public string FirstName { get { return _customer.FirstName; } set { if (value == _customer.FirstName) return; _customer.FirstName = value; base.OnPropertyChanged("FirstName"); ...

Binding to a dictionary in Silverlight with INotifyPropertyChanged

In silverlight, I can not get INotifyPropertyChanged to work like I want it to when binding to a dictionary. In the example below, the page binds to the dictionary okay but when I change the content of one of the textboxes the CustomProperties property setter is not called. The CustomProperties property setter is only called when CustomP...

Indirect property notification

Hello, this question might look a little trivial, but it might not be. I'm just wondering which of the following two cases is better for indirect property notification, or perhaps there is an even better way. The scenario: I have two properties, the first one is an object called HoldingObject, the second one is a boolean called IsHoldi...

Will WCF allow me to use object references across boundaries on objects that implement INotifyPropertyChanged or contain observablecollection objects?

So I've created a series of objects that interact with a piece of hardware over a serial port. There is a thread running monitoring the serial port, and if the state of the hardware changes it updates properties in my objects. I'm using observable collections, and INotifyPropertyChanged. I've built a UI in WPF and it works great, show...

Firing PropertyChanged event in a complex, nested type in WPF

I have a class called DataStore and a list of Departments (an ObservableCollection), and each department again has a list of Products. Properties in the Product class that are changed also affect properties in the Department and DataStore class. How does each Product notify the Department it belongs to, and the DataStore (which is the mo...

typesafe NotifyPropertyChanged using linq expressions

Form Build your own MVVM I have the following code that lets us have typesafe NotifyOfPropertyChange calls: public void NotifyOfPropertyChange<TProperty>(Expression<Func<TProperty>> property) { var lambda = (LambdaExpression)property; MemberExpression memberExpression; if (lambda.Body is UnaryExpression) { var un...

Is it getting to be time for C# to support compile-time macros?

Thus far, Microsoft's C# team has resisted adding formal compile-time macro capabilities to the language. There are aspects of programming with WPF that seem (to me, at least) to be creating some compelling use cases for macros. Dependency properties, for instance. It would be so nice to just be able to do something like this: [Depen...

Can we update a source that is not DepencyProperty or not INotifyPropertyChanged compliant

I have a business object that comes from the core of the application. That object does not inherit from INotifyPropertyChanged. It contains some property that my XAML code bind to it. I only want to update the properties not the UI dynamically (OneWayToSource style). By example, if I change the text of a text box, the source item does n...