123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264 |
- <Page x:Class="PsychoTest.Pages.UserTests"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:local="clr-namespace:PsychoTest.Pages"
- mc:Ignorable="d"
- d:DesignHeight="1024" d:DesignWidth="1440"
- Title="UserTests"
- xmlns:theme="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero2">
- <Page.Resources>
- <LinearGradientBrush x:Key="ComboBox.Static.Background" EndPoint="0,1" StartPoint="0,0">
- <GradientStop Color="#FFF0F0F0" Offset="0.0"/>
- <GradientStop Color="#FFE5E5E5" Offset="1.0"/>
- </LinearGradientBrush>
- <SolidColorBrush x:Key="ComboBox.Static.Border" Color="#FFACACAC"/>
- <SolidColorBrush x:Key="ComboBox.Static.Glyph" Color="#FF606060"/>
- <SolidColorBrush x:Key="ComboBox.Static.Editable.Background" Color="#FFFFFFFF"/>
- <SolidColorBrush x:Key="ComboBox.Static.Editable.Border" Color="#FFABADB3"/>
- <SolidColorBrush x:Key="ComboBox.Static.Editable.Button.Background" Color="Transparent"/>
- <SolidColorBrush x:Key="ComboBox.Static.Editable.Button.Border" Color="Transparent"/>
- <LinearGradientBrush x:Key="ComboBox.MouseOver.Background" EndPoint="0,1" StartPoint="0,0">
- <GradientStop Color="#FFECF4FC" Offset="0.0"/>
- <GradientStop Color="#FFDCECFC" Offset="1.0"/>
- </LinearGradientBrush>
- <SolidColorBrush x:Key="ComboBox.MouseOver.Border" Color="#FF7EB4EA"/>
- <SolidColorBrush x:Key="ComboBox.MouseOver.Glyph" Color="#FF000000"/>
- <SolidColorBrush x:Key="ComboBox.MouseOver.Editable.Background" Color="#FFFFFFFF"/>
- <SolidColorBrush x:Key="ComboBox.MouseOver.Editable.Border" Color="#FF7EB4EA"/>
- <LinearGradientBrush x:Key="ComboBox.MouseOver.Editable.Button.Background" EndPoint="0,1" StartPoint="0,0">
- <GradientStop Color="#FFEBF4FC" Offset="0.0"/>
- <GradientStop Color="#FFDCECFC" Offset="1.0"/>
- </LinearGradientBrush>
- <SolidColorBrush x:Key="ComboBox.MouseOver.Editable.Button.Border" Color="#FF7EB4EA"/>
- <LinearGradientBrush x:Key="ComboBox.Pressed.Background" EndPoint="0,1" StartPoint="0,0">
- <GradientStop Color="#FFDAECFC" Offset="0.0"/>
- <GradientStop Color="#FFC4E0FC" Offset="1.0"/>
- </LinearGradientBrush>
- <SolidColorBrush x:Key="ComboBox.Pressed.Border" Color="#FF569DE5"/>
- <SolidColorBrush x:Key="ComboBox.Pressed.Glyph" Color="#FF000000"/>
- <SolidColorBrush x:Key="ComboBox.Pressed.Editable.Background" Color="#FFFFFFFF"/>
- <SolidColorBrush x:Key="ComboBox.Pressed.Editable.Border" Color="#FF569DE5"/>
- <LinearGradientBrush x:Key="ComboBox.Pressed.Editable.Button.Background" EndPoint="0,1" StartPoint="0,0">
- <GradientStop Color="#FFDAEBFC" Offset="0.0"/>
- <GradientStop Color="#FFC4E0FC" Offset="1.0"/>
- </LinearGradientBrush>
- <SolidColorBrush x:Key="ComboBox.Pressed.Editable.Button.Border" Color="#FF569DE5"/>
- <SolidColorBrush x:Key="ComboBox.Disabled.Background" Color="#FFF0F0F0"/>
- <SolidColorBrush x:Key="ComboBox.Disabled.Border" Color="#FFD9D9D9"/>
- <SolidColorBrush x:Key="ComboBox.Disabled.Glyph" Color="#FFBFBFBF"/>
- <SolidColorBrush x:Key="ComboBox.Disabled.Editable.Background" Color="#FFFFFFFF"/>
- <SolidColorBrush x:Key="ComboBox.Disabled.Editable.Border" Color="#FFBFBFBF"/>
- <SolidColorBrush x:Key="ComboBox.Disabled.Editable.Button.Background" Color="Transparent"/>
- <SolidColorBrush x:Key="ComboBox.Disabled.Editable.Button.Border" Color="Transparent"/>
- <Style x:Key="ComboBoxToggleButton" TargetType="{x:Type ToggleButton}">
- <Setter Property="OverridesDefaultStyle" Value="true"/>
- <Setter Property="IsTabStop" Value="false"/>
- <Setter Property="Focusable" Value="false"/>
- <Setter Property="ClickMode" Value="Press"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ToggleButton}">
- <Border x:Name="templateRoot" CornerRadius="10" Background="White" Opacity="0.5" BorderBrush="Black" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
- <Border x:Name="splitBorder" BorderBrush="Transparent" BorderThickness="1" HorizontalAlignment="Right" Margin="0,0,10,0" SnapsToDevicePixels="true" Width="30">
- <Image Source="/Resources/arrow_down.png"/>
- </Border>
- </Border>
- <ControlTemplate.Triggers>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="true"/>
- <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Mode=Self}}" Value="false"/>
- <Condition Binding="{Binding IsPressed, RelativeSource={RelativeSource Mode=Self}}" Value="false"/>
- <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Mode=Self}}" Value="true"/>
- </MultiDataTrigger.Conditions>
- <Setter Property="Background" TargetName="templateRoot" Value="{StaticResource ComboBox.Static.Editable.Background}"/>
- <Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.Static.Editable.Border}"/>
- <Setter Property="Background" TargetName="splitBorder" Value="{StaticResource ComboBox.Static.Editable.Button.Background}"/>
- <Setter Property="BorderBrush" TargetName="splitBorder" Value="{StaticResource ComboBox.Static.Editable.Button.Border}"/>
- </MultiDataTrigger>
-
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Mode=Self}}" Value="true"/>
- <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="false"/>
- </MultiDataTrigger.Conditions>
- <Setter Property="Background" TargetName="templateRoot" Value="white"/>
- <Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.MouseOver.Border}"/>
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Mode=Self}}" Value="true"/>
- <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="true"/>
- </MultiDataTrigger.Conditions>
- <Setter Property="Background" TargetName="templateRoot" Value="{StaticResource ComboBox.MouseOver.Editable.Background}"/>
- <Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.MouseOver.Editable.Border}"/>
- <Setter Property="Background" TargetName="splitBorder" Value="{StaticResource ComboBox.MouseOver.Editable.Button.Background}"/>
- <Setter Property="BorderBrush" TargetName="splitBorder" Value="{StaticResource ComboBox.MouseOver.Editable.Button.Border}"/>
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsPressed, RelativeSource={RelativeSource Mode=Self}}" Value="true"/>
- <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="false"/>
- </MultiDataTrigger.Conditions>
- <Setter Property="Background" TargetName="templateRoot" Value="white"/>
- <Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.Pressed.Border}"/>
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsPressed, RelativeSource={RelativeSource Mode=Self}}" Value="true"/>
- <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="true"/>
- </MultiDataTrigger.Conditions>
- <Setter Property="Background" TargetName="templateRoot" Value="white"/>
- <Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.Pressed.Editable.Border}"/>
- <Setter Property="Background" TargetName="splitBorder" Value="white"/>
- <Setter Property="BorderBrush" TargetName="splitBorder" Value="{StaticResource ComboBox.Pressed.Editable.Button.Border}"/>
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Mode=Self}}" Value="false"/>
- <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="false"/>
- </MultiDataTrigger.Conditions>
- <Setter Property="Background" TargetName="templateRoot" Value="{StaticResource ComboBox.Disabled.Background}"/>
- <Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.Disabled.Border}"/>
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Mode=Self}}" Value="false"/>
- <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="true"/>
- </MultiDataTrigger.Conditions>
- <Setter Property="Background" TargetName="templateRoot" Value="{StaticResource ComboBox.Disabled.Editable.Background}"/>
- <Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.Disabled.Editable.Border}"/>
- <Setter Property="Background" TargetName="splitBorder" Value="{StaticResource ComboBox.Disabled.Editable.Button.Background}"/>
- <Setter Property="BorderBrush" TargetName="splitBorder" Value="{StaticResource ComboBox.Disabled.Editable.Button.Border}"/>
- </MultiDataTrigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <ControlTemplate x:Key="ComboBoxTemplate1" TargetType="{x:Type ComboBox}">
- <Grid x:Name="templateRoot" SnapsToDevicePixels="true">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*"/>
- <ColumnDefinition MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" Width="50"/>
- </Grid.ColumnDefinitions>
- <Popup x:Name="PART_Popup" AllowsTransparency="true" Grid.ColumnSpan="2" IsOpen="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource Mode=TemplatedParent}}" Margin="1" Placement="Bottom" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}">
- <theme:SystemDropShadowChrome x:Name="shadow" Color="Transparent" MinWidth="{Binding ActualWidth, ElementName=templateRoot}" MaxHeight="{TemplateBinding MaxDropDownHeight}">
- <Border x:Name="dropDownBorder" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" BorderThickness="1">
- <ScrollViewer x:Name="DropDownScrollViewer">
- <Grid x:Name="grid" RenderOptions.ClearTypeHint="Enabled">
- <Canvas x:Name="canvas" HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0">
- <Rectangle x:Name="opaqueRect" Fill="{Binding Background, ElementName=dropDownBorder}" Height="{Binding ActualHeight, ElementName=dropDownBorder}" Width="{Binding ActualWidth, ElementName=dropDownBorder}"/>
- </Canvas>
- <ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
- </Grid>
- </ScrollViewer>
- </Border>
- </theme:SystemDropShadowChrome>
- </Popup>
- <ToggleButton x:Name="toggleButton" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource Mode=TemplatedParent}}" Style="{StaticResource ComboBoxToggleButton}"/>
- <ContentPresenter x:Name="contentPresenter" ContentStringFormat="{TemplateBinding SelectionBoxItemStringFormat}" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" Content="{TemplateBinding SelectionBoxItem}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" IsHitTestVisible="false" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
- <Setter Property="Margin" TargetName="shadow" Value="0,0,5,5"/>
- <Setter Property="Color" TargetName="shadow" Value="#71000000"/>
- </Trigger>
- <Trigger Property="HasItems" Value="false">
- <Setter Property="Height" TargetName="dropDownBorder" Value="95"/>
- </Trigger>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="IsGrouping" Value="true"/>
- <Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/>
- </MultiTrigger.Conditions>
- <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
- </MultiTrigger>
- <Trigger Property="ScrollViewer.CanContentScroll" SourceName="DropDownScrollViewer" Value="false">
- <Setter Property="Canvas.Top" TargetName="opaqueRect" Value="{Binding VerticalOffset, ElementName=DropDownScrollViewer}"/>
- <Setter Property="Canvas.Left" TargetName="opaqueRect" Value="{Binding HorizontalOffset, ElementName=DropDownScrollViewer}"/>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- <SolidColorBrush x:Key="TextBox.MouseOver.Border" Color="#FF7EB4EA"/>
- <SolidColorBrush x:Key="TextBox.Focus.Border" Color="#FF569DE5"/>
- <ControlTemplate x:Key="TextBoxTemplate1" TargetType="{x:Type TextBoxBase}">
- <Border x:Name="border" CornerRadius="10" BorderBrush="Black" BorderThickness="1" SnapsToDevicePixels="True">
- <Border.Background>
- <SolidColorBrush Color="White" Opacity="0.5"/>
- </Border.Background>
- <ScrollViewer x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>
- </Border>
- <ControlTemplate.Triggers>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- <SolidColorBrush x:Key="brushWatermarkBackground" Color="White" />
- <SolidColorBrush x:Key="brushWatermarkForeground" Color="LightSteelBlue" />
- <SolidColorBrush x:Key="brushWatermarkBorder" Color="Indigo" />
- <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
- <Style x:Key="EntryFieldStyle" TargetType="Grid" >
- <Setter Property="HorizontalAlignment" Value="Stretch" />
- <Setter Property="VerticalAlignment" Value="Center" />
- </Style>
- </Page.Resources>
- <Grid Background="#00A08A">
- <Grid.RowDefinitions>
- <RowDefinition Height="160"/>
- <RowDefinition/>
- </Grid.RowDefinitions>
- <Grid Grid.Row="0" HorizontalAlignment="Stretch" VerticalAlignment="Center">
- <ComboBox SelectionChanged="ChangeCategory" FontSize="30" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" SelectedIndex="0" Margin="20,0,0,0" Template="{DynamicResource ComboBoxTemplate1}" Name="CategoryFilter" HorizontalAlignment="Left" Height="70" Width="370"/>
- <TextBox TextChanged="SearchChanged" Name="SearchBar" ToolTip="Поиск" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" FontSize="30" Template="{DynamicResource TextBoxTemplate1}" HorizontalAlignment="Center" Background="#0000" Height="70" Width="370" />
- <Button Click="GoToUserPage" Margin="0,0,20,0" Background="#FFA400" Template="{StaticResource ButtonTemplate1}" HorizontalAlignment="Right" Height="135" Width="110">
- <Button.Content>
- <Image Width="90" Height="110" Source="/Resources/Account.png"/>
- </Button.Content>
- </Button>
- </Grid>
- <ListView Margin="0,10,0,10" Name="TestList" Grid.Row="1" Background="#0000" BorderThickness="0">
- <ListView.ItemsPanel>
- <ItemsPanelTemplate>
- <StackPanel Width="1400"/>
- </ItemsPanelTemplate>
- </ListView.ItemsPanel>
- <ListView.ItemTemplate>
- <DataTemplate>
- <Border VerticalAlignment="Center" CornerRadius="10" BorderThickness="2" BorderBrush="Black" Height="370" Width="1400">
- <Border.Background>
- <SolidColorBrush Color="White" Opacity="0.5"/>
- </Border.Background>
- <Grid Width="1400">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*"/>
- <ColumnDefinition Width="2*"/>
- </Grid.ColumnDefinitions>
-
- <Image Margin="60,0,0,0" Grid.Column="0" HorizontalAlignment="Left" Uid="{Binding Test_id}" Width="260" Height="260" Loaded="Image_Loaded"/>
- <StackPanel Grid.Column="1" HorizontalAlignment="Center">
- <TextBlock Margin="0,35,0,0" Text="{Binding Test_name}" FontSize="40" HorizontalAlignment="Center"/>
- <TextBlock Margin="0,20,0,0" TextWrapping="Wrap" Text="{Binding Description}" FontSize="20" HorizontalAlignment="Center"/>
- <TextBlock Margin="0,20,0,0" Text="{Binding StringFormat=Количество вопросов: {0}, Path=Questions_count}" FontSize="18" HorizontalAlignment="Center"/>
- <Button Uid="{Binding Test_id}" Click="GoToTestPage" Margin="0,20,0,0" Content="Пройти тест" FontSize="30" Template="{DynamicResource ButtonTemplate1}" Width="540" Height="60" Background="#FFA400" BorderBrush="#0000"/>
- </StackPanel>
- </Grid>
- </Border>
- </DataTemplate>
- </ListView.ItemTemplate>
- </ListView>
-
- </Grid>
- </Page>
|