|
Sorry to "wake" a rather old thread to life, but I have a somewhat related question.
I have a TreeView almost like the above example (but no actual view models, just a simple class in this case). When I click an item in the TreeView, I want to know wich item I clicked and take action from there, but when I'm attaching
cal:Message.Attach="[Event SelectedItemChanged] = [Action Test($dataContext)]"
to my TreeView, the Action "Test" gets called but the parameter is always null.
This is my XAML for the treeview:
<TreeView ItemsSource="{Binding MyItems}" cal:Message.Attach="[Event SelectedItemChanged] = [Action Test($dataContext)]">
<TreeView.Resources>
<HierarchicalDataTemplate ItemsSource="{Binding Children}"
DataType="{x:Type CaliburnTest:MyClass}">
<TextBlock Text="{Binding Name}" />
</HierarchicalDataTemplate>
</TreeView.Resources>
</TreeView>
As I said, my "public void Test(MyClass myClass)..." get's called on my view model, but the parameter is null. Any ideas on how to solve this?
Thanks for a great framework btw!
//J
|