85 lines
5.0 KiB
XML
85 lines
5.0 KiB
XML
<Window x:Class="Päevaküsimus.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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
mc:Ignorable="d"
|
|
Title="MainWindow" Height="350" Width="525">
|
|
|
|
<TabControl x:Name="viewTabControl" Margin="0,0,0,0">
|
|
<TabItem Header="Päevaküsimus">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition />
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto" MinWidth="110" />
|
|
<ColumnDefinition />
|
|
</Grid.ColumnDefinitions>
|
|
<Label Grid.Column="0" Grid.Row="0" Content="Päevaküsimus on:"/>
|
|
<Label Grid.Column="1" Grid.Row="0" Content="{Binding dayQuestion.question}"/>
|
|
<Label Grid.Column="0" Grid.Row="1" Content="Vali õige vastuse variant"/>
|
|
<ListBox Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" ItemsSource="{Binding dayQuestion.answers}" x:Name="gameAnswerSelectionListBox" SelectionChanged="GameAnswerSelectionListBox_OnSelectionChanged">
|
|
<ListBox.ItemTemplate>
|
|
<DataTemplate>
|
|
<Label Content="{Binding answer}" />
|
|
</DataTemplate>
|
|
</ListBox.ItemTemplate>
|
|
</ListBox>
|
|
<Button x:Name="displayNewQuestion" Content="Kuva uus küsimus" Grid.Column="1" HorizontalAlignment="Right" Margin="0,0,0,0" Grid.Row="1" Padding="7,0" Click="DisplayNewQuestion_OnClick"/>
|
|
</Grid>
|
|
</TabItem>
|
|
<TabItem Header="Admin">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"></RowDefinition>
|
|
<RowDefinition></RowDefinition>
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto"></ColumnDefinition>
|
|
<ColumnDefinition></ColumnDefinition>
|
|
</Grid.ColumnDefinitions>
|
|
<Label Grid.Row="0" Grid.Column="0" Content="Küsimused"></Label>
|
|
<Label Grid.Row="0" Grid.Column="1" Content="Vaata/Muuda"></Label>
|
|
<ListBox x:Name="allQuestionsListBox" Grid.Column="0" Grid.Row="1" ItemsSource="{Binding questions}" SelectionChanged="AllQuestionsListBox_OnSelectionChanged" Width="150">
|
|
<ListBox.ItemTemplate>
|
|
<DataTemplate>
|
|
<Label Content="{Binding question}" />
|
|
</DataTemplate>
|
|
</ListBox.ItemTemplate>
|
|
</ListBox>
|
|
<Grid Grid.Row="1" Grid.Column="1">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"></RowDefinition>
|
|
<RowDefinition></RowDefinition>
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto"></ColumnDefinition>
|
|
<ColumnDefinition></ColumnDefinition>
|
|
<ColumnDefinition Width="Auto"></ColumnDefinition>
|
|
</Grid.ColumnDefinitions>
|
|
<Label Grid.Row="0" Grid.Column="0" Content="Küsimus:"></Label>
|
|
<TextBox Grid.Row="0" Grid.Column="1" Text="{Binding selectedQuestion.question}" KeyUp="QuestionQuestionTextBox_OnKeyUp" x:Name="questionQuestionTextBox"/>
|
|
<DataGrid Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="3" ItemsSource="{Binding selectedQuestion.answers}" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False">
|
|
<DataGrid.Columns>
|
|
<DataGridTextColumn Header="Vastus" IsReadOnly="False" Binding="{Binding answer}" Width="*">
|
|
</DataGridTextColumn>
|
|
<DataGridCheckBoxColumn Header="Õige?" IsReadOnly="False" Binding="{Binding correct}">
|
|
</DataGridCheckBoxColumn>
|
|
<DataGridTemplateColumn Header="Vastanuid" IsReadOnly="True">
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
<DataTemplate>
|
|
<Label Content="{Binding selectionCount}" Margin="0" Padding="0" HorizontalContentAlignment="Center"/>
|
|
</DataTemplate>
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
</DataGridTemplateColumn>
|
|
</DataGrid.Columns>
|
|
</DataGrid>
|
|
</Grid>
|
|
</Grid>
|
|
</TabItem>
|
|
</TabControl>
|
|
</Window>
|