Click here to Skip to main content
16,006,348 members
Home / Discussions / C#
   

C#

 
GeneralRe: Populating a Treeview from a dataset in c# Pin
Anurag Gandhi23-Jan-10 7:43
professionalAnurag Gandhi23-Jan-10 7:43 
QuestionRe: Populating a Treeview from a dataset in c# Pin
tonyonlinux23-Jan-10 10:07
tonyonlinux23-Jan-10 10:07 
QuestionCreating ASP.NET server control with design-time capabilities Pin
[DK]KiloDunse22-Jan-10 11:04
[DK]KiloDunse22-Jan-10 11:04 
AnswerRe: Creating ASP.NET server control with design-time capabilities Pin
Not Active22-Jan-10 11:11
mentorNot Active22-Jan-10 11:11 
GeneralRe: Creating ASP.NET server control with design-time capabilities Pin
[DK]KiloDunse22-Jan-10 11:16
[DK]KiloDunse22-Jan-10 11:16 
GeneralRe: Creating ASP.NET server control with design-time capabilities Pin
Not Active22-Jan-10 11:28
mentorNot Active22-Jan-10 11:28 
AnswerRe: Creating ASP.NET server control with design-time capabilities Pin
[DK]KiloDunse22-Jan-10 15:54
[DK]KiloDunse22-Jan-10 15:54 
QuestionINotifyPropertyChanged, attributes and notification cascade Pin
N4sh22-Jan-10 9:15
N4sh22-Jan-10 9:15 
Hi people,

I have been thinking about a notification system and notification cascade and I came up with the following draft of code (wrote on notepad++, i know i does not compile). I would like to get some more ideas about notification cascading and maybe gather some people to implement something on CodePlex.

Below the snippet there are some resources I found about multiple implementations.

Snippet :
// Avoids having to plumb notifications, is it useful as the class implements the interface?
// INotifyPropertyChanged is useful to know if it is possible to cascade changes
[Notify]
public class MyViewModel : 
	INotifyPropertyChanged, (INotifier?,) IDisposable, 
	INotificationConfigurator<MyViewModel> {
	public MyViewModel(AnotherObservableViewModel other){
		
	}
	
	// if property can notify it changed, notify my listeners it changed
	// you can filter which properties to cascade
	[CascadeNotification<AnotherClass>(x => x.Pty)] 
	public AnotherClass MyProperty {
		get;set;
	}
	
	[DontNotify] // blocks observation
	public object YourProperty {
		get;set;
	}
	
	public void AnActionDelegate(){
		// do something
	}
	
	public void ConfigureCascades<MyViewModel>(INotificationEngine notifier){
		//Cascade a notification
		notifier.CascadeChange<AnotherObservableViewModel>(other)
			.OnUpdate(other.OtherProperty)
				.CascadeOn(this.MyProperty)
				.Do(AnActionDelegate)
			.OnDispose()
				.CascadeDispose();
				
		// or?
		notifier.Cascade<From,To>() // notifier.Cascade<From,To>(From f, To t) overload ??
			.OnUpdate(from => from.OtherProperty)
				.CascadeNotificationOn(to => to.MyProperty)
				.Do(to => to.AnActionDelegate())
			.OnDispose()
				.CascadeDispose();
	}
}


Resources :

Implementing INotifyPropertyChanged with Unity Interception[^]
Same thing with PostSharp[^]
http://code.google.com/p/postsharp-user-samples/wiki/DataBindingSupport[^]
http://khason.net/dev/inotifypropertychanged-auto-wiring-or-how-to-get-rid-of-redundant-code/[^]
http://blogs.msdn.com/knowledgecast/[^]
http://wpfstarterkit.codeplex.com/Thread/List.aspx[^]
http://jfromaniello.blogspot.com/2009/07/inotifypropertychanged-as-aop.html[^]
http://shecht.wordpress.com/2009/12/12/inotifypropertychanged-with-unity-interception-aop/[^]
http://houseofbilz.com/archive/2009/11/14/adventures-in-mvvm----dependant-properties-with-inotifypropertychanged.aspx[^]
Questionhow to split input integer variable Pin
arungracy22-Jan-10 9:15
arungracy22-Jan-10 9:15 
AnswerRe: how to split input integer variable Pin
loyal ginger22-Jan-10 9:22
loyal ginger22-Jan-10 9:22 
GeneralRe: how to split input integer variable Pin
Som Shekhar22-Jan-10 9:39
Som Shekhar22-Jan-10 9:39 
AnswerRe: how to split input integer variable Pin
#realJSOP22-Jan-10 10:23
professional#realJSOP22-Jan-10 10:23 
GeneralRe: how to split input integer variable Pin
Luc Pattyn22-Jan-10 10:46
sitebuilderLuc Pattyn22-Jan-10 10:46 
GeneralRe: how to split input integer variable Pin
#realJSOP22-Jan-10 11:05
professional#realJSOP22-Jan-10 11:05 
AnswerRe: how to split input integer variable [modified] Pin
#realJSOP22-Jan-10 10:36
professional#realJSOP22-Jan-10 10:36 
GeneralRe: how to split input integer variable [modified] Pin
Luc Pattyn22-Jan-10 11:32
sitebuilderLuc Pattyn22-Jan-10 11:32 
GeneralRe: how to split input integer variable Pin
#realJSOP22-Jan-10 12:46
professional#realJSOP22-Jan-10 12:46 
AnswerRe: how to split input integer variable [modified] Pin
#realJSOP23-Jan-10 2:16
professional#realJSOP23-Jan-10 2:16 
AnswerRe: how to split input integer variable Pin
#realJSOP23-Jan-10 5:04
professional#realJSOP23-Jan-10 5:04 
Questionget data from SSRS report Pin
Mohamed El-Wehishy22-Jan-10 7:20
Mohamed El-Wehishy22-Jan-10 7:20 
QuestionA Dialog bug (Edited) Pin
Muammar©22-Jan-10 7:04
Muammar©22-Jan-10 7:04 
AnswerRe: A Dialog bug (Edited) Pin
Som Shekhar22-Jan-10 7:20
Som Shekhar22-Jan-10 7:20 
GeneralRe: A Dialog bug (Edited) Pin
Muammar©22-Jan-10 20:10
Muammar©22-Jan-10 20:10 
GeneralRe: A Dialog bug (Edited) Pin
Som Shekhar22-Jan-10 20:16
Som Shekhar22-Jan-10 20:16 
AnswerRe: A Dialog bug (Edited) Pin
loyal ginger22-Jan-10 7:26
loyal ginger22-Jan-10 7:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.