Merge pull request #180 from irihitech/178-datavalidationerror

Add DataValidationError to Input Control
This commit is contained in:
Dong Bin 2023-05-08 23:26:08 +08:00 committed by GitHub
commit 37746e38f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 1127 additions and 613 deletions

View File

@ -0,0 +1,83 @@
<UserControl
x:Class="Semi.Avalonia.Demo.Pages.DataValidationErrorsDemo"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:system="clr-namespace:System;assembly=netstandard"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<ScrollViewer>
<StackPanel HorizontalAlignment="Left" Spacing="20">
<AutoCompleteBox Width="300">
<DataValidationErrors.Error>
<system:Exception />
</DataValidationErrors.Error>
</AutoCompleteBox>
<AutoCompleteBox Width="300" Classes="Large">
<DataValidationErrors.Error>
<system:Exception />
</DataValidationErrors.Error>
</AutoCompleteBox>
<AutoCompleteBox Width="300" Classes="Small">
<DataValidationErrors.Error>
<system:Exception />
</DataValidationErrors.Error>
</AutoCompleteBox>
<CalendarDatePicker Width="300">
<DataValidationErrors.Error>
<system:Exception />
</DataValidationErrors.Error>
</CalendarDatePicker>
<ComboBox Width="300">
<ComboBoxItem>AAA</ComboBoxItem>
<ComboBoxItem>BBB</ComboBoxItem>
<DataValidationErrors.Error>
<system:Exception />
</DataValidationErrors.Error>
</ComboBox>
<DatePicker Width="300">
<DataValidationErrors.Error>
<system:Exception />
</DataValidationErrors.Error>
</DatePicker>
<NumericUpDown Width="300">
<DataValidationErrors.Error>
<system:Exception />
</DataValidationErrors.Error>
</NumericUpDown>
<Slider Width="300">
<DataValidationErrors.Error>
<system:Exception />
</DataValidationErrors.Error>
</Slider>
<TimePicker Width="300">
<DataValidationErrors.Error>
<system:Exception />
</DataValidationErrors.Error>
</TimePicker>
<TextBox
Width="300"
InnerLeftContent="http://"
InnerRightContent=".com">
<DataValidationErrors.Error>
<system:Exception />
</DataValidationErrors.Error>
</TextBox>
<TextBox
Width="300"
InnerLeftContent="http://"
InnerRightContent=".com">
<TextBox.Styles>
<Style Selector="TextBox /template/ DataValidationErrors">
<Setter Property="Theme" Value="{DynamicResource TooltipDataValidationErrors}" />
</Style>
</TextBox.Styles>
<DataValidationErrors.Error>
<system:Exception />
</DataValidationErrors.Error>
</TextBox>
</StackPanel>
</ScrollViewer>
</UserControl>

View File

@ -0,0 +1,18 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Semi.Avalonia.Demo.Pages;
public partial class DataValidationErrorsDemo : UserControl
{
public DataValidationErrorsDemo()
{
InitializeComponent();
}
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
}

View File

@ -4,6 +4,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:system="clr-namespace:System;assembly=netstandard"
d:DesignHeight="450" d:DesignHeight="450"
d:DesignWidth="800" d:DesignWidth="800"
mc:Ignorable="d"> mc:Ignorable="d">

View File

@ -105,6 +105,9 @@
<TabItem Header="ComboBox"> <TabItem Header="ComboBox">
<pages:ComboBoxDemo /> <pages:ComboBoxDemo />
</TabItem> </TabItem>
<TabItem Header="DataValidationErrors">
<pages:DataValidationErrorsDemo />
</TabItem>
<TabItem Header="DataGrid"> <TabItem Header="DataGrid">
<pages:DataGridDemo /> <pages:DataGridDemo />
</TabItem> </TabItem>

View File

@ -14,6 +14,13 @@
BasedOn="{StaticResource {x:Type TextBox}}" BasedOn="{StaticResource {x:Type TextBox}}"
TargetType="TextBox"> TargetType="TextBox">
<Setter Property="VerticalAlignment" Value="Stretch" /> <Setter Property="VerticalAlignment" Value="Stretch" />
<Setter Property="MinHeight" Value="20" />
<Style Selector="^ /template/ Border#PART_ContentPresenterBorder">
<Setter Property="MinHeight" Value="20" />
</Style>
<Style Selector="^:error:focus /template/ Border#PART_ContentPresenterBorder">
<Setter Property="Border.BorderBrush" Value="Transparent" />
</Style>
<Style Selector="^ /template/ DataValidationErrors"> <Style Selector="^ /template/ DataValidationErrors">
<Setter Property="Theme" Value="{DynamicResource TooltipDataValidationErrors}" /> <Setter Property="Theme" Value="{DynamicResource TooltipDataValidationErrors}" />
</Style> </Style>

View File

@ -12,35 +12,38 @@
<Setter Property="AutoCompleteBox.MaxDropDownHeight" Value="{DynamicResource AutoCompleteMaxDropdownHeight}" /> <Setter Property="AutoCompleteBox.MaxDropDownHeight" Value="{DynamicResource AutoCompleteMaxDropdownHeight}" />
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate TargetType="AutoCompleteBox"> <ControlTemplate TargetType="AutoCompleteBox">
<Panel> <DataValidationErrors>
<TextBox <Panel>
Name="PART_TextBox" <TextBox
VerticalAlignment="Center" Name="PART_TextBox"
DataValidationErrors.Errors="{TemplateBinding (DataValidationErrors.Errors)}" VerticalAlignment="Center"
Watermark="{TemplateBinding Watermark}" /> DataValidationErrors.Errors="{TemplateBinding (DataValidationErrors.Errors)}"
<Popup Theme="{DynamicResource NonErrorTextBox}"
Name="PART_Popup" Watermark="{TemplateBinding Watermark}" />
MinWidth="{Binding Bounds.Width, RelativeSource={RelativeSource TemplatedParent}}" <Popup
MaxHeight="{TemplateBinding MaxDropDownHeight}" Name="PART_Popup"
IsLightDismissEnabled="True" MinWidth="{Binding Bounds.Width, RelativeSource={RelativeSource TemplatedParent}}"
PlacementTarget="{TemplateBinding}"> MaxHeight="{TemplateBinding MaxDropDownHeight}"
<Border IsLightDismissEnabled="True"
Margin="{DynamicResource AutoCompleteBoxPopupMargin}" PlacementTarget="{TemplateBinding}">
HorizontalAlignment="Stretch" <Border
Background="{DynamicResource AutoCompleteBoxPopupBackground}" Margin="{DynamicResource AutoCompleteBoxPopupMargin}"
BorderBrush="{DynamicResource AutoCompleteBoxPopupBorderBrush}" HorizontalAlignment="Stretch"
BorderThickness="{DynamicResource AutoCompleteBoxPopupBorderThickness}" Background="{DynamicResource AutoCompleteBoxPopupBackground}"
BoxShadow="{DynamicResource AutoCompleteBoxPopupBoxShadow}" BorderBrush="{DynamicResource AutoCompleteBoxPopupBorderBrush}"
CornerRadius="{DynamicResource AutoCompleteBoxPopupCornerRadius}"> BorderThickness="{DynamicResource AutoCompleteBoxPopupBorderThickness}"
<ListBox BoxShadow="{DynamicResource AutoCompleteBoxPopupBoxShadow}"
Name="PART_SelectingItemsControl" CornerRadius="{DynamicResource AutoCompleteBoxPopupCornerRadius}">
Foreground="{TemplateBinding Foreground}" <ListBox
ItemTemplate="{TemplateBinding ItemTemplate}" Name="PART_SelectingItemsControl"
ScrollViewer.HorizontalScrollBarVisibility="Auto" Foreground="{TemplateBinding Foreground}"
ScrollViewer.VerticalScrollBarVisibility="Auto" /> ItemTemplate="{TemplateBinding ItemTemplate}"
</Border> ScrollViewer.HorizontalScrollBarVisibility="Auto"
</Popup> ScrollViewer.VerticalScrollBarVisibility="Auto" />
</Panel> </Border>
</Popup>
</Panel>
</DataValidationErrors>
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>

View File

@ -34,107 +34,108 @@
<Setter Property="VerticalAlignment" Value="Center" /> <Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalContentAlignment" Value="Left" /> <Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="VerticalContentAlignment" Value="Center" /> <Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="CalendarDatePicker.MinHeight" Value="{DynamicResource CalendarDatePickerDefaultHeight}" />
<Setter Property="Padding" Value="8 0" /> <Setter Property="Padding" Value="8 0" />
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate TargetType="CalendarDatePicker"> <ControlTemplate TargetType="CalendarDatePicker">
<Panel <DataValidationErrors>
x:Name="LayoutRoot" <Panel
HorizontalAlignment="Stretch" x:Name="LayoutRoot"
VerticalAlignment="Stretch"> HorizontalAlignment="Stretch"
<Border VerticalAlignment="Stretch">
x:Name="Background" <Border
Background="{TemplateBinding Background}" x:Name="Background"
BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}"
BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}"
CornerRadius="{TemplateBinding CornerRadius}"> BorderThickness="{TemplateBinding BorderThickness}"
<Grid CornerRadius="{TemplateBinding CornerRadius}">
HorizontalAlignment="Stretch" <Grid
VerticalAlignment="Center"
ColumnDefinitions="*,Auto">
<TextBox
Name="PART_TextBox"
Grid.Column="0"
MinHeight="{DynamicResource CalendarDatePickerInnerDefaultHeight}"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
VerticalAlignment="Center" VerticalAlignment="Center"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" ColumnDefinitions="*,Auto">
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" <TextBox
Background="Transparent" Name="PART_TextBox"
BorderBrush="Transparent" Grid.Column="0"
BorderThickness="0" MinHeight="{DynamicResource CalendarDatePickerDefaultHeight}"
CornerRadius="{TemplateBinding CornerRadius}" HorizontalAlignment="Stretch"
Foreground="{TemplateBinding Foreground}" VerticalAlignment="Center"
UseFloatingWatermark="{TemplateBinding UseFloatingWatermark}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
Watermark="{TemplateBinding Watermark}"> VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
<TextBox.Styles> Background="Transparent"
<Style Selector="TextBox#PART_TextBox:pointerover /template/ Border#PART_ContentPresenterBorder"> BorderBrush="Transparent"
<!-- By default the TextBox has its own focused state, override this to disable it here --> BorderThickness="0"
<Setter Property="Background" Value="Transparent" /> CornerRadius="{TemplateBinding CornerRadius}"
<Setter Property="BorderBrush" Value="Transparent" /> Foreground="{TemplateBinding Foreground}"
<Setter Property="BorderThickness" Value="0" /> Theme="{DynamicResource NonErrorTextBox}"
</Style> UseFloatingWatermark="{TemplateBinding UseFloatingWatermark}"
<Style Selector="TextBox#PART_TextBox:focus /template/ Border#PART_ContentPresenterBorder"> Watermark="{TemplateBinding Watermark}">
<!-- By default the TextBox has its own focused state, override this to disable it here --> <TextBox.Styles>
<Setter Property="Background" Value="Transparent" /> <Style Selector="TextBox#PART_TextBox:pointerover /template/ Border#PART_ContentPresenterBorder">
<Setter Property="BorderBrush" Value="Transparent" /> <!-- By default the TextBox has its own focused state, override this to disable it here -->
<Setter Property="BorderThickness" Value="0" />
</Style>
<Style Selector="TextBox#PART_TextBox:disabled">
<Style Selector="^ /template/ Border#PART_ContentPresenterBorder">
<!-- By default the TextBox has its own disabled state, override this to make the border background show through -->
<Setter Property="Background" Value="Transparent" /> <Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" /> <Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
</Style> </Style>
</Style> <Style Selector="TextBox#PART_TextBox:focus /template/ Border#PART_ContentPresenterBorder">
</TextBox.Styles> <!-- By default the TextBox has its own focused state, override this to disable it here -->
</TextBox> <Setter Property="Background" Value="Transparent" />
<Button <Setter Property="BorderBrush" Value="Transparent" />
Name="PART_Button" <Setter Property="BorderThickness" Value="0" />
Grid.Column="1" </Style>
Padding="0,0,8,0" <Style Selector="TextBox#PART_TextBox:disabled">
Cursor="Hand" <Style Selector="^ /template/ Border#PART_ContentPresenterBorder">
Focusable="False" <!-- By default the TextBox has its own disabled state, override this to make the border background show through -->
Theme="{DynamicResource CalendarDatePickerButton}" /> <Setter Property="Background" Value="Transparent" />
<Popup <Setter Property="BorderBrush" Value="Transparent" />
Name="PART_Popup" </Style>
HorizontalOffset="-8" </Style>
IsLightDismissEnabled="True" </TextBox.Styles>
PlacementTarget="{TemplateBinding}" </TextBox>
VerticalOffset="-4"> <Button
<Border Name="PART_Button"
Margin="8" Grid.Column="1"
Background="Transparent" Padding="0,0,8,0"
BoxShadow="{DynamicResource CalendarDatePickerPopupBoxShadows}" Cursor="Hand"
CornerRadius="{DynamicResource CalendarCornerRadius}"> Focusable="False"
<Calendar Theme="{DynamicResource CalendarDatePickerButton}" />
Name="PART_Calendar" <Popup
BorderThickness="0" Name="PART_Popup"
CornerRadius="{Binding $parent[Border].CornerRadius}" HorizontalOffset="-8"
DisplayDate="{TemplateBinding DisplayDate}" IsLightDismissEnabled="True"
DisplayDateEnd="{TemplateBinding DisplayDateEnd}" PlacementTarget="{TemplateBinding}"
DisplayDateStart="{TemplateBinding DisplayDateStart}" VerticalOffset="-4">
FirstDayOfWeek="{TemplateBinding FirstDayOfWeek}" <Border
IsTodayHighlighted="{TemplateBinding IsTodayHighlighted}" Margin="8"
SelectedDate="{TemplateBinding SelectedDate, Background="Transparent"
Mode=TwoWay}" /> BoxShadow="{DynamicResource CalendarDatePickerPopupBoxShadows}"
</Border> CornerRadius="{DynamicResource CalendarCornerRadius}">
</Popup> <Calendar
</Grid> Name="PART_Calendar"
</Border> BorderThickness="0"
CornerRadius="{Binding $parent[Border].CornerRadius}"
DisplayDate="{TemplateBinding DisplayDate}"
DisplayDateEnd="{TemplateBinding DisplayDateEnd}"
DisplayDateStart="{TemplateBinding DisplayDateStart}"
FirstDayOfWeek="{TemplateBinding FirstDayOfWeek}"
IsTodayHighlighted="{TemplateBinding IsTodayHighlighted}"
SelectedDate="{TemplateBinding SelectedDate,
Mode=TwoWay}" />
</Border>
</Popup>
</Grid>
</Border>
</Panel>
</DataValidationErrors>
</Panel>
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
<Style Selector="^.Large"> <Style Selector="^.Large">
<Setter Property="CalendarDatePicker.MinHeight" Value="{DynamicResource CalendarDatePickerLargeHeight}" />
<Style Selector="^ /template/ TextBox#PART_TextBox"> <Style Selector="^ /template/ TextBox#PART_TextBox">
<Setter Property="TextBox.MinHeight" Value="{DynamicResource CalendarDatePickerInnerLargeHeight}" /> <Setter Property="TextBox.MinHeight" Value="{DynamicResource CalendarDatePickerInnerLargeHeight}" />
</Style> </Style>
</Style> </Style>
<Style Selector="^.Small"> <Style Selector="^.Small">
<Setter Property="CalendarDatePicker.MinHeight" Value="{DynamicResource CalendarDatePickerSmallHeight}" />
<Style Selector="^ /template/ TextBox#PART_TextBox"> <Style Selector="^ /template/ TextBox#PART_TextBox">
<Setter Property="TextBox.MinHeight" Value="{DynamicResource CalendarDatePickerInnerSmallHeight}" /> <Setter Property="TextBox.MinHeight" Value="{DynamicResource CalendarDatePickerInnerSmallHeight}" />
</Style> </Style>
@ -166,6 +167,25 @@
<Setter Property="BorderBrush" Value="{DynamicResource CalendarDatePickerFocusBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource CalendarDatePickerFocusBorderBrush}" />
</Style> </Style>
<Style Selector="^:error">
<Style Selector="^ /template/ Border#Background">
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsBackground}" />
<Setter Property="BorderBrush" Value="Transparent" />
</Style>
<Style Selector="^:pointerover /template/ Border#Background">
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsPointerOverBackground}" />
<Setter Property="BorderBrush" Value="Transparent" />
</Style>
<Style Selector="^:pressed /template/ Border#Background">
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsPressedBackground}" />
<Setter Property="BorderBrush" Value="Transparent" />
</Style>
<Style Selector="^:focus-within /template/ Border#Background">
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsSelectedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource DataValidationErrorsSelectedBorderBrush}" />
</Style>
</Style>
<Style Selector="^.Bordered"> <Style Selector="^.Bordered">
<Style Selector="^ Border#Background"> <Style Selector="^ Border#Background">
<Setter Property="Border.Background" Value="{DynamicResource CalendarDatePickerBorderedDefaultBackground}" /> <Setter Property="Border.Background" Value="{DynamicResource CalendarDatePickerBorderedDefaultBackground}" />
@ -189,6 +209,24 @@
<Setter Property="Foreground" Value="{DynamicResource CalendarDatePickerDisabledIconForeground}" /> <Setter Property="Foreground" Value="{DynamicResource CalendarDatePickerDisabledIconForeground}" />
</Style> </Style>
</Style> </Style>
<Style Selector="^:error">
<Style Selector="^ /template/ Border#Background">
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource DataValidationErrorsBorderBrush}" />
</Style>
<Style Selector="^:pointerover /template/ Border#Background">
<Setter Property="Border.Background" Value="{DynamicResource DataValidationErrorsPointerOverBackground}" />
<Setter Property="Border.BorderBrush" Value="{DynamicResource DataValidationErrorsPointerOverBorderBrush}" />
</Style>
<Style Selector="^:pressed /template/ Border#Background">
<Setter Property="Border.Background" Value="{DynamicResource DataValidationErrorsPressedBackground}" />
<Setter Property="Border.BorderBrush" Value="{DynamicResource DataValidationErrorsPressedBorderBrush}" />
</Style>
<Style Selector="^:focus-within /template/ Border#Background">
<Setter Property="Border.Background" Value="{DynamicResource DataValidationErrorsSelectedBackground}" />
<Setter Property="Border.BorderBrush" Value="{DynamicResource DataValidationErrorsSelectedBorderBrush}" />
</Style>
</Style>
</Style> </Style>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@ -36,7 +36,6 @@
<Setter Property="CornerRadius" Value="{DynamicResource ComboBoxSelectorCornerRadius}" /> <Setter Property="CornerRadius" Value="{DynamicResource ComboBoxSelectorCornerRadius}" />
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" /> <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" /> <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
<Setter Property="MinHeight" Value="{DynamicResource ComboBoxDefaultHeight}" />
<Setter Property="HorizontalContentAlignment" Value="Left" /> <Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="VerticalContentAlignment" Value="Center" /> <Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Left" /> <Setter Property="HorizontalAlignment" Value="Left" />
@ -45,96 +44,99 @@
<Setter Property="PlaceholderForeground" Value="{DynamicResource ComboBoxPlaceHolderForeground}" /> <Setter Property="PlaceholderForeground" Value="{DynamicResource ComboBoxPlaceHolderForeground}" />
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate TargetType="ComboBox"> <ControlTemplate TargetType="ComboBox">
<Grid ColumnDefinitions="*,32"> <DataValidationErrors>
<Border <Grid ColumnDefinitions="*,32">
x:Name="Background"
Grid.Column="0"
Grid.ColumnSpan="2"
MinWidth="{DynamicResource ComboBoxThemeMinWidth}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}" />
<TextBlock
x:Name="PlaceholderTextBlock"
Grid.Column="0"
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Foreground="{TemplateBinding Foreground}"
IsVisible="{TemplateBinding SelectionBoxItem,
Converter={x:Static ObjectConverters.IsNull}}"
Opacity="0.3"
Text="{TemplateBinding PlaceholderText}" />
<ContentPresenter
x:Name="ContentPresenter"
Grid.Column="0"
Margin="{TemplateBinding Padding}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Content="{TemplateBinding SelectionBoxItem}"
ContentTemplate="{TemplateBinding ItemTemplate}" />
<Border
x:Name="DropDownOverlay"
Grid.Column="1"
Width="30"
Margin="0,1,1,1"
HorizontalAlignment="Right"
Background="Transparent"
IsVisible="False" />
<PathIcon
x:Name="DropDownGlyph"
Grid.Column="1"
Width="12"
Height="12"
Margin="0,0,10,0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Data="{DynamicResource ComboBoxIcon}"
Foreground="{DynamicResource ComboBoxIconDefaultForeground}"
IsHitTestVisible="False"
UseLayoutRounding="False" />
<Popup
Name="PART_Popup"
Grid.Column="0"
MinWidth="{Binding Bounds.Width, RelativeSource={RelativeSource TemplatedParent}}"
MaxHeight="{TemplateBinding MaxDropDownHeight}"
ClipToBounds="False"
InheritsTransform="True"
IsLightDismissEnabled="True"
IsOpen="{TemplateBinding IsDropDownOpen,
Mode=TwoWay}"
PlacementTarget="Background"
WindowManagerAddShadowHint="False">
<Border <Border
x:Name="PopupBorder" x:Name="Background"
Margin="0,4" Grid.Column="0"
HorizontalAlignment="Stretch" Grid.ColumnSpan="2"
Background="{DynamicResource ComboBoxPopupBackground}" MinHeight="{DynamicResource ComboBoxDefaultHeight}"
BorderBrush="{DynamicResource ComboBoxPopupBorderBrush}" MinWidth="{DynamicResource ComboBoxThemeMinWidth}"
BorderThickness="{DynamicResource ComboBoxPopupBorderThickness}" Background="{TemplateBinding Background}"
BoxShadow="{DynamicResource ComboBoxPopupBoxShadow}" BorderBrush="{TemplateBinding BorderBrush}"
ClipToBounds="True" BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="6"> CornerRadius="{TemplateBinding CornerRadius}" />
<ScrollViewer HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"> <TextBlock
<ItemsPresenter x:Name="PlaceholderTextBlock"
Name="PART_ItemsPresenter" Grid.Column="0"
Margin="{DynamicResource ComboBoxDropdownContentMargin}" Margin="{TemplateBinding Padding}"
ItemsPanel="{TemplateBinding ItemsPanel}" /> HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
</ScrollViewer> VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
</Border> Foreground="{TemplateBinding Foreground}"
</Popup> IsVisible="{TemplateBinding SelectionBoxItem,Converter={x:Static ObjectConverters.IsNull}}"
</Grid> Opacity="0.3"
Text="{TemplateBinding PlaceholderText}" />
<ContentPresenter
x:Name="ContentPresenter"
Grid.Column="0"
Margin="{TemplateBinding Padding}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Content="{TemplateBinding SelectionBoxItem}"
ContentTemplate="{TemplateBinding ItemTemplate}" />
<Border
x:Name="DropDownOverlay"
Grid.Column="1"
Width="30"
Margin="0,1,1,1"
HorizontalAlignment="Right"
Background="Transparent"
IsVisible="False" />
<PathIcon
x:Name="DropDownGlyph"
Grid.Column="1"
Width="12"
Height="12"
Margin="0,0,10,0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Data="{DynamicResource ComboBoxIcon}"
Foreground="{DynamicResource ComboBoxIconDefaultForeground}"
IsHitTestVisible="False"
UseLayoutRounding="False" />
<Popup
Name="PART_Popup"
Grid.Column="0"
MinWidth="{Binding Bounds.Width, RelativeSource={RelativeSource TemplatedParent}}"
MaxHeight="{TemplateBinding MaxDropDownHeight}"
ClipToBounds="False"
InheritsTransform="True"
IsLightDismissEnabled="True"
IsOpen="{TemplateBinding IsDropDownOpen,Mode=TwoWay}"
PlacementTarget="Background"
WindowManagerAddShadowHint="False">
<Border
x:Name="PopupBorder"
Margin="0,4"
HorizontalAlignment="Stretch"
Background="{DynamicResource ComboBoxPopupBackground}"
BorderBrush="{DynamicResource ComboBoxPopupBorderBrush}"
BorderThickness="{DynamicResource ComboBoxPopupBorderThickness}"
BoxShadow="{DynamicResource ComboBoxPopupBoxShadow}"
ClipToBounds="True"
CornerRadius="6">
<ScrollViewer
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}">
<ItemsPresenter
Name="PART_ItemsPresenter"
Margin="{DynamicResource ComboBoxDropdownContentMargin}"
ItemsPanel="{TemplateBinding ItemsPanel}" />
</ScrollViewer>
</Border>
</Popup>
</Grid>
</DataValidationErrors>
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
<Style Selector="^.Large"> <Style Selector="^.Large /template/ Border#Background">
<Setter Property="ComboBox.MinHeight" Value="{DynamicResource ComboBoxLargeHeight}" /> <Setter Property="ComboBox.MinHeight" Value="{DynamicResource ComboBoxLargeHeight}" />
</Style> </Style>
<Style Selector="^.Small"> <Style Selector="^.Small /template/ Border#Background">
<Setter Property="ComboBox.MinHeight" Value="{DynamicResource ComboBoxSmallHeight}" /> <Setter Property="ComboBox.MinHeight" Value="{DynamicResource ComboBoxSmallHeight}" />
</Style> </Style>
@ -173,6 +175,25 @@
<Setter Property="Foreground" Value="{DynamicResource ComboBoxIconDisabledForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ComboBoxIconDisabledForeground}" />
</Style> </Style>
</Style> </Style>
<!-- Error State -->
<Style Selector="^:error">
<Style Selector="^ /template/ Border#Background">
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsBackground}" />
</Style>
<Style Selector="^:pointerover /template/ Border#Background">
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsPointerOverBackground}" />
<Setter Property="BorderBrush" Value="Transparent" />
</Style>
<Style Selector="^:pressed /template/ Border#Background">
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsPressedBackground}" />
<Setter Property="BorderBrush" Value="Transparent" />
</Style>
<Style Selector="^:focus /template/ Border#Background">
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsSelectedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource DataValidationErrorsSelectedBorderBrush}" />
</Style>
</Style>
<Style Selector="^.Bordered"> <Style Selector="^.Bordered">
<Style Selector="^ /template/ Border#Background"> <Style Selector="^ /template/ Border#Background">
<Setter Property="Background" Value="{DynamicResource ComboBoxSelectorBorderedBackground}" /> <Setter Property="Background" Value="{DynamicResource ComboBoxSelectorBorderedBackground}" />
@ -201,6 +222,24 @@
<Setter Property="Foreground" Value="{DynamicResource ComboBoxIconDisabledForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ComboBoxIconDisabledForeground}" />
</Style> </Style>
</Style> </Style>
<Style Selector="^:error">
<Style Selector="^ /template/ Border#Background">
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource DataValidationErrorsBorderBrush}" />
</Style>
<Style Selector="^:pointerover /template/ Border#Background">
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsPointerOverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource DataValidationErrorsPointerOverBorderBrush}" />
</Style>
<Style Selector="^:pressed /template/ Border#Background">
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource DataValidationErrorsPressedBorderBrush}" />
</Style>
<Style Selector="^:focus /template/ Border#Background">
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsSelectedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource DataValidationErrorsSelectedBorderBrush}" />
</Style>
</Style>
</Style> </Style>
</ControlTheme> </ControlTheme>

View File

@ -16,6 +16,7 @@
<ResourceInclude Source="avares://Semi.Avalonia/Controls/ComboBox.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/ComboBox.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Controls/ContentControl.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/ContentControl.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Controls/ContextMenu.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/ContextMenu.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Controls/DataValidationErrors.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Controls/DatePicker.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/DatePicker.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Controls/DateTimePickerShared.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/DateTimePickerShared.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Controls/DropDownButton.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/DropDownButton.axaml" />

View File

@ -0,0 +1,108 @@
<ResourceDictionary
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:collections="clr-namespace:System.Collections;assembly=netstandard">
<!-- Add Resources Here -->
<ControlTheme x:Key="{x:Type DataValidationErrors}" TargetType="DataValidationErrors">
<Setter Property="Template">
<ControlTemplate TargetType="DataValidationErrors">
<DockPanel LastChildFill="True">
<ContentControl
x:Name="InlineDataValidationContentControl"
Margin="0,4,0,0"
Content="{Binding (DataValidationErrors.Errors)}"
ContentTemplate="{TemplateBinding ErrorTemplate}"
DataContext="{TemplateBinding Owner}"
DockPanel.Dock="Bottom"
IsVisible="{Binding (DataValidationErrors.HasErrors)}" />
<ContentPresenter
Name="PART_ContentPresenter"
Padding="{TemplateBinding Padding}"
Background="{TemplateBinding Background}"
BorderThickness="{TemplateBinding BorderThickness}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
CornerRadius="{TemplateBinding CornerRadius}" />
</DockPanel>
</ControlTemplate>
</Setter>
<Setter Property="ErrorTemplate">
<DataTemplate>
<ItemsControl
x:DataType="DataValidationErrors"
Foreground="{DynamicResource DataValidationErrorsForeground}"
ItemsSource="{Binding}">
<ItemsControl.Styles>
<Style Selector="TextBlock">
<Setter Property="TextWrapping" Value="Wrap" />
</Style>
</ItemsControl.Styles>
</ItemsControl>
</DataTemplate>
</Setter>
</ControlTheme>
<ControlTheme x:Key="SilentDataValidationErrors" TargetType="DataValidationErrors">
<Setter Property="Template">
<ControlTemplate TargetType="DataValidationErrors">
<ContentPresenter
Name="PART_ContentPresenter"
Padding="{TemplateBinding Padding}"
Background="{TemplateBinding Background}"
BorderThickness="{TemplateBinding BorderThickness}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
CornerRadius="{TemplateBinding CornerRadius}" />
</ControlTemplate>
</Setter>
</ControlTheme>
<ControlTheme x:Key="TooltipDataValidationErrors" TargetType="DataValidationErrors">
<Setter Property="Template">
<ControlTemplate TargetType="DataValidationErrors">
<DockPanel LastChildFill="True">
<ContentControl
Content="{Binding (DataValidationErrors.Errors)}"
ContentTemplate="{TemplateBinding ErrorTemplate}"
DataContext="{TemplateBinding Owner}"
DockPanel.Dock="Right"
IsVisible="{Binding (DataValidationErrors.HasErrors)}" />
<ContentPresenter
Name="PART_ContentPresenter"
Padding="{TemplateBinding Padding}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
CornerRadius="{TemplateBinding CornerRadius}" />
</DockPanel>
</ControlTemplate>
</Setter>
<Setter Property="ErrorTemplate">
<DataTemplate>
<Panel Name="PART_InlineErrorTemplatePanel" Background="Transparent">
<Panel.Styles>
<Style Selector="Panel#PART_InlineErrorTemplatePanel">
<Setter Property="Margin" Value="8,0" />
</Style>
<Style Selector="Panel#PART_InlineErrorTemplatePanel ToolTip">
<Setter Property="BorderBrush" Value="{DynamicResource DataValidationErrorsForeground}" />
</Style>
<Style Selector="Panel#PART_InlineErrorTemplatePanel ToolTip TextBlock">
<Setter Property="TextWrapping" Value="Wrap" />
</Style>
</Panel.Styles>
<ToolTip.Tip>
<ItemsControl x:DataType="collections:IEnumerable" ItemsSource="{Binding}" />
</ToolTip.Tip>
<Path
Width="14"
Height="14"
Data="M14,7 A7,7 0 0,0 0,7 M0,7 A7,7 0 1,0 14,7 M7,3l0,5 M7,9l0,2"
Stroke="{DynamicResource DataValidationErrorsForeground}"
StrokeThickness="2" />
</Panel>
</DataTemplate>
</Setter>
</ControlTheme>
</ResourceDictionary>

View File

@ -125,7 +125,6 @@
</ControlTheme> </ControlTheme>
<ControlTheme x:Key="{x:Type DatePicker}" TargetType="DatePicker"> <ControlTheme x:Key="{x:Type DatePicker}" TargetType="DatePicker">
<Setter Property="MinHeight" Value="{DynamicResource DateTimePickerButtonDefaultHeight}" />
<Setter Property="Foreground" Value="{DynamicResource DateTimePickerButtonForeground}" /> <Setter Property="Foreground" Value="{DynamicResource DateTimePickerButtonForeground}" />
<Setter Property="Background" Value="{DynamicResource DateTimePickerButtonBackground}" /> <Setter Property="Background" Value="{DynamicResource DateTimePickerButtonBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource DateTimePickerButtonBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource DateTimePickerButtonBorderBrush}" />
@ -135,90 +134,94 @@
<Setter Property="VerticalAlignment" Value="Center" /> <Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate TargetType="DatePicker"> <ControlTemplate TargetType="DatePicker">
<Grid Name="LayoutRoot" Margin="{TemplateBinding Padding}"> <DataValidationErrors>
<Button <Grid Name="LayoutRoot" Margin="{TemplateBinding Padding}">
Name="PART_FlyoutButton" <Button
Width="298" Name="PART_FlyoutButton"
MinWidth="298" Width="298"
HorizontalAlignment="Stretch" MinWidth="298"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
Background="{TemplateBinding Background}" VerticalAlignment="Stretch"
BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}"
BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}"
CornerRadius="{TemplateBinding CornerRadius}" BorderThickness="{TemplateBinding BorderThickness}"
Cursor="Hand" CornerRadius="{TemplateBinding CornerRadius}"
Foreground="{TemplateBinding Foreground}" Cursor="Hand"
IsEnabled="{TemplateBinding IsEnabled}" DataValidationErrors.Errors="{TemplateBinding (DataValidationErrors.Errors)}"
Theme="{StaticResource DateTimePickerFlyoutButton}"> Foreground="{TemplateBinding Foreground}"
<Grid ColumnDefinitions="*, Auto"> IsEnabled="{TemplateBinding IsEnabled}"
<Grid MinHeight="{DynamicResource DateTimePickerButtonDefaultHeight}"
Name="PART_ButtonContentGrid" Theme="{StaticResource DateTimePickerFlyoutButton}">
Grid.Column="0" <Grid ColumnDefinitions="*, Auto">
VerticalAlignment="Center" <Grid
ColumnDefinitions="78*,Auto,132*,Auto,78*"> Name="PART_ButtonContentGrid"
<TextBlock Grid.Column="0"
Name="PART_DayTextBlock"
Padding="12,4"
HorizontalAlignment="Center"
VerticalAlignment="Center" VerticalAlignment="Center"
FontFamily="{TemplateBinding FontFamily}" ColumnDefinitions="78*,Auto,132*,Auto,78*">
FontSize="{TemplateBinding FontSize}" <TextBlock
FontWeight="{TemplateBinding FontWeight}" Name="PART_DayTextBlock"
Text="day" /> Padding="12,4"
<TextBlock HorizontalAlignment="Center"
Name="PART_MonthTextBlock" VerticalAlignment="Center"
Padding="12,4" FontFamily="{TemplateBinding FontFamily}"
VerticalAlignment="Center" FontSize="{TemplateBinding FontSize}"
FontFamily="{TemplateBinding FontFamily}" FontWeight="{TemplateBinding FontWeight}"
FontSize="{TemplateBinding FontSize}" Text="day" />
FontWeight="{TemplateBinding FontWeight}" <TextBlock
Text="month" Name="PART_MonthTextBlock"
TextAlignment="Left" /> Padding="12,4"
<TextBlock VerticalAlignment="Center"
Name="PART_YearTextBlock" FontFamily="{TemplateBinding FontFamily}"
Padding="12,4" FontSize="{TemplateBinding FontSize}"
HorizontalAlignment="Center" FontWeight="{TemplateBinding FontWeight}"
VerticalAlignment="Center" Text="month"
FontFamily="{TemplateBinding FontFamily}" TextAlignment="Left" />
FontSize="{TemplateBinding FontSize}" <TextBlock
FontWeight="{TemplateBinding FontWeight}" Name="PART_YearTextBlock"
Text="year" /> Padding="12,4"
<Rectangle HorizontalAlignment="Center"
x:Name="PART_FirstSpacer" VerticalAlignment="Center"
FontFamily="{TemplateBinding FontFamily}"
FontSize="{TemplateBinding FontSize}"
FontWeight="{TemplateBinding FontWeight}"
Text="year" />
<Rectangle
x:Name="PART_FirstSpacer"
Grid.Column="1"
Width="1"
Margin="0,4"
HorizontalAlignment="Center"
Fill="{DynamicResource DateTimePickerSeparatorBackground}" />
<Rectangle
x:Name="PART_SecondSpacer"
Grid.Column="3"
Width="1"
Margin="0,4"
HorizontalAlignment="Center"
Fill="{DynamicResource DateTimePickerSeparatorBackground}" />
</Grid>
<PathIcon
Name="PART_Icon"
Grid.Column="1" Grid.Column="1"
Width="1" Width="16"
Margin="0,4" Height="16"
HorizontalAlignment="Center" Margin="0,0,8,0"
Fill="{DynamicResource DateTimePickerSeparatorBackground}" /> Data="{DynamicResource DatePickerIconGlyph}"
<Rectangle Foreground="{DynamicResource DateTimePickerIconForeground}" />
x:Name="PART_SecondSpacer"
Grid.Column="3"
Width="1"
Margin="0,4"
HorizontalAlignment="Center"
Fill="{DynamicResource DateTimePickerSeparatorBackground}" />
</Grid> </Grid>
<PathIcon </Button>
Name="PART_Icon"
Grid.Column="1"
Width="16"
Height="16"
Margin="0,0,8,0"
Data="{DynamicResource DatePickerIconGlyph}"
Foreground="{DynamicResource DateTimePickerIconForeground}" />
</Grid>
</Button>
<Popup <Popup
Name="PART_Popup" Name="PART_Popup"
IsLightDismissEnabled="True" IsLightDismissEnabled="True"
Placement="Bottom" Placement="Bottom"
PlacementTarget="{TemplateBinding}" PlacementTarget="{TemplateBinding}"
WindowManagerAddShadowHint="False"> WindowManagerAddShadowHint="False">
<DatePickerPresenter Name="PART_PickerPresenter" /> <DatePickerPresenter Name="PART_PickerPresenter" />
</Popup> </Popup>
</Grid> </Grid>
</DataValidationErrors>
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
@ -230,10 +233,10 @@
<Style Selector="^:hasnodate /template/ Button#PART_FlyoutButton TextBlock"> <Style Selector="^:hasnodate /template/ Button#PART_FlyoutButton TextBlock">
<Setter Property="Foreground" Value="{DynamicResource DateTimePickerEmptyForeground}" /> <Setter Property="Foreground" Value="{DynamicResource DateTimePickerEmptyForeground}" />
</Style> </Style>
<Style Selector="^.Large"> <Style Selector="^.Large /template/ Button#PART_FlyoutButton">
<Setter Property="MinHeight" Value="{DynamicResource DateTimePickerButtonLargeHeight}" /> <Setter Property="MinHeight" Value="{DynamicResource DateTimePickerButtonLargeHeight}" />
</Style> </Style>
<Style Selector="^.Small"> <Style Selector="^.Small /template/ Button#PART_FlyoutButton">
<Setter Property="MinHeight" Value="{DynamicResource DateTimePickerButtonSmallHeight}" /> <Setter Property="MinHeight" Value="{DynamicResource DateTimePickerButtonSmallHeight}" />
</Style> </Style>
</ControlTheme> </ControlTheme>

View File

@ -30,6 +30,25 @@
<Setter Property="BorderBrush" Value="{DynamicResource DateTimePickerButtonDisabledBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource DateTimePickerButtonDisabledBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource DateTimePickerButtonDisabledBackground}" /> <Setter Property="Background" Value="{DynamicResource DateTimePickerButtonDisabledBackground}" />
</Style> </Style>
<Style Selector="^:error">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsBackground}" />
<Setter Property="BorderBrush" Value="Transparent" />
</Style>
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsPointerOverBackground}" />
<Setter Property="BorderBrush" Value="Transparent" />
</Style>
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsPressedBackground}" />
<Setter Property="BorderBrush" Value="Transparent" />
</Style>
<Style Selector="^:focus /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsSelectedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource DataValidationErrorsSelectedBorderBrush}" />
</Style>
</Style>
</ControlTheme> </ControlTheme>
<!-- Theme for the items displayed in the selectors --> <!-- Theme for the items displayed in the selectors -->

View File

@ -5,45 +5,67 @@
<!-- Add Resources Here --> <!-- Add Resources Here -->
<ControlTheme x:Key="{x:Type NumericUpDown}" TargetType="NumericUpDown"> <ControlTheme x:Key="{x:Type NumericUpDown}" TargetType="NumericUpDown">
<Setter Property="NumericUpDown.VerticalContentAlignment" Value="Center" /> <Setter Property="NumericUpDown.VerticalContentAlignment" Value="Center" />
<Setter Property="NumericUpDown.MinHeight" Value="{DynamicResource NumericUpDownWrapperDefaultHeight}" />
<Setter Property="NumericUpDown.CornerRadius" Value="{DynamicResource NumericUpDownCornerRadius}" /> <Setter Property="NumericUpDown.CornerRadius" Value="{DynamicResource NumericUpDownCornerRadius}" />
<Setter Property="NumericUpDown.Template"> <Setter Property="NumericUpDown.Template">
<ControlTemplate TargetType="NumericUpDown"> <ControlTemplate TargetType="NumericUpDown">
<ButtonSpinner <DataValidationErrors>
Name="PART_Spinner" <ButtonSpinner
MinWidth="0" Name="PART_Spinner"
HorizontalContentAlignment="Stretch" MinWidth="0"
VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch"
AllowSpin="{TemplateBinding AllowSpin}" VerticalContentAlignment="Stretch"
Background="{TemplateBinding Background}" AllowSpin="{TemplateBinding AllowSpin}"
BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}"
BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}"
ButtonSpinnerLocation="{TemplateBinding ButtonSpinnerLocation}" BorderThickness="{TemplateBinding BorderThickness}"
ShowButtonSpinner="{TemplateBinding ShowButtonSpinner}"> ButtonSpinnerLocation="{TemplateBinding ButtonSpinnerLocation}"
<TextBox ShowButtonSpinner="{TemplateBinding ShowButtonSpinner}">
Name="PART_TextBox" <TextBox
Height="{TemplateBinding Height}" Name="PART_TextBox"
MinHeight="{TemplateBinding MinHeight}" Height="{TemplateBinding Height}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" MinHeight="{DynamicResource NumericUpDownWrapperDefaultHeight}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
AcceptsReturn="False" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
CornerRadius="{TemplateBinding CornerRadius}" AcceptsReturn="False"
FontSize="{TemplateBinding FontSize}" CornerRadius="{TemplateBinding CornerRadius}"
Foreground="{TemplateBinding Foreground}" DataValidationErrors.Errors="{ReflectionBinding $parent[NumericUpDown].(DataValidationErrors.Errors)}"
IsReadOnly="{TemplateBinding IsReadOnly}" FontSize="{TemplateBinding FontSize}"
Text="{TemplateBinding Text}" Foreground="{TemplateBinding Foreground}"
TextWrapping="NoWrap" IsReadOnly="{TemplateBinding IsReadOnly}"
Watermark="{TemplateBinding Watermark}" /> Text="{TemplateBinding Text}"
</ButtonSpinner> TextWrapping="NoWrap"
Theme="{DynamicResource NonErrorTextBox}"
Watermark="{TemplateBinding Watermark}" />
</ButtonSpinner>
</DataValidationErrors>
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
<Style Selector="^.Large"> <Style Selector="^.Large /template/ TextBox#PART_TextBox">
<Setter Property="MinHeight" Value="{DynamicResource NumericUpDownWrapperLargeHeight}" /> <Setter Property="MinHeight" Value="{DynamicResource NumericUpDownWrapperLargeHeight}" />
</Style> </Style>
<Style Selector="^.Small"> <Style Selector="^.Small /template/ TextBox#PART_TextBox">
<Setter Property="MinHeight" Value="{DynamicResource NumericUpDownWrapperSmallHeight}" /> <Setter Property="MinHeight" Value="{DynamicResource NumericUpDownWrapperSmallHeight}" />
</Style> </Style>
<Style Selector="^:error">
<Style Selector="^ /template/ TextBox#PART_TextBox">
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsBackground}" />
<Setter Property="BorderBrush" Value="Transparent" />
</Style>
<Style Selector="^:pointerover /template/ TextBox#PART_TextBox">
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsPointerOverBackground}" />
<Setter Property="BorderBrush" Value="Transparent" />
</Style>
<Style Selector="^:pressed /template/ TextBox#PART_TextBox">
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsPressedBackground}" />
<Setter Property="BorderBrush" Value="Transparent" />
</Style>
<Style Selector="^:focus /template/ TextBox#PART_TextBox">
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsSelectedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource DataValidationErrorsSelectedBorderBrush}" />
</Style>
</Style>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@ -60,10 +60,10 @@
CornerRadius="{TemplateBinding CornerRadius}" /> CornerRadius="{TemplateBinding CornerRadius}" />
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
<Style Selector="^:pointerover /template/ Border"> <Style Selector="^:pointerover">
<Setter Property="BorderBrush" Value="{DynamicResource SliderThumbPointeroverBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource SliderThumbPointeroverBorderBrush}" />
</Style> </Style>
<Style Selector="^:pressed /template/ Border"> <Style Selector="^:pressed">
<Setter Property="BorderBrush" Value="{DynamicResource SliderThumbPressedBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource SliderThumbPressedBorderBrush}" />
</Style> </Style>
</ControlTheme> </ControlTheme>
@ -75,165 +75,155 @@
<Style Selector="^:horizontal"> <Style Selector="^:horizontal">
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate TargetType="Slider"> <ControlTemplate TargetType="Slider">
<Border <DataValidationErrors>
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}">
<Grid <Grid
x:Name="SliderContainer" x:Name="SliderContainer"
Margin="{TemplateBinding Padding}" Margin="{TemplateBinding Padding}"
Background="Transparent"> Background="Transparent"
RowDefinitions="Auto,Auto,Auto">
<Grid.Styles> <Grid.Styles>
<Style Selector="TickBar"> <Style Selector="TickBar">
<Setter Property="ReservedSpace" Value="{Binding #PART_Track.Thumb.Bounds}" /> <Setter Property="ReservedSpace" Value="{Binding #PART_Track.Thumb.Bounds}" />
</Style> </Style>
</Grid.Styles> </Grid.Styles>
<Grid x:Name="HorizontalTemplate" RowDefinitions="Auto,Auto,Auto"> <TickBar
<TickBar Name="TopTickBar"
Name="TopTickBar" Grid.Row="0"
Grid.Row="0" Height="{DynamicResource SliderTickHorizontalHeight}"
Height="{DynamicResource SliderTickHorizontalHeight}" Margin="0,0,0,4"
Margin="0,0,0,4" VerticalAlignment="Bottom"
VerticalAlignment="Bottom" Fill="{DynamicResource SliderTickForeground}"
Fill="{DynamicResource SliderTickForeground}" IsVisible="False"
IsVisible="False" Maximum="{TemplateBinding Slider.Maximum}"
Maximum="{TemplateBinding Slider.Maximum}" Minimum="{TemplateBinding Slider.Minimum}"
Minimum="{TemplateBinding Slider.Minimum}" Orientation="{TemplateBinding Slider.Orientation}"
Orientation="{TemplateBinding Slider.Orientation}" Placement="Top"
Placement="Top" TickFrequency="{TemplateBinding Slider.TickFrequency}"
TickFrequency="{TemplateBinding Slider.TickFrequency}" Ticks="{TemplateBinding Ticks}" />
Ticks="{TemplateBinding Ticks}" /> <TickBar
<TickBar Name="BottomTickBar"
Name="BottomTickBar" Grid.Row="2"
Grid.Row="2" Height="{DynamicResource SliderTickHorizontalHeight}"
Height="{DynamicResource SliderTickHorizontalHeight}" Margin="0,4,0,0"
Margin="0,4,0,0" VerticalAlignment="Top"
VerticalAlignment="Top" Fill="{DynamicResource SliderTickForeground}"
Fill="{DynamicResource SliderTickForeground}" IsVisible="False"
IsVisible="False" Maximum="{TemplateBinding Slider.Maximum}"
Maximum="{TemplateBinding Slider.Maximum}" Minimum="{TemplateBinding Slider.Minimum}"
Minimum="{TemplateBinding Slider.Minimum}" Orientation="{TemplateBinding Slider.Orientation}"
Orientation="{TemplateBinding Slider.Orientation}" Placement="Bottom"
Placement="Bottom" TickFrequency="{TemplateBinding Slider.TickFrequency}"
TickFrequency="{TemplateBinding Slider.TickFrequency}" Ticks="{TemplateBinding Ticks}" />
Ticks="{TemplateBinding Ticks}" /> <Track
<Track Name="PART_Track"
Name="PART_Track" Grid.Row="1"
Grid.Row="1" IsDirectionReversed="{TemplateBinding IsDirectionReversed}"
IsDirectionReversed="{TemplateBinding IsDirectionReversed}" Maximum="{TemplateBinding Maximum}"
Maximum="{TemplateBinding Maximum}" Minimum="{TemplateBinding Minimum}"
Minimum="{TemplateBinding Minimum}" Orientation="Horizontal"
Orientation="Horizontal" Value="{TemplateBinding Value,
Value="{TemplateBinding Value, Mode=TwoWay}">
Mode=TwoWay}"> <Track.DecreaseButton>
<Track.DecreaseButton> <RepeatButton
<RepeatButton Name="PART_DecreaseButton"
Name="PART_DecreaseButton" Background="{TemplateBinding Foreground}"
Background="{TemplateBinding Foreground}" Focusable="False"
Focusable="False" Theme="{StaticResource SliderHorizontalRepeatButton}" />
Theme="{StaticResource SliderHorizontalRepeatButton}" /> </Track.DecreaseButton>
</Track.DecreaseButton> <Track.IncreaseButton>
<Track.IncreaseButton> <RepeatButton
<RepeatButton Name="PART_IncreaseButton"
Name="PART_IncreaseButton" Background="{TemplateBinding Background}"
Background="{TemplateBinding Background}" Focusable="False"
Focusable="False" Theme="{StaticResource SliderHorizontalRepeatButton}" />
Theme="{StaticResource SliderHorizontalRepeatButton}" /> </Track.IncreaseButton>
</Track.IncreaseButton> <Thumb
<Thumb Name="thumb"
Name="thumb" Width="{DynamicResource SliderThumbWidth}"
Width="{DynamicResource SliderThumbWidth}" Height="{DynamicResource SliderThumbHeight}"
Height="{DynamicResource SliderThumbHeight}" DataContext="{TemplateBinding Value}"
DataContext="{TemplateBinding Value}" Theme="{StaticResource SliderThumbTheme}" />
Theme="{StaticResource SliderThumbTheme}" /> </Track>
</Track>
</Grid>
</Grid> </Grid>
</Border> </DataValidationErrors>
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
</Style> </Style>
<Style Selector="^:vertical"> <Style Selector="^:vertical">
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate> <ControlTemplate>
<Border <DataValidationErrors>
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}">
<Grid <Grid
x:Name="SliderContainer" x:Name="SliderContainer"
MinWidth="{DynamicResource SliderVerticalWidth}"
Margin="{TemplateBinding Padding}" Margin="{TemplateBinding Padding}"
Background="{DynamicResource SliderContainerBackground}"> Background="{DynamicResource SliderContainerBackground}"
ColumnDefinitions="Auto,Auto,Auto">
<Grid.Styles> <Grid.Styles>
<Style Selector="TickBar"> <Style Selector="TickBar">
<Setter Property="ReservedSpace" Value="{Binding #PART_Track.Thumb.Bounds}" /> <Setter Property="ReservedSpace" Value="{Binding #PART_Track.Thumb.Bounds}" />
</Style> </Style>
</Grid.Styles> </Grid.Styles>
<Grid <TickBar
x:Name="VerticalTemplate" Name="LeftTickBar"
MinWidth="{DynamicResource SliderVerticalWidth}" Grid.Column="0"
ColumnDefinitions="Auto,Auto,Auto"> Width="{DynamicResource SliderTickVerticalWidth}"
<TickBar Margin="0,0,4,0"
Name="LeftTickBar" HorizontalAlignment="Right"
Grid.Column="0" Fill="{DynamicResource SliderTickForeground}"
Width="{DynamicResource SliderTickVerticalWidth}" IsVisible="False"
Margin="0,0,4,0" Maximum="{TemplateBinding Slider.Maximum}"
HorizontalAlignment="Right" Minimum="{TemplateBinding Slider.Minimum}"
Fill="{DynamicResource SliderTickForeground}" Orientation="{TemplateBinding Slider.Orientation}"
IsVisible="False" Placement="Left"
Maximum="{TemplateBinding Slider.Maximum}" TickFrequency="{TemplateBinding Slider.TickFrequency}"
Minimum="{TemplateBinding Slider.Minimum}" Ticks="{TemplateBinding Ticks}" />
Orientation="{TemplateBinding Slider.Orientation}" <TickBar
Placement="Left" Name="RightTickBar"
TickFrequency="{TemplateBinding Slider.TickFrequency}" Grid.Column="2"
Ticks="{TemplateBinding Ticks}" /> Width="{DynamicResource SliderTickVerticalWidth}"
<TickBar Margin="4,0,0,0"
Name="RightTickBar" HorizontalAlignment="Left"
Grid.Column="2" Fill="{DynamicResource SliderTickForeground}"
Width="{DynamicResource SliderTickVerticalWidth}" IsVisible="False"
Margin="4,0,0,0" Maximum="{TemplateBinding Slider.Maximum}"
HorizontalAlignment="Left" Minimum="{TemplateBinding Slider.Minimum}"
Fill="{DynamicResource SliderTickForeground}" Orientation="{TemplateBinding Slider.Orientation}"
IsVisible="False" Placement="Right"
Maximum="{TemplateBinding Slider.Maximum}" TickFrequency="{TemplateBinding Slider.TickFrequency}"
Minimum="{TemplateBinding Slider.Minimum}" Ticks="{TemplateBinding Ticks}" />
Orientation="{TemplateBinding Slider.Orientation}" <Track
Placement="Right" Name="PART_Track"
TickFrequency="{TemplateBinding Slider.TickFrequency}" Grid.Column="1"
Ticks="{TemplateBinding Ticks}" /> IsDirectionReversed="{TemplateBinding IsDirectionReversed}"
<Track Maximum="{TemplateBinding Maximum}"
Name="PART_Track" Minimum="{TemplateBinding Minimum}"
Grid.Column="1" Orientation="Vertical"
IsDirectionReversed="{TemplateBinding IsDirectionReversed}" Value="{TemplateBinding Value,
Maximum="{TemplateBinding Maximum}" Mode=TwoWay}">
Minimum="{TemplateBinding Minimum}" <Track.DecreaseButton>
Orientation="Vertical" <RepeatButton
Value="{TemplateBinding Value, Name="PART_DecreaseButton"
Mode=TwoWay}"> Background="{TemplateBinding Foreground}"
<Track.DecreaseButton> Focusable="False"
<RepeatButton Theme="{StaticResource SliderVerticalRepeatButton}" />
Name="PART_DecreaseButton" </Track.DecreaseButton>
Background="{TemplateBinding Foreground}" <Track.IncreaseButton>
Focusable="False" <RepeatButton
Theme="{StaticResource SliderVerticalRepeatButton}" /> Name="PART_IncreaseButton"
</Track.DecreaseButton> Background="{TemplateBinding Background}"
<Track.IncreaseButton> Focusable="False"
<RepeatButton Theme="{StaticResource SliderVerticalRepeatButton}" />
Name="PART_IncreaseButton" </Track.IncreaseButton>
Background="{TemplateBinding Background}" <Thumb
Focusable="False" Name="thumb"
Theme="{StaticResource SliderVerticalRepeatButton}" /> Width="{DynamicResource SliderThumbWidth}"
</Track.IncreaseButton> Height="{DynamicResource SliderThumbHeight}"
<Thumb DataContext="{TemplateBinding Value}"
Name="thumb" Theme="{StaticResource SliderThumbTheme}" />
Width="{DynamicResource SliderThumbWidth}" </Track>
Height="{DynamicResource SliderThumbHeight}"
DataContext="{TemplateBinding Value}"
Theme="{StaticResource SliderThumbTheme}" />
</Track>
</Grid>
</Grid> </Grid>
</Border> </DataValidationErrors>
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
</Style> </Style>
@ -263,6 +253,10 @@
<Setter Property="IsVisible" Value="True" /> <Setter Property="IsVisible" Value="True" />
</Style> </Style>
<Style Selector="^:error /template/ Thumb#thumb">
<Setter Property="Thumb.BorderBrush" Value="{DynamicResource DataValidationErrorsSelectedBorderBrush}" />
</Style>
<!-- Disabled State --> <!-- Disabled State -->
<Style Selector="^:disabled"> <Style Selector="^:disabled">

View File

@ -96,7 +96,6 @@
<Setter Property="TextBox.FontSize" Value="14" /> <Setter Property="TextBox.FontSize" Value="14" />
<Setter Property="TextBox.Cursor" Value="Ibeam" /> <Setter Property="TextBox.Cursor" Value="Ibeam" />
<Setter Property="TextBox.CaretBrush" Value="{DynamicResource TextBoxTextCaretBrush}" /> <Setter Property="TextBox.CaretBrush" Value="{DynamicResource TextBoxTextCaretBrush}" />
<Setter Property="TextBox.MinHeight" Value="{DynamicResource TextBoxWrapperDefaultHeight}" />
<Setter Property="TextBox.Padding" Value="{DynamicResource TextBoxContentPadding}" /> <Setter Property="TextBox.Padding" Value="{DynamicResource TextBoxContentPadding}" />
<Setter Property="TextBox.VerticalContentAlignment" Value="Center" /> <Setter Property="TextBox.VerticalContentAlignment" Value="Center" />
<Setter Property="TextBox.FocusAdorner" Value="{x:Null}" /> <Setter Property="TextBox.FocusAdorner" Value="{x:Null}" />
@ -104,22 +103,207 @@
<Setter Property="TextBox.ContextFlyout" Value="{StaticResource DefaultTextBoxContextFlyout}" /> <Setter Property="TextBox.ContextFlyout" Value="{StaticResource DefaultTextBoxContextFlyout}" />
<Setter Property="TextBox.Template"> <Setter Property="TextBox.Template">
<ControlTemplate TargetType="TextBox"> <ControlTemplate TargetType="TextBox">
<Border <DataValidationErrors>
Name="PART_ContentPresenterBorder" <Border
Background="{TemplateBinding Background}" Name="PART_ContentPresenterBorder"
BorderBrush="{TemplateBinding BorderBrush}" MinHeight="{DynamicResource TextBoxWrapperDefaultHeight}"
BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}"
CornerRadius="{TemplateBinding CornerRadius}"> BorderBrush="{TemplateBinding BorderBrush}"
<Grid Margin="{TemplateBinding Padding}" ColumnDefinitions="Auto,*,Auto, Auto, Auto"> BorderThickness="{TemplateBinding BorderThickness}"
<ContentPresenter CornerRadius="{TemplateBinding CornerRadius}">
Grid.Column="0" <Grid Margin="{TemplateBinding Padding}" ColumnDefinitions="Auto,*,Auto, Auto, Auto">
Padding="{DynamicResource TextBoxInnerLeftContentPadding}" <ContentPresenter
VerticalAlignment="Center" Grid.Column="0"
Content="{TemplateBinding InnerLeftContent}" Padding="{DynamicResource TextBoxInnerLeftContentPadding}"
Foreground="{DynamicResource TextBoxInnerForeground}" VerticalAlignment="Center"
IsVisible="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=InnerLeftContent, Converter={x:Static ObjectConverters.IsNotNull}}" /> Content="{TemplateBinding InnerLeftContent}"
Foreground="{DynamicResource TextBoxInnerForeground}"
IsVisible="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=InnerLeftContent, Converter={x:Static ObjectConverters.IsNotNull}}" />
<ScrollViewer
Grid.Column="1"
AllowAutoHide="{TemplateBinding (ScrollViewer.AllowAutoHide)}"
HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}"
IsScrollChainingEnabled="{TemplateBinding (ScrollViewer.IsScrollChainingEnabled)}"
VerticalScrollBarVisibility="{TemplateBinding (ScrollViewer.VerticalScrollBarVisibility)}">
<Panel>
<TextBlock
Name="PART_Watermark"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
IsVisible="{TemplateBinding Text,
Converter={x:Static StringConverters.IsNullOrEmpty}}"
Opacity="0.5"
Text="{TemplateBinding Watermark}"
TextAlignment="{TemplateBinding TextAlignment}"
TextWrapping="{TemplateBinding TextWrapping}" />
<TextPresenter
Name="PART_TextPresenter"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
CaretBrush="{TemplateBinding CaretBrush}"
CaretIndex="{TemplateBinding CaretIndex}"
LineHeight="{TemplateBinding LineHeight}"
PasswordChar="{TemplateBinding PasswordChar}"
RevealPassword="{TemplateBinding RevealPassword}"
SelectionBrush="{TemplateBinding SelectionBrush}"
SelectionEnd="{TemplateBinding SelectionEnd}"
SelectionForegroundBrush="{TemplateBinding SelectionForegroundBrush}"
SelectionStart="{TemplateBinding SelectionStart}"
Text="{TemplateBinding Text,
Mode=TwoWay}"
TextAlignment="{TemplateBinding TextAlignment}"
TextWrapping="{TemplateBinding TextWrapping}" />
</Panel>
</ScrollViewer>
<Button
Name="PART_ClearButton"
Grid.Column="2"
Command="{Binding $parent[TextBox].Clear}"
IsVisible="False"
Theme="{StaticResource InputClearButton}" />
<ToggleButton
Name="PART_RevealButton"
Grid.Column="3"
Margin="4,0,0,0"
IsChecked="{TemplateBinding RevealPassword,
Mode=TwoWay}"
IsVisible="False"
Theme="{StaticResource InputToggleButton}" />
<ContentPresenter
Grid.Column="4"
Padding="{DynamicResource TextBoxInnerRightContentPadding}"
VerticalAlignment="Center"
Content="{TemplateBinding InnerRightContent}"
Foreground="{DynamicResource TextBoxInnerForeground}"
IsVisible="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=InnerRightContent, Converter={x:Static ObjectConverters.IsNotNull}}" />
</Grid>
</Border>
</DataValidationErrors>
</ControlTemplate>
</Setter>
<Style Selector="^:pointerover /template/ Border#PART_ContentPresenterBorder">
<Setter Property="Border.Background" Value="{DynamicResource TextBoxPointeroverBackground}" />
</Style>
<Style Selector="^:pressed /template/ Border#PART_ContentPresenterBorder">
<Setter Property="Border.Background" Value="{DynamicResource TextBoxPressedBackground}" />
</Style>
<Style Selector="^:focus /template/ Border#PART_ContentPresenterBorder">
<Setter Property="Border.BorderBrush" Value="{DynamicResource TextBoxFocusBorderBrush}" />
</Style>
<Style Selector="^:disabled /template/ Border#PART_ContentPresenterBorder">
<Setter Property="Border.BorderBrush" Value="{DynamicResource TextBoxDisabledBorderBrush}" />
<Setter Property="Border.Background" Value="{DynamicResource TextBoxDisabledBackground}" />
</Style>
<Style Selector="^:disabled">
<Setter Property="TextBox.Foreground" Value="{DynamicResource TextBoxDisabledForeground}" />
</Style>
<Style Selector="^:error">
<Style Selector="^ /template/ Border#PART_ContentPresenterBorder">
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsBackground}" />
<Setter Property="BorderBrush" Value="Transparent" />
</Style>
<Style Selector="^:pointerover /template/ Border#PART_ContentPresenterBorder">
<Setter Property="Border.Background" Value="{DynamicResource DataValidationErrorsPointerOverBackground}" />
<Setter Property="Border.BorderBrush" Value="Transparent" />
</Style>
<Style Selector="^:pressed /template/ Border#PART_ContentPresenterBorder">
<Setter Property="Border.Background" Value="{DynamicResource DataValidationErrorsPressedBackground}" />
<Setter Property="Border.BorderBrush" Value="Transparent" />
</Style>
<Style Selector="^:focus /template/ Border#PART_ContentPresenterBorder">
<Setter Property="Border.Background" Value="{DynamicResource DataValidationErrorsSelectedBackground}" />
<Setter Property="Border.BorderBrush" Value="{DynamicResource DataValidationErrorsSelectedBorderBrush}" />
</Style>
</Style>
<Style Selector="^.clearButton, ^.ClearButton">
<Style Selector="^[AcceptsReturn=False][IsReadOnly=False]:focus:not(:empty) /template/ Button#PART_ClearButton">
<Setter Property="Button.IsVisible" Value="True" />
</Style>
<Style Selector="^[AcceptsReturn=False][IsReadOnly=False]:pointerover:not(:empty) /template/ Button#PART_ClearButton">
<Setter Property="Button.IsVisible" Value="True" />
</Style>
</Style>
<Style Selector="^.revealPasswordButton, ^.RevealPasswordButton">
<Style Selector="^ /template/ ToggleButton#PART_RevealButton">
<Setter Property="ToggleButton.IsVisible" Value="True" />
</Style>
</Style>
<Style Selector="^.Large /template/ Border#PART_ContentPresenterBorder">
<Setter Property="MinHeight" Value="{DynamicResource TextBoxWrapperLargeHeight}" />
</Style>
<Style Selector="^.Small /template/ Border#PART_ContentPresenterBorder">
<Setter Property="MinHeight" Value="{DynamicResource TextBoxWrapperSmallHeight}" />
</Style>
<Style Selector="^.Bordered">
<Setter Property="TextBox.Background" Value="{DynamicResource TextBoxBorderedDefaultBackground}" />
<Setter Property="TextBox.BorderBrush" Value="{DynamicResource TextBoxBorderedDefaultBorderBrush}" />
<Style Selector="^:pointerover /template/ Border#PART_ContentPresenterBorder">
<Setter Property="Border.Background" Value="{DynamicResource TextBoxBorderedPointeroverBackground}" />
<Setter Property="Border.BorderBrush" Value="{DynamicResource TextBoxBorderedPointeroverBorderBrush}" />
</Style>
<Style Selector="^:focus">
<Setter Property="TextBox.Background" Value="{DynamicResource TextBoxBorderedPointeroverBackground}" />
<Setter Property="TextBox.BorderBrush" Value="{DynamicResource TextBoxBorderedPointeroverBorderBrush}" />
</Style>
<Style Selector="^:disabled /template/ Border#PART_ContentPresenterBorder">
<Setter Property="TextBox.Background" Value="{DynamicResource TextBoxDisabledBackground}" />
<Setter Property="TextBox.BorderBrush" Value="{DynamicResource TextBoxDisabledBorderBrush}" />
</Style>
<Style Selector="^:error">
<Style Selector="^ /template/ Border#PART_ContentPresenterBorder">
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource DataValidationErrorsBorderBrush}" />
</Style>
<Style Selector="^:pointerover /template/ Border#PART_ContentPresenterBorder">
<Setter Property="Border.Background" Value="{DynamicResource DataValidationErrorsPointerOverBackground}" />
<Setter Property="Border.BorderBrush" Value="{DynamicResource DataValidationErrorsPointerOverBorderBrush}" />
</Style>
<Style Selector="^:pressed /template/ Border#PART_ContentPresenterBorder">
<Setter Property="Border.Background" Value="{DynamicResource DataValidationErrorsPressedBackground}" />
<Setter Property="Border.BorderBrush" Value="{DynamicResource DataValidationErrorsPressedBorderBrush}" />
</Style>
<Style Selector="^:focus /template/ Border#PART_ContentPresenterBorder">
<Setter Property="Border.Background" Value="{DynamicResource DataValidationErrorsSelectedBackground}" />
<Setter Property="Border.BorderBrush" Value="{DynamicResource DataValidationErrorsSelectedBorderBrush}" />
</Style>
</Style>
</Style>
</ControlTheme>
<ControlTheme x:Key="NonErrorTextBox" TargetType="TextBox">
<Setter Property="TextBox.Foreground" Value="{DynamicResource TextBoxForeground}" />
<Setter Property="TextBox.Background" Value="{DynamicResource TextBoxDefaultBackground}" />
<Setter Property="TextBox.BorderBrush" Value="{DynamicResource TextBoxDefaultBorderBrush}" />
<Setter Property="TextBox.SelectionBrush" Value="{DynamicResource TextBoxSelectionBackground}" />
<Setter Property="TextBox.SelectionForegroundBrush" Value="{DynamicResource TextBoxSelectionForeground}" />
<Setter Property="TextBox.BorderThickness" Value="{DynamicResource TextBoxBorderThickness}" />
<Setter Property="TextBox.CornerRadius" Value="{DynamicResource TextBoxDefaultCornerRadius}" />
<Setter Property="TextBox.FontSize" Value="14" />
<Setter Property="TextBox.Cursor" Value="Ibeam" />
<Setter Property="TextBox.CaretBrush" Value="{DynamicResource TextBoxTextCaretBrush}" />
<Setter Property="TextBox.Padding" Value="{DynamicResource TextBoxContentPadding}" />
<Setter Property="TextBox.MinHeight" Value="{DynamicResource TextBoxWrapperDefaultHeight}" />
<Setter Property="TextBox.VerticalContentAlignment" Value="Center" />
<Setter Property="TextBox.FocusAdorner" Value="{x:Null}" />
<Setter Property="ScrollViewer.IsScrollChainingEnabled" Value="True" />
<Setter Property="TextBox.ContextFlyout" Value="{StaticResource DefaultTextBoxContextFlyout}" />
<Setter Property="TextBox.Template">
<ControlTemplate TargetType="TextBox">
<DataValidationErrors Theme="{DynamicResource SilentDataValidationErrors}">
<Border
Name="PART_ContentPresenterBorder"
MinHeight="{TemplateBinding MinHeight}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}">
<ScrollViewer <ScrollViewer
Grid.Column="1" Margin="{TemplateBinding Padding}"
AllowAutoHide="{TemplateBinding (ScrollViewer.AllowAutoHide)}" AllowAutoHide="{TemplateBinding (ScrollViewer.AllowAutoHide)}"
HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}" HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}"
IsScrollChainingEnabled="{TemplateBinding (ScrollViewer.IsScrollChainingEnabled)}" IsScrollChainingEnabled="{TemplateBinding (ScrollViewer.IsScrollChainingEnabled)}"
@ -154,29 +338,8 @@
TextWrapping="{TemplateBinding TextWrapping}" /> TextWrapping="{TemplateBinding TextWrapping}" />
</Panel> </Panel>
</ScrollViewer> </ScrollViewer>
<Button </Border>
Name="PART_ClearButton" </DataValidationErrors>
Grid.Column="2"
Command="{Binding $parent[TextBox].Clear}"
IsVisible="False"
Theme="{StaticResource InputClearButton}" />
<ToggleButton
Name="PART_RevealButton"
Grid.Column="3"
Margin="4,0,0,0"
IsChecked="{TemplateBinding RevealPassword,
Mode=TwoWay}"
IsVisible="False"
Theme="{StaticResource InputToggleButton}" />
<ContentPresenter
Grid.Column="4"
Padding="{DynamicResource TextBoxInnerRightContentPadding}"
VerticalAlignment="Center"
Content="{TemplateBinding InnerRightContent}"
Foreground="{DynamicResource TextBoxInnerForeground}"
IsVisible="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=InnerRightContent, Converter={x:Static ObjectConverters.IsNotNull}}" />
</Grid>
</Border>
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
@ -196,40 +359,23 @@
<Style Selector="^:disabled"> <Style Selector="^:disabled">
<Setter Property="TextBox.Foreground" Value="{DynamicResource TextBoxDisabledForeground}" /> <Setter Property="TextBox.Foreground" Value="{DynamicResource TextBoxDisabledForeground}" />
</Style> </Style>
<Style Selector="^.clearButton, ^.ClearButton">
<Style Selector="^[AcceptsReturn=False][IsReadOnly=False]:focus:not(:empty) /template/ Button#PART_ClearButton">
<Setter Property="Button.IsVisible" Value="True" />
</Style>
<Style Selector="^[AcceptsReturn=False][IsReadOnly=False]:pointerover:not(:empty) /template/ Button#PART_ClearButton">
<Setter Property="Button.IsVisible" Value="True" />
</Style>
</Style>
<Style Selector="^.revealPasswordButton, ^.RevealPasswordButton">
<Style Selector="^ /template/ ToggleButton#PART_RevealButton">
<Setter Property="ToggleButton.IsVisible" Value="True" />
</Style>
</Style>
<Style Selector="^.Large">
<Setter Property="TextBox.MinHeight" Value="{DynamicResource TextBoxWrapperLargeHeight}" />
</Style>
<Style Selector="^.Small">
<Setter Property="TextBox.MinHeight" Value="{DynamicResource TextBoxWrapperSmallHeight}" />
</Style>
<Style Selector="^.Bordered"> <Style Selector="^:error">
<Setter Property="TextBox.Background" Value="{DynamicResource TextBoxBorderedDefaultBackground}" /> <Style Selector="^ /template/ Border#PART_ContentPresenterBorder">
<Setter Property="TextBox.BorderBrush" Value="{DynamicResource TextBoxBorderedDefaultBorderBrush}" /> <Setter Property="Background" Value="{DynamicResource DataValidationErrorsBackground}" />
<Setter Property="BorderBrush" Value="Transparent" />
</Style>
<Style Selector="^:pointerover /template/ Border#PART_ContentPresenterBorder"> <Style Selector="^:pointerover /template/ Border#PART_ContentPresenterBorder">
<Setter Property="Border.Background" Value="{DynamicResource TextBoxBorderedPointeroverBackground}" /> <Setter Property="Border.Background" Value="{DynamicResource DataValidationErrorsPointerOverBackground}" />
<Setter Property="Border.BorderBrush" Value="{DynamicResource TextBoxBorderedPointeroverBorderBrush}" /> <Setter Property="Border.BorderBrush" Value="Transparent" />
</Style> </Style>
<Style Selector="^:focus"> <Style Selector="^:pressed /template/ Border#PART_ContentPresenterBorder">
<Setter Property="TextBox.Background" Value="{DynamicResource TextBoxBorderedPointeroverBackground}" /> <Setter Property="Border.Background" Value="{DynamicResource DataValidationErrorsPressedBackground}" />
<Setter Property="TextBox.BorderBrush" Value="{DynamicResource TextBoxBorderedPointeroverBorderBrush}" /> <Setter Property="Border.BorderBrush" Value="Transparent" />
</Style> </Style>
<Style Selector="^:disabled /template/ Border#PART_ContentPresenterBorder"> <Style Selector="^:focus /template/ Border#PART_ContentPresenterBorder">
<Setter Property="TextBox.Background" Value="{DynamicResource TextBoxDisabledBackground}" /> <Setter Property="Border.Background" Value="{DynamicResource DataValidationErrorsSelectedBackground}" />
<Setter Property="TextBox.BorderBrush" Value="{DynamicResource TextBoxDisabledBorderBrush}" /> <Setter Property="Border.BorderBrush" Value="{DynamicResource DataValidationErrorsSelectedBorderBrush}" />
</Style> </Style>
</Style> </Style>
</ControlTheme> </ControlTheme>

View File

@ -129,7 +129,6 @@
</ControlTheme> </ControlTheme>
<ControlTheme x:Key="{x:Type TimePicker}" TargetType="TimePicker"> <ControlTheme x:Key="{x:Type TimePicker}" TargetType="TimePicker">
<Setter Property="MinHeight" Value="{DynamicResource DateTimePickerButtonDefaultHeight}" />
<Setter Property="Foreground" Value="{DynamicResource DateTimePickerButtonForeground}" /> <Setter Property="Foreground" Value="{DynamicResource DateTimePickerButtonForeground}" />
<Setter Property="Background" Value="{DynamicResource DateTimePickerButtonBackground}" /> <Setter Property="Background" Value="{DynamicResource DateTimePickerButtonBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource DateTimePickerButtonBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource DateTimePickerButtonBorderBrush}" />
@ -139,106 +138,110 @@
<Setter Property="VerticalAlignment" Value="Center" /> <Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate> <ControlTemplate>
<Grid Name="LayoutRoot" Margin="{TemplateBinding Padding}"> <DataValidationErrors>
<Button <Grid Name="LayoutRoot" Margin="{TemplateBinding Padding}">
x:Name="PART_FlyoutButton" <Button
Width="242" x:Name="PART_FlyoutButton"
MinWidth="242" Width="242"
HorizontalAlignment="Stretch" MinWidth="242"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
Background="{TemplateBinding Background}" VerticalAlignment="Stretch"
BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}"
BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}"
CornerRadius="{TemplateBinding CornerRadius}" BorderThickness="{TemplateBinding BorderThickness}"
Cursor="Hand" CornerRadius="{TemplateBinding CornerRadius}"
Foreground="{TemplateBinding Foreground}" Cursor="Hand"
IsEnabled="{TemplateBinding IsEnabled}" DataValidationErrors.Errors="{TemplateBinding (DataValidationErrors.Errors)}"
Theme="{StaticResource DateTimePickerFlyoutButton}"> Foreground="{TemplateBinding Foreground}"
<Grid ColumnDefinitions="*, Auto"> IsEnabled="{TemplateBinding IsEnabled}"
<Grid Name="PART_FlyoutButtonContentGrid" Grid.Column="0"> MinHeight="{DynamicResource DateTimePickerButtonDefaultHeight}"
<!-- Ignore col defs here, set in code --> Theme="{StaticResource DateTimePickerFlyoutButton}">
<Border <Grid ColumnDefinitions="*, Auto">
x:Name="PART_FirstPickerHost" <Grid Name="PART_FlyoutButtonContentGrid" Grid.Column="0">
Grid.Column="0" <!-- Ignore col defs here, set in code -->
HorizontalAlignment="Stretch" <Border
VerticalAlignment="Stretch"> x:Name="PART_FirstPickerHost"
<TextBlock Grid.Column="0"
x:Name="PART_HourTextBlock" HorizontalAlignment="Stretch"
Padding="12,4" VerticalAlignment="Stretch">
HorizontalAlignment="Center" <TextBlock
VerticalAlignment="Center" x:Name="PART_HourTextBlock"
FontFamily="{TemplateBinding FontFamily}" Padding="12,4"
FontSize="{TemplateBinding FontSize}" HorizontalAlignment="Center"
FontWeight="{TemplateBinding FontWeight}" /> VerticalAlignment="Center"
</Border> FontFamily="{TemplateBinding FontFamily}"
FontSize="{TemplateBinding FontSize}"
FontWeight="{TemplateBinding FontWeight}" />
</Border>
<Rectangle <Rectangle
Name="PART_FirstColumnDivider" Name="PART_FirstColumnDivider"
Grid.Column="1"
Width="1"
Margin="0,4"
HorizontalAlignment="Center"
Fill="{DynamicResource DateTimePickerSeparatorBackground}" />
<Border
x:Name="PART_SecondPickerHost"
Grid.Column="2"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch">
<TextBlock
x:Name="PART_MinuteTextBlock"
Padding="12,4"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontFamily="{TemplateBinding FontFamily}"
FontSize="{TemplateBinding FontSize}"
FontWeight="{TemplateBinding FontWeight}" />
</Border>
<Rectangle
Name="PART_SecondColumnDivider"
Grid.Column="3"
Width="1"
Margin="0,4"
HorizontalAlignment="Center"
Fill="{DynamicResource DateTimePickerSeparatorBackground}" />
<Border
x:Name="PART_ThirdPickerHost"
Grid.Column="4"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch">
<TextBlock
x:Name="PART_PeriodTextBlock"
Padding="12,4"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontFamily="{TemplateBinding FontFamily}"
FontSize="{TemplateBinding FontSize}"
FontWeight="{TemplateBinding FontWeight}" />
</Border>
</Grid>
<PathIcon
Name="PART_Icon"
Grid.Column="1" Grid.Column="1"
Width="1" Width="16"
Margin="0,4" Height="16"
HorizontalAlignment="Center" Margin="0,0,8,0"
Fill="{DynamicResource DateTimePickerSeparatorBackground}" /> Data="{DynamicResource TimePickerIconGlyph}"
Foreground="{DynamicResource DateTimePickerIconForeground}" />
<Border
x:Name="PART_SecondPickerHost"
Grid.Column="2"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch">
<TextBlock
x:Name="PART_MinuteTextBlock"
Padding="12,4"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontFamily="{TemplateBinding FontFamily}"
FontSize="{TemplateBinding FontSize}"
FontWeight="{TemplateBinding FontWeight}" />
</Border>
<Rectangle
Name="PART_SecondColumnDivider"
Grid.Column="3"
Width="1"
Margin="0,4"
HorizontalAlignment="Center"
Fill="{DynamicResource DateTimePickerSeparatorBackground}" />
<Border
x:Name="PART_ThirdPickerHost"
Grid.Column="4"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch">
<TextBlock
x:Name="PART_PeriodTextBlock"
Padding="12,4"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontFamily="{TemplateBinding FontFamily}"
FontSize="{TemplateBinding FontSize}"
FontWeight="{TemplateBinding FontWeight}" />
</Border>
</Grid> </Grid>
<PathIcon
Name="PART_Icon"
Grid.Column="1"
Width="16"
Height="16"
Margin="0,0,8,0"
Data="{DynamicResource TimePickerIconGlyph}"
Foreground="{DynamicResource DateTimePickerIconForeground}" />
</Grid>
</Button> </Button>
<Popup <Popup
Name="PART_Popup" Name="PART_Popup"
IsLightDismissEnabled="True" IsLightDismissEnabled="True"
Placement="Bottom" Placement="Bottom"
PlacementTarget="{TemplateBinding}" PlacementTarget="{TemplateBinding}"
WindowManagerAddShadowHint="False"> WindowManagerAddShadowHint="False">
<TimePickerPresenter Name="PART_PickerPresenter" /> <TimePickerPresenter Name="PART_PickerPresenter" />
</Popup> </Popup>
</Grid> </Grid>
</DataValidationErrors>
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
@ -250,10 +253,10 @@
<Setter Property="Foreground" Value="{DynamicResource DateTimePickerEmptyForeground}" /> <Setter Property="Foreground" Value="{DynamicResource DateTimePickerEmptyForeground}" />
</Style> </Style>
<Style Selector="^.Large"> <Style Selector="^.Large /template/ Button#PART_FlyoutButton">
<Setter Property="MinHeight" Value="{DynamicResource DateTimePickerButtonLargeHeight}" /> <Setter Property="MinHeight" Value="{DynamicResource DateTimePickerButtonLargeHeight}" />
</Style> </Style>
<Style Selector="^.Small"> <Style Selector="^.Small /template/ Button#PART_FlyoutButton">
<Setter Property="MinHeight" Value="{DynamicResource DateTimePickerButtonSmallHeight}" /> <Setter Property="MinHeight" Value="{DynamicResource DateTimePickerButtonSmallHeight}" />
</Style> </Style>
</ControlTheme> </ControlTheme>

View File

@ -13,6 +13,7 @@
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Dark/Carousel.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Themes/Dark/Carousel.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Dark/CheckBox.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Themes/Dark/CheckBox.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Dark/ComboBox.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Themes/Dark/ComboBox.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Dark/DataValidationErrors.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Dark/DatePicker.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Themes/Dark/DatePicker.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Dark/DateTimePickerShared.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Themes/Dark/DateTimePickerShared.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Dark/DropDownButton.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Themes/Dark/DropDownButton.axaml" />

View File

@ -0,0 +1,12 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- Add Resources Here -->
<SolidColorBrush x:Key="DataValidationErrorsForeground" Color="#FFFC725A" />
<SolidColorBrush x:Key="DataValidationErrorsBackground" Opacity="0.2" Color="#FFFC725A" />
<SolidColorBrush x:Key="DataValidationErrorsBorderBrush" Opacity="0.2" Color="#FFFC725A" />
<SolidColorBrush x:Key="DataValidationErrorsPointerOverBackground" Opacity="0.3" Color="#FFFC725A" />
<SolidColorBrush x:Key="DataValidationErrorsPointerOverBorderBrush" Opacity="0.3" Color="#FFFC725A" />
<SolidColorBrush x:Key="DataValidationErrorsPressedBackground" Opacity="0.4" Color="#FFFC725A" />
<SolidColorBrush x:Key="DataValidationErrorsPressedBorderBrush" Opacity="0.4" Color="#FFFC725A" />
<SolidColorBrush x:Key="DataValidationErrorsSelectedBackground" Opacity="0.2" Color="#FFFC725A" />
<SolidColorBrush x:Key="DataValidationErrorsSelectedBorderBrush" Color="#FFFC725A" />
</ResourceDictionary>

View File

@ -0,0 +1,12 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- Add Resources Here -->
<SolidColorBrush x:Key="DataValidationErrorsForeground" Color="#FFF93920" />
<SolidColorBrush x:Key="DataValidationErrorsBackground" Color="#FFFEF2ED" />
<SolidColorBrush x:Key="DataValidationErrorsBorderBrush" Color="#FFFEF2ED" />
<SolidColorBrush x:Key="DataValidationErrorsPointerOverBackground" Color="#FFFEDDD2" />
<SolidColorBrush x:Key="DataValidationErrorsPointerOverBorderBrush" Color="#FFFEDDD2" />
<SolidColorBrush x:Key="DataValidationErrorsPressedBackground" Color="#FFFDB7A5" />
<SolidColorBrush x:Key="DataValidationErrorsPressedBorderBrush" Color="#FFFDB7A5" />
<SolidColorBrush x:Key="DataValidationErrorsSelectedBackground" Color="#FFFEF2ED" />
<SolidColorBrush x:Key="DataValidationErrorsSelectedBorderBrush" Color="#FFF93920" />
</ResourceDictionary>

View File

@ -12,6 +12,7 @@
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/Carousel.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/Carousel.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/CheckBox.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/CheckBox.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/ComboBox.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/ComboBox.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/DataValidationErrors.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/DatePicker.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/DatePicker.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/DateTimePickerShared.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/DateTimePickerShared.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/DropDownButton.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/DropDownButton.axaml" />