NEW FEATURE: Channel Triggers

99 views
Skip to first unread message

Rishi Oberoi

unread,
Feb 3, 2011, 7:00:55 AM2/3/11
to nro...@googlegroups.com
One latest feature added to nRoute are so-called "Channel Triggers" - as I am sure you guys know nRoute's messaging framework is based on a mediator pattern that uses IObservable based channels through which you can do "decoupled communication" though-out your application. And so these channel trigger basically allow you to observe channels from within the view, and when invoked they allow you to effect one or more changes again to the view. These triggers work just like any other, you pair it up with one or more actions:
                	<i:Interaction.Triggers>
                 <n:ChannelTrigger ChannelType="{x:Type system:String}">
                 <ei:ChangePropertyAction PropertyName="Foreground" Value="Red"/>
                 </n:ChannelTrigger>
                 </i:Interaction.Triggers>
So above the channel trigger listens to IChannel<string> and if anything comes through it changes the foreground property to color Red. Note, in case you want to listen to a private channel just specify the ChannelKey property, and secondly any passed-in value (like "Hello World" below) is directly passed onto to all the rigged Trigger-Actions. 

On the sender's/publisher's end, you use the channel as usual:

            Channel<string>.Public.OnNext("Hello World");

            // or
            var _channel = ResourceLocator.GetResource<IChannel<string>>();
            _channel.OnNext("Hello World");

This is a relative simple new feature, but I think it's also very powerful - as you can now in a totally disconnected way effect changes to the any view from any nook or corner of your application.  

Cheers,
Rishi

Adrian Hara

unread,
Feb 3, 2011, 8:17:08 AM2/3/11
to nro...@googlegroups.com

Hey Rishi,

 

I’ve a somewhat general question. In light of all these cool features (btw, might be cool to have a NullOrStringEmptyXXXBehavior in there J), how stable is the codeplex code? Can I feel safe to take it and use it in production? Or should I wait for an “official release”?

 

Otherwise, thanks for all the improvements, I’m sure once I start using them I won’t be able to live without them anymore ;)

 

Cheers,

Adi

 

Freundliche Grüsse / Best regards

Adrian Hara
Cloud Developer
LinkedIn 


coresystems ag
Villa im Park | Dorfstrasse 69
5210 Windisch | Switzerland


Phone +41 56 500 22 22
Fax +41 56 444 20 50
Infoline +41 848 088 088
www.coresystems.ch
www.coresuite.com
follow us on
twitter

Visit us at CeBIT:
SAP Partner Booth: Hall 5, Booth A18
Cloud Computing: Hall 4, Booth A58
OS X Business Park: Hall 2, Booth A20
Microsoft Booth: Hall 4, Booth P47

The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and / or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.

Rishi Oberoi

unread,
Feb 3, 2011, 5:24:15 PM2/3/11
to nro...@googlegroups.com
I don't think it's ready for production use - though if you are in development with two/three months to spare, then using this shouldn't be a problem - especially as I'm, one, using it to on a in-development project and, two, I try to check-in features in chunks whilst ensuring I don't break the build. However, if you choose to use it, be aware it does/will introduce breaking changes.

Rishi

Gerhard Kreuzer

unread,
Feb 3, 2011, 6:03:13 PM2/3/11
to nro...@googlegroups.com
Hi Rishi,
 
just read the post. Ok, so I will plan to start with it in about 5 month or so. Then, breaking new features should be mostly done ....
 
With best regards
 
Gerhard


Von: nro...@googlegroups.com [mailto:nro...@googlegroups.com] Im Auftrag von Rishi Oberoi
Gesendet: Donnerstag, 03. Februar 2011 23:24
An: nro...@googlegroups.com
Betreff: Re: RE: [nRoute] NEW FEATURE: Channel Triggers

Rishi Oberoi

unread,
Feb 3, 2011, 6:13:48 PM2/3/11
to nro...@googlegroups.com
Definitely, I plan to be finished before the end of this month - and then have a little gestation (aka testing) period before releasing it. 
Rishi 

Rishi Oberoi

unread,
Feb 3, 2011, 6:21:53 PM2/3/11
to nro...@googlegroups.com
BTW Adrian, I think we can skip NullOrStringEmptyXXXBehavior because we can use NullOrEmptySourceXXXBehaviour for string values - well, because a string type is an IEnumerable<char>. Though off head I can't speak to the performance advantage/disadvantage of using IEnumerable as opposed IsNullOrEmpty methods to check for nullability/emptiness. 

Rishi

Gerhard Kreuzer

unread,
Feb 4, 2011, 1:12:15 AM2/4/11
to nro...@googlegroups.com
Hi Rishi,
 
is there a temporary download available, I will try to check this version out ...
Thanks
 
With best regards
 
Gerhard
 
PS: nRoute is on top of my list for navigation tasks


Von: nro...@googlegroups.com [mailto:nro...@googlegroups.com] Im Auftrag von Rishi Oberoi
Gesendet: Freitag, 04. Februar 2011 00:14
An: nro...@googlegroups.com
Betreff: Re: AW: RE: [nRoute] NEW FEATURE: Channel Triggers

Gerhard Kreuzer

unread,
Feb 4, 2011, 5:14:46 AM2/4/11
to nro...@googlegroups.com
Hi,
 
do you have any new examples, or parts of examples or something that shows the new features?
I know, you working hard, so please don't hurry.
 
Is there more documentation about NavigationContainers, than online today?
 
With best regards
 
Gerhard


Von: nro...@googlegroups.com [mailto:nro...@googlegroups.com] Im Auftrag von Rishi Oberoi
Gesendet: Freitag, 04. Februar 2011 00:22
An: nro...@googlegroups.com
Betreff: Re: RE: [nRoute] NEW FEATURE: Channel Triggers

Rishi Oberoi

unread,
Feb 4, 2011, 4:17:36 PM2/4/11
to Gerhard Kreuzer, nro...@googlegroups.com
Yes, you can get hold of the latest source from the repository  at http://nroute.codeplex.com - it should be under a folder called nroute5.

Cheers,
Rishi

From: Gerhard Kreuzer
Sent: Friday, 4 February 2011 9:12 AM
To: nro...@googlegroups.com
Subject: AW: AW: RE: [nRoute] NEW FEATURE: Channel Triggers

Hi Rishi,
 
is there a temporary download available, I will try to check this version out ...
Thanks
 
With best regards
 
Gerhard
 
PS: nRoute is on top of my list for navigation tasks

Von: nro...@googlegroups.com [mailto:nro...@googlegroups.com] Im Auftrag von Rishi Oberoi
Gesendet: Freitag, 04. Februar 2011 00:14
An: nro...@googlegroups.com
Betreff: Re: AW: RE: [nRoute] NEW FEATURE: Channel Triggers

Rishi Oberoi

unread,
Feb 5, 2011, 8:43:37 AM2/5/11
to nro...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages