mirror of
https://github.com/openziti/desktop-edge-win.git
synced 2026-09-24 11:52:02 +00:00
2f7e53f02c
* feat: bump dependencies (NuGet 8 -> 10, NLog 5 -> 6) * feat: shared IPC data structures for policy state * feat: registry policy reader with WMI watcher * feat: monitor service policy enforcement, maintenance window, deferred install * feat: UI policy state propagation, locks, deferred-install + sentinel UX fix * feat: ADMX/ADML templates, admin guide, helper script, test runbook * chore: build tooling, MSI SHA256, version bump, release notes * more reworking around the adml/admx/md * build and upload ADMX/ADML admin templates zip * updates from looking at / testing GPO UI * missed the prepare-for-tests ps1 * add boms to all ps1's just in case * update test-run for more vebosity to allow humans to understand * more updates to release notes * Fix alignment on "from" label for maintenance window * Remove arrow pointing to task bar * Remove unused selection changed stub * Ensure logical hour value is passed to maintenance window start/end * Fix invalid URL error not showing - ensure maintenance start/end time errors return correctly Change variable names * reworking new-upcoming-releasenotes * publish admin templates zip + sha256 sidecar to GitHub release, update release note * add tatooing words * reword clamping words --------- Co-authored-by: Christopher Britton <christopher.l.britton@outlook.com>
554 lines
44 KiB
XML
554 lines
44 KiB
XML
<!--
|
|
Copyright NetFoundry Inc.
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
https://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
-->
|
|
<Application x:Class="ZitiDesktopEdge.App"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:local="clr-namespace:ZitiDesktopEdge"
|
|
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
|
xmlns:Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero2"
|
|
xmlns:uiutils="clr-namespace:Ziti.Desktop.Edge.Utils"
|
|
ShutdownMode="OnExplicitShutdown"
|
|
StartupUri="MainWindow.xaml">
|
|
<Application.Resources>
|
|
<ResourceDictionary>
|
|
<ResourceDictionary.MergedDictionaries>
|
|
<ResourceDictionary Source="./Styles/ScrollBarStyles.xaml"/>
|
|
</ResourceDictionary.MergedDictionaries>
|
|
<Thickness x:Key="MarginTop10">0,10,0,0</Thickness>
|
|
<Color x:Key="ContextMenuTextNormal">#C0C0C0</Color>
|
|
<Color x:Key="ContextMenuTextHover">#ffffff</Color>
|
|
<Color x:Key="DarkBackground">#131429</Color>
|
|
<Color x:Key="InvalidUrlDark">#FF860000</Color>
|
|
<Color x:Key="InvalidUrlLight">#FFECB5B5</Color>
|
|
<Color x:Key="LightBackground">#2b3046</Color>
|
|
<Color x:Key="VeryLightBackground">#cbcDd4</Color>
|
|
<Color x:Key="ColumnHeaderText">#7d8faf</Color>
|
|
|
|
<SolidColorBrush x:Key="DarkBackgroundBrush" Color="{StaticResource DarkBackground}" />
|
|
<SolidColorBrush x:Key="LightBackgroundBrush" Color="{StaticResource LightBackground}" />
|
|
<SolidColorBrush x:Key="VeryLightBackgroundBrush" Color="{StaticResource VeryLightBackground}" />
|
|
<SolidColorBrush x:Key="ContextMenuTextNormalBrush" Color="{StaticResource ContextMenuTextNormal}" />
|
|
<SolidColorBrush x:Key="ContextMenuTextHoverBrush" Color="{StaticResource ContextMenuTextHover}" />
|
|
<SolidColorBrush x:Key="InvalidUrlBorderBrush" Color="{StaticResource InvalidUrlDark}" />
|
|
<SolidColorBrush x:Key="InvalidUrlBackgroundBrush" Color="{StaticResource InvalidUrlLight}" />
|
|
<SolidColorBrush x:Key="ColumnHeaderTextBrush" Color="{StaticResource ColumnHeaderText}" />
|
|
|
|
<Style x:Key="SectionDivider" TargetType="Rectangle">
|
|
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
|
<Setter Property="Height" Value="1"/>
|
|
<Setter Property="Fill" Value="{StaticResource ColumnHeaderTextBrush}"/>
|
|
<Setter Property="Opacity" Value="0.2"/>
|
|
</Style>
|
|
|
|
|
|
|
|
<Color x:Key="ButtonColor">#FF7EB4EA</Color>
|
|
<SolidColorBrush x:Key="ButtonBrush" Color="{StaticResource ButtonColor}"/>
|
|
<LinearGradientBrush x:Key="ComboBox.Static.Background" EndPoint="0,1" StartPoint="0,0">
|
|
<GradientStop Color="#FFFFFFFF" Offset="0.0"/>
|
|
<GradientStop Color="#FFFFFFFF" Offset="1.0"/>
|
|
</LinearGradientBrush>
|
|
<SolidColorBrush x:Key="ComboBox.Static.Border" Color="#FFACACAC"/>
|
|
<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"/>
|
|
<SolidColorBrush x:Key="ComboBox.MouseOver.Glyph" Color="#FF000000"/>
|
|
<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"/>
|
|
<SolidColorBrush x:Key="ComboBox.MouseOver.Editable.Button.Border" Color="#FF7EB4EA"/>
|
|
<SolidColorBrush x:Key="ComboBox.Pressed.Glyph" Color="#FF000000"/>
|
|
<SolidColorBrush x:Key="ComboBox.Pressed.Border" Color="#FF569DE5"/>
|
|
<SolidColorBrush x:Key="ComboBox.Pressed.Editable.Background" Color="#FFFFFFFF"/>
|
|
<SolidColorBrush x:Key="ComboBox.Pressed.Editable.Border" Color="#FF569DE5"/>
|
|
<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"/>
|
|
<SolidColorBrush x:Key="TextBox.Static.Background" Color="#FFFFFFFF"/>
|
|
<Style TargetType="{x:Type Label}">
|
|
<Setter Property="FontFamily" Value="pack://application:,,,/Assets/Fonts/#Open Sans"/>
|
|
</Style>
|
|
<Style TargetType="{x:Type TextBox}">
|
|
<Setter Property="FontFamily" Value="pack://application:,,,/Assets/Fonts/#Open Sans"/>
|
|
</Style>
|
|
<Style TargetType="{x:Type ListBoxItem}">
|
|
<Setter Property="FontFamily" Value="pack://application:,,,/Assets/Fonts/#Open Sans"/>
|
|
</Style>
|
|
|
|
<Style x:Key="RoundCorner" TargetType="{x:Type Button}">
|
|
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
|
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
|
<Setter Property="Padding" Value="1"/>
|
|
<Setter Property="Background" Value="AliceBlue"/>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type Button}">
|
|
<Grid x:Name="grid">
|
|
<Border x:Name="border" CornerRadius="12" BorderThickness="0"/>
|
|
</Grid>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter Property="Opacity" TargetName="grid" Value="0.8"/>
|
|
</Trigger>
|
|
<Trigger Property="IsEnabled" Value="False">
|
|
<Setter Property="Opacity" TargetName="grid" Value="0.25"/>
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<Style TargetType="{x:Type FrameworkElement}" x:Key="VisibleAnimation">
|
|
<Setter Property="Visibility" Value="Collapsed"/>
|
|
<Setter Property="Opacity" Value="0"/>
|
|
<Style.Triggers>
|
|
<Trigger Property="Visibility" Value="Visible">
|
|
<Trigger.EnterActions>
|
|
<BeginStoryboard>
|
|
<Storyboard>
|
|
<DoubleAnimation Storyboard.TargetProperty="Opacity" From="0.0" To="1.0" Duration="0:0:0.2"/>
|
|
</Storyboard>
|
|
</BeginStoryboard>
|
|
</Trigger.EnterActions>
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
|
|
<Style x:Key="MyButton" TargetType="{x:Type Button}">
|
|
<Setter Property="OverridesDefaultStyle" Value="True" />
|
|
<Setter Property="Cursor" Value="Hand" />
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type Button}">
|
|
<Border x:Name="border" BorderThickness="0" BorderBrush="Black" Background="{TemplateBinding Background}">
|
|
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
|
|
</Border>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter Property="Opacity" Value="0.8" />
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<Style x:Key="ComboBoxTextBoxStyle" TargetType="{x:Type TextBox}">
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type TextBox}">
|
|
<Grid>
|
|
<Border CornerRadius="7"
|
|
BorderThickness="4"
|
|
Background="{TemplateBinding Background}"
|
|
BorderBrush="Black">
|
|
<ScrollViewer x:Name="PART_ContentHost"/>
|
|
</Border>
|
|
</Grid>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<Style x:Key="FocusVisual">
|
|
<Setter Property="Control.Template">
|
|
<Setter.Value>
|
|
<ControlTemplate>
|
|
<Rectangle StrokeDashArray="1 2" StrokeThickness="1" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" SnapsToDevicePixels="true" Margin="2"/>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
<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>
|
|
<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>
|
|
<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>
|
|
<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>
|
|
<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" SnapsToDevicePixels="true" Background="{StaticResource ComboBox.Static.Background}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="7" BorderBrush="{StaticResource ComboBox.Static.Border}">
|
|
<Border x:Name="splitBorder" Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" SnapsToDevicePixels="true" Margin="0" HorizontalAlignment="Right" BorderThickness="1" BorderBrush="Transparent">
|
|
<Path x:Name="arrow" VerticalAlignment="Center" Margin="0" HorizontalAlignment="Center" Fill="{StaticResource ComboBox.Static.Glyph}" 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"/>
|
|
</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>
|
|
<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="ComboStyle" 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>
|
|
<LinearGradientBrush x:Key="ComboBox.Static.Background2" EndPoint="0,1" StartPoint="0,0">
|
|
<GradientStop Color="#FFF0F0F0" Offset="0.0"/>
|
|
<GradientStop Color="#FFE5E5E5" Offset="1.0"/>
|
|
</LinearGradientBrush>
|
|
<Style x:Key="ComboBoxToggleButton2" 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="7" BorderThickness="0" Background="Gray" 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>
|
|
<Style x:Key="FilterComboStyle" 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>
|
|
|
|
<sys:Double x:Key="MaxWindowWidth">480</sys:Double>
|
|
<uiutils:NullOrEmptyToCollapsedConverter x:Key="NullToCollapsed"/>
|
|
|
|
<!-- set the default scrollbar styling -->
|
|
<Style TargetType="{x:Type ScrollBar}" BasedOn="{StaticResource ScrollBar2026}"/>
|
|
</ResourceDictionary>
|
|
</Application.Resources>
|
|
</Application>
|