Skip to content

Commit

Permalink
code clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
TysonMN committed Aug 15, 2021
1 parent 5a7ca03 commit 1bf4d28
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/Samples/Multiselect.Core/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ let main window =

WpfProgram.mkSimple init update bindings
|> WpfProgram.withLogger (new SerilogLoggerFactory(logger))
|> WpfProgram.startElmishLoop window
|> WpfProgram.startElmishLoop window
13 changes: 6 additions & 7 deletions src/Samples/Multiselect/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Window x:Class="Elmish.WPF.Samples.Multiselect.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="clr-namespace:Elmish.WPF.Samples.Multiselect;assembly=Multiselect.Core"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
Expand All @@ -12,20 +12,19 @@
mc:Ignorable="d"
d:DataContext="{x:Static vm:Program.designVm}">
<Window.Resources>
<ObjectDataProvider x:Key="dataFromEnum" MethodName="GetValues"
ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider x:Key="dataFromEnum" MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="SelectionMode"/>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
</Window.Resources>
<StackPanel Margin="0,15,0,0">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<Button Command="{Binding SelectRandom}" Margin="5 5" Width="100">Select random</Button>
<Button Command="{Binding Deselect}" Margin="5 5" Width="100">Deselect</Button>
<Button Command="{Binding SelectRandom}" Content="Select random" Margin="5 5" Width="100"/>
<Button Command="{Binding Deselect}" Content="Deselect" Margin="5 5" Width="100"/>
<ComboBox x:Name="SelectionModeComboBox" ItemsSource="{Binding Source={StaticResource dataFromEnum}}" SelectedIndex="2" />
</StackPanel>
<ListBox ItemsSource="{Binding Entities}" HorizontalContentAlignment="Center" SelectionMode="{Binding ElementName=SelectionModeComboBox, Path=SelectedItem}">
<ListBox ItemsSource="{Binding Entities}" SelectionMode="{Binding ElementName=SelectionModeComboBox, Path=SelectedItem}" HorizontalContentAlignment="Center">
<ListBox.Resources>
<Style TargetType="{x:Type ListBoxItem}" BasedOn="{StaticResource {x:Type ListBoxItem}}">
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
Expand All @@ -41,4 +40,4 @@
</ListBox.ItemTemplate>
</ListBox>
</StackPanel>
</Window>
</Window>

0 comments on commit 1bf4d28

Please sign in to comment.