|
<UserControl x:Class="Slex.Lib.Demo.Views.Demos.InvokeCommand"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:slex="clr-namespace:Slex.Lib.Interactions;assembly=Slex.Lib"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">
<Grid x:Name="LayoutRoot">
<i:Interaction.Triggers>
<slex:EventTrigger ElementName="userList" EventName="SelectionChanged">
<slex:InvokeCommandAction CommandName="UpdateUserCommand">
<slex:ActionParameters>
<slex:ActionParameter ElementName="userList" Property="SelectedItem"/>
</slex:ActionParameters>
</slex:InvokeCommandAction>
</slex:EventTrigger>
</i:Interaction.Triggers>
<StackPanel>
<ListBox ItemsSource="{Binding Users}" Name="userList">
</ListBox>
<TextBlock Text="{Binding Data}" Margin="3"/>
</StackPanel>
</Grid>
</UserControl>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Architect, Developer, Speaker | Wannabe GUT inventor & Data Scientist | Microsoft MVP in C#