123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455 |
- <Window xmlns="https://github.com/avaloniaui"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:vm="using:EntranseTesting.ViewModels"
- xmlns:conv="clr-namespace:EntranseTesting.Converter;assembly=EntranseTesting"
- xmlns:dialogHost="clr-namespace:DialogHostAvalonia;assembly=DialogHost.Avalonia"
- 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="500"
- MinWidth="500" MinHeight="500"
- x:Class="EntranseTesting.Views.MainWindow"
- x:DataType="vm:MainWindowViewModel"
- Icon="/Assets/icon.ico"
- Title="Входное тестирование">
- <Design.DataContext>
- <!-- This only sets the DataContext for the previewer in an IDE,
- to set the actual DataContext for runtime, set the DataContext property in code (look at App.axaml.cs) -->
- <vm:MainWindowViewModel/>
- </Design.DataContext>
- <Window.Resources>
- <conv:SizeConverter x:Key="SizeConverter"/>
- <conv:ImageConverter x:Key="ImageConverter"/>
- <x:Decimal x:Key="HeaderParameter">1.5</x:Decimal>
- <x:Decimal x:Key="Header2Parameter">1.3</x:Decimal>
- <x:Decimal x:Key="SmallParameter">0.8</x:Decimal>
- <x:Decimal x:Key="ArrangmentParameter">190.0</x:Decimal>
- <x:Decimal x:Key="CAFSParameter">300.0</x:Decimal>
- <x:Decimal x:Key="ImageParameter">1.1</x:Decimal>
- <x:Decimal x:Key="IconWH">20.0</x:Decimal>
- <x:Decimal x:Key="ButtonParametr">50.0</x:Decimal>
- <x:Decimal x:Key="ButtonNavParametr">23.0</x:Decimal>
- </Window.Resources>
- <Window.Styles>
- <Style Selector=":is(TopLevel)">
- <Setter Property="FontFamily" Value="{Binding #MyFont.SelectedValue}"/>
- <Setter Property="FontSize" Value="{Binding #MyFontSize.Value}"/>
- <Setter Property="TextBlock.TextWrapping" Value="Wrap"/>
- </Style>
- <Style Selector=":is(TextBlock)">
- <Setter Property="FontFamily" Value="{Binding #MyFont.SelectedValue}"/>
- <Setter Property="FontSize" Value="{Binding #MyFontSize.Value}"/>
- <Setter Property="TextWrapping" Value="Wrap"/>
- </Style>
- <Style Selector=":is(ComboBox)">
- <Setter Property="FontFamily" Value="{Binding #MyFont.SelectedValue}"/>
- <Setter Property="FontSize" Value="{Binding #MyFontSize.Value}"/>
- <Setter Property="TextBlock.TextWrapping" Value="Wrap"/>
- <Setter Property="TextBlock.TextTrimming" Value="CharacterEllipsis"/>
- </Style>
- <Style Selector=":is(TextBox)">
- <Setter Property="FontFamily" Value="{Binding #MyFont.SelectedValue}"/>
- <Setter Property="FontSize" Value="{Binding #MyFontSize.Value}"/>
- <Setter Property="TextWrapping" Value="Wrap"/>
- </Style>
- <Style Selector=":is(NumericUpDown)">
- <Setter Property="FontFamily" Value="{Binding #MyFont.SelectedValue}"/>
- <Setter Property="FontSize" Value="{Binding #MyFontSize.Value}"/>
- <Setter Property="TextBlock.TextWrapping" Value="Wrap"/>
- </Style>
- <Style Selector=":is(TimePicker)">
- <Setter Property="FontFamily" Value="{Binding #MyFont.SelectedValue}"/>
- <Setter Property="FontSize" Value="{Binding #MyFontSize.Value}"/>
- </Style>
- <Style Selector=":is(Button)">
- <Setter Property="FontFamily" Value="{Binding #MyFont.SelectedValue}"/>
- <Setter Property="FontSize" Value="{Binding #MyFontSize.Value}"/>
- <Setter Property="TextBlock.TextWrapping" Value="Wrap"/>
- </Style>
- <Style Selector=":is(TextBlock).Header">
- <Setter Property="FontSize" Value="{Binding #MyFontSize.Value, Converter={StaticResource SizeConverter}, ConverterParameter={StaticResource HeaderParameter}}"/>
- <Setter Property="FontWeight" Value="Bold"/>
- <Setter Property="Margin" Value="5 10 5 15"/>
- </Style>
- <Style Selector=":is(TextBlock).Header2">
- <Setter Property="FontSize" Value="{Binding #MyFontSize.Value, Converter={StaticResource SizeConverter}, ConverterParameter={StaticResource Header2Parameter}}"/>
- <Setter Property="FontWeight" Value="Bold"/>
- </Style>
- <Style Selector=":is(TextBlock).Small">
- <Setter Property="FontSize" Value="{Binding #MyFontSize.Value, Converter={StaticResource SizeConverter}, ConverterParameter={StaticResource SmallParameter}}"/>
- <Setter Property="Margin" Value="5"/>
- <Setter Property="Opacity" Value="0.9"/>
- </Style>
- <Style Selector=":is(Border).Arrangment">
- <Setter Property="Width" Value="{Binding #MyFontSize.Value, Converter={StaticResource ImageConverter}, ConverterParameter={StaticResource ArrangmentParameter}}"/>
- </Style>
- <Style Selector=":is(Border).CAFS">
- <Setter Property="Width" Value="{Binding #MyFontSize.Value, Converter={StaticResource ImageConverter}, ConverterParameter={StaticResource CAFSParameter}}"/>
- </Style>
- <Style Selector=":is(IconElement)">
- <Setter Property="Width" Value="{Binding #MyFontSize.Value, Converter={StaticResource ImageConverter}, ConverterParameter={StaticResource IconWH}}"/>
- <Setter Property="Height" Value="{Binding #MyFontSize.Value, Converter={StaticResource ImageConverter}, ConverterParameter={StaticResource IconWH}}"/>
- </Style>
- <Style Selector=":is(Button).Progress">
- <Setter Property="Width" Value="{Binding #MyFontSize.Value, Converter={StaticResource ImageConverter}, ConverterParameter={StaticResource ButtonParametr}}"/>
- </Style>
- <Style Selector=":is(Button).ProgressNav">
- <Setter Property="Width" Value="{Binding #MyFontSize.Value, Converter={StaticResource ImageConverter}, ConverterParameter={StaticResource ButtonNavParametr}}"/>
- </Style>
- <Style Selector=":is(Image).Test">
- <Setter Property="MaxWidth" Value="150"/>
- <Setter Property="MaxHeight" Value="100"/>
- <Setter Property="Stretch" Value="Uniform"/>
- <Setter Property="Cursor" Value="Hand"/>
- </Style>
- <Style Selector=":is(Expander).Content">
- <Setter Property="Width" Value="{Binding #MyFontSize.Value, Converter={StaticResource ImageConverter}, ConverterParameter={StaticResource CAFSParameter}}"/>
- </Style>
- <Style Selector=":is(Image).Test:pointerover">
- <Setter Property="MaxWidth" Value="350"/>
- <Setter Property="MaxHeight" Value="300"/>
- </Style>
- <Style Selector=":is(Button).icon">
- <Setter Property="Template">
- <ControlTemplate>
- <Border Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- CornerRadius="{StaticResource ControlCornerRadius}"
- Padding="{TemplateBinding Padding}">
- <DockPanel>
- <PathIcon Foreground="{TemplateBinding Foreground}"
- Data="{TemplateBinding Tag}"
- DockPanel.Dock="Left" />
- <ContentPresenter Content="{TemplateBinding Content}"
- IsVisible="{Binding IsPaneOpen}"
- Margin="10,0,10,0"
- TextBlock.Foreground="{TemplateBinding Foreground}"
- ContentTemplate="{TemplateBinding ContentTemplate}"
- HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
- </DockPanel>
- </Border>
- </ControlTemplate>
- </Setter>
- </Style>
- <Style Selector=":is(Button).icon:pointerover">
- <Setter Property="Opacity" Value="0.35"/>
- </Style>
- <Style Selector=":is(Button).icon:pressed">
- <Setter Property="Opacity" Value="0.65"/>
- </Style>
- <Style Selector=":is(Button).menu">
- <Setter Property="Template">
- <ControlTemplate>
- <Border Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- CornerRadius="10,0"
- Padding="{TemplateBinding Padding}">
- <DockPanel>
- <PathIcon Foreground="{TemplateBinding Foreground}"
- Data="{TemplateBinding Tag}"
- DockPanel.Dock="Left"/>
- <ContentPresenter Content="{TemplateBinding Content}"
- Margin="10,0,10,0"
- TextBlock.Foreground="{TemplateBinding Foreground}"
- ContentTemplate="{TemplateBinding ContentTemplate}"
- HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
- </DockPanel>
- </Border>
- </ControlTemplate>
- </Setter>
- </Style>
- <Style Selector=":is(Button):disabled">
- <Setter Property="Background" Value="#696BFF"/>
- </Style>
- </Window.Styles>
- <dialogHost:DialogHost CloseOnClickAway="True"
- IsOpen="{Binding IsOpenAuthorization}">
- <dialogHost:DialogHost.DialogContent>
- <StackPanel Spacing="15" Margin="15 10">
- <TextBlock Text="Авторизация" Classes="Header"
- HorizontalAlignment="Center"/>
- <TextBox Width="250" Watermark="Логин" Text="{Binding Login}"/>
- <TextBox Width="250" Watermark="Пароль" Text="{Binding Password}"
- PasswordChar="*"/>
- <Button Content="Войти" Command="{Binding AuthorizationCommand}"
- HorizontalAlignment="Center"/>
- </StackPanel>
- </dialogHost:DialogHost.DialogContent>
-
- <SplitView IsPaneOpen="{Binding IsPaneOpen}"
- CompactPaneLength="50"
- OpenPaneLength="300"
- DisplayMode="CompactInline">
- <SplitView.Pane>
- <Grid RowDefinitions="Auto, *, Auto">
- <Button Command="{Binding IsClickPainCommand}" Classes="icon"
- Tag="{StaticResource LineHorizontal3Regular}"
- Background="Transparent" Grid.Row="0" Margin="5"/>
- <ScrollViewer HorizontalScrollBarVisibility="Disabled"
- VerticalScrollBarVisibility="Auto"
- Grid.Row="1">
- <StackPanel Spacing="5" Margin="5"
- VerticalAlignment="Top">
- <!-- // Кнопка Авторизация //-->
- <Button Command="{Binding OpenAuthorizationCommand}" Classes="icon"
- IsVisible="{Binding IsAuth}" HorizontalAlignment="Stretch"
- Tag="{StaticResource PersonRegular}" Content="Авторизироваться"
- ToolTip.Tip="Авторизироваться в системе"
- Background="Transparent"/>
- <!-- // Кнопка Изменения текста //-->
- <Button Command="{Binding IsTextClickCommand}" Classes="icon"
- HorizontalAlignment="Stretch"
- Tag="{StaticResource TextFieldRegular}" Content="Отображение текста"
- ToolTip.Tip="Настройка отображения текста"
- Background="Transparent"/>
- <!-- // Параметры Изменения текста //-->
- <WrapPanel IsVisible="{Binding TextChangeVisible}" Margin="10 0">
- <TextBlock Text="Шрифт"/>
- <ComboBox Name="MyFont"
- ItemsSource="{Binding IS.Fonts}" SelectedItem="{Binding IS.SelectedFont}"
- AutoScrollToSelectedItem="True"
- IsTextSearchEnabled="True"
- Width="200"/>
- </WrapPanel>
- <WrapPanel IsVisible="{Binding TextChangeVisible}" Margin="10 0">
- <TextBlock Text="Размер шрифта"/>
- <NumericUpDown Name="MyFontSize"
- Value="{Binding IS.MyFontSize}"
- Minimum="10" Maximum="28"
- Increment="2"
- MinWidth="100"
- ButtonSpinnerLocation="Left"/>
- </WrapPanel>
- <!-- // Кнопка Инфо Подсказки //-->
- <Button Command="{Binding IsHintClickCommand}" Classes="icon"
- IsVisible="{Binding Info}" HorizontalAlignment="Stretch"
- Tag="{StaticResource LightbulbCircleRegular}" Content="Система подсказок"
- ToolTip.Tip="Информация о системе подсказок"
- Background="Transparent"/>
- <!-- // Текст Инфо Подсказки //-->
- <TextBlock Text="{Binding Mess.InfoHint}"
- IsVisible="{Binding HintVisible}"
- Margin="10 0"/>
- <!-- // Кнопка Добавления вопроса //-->
- <Button Command="{Binding AddQuestion}" Classes="icon"
- IsVisible="{Binding EditorPages.EditingVisible}" HorizontalAlignment="Stretch"
- Tag="{StaticResource AddSquareRegular}" Content="Добавить вопрос"
- ToolTip.Tip="Добавить вопрос"
- Background="Transparent"/>
- <!-- // Фильтрация и сортировка //-->
- <StackPanel Orientation="Vertical" Spacing="5"
- IsVisible="{Binding EditorPages.EditingVisible}" >
- <Button Command="{Binding IsClickPainCommand}" Classes="icon"
- HorizontalAlignment="Stretch"
- Tag="{StaticResource FilterRegular}" Content="Фильтрация и сортировка"
- ToolTip.Tip="Фильтрация и сортировка вопросов"
- Background="Transparent"/>
- <StackPanel Orientation="Vertical" Spacing="10"
- IsVisible="{Binding IsPaneOpen}">
- <!-- // Поиск //-->
- <StackPanel Orientation="Vertical" Margin="5">
- <TextBlock Text="Искать по вопросу"
- HorizontalAlignment="Stretch"/>
- <TextBox Text="{Binding EditorPages.TaskMainPage.SearchLine}"
- TextBlock.TextWrapping="NoWrap"
- HorizontalAlignment="Stretch"/>
- </StackPanel>
- <!-- // Фильтрация //-->
- <StackPanel Orientation="Vertical" Margin="5">
- <TextBlock Text="Фильтровать по типу задания"
- HorizontalAlignment="Stretch"/>
- <ComboBox ItemsSource="{Binding EditorPages.TaskMainPage.CategoryList}"
- SelectedItem="{Binding EditorPages.TaskMainPage.SelectedCategory}"
- TextBlock.TextWrapping="NoWrap"
- TextBlock.TextTrimming="WordEllipsis"
- HorizontalAlignment="Stretch"/>
- </StackPanel>
- <!-- // Сортировка //-->
- <StackPanel Orientation="Vertical" Margin="5">
- <TextBlock Text="Сортировать"
- VerticalAlignment="Center"/>
- <ComboBox ItemsSource="{Binding EditorPages.TaskMainPage.SortList}"
- SelectedItem="{Binding EditorPages.TaskMainPage.SelectedSort}"
- WrapSelection="False"
- TextBlock.TextWrapping="NoWrap"
- HorizontalAlignment="Stretch"/>
- </StackPanel>
- <!-- // Те которые включаются в тест //-->
- <CheckBox Content="Вопросы, включаемые в тест"
- HorizontalAlignment="Stretch" Margin="5"
- IsChecked="{Binding EditorPages.TaskMainPage.SelectedInTest}"/>
- </StackPanel>
- </StackPanel>
- <!-- Вопросы к заданиям-->
- <StackPanel Orientation="Vertical" Spacing="5" HorizontalAlignment="Stretch"
- IsVisible="{Binding ButtonVisible}" >
- <Button Command="{Binding IsClickPainCommand}" Classes="icon"
- HorizontalAlignment="Stretch"
- Tag="{StaticResource TableSettingsRegular}" Content="Навигация по тесту"
- ToolTip.Tip="Навигация по тесту"
- Background="Transparent"/>
- <ItemsRepeater ItemsSource="{Binding TestMain.TestPages.ProgressButtons}"
- VerticalAlignment="Stretch" HorizontalAlignment="Center"
- Margin="5 15" IsVisible="{Binding IsPaneOpen}">
- <ItemsRepeater.Layout>
- <WrapLayout HorizontalSpacing="5" VerticalSpacing="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>
- </StackPanel>
- <StackPanel Orientation="Vertical" Spacing="10"
- IsVisible="{Binding UserResultVisible}">
- <!-- Инфо о метках -->
- <Button Command="{Binding IsClickPainCommand}" Classes="icon"
- HorizontalAlignment="Stretch"
- Tag="{StaticResource InfoRegular}" Content="Информация о метках"
- Background="Transparent">
- <ToolTip.Tip>
- <StackPanel Orientation="Vertical">
- <TextBlock Margin="2">
- <TextBlock.Inlines>
- <Run Text="		" Background="LightGreen"/>
- <Run Text=" Правильно "/>
- </TextBlock.Inlines>
- </TextBlock>
- <TextBlock Margin="2">
- <TextBlock.Inlines>
- <Run Text="		" Background="Yellow"/>
- <Run Text=" Частично правильно "/>
- </TextBlock.Inlines>
- </TextBlock>
- <TextBlock Margin="2">
- <TextBlock.Inlines>
- <Run Text="		" Background="LightGray"/>
- <Run Text=" Правильно, но не выбрано"/>
- </TextBlock.Inlines>
- </TextBlock>
- <TextBlock Margin="2">
- <TextBlock.Inlines>
- <Run Text="		" Background="LightCoral"/>
- <Run Text=" Не правильно"/>
- </TextBlock.Inlines>
- </TextBlock>
- <TextBlock Margin="2">
- <TextBlock.Inlines>
- <Run Text="		" Background="LightSalmon"/>
- <Run Text=" Не правильно, но выбрано "/>
- </TextBlock.Inlines>
- </TextBlock>
- </StackPanel>
- </ToolTip.Tip>
- </Button>
- <!-- Поиск, сортировка в результатах пользователя -->
- <StackPanel Orientation="Vertical" Spacing="10"
- IsVisible="{Binding IsPaneOpen}"
- Margin="5 0">
- <StackPanel Orientation="Vertical" Margin="0 0 15 0"
- Spacing="5" >
- <TextBlock Text="Поиск по вопросу"/>
- <TextBox Text="{Binding UserResult.SearchLine}" HorizontalAlignment="Stretch"/>
- </StackPanel>
- <CheckBox IsThreeState="True" IsChecked="{Binding UserResult.CorrectlyVisible}"
- Margin="5 0"
- ToolTip.Tip="Параметр: Состояние вопроса [Решен/Не решен]">
- <CheckBox.Styles>
- <Style Selector="CheckBox:checked">
- <Setter Property="Content" Value="Вопросы с правильным ответом"/>
- </Style>
- <Style Selector="CheckBox:unchecked">
- <Setter Property="Content" Value="Вопрос с не правильным ответом"/>
- </Style>
- <Style Selector="CheckBox">
- <Setter Property="Content" Value="Все вопросы"/>
- </Style>
- </CheckBox.Styles>
- </CheckBox>
- <CheckBox IsThreeState="True" IsChecked="{Binding UserResult.ResponseVisible}"
- Margin="5 0"
- ToolTip.Tip="Параметр: Состояние вопроса [Решен/Пропущен]">
- <CheckBox.Styles>
- <Style Selector="CheckBox:checked">
- <Setter Property="Content" Value="Вопросы с ответом"/>
- </Style>
- <Style Selector="CheckBox:unchecked">
- <Setter Property="Content" Value="Пропущенные вопросы"/>
- </Style>
- <Style Selector="CheckBox">
- <Setter Property="Content" Value="Все вопросы"/>
- </Style>
- </CheckBox.Styles>
- </CheckBox>
- <CheckBox IsThreeState="True" IsChecked="{Binding UserResult.HintVisible}"
- Margin="5 0"
- ToolTip.Tip="Параметр: Состояние подсказки [Использована/Не использована]">
- <CheckBox.Styles>
- <Style Selector="CheckBox:checked">
- <Setter Property="Content" Value="Вопросы с применением подсказок"/>
- </Style>
- <Style Selector="CheckBox:unchecked">
- <Setter Property="Content" Value="Вопросы без применения подсказок"/>
- </Style>
- <Style Selector="CheckBox">
- <Setter Property="Content" Value="Все вопросы"/>
- </Style>
- </CheckBox.Styles>
- </CheckBox>
- </StackPanel>
- </StackPanel>
- </StackPanel>
- </ScrollViewer>
- <!-- // Кнопка выхода //-->
- <Button Command="{Binding ToBackCommand}" Margin="5"
- IsVisible="{Binding IsExit}" Classes="icon"
- VerticalAlignment="Bottom" HorizontalAlignment="Right"
- Tag="{StaticResource SignOutRegular}" Content="Выйти"
- ToolTip.Tip="Вернуться на главную страницу"
- Background="Transparent" Grid.Row="2"/>
- </Grid>
- </SplitView.Pane>
- <SplitView.Content>
- <ContentControl Content="{Binding UC}"
- HorizontalAlignment="Stretch"
- VerticalAlignment="Stretch"
- Name="TestContent"/>
- </SplitView.Content>
- </SplitView>
- </dialogHost:DialogHost>
- </Window>
|