|
5 | 5 | xmlns:conv="clr-namespace:TicketLottery.Converters" |
6 | 6 | xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
7 | 7 | xmlns:dgx="urn:tom-englert.de/DataGridExtensions" |
| 8 | + xmlns:enum="clr-namespace:TicketLottery.Enums" |
8 | 9 | xmlns:i="http://schemas.microsoft.com/xaml/behaviors" |
9 | 10 | xmlns:local="clr-namespace:TicketLottery" |
10 | 11 | xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
11 | 12 | xmlns:md="http://materialdesigninxaml.net/winfx/xaml/themes" |
12 | 13 | xmlns:p="clr-namespace:TicketLottery.Properties" |
| 14 | + xmlns:sys="clr-namespace:System;assembly=mscorlib" |
13 | 15 | xmlns:vm="clr-namespace:TicketLottery.ViewModels" |
14 | 16 | Title="Stream Utilites" |
15 | 17 | Width="1200" |
|
22 | 24 | <ResourceDictionary> |
23 | 25 | <ResourceDictionary.MergedDictionaries> |
24 | 26 | <ResourceDictionary Source="/Dialogs/LotterySettingsDialog.xaml" /> |
| 27 | + <ResourceDictionary Source="/Dialogs/SpinWinnerDialog.xaml" /> |
25 | 28 | <ResourceDictionary> |
26 | 29 | <conv:KeyDownEventArgsConverter x:Key="KeyDownEventArgsConverter" /> |
27 | 30 | </ResourceDictionary> |
| 31 | + <ResourceDictionary> |
| 32 | + <ObjectDataProvider x:Key="TicketTypeData" |
| 33 | + MethodName="GetValues" |
| 34 | + ObjectType="{x:Type sys:Enum}"> |
| 35 | + <ObjectDataProvider.MethodParameters> |
| 36 | + <x:Type TypeName="enum:TicketType" /> |
| 37 | + </ObjectDataProvider.MethodParameters> |
| 38 | + </ObjectDataProvider> |
| 39 | + </ResourceDictionary> |
28 | 40 | </ResourceDictionary.MergedDictionaries> |
29 | 41 | </ResourceDictionary> |
30 | 42 | </Window.Resources> |
|
61 | 73 | Style="{StaticResource MaterialDesignHeadline5TextBlock}" |
62 | 74 | Text="Ticket Lottery" /> |
63 | 75 | <Button Grid.Column="2" |
64 | | - Command="{x:Static md:DialogHost.OpenDialogCommand}" |
65 | | - CommandParameter="{x:Static p:Settings.Default}" |
| 76 | + Command="{Binding ShowSettingsDialogCommand}" |
66 | 77 | Content="{md:PackIcon Settings}" |
67 | 78 | Style="{StaticResource MaterialDesignIconButton}" /> |
68 | 79 | </Grid> |
|
133 | 144 | <DataGridTextColumn MinWidth="100" |
134 | 145 | Binding="{Binding Count, UpdateSourceTrigger=PropertyChanged}" |
135 | 146 | Header="Count" /> |
136 | | - <DataGridTextColumn MinWidth="100" |
137 | | - Binding="{Binding Type, UpdateSourceTrigger=PropertyChanged}" |
138 | | - Header="Type" /> |
| 147 | + <DataGridComboBoxColumn MinWidth="120" |
| 148 | + Header="Type" |
| 149 | + ItemsSource="{Binding Source={StaticResource TicketTypeData}, Mode=OneWay}" |
| 150 | + SelectedValueBinding="{Binding Type, UpdateSourceTrigger=PropertyChanged}" /> |
139 | 151 | <DataGridTextColumn MinWidth="100" |
140 | 152 | Binding="{Binding InsertTime, StringFormat=g}" |
141 | 153 | Header="Insert Time" |
|
156 | 168 | AutoGenerateColumns="False" |
157 | 169 | BorderThickness="2" |
158 | 170 | CanUserAddRows="False" |
| 171 | + IsReadOnly="True" |
159 | 172 | ItemsSource="{Binding Tickets}" |
160 | 173 | SelectionUnit="FullRow"> |
161 | 174 | <DataGrid.Columns> |
|
169 | 182 | </DataGrid> |
170 | 183 | <Button Grid.Row="1" |
171 | 184 | HorizontalAlignment="Center" |
| 185 | + Command="{Binding ShowSpinWinnerDialogCommand}" |
172 | 186 | Content="Spin!" /> |
173 | 187 | </Grid> |
174 | 188 | </Grid> |
|
0 commit comments