Hey guys,
I am thinking of taking a shot at rewriting MultiBinding for Silverlight (it’s not currently available). Before I dive into Reflector, did any one of you guys already do this?
Cheers,
Laurent
--
Laurent Bugnion [Microsoft MVP, MCP]
Software engineering, Blog: http://www.galasoft.ch
PhotoAlbum: http://www.galasoft.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Just wondering…
In a M-V-VM world, do we really need MultiBinding?
-Corrado
I'm as big a proponent of MVVM as anyone, but there are some things I can do in a view using a multibinding that I just wouldn't want to give up. Very often, these are purely view specific tasks (e.g., numbering items presented in an ItemsControl) where I do not want to impose any extra requirements on the VM.
Quoting "wpf-di...@googlegroups.com"
<wpf-di...@googlegroups.com>:
> Just wondering.
>
> In a M-V-VM world, do we really need MultiBinding?
>
>
>
> -Corrado
>
>
>
> From: wpf-di...@googlegroups.com
[mailto:wpf-di...@googlegroups.com]
> On Behalf Of Laurent Bugnion,
GalaSoft [MVP, MCP]
> Sent: sabato 14 febbraio 2009 22:00
> To:
wpf-di...@googlegroups.com
> Subject: [WPF Disciples] MultiBinding
and IMultiValueConverter in
> Silverlight?
>
>
>
> Hey guys,
>
>
>
> I am
thinking of taking a shot at rewriting MultiBinding for Silverlight
>
(it's not currently available). Before I dive into Reflector, did any one of
> you guys already do this?
>
>
>
>
Cheers,
>
> Laurent
>
> --
>
>
Laurent Bugnion [Microsoft MVP, MCP]
>
> Software engineering, Blog: <http://www.galasoft.ch/>
> http://www.galasoft.ch
>
> PhotoAlbum: <http://www.galasoft.ch/pictures>
> http://www.galasoft.ch/pictures
>
> Support
children in Calcutta: <http://www.calcutta-espoir.ch/>
> http://www.calcutta-espoir.ch
>
>
>
>
>
Dr. WPF - Online Office at http://www.drwpf.com/blog/
Makes sense (as usual… J)
but if I should implement it myself I’d stick with VM implementation, if its inside the VM, it’s easier to test.
-Corrado
From: wpf-di...@googlegroups.com [mailto:wpf-di...@googlegroups.com] On Behalf Of Dr. WPF
Sent: domenica 15 febbraio 2009 09:58
To: wpf-di...@googlegroups.com
Subject: [WPF Disciples] Re: MultiBinding and IMultiValueConverter inSilverlight?
I'm as big a proponent of MVVM as anyone, but there are some things I can do in a view using a multibinding that I just wouldn't want to give up. Very often, these are purely view specific tasks (e.g., numbering items presented in an ItemsControl) where I do not want to impose any extra requirements on the VM.
Quoting "wpf-di...@googlegroups.com"
<wpf-di...@googlegroups.com>:
> Just wondering.
>
> In a M-V-VM world, do we really need MultiBinding?
>
>
>
> -Corrado
>
>
>
> From: wpf-di...@googlegroups.com
[mailto:wpf-di...@googlegroups.com]
> On Behalf Of Laurent Bugnion, GalaSoft [MVP, MCP]
> Sent: sabato 14 febbraio 2009 22:00
> To: wpf-di...@googlegroups.com
> Subject: [WPF Disciples] MultiBinding and IMultiValueConverter in
> Silverlight?
>
>
>
> Hey guys,
>
>
>
> I am thinking of taking a shot at rewriting MultiBinding for Silverlight
> (it's not currently available). Before I dive into Reflector, did any one
of
> you guys already do this?
>
>
>
> Cheers,
>
> Laurent
>
> --
>
> Laurent Bugnion [Microsoft MVP, MCP]
>
> Software engineering, Blog: <http://www.galasoft.ch/>
> http://www.galasoft.ch
>
> PhotoAlbum: <http://www.galasoft.ch/pictures>
> http://www.galasoft.ch/pictures
>
> Support children in Calcutta: <http://www.calcutta-espoir.ch/>
> http://www.calcutta-espoir.ch
>
>
>
>
>
Hey Corrado,
I rarely use MultiBinding, but there is one case where I find them really useful: When I need to bring an instance of a UI Element in the code. The real life example I have in mind is this (in fact it’s funny we talk about it, because I have a blog post half written about this. Credits due to the Doc, who showed me this one day in 2007…)
The problem is when you want to apply a resource to an element based on a value. For example, you want to apply a Brush to a Border in a ListBox, depending on the value of a Customer account. If the account is in the 0 – 1000 range, choose a red-ish brush, 1001-2000 orange-ish brush, 2001-3000 Green-ish brush, etc…
I can do the conversion purely in the VM, I have the problem of finding the resource. Usually, the best way (from an integrator’s perspective) is to use TryFindResource, because it allows me to move the resources without altering the code. I am a big fan of TryFindResource, because it allows easy resource refactoring. I cannot count the times where I had to move a resource from a UserControl (for example) into a ResourceDictionary.
So now I am left with a problem: How do I access the UIElement on which I want to call TryFindResource. If I do this in the VM, I need a reference to a View element in the VM, and I try to avoid this if possible. The alternative is using the MultiBinding and a IMultiValuerConverter. If the first binding in the MultiBinding is set to the UIElement itself (using RelativeSource Self), then I can call TryFindResource on it based on the second value in the MultiBinding (for example the Account number).
How would you handle the cases (and there are some others than mentioned here) where you need a reference to a View element in the VM?
Thanks,
Laurent
No virus
found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.0.233 / Virus Database: 270.10.23/1952 - Release Date: 02/13/09
18:29:00
Hey Laurent,
What’s wrong with this?
<Grid>
<Grid.Resources>
<SolidColorBrush x:Key="YellowBrush" Color="Yellow" />
<SolidColorBrush x:Key="RedBrush" Color="Red" />
<SolidColorBrush x:Key="BlueBrush" Color="Blue" />
</Grid.Resources>
<Border BorderThickness="2">
<Border.Style>
<Style TargetType="{x:Type Border}">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=CustomerThreshold}" Value="0">
<Setter Property="BorderBrush" Value="{StaticResource YellowBrush}" />
</DataTrigger>
<DataTrigger Binding="{Binding Path=CustomerThreshold}" Value="1">
<Setter Property="BorderBrush" Value="{StaticResource RedBrush}" />
</DataTrigger>
<DataTrigger Binding="{Binding Path=CustomerThreshold}" Value="2">
<Setter Property="BorderBrush" Value="{StaticResource BlueBrush}" />
</DataTrigger>
</Style.Triggers>
</Style>
</Border.Style>
<ListBox />
</Border>
</Grid>
Of course CustomerThreshold is a property of my ViewModel that drives border color
>How would you handle the cases (and there are some others than mentioned here) where you need a reference to a View element in the VM?
In case I need it I’d probably pass a reference to the view on ViewModel constructor.
-Corrado
From: wpf-di...@googlegroups.com [mailto:wpf-di...@googlegroups.com] On Behalf Of Laurent Bugnion, GalaSoft [MVP, MCP]
Sent: domenica 15 febbraio 2009 10:24
To: wpf-di...@googlegroups.com
Subject: [WPF Disciples] Re: MultiBinding and IMultiValueConverter in Silverlight?
Hey Corrado,
I rarely use MultiBinding, but there is one case where I find them really useful: When I need to bring an instance of a UI Element in the code. The real life example I have in mind is this (in fact it’s funny we talk about it, because I have a blog post half written about this. Credits due to the Doc, who showed me this one day in 2007…)
The problem is when you want to apply a resource to an element based on a value. For example, you want to apply a Brush to a Border in a ListBox, depending on the value of a Customer account. If the account is in the 0 – 1000 range, choose a red-ish brush, 1001-2000 orange-ish brush, 2001-3000 Green-ish brush, etc…
I can do the conversion purely in the VM, I have the problem of finding the resource. Usually, the best way (from an integrator’s perspective) is to use TryFindResource, because it allows me to move the resources without altering the code. I am a big fan of TryFindResource, because it allows easy resource refactoring. I cannot count the times where I had to move a resource from a UserControl (for example) into a ResourceDictionary.
So now I am left with a problem: How do I access the UIElement on which I want to call TryFindResource. If I do this in the VM, I need a reference to a View element in the VM, and I try to avoid this if possible. The alternative is using the MultiBinding and a IMultiValuerConverter. If the first binding in the MultiBinding is set to the UIElement itself (using RelativeSource Self), then I can call TryFindResource on it based on the second value in the MultiBinding (for example the Account number).
How would you handle the cases (and there are some others than mentioned here) where you need a reference to a View element in the VM?
Thanks,
Laurent
From: wpf-di...@googlegroups.com [mailto:wpf-di...@googlegroups.com] On Behalf Of Corrado Cavalli
Sent: Sunday, February 15, 2009 8:13 AM
No virus found in this incoming message.
That could actually work. Let me check it in my sample application and
ponder about this. Man I am not sure how people were ever solving
programming problems before the internet...
That leaves us with the issue that it doesn't work in Silverlight, but
neither does my MultiBinding solution. Starting to wonder if I can do
something with VSM to solve that issue in Silverlight...
Thanks,
Laurent
Hey Laurent,
<Grid>
<Grid.Resources>
</Grid.Resources>
<Border BorderThickness="2">
<Border.Style>
<Style.Triggers>
</DataTrigger>
</DataTrigger>
</DataTrigger>
</Style.Triggers>
</Style>
</Border.Style>
<ListBox />
</Border>
</Grid>
-Corrado
Hey Corrado,
Credits due to the Doc, who showed me this one day in 2007.)
The problem is when you want to apply a resource to an element based on
a value. For example, you want to apply a Brush to a Border in a
ListBox, depending on the value of a Customer account. If the account is
in the 0 - 1000 range, choose a red-ish brush, 1001-2000 orange-ish
brush, 2001-3000 Green-ish brush, etc.
Thanks,
Laurent
Just wondering.
In a M-V-VM world, do we really need MultiBinding?
-Corrado
From: wpf-di...@googlegroups.com
[mailto:wpf-di...@googlegroups.com] On Behalf Of Laurent Bugnion,
GalaSoft [MVP, MCP]
Sent: sabato 14 febbraio 2009 22:00
To: wpf-di...@googlegroups.com
Subject: [WPF Disciples] MultiBinding and IMultiValueConverter in
Silverlight?
Hey guys,
I am thinking of taking a shot at rewriting MultiBinding for Silverlight
(it's not currently available). Before I dive into Reflector, did any
one of you guys already do this?
Cheers,
Laurent
--
Laurent Bugnion [Microsoft MVP, MCP]
Software engineering, Blog: http://www.galasoft.ch
PhotoAlbum: http://www.galasoft.ch/pictures
<http://www.galasoft.ch/pictures>
Support children in Calcutta: http://www.calcutta-espoir.ch
<http://www.calcutta-espoir.ch/>
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.0.233 / Virus Database: 270.10.23/1952 - Release Date:
02/13/09 18:29:00
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.0.237 / Virus Database: 270.10.23/1953 - Release Date: 02/14/09
18:01:00
-Corrado
-----Original Message-----
From: wpf-di...@googlegroups.com [mailto:wpf-di...@googlegroups.com]
On Behalf Of Laurent Bugnion, GalaSoft [MVP, MCP]
Sent: domenica 15 febbraio 2009 13:21
To: wpf-di...@googlegroups.com
Subject: [WPF Disciples] Re: MultiBinding and IMultiValueConverter in
Silverlight?
Hey Corrado,
That could actually work. Let me check it in my sample application and
ponder about this. Man I am not sure how people were ever solving
programming problems before the internet...
That leaves us with the issue that it doesn't work in Silverlight, but
neither does my MultiBinding solution. Starting to wonder if I can do
something with VSM to solve that issue in Silverlight...
Thanks,
Laurent
Hey Laurent,
<Grid>
<Grid.Resources>
</Grid.Resources>
<Border BorderThickness="2">
<Border.Style>
<Style.Triggers>
</DataTrigger>
</DataTrigger>
</DataTrigger>
</Style.Triggers>
</Style>
</Border.Style>
<ListBox />
</Border>
</Grid>
-Corrado
Hey Corrado,
Credits due to the Doc, who showed me this one day in 2007.)
The problem is when you want to apply a resource to an element based on
a value. For example, you want to apply a Brush to a Border in a
ListBox, depending on the value of a Customer account. If the account is
in the 0 - 1000 range, choose a red-ish brush, 1001-2000 orange-ish
brush, 2001-3000 Green-ish brush, etc.
Thanks,
Laurent
Just wondering.
In a M-V-VM world, do we really need MultiBinding?
-Corrado
From: wpf-di...@googlegroups.com
[mailto:wpf-di...@googlegroups.com] On Behalf Of Laurent Bugnion,
GalaSoft [MVP, MCP]
Sent: sabato 14 febbraio 2009 22:00
To: wpf-di...@googlegroups.com
Subject: [WPF Disciples] MultiBinding and IMultiValueConverter in
Silverlight?
Hey guys,
I am thinking of taking a shot at rewriting MultiBinding for Silverlight
(it's not currently available). Before I dive into Reflector, did any
one of you guys already do this?
Cheers,
Laurent
--
Laurent Bugnion [Microsoft MVP, MCP]
Software engineering, Blog: http://www.galasoft.ch
PhotoAlbum: http://www.galasoft.ch/pictures
<http://www.galasoft.ch/pictures>
Support children in Calcutta: http://www.calcutta-espoir.ch
<http://www.calcutta-espoir.ch/>
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.0.233 / Virus Database: 270.10.23/1952 - Release Date:
02/13/09 18:29:00
No virus found in this incoming message.
Checked by AVG - www.avg.com
Sure, a few months ago someone asked me how to change textbox background based on two different variables and MultiBinding did the trick! J
http://blogs.ugidotnet.org/corrado/archive/2008/07/11/93368.aspx
From: wpf-di...@googlegroups.com
[mailto:wpf-di...@googlegroups.com] On Behalf Of Eric Burke
Sent: domenica 15 febbraio 2009 15:04
To: wpf-di...@googlegroups.com
Subject: [WPF Disciples] Re: MultiBinding and IMultiValueConverter in
Silverlight?
We use this technique heavily in Yahoo! Messenger. Most often it's like this case where you pass in the item you're going to operate on, and then other value(s) that might have to participate in the operation.
I am busy writing a comparison of MultiBinding vs DataTrigger. Can’t say I really can favor one or the other in the moment. Both have interesting features. More to follow ;)
Laurent,
Can you share a concise sample where you have used this technique and felt
there was no workaround?? (off-line is fine if you can’t share publicly).
If feels that you have UI that could have been driven with viewmodel. Rather
then you pushing values to the UIElements, the UIElements should be picking state
from the ViewModel and then locating the resources (via triggers?) based on
these values? I am guessing other scenarios could be more complicated?
Corrado, I think you have a point that Multibinding usage is less when you have a viewmodel, but I think there are still scenarios where Multibinding is warranted. I use Multibinding seldomly, but do use it. from looking at a few apps, I think a recurrent scenario is that I do not like to replicate properties in the view model for no reason. Simplest one is First + LastName.. In ViewModel, these are separate because I need them that way, but sometimes the view wants to display it together .. I could add an extra property in VM to hold FullName, but then I end up with say 3 variations of this ( middlename, middle initial, etc.. ) so I let MultiBinding do its magic and create a reusable MultiValue converter to do the work.. The logic is still in the converter (not so much in the view). Keeping atomicity on the data is important to me (seems to bite me often).. Pavan’s scenario seems valid and interesting too.. I am sure there are a few others …
Cheers,
About your SouthRidge demo: Do you have an idea why if i load it
in VS2008 and double click main view xaml file, my VS2008 closes
without any message? (Blends opens it fine...)
-Corrado
On Mon Feb 16 01:41:40 CST 2009, Jaime Rodriguez
<jai...@microsoft.com> wrote:
> Laurent,
>
> Can you share a concise sample where you have used this technique
> and felt there was no workaround?? (off-line is fine if you
> can?t share publicly).
> If feels that you have UI that could have been driven with
> viewmodel. Rather then you pushing values to the UIElements, the
> UIElements should be picking state from the ViewModel and then
> locating the resources (via triggers?) based on these values?
> I am guessing other scenarios could be more complicated?
>
> Corrado, I think you have a point that Multibinding usage is less
> when you have a viewmodel, but I think there are still scenarios
> where Multibinding is warranted. I use Multibinding seldomly,
> but do use it. from looking at a few apps, I think a recurrent
> scenario is that I do not like to replicate properties in the
> view model for no reason. Simplest one is First + LastName..
> In ViewModel, these are separate because I need them that way,
> but sometimes the view wants to display it together .. I could
> add an extra property in VM to hold FullName, but then I end up
> with say 3 variations of this ( middlename, middle initial, etc..
> ) so I let MultiBinding do its magic and create a reusable
> MultiValue converter to do the work.. The logic is still in the
> converter (not so much in the view). Keeping atomicity on the
> data is important to me (seems to bite me often).. Pavan?s
> scenario seems valid and interesting too.. I am sure there are a
> few others ?
>
> Cheers,
>
>
>
>
> From: wpf-di...@googlegroups.com
> [mailto:wpf-di...@googlegroups.com] On Behalf Of Eric Burke
> Sent: Sunday, February 15, 2009 6:04 AM
> To: wpf-di...@googlegroups.com
> Subject: [WPF Disciples] Re: MultiBinding and
> IMultiValueConverter in Silverlight?
>
> We use this technique heavily in Yahoo! Messenger. Most often
> it's like this case where you pass in the item you're going to
> operate on, and then other value(s) that might have to
> participate in the operation.
>
> ________________________________
> From: "Laurent Bugnion, GalaSoft [MVP, MCP]"
> <lau...@galasoft.ch>
> To: wpf-di...@googlegroups.com
> Sent: Sunday, February 15, 2009 4:23:33 AM
> Subject: [WPF Disciples] Re: MultiBinding and
> IMultiValueConverter in Silverlight?
> Hey Corrado,
>
> I rarely use MultiBinding, but there is one case where I find
> them really useful: When I need to bring an instance of a UI
> Element in the code. The real life example I have in mind is this
> (in fact it?s funny we talk about it, because I have a blog post
> half written about this. Credits due to the Doc, who showed me
> this one day in 2007?)
>
> The problem is when you want to apply a resource to an element
> based on a value. For example, you want to apply a Brush to a
> Border in a ListBox, depending on the value of a Customer
> account. If the account is in the 0 ? 1000 range, choose a
> red-ish brush, 1001-2000 orange-ish brush, 2001-3000 Green-ish
> brush, etc?
>
> I can do the conversion purely in the VM, I have the problem of
> finding the resource. Usually, the best way (from an integrator?s
> Just wondering?
> In a M-V-VM world, do we really need MultiBinding?
>
> -Corrado
>
> From: wpf-di...@googlegroups.com
> [mailto:wpf-di...@googlegroups.com] On Behalf Of Laurent
> Bugnion, GalaSoft [MVP, MCP]
> Sent: sabato 14 febbraio 2009 22:00
> To: wpf-di...@googlegroups.com
> Subject: [WPF Disciples] MultiBinding and IMultiValueConverter in
> Silverlight?
>
> Hey guys,
>
> I am thinking of taking a shot at rewriting MultiBinding for
> Silverlight (it?s not currently available). Before I dive into
> Reflector, did any one of you guys already do this?
>
> Cheers,
> Laurent
> --
> Laurent Bugnion [Microsoft MVP, MCP]
> Software engineering, Blog:
> http://www.galasoft.ch<http://www.galasoft.ch/>
> PhotoAlbum: http://www.galasoft.ch/pictures
> Support children in Calcutta:
> http://www.calcutta-espoir.ch<http://www.calcutta-espoir.ch/>
>
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com<http://www.avg.com/>
Hi Jaime,
Before I start, I sent you an email regarding MIX, did you get it?
As I replied to Corrado, I think that the DataTrigger solution he proposes can solve that problem. I have written a sample application using both techniques and trying to compare advantages and inconveniencies of both. I intend to blog that right after I publish part two of my IsSynchronizedWithCurrentItem post.
My first impression is that both solutions are non-perfect. The DataTrigger solution is more verbose (since it is mostly implemented in XAML), which is annoying especially if you use the same logic in multiple place. Also, if you need to add values (to an enum, for example) or ranges (in the Threshold model we were discussing), you need to modify multiple places in the XAML, while in the best case you don’t need to modify the Converter at all (and in the worst case, your changes will be localized to one class only). With the Converter, you simply reuse the same class in multiple places, which reduces the amount of code that needs to be maintained. However, as you mention, the Converter solution is a hybrid View/ViewModel, and is less “clean”.
I also compared the testability of both solutions. Unit testing a IMultiValueConverter is possible, but is a bit awkward because you start unit testing view logic, which is always a bit weird and which I try to avoid. Unit testing the ViewModel is easy and well known, no surprises there (but it doesn’t test the view logic at all, and you cannot verify that the resource will indeed be found. This is typical of WPF where bindings written in XAML cannot be unit tested, but I never saw this being an issue in the real world).
If we want to push to the extreme, the Converter solution answers better to the SOLID principles (the Converter has one purpose only, which is to convert, and thus has less reasons to change than a multi purpose ViewModel class ;) Thankfully I am pragmatic and will not judge the solutions based on that. After all, we can argue that keeping the ViewModel logic in the ViewModel makes more sense than starting to involve converters.
About your comment that I am “pushing” the values to the view, I don’t feel this way. After all, the MultiBinding is in XAML, same as the DataTrigger, so the action is started by the View in both cases. As I mentioned, the Converter in this case is a hybrid View/ViewModel, which is less clean, but I can live with that.
In short: It’s a bit hard to decide for one solution or the other. I will probably recommend the DataTrigger solution in my blog post, due to the fact that it’s more in line with the ViewModel pattern.
And as a conclusion, none of these solutions work in Silverlight…
Cheers,
Laurent
Blend also doesn't support data triggers, so we are forced to work in XAML
editor anyway here... or did I miss something?
Cheers,
Laurent
-Corrado
Version: 8.0.237 / Virus Database: 270.10.23/1953 - Release Date: 02/15/09
18:09:00
-Corrado
On Mon Feb 16 03:16:19 CST 2009, "Laurent Bugnion, GalaSoft [MVP,
Since we are on the topic of localization, one of the swiss WPF developers I know came up with what I think is a good solution
http://www.wpftutorial.net/Localisation.html
Cheers,
Laurent
Version: 8.0.237 / Virus Database: 270.10.24/1954 - Release Date: 02/15/09 18:09:00
-Corrado
On Mon Feb 16 09:31:48 CST 2009, Josh Smith
<flappl...@gmail.com> wrote:
> I especially like his trick that maps into the standard default
> xml
> namespace. Very clever! :)
>
> On Mon, Feb 16, 2009 at 10:20 AM, Laurent Bugnion, GalaSoft [MVP,
> MCP]
> <lau...@galasoft.ch> wrote:
>
>> Since we are on the topic of localization, one of the swiss WPF
>> developers I know came up with what I think is a good solution
>>
>>
>>
>> http://www.wpftutorial.net/Localisation.html
>>
>>
>>
>> Cheers,
>>
>> Laurent
>>
>>
>>
>> *From:* wpf-di...@googlegroups.com [mailto:
>> wpf-di...@googlegroups.com] *On Behalf Of *Josh Smith
>> *Sent:* Monday, February 16, 2009 3:58 PM
>>
>> *To:* wpf-di...@googlegroups.com
>> *Subject:* [WPF Disciples] Re: MultiBinding and
>> ------------------------------
>>
>> *From:* Jaime Rodriguez <jai...@microsoft.com>
>> *To:* "wpf-di...@googlegroups.com"
>> <wpf-di...@googlegroups.com>
>> *Sent:* Monday, February 16, 2009 2:41:40 AM
>>
>>
>> *Subject:* [WPF Disciples] Re: MultiBinding and
>> others ?
>>
>>
>>
>> Cheers,
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> *From:* wpf-di...@googlegroups.com [mailto:
>> wpf-di...@googlegroups.com] *On Behalf Of *Eric Burke
>> *Sent:* Sunday, February 15, 2009 6:04 AM
>> *To:* wpf-di...@googlegroups.com
>> *Subject:* [WPF Disciples] Re: MultiBinding and
>> IMultiValueConverter in
>> Silverlight?
>>
>>
>>
>> We use this technique heavily in Yahoo! Messenger. Most often
>> it's like
>> this case where you pass in the item you're going to operate on,
>> and then
>> other value(s) that might have to participate in the operation.
>>
>>
>> ------------------------------
>>
>> *From:* "Laurent Bugnion, GalaSoft [MVP, MCP]"
>> <lau...@galasoft.ch>
>> *To:* wpf-di...@googlegroups.com
>> *Sent:* Sunday, February 15, 2009 4:23:33 AM
>> *Subject:* [WPF Disciples] Re: MultiBinding and
>> IMultiValueConverter in
>> Silverlight?
>>
>> Hey Corrado,
>>
>>
>>
>> I rarely use MultiBinding, but there is one case where I find
>> them really
>> useful: When I need to bring an instance of a UI Element in the
>> code. The
>> real life example I have in mind is this (in fact it's funny we
>> talk about
>> it, because I have a blog post half written about this. Credits
>> due to the
>> Doc, who showed me this one day in 2007?)
>>
>>
>>
>> The problem is when you want to apply a resource to an element
>> based on a
>> value. For example, you want to apply a Brush to a Border in a
>> ListBox,
>> depending on the value of a Customer account. If the account is
>> in the 0 ?
>> 1000 range, choose a red-ish brush, 1001-2000 orange-ish brush,
>> 2001-3000
>> Green-ish brush, etc?
>> *From:* wpf-di...@googlegroups.com [mailto:
>> wpf-di...@googlegroups.com] *On Behalf Of *Corrado Cavalli
>> *Sent:* Sunday, February 15, 2009 8:13 AM
>> *To:* wpf-di...@googlegroups.com
>> *Subject:* [WPF Disciples] Re: MultiBinding and
>> IMultiValueConverter in
>> Silverlight?
>>
>>
>>
>> Just wondering?
>>
>> In a M-V-VM world, do we really need MultiBinding?
>>
>>
>>
>> -Corrado
>>
>>
>>
>> *From:* wpf-di...@googlegroups.com [mailto:
>> wpf-di...@googlegroups.com] *On Behalf Of *Laurent Bugnion,
>> GalaSoft
>> [MVP, MCP]
>> *Sent:* sabato 14 febbraio 2009 22:00
>> *To:* wpf-di...@googlegroups.com
>> *Subject:* [WPF Disciples] MultiBinding and IMultiValueConverter