Not quite sure an "e.Handled = true" concept in messenger makes sense since the messages are going to be propogated in a random/arbitrary/indeterminate order. Its really up to the subscriber to determine if the message should be handled. Your "e.Handled = true" concept might just mean that somebody handled it and its up to the subcriber to play nice and check the flag. A lot of messenger implementations fire & forget the notifications in async mode too. Then it makes even less sense.
Now that I'v had a few days to thin about it, the subscriber should pass in it's id to the control Init. Could be a PK or a guid. If there are 3 tabs open, each instance of control would be intiailized with a different id.
Then, each subsequent call would have that Id passed with it. Then control's methods would only act if the Id passed in the message matches that sent in the 'init' method.
That's about how I would do it - although pass a reference to the object rather than just an Id - you then have the advantage of being able to access the object in question from your consumer.
Send Message - "I've just updated this Customer"
Receive Message - do nothing - not interested in this customer
Receive Message - update my list of customers as the value in the CustomerType property matches my filtering criteria.
Receive Message - I'm displaying this actual customer - so I'll refresh myself
the 'handled' approach can be useful; my example is selecting a customer to edit from a list.
If an existing customer edit view is out there, in a 'clean' state, it can take over the job of editing the selected customer - but you don't want another view to do the same thing too!
I have a tab control with two tabs in it,in each tab i have text boxes, the data of the text boxes is being validated using the IDataErrorInfo interface.
If there is an invalid data i am rendering a red ellipsis and a tool tip box using this XAML code:
<!--The template which renders a TextBox when it contains invalid data.-->
<ControlTemplatex:Key="TextBoxErrorTemplate"><DockPanel><EllipseDockPanel.Dock="Right"Margin="2,0"ToolTip="Contains invalid data"Width="10"Height="10"><Ellipse.Fill><LinearGradientBrush><GradientStopColor="#11FF1111"Offset="0"/><GradientStopColor="#FFFF0000"Offset="1"/></LinearGradientBrush></Ellipse.Fill></Ellipse>
<!--This placeholder occupies where the TextBox will appear.-->
Text box XAML:
<!--ID text box-->
The problem is when i go to another tab and then come back again the red Ellipses are disappear.
Help any one?
Last Visit: 31-Dec-99 19:00 Last Update: 29-Nov-15 11:49