Hi,
I've made a user control that has it's own Click Event. The control sits inside an items control
I can hook to this event in xaml/code behind as normal fine.
e.g.
I've tried setting the Action.TargetWithoutContext property to the context of the itemscontrol, the grid above it and the user control itself.
I've made a user control that has it's own Click Event. The control sits inside an items control
I can hook to this event in xaml/code behind as normal fine.
e.g.
<ItemsControl Grid.Column="1" Background="{x:Null}" Grid.Row="1" MaxHeight="40" VerticalAlignment="Top"
BorderBrush="{x:Null}"
Style="{DynamicResource NoticationsItemsControlStyle}"
IsTabStop="False"
ItemsSource="{Binding Notification, Mode=TwoWay}"
ScrollViewer.HorizontalScrollBarVisibility="Hidden">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Controls:NotificationItem Model="{Binding .}" Margin="0,0,0,10" Click="NotificationItem_Click"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
Using the message Attach syntax however doesn't seem to work as below:<ItemsControl Grid.Column="1" Background="{x:Null}" Grid.Row="1" MaxHeight="40" VerticalAlignment="Top"
BorderBrush="{x:Null}"
Style="{DynamicResource NoticationsItemsControlStyle}"
IsTabStop="False"
ItemsSource="{Binding Notification, Mode=TwoWay}"
ScrollViewer.HorizontalScrollBarVisibility="Hidden">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Controls:NotificationItem Model="{Binding .}" Margin="0,0,0,10" cal:Message.Attach="[Event Click] = [Action Test]"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
I'm having trouble with the Message.Attach - it doesn't seem to hook up to test method. So when they click my handler is null and never fires and never calls the test method.I've tried setting the Action.TargetWithoutContext property to the context of the itemscontrol, the grid above it and the user control itself.