123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162 |
- <UserControl xmlns="https://github.com/avaloniaui"
- 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" d:DesignWidth="800" d:DesignHeight="450"
- x:Class="EntranseTesting.TestPage"
- xmlns:vm="using:EntranseTesting.ViewModels"
- x:DataType="vm:MainWindowViewModel">
- <Grid RowDefinitions="Auto,Auto,Auto,*,Auto"
- ColumnDefinitions="*,*"
- Margin="15 10"
- HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
- <!-- Имя пользователя -->
- <TextBlock Text="{Binding TestMain.NameUser, TargetNullValue='Не авторизован', StringFormat='Пользователь: {0}'}"
- Grid.Row="0" Grid.Column="0" Margin="0 5 10 15"
- HorizontalAlignment="Left" VerticalAlignment="Center"/>
-
- <!-- Навигация и прогресс теста-->
- <StackPanel Grid.Row="1" Grid.ColumnSpan="2" VerticalAlignment="Stretch">
- <Grid ColumnDefinitions="Auto, *,Auto">
- <Button Classes="ProgressNav" MinWidth="25"
- Grid.Column="0"
- HorizontalContentAlignment="Center"
- VerticalContentAlignment="Center"
- Content="<"
- Command="{Binding TestMain.TestPages.Back}"/>
- <ScrollViewer HorizontalScrollBarVisibility="Auto"
- VerticalScrollBarVisibility="Disabled"
- Grid.Column="1"
- Margin="5 0">
- <ItemsRepeater ItemsSource="{Binding TestMain.TestPages.TakeProgressButtons}"
- VerticalAlignment="Stretch" HorizontalAlignment="Center"
- Margin="0 15">
- <ItemsRepeater.Layout>
- <StackLayout Spacing="5" Orientation="Horizontal"/>
- </ItemsRepeater.Layout>
- <ItemsRepeater.ItemTemplate>
- <DataTemplate>
- <Button Content="{Binding Num}"
- Classes="Progress"
- Classes.active="{Binding Active}" Classes.check="{Binding Check}"
- Command="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).TestMain.ClickToQuestion}"
- CommandParameter="{Binding Num}"
- HorizontalContentAlignment="Center"
- VerticalContentAlignment="Center">
- <Button.Styles>
- <Style Selector=":is(Button).check">
- <Setter Property="Background" Value="LightGreen"/>
- </Style>
- <Style Selector=":is(Button).active">
- <Setter Property="Background" Value="#696BFF"/>
- </Style>
- </Button.Styles>
- </Button>
- </DataTemplate>
- </ItemsRepeater.ItemTemplate>
- </ItemsRepeater>
- </ScrollViewer>
- <Button Classes="ProgressNav" MinWidth="25"
- Grid.Column="2"
- HorizontalContentAlignment="Center"
- VerticalContentAlignment="Center"
- Content=">"
- Command="{Binding TestMain.TestPages.Next}"/>
- </Grid>
- <ProgressBar Minimum="0" Maximum="{Binding TestMain.TestPages.CountQuestion}"
- Value="{Binding TestMain.TestPages.NumQuestion}"
- Margin="0 5"
- ShowProgressText="True" ProgressTextFormat="{Binding TestMain.TestPages.ProgressText}"/>
- </StackPanel>
- <!-- Номер вопроса -->
- <TextBlock Text="{Binding TestMain.TestPages.NumQuestion, StringFormat='Вопрос {0}'}"
- Margin="10 5" Grid.Column="0" Grid.Row="2"
- HorizontalAlignment="Left"/>
- <ContentControl Content="{Binding TestMain.TestPages.TestUC}"
- Grid.Row="3" Grid.ColumnSpan="2" Margin="0 5"
- HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"/>
- <Button Content="{Binding TestMain.TestPages.ButtonValue}"
- Command="{Binding NextQuestion}"
- Grid.Row="4" Grid.ColumnSpan="2"
- HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
- HorizontalAlignment="Right" VerticalAlignment="Bottom"/>
- <!-- Подсказки -->
- <Expander VerticalAlignment="Top" Grid.Column="1" Grid.Row="0" Grid.RowSpan="5"
- HorizontalAlignment="Right" IsVisible="{Binding TestMain.TestPages.SettingTest.HintVisibility}"
- MaxWidth="{Binding $parent.Bounds.Width}">
- <Expander.Header>
- <StackPanel Orientation="Horizontal" Spacing="10" VerticalAlignment="Center"
- HorizontalAlignment="Right">
- <PathIcon Data="{StaticResource LightbulbCircleRegular}"/>
- <TextBlock Text="Подсказки"/>
- </StackPanel>
- </Expander.Header>
- <Expander.Content>
- <Grid >
- <TextBlock Text="Подсказки для данного задания не предусмотрены"
- IsVisible="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).TestMain.TestPages.NoVisibleHint}"/>
- <StackPanel Orientation="Vertical" Spacing="10"
- IsVisible="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).TestMain.TestPages.VisibleHint}">
- <!-- Информация о количестве подсказок -->
- <TextBlock Text="{Binding TestMain.TestPages.HintCountLine}"
- HorizontalAlignment="Right" VerticalAlignment="Center"/>
- <!-- Подсказки -->
- <ScrollViewer MaxHeight="450">
- <ItemsRepeater ItemsSource="{Binding TestMain.TestPages.Hints}"
- HorizontalAlignment="Stretch"
- VerticalAlignment="Stretch"
- Margin="0 0 20 0">
- <ItemsRepeater.Layout>
- <StackLayout Orientation="Vertical"/>
- </ItemsRepeater.Layout>
- <ItemsRepeater.ItemTemplate>
- <DataTemplate>
- <Border BorderBrush="#696BFF" BorderThickness="0 0 0 1" Padding="0 5">
- <Grid RowDefinitions="Auto,Auto">
- <StackPanel Orientation="Vertical" Spacing="10" Grid.Row="1"
- IsVisible="{Binding HintPurchased}">
- <TextBlock Text="{Binding IdHintNavigation.Text}"
- VerticalAlignment="Center"/>
- <ItemsRepeater ItemsSource="{Binding IdHintNavigation.HintImages}"
- HorizontalAlignment="Stretch"
- VerticalAlignment="Stretch">
- <ItemsRepeater.Layout>
- <WrapLayout HorizontalSpacing="10" VerticalSpacing="5"/>
- </ItemsRepeater.Layout>
- <ItemsRepeater.ItemTemplate>
- <DataTemplate>
- <Image Source="{Binding hImage}" Classes="Test"/>
- </DataTemplate>
- </ItemsRepeater.ItemTemplate>
- </ItemsRepeater>
- </StackPanel>
- <Grid ColumnDefinitions="*,*"
- IsVisible="{Binding NoHintPurchased}">
- <TextBlock Text="Цена подсказки "/>
- <Button Grid.Column="1"
- Content="{Binding CostLine}"
- Command="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).TestMain.TestPages.BuyAHint}"
- CommandParameter="{Binding Id}"
- HorizontalAlignment="Right"/>
- </Grid>
- </Grid>
- </Border>
- </DataTemplate>
- </ItemsRepeater.ItemTemplate>
- </ItemsRepeater>
- </ScrollViewer>
- </StackPanel>
- </Grid>
- </Expander.Content>
- </Expander>
- </Grid>
- </UserControl>
|