Skip to content

Commit

Permalink
Added menu
Browse files Browse the repository at this point in the history
  • Loading branch information
TimeTravelPenguin committed Jul 12, 2021
1 parent 5391bc7 commit c001988
Showing 1 changed file with 80 additions and 55 deletions.
135 changes: 80 additions & 55 deletions DiscordTimeStamper/MainWindowView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,69 +16,94 @@
<Window.DataContext>
<local:MainWindowViewModel />
</Window.DataContext>
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="10" />
<ColumnDefinition Width="200" />
</Grid.ColumnDefinitions>


<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="5" />
<RowDefinition Height="Auto" />
<RowDefinition Height="5" />
<RowDefinition Height="Auto" />
<RowDefinition Height="15" />
<RowDefinition Height="3" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>

<Label
Grid.Row="0"
Grid.Column="0"
Content="Date/Time:" />
<Label
Grid.Row="4"
Grid.Column="0"
Content="Time Code:" />
<Menu Grid.ColumnSpan="3" Height="Auto">
<MenuItem Header="_About">
<MenuItem Command="{Binding CommandGithub}" Header="_GitHub" />
</MenuItem>
</Menu>

<Grid Margin="5,0,5,5" Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="10" />
<ColumnDefinition Width="200" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="5" />
<RowDefinition Height="Auto" />
<RowDefinition Height="15" />
<RowDefinition Height="*" />
<RowDefinition Height="10" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>

<Label
Grid.Row="0"
Grid.Column="0"
Content="Datetime:" />
<Label
Grid.Row="2"
Grid.Column="0"
Content="Timezone:" />

<mah:DateTimePicker
Grid.Row="0"
Grid.Column="2"
SelectedDateTime="{Binding DateTime, UpdateSourceTrigger=PropertyChanged}" />

<ComboBox
Grid.Row="2"
Grid.Column="2"
ItemsSource="{Binding TimeZones, Mode=OneWay}"
SelectedItem="{Binding SelectedTimeZone, UpdateSourceTrigger=PropertyChanged}" />

<mah:DateTimePicker
Grid.Row="0"
Grid.Column="2"
SelectedDateTime="{Binding DateTime, UpdateSourceTrigger=PropertyChanged}" />
<DataGrid
Grid.Row="4"
Grid.Column="0"
Grid.ColumnSpan="3"
HorizontalContentAlignment="Stretch"
AutoGenerateColumns="False"
CanUserAddRows="False"
CanUserDeleteRows="False"
CanUserReorderColumns="False"
CanUserResizeColumns="False"
CanUserSortColumns="False"
IsReadOnly="True"
ItemsSource="{Binding GeneratedFormats, Mode=OneWay}"
SelectedItem="{Binding SelectedDataGridItem, Mode=OneWayToSource}">

<ComboBox
Grid.Row="4"
Grid.Column="2"
ItemsSource="{Binding TimeZones, Mode=OneWay}"
SelectedItem="{Binding SelectedTimeZone, UpdateSourceTrigger=PropertyChanged}" />
<DataGrid.Columns>
<DataGridTextColumn
MinWidth="200"
Binding="{Binding Value}"
Header="Value" />

<DataGrid
Grid.Row="6"
Grid.Column="0"
Grid.ColumnSpan="3"
HorizontalContentAlignment="Stretch"
AutoGenerateColumns="False"
CanUserAddRows="False"
CanUserDeleteRows="False"
CanUserReorderColumns="False"
CanUserResizeColumns="False"
CanUserSortColumns="False"
IsReadOnly="True"
ItemsSource="{Binding GeneratedFormats, Mode=OneWay}"
SelectedItem="{Binding SelectedDataGridItem, Mode=OneWayToSource}">
<b:Interaction.Triggers>
<b:EventTrigger EventName="MouseDoubleClick">
<b:InvokeCommandAction Command="{Binding DataGridDoubleClickCommand}" />
</b:EventTrigger>
</b:Interaction.Triggers>
<DataGridTextColumn Binding="{Binding DiscordFormat}" Header="Discord Format">
<DataGridTextColumn.CellStyle>
<Style TargetType="{x:Type FrameworkElement}">
<Setter Property="HorizontalAlignment" Value="Center" />
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>

<DataGrid.Columns>
<DataGridTextColumn
MinWidth="200"
Binding="{Binding Value}"
Header="Value" />
<DataGridTextColumn Binding="{Binding DiscordFormat}" Header="Discord Format" />
</DataGrid.Columns>
</DataGrid>
<Button
Grid.Row="6"
Grid.Column="0"
Grid.ColumnSpan="3"
Command="{Binding CommandCopySelected}"
Content="Copy selected" />
</Grid>
</Grid>
</Window>

0 comments on commit c001988

Please sign in to comment.