Can I change the binding source to another source in XAML?
- by No hay Problema
Hi guys,
I want to do a very simple thing, can you point me on the right direction?
I want to change the source in XAML to another object source, let me put you an example:
I have a Listview, bound to a "Model A", it has many properties, but one is called "Total". This property is not shown on the View
Each ListviewItem has its own source (ItemsSource), BUT, one of the fields should show "Total" from "Model A"
Caveat: I am implementing MVVM, so the "Model A" is assigned as a VM DataSource, XAML knows nothing about it.
So, in my perfect world the XAML should look like this:
<GridViewColumn Header="Total" Width="150">
<GridViewColumn.CellTemplate>
<DataTemplate>
<Label Content="{Binding Source=<The source of LISTVIEW> Path=Total}"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
I have tried RelativeSource but that points me to the XAML object, I want the source of it, is it possible?
Thanks