681 lines
47 KiB
XML
681 lines
47 KiB
XML
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:VM="clr-namespace:Common.UI.ViewModels"
|
|
xmlns:Views="clr-namespace:Common.UI.Views"
|
|
xmlns:Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero2" x:Class="Common.UI.Pages.Eregister"
|
|
WindowTitle="UI / Eregister test environment"
|
|
Title="Eregister">
|
|
<Page.Resources>
|
|
<Style x:Key="FocusVisual">
|
|
<Setter Property="Control.Template">
|
|
<Setter.Value>
|
|
<ControlTemplate>
|
|
<Rectangle Margin="2" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
<LinearGradientBrush x:Key="ComboBox.Static.Background" EndPoint="0,1" StartPoint="0,0">
|
|
<GradientStop Color="White" Offset="0.0"/>
|
|
<GradientStop Color="White" Offset="1.0"/>
|
|
</LinearGradientBrush>
|
|
<SolidColorBrush x:Key="ComboBox.Static.Border" Color="#FFBFBFBF"/>
|
|
<SolidColorBrush x:Key="ComboBox.Static.Editable.Background" Color="#FFFFFFFF"/>
|
|
<SolidColorBrush x:Key="ComboBox.Static.Editable.Border" Color="White"/>
|
|
<SolidColorBrush x:Key="ComboBox.Static.Editable.Button.Background" Color="Transparent"/>
|
|
<SolidColorBrush x:Key="ComboBox.Static.Editable.Button.Border" Color="Transparent"/>
|
|
<SolidColorBrush x:Key="ComboBox.MouseOver.Glyph" Color="#FF000000"/>
|
|
<LinearGradientBrush x:Key="ComboBox.MouseOver.Background" EndPoint="0,1" StartPoint="0,0">
|
|
<GradientStop Color="White" Offset="0.0"/>
|
|
<GradientStop Color="White" Offset="1.0"/>
|
|
</LinearGradientBrush>
|
|
<SolidColorBrush x:Key="ComboBox.MouseOver.Border" Color="#FF7EB4EA"/>
|
|
<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="White" Offset="0.0"/>
|
|
<GradientStop Color="White" Offset="1.0"/>
|
|
</LinearGradientBrush>
|
|
<SolidColorBrush x:Key="ComboBox.MouseOver.Editable.Button.Border" Color="White"/>
|
|
<SolidColorBrush x:Key="ComboBox.Pressed.Glyph" Color="#FF000000"/>
|
|
<LinearGradientBrush x:Key="ComboBox.Pressed.Background" EndPoint="0,1" StartPoint="0,0">
|
|
<GradientStop Color="White" Offset="0.0"/>
|
|
<GradientStop Color="White" Offset="1.0"/>
|
|
</LinearGradientBrush>
|
|
<SolidColorBrush x:Key="ComboBox.Pressed.Border" Color="White"/>
|
|
<SolidColorBrush x:Key="ComboBox.Pressed.Editable.Background" Color="#FFFFFFFF"/>
|
|
<SolidColorBrush x:Key="ComboBox.Pressed.Editable.Border" Color="White"/>
|
|
<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.Glyph" Color="#FFBFBFBF"/>
|
|
<SolidColorBrush x:Key="ComboBox.Disabled.Background" Color="#FFF0F0F0"/>
|
|
<SolidColorBrush x:Key="ComboBox.Disabled.Border" Color="#FFD9D9D9"/>
|
|
<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"/>
|
|
<SolidColorBrush x:Key="ComboBox.Static.Glyph" Color="#FF606060"/>
|
|
<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"
|
|
BorderBrush="{StaticResource ComboBox.Static.Border}"
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
Background="{StaticResource ComboBox.Static.Background}"
|
|
SnapsToDevicePixels="true">
|
|
<Border x:Name="splitBorder" BorderBrush="Transparent" BorderThickness="1" HorizontalAlignment="Right" Margin="0" SnapsToDevicePixels="true" Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}">
|
|
<Path x:Name="arrow" Data="F1 M 0,0 L 2.667,2.66665 L 5.3334,0 L 5.3334,-1.78168 L 2.6667,0.88501 L0,-1.78168 L0,0 Z" Fill="{StaticResource ComboBox.Static.Glyph}" HorizontalAlignment="Center" Margin="0" VerticalAlignment="Center"/>
|
|
</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 Self}}" Value="false"/>
|
|
<Condition Binding="{Binding IsPressed, RelativeSource={RelativeSource Self}}" Value="false"/>
|
|
<Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource 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>
|
|
<Trigger Property="IsMouseOver" Value="true">
|
|
<Setter Property="Fill" TargetName="arrow" Value="{StaticResource ComboBox.MouseOver.Glyph}"/>
|
|
</Trigger>
|
|
<MultiDataTrigger>
|
|
<MultiDataTrigger.Conditions>
|
|
<Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
|
|
<Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="false"/>
|
|
</MultiDataTrigger.Conditions>
|
|
<Setter Property="Background" TargetName="templateRoot" Value="{StaticResource ComboBox.MouseOver.Background}"/>
|
|
<Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.MouseOver.Border}"/>
|
|
</MultiDataTrigger>
|
|
<MultiDataTrigger>
|
|
<MultiDataTrigger.Conditions>
|
|
<Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource 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>
|
|
<Trigger Property="IsPressed" Value="true">
|
|
<Setter Property="Fill" TargetName="arrow" Value="{StaticResource ComboBox.Pressed.Glyph}"/>
|
|
</Trigger>
|
|
<MultiDataTrigger>
|
|
<MultiDataTrigger.Conditions>
|
|
<Condition Binding="{Binding IsPressed, RelativeSource={RelativeSource Self}}" Value="true"/>
|
|
<Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="false"/>
|
|
</MultiDataTrigger.Conditions>
|
|
<Setter Property="Background" TargetName="templateRoot" Value="{StaticResource ComboBox.Pressed.Background}"/>
|
|
<Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.Pressed.Border}"/>
|
|
</MultiDataTrigger>
|
|
<MultiDataTrigger>
|
|
<MultiDataTrigger.Conditions>
|
|
<Condition Binding="{Binding IsPressed, RelativeSource={RelativeSource 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.Pressed.Editable.Background}"/>
|
|
<Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.Pressed.Editable.Border}"/>
|
|
<Setter Property="Background" TargetName="splitBorder" Value="{StaticResource ComboBox.Pressed.Editable.Button.Background}"/>
|
|
<Setter Property="BorderBrush" TargetName="splitBorder" Value="{StaticResource ComboBox.Pressed.Editable.Button.Border}"/>
|
|
</MultiDataTrigger>
|
|
<Trigger Property="IsEnabled" Value="false">
|
|
<Setter Property="Fill" TargetName="arrow" Value="{StaticResource ComboBox.Disabled.Glyph}"/>
|
|
</Trigger>
|
|
<MultiDataTrigger>
|
|
<MultiDataTrigger.Conditions>
|
|
<Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource 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 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="ComboBoxTemplate" TargetType="{x:Type ComboBox}">
|
|
<Grid x:Name="templateRoot" SnapsToDevicePixels="true">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" Width="0"/>
|
|
</Grid.ColumnDefinitions>
|
|
<Popup x:Name="PART_Popup" AllowsTransparency="true" Grid.ColumnSpan="2" IsOpen="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Margin="1" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom">
|
|
<Themes:SystemDropShadowChrome x:Name="shadow"
|
|
Color="Transparent"
|
|
MaxHeight="{TemplateBinding MaxDropDownHeight}"
|
|
MinWidth="{Binding ActualWidth, ElementName=templateRoot}">
|
|
<Border x:Name="dropDownBorder"
|
|
BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}"
|
|
BorderThickness="1"
|
|
Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}">
|
|
<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>
|
|
</Themes:SystemDropShadowChrome>
|
|
</Popup>
|
|
<ToggleButton x:Name="toggleButton" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.ColumnSpan="2" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource ComboBoxToggleButton}"/>
|
|
<ContentPresenter x:Name="contentPresenter"
|
|
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
|
|
ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
|
|
Content="{TemplateBinding SelectionBoxItem}"
|
|
ContentStringFormat="{TemplateBinding SelectionBoxItemStringFormat}"
|
|
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.Static.Background" Color="#FFFFFFFF"/>
|
|
<Style x:Key="ComboBoxEditableTextBox" TargetType="{x:Type TextBox}">
|
|
<Setter Property="OverridesDefaultStyle" Value="true"/>
|
|
<Setter Property="AllowDrop" Value="true"/>
|
|
<Setter Property="MinWidth" Value="0"/>
|
|
<Setter Property="MinHeight" Value="0"/>
|
|
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
|
|
<Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/>
|
|
<Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type TextBox}">
|
|
<ScrollViewer x:Name="PART_ContentHost"
|
|
Background="Transparent"
|
|
Focusable="false"
|
|
HorizontalScrollBarVisibility="Hidden"
|
|
VerticalScrollBarVisibility="Hidden"/>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
<ControlTemplate x:Key="ComboBoxEditableTemplate" TargetType="{x:Type ComboBox}">
|
|
<Grid x:Name="templateRoot" SnapsToDevicePixels="true">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" Width="0"/>
|
|
</Grid.ColumnDefinitions>
|
|
<Popup x:Name="PART_Popup" AllowsTransparency="true" Grid.ColumnSpan="2" IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom">
|
|
<Themes:SystemDropShadowChrome x:Name="shadow" Color="Transparent" MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding ActualWidth, ElementName=templateRoot}">
|
|
<Border x:Name="dropDownBorder" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" BorderThickness="1" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}">
|
|
<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>
|
|
</Themes:SystemDropShadowChrome>
|
|
</Popup>
|
|
<ToggleButton x:Name="toggleButton" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.ColumnSpan="2" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource ComboBoxToggleButton}"/>
|
|
<Border x:Name="border"
|
|
Background="{StaticResource TextBox.Static.Background}"
|
|
Margin="{TemplateBinding BorderThickness}">
|
|
<TextBox x:Name="PART_EditableTextBox"
|
|
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
IsReadOnly="{Binding IsReadOnly, RelativeSource={RelativeSource TemplatedParent}}"
|
|
Margin="{TemplateBinding Padding}"
|
|
Style="{StaticResource ComboBoxEditableTextBox}"
|
|
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
|
</Border>
|
|
</Grid>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsEnabled" Value="false">
|
|
<Setter Property="Opacity" TargetName="border" Value="0.56"/>
|
|
</Trigger>
|
|
<Trigger Property="IsKeyboardFocusWithin" Value="true">
|
|
<Setter Property="Foreground" Value="Black"/>
|
|
</Trigger>
|
|
<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>
|
|
<Style x:Key="ComboBoxStyle" TargetType="{x:Type ComboBox}">
|
|
<Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
|
|
<Setter Property="Background" Value="{StaticResource ComboBox.Static.Background}"/>
|
|
<Setter Property="BorderBrush" Value="{StaticResource ComboBox.Static.Border}"/>
|
|
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"/>
|
|
<Setter Property="BorderThickness" Value="1"/>
|
|
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
|
|
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
|
|
<Setter Property="Padding" Value="6,3,5,3"/>
|
|
<Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
|
|
<Setter Property="ScrollViewer.PanningMode" Value="Both"/>
|
|
<Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
|
|
<Setter Property="Template" Value="{StaticResource ComboBoxTemplate}"/>
|
|
<Style.Triggers>
|
|
<Trigger Property="IsEditable" Value="true">
|
|
<Setter Property="IsTabStop" Value="false"/>
|
|
<Setter Property="Padding" Value="2"/>
|
|
<Setter Property="Template" Value="{StaticResource ComboBoxEditableTemplate}"/>
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
<Style x:Key="TreeViewItemFocusVisual">
|
|
<Setter Property="Control.Template">
|
|
<Setter.Value>
|
|
<ControlTemplate>
|
|
<Rectangle/>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
<SolidColorBrush x:Key="TreeViewItem.TreeArrow.Static.Checked.Fill" Color="#FF595959"/>
|
|
<SolidColorBrush x:Key="TreeViewItem.TreeArrow.Static.Checked.Stroke" Color="#FF262626"/>
|
|
<SolidColorBrush x:Key="TreeViewItem.TreeArrow.MouseOver.Stroke" Color="#FF27C7F7"/>
|
|
<SolidColorBrush x:Key="TreeViewItem.TreeArrow.MouseOver.Fill" Color="#FFCCEEFB"/>
|
|
<SolidColorBrush x:Key="TreeViewItem.TreeArrow.MouseOver.Checked.Stroke" Color="#FF1CC4F7"/>
|
|
<SolidColorBrush x:Key="TreeViewItem.TreeArrow.MouseOver.Checked.Fill" Color="#FF82DFFB"/>
|
|
<PathGeometry x:Key="TreeArrow" Figures="M0,0 L0,6 L6,0 z"/>
|
|
<SolidColorBrush x:Key="TreeViewItem.TreeArrow.Static.Fill" Color="#FFFFFFFF"/>
|
|
<SolidColorBrush x:Key="TreeViewItem.TreeArrow.Static.Stroke" Color="#FF818181"/>
|
|
<Style x:Key="ExpandCollapseToggleStyle" TargetType="{x:Type ToggleButton}">
|
|
<Setter Property="Focusable" Value="False"/>
|
|
<Setter Property="Width" Value="16"/>
|
|
<Setter Property="Height" Value="16"/>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type ToggleButton}">
|
|
<Border Background="Transparent" Height="16" Padding="5,5,5,5" Width="16">
|
|
<Path x:Name="ExpandPath" Data="{StaticResource TreeArrow}" Fill="{StaticResource TreeViewItem.TreeArrow.Static.Fill}" Stroke="{StaticResource TreeViewItem.TreeArrow.Static.Stroke}">
|
|
<Path.RenderTransform>
|
|
<RotateTransform Angle="135" CenterY="3" CenterX="3"/>
|
|
</Path.RenderTransform>
|
|
</Path>
|
|
</Border>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsChecked" Value="True">
|
|
<Setter Property="RenderTransform" TargetName="ExpandPath">
|
|
<Setter.Value>
|
|
<RotateTransform Angle="180" CenterY="3" CenterX="3"/>
|
|
</Setter.Value>
|
|
</Setter>
|
|
<Setter Property="Fill" TargetName="ExpandPath" Value="{StaticResource TreeViewItem.TreeArrow.Static.Checked.Fill}"/>
|
|
<Setter Property="Stroke" TargetName="ExpandPath" Value="{StaticResource TreeViewItem.TreeArrow.Static.Checked.Stroke}"/>
|
|
</Trigger>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter Property="Stroke" TargetName="ExpandPath" Value="{StaticResource TreeViewItem.TreeArrow.MouseOver.Stroke}"/>
|
|
<Setter Property="Fill" TargetName="ExpandPath" Value="{StaticResource TreeViewItem.TreeArrow.MouseOver.Fill}"/>
|
|
</Trigger>
|
|
<MultiTrigger>
|
|
<MultiTrigger.Conditions>
|
|
<Condition Property="IsMouseOver" Value="True"/>
|
|
<Condition Property="IsChecked" Value="True"/>
|
|
</MultiTrigger.Conditions>
|
|
<Setter Property="Stroke" TargetName="ExpandPath" Value="{StaticResource TreeViewItem.TreeArrow.MouseOver.Checked.Stroke}"/>
|
|
<Setter Property="Fill" TargetName="ExpandPath" Value="{StaticResource TreeViewItem.TreeArrow.MouseOver.Checked.Fill}"/>
|
|
</MultiTrigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
<Style x:Key="TreeViewItemWithValueStyle" TargetType="{x:Type TreeViewItem}">
|
|
<Setter Property="Background" Value="Transparent"/>
|
|
<Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
|
|
<Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
|
|
<Setter Property="Padding" Value="1,0,0,0"/>
|
|
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
|
|
<Setter Property="FocusVisualStyle" Value="{StaticResource TreeViewItemFocusVisual}"/>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type TreeViewItem}">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition MinWidth="19" Width="Auto"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition/>
|
|
</Grid.RowDefinitions>
|
|
<ToggleButton x:Name="Expander" ClickMode="Press" IsChecked="{Binding IsExpanded, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource ExpandCollapseToggleStyle}"/>
|
|
<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.Column="1" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
|
|
<ContentPresenter x:Name="PART_Header" ContentSource="Header" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
|
</Border>
|
|
<ItemsPresenter x:Name="ItemsHost" Grid.ColumnSpan="2" Grid.Column="1" Grid.Row="1"/>
|
|
</Grid>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsExpanded" Value="false">
|
|
<Setter Property="Visibility" TargetName="ItemsHost" Value="Collapsed"/>
|
|
</Trigger>
|
|
<Trigger Property="HasItems" Value="false">
|
|
<Setter Property="Visibility" TargetName="Expander" Value="Hidden"/>
|
|
</Trigger>
|
|
<Trigger Property="IsSelected" Value="true">
|
|
<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
|
|
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
|
|
</Trigger>
|
|
<MultiTrigger>
|
|
<MultiTrigger.Conditions>
|
|
<Condition Property="IsSelected" Value="true"/>
|
|
<Condition Property="IsSelectionActive" Value="false"/>
|
|
</MultiTrigger.Conditions>
|
|
<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightBrushKey}}"/>
|
|
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightTextBrushKey}}"/>
|
|
</MultiTrigger>
|
|
<Trigger Property="IsEnabled" Value="false">
|
|
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
<Style.Triggers>
|
|
<Trigger Property="VirtualizingPanel.IsVirtualizing" Value="true">
|
|
<Setter Property="ItemsPanel">
|
|
<Setter.Value>
|
|
<ItemsPanelTemplate>
|
|
<VirtualizingStackPanel/>
|
|
</ItemsPanelTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</Page.Resources>
|
|
<Page.DataContext>
|
|
<VM:EregisterVM />
|
|
</Page.DataContext>
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="*" />
|
|
</Grid.RowDefinitions>
|
|
<Views:MainMenuView Grid.Row="0" />
|
|
<Border BorderBrush="LightGray"
|
|
BorderThickness="0, 0, 0, 1"
|
|
Grid.Row="1">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="Auto" />
|
|
</Grid.ColumnDefinitions>
|
|
<StackPanel Grid.Column="0" Orientation="Horizontal">
|
|
<ComboBox HorizontalAlignment="Left"
|
|
IsEnabled="{Binding IsConnectEnabled}"
|
|
ItemsSource="{Binding COMPorts}"
|
|
Margin="5"
|
|
Padding="3"
|
|
SelectedItem="{Binding COMPort}"
|
|
Style="{DynamicResource ComboBoxStyle}"
|
|
VerticalAlignment="Stretch"
|
|
Width="80" />
|
|
<Button Background="White"
|
|
BorderBrush="#FFC0C0C0"
|
|
Command="{Binding ConnectCommand}"
|
|
Content="Connect"
|
|
HorizontalAlignment="Left"
|
|
Visibility="{Binding IsConnectEnabled, Converter={StaticResource BooleanToVisibility}}"
|
|
Margin="0, 5, 5, 5"
|
|
Padding="15, 0"
|
|
VerticalAlignment="Stretch" />
|
|
<Button Background="White"
|
|
BorderBrush="#FFC0C0C0"
|
|
Command="{Binding DisconnectCommand}"
|
|
Content="Disconnect"
|
|
HorizontalAlignment="Left"
|
|
Visibility="{Binding IsDisconnectEnabled, Converter={StaticResource BooleanToVisibility}}"
|
|
Margin="0, 5, 5, 5"
|
|
Padding="15, 0"
|
|
VerticalAlignment="Stretch" />
|
|
</StackPanel>
|
|
<StackPanel Grid.Column="2" Orientation="Horizontal">
|
|
<Label Content="{Binding SirtId}"
|
|
FontSize="11"
|
|
FontWeight="bold"
|
|
Margin="5"
|
|
Padding="0"
|
|
VerticalAlignment="Stretch"
|
|
VerticalContentAlignment="Center"/>
|
|
<Label Content="{Binding Frequency}"
|
|
FontSize="11"
|
|
FontWeight="bold"
|
|
Margin="0, 5, 5, 5"
|
|
Padding="0"
|
|
VerticalAlignment="Stretch"
|
|
VerticalContentAlignment="Center" />
|
|
<Border Background="{Binding IsConnected, Converter={StaticResource BooleanToBackground}}"
|
|
BorderBrush="{Binding IsConnected, Converter={StaticResource BooleanToBorder}}"
|
|
BorderThickness="1"
|
|
CornerRadius="7"
|
|
Height="14"
|
|
Margin="5, 5, 15, 5"
|
|
VerticalAlignment="Center"
|
|
Width="14"/>
|
|
</StackPanel>
|
|
</Grid>
|
|
</Border>
|
|
<Grid Grid.Row="2" Visibility="{Binding IsConnected, Converter={StaticResource BooleanToVisibility}}">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition MinWidth="100" Width="Auto" />
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="1*" />
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="1*" />
|
|
</Grid.ColumnDefinitions>
|
|
<Grid Grid.Column="0"
|
|
Visibility="{Binding IsConnected, Converter={StaticResource BooleanToVisibility}}">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="*" />
|
|
</Grid.RowDefinitions>
|
|
<Label Background="LightGray"
|
|
Content="{Binding AddressesCount}"
|
|
FontSize="12"
|
|
FontWeight="Bold"
|
|
Grid.Row="0"
|
|
Margin="0"
|
|
Padding="10, 5, 25, 5"/>
|
|
<ScrollViewer Grid.Row="1"
|
|
HorizontalScrollBarVisibility="Hidden"
|
|
VerticalScrollBarVisibility="Auto">
|
|
<ItemsControl ItemsSource="{Binding Addresses}">
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate>
|
|
<RadioButton Command="{Binding Path=DataContext.PickAddressCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Page}}}"
|
|
CommandParameter="{Binding .}"
|
|
Content="{Binding .}"
|
|
FontSize="12"
|
|
FontWeight="Bold"
|
|
Foreground="DimGray"
|
|
GroupName="addresses"
|
|
HorizontalAlignment="Stretch"
|
|
HorizontalContentAlignment="Left"
|
|
Margin="5, 0, 0, 0"
|
|
Padding="10, 3, 25, 3"
|
|
VerticalAlignment="Top"
|
|
VerticalContentAlignment="Center"/>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
</ScrollViewer>
|
|
</Grid>
|
|
<GridSplitter BorderBrush="LightGray"
|
|
BorderThickness="1, 0, 1, 0"
|
|
Grid.Column="1"
|
|
ResizeBehavior="PreviousAndNext"
|
|
ResizeDirection="Columns"
|
|
Width="3" />
|
|
<Grid Grid.Column="2"
|
|
Visibility="{Binding AddressSelected, Converter={StaticResource BooleanToVisibility}}">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="*" />
|
|
</Grid.RowDefinitions>
|
|
<Label Background="LightGray"
|
|
Content="{Binding Address}"
|
|
FontSize="12"
|
|
FontWeight="Bold"
|
|
Grid.Row="0"
|
|
HorizontalAlignment="Stretch"
|
|
HorizontalContentAlignment="Stretch"
|
|
Margin="0"
|
|
Padding="10, 5, 10, 5">
|
|
<Label.ContentTemplate>
|
|
<DataTemplate>
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="Auto" />
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock Grid.Column="0"
|
|
Margin="0"
|
|
Padding="0"
|
|
Text="{Binding .}" />
|
|
<Path Cursor="Hand"
|
|
Fill="Red"
|
|
Grid.Column="1"
|
|
Height="12"
|
|
Stretch="Uniform"
|
|
Width="12">
|
|
<Path.Data>
|
|
<GeometryGroup>
|
|
<PathGeometry Figures="M6.5 1h3a.5.5 0 0 1 .5.5v1H6v-1a.5.5 0 0 1 .5-.5M11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3A1.5 1.5 0 0 0 5 1.5v1H1.5a.5.5 0 0 0 0 1h.538l.853 10.66A2 2 0 0 0 4.885 16h6.23a2 2 0 0 0 1.994-1.84l.853-10.66h.538a.5.5 0 0 0 0-1zm1.958 1-.846 10.58a1 1 0 0 1-.997.92h-6.23a1 1 0 0 1-.997-.92L3.042 3.5zm-7.487 1a.5.5 0 0 1 .528.47l.5 8.5a.5.5 0 0 1-.998.06L5 5.03a.5.5 0 0 1 .47-.53Zm5.058 0a.5.5 0 0 1 .47.53l-.5 8.5a.5.5 0 1 1-.998-.06l.5-8.5a.5.5 0 0 1 .528-.47M8 4.5a.5.5 0 0 1 .5.5v8.5a.5.5 0 0 1-1 0V5a.5.5 0 0 1 .5-.5" />
|
|
</GeometryGroup>
|
|
</Path.Data>
|
|
<Path.InputBindings>
|
|
<MouseBinding Command="{Binding Path=DataContext.RemoveAddressCommand
|
|
, RelativeSource={RelativeSource Mode=FindAncestor
|
|
, AncestorType={x:Type Page}}}"
|
|
MouseAction="LeftClick" />
|
|
</Path.InputBindings>
|
|
</Path>
|
|
</Grid>
|
|
</DataTemplate>
|
|
</Label.ContentTemplate>
|
|
</Label>
|
|
<ScrollViewer Grid.Row="1"
|
|
HorizontalScrollBarVisibility="Hidden"
|
|
VerticalScrollBarVisibility="Auto">
|
|
<ItemsControl ItemsSource="{Binding EregisterProperties}">
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate DataType="{x:Type VM:KvpViewModel}">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="210" />
|
|
<ColumnDefinition Width="*" />
|
|
</Grid.ColumnDefinitions>
|
|
<Label BorderBrush="LightGray"
|
|
BorderThickness="0, 0, 1, 1"
|
|
Content="{Binding Key}"
|
|
FontSize="12"
|
|
FontWeight="Bold"
|
|
Grid.Column="0"
|
|
Grid.Row="{Binding Row}"
|
|
Margin="0"
|
|
Padding="10, 5"/>
|
|
<Label BorderBrush="LightGray"
|
|
BorderThickness="0, 0, 0, 1"
|
|
Content="{Binding Value}"
|
|
FontSize="12"
|
|
FontWeight="Bold"
|
|
Grid.Column="1"
|
|
Grid.Row="{Binding Row}"
|
|
Margin="0"
|
|
Padding="10, 5" />
|
|
</Grid>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
</ScrollViewer>
|
|
</Grid>
|
|
<GridSplitter BorderBrush="LightGray"
|
|
BorderThickness="1, 0, 1, 0"
|
|
Grid.Column="3"
|
|
ResizeBehavior="PreviousAndNext"
|
|
ResizeDirection="Columns"
|
|
Width="3" />
|
|
<Grid Grid.Column="4"
|
|
Visibility="{Binding AddressSelected, Converter={StaticResource BooleanToVisibility}}">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="*" />
|
|
</Grid.RowDefinitions>
|
|
<Button Command="{Binding StartProgrammingCommand}"
|
|
Content="Start programming"
|
|
Grid.Row="0"
|
|
HorizontalAlignment="Left"
|
|
Padding="30, 5"/>
|
|
|
|
</Grid>
|
|
</Grid>
|
|
</Grid>
|
|
</Page>
|