I have another one that I came across today that I thought would work, but didn't.
I'm using a DataGrid where the SelectedItem has a databinding to the ViewModel called SelectedLinkItem and it is working when each time I select a row, it definitely updates back to the ViewModel.
I'm using a RowDetailsTemplate with the following:
<DataTemplate x:Key="linkTemplate"><TextBox Text="{Binding AlternativeLink, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Margin="3" /><Button Grid.Column="1" Margin="3" Content="Link" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl}, Path=DataContext.NavBrowserCommand}" CommandParameter="{{Binding RelativeSource={RelativeSource AncestorType=UserControl}, Path=DataContext.SelectedLinkItem.AlternativeLink}" />
</DataTemplate>
Now the Command property is working and it definitely firing in the ViewModel by hitting a breakpoint within the NavBrowserCommand, but the CommandParameter is null, yet when I look at the SelectedLinkItem.AlternativeLink, it definitely has the correct URL.
So why is it that the URL string not being passed?
The reason why I am going through this route is that I'm going to be adding in more Links (like Link1, Link2, Link3, etc) but I want to use one ICommand to spawn off the link to a browser.
I also planning on doing something else within the RowDetailsTemplate, but the values will not be supplied by the DataGrid, and instead will come from the databindings from the ViewModel.
So all you gurus.... any idea on what I am doing wrong?? :-D