Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <ListBox x:Name="listbox" ItemsSource="{Binding StringList}" SelectionMode="Multiple"/>
- <Button Command="{Binding GetListItemsCommand}" CommandParameter="{Binding SelectedItems, ElementName=listbox}" Content="GetSelectedListBoxItems"/>
- xmlns:i="http://schemas.microsoft.com/expression//2010/interactivity"
- xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
- <GridView x:Name="GridName">
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="SelectionChanged">
- <i:InvokeCommandAction Command="{Binding Datacontext.SelectionChangedCommand, ElementName=YourUserControlName}" CommandParameter="{Binding SelectedItems, ElementName=GridName}" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- public DelegateCommand<object> SelectionChangedCommand {get;set;}
- SelectionChangedCommand = new DelegateCommand<object> (items => {
- var itemList = (items as ObservableCollection<object>).Cast<YourDto>().ToList();
- }
- // Your goes heres
- // Your goes heres
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement