mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-03-11 04:00:48 +08:00
Compare commits
4 Commits
progress
...
copilot/ad
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4b183c591c | ||
|
|
4ddcca529c | ||
|
|
c144056ab0 | ||
|
|
65e4d0d4a4 |
@@ -1,7 +1,7 @@
|
|||||||
<Project>
|
<Project>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
||||||
<AvaloniaVersion>12.0.0-preview1</AvaloniaVersion>
|
<AvaloniaVersion>12.0.0-preview2</AvaloniaVersion>
|
||||||
<DataGridVersion>11.3.10</DataGridVersion>
|
<DataGridVersion>11.3.10</DataGridVersion>
|
||||||
<SkiaSharpVersion>3.119.1</SkiaSharpVersion>
|
<SkiaSharpVersion>3.119.1</SkiaSharpVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|||||||
99
demo/Semi.Avalonia.Demo/Pages/CommandBarDemo.axaml
Normal file
99
demo/Semi.Avalonia.Demo/Pages/CommandBarDemo.axaml
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
<UserControl
|
||||||
|
x:Class="Semi.Avalonia.Demo.Pages.CommandBarDemo"
|
||||||
|
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"
|
||||||
|
d:DesignHeight="600"
|
||||||
|
d:DesignWidth="800"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
<UserControl.Resources>
|
||||||
|
<StreamGeometry x:Key="SemiIconShare">
|
||||||
|
M17.5 2A3.5 3.5 0 1 1 15 7.95l-5.13 3.11a3.5 3.5 0 0 1 .03 1.78l5.22 3.1A3.49 3.49 0 0 1 21 18.5a3.5 3.5 0 1 1-6.9-.85l-5.22-3.08A3.49 3.49 0 0 1 3 12a3.5 3.5 0 0 1 5.8-2.63l5.27-3.19A3.5 3.5 0 0 1 17.5 2Z
|
||||||
|
</StreamGeometry>
|
||||||
|
</UserControl.Resources>
|
||||||
|
<ScrollViewer>
|
||||||
|
<StackPanel Spacing="16" Margin="0,0,0,16">
|
||||||
|
|
||||||
|
<!-- Default: label below icon (Bottom) -->
|
||||||
|
<HeaderedContentControl Theme="{StaticResource GroupBox}">
|
||||||
|
<HeaderedContentControl.Header>
|
||||||
|
<TextBlock Text="CommandBar — Label Position: Bottom (default)" />
|
||||||
|
</HeaderedContentControl.Header>
|
||||||
|
<CommandBar>
|
||||||
|
<AppBarButton Label="New" Icon="{DynamicResource SemiIconPlus}" />
|
||||||
|
<AppBarButton Label="Save" Icon="{DynamicResource SemiIconSave}" />
|
||||||
|
<AppBarSeparator />
|
||||||
|
<AppBarToggleButton Label="Bold" Icon="{DynamicResource SemiIconBold}" />
|
||||||
|
<AppBarToggleButton Label="Italic" Icon="{DynamicResource SemiIconItalic}" />
|
||||||
|
<AppBarSeparator />
|
||||||
|
<AppBarButton Label="Share" Icon="{DynamicResource SemiIconShare}" />
|
||||||
|
<AppBarButton Label="Export" Icon="{DynamicResource SemiIconExport}" />
|
||||||
|
<AppBarButton Label="Print" Icon="{DynamicResource SemiIconPrint}" />
|
||||||
|
<AppBarSeparator />
|
||||||
|
<AppBarButton Label="Delete" Icon="{DynamicResource SemiIconDelete}" />
|
||||||
|
</CommandBar>
|
||||||
|
</HeaderedContentControl>
|
||||||
|
|
||||||
|
<!-- LabelPosition=Right -->
|
||||||
|
<HeaderedContentControl Theme="{StaticResource GroupBox}">
|
||||||
|
<HeaderedContentControl.Header>
|
||||||
|
<TextBlock Text="CommandBar — Label Position: Right" />
|
||||||
|
</HeaderedContentControl.Header>
|
||||||
|
<CommandBar DefaultLabelPosition="Right">
|
||||||
|
<AppBarToggleButton Label="Bold" Icon="{DynamicResource SemiIconBold}" />
|
||||||
|
<AppBarToggleButton Label="Italic" Icon="{DynamicResource SemiIconItalic}" />
|
||||||
|
<AppBarToggleButton Label="Underline" Icon="{DynamicResource SemiIconUnderline}" />
|
||||||
|
</CommandBar>
|
||||||
|
</HeaderedContentControl>
|
||||||
|
|
||||||
|
<!-- Compact (icons only) -->
|
||||||
|
<HeaderedContentControl Theme="{StaticResource GroupBox}">
|
||||||
|
<HeaderedContentControl.Header>
|
||||||
|
<TextBlock Text="CommandBar — Compact (icons only)" />
|
||||||
|
</HeaderedContentControl.Header>
|
||||||
|
<CommandBar DefaultLabelPosition="Collapsed">
|
||||||
|
<AppBarToggleButton Label="Bold" Icon="{DynamicResource SemiIconBold}" />
|
||||||
|
<AppBarToggleButton Label="Italic" Icon="{DynamicResource SemiIconItalic}" />
|
||||||
|
<AppBarToggleButton Label="Underline" Icon="{DynamicResource SemiIconUnderline}" />
|
||||||
|
</CommandBar>
|
||||||
|
</HeaderedContentControl>
|
||||||
|
|
||||||
|
<!-- With secondary commands (overflow) -->
|
||||||
|
<HeaderedContentControl Theme="{StaticResource GroupBox}">
|
||||||
|
<HeaderedContentControl.Header>
|
||||||
|
<TextBlock Text="CommandBar — With Secondary Commands (overflow)" />
|
||||||
|
</HeaderedContentControl.Header>
|
||||||
|
<CommandBar>
|
||||||
|
<AppBarButton Label="New" Icon="{DynamicResource SemiIconPlus}" />
|
||||||
|
<AppBarButton Label="Save" Icon="{DynamicResource SemiIconSave}" />
|
||||||
|
<AppBarButton Label="Share" Icon="{DynamicResource SemiIconShare}" />
|
||||||
|
<CommandBar.SecondaryCommands>
|
||||||
|
<AppBarButton Label="Export" Icon="{DynamicResource SemiIconExport}" />
|
||||||
|
<AppBarButton Label="Delete" Icon="{DynamicResource SemiIconDelete}" />
|
||||||
|
</CommandBar.SecondaryCommands>
|
||||||
|
</CommandBar>
|
||||||
|
</HeaderedContentControl>
|
||||||
|
|
||||||
|
<HeaderedContentControl Theme="{StaticResource GroupBox}">
|
||||||
|
<HeaderedContentControl.Header>
|
||||||
|
<StackPanel HorizontalAlignment="Left">
|
||||||
|
<TextBlock Text="CommandBar — Dynamic Overflow" />
|
||||||
|
<ToggleSwitch Name="idfe" IsChecked="True" />
|
||||||
|
<Slider Name="ws" Width="500" Minimum="0" Maximum="500" Value="100" />
|
||||||
|
</StackPanel>
|
||||||
|
</HeaderedContentControl.Header>
|
||||||
|
<CommandBar
|
||||||
|
IsDynamicOverflowEnabled="{Binding #idfe.IsChecked}"
|
||||||
|
Width="{Binding #ws.Value}">
|
||||||
|
<AppBarButton Label="New" Icon="{DynamicResource SemiIconPlus}" />
|
||||||
|
<AppBarButton Label="Save" Icon="{DynamicResource SemiIconSave}" />
|
||||||
|
<AppBarButton Label="Share" Icon="{DynamicResource SemiIconShare}" />
|
||||||
|
<AppBarButton Label="Export" Icon="{DynamicResource SemiIconExport}" />
|
||||||
|
<AppBarButton Label="Delete" Icon="{DynamicResource SemiIconDelete}" />
|
||||||
|
</CommandBar>
|
||||||
|
</HeaderedContentControl>
|
||||||
|
|
||||||
|
</StackPanel>
|
||||||
|
</ScrollViewer>
|
||||||
|
</UserControl>
|
||||||
11
demo/Semi.Avalonia.Demo/Pages/CommandBarDemo.axaml.cs
Normal file
11
demo/Semi.Avalonia.Demo/Pages/CommandBarDemo.axaml.cs
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
using Avalonia.Controls;
|
||||||
|
|
||||||
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
|
public partial class CommandBarDemo : UserControl
|
||||||
|
{
|
||||||
|
public CommandBarDemo()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -269,6 +269,9 @@
|
|||||||
<TabItem
|
<TabItem
|
||||||
Theme="{DynamicResource CategoryTabItem}"
|
Theme="{DynamicResource CategoryTabItem}"
|
||||||
Header="Other" />
|
Header="Other" />
|
||||||
|
<TabItem Header="CommandBar">
|
||||||
|
<pages:CommandBarDemo />
|
||||||
|
</TabItem>
|
||||||
<TabItem Header="GridSplitter">
|
<TabItem Header="GridSplitter">
|
||||||
<pages:GridSplitterDemo />
|
<pages:GridSplitterDemo />
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
|||||||
@@ -5,10 +5,12 @@
|
|||||||
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:views="clr-namespace:Semi.Avalonia.Demo.Views"
|
xmlns:views="clr-namespace:Semi.Avalonia.Demo.Views"
|
||||||
Title="Semi.Avalonia.Demo"
|
Title="Semi Avalonia Demo"
|
||||||
d:DesignHeight="450"
|
d:DesignHeight="450"
|
||||||
d:DesignWidth="800"
|
d:DesignWidth="800"
|
||||||
|
ExtendClientAreaToDecorationsHint="True"
|
||||||
|
ExtendClientAreaTitleBarHeightHint="40"
|
||||||
Icon="/Assets/irihi.ico"
|
Icon="/Assets/irihi.ico"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<views:MainView />
|
<views:MainView Margin="{Binding $parent[Window].WindowDecorationMargin}" />
|
||||||
</Window>
|
</Window>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<Project>
|
<Project>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
||||||
<AvaloniaVersion>12.0.0-preview1</AvaloniaVersion>
|
<AvaloniaVersion>12.0.0-preview2</AvaloniaVersion>
|
||||||
<DataGridVersion>11.3.7</DataGridVersion>
|
<DataGridVersion>11.3.7</DataGridVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Media;
|
using Avalonia.Media;
|
||||||
using Avalonia.Utilities;
|
using Avalonia.Utilities;
|
||||||
|
using Irihi.Avalonia.Shared.Helpers;
|
||||||
|
|
||||||
namespace Semi.Avalonia.ColorPicker;
|
namespace Semi.Avalonia.ColorPicker;
|
||||||
|
|
||||||
@@ -220,8 +221,8 @@ public class SemiColorDarkPalette: IColorPalette
|
|||||||
public Color GetColor(int colorIndex, int shadeIndex)
|
public Color GetColor(int colorIndex, int shadeIndex)
|
||||||
{
|
{
|
||||||
return Colors[
|
return Colors[
|
||||||
MathUtilities.Clamp(colorIndex, 0, ColorCount - 1),
|
MathHelpers.SafeClamp(colorIndex, 0, ColorCount - 1),
|
||||||
MathUtilities.Clamp(shadeIndex, 0, ShadeCount - 1)
|
MathHelpers.SafeClamp(shadeIndex, 0, ShadeCount - 1)
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Media;
|
using Avalonia.Media;
|
||||||
using Avalonia.Utilities;
|
using Avalonia.Utilities;
|
||||||
|
using Irihi.Avalonia.Shared.Helpers;
|
||||||
|
|
||||||
namespace Semi.Avalonia.ColorPicker;
|
namespace Semi.Avalonia.ColorPicker;
|
||||||
|
|
||||||
@@ -220,8 +221,8 @@ public class SemiColorLightPalette: IColorPalette
|
|||||||
public Color GetColor(int colorIndex, int shadeIndex)
|
public Color GetColor(int colorIndex, int shadeIndex)
|
||||||
{
|
{
|
||||||
return Colors[
|
return Colors[
|
||||||
MathUtilities.Clamp(colorIndex, 0, ColorCount - 1),
|
MathHelpers.SafeClamp(colorIndex, 0, ColorCount - 1),
|
||||||
MathUtilities.Clamp(shadeIndex, 0, ShadeCount - 1)
|
MathHelpers.SafeClamp(shadeIndex, 0, ShadeCount - 1)
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,112 +0,0 @@
|
|||||||
<ResourceDictionary
|
|
||||||
xmlns="https://github.com/avaloniaui"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
|
||||||
<Design.PreviewWith>
|
|
||||||
<CaptionButtons />
|
|
||||||
</Design.PreviewWith>
|
|
||||||
|
|
||||||
<ControlTheme x:Key="CaptionButton" TargetType="Button">
|
|
||||||
<Setter Property="Foreground" Value="{DynamicResource CaptionButtonForeground}" />
|
|
||||||
<Setter Property="Background" Value="Transparent" />
|
|
||||||
<Setter Property="CornerRadius" Value="{StaticResource CaptionButtonCornerRadius}" />
|
|
||||||
<Setter Property="Padding" Value="{StaticResource CaptionButtonPadding}" />
|
|
||||||
<Setter Property="Width" Value="{StaticResource CaptionButtonWidth}" />
|
|
||||||
<Setter Property="Height" Value="{StaticResource CaptionButtonHeight}" />
|
|
||||||
<Setter Property="Cursor" Value="Hand" />
|
|
||||||
<Setter Property="VerticalAlignment" Value="Stretch" />
|
|
||||||
<Setter Property="Template">
|
|
||||||
<ControlTemplate TargetType="Button">
|
|
||||||
<ContentPresenter
|
|
||||||
Name="PART_ContentPresenter"
|
|
||||||
Padding="{TemplateBinding Padding}"
|
|
||||||
Foreground="{TemplateBinding Foreground}"
|
|
||||||
Background="{TemplateBinding Background}"
|
|
||||||
BorderBrush="{TemplateBinding BorderBrush}"
|
|
||||||
BorderThickness="{TemplateBinding BorderThickness}"
|
|
||||||
Content="{TemplateBinding Content}"
|
|
||||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
|
||||||
CornerRadius="{TemplateBinding CornerRadius}" />
|
|
||||||
</ControlTemplate>
|
|
||||||
</Setter>
|
|
||||||
|
|
||||||
<Style Selector="^:pointerover">
|
|
||||||
<Setter Property="Background" Value="{DynamicResource CaptionButtonPointeroverBackground}" />
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
<Style Selector="^:pressed">
|
|
||||||
<Setter Property="Background" Value="{DynamicResource CaptionButtonPressedBackground}" />
|
|
||||||
</Style>
|
|
||||||
</ControlTheme>
|
|
||||||
|
|
||||||
<ControlTheme x:Key="{x:Type CaptionButtons}" TargetType="CaptionButtons">
|
|
||||||
<Setter Property="Foreground" Value="{DynamicResource CaptionButtonForeground}" />
|
|
||||||
<Setter Property="Template">
|
|
||||||
<ControlTemplate TargetType="CaptionButtons">
|
|
||||||
<StackPanel Orientation="Horizontal">
|
|
||||||
<Button Name="PART_FullScreenButton" Theme="{StaticResource CaptionButton}">
|
|
||||||
<PathIcon
|
|
||||||
Name="PART_FullScreenButtonIcon"
|
|
||||||
Theme="{StaticResource InnerPathIcon}"
|
|
||||||
Data="{StaticResource WindowExpandGlyph}"
|
|
||||||
Foreground="{Binding $parent[Button].Foreground}" />
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
Name="PART_MinimizeButton"
|
|
||||||
Theme="{StaticResource CaptionButton}"
|
|
||||||
AutomationProperties.Name="Minimize"
|
|
||||||
Win32Properties.NonClientHitTestResult="MinButton">
|
|
||||||
<PathIcon
|
|
||||||
Name="PART_MinimizeButtonIcon"
|
|
||||||
Theme="{StaticResource InnerPathIcon}"
|
|
||||||
Data="{StaticResource WindowMinimizeGlyph}"
|
|
||||||
Foreground="{Binding $parent[Button].Foreground}" />
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
Name="PART_RestoreButton"
|
|
||||||
Theme="{StaticResource CaptionButton}"
|
|
||||||
AutomationProperties.Name="Maximize"
|
|
||||||
Win32Properties.NonClientHitTestResult="MaxButton">
|
|
||||||
<PathIcon
|
|
||||||
Name="PART_RestoreButtonIcon"
|
|
||||||
Theme="{StaticResource InnerPathIcon}"
|
|
||||||
Data="{StaticResource WindowMaximizeGlyph}"
|
|
||||||
Foreground="{Binding $parent[Button].Foreground}" />
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
Name="PART_CloseButton"
|
|
||||||
Theme="{StaticResource CaptionButton}"
|
|
||||||
AutomationProperties.Name="Close"
|
|
||||||
Win32Properties.NonClientHitTestResult="Close">
|
|
||||||
<PathIcon
|
|
||||||
Name="PART_CloseButtonIcon"
|
|
||||||
Theme="{StaticResource InnerPathIcon}"
|
|
||||||
Data="{StaticResource WindowCloseIconGlyph}"
|
|
||||||
Foreground="{Binding $parent[Button].Foreground}" />
|
|
||||||
</Button>
|
|
||||||
</StackPanel>
|
|
||||||
</ControlTemplate>
|
|
||||||
</Setter>
|
|
||||||
|
|
||||||
<Style Selector="^ /template/ Button#PART_CloseButton:pointerover">
|
|
||||||
<Setter Property="Foreground" Value="{DynamicResource CaptionButtonCloseForeground}" />
|
|
||||||
<Setter Property="Background" Value="{DynamicResource CaptionButtonClosePointeroverBackground}" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^ /template/ Button#PART_CloseButton:pressed">
|
|
||||||
<Setter Property="Foreground" Value="{DynamicResource CaptionButtonCloseForeground}" />
|
|
||||||
<Setter Property="Background" Value="{DynamicResource CaptionButtonClosePressedBackground}" />
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
<Style Selector="^:maximized /template/ PathIcon#PART_RestoreButtonIcon">
|
|
||||||
<Setter Property="Data" Value="{StaticResource WindowRestoreGlyph}" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^:fullscreen /template/ PathIcon#PART_FullScreenButtonIcon">
|
|
||||||
<Setter Property="Data" Value="{StaticResource WindowCollapseGlyph}" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^:fullscreen /template/ Button#PART_RestoreButton">
|
|
||||||
<Setter Property="IsVisible" Value="False" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^:fullscreen /template/ Button#PART_MinimizeButton">
|
|
||||||
<Setter Property="IsVisible" Value="False" />
|
|
||||||
</Style>
|
|
||||||
</ControlTheme>
|
|
||||||
</ResourceDictionary>
|
|
||||||
406
src/Semi.Avalonia/Controls/CommandBar.axaml
Normal file
406
src/Semi.Avalonia/Controls/CommandBar.axaml
Normal file
@@ -0,0 +1,406 @@
|
|||||||
|
<ResourceDictionary
|
||||||
|
xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
|
|
||||||
|
<Design.PreviewWith>
|
||||||
|
<Border Padding="16" Width="600" Background="{DynamicResource SemiColorBackground0}">
|
||||||
|
<StackPanel Spacing="16">
|
||||||
|
<CommandBar>
|
||||||
|
<AppBarButton Label="New" Icon="{DynamicResource SemiIconPlus}" />
|
||||||
|
<AppBarButton Label="Save" Icon="{DynamicResource SemiIconSave}" />
|
||||||
|
<AppBarSeparator />
|
||||||
|
<AppBarToggleButton Label="Bold" Icon="{DynamicResource SemiIconBold}" />
|
||||||
|
<AppBarButton Label="Copy" IsEnabled="False" Icon="{DynamicResource SemiIconCopy}" />
|
||||||
|
</CommandBar>
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
|
</Design.PreviewWith>
|
||||||
|
|
||||||
|
<!-- AppBarButton -->
|
||||||
|
<ControlTheme x:Key="{x:Type AppBarButton}" TargetType="AppBarButton">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource AppBarButtonBackground}" />
|
||||||
|
<Setter Property="Foreground" Value="{DynamicResource AppBarButtonForeground}" />
|
||||||
|
<Setter Property="BorderBrush" Value="Transparent" />
|
||||||
|
<Setter Property="BorderThickness" Value="0" />
|
||||||
|
<Setter Property="Padding" Value="{DynamicResource AppBarButtonPadding}" />
|
||||||
|
<Setter Property="Width" Value="{DynamicResource AppBarButtonWidth}" />
|
||||||
|
<Setter Property="MinHeight" Value="{DynamicResource AppBarButtonMinHeight}" />
|
||||||
|
<Setter Property="CornerRadius" Value="{DynamicResource AppBarButtonCornerRadius}" />
|
||||||
|
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||||||
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||||
|
<Setter Property="Cursor" Value="Hand" />
|
||||||
|
<Setter Property="Template">
|
||||||
|
<ControlTemplate TargetType="AppBarButton">
|
||||||
|
<Border
|
||||||
|
Name="PART_Border"
|
||||||
|
Background="{TemplateBinding Background}"
|
||||||
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||||||
|
BorderThickness="{TemplateBinding BorderThickness}"
|
||||||
|
CornerRadius="{TemplateBinding CornerRadius}"
|
||||||
|
Padding="{TemplateBinding Padding}">
|
||||||
|
<StackPanel
|
||||||
|
Name="PART_LayoutRoot"
|
||||||
|
Spacing="4"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center">
|
||||||
|
<ContentPresenter
|
||||||
|
Name="PART_IconPresenter"
|
||||||
|
Content="{TemplateBinding Icon}"
|
||||||
|
Foreground="{TemplateBinding Foreground}"
|
||||||
|
Width="{DynamicResource AppBarButtonIconSize}"
|
||||||
|
Height="{DynamicResource AppBarButtonIconSize}"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center">
|
||||||
|
<ContentPresenter.DataTemplates>
|
||||||
|
<DataTemplate DataType="Geometry">
|
||||||
|
<PathIcon
|
||||||
|
Theme="{DynamicResource InnerPathIcon}"
|
||||||
|
Data="{Binding}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</ContentPresenter.DataTemplates>
|
||||||
|
</ContentPresenter>
|
||||||
|
<TextBlock
|
||||||
|
Name="PART_Label"
|
||||||
|
Text="{TemplateBinding Label}"
|
||||||
|
Foreground="{TemplateBinding Foreground}"
|
||||||
|
FontSize="{DynamicResource AppBarButtonLabelFontSize}"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
TextTrimming="CharacterEllipsis" />
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter>
|
||||||
|
|
||||||
|
<!-- Pointer over -->
|
||||||
|
<Style Selector="^:pointerover /template/ Border#PART_Border">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource AppBarButtonPointeroverBackground}" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<!-- Pressed -->
|
||||||
|
<Style Selector="^:pressed /template/ Border#PART_Border">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource AppBarButtonPressedBackground}" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<!-- Disabled -->
|
||||||
|
<Style Selector="^:disabled /template/ ContentPresenter#PART_IconPresenter">
|
||||||
|
<Setter Property="Foreground" Value="{DynamicResource AppBarButtonDisabledForeground}" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^:disabled /template/ TextBlock#PART_Label">
|
||||||
|
<Setter Property="Foreground" Value="{DynamicResource AppBarButtonDisabledForeground}" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<!-- IsCompact: hide label, use compact width -->
|
||||||
|
<Style Selector="^[IsCompact=True]">
|
||||||
|
<Setter Property="Width" Value="{DynamicResource AppBarButtonCompactWidth}" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^[IsCompact=True] /template/ TextBlock#PART_Label">
|
||||||
|
<Setter Property="IsVisible" Value="False" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<!-- LabelPosition=Collapsed: hide label, use compact width -->
|
||||||
|
<Style Selector="^[LabelPosition=Collapsed]">
|
||||||
|
<Setter Property="Width" Value="{DynamicResource AppBarButtonCompactWidth}" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^[LabelPosition=Collapsed] /template/ TextBlock#PART_Label">
|
||||||
|
<Setter Property="IsVisible" Value="False" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<!-- LabelPosition=Right: horizontal layout, auto-width -->
|
||||||
|
<Style Selector="^[LabelPosition=Right]">
|
||||||
|
<Setter Property="Width" Value="{x:Static x:Double.NaN}" />
|
||||||
|
<Setter Property="MinWidth" Value="{DynamicResource AppBarButtonCompactWidth}" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^[LabelPosition=Right] /template/ StackPanel#PART_LayoutRoot">
|
||||||
|
<Setter Property="Orientation" Value="Horizontal" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^[LabelPosition=Right] /template/ ContentPresenter#PART_IconPresenter">
|
||||||
|
<Setter Property="VerticalAlignment" Value="Center" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^[LabelPosition=Right] /template/ TextBlock#PART_Label">
|
||||||
|
<Setter Property="VerticalAlignment" Value="Center" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<!-- IsInOverflow: full-width horizontal layout for use inside overflow popup -->
|
||||||
|
<Style Selector="^[IsInOverflow=True]">
|
||||||
|
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||||
|
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||||
|
<Setter Property="Width" Value="{x:Static x:Double.NaN}" />
|
||||||
|
<Setter Property="MinHeight" Value="{DynamicResource AppBarButtonOverflowMinHeight}" />
|
||||||
|
<Setter Property="Padding" Value="{DynamicResource AppBarButtonOverflowPadding}" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^[IsInOverflow=True] /template/ StackPanel#PART_LayoutRoot">
|
||||||
|
<Setter Property="Orientation" Value="Horizontal" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^[IsInOverflow=True] /template/ ContentPresenter#PART_IconPresenter">
|
||||||
|
<Setter Property="VerticalAlignment" Value="Center" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^[IsInOverflow=True] /template/ TextBlock#PART_Label">
|
||||||
|
<Setter Property="VerticalAlignment" Value="Center" />
|
||||||
|
</Style>
|
||||||
|
</ControlTheme>
|
||||||
|
|
||||||
|
<!-- AppBarToggleButton -->
|
||||||
|
<ControlTheme x:Key="{x:Type AppBarToggleButton}" TargetType="AppBarToggleButton">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource AppBarButtonBackground}" />
|
||||||
|
<Setter Property="Foreground" Value="{DynamicResource AppBarButtonForeground}" />
|
||||||
|
<Setter Property="BorderBrush" Value="Transparent" />
|
||||||
|
<Setter Property="BorderThickness" Value="0" />
|
||||||
|
<Setter Property="Padding" Value="{DynamicResource AppBarButtonPadding}" />
|
||||||
|
<Setter Property="Width" Value="{DynamicResource AppBarButtonWidth}" />
|
||||||
|
<Setter Property="MinHeight" Value="{DynamicResource AppBarButtonMinHeight}" />
|
||||||
|
<Setter Property="CornerRadius" Value="{DynamicResource AppBarButtonCornerRadius}" />
|
||||||
|
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||||||
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||||
|
<Setter Property="Cursor" Value="Hand" />
|
||||||
|
<Setter Property="Template">
|
||||||
|
<ControlTemplate TargetType="AppBarToggleButton">
|
||||||
|
<Border
|
||||||
|
Name="PART_Border"
|
||||||
|
Background="{TemplateBinding Background}"
|
||||||
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||||||
|
BorderThickness="{TemplateBinding BorderThickness}"
|
||||||
|
CornerRadius="{TemplateBinding CornerRadius}"
|
||||||
|
Padding="{TemplateBinding Padding}">
|
||||||
|
<StackPanel
|
||||||
|
Name="PART_LayoutRoot"
|
||||||
|
Spacing="4"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center">
|
||||||
|
<ContentPresenter
|
||||||
|
Name="PART_IconPresenter"
|
||||||
|
Content="{TemplateBinding Icon}"
|
||||||
|
Foreground="{TemplateBinding Foreground}"
|
||||||
|
Width="{DynamicResource AppBarButtonIconSize}"
|
||||||
|
Height="{DynamicResource AppBarButtonIconSize}"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center">
|
||||||
|
<ContentPresenter.DataTemplates>
|
||||||
|
<DataTemplate DataType="Geometry">
|
||||||
|
<PathIcon
|
||||||
|
Theme="{DynamicResource InnerPathIcon}"
|
||||||
|
Data="{Binding}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</ContentPresenter.DataTemplates>
|
||||||
|
</ContentPresenter>
|
||||||
|
<TextBlock
|
||||||
|
Name="PART_Label"
|
||||||
|
Text="{TemplateBinding Label}"
|
||||||
|
Foreground="{TemplateBinding Foreground}"
|
||||||
|
FontSize="{DynamicResource AppBarButtonLabelFontSize}"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
TextTrimming="CharacterEllipsis" />
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter>
|
||||||
|
|
||||||
|
<!-- Pointer over -->
|
||||||
|
<Style Selector="^:pointerover /template/ Border#PART_Border">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource AppBarButtonPointeroverBackground}" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<!-- Pressed -->
|
||||||
|
<Style Selector="^:pressed /template/ Border#PART_Border">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource AppBarButtonPressedBackground}" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<!-- Checked -->
|
||||||
|
<Style Selector="^:checked /template/ Border#PART_Border">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource AppBarToggleButtonCheckedBackground}" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^:checked /template/ ContentPresenter#PART_IconPresenter">
|
||||||
|
<Setter Property="Foreground" Value="{DynamicResource AppBarToggleButtonCheckedForeground}" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^:checked /template/ TextBlock#PART_Label">
|
||||||
|
<Setter Property="Foreground" Value="{DynamicResource AppBarToggleButtonCheckedForeground}" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<!-- Checked + Pointer over -->
|
||||||
|
<Style Selector="^:checked:pointerover /template/ Border#PART_Border">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource AppBarToggleButtonCheckedPointeroverBackground}" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<!-- Disabled -->
|
||||||
|
<Style Selector="^:disabled /template/ ContentPresenter#PART_IconPresenter">
|
||||||
|
<Setter Property="Foreground" Value="{DynamicResource AppBarButtonDisabledForeground}" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^:disabled /template/ TextBlock#PART_Label">
|
||||||
|
<Setter Property="Foreground" Value="{DynamicResource AppBarButtonDisabledForeground}" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<!-- IsCompact: hide label, use compact width -->
|
||||||
|
<Style Selector="^[IsCompact=True]">
|
||||||
|
<Setter Property="Width" Value="{DynamicResource AppBarButtonCompactWidth}" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^[IsCompact=True] /template/ TextBlock#PART_Label">
|
||||||
|
<Setter Property="IsVisible" Value="False" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<!-- LabelPosition=Collapsed: hide label, use compact width -->
|
||||||
|
<Style Selector="^[LabelPosition=Collapsed]">
|
||||||
|
<Setter Property="Width" Value="{DynamicResource AppBarButtonCompactWidth}" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^[LabelPosition=Collapsed] /template/ TextBlock#PART_Label">
|
||||||
|
<Setter Property="IsVisible" Value="False" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<!-- LabelPosition=Right: horizontal layout, auto-width -->
|
||||||
|
<Style Selector="^[LabelPosition=Right]">
|
||||||
|
<Setter Property="Width" Value="{x:Static x:Double.NaN}" />
|
||||||
|
<Setter Property="MinWidth" Value="{DynamicResource AppBarButtonCompactWidth}" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^[LabelPosition=Right] /template/ StackPanel#PART_LayoutRoot">
|
||||||
|
<Setter Property="Orientation" Value="Horizontal" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^[LabelPosition=Right] /template/ ContentPresenter#PART_IconPresenter">
|
||||||
|
<Setter Property="VerticalAlignment" Value="Center" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^[LabelPosition=Right] /template/ TextBlock#PART_Label">
|
||||||
|
<Setter Property="VerticalAlignment" Value="Center" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<!-- IsInOverflow: full-width horizontal layout -->
|
||||||
|
<Style Selector="^[IsInOverflow=True]">
|
||||||
|
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||||
|
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||||
|
<Setter Property="Width" Value="{x:Static x:Double.NaN}" />
|
||||||
|
<Setter Property="MinHeight" Value="{DynamicResource AppBarButtonOverflowMinHeight}" />
|
||||||
|
<Setter Property="Padding" Value="{DynamicResource AppBarButtonOverflowPadding}" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^[IsInOverflow=True] /template/ StackPanel#PART_LayoutRoot">
|
||||||
|
<Setter Property="Orientation" Value="Horizontal" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^[IsInOverflow=True] /template/ ContentPresenter#PART_IconPresenter">
|
||||||
|
<Setter Property="VerticalAlignment" Value="Center" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^[IsInOverflow=True] /template/ TextBlock#PART_Label">
|
||||||
|
<Setter Property="VerticalAlignment" Value="Center" />
|
||||||
|
</Style>
|
||||||
|
</ControlTheme>
|
||||||
|
|
||||||
|
<!-- AppBarSeparator -->
|
||||||
|
<ControlTheme x:Key="{x:Type AppBarSeparator}" TargetType="AppBarSeparator">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource AppBarSeparatorBackground}" />
|
||||||
|
<Setter Property="Width" Value="{DynamicResource AppBarSeparatorWidth}" />
|
||||||
|
<Setter Property="MinHeight" Value="{DynamicResource AppBarSeparatorMinHeight}" />
|
||||||
|
<Setter Property="Margin" Value="{DynamicResource AppBarSeparatorMargin}" />
|
||||||
|
<Setter Property="Template">
|
||||||
|
<ControlTemplate TargetType="AppBarSeparator">
|
||||||
|
<Border
|
||||||
|
Background="{TemplateBinding Background}"
|
||||||
|
Width="{TemplateBinding Width}"
|
||||||
|
MinHeight="{TemplateBinding MinHeight}" />
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter>
|
||||||
|
|
||||||
|
<!-- IsInOverflow: horizontal line separator -->
|
||||||
|
<Style Selector="^[IsInOverflow=True]">
|
||||||
|
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||||
|
<Setter Property="Width" Value="{x:Static x:Double.NaN}" />
|
||||||
|
<Setter Property="Height" Value="{DynamicResource AppBarSeparatorOverflowHeight}" />
|
||||||
|
<Setter Property="MinHeight" Value="0" />
|
||||||
|
<Setter Property="Margin" Value="{DynamicResource AppBarSeparatorOverflowMargin}" />
|
||||||
|
</Style>
|
||||||
|
</ControlTheme>
|
||||||
|
|
||||||
|
<!-- CommandBar -->
|
||||||
|
<ControlTheme x:Key="{x:Type CommandBar}" TargetType="CommandBar">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource CommandBarBackground}" />
|
||||||
|
<Setter Property="Foreground" Value="{DynamicResource CommandBarForeground}" />
|
||||||
|
<Setter Property="BorderBrush" Value="{DynamicResource CommandBarBorderBrush}" />
|
||||||
|
<Setter Property="BorderThickness" Value="{DynamicResource CommandBarBorderThickness}" />
|
||||||
|
<Setter Property="CornerRadius" Value="{DynamicResource CommandBarCornerRadius}" />
|
||||||
|
<Setter Property="MinHeight" Value="{DynamicResource CommandBarMinHeight}" />
|
||||||
|
<Setter Property="Padding" Value="{DynamicResource CommandBarPadding}" />
|
||||||
|
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||||
|
<Setter Property="Template">
|
||||||
|
<ControlTemplate TargetType="CommandBar">
|
||||||
|
<Border
|
||||||
|
Background="{TemplateBinding Background}"
|
||||||
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||||||
|
BorderThickness="{TemplateBinding BorderThickness}"
|
||||||
|
CornerRadius="{TemplateBinding CornerRadius}"
|
||||||
|
MinHeight="{TemplateBinding MinHeight}"
|
||||||
|
Padding="{TemplateBinding Padding}">
|
||||||
|
<Panel>
|
||||||
|
<DockPanel>
|
||||||
|
<!-- Overflow button (docked right) -->
|
||||||
|
<Button
|
||||||
|
Name="PART_OverflowButton"
|
||||||
|
DockPanel.Dock="Right"
|
||||||
|
Theme="{DynamicResource AppBarOverflowButton}"
|
||||||
|
IsVisible="{TemplateBinding IsOverflowButtonVisible}"
|
||||||
|
VerticalAlignment="Stretch">
|
||||||
|
<PathIcon
|
||||||
|
Width="{DynamicResource AppBarButtonIconSize}"
|
||||||
|
Height="{DynamicResource AppBarButtonIconSize}"
|
||||||
|
Foreground="{TemplateBinding Foreground}"
|
||||||
|
Data="{DynamicResource CommandBarOverflowButtonGlyph}" />
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<!-- Custom content (docked left) -->
|
||||||
|
<ContentPresenter
|
||||||
|
Name="PART_ContentPresenter"
|
||||||
|
DockPanel.Dock="Left"
|
||||||
|
Content="{TemplateBinding Content}"
|
||||||
|
VerticalAlignment="Center" />
|
||||||
|
|
||||||
|
<!-- Primary commands (fills remaining space, right-aligned) -->
|
||||||
|
<ItemsControl
|
||||||
|
Name="PART_PrimaryCommands"
|
||||||
|
ItemsSource="{Binding VisiblePrimaryCommands, RelativeSource={RelativeSource TemplatedParent}}"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
VerticalAlignment="Stretch"
|
||||||
|
ClipToBounds="True">
|
||||||
|
<ItemsControl.ItemsPanel>
|
||||||
|
<ItemsPanelTemplate>
|
||||||
|
<StackPanel Orientation="Horizontal" Spacing="2" />
|
||||||
|
</ItemsPanelTemplate>
|
||||||
|
</ItemsControl.ItemsPanel>
|
||||||
|
</ItemsControl>
|
||||||
|
</DockPanel>
|
||||||
|
|
||||||
|
<!-- Overflow popup -->
|
||||||
|
<Popup
|
||||||
|
Name="PART_OverflowPopup"
|
||||||
|
IsOpen="{TemplateBinding IsOpen, Mode=TwoWay}"
|
||||||
|
PlacementTarget="{Binding #PART_OverflowButton}"
|
||||||
|
Placement="Bottom"
|
||||||
|
IsLightDismissEnabled="True"
|
||||||
|
WindowManagerAddShadowHint="False">
|
||||||
|
<Border
|
||||||
|
Background="{DynamicResource CommandBarOverflowBackground}"
|
||||||
|
BorderBrush="{DynamicResource CommandBarOverflowBorderBrush}"
|
||||||
|
BorderThickness="{DynamicResource CommandBarBorderThickness}"
|
||||||
|
BoxShadow="{DynamicResource CommandBarOverflowBoxShadow}"
|
||||||
|
CornerRadius="{DynamicResource CommandBarOverflowCornerRadius}"
|
||||||
|
Padding="{DynamicResource CommandBarOverflowPadding}"
|
||||||
|
MinWidth="{DynamicResource CommandBarOverflowMinWidth}">
|
||||||
|
<ItemsControl
|
||||||
|
ItemsSource="{Binding OverflowItems, RelativeSource={RelativeSource TemplatedParent}}">
|
||||||
|
<ItemsControl.ItemsPanel>
|
||||||
|
<ItemsPanelTemplate>
|
||||||
|
<StackPanel Spacing="2" />
|
||||||
|
</ItemsPanelTemplate>
|
||||||
|
</ItemsControl.ItemsPanel>
|
||||||
|
</ItemsControl>
|
||||||
|
</Border>
|
||||||
|
</Popup>
|
||||||
|
</Panel>
|
||||||
|
</Border>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter>
|
||||||
|
</ControlTheme>
|
||||||
|
|
||||||
|
<!-- Overflow button inner theme (borderless, transparent) -->
|
||||||
|
<ControlTheme x:Key="AppBarOverflowButton" TargetType="Button"
|
||||||
|
BasedOn="{StaticResource {x:Type Button}}">
|
||||||
|
<Setter Property="Background" Value="Transparent" />
|
||||||
|
<Setter Property="BorderBrush" Value="Transparent" />
|
||||||
|
<Setter Property="BorderThickness" Value="0" />
|
||||||
|
<Setter Property="Padding" Value="{DynamicResource AppBarButtonPadding}" />
|
||||||
|
<Setter Property="MinWidth" Value="{DynamicResource AppBarButtonCompactWidth}" />
|
||||||
|
<Setter Property="CornerRadius" Value="{DynamicResource AppBarButtonCornerRadius}" />
|
||||||
|
</ControlTheme>
|
||||||
|
|
||||||
|
</ResourceDictionary>
|
||||||
@@ -4,54 +4,87 @@
|
|||||||
xmlns:semi="https://irihi.tech/semi"
|
xmlns:semi="https://irihi.tech/semi"
|
||||||
xmlns:converters="using:Avalonia.Controls.Converters">
|
xmlns:converters="using:Avalonia.Controls.Converters">
|
||||||
<Design.PreviewWith>
|
<Design.PreviewWith>
|
||||||
<StackPanel Width="400" Margin="20">
|
<StackPanel Margin="20" Spacing="20">
|
||||||
<ProgressBar />
|
<ProgressBar
|
||||||
<ProgressBar Value="20" />
|
Width="200"
|
||||||
<ProgressBar Value="50" Classes="Success" />
|
Maximum="100"
|
||||||
<ProgressBar Value="80" Classes="Warning" />
|
Minimum="0"
|
||||||
<ProgressBar Value="100" Classes="Error" />
|
ShowProgressText="True"
|
||||||
<ProgressBar ShowProgressText="True" />
|
Value="20" />
|
||||||
<ProgressBar Value="20" ShowProgressText="True" />
|
<ProgressBar
|
||||||
<ProgressBar Value="50" Classes="Success" ShowProgressText="True" />
|
Width="200"
|
||||||
<ProgressBar Value="80" Classes="Warning" ShowProgressText="True" />
|
IsIndeterminate="True"
|
||||||
<ProgressBar Value="100" Classes="Error" ShowProgressText="True" />
|
Maximum="100"
|
||||||
<ProgressBar Classes="Left" ShowProgressText="True" />
|
Minimum="0"
|
||||||
<ProgressBar Value="20" Classes="Left" ShowProgressText="True" />
|
ShowProgressText="True"
|
||||||
<ProgressBar Value="50" Classes="Left Success" ShowProgressText="True" />
|
Value="20" />
|
||||||
<ProgressBar Value="80" Classes="Left Warning" ShowProgressText="True" />
|
<ProgressBar
|
||||||
<ProgressBar Value="100" Classes="Left Error" ShowProgressText="True" />
|
Width="200"
|
||||||
<ProgressBar Classes="Right" ShowProgressText="True" />
|
Classes="Left"
|
||||||
<ProgressBar Value="20" Classes="Right" ShowProgressText="True" />
|
IsIndeterminate="True"
|
||||||
<ProgressBar Value="50" Classes="Right Success" ShowProgressText="True" />
|
Maximum="100"
|
||||||
<ProgressBar Value="80" Classes="Right Warning" ShowProgressText="True" />
|
Minimum="0"
|
||||||
<ProgressBar Value="100" Classes="Right Error" ShowProgressText="True" />
|
ShowProgressText="True"
|
||||||
|
Value="20" />
|
||||||
<StackPanel Orientation="Horizontal">
|
<ProgressBar
|
||||||
<StackPanel.Styles>
|
Width="200"
|
||||||
<Style Selector="ProgressBar">
|
Classes="Left"
|
||||||
<Setter Property="Orientation" Value="Vertical" />
|
Maximum="100"
|
||||||
</Style>
|
Minimum="0"
|
||||||
</StackPanel.Styles>
|
ShowProgressText="True"
|
||||||
<ProgressBar />
|
Value="20" />
|
||||||
<ProgressBar Value="20" />
|
<ProgressBar
|
||||||
<ProgressBar Value="50" Classes="Success" />
|
Width="200"
|
||||||
<ProgressBar Value="80" Classes="Warning" />
|
Classes="Right"
|
||||||
<ProgressBar Value="100" Classes="Error" />
|
Maximum="100"
|
||||||
<ProgressBar ShowProgressText="True" />
|
Minimum="0"
|
||||||
<ProgressBar Value="20" ShowProgressText="True" />
|
ShowProgressText="True"
|
||||||
<ProgressBar Value="50" Classes="Success" ShowProgressText="True" />
|
Value="20" />
|
||||||
<ProgressBar Value="80" Classes="Warning" ShowProgressText="True" />
|
<StackPanel
|
||||||
<ProgressBar Value="100" Classes="Error" ShowProgressText="True" />
|
HorizontalAlignment="Left"
|
||||||
<ProgressBar Classes="Top" ShowProgressText="True" />
|
Orientation="Horizontal"
|
||||||
<ProgressBar Value="20" Classes="Top" ShowProgressText="True" />
|
Spacing="20">
|
||||||
<ProgressBar Value="50" Classes="Top Success" ShowProgressText="True" />
|
<ProgressBar
|
||||||
<ProgressBar Value="80" Classes="Top Warning" ShowProgressText="True" />
|
Classes="Left"
|
||||||
<ProgressBar Value="100" Classes="Top Error" ShowProgressText="True" />
|
Maximum="100"
|
||||||
<ProgressBar Classes="Bottom" ShowProgressText="True" />
|
Minimum="0"
|
||||||
<ProgressBar Value="20" Classes="Bottom" ShowProgressText="True" />
|
Orientation="Vertical"
|
||||||
<ProgressBar Value="50" Classes="Bottom Success" ShowProgressText="True" />
|
ShowProgressText="True"
|
||||||
<ProgressBar Value="80" Classes="Bottom Warning" ShowProgressText="True" />
|
Value="20" />
|
||||||
<ProgressBar Value="100" Classes="Bottom Error" ShowProgressText="True" />
|
<ProgressBar
|
||||||
|
Classes="Right"
|
||||||
|
Maximum="100"
|
||||||
|
Minimum="0"
|
||||||
|
Orientation="Vertical"
|
||||||
|
ShowProgressText="True"
|
||||||
|
Value="20" />
|
||||||
|
<ProgressBar
|
||||||
|
Maximum="100"
|
||||||
|
Minimum="0"
|
||||||
|
Orientation="Vertical"
|
||||||
|
ShowProgressText="True"
|
||||||
|
Value="20" />
|
||||||
|
<ProgressBar
|
||||||
|
Classes="Left"
|
||||||
|
Maximum="100"
|
||||||
|
Minimum="0"
|
||||||
|
Orientation="Vertical"
|
||||||
|
ShowProgressText="False"
|
||||||
|
Value="20" />
|
||||||
|
<ProgressBar
|
||||||
|
IsIndeterminate="True"
|
||||||
|
Maximum="100"
|
||||||
|
Minimum="0"
|
||||||
|
Orientation="Vertical"
|
||||||
|
ShowProgressText="True"
|
||||||
|
Value="20" />
|
||||||
|
<ProgressBar
|
||||||
|
IsIndeterminate="True"
|
||||||
|
Maximum="100"
|
||||||
|
Minimum="0"
|
||||||
|
Orientation="Vertical"
|
||||||
|
ShowProgressText="False"
|
||||||
|
Value="20" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Design.PreviewWith>
|
</Design.PreviewWith>
|
||||||
@@ -82,7 +115,7 @@
|
|||||||
<Panel Name="DeterminateRoot" Opacity="1">
|
<Panel Name="DeterminateRoot" Opacity="1">
|
||||||
<Panel.Transitions>
|
<Panel.Transitions>
|
||||||
<Transitions>
|
<Transitions>
|
||||||
<DoubleTransition Property="Opacity" Duration="0:0:0.2" />
|
<DoubleTransition Property="Opacity" Duration="0:0:0.197" />
|
||||||
</Transitions>
|
</Transitions>
|
||||||
</Panel.Transitions>
|
</Panel.Transitions>
|
||||||
<Border
|
<Border
|
||||||
@@ -94,7 +127,7 @@
|
|||||||
<Panel Name="IndeterminateRoot" Opacity="0">
|
<Panel Name="IndeterminateRoot" Opacity="0">
|
||||||
<Panel.Transitions>
|
<Panel.Transitions>
|
||||||
<Transitions>
|
<Transitions>
|
||||||
<DoubleTransition Property="Opacity" Duration="0:0:0.2" />
|
<DoubleTransition Property="Opacity" Duration="0:0:0.197" />
|
||||||
</Transitions>
|
</Transitions>
|
||||||
</Panel.Transitions>
|
</Panel.Transitions>
|
||||||
<Border
|
<Border
|
||||||
@@ -125,7 +158,7 @@
|
|||||||
<TextBlock.Text>
|
<TextBlock.Text>
|
||||||
<MultiBinding Converter="{StaticResource StringFormatConverter}">
|
<MultiBinding Converter="{StaticResource StringFormatConverter}">
|
||||||
<TemplateBinding Property="ProgressTextFormat" />
|
<TemplateBinding Property="ProgressTextFormat" />
|
||||||
<TemplateBinding Property="Value" />
|
<Binding Path="Value" RelativeSource="{RelativeSource TemplatedParent}" />
|
||||||
<TemplateBinding Property="Percentage" />
|
<TemplateBinding Property="Percentage" />
|
||||||
<TemplateBinding Property="Minimum" />
|
<TemplateBinding Property="Minimum" />
|
||||||
<TemplateBinding Property="Maximum" />
|
<TemplateBinding Property="Maximum" />
|
||||||
@@ -158,155 +191,149 @@
|
|||||||
<Style Selector="^.Error">
|
<Style Selector="^.Error">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource ProgressBarErrorForeground}" />
|
<Setter Property="Foreground" Value="{DynamicResource ProgressBarErrorForeground}" />
|
||||||
</Style>
|
</Style>
|
||||||
|
<Style Selector="^:horizontal /template/ Border#PART_Indicator">
|
||||||
|
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||||
|
<Setter Property="VerticalAlignment" Value="Stretch" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^:vertical /template/ Border#PART_Indicator">
|
||||||
|
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||||
|
<Setter Property="VerticalAlignment" Value="Top" />
|
||||||
|
</Style>
|
||||||
<Style Selector="^:horizontal">
|
<Style Selector="^:horizontal">
|
||||||
<Setter Property="MinWidth" Value="200" />
|
<Setter Property="MinWidth" Value="200" />
|
||||||
<Setter Property="MinHeight" Value="4" />
|
<Setter Property="MinHeight" Value="4" />
|
||||||
<Style Selector="^ /template/ Border#PART_Indicator">
|
|
||||||
<Setter Property="HorizontalAlignment" Value="Left" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^ /template/ Border#IndeterminateProgressBarIndicator">
|
|
||||||
<Setter Property="Width" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerWidth}" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^ /template/ Border#IndeterminateProgressBarIndicator2">
|
|
||||||
<Setter Property="Width" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2Width}" />
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
<Style Selector="^.Left,^.Top">
|
|
||||||
<Style Selector="^ /template/ LayoutTransformControl#PART_LayoutTransformControl">
|
|
||||||
<Setter Property="Grid.Column" Value="0" />
|
|
||||||
<Setter Property="Grid.Row" Value="1" />
|
|
||||||
<Setter Property="Margin" Value="0 0 16 0" />
|
|
||||||
<Setter Property="MinWidth" Value="45" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^ /template/ Border#ProgressBarRoot">
|
|
||||||
<Setter Property="MinHeight" Value="4" />
|
|
||||||
<Setter Property="VerticalAlignment" Value="Center" />
|
|
||||||
</Style>
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^.Right,^.Bottom">
|
|
||||||
<Style Selector="^ /template/ LayoutTransformControl#PART_LayoutTransformControl">
|
|
||||||
<Setter Property="Grid.Column" Value="2" />
|
|
||||||
<Setter Property="Grid.Row" Value="1" />
|
|
||||||
<Setter Property="Margin" Value="16 0 0 0" />
|
|
||||||
<Setter Property="MinWidth" Value="45" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^ /template/ Border#ProgressBarRoot">
|
|
||||||
<Setter Property="MinHeight" Value="4" />
|
|
||||||
<Setter Property="VerticalAlignment" Value="Center" />
|
|
||||||
</Style>
|
|
||||||
</Style>
|
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style Selector="^:vertical">
|
<Style Selector="^:vertical">
|
||||||
<Style Selector="^ /template/ LayoutTransformControl#PART_LayoutTransformControl">
|
|
||||||
<Setter Property="LayoutTransform">
|
|
||||||
<RotateTransform Angle="90" />
|
|
||||||
</Setter>
|
|
||||||
</Style>
|
|
||||||
<Setter Property="MinWidth" Value="4" />
|
<Setter Property="MinWidth" Value="4" />
|
||||||
<Setter Property="MinHeight" Value="200" />
|
<Setter Property="MinHeight" Value="200" />
|
||||||
<Style Selector="^ /template/ Border#PART_Indicator">
|
</Style>
|
||||||
<Setter Property="VerticalAlignment" Value="Top" />
|
<Style Selector="^:vertical /template/ LayoutTransformControl#PART_LayoutTransformControl">
|
||||||
|
<Setter Property="LayoutTransform">
|
||||||
|
<RotateTransform Angle="90" />
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^:indeterminate /template/ Panel#DeterminateRoot">
|
||||||
|
<Setter Property="Opacity" Value="0" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^:indeterminate /template/ Panel#IndeterminateRoot">
|
||||||
|
<Setter Property="Opacity" Value="1" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^:horizontal:indeterminate /template/ Border#IndeterminateProgressBarIndicator">
|
||||||
|
<Style.Animations>
|
||||||
|
<Animation IterationCount="Infinite" Duration="0:0:2">
|
||||||
|
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:0">
|
||||||
|
<Setter Property="TranslateTransform.X" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerAnimationStartPosition}" />
|
||||||
|
</KeyFrame>
|
||||||
|
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:1.5">
|
||||||
|
<Setter Property="TranslateTransform.X" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerAnimationEndPosition}" />
|
||||||
|
</KeyFrame>
|
||||||
|
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:2">
|
||||||
|
<Setter Property="TranslateTransform.X" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerAnimationEndPosition}" />
|
||||||
|
</KeyFrame>
|
||||||
|
</Animation>
|
||||||
|
</Style.Animations>
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^:horizontal:indeterminate /template/ Border#IndeterminateProgressBarIndicator2">
|
||||||
|
<Style.Animations>
|
||||||
|
<Animation IterationCount="Infinite" Duration="0:0:2">
|
||||||
|
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:0">
|
||||||
|
<Setter Property="TranslateTransform.X" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2AnimationStartPosition}" />
|
||||||
|
</KeyFrame>
|
||||||
|
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:0.75">
|
||||||
|
<Setter Property="TranslateTransform.X" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2AnimationStartPosition}" />
|
||||||
|
</KeyFrame>
|
||||||
|
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:2">
|
||||||
|
<Setter Property="TranslateTransform.X" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2AnimationEndPosition}" />
|
||||||
|
</KeyFrame>
|
||||||
|
</Animation>
|
||||||
|
</Style.Animations>
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^:vertical:indeterminate /template/ Border#IndeterminateProgressBarIndicator">
|
||||||
|
<Style.Animations>
|
||||||
|
<Animation IterationCount="Infinite" Duration="0:0:2">
|
||||||
|
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:0">
|
||||||
|
<Setter Property="TranslateTransform.Y" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerAnimationStartPosition}" />
|
||||||
|
</KeyFrame>
|
||||||
|
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:1.5">
|
||||||
|
<Setter Property="TranslateTransform.Y" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerAnimationEndPosition}" />
|
||||||
|
</KeyFrame>
|
||||||
|
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:2">
|
||||||
|
<Setter Property="TranslateTransform.Y" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerAnimationEndPosition}" />
|
||||||
|
</KeyFrame>
|
||||||
|
</Animation>
|
||||||
|
</Style.Animations>
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^:vertical:indeterminate /template/ Border#IndeterminateProgressBarIndicator2">
|
||||||
|
<Style.Animations>
|
||||||
|
<Animation IterationCount="Infinite" Duration="0:0:2">
|
||||||
|
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:0">
|
||||||
|
<Setter Property="TranslateTransform.Y" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2AnimationStartPosition}" />
|
||||||
|
</KeyFrame>
|
||||||
|
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:0.75">
|
||||||
|
<Setter Property="TranslateTransform.Y" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2AnimationStartPosition}" />
|
||||||
|
</KeyFrame>
|
||||||
|
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:2">
|
||||||
|
<Setter Property="TranslateTransform.Y" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2AnimationEndPosition}" />
|
||||||
|
</KeyFrame>
|
||||||
|
</Animation>
|
||||||
|
</Style.Animations>
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^:horizontal /template/ Border#IndeterminateProgressBarIndicator">
|
||||||
|
<Setter Property="Width" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerWidth}" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^:horizontal /template/ Border#IndeterminateProgressBarIndicator2">
|
||||||
|
<Setter Property="Width" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2Width}" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^:vertical /template/ Border#IndeterminateProgressBarIndicator">
|
||||||
|
<Setter Property="Height" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerWidth}" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^:vertical /template/ Border#IndeterminateProgressBarIndicator2">
|
||||||
|
<Setter Property="Height" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2Width}" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^.Left">
|
||||||
|
<Style Selector="^:horizontal /template/ LayoutTransformControl#PART_LayoutTransformControl">
|
||||||
|
<Setter Property="Grid.Column" Value="0" />
|
||||||
|
<Setter Property="Grid.Row" Value="1" />
|
||||||
|
<Setter Property="Margin" Value="4 0" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^ /template/ Border#IndeterminateProgressBarIndicator">
|
<Style Selector="^:vertical /template/ LayoutTransformControl#PART_LayoutTransformControl">
|
||||||
<Setter Property="Height" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerWidth}" />
|
<Setter Property="Grid.Column" Value="1" />
|
||||||
|
<Setter Property="Grid.Row" Value="0" />
|
||||||
|
<Setter Property="Margin" Value="0 4" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^ /template/ Border#IndeterminateProgressBarIndicator2">
|
<Style Selector="^:horizontal /template/ Border#ProgressBarRoot">
|
||||||
<Setter Property="Height" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2Width}" />
|
<Setter Property="MinHeight" Value="4" />
|
||||||
|
<Setter Property="VerticalAlignment" Value="Center" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^.Left,^.Top">
|
<Style Selector="^:vertical /template/ Border#ProgressBarRoot">
|
||||||
<Style Selector="^ /template/ LayoutTransformControl#PART_LayoutTransformControl">
|
<Setter Property="MinWidth" Value="4" />
|
||||||
<Setter Property="Grid.Column" Value="1" />
|
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||||
<Setter Property="Grid.Row" Value="0" />
|
|
||||||
<Setter Property="Margin" Value="0 0 0 16" />
|
|
||||||
<Setter Property="MinHeight" Value="45" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^ /template/ Border#ProgressBarRoot">
|
|
||||||
<Setter Property="MinWidth" Value="4" />
|
|
||||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
|
||||||
</Style>
|
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^.Right,^.Bottom">
|
<Style Selector="^ /template/ TextBlock#PART_ProgressText">
|
||||||
<Style Selector="^ /template/ LayoutTransformControl#PART_LayoutTransformControl">
|
<Setter Property="Foreground" Value="{DynamicResource ProgressBarOuterTextForeground}" />
|
||||||
<Setter Property="Grid.Column" Value="1" />
|
|
||||||
<Setter Property="Grid.Row" Value="2" />
|
|
||||||
<Setter Property="Margin" Value="0 16 0 0" />
|
|
||||||
<Setter Property="MinHeight" Value="45" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^ /template/ Border#ProgressBarRoot">
|
|
||||||
<Setter Property="MinWidth" Value="4" />
|
|
||||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
|
||||||
</Style>
|
|
||||||
</Style>
|
</Style>
|
||||||
</Style>
|
</Style>
|
||||||
|
<Style Selector="^.Right">
|
||||||
<Style Selector="^:indeterminate">
|
<Style Selector="^:horizontal /template/ LayoutTransformControl#PART_LayoutTransformControl">
|
||||||
<Style Selector="^ /template/ Panel#DeterminateRoot">
|
<Setter Property="Grid.Column" Value="2" />
|
||||||
<Setter Property="Opacity" Value="0" />
|
<Setter Property="Grid.Row" Value="1" />
|
||||||
|
<Setter Property="Margin" Value="4 0" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^ /template/ Panel#IndeterminateRoot">
|
<Style Selector="^:vertical /template/ LayoutTransformControl#PART_LayoutTransformControl">
|
||||||
<Setter Property="Opacity" Value="1" />
|
<Setter Property="Grid.Column" Value="1" />
|
||||||
|
<Setter Property="Grid.Row" Value="2" />
|
||||||
|
<Setter Property="Margin" Value="0 4" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^:horizontal /template/ Border#IndeterminateProgressBarIndicator">
|
<Style Selector="^:horizontal /template/ Border#ProgressBarRoot">
|
||||||
<Style.Animations>
|
<Setter Property="MinHeight" Value="4" />
|
||||||
<Animation IterationCount="Infinite" Duration="0:0:2">
|
<Setter Property="VerticalAlignment" Value="Center" />
|
||||||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:0">
|
|
||||||
<Setter Property="TranslateTransform.X" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerAnimationStartPosition}" />
|
|
||||||
</KeyFrame>
|
|
||||||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:1.5">
|
|
||||||
<Setter Property="TranslateTransform.X" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerAnimationEndPosition}" />
|
|
||||||
</KeyFrame>
|
|
||||||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:2">
|
|
||||||
<Setter Property="TranslateTransform.X" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerAnimationEndPosition}" />
|
|
||||||
</KeyFrame>
|
|
||||||
</Animation>
|
|
||||||
</Style.Animations>
|
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^:horizontal /template/ Border#IndeterminateProgressBarIndicator2">
|
<Style Selector="^:vertical /template/ Border#ProgressBarRoot">
|
||||||
<Style.Animations>
|
<Setter Property="MinWidth" Value="4" />
|
||||||
<Animation IterationCount="Infinite" Duration="0:0:2">
|
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:0">
|
|
||||||
<Setter Property="TranslateTransform.X" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2AnimationStartPosition}" />
|
|
||||||
</KeyFrame>
|
|
||||||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:0.75">
|
|
||||||
<Setter Property="TranslateTransform.X" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2AnimationStartPosition}" />
|
|
||||||
</KeyFrame>
|
|
||||||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:2">
|
|
||||||
<Setter Property="TranslateTransform.X" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2AnimationEndPosition}" />
|
|
||||||
</KeyFrame>
|
|
||||||
</Animation>
|
|
||||||
</Style.Animations>
|
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^:vertical /template/ Border#IndeterminateProgressBarIndicator">
|
<Style Selector="^ /template/ TextBlock#PART_ProgressText">
|
||||||
<Style.Animations>
|
<Setter Property="Foreground" Value="{DynamicResource ProgressBarOuterTextForeground}" />
|
||||||
<Animation IterationCount="Infinite" Duration="0:0:2">
|
|
||||||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:0">
|
|
||||||
<Setter Property="TranslateTransform.Y" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerAnimationStartPosition}" />
|
|
||||||
</KeyFrame>
|
|
||||||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:1.5">
|
|
||||||
<Setter Property="TranslateTransform.Y" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerAnimationEndPosition}" />
|
|
||||||
</KeyFrame>
|
|
||||||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:2">
|
|
||||||
<Setter Property="TranslateTransform.Y" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerAnimationEndPosition}" />
|
|
||||||
</KeyFrame>
|
|
||||||
</Animation>
|
|
||||||
</Style.Animations>
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^:vertical /template/ Border#IndeterminateProgressBarIndicator2">
|
|
||||||
<Style.Animations>
|
|
||||||
<Animation IterationCount="Infinite" Duration="0:0:2">
|
|
||||||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:0">
|
|
||||||
<Setter Property="TranslateTransform.Y" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2AnimationStartPosition}" />
|
|
||||||
</KeyFrame>
|
|
||||||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:0.75">
|
|
||||||
<Setter Property="TranslateTransform.Y" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2AnimationStartPosition}" />
|
|
||||||
</KeyFrame>
|
|
||||||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:2">
|
|
||||||
<Setter Property="TranslateTransform.Y" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2AnimationEndPosition}" />
|
|
||||||
</KeyFrame>
|
|
||||||
</Animation>
|
|
||||||
</Style.Animations>
|
|
||||||
</Style>
|
</Style>
|
||||||
</Style>
|
</Style>
|
||||||
</ControlTheme>
|
</ControlTheme>
|
||||||
|
|||||||
@@ -1,53 +0,0 @@
|
|||||||
<ResourceDictionary
|
|
||||||
xmlns="https://github.com/avaloniaui"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
|
||||||
<ControlTheme x:Key="{x:Type TitleBar}" TargetType="TitleBar">
|
|
||||||
<Setter Property="VerticalAlignment" Value="Top" />
|
|
||||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
|
||||||
<Setter Property="Background" Value="Transparent" />
|
|
||||||
<Setter Property="Template">
|
|
||||||
<ControlTemplate>
|
|
||||||
<Panel HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="Stretch">
|
|
||||||
<Panel
|
|
||||||
Name="PART_MouseTracker"
|
|
||||||
Height="1"
|
|
||||||
VerticalAlignment="Top" />
|
|
||||||
<Panel Name="PART_Container">
|
|
||||||
<Border
|
|
||||||
Name="PART_Background"
|
|
||||||
Background="{TemplateBinding Background}"
|
|
||||||
IsHitTestVisible="False"
|
|
||||||
Win32Properties.NonClientHitTestResult="Caption" />
|
|
||||||
<CaptionButtons
|
|
||||||
Name="PART_CaptionButtons"
|
|
||||||
HorizontalAlignment="Right"
|
|
||||||
VerticalAlignment="Top"
|
|
||||||
Foreground="{TemplateBinding Foreground}"
|
|
||||||
Win32Properties.NonClientHitTestResult="Client" />
|
|
||||||
</Panel>
|
|
||||||
</Panel>
|
|
||||||
</ControlTemplate>
|
|
||||||
</Setter>
|
|
||||||
|
|
||||||
<Style Selector="^:fullscreen /template/ Border#PART_Background">
|
|
||||||
<Setter Property="IsHitTestVisible" Value="True" />
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
<Style Selector="^:fullscreen /template/ Panel#PART_MouseTracker">
|
|
||||||
<Setter Property="Background" Value="Transparent" />
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
<Style Selector="^:fullscreen /template/ Panel#PART_Container">
|
|
||||||
<Setter Property="RenderTransform" Value="translateY(-50px)" />
|
|
||||||
<Setter Property="Transitions">
|
|
||||||
<Transitions>
|
|
||||||
<TransformOperationsTransition Property="RenderTransform" Duration="0:0:0.1" />
|
|
||||||
</Transitions>
|
|
||||||
</Setter>
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
<Style Selector="^:fullscreen:pointerover /template/ Panel#PART_Container">
|
|
||||||
<Setter Property="RenderTransform" Value="none" />
|
|
||||||
</Style>
|
|
||||||
</ControlTheme>
|
|
||||||
</ResourceDictionary>
|
|
||||||
@@ -15,9 +15,6 @@
|
|||||||
<Border Background="{TemplateBinding Background}" IsHitTestVisible="False" />
|
<Border Background="{TemplateBinding Background}" IsHitTestVisible="False" />
|
||||||
<Panel Margin="{TemplateBinding WindowDecorationMargin}" Background="Transparent" />
|
<Panel Margin="{TemplateBinding WindowDecorationMargin}" Background="Transparent" />
|
||||||
<VisualLayerManager>
|
<VisualLayerManager>
|
||||||
<VisualLayerManager.ChromeOverlayLayer>
|
|
||||||
<TitleBar />
|
|
||||||
</VisualLayerManager.ChromeOverlayLayer>
|
|
||||||
<ContentPresenter
|
<ContentPresenter
|
||||||
Name="PART_ContentPresenter"
|
Name="PART_ContentPresenter"
|
||||||
Margin="{TemplateBinding Padding}"
|
Margin="{TemplateBinding Padding}"
|
||||||
|
|||||||
206
src/Semi.Avalonia/Controls/WindowDrawnDecorations.axaml
Normal file
206
src/Semi.Avalonia/Controls/WindowDrawnDecorations.axaml
Normal file
@@ -0,0 +1,206 @@
|
|||||||
|
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
|
|
||||||
|
<ControlTheme x:Key="CaptionButton" TargetType="Button">
|
||||||
|
<Setter Property="Foreground" Value="{DynamicResource CaptionButtonForeground}" />
|
||||||
|
<Setter Property="Background" Value="Transparent" />
|
||||||
|
<Setter Property="CornerRadius" Value="{StaticResource CaptionButtonCornerRadius}" />
|
||||||
|
<Setter Property="Padding" Value="{StaticResource CaptionButtonPadding}" />
|
||||||
|
<Setter Property="Width" Value="{StaticResource CaptionButtonWidth}" />
|
||||||
|
<Setter Property="Height" Value="{StaticResource CaptionButtonHeight}" />
|
||||||
|
<Setter Property="Cursor" Value="Hand" />
|
||||||
|
<Setter Property="VerticalAlignment" Value="Stretch" />
|
||||||
|
<Setter Property="Template">
|
||||||
|
<ControlTemplate TargetType="Button">
|
||||||
|
<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}"
|
||||||
|
Foreground="{TemplateBinding Foreground}" />
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter>
|
||||||
|
|
||||||
|
<Style Selector="^:pointerover">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource CaptionButtonPointeroverBackground}" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style Selector="^:pressed">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource CaptionButtonPressedBackground}" />
|
||||||
|
</Style>
|
||||||
|
</ControlTheme>
|
||||||
|
|
||||||
|
<ControlTheme x:Key="{x:Type WindowDrawnDecorations}" TargetType="WindowDrawnDecorations">
|
||||||
|
<Setter Property="DefaultTitleBarHeight" Value="32" />
|
||||||
|
<Setter Property="DefaultFrameThickness" Value="1" />
|
||||||
|
<Setter Property="DefaultShadowThickness" Value="16" />
|
||||||
|
<Setter Property="Template">
|
||||||
|
<WindowDrawnDecorationsTemplate>
|
||||||
|
<WindowDrawnDecorationsContent>
|
||||||
|
<WindowDrawnDecorationsContent.Underlay>
|
||||||
|
<!-- Full-size: covers shadow area + frame + behind client area -->
|
||||||
|
<Panel>
|
||||||
|
<Border
|
||||||
|
x:Name="PART_WindowBorder"
|
||||||
|
Margin="{TemplateBinding ShadowThickness}"
|
||||||
|
Background="{DynamicResource WindowBackground}"
|
||||||
|
BorderBrush="{DynamicResource WindowBorderBrush}"
|
||||||
|
BorderThickness="1"
|
||||||
|
BoxShadow="0 8 32 0 #40000000" />
|
||||||
|
<!-- Titlebar: background, title text, and drag area live in underlay -->
|
||||||
|
<Panel x:Name="PART_TitleBar" VerticalAlignment="Top"
|
||||||
|
Height="{TemplateBinding TitleBarHeight}"
|
||||||
|
Background="{DynamicResource SystemControlBackgroundAltHighBrush}"
|
||||||
|
IsVisible="{TemplateBinding HasTitleBar}"
|
||||||
|
WindowDecorationProperties.ElementRole="TitleBar" />
|
||||||
|
</Panel>
|
||||||
|
</WindowDrawnDecorationsContent.Underlay>
|
||||||
|
|
||||||
|
<WindowDrawnDecorationsContent.Overlay>
|
||||||
|
<!-- Positioned over the titlebar area -->
|
||||||
|
<Panel x:Name="PART_OverlayWrapper">
|
||||||
|
<!-- Title text lives in overlay so it renders above client content -->
|
||||||
|
<Panel
|
||||||
|
x:Name="PART_TitleTextPanel"
|
||||||
|
Height="{TemplateBinding TitleBarHeight}"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
IsHitTestVisible="False"
|
||||||
|
IsVisible="{TemplateBinding HasTitleBar}">
|
||||||
|
<TextBlock
|
||||||
|
Margin="12,0,0,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
FontSize="12"
|
||||||
|
Text="{TemplateBinding Title}" />
|
||||||
|
</Panel>
|
||||||
|
<StackPanel
|
||||||
|
x:Name="PART_OverlayPanel"
|
||||||
|
Height="{TemplateBinding TitleBarHeight}"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
IsVisible="{TemplateBinding HasTitleBar}"
|
||||||
|
Orientation="Horizontal"
|
||||||
|
Spacing="2"
|
||||||
|
TextElement.FontSize="10">
|
||||||
|
<Button
|
||||||
|
Name="PART_FullScreenButton"
|
||||||
|
Theme="{StaticResource CaptionButton}"
|
||||||
|
WindowDecorationProperties.ElementRole="FullScreenButton">
|
||||||
|
<PathIcon
|
||||||
|
Name="PART_FullScreenButtonIcon"
|
||||||
|
Data="{StaticResource WindowExpandGlyph}"
|
||||||
|
Foreground="{Binding $parent[Button].Foreground}"
|
||||||
|
Theme="{StaticResource InnerPathIcon}" />
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
Name="PART_MinimizeButton"
|
||||||
|
AutomationProperties.Name="Minimize"
|
||||||
|
Theme="{StaticResource CaptionButton}"
|
||||||
|
WindowDecorationProperties.ElementRole="MinimizeButton">
|
||||||
|
<PathIcon
|
||||||
|
Name="PART_MinimizeButtonIcon"
|
||||||
|
Data="{StaticResource WindowMinimizeGlyph}"
|
||||||
|
Foreground="{Binding $parent[Button].Foreground}"
|
||||||
|
Theme="{StaticResource InnerPathIcon}" />
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
Name="PART_MaximizeButton"
|
||||||
|
AutomationProperties.Name="Maximize"
|
||||||
|
Theme="{StaticResource CaptionButton}"
|
||||||
|
WindowDecorationProperties.ElementRole="MaximizeButton">
|
||||||
|
<PathIcon
|
||||||
|
Name="PART_MaximizeButtonIcon"
|
||||||
|
Data="{StaticResource WindowMaximizeGlyph}"
|
||||||
|
Foreground="{Binding $parent[Button].Foreground}"
|
||||||
|
Theme="{StaticResource InnerPathIcon}" />
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
Name="PART_CloseButton"
|
||||||
|
AutomationProperties.Name="Close"
|
||||||
|
Theme="{StaticResource CaptionButton}"
|
||||||
|
WindowDecorationProperties.ElementRole="CloseButton">
|
||||||
|
<PathIcon
|
||||||
|
Name="PART_CloseButtonIcon"
|
||||||
|
Data="{StaticResource WindowCloseIconGlyph}"
|
||||||
|
Foreground="{Binding $parent[Button].Foreground}"
|
||||||
|
Theme="{StaticResource InnerPathIcon}" />
|
||||||
|
</Button>
|
||||||
|
</StackPanel>
|
||||||
|
</Panel>
|
||||||
|
</WindowDrawnDecorationsContent.Overlay>
|
||||||
|
|
||||||
|
<WindowDrawnDecorationsContent.FullscreenPopover>
|
||||||
|
<!-- Shown on hover at top edge in fullscreen -->
|
||||||
|
<DockPanel Height="{TemplateBinding TitleBarHeight}" Background="#E0000000">
|
||||||
|
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal">
|
||||||
|
<Button
|
||||||
|
x:Name="PART_PopoverFullScreenButton"
|
||||||
|
Theme="{StaticResource CaptionButton}"
|
||||||
|
WindowDecorationProperties.ElementRole="FullScreenButton">
|
||||||
|
<PathIcon
|
||||||
|
Data="{StaticResource WindowCollapseGlyph}"
|
||||||
|
Foreground="{Binding $parent[Button].Foreground}"
|
||||||
|
Theme="{StaticResource InnerPathIcon}" />
|
||||||
|
</Button>
|
||||||
|
</StackPanel>
|
||||||
|
<TextBlock
|
||||||
|
Margin="12,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Foreground="White"
|
||||||
|
Text="{TemplateBinding Title}" />
|
||||||
|
</DockPanel>
|
||||||
|
</WindowDrawnDecorationsContent.FullscreenPopover>
|
||||||
|
</WindowDrawnDecorationsContent>
|
||||||
|
</WindowDrawnDecorationsTemplate>
|
||||||
|
</Setter>
|
||||||
|
|
||||||
|
<Style Selector="^ /template/ Button#PART_CloseButton:pointerover">
|
||||||
|
<Setter Property="Foreground" Value="{DynamicResource CaptionButtonCloseForeground}" />
|
||||||
|
<Setter Property="Background" Value="{DynamicResource CaptionButtonClosePointeroverBackground}" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^ /template/ Button#PART_CloseButton:pressed">
|
||||||
|
<Setter Property="Foreground" Value="{DynamicResource CaptionButtonCloseForeground}" />
|
||||||
|
<Setter Property="Background" Value="{DynamicResource CaptionButtonClosePressedBackground}" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<!-- Shadow: inset border and add drop shadow -->
|
||||||
|
<Style Selector="^:has-shadow /template/ Panel#PART_UnderlayWrapper">
|
||||||
|
<Setter Property="Margin" Value="{TemplateBinding ShadowThickness}" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^:has-shadow /template/ Border#PART_WindowBorder">
|
||||||
|
<Setter Property="BoxShadow" Value="0 2 10 2 #80000000" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^:has-shadow /template/ Panel#PART_OverlayWrapper">
|
||||||
|
<Setter Property="Margin" Value="{TemplateBinding ShadowThickness}" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<!-- Maximized: restore button path changes -->
|
||||||
|
<Style Selector="^:maximized /template/ Path#PART_MaximizeButtonIcon">
|
||||||
|
<Setter Property="Data" Value="{StaticResource WindowRestoreGlyph}" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<!-- Border: inset titlebar and buttons inside frame -->
|
||||||
|
<Style Selector="^:has-border /template/ Panel#PART_TitleTextPanel">
|
||||||
|
<Setter Property="Margin" Value="1,1,1,0" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^:has-border /template/ Panel#PART_TitleBar">
|
||||||
|
<Setter Property="Margin" Value="1,1,1,0" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^:has-border /template/ StackPanel#PART_OverlayPanel">
|
||||||
|
<Setter Property="Margin" Value="0,1,1,0" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<!-- Fullscreen: hide overlay and titlebar (popover takes over) -->
|
||||||
|
<Style Selector="^:fullscreen /template/ Panel#PART_TitleTextPanel">
|
||||||
|
<Setter Property="IsVisible" Value="False" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^:fullscreen /template/ StackPanel#PART_OverlayPanel">
|
||||||
|
<Setter Property="IsVisible" Value="False" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^:fullscreen /template/ Panel#PART_TitleBar">
|
||||||
|
<Setter Property="IsVisible" Value="False" />
|
||||||
|
</Style>
|
||||||
|
</ControlTheme>
|
||||||
|
</ResourceDictionary>
|
||||||
@@ -9,10 +9,10 @@
|
|||||||
<ResourceInclude Source="ButtonSpinner.axaml" />
|
<ResourceInclude Source="ButtonSpinner.axaml" />
|
||||||
<ResourceInclude Source="Calendar.axaml" />
|
<ResourceInclude Source="Calendar.axaml" />
|
||||||
<ResourceInclude Source="CalendarDatePicker.axaml" />
|
<ResourceInclude Source="CalendarDatePicker.axaml" />
|
||||||
<ResourceInclude Source="CaptionButtons.axaml" />
|
|
||||||
<ResourceInclude Source="Carousel.axaml" />
|
<ResourceInclude Source="Carousel.axaml" />
|
||||||
<ResourceInclude Source="CheckBox.axaml" />
|
<ResourceInclude Source="CheckBox.axaml" />
|
||||||
<ResourceInclude Source="ComboBox.axaml" />
|
<ResourceInclude Source="ComboBox.axaml" />
|
||||||
|
<ResourceInclude Source="CommandBar.axaml" />
|
||||||
<ResourceInclude Source="ContextMenu.axaml" />
|
<ResourceInclude Source="ContextMenu.axaml" />
|
||||||
<ResourceInclude Source="DataValidationErrors.axaml" />
|
<ResourceInclude Source="DataValidationErrors.axaml" />
|
||||||
<ResourceInclude Source="DatePicker.axaml" />
|
<ResourceInclude Source="DatePicker.axaml" />
|
||||||
@@ -51,13 +51,13 @@
|
|||||||
<ResourceInclude Source="TextBox.axaml" />
|
<ResourceInclude Source="TextBox.axaml" />
|
||||||
<ResourceInclude Source="ThemeVariantScope.axaml" />
|
<ResourceInclude Source="ThemeVariantScope.axaml" />
|
||||||
<ResourceInclude Source="TimePicker.axaml" />
|
<ResourceInclude Source="TimePicker.axaml" />
|
||||||
<ResourceInclude Source="TitleBar.axaml" />
|
|
||||||
<ResourceInclude Source="ToggleButton.axaml" />
|
<ResourceInclude Source="ToggleButton.axaml" />
|
||||||
<ResourceInclude Source="ToggleSwitch.axaml" />
|
<ResourceInclude Source="ToggleSwitch.axaml" />
|
||||||
<ResourceInclude Source="Tooltip.axaml" />
|
<ResourceInclude Source="Tooltip.axaml" />
|
||||||
<ResourceInclude Source="TransitioningContentControl.axaml" />
|
<ResourceInclude Source="TransitioningContentControl.axaml" />
|
||||||
<ResourceInclude Source="TreeView.axaml" />
|
<ResourceInclude Source="TreeView.axaml" />
|
||||||
<ResourceInclude Source="Window.axaml" />
|
<ResourceInclude Source="Window.axaml" />
|
||||||
|
<ResourceInclude Source="WindowDrawnDecorations.axaml" />
|
||||||
<ResourceInclude Source="WindowNotificationManager.axaml" />
|
<ResourceInclude Source="WindowNotificationManager.axaml" />
|
||||||
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary.MergedDictionaries>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
22
src/Semi.Avalonia/Themes/Dark/CommandBar.axaml
Normal file
22
src/Semi.Avalonia/Themes/Dark/CommandBar.axaml
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
|
<!-- AppBarButton / AppBarToggleButton -->
|
||||||
|
<SolidColorBrush x:Key="AppBarButtonBackground" Color="Transparent" />
|
||||||
|
<StaticResource x:Key="AppBarButtonForeground" ResourceKey="SemiColorText0" />
|
||||||
|
<StaticResource x:Key="AppBarButtonPointeroverBackground" ResourceKey="SemiColorFill0" />
|
||||||
|
<StaticResource x:Key="AppBarButtonPressedBackground" ResourceKey="SemiColorFill1" />
|
||||||
|
<StaticResource x:Key="AppBarButtonDisabledForeground" ResourceKey="SemiColorDisabledText" />
|
||||||
|
<!-- AppBarToggleButton checked state -->
|
||||||
|
<StaticResource x:Key="AppBarToggleButtonCheckedForeground" ResourceKey="SemiColorPrimary" />
|
||||||
|
<StaticResource x:Key="AppBarToggleButtonCheckedBackground" ResourceKey="SemiColorPrimaryLight" />
|
||||||
|
<StaticResource x:Key="AppBarToggleButtonCheckedPointeroverBackground" ResourceKey="SemiColorPrimaryLightPointerover" />
|
||||||
|
<!-- AppBarSeparator -->
|
||||||
|
<StaticResource x:Key="AppBarSeparatorBackground" ResourceKey="SemiColorBorder" />
|
||||||
|
<!-- CommandBar -->
|
||||||
|
<StaticResource x:Key="CommandBarBackground" ResourceKey="SemiColorBackground1" />
|
||||||
|
<StaticResource x:Key="CommandBarForeground" ResourceKey="SemiColorText0" />
|
||||||
|
<StaticResource x:Key="CommandBarBorderBrush" ResourceKey="SemiColorBorder" />
|
||||||
|
<!-- CommandBar overflow popup -->
|
||||||
|
<StaticResource x:Key="CommandBarOverflowBackground" ResourceKey="SemiColorBackground3" />
|
||||||
|
<StaticResource x:Key="CommandBarOverflowBorderBrush" ResourceKey="SemiColorBorder" />
|
||||||
|
<StaticResource x:Key="CommandBarOverflowBoxShadow" ResourceKey="SemiShadowElevated" />
|
||||||
|
</ResourceDictionary>
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
<StaticResource x:Key="ProgressBarIndicatorBrush" ResourceKey="SemiColorPrimary" />
|
<StaticResource x:Key="ProgressBarIndicatorBrush" ResourceKey="SemiColorPrimary" />
|
||||||
<StaticResource x:Key="ProgressBarBackground" ResourceKey="SemiColorFill0" />
|
<StaticResource x:Key="ProgressBarBackground" ResourceKey="SemiColorFill0" />
|
||||||
<StaticResource x:Key="ProgressBarTextForeground" ResourceKey="SemiColorText0" />
|
<StaticResource x:Key="ProgressBarTextForeground" ResourceKey="SemiColorText0" />
|
||||||
|
<StaticResource x:Key="ProgressBarOuterTextForeground" ResourceKey="SemiColorText0" />
|
||||||
<SolidColorBrush x:Key="ProgressBarRootBorderBrush" Color="Transparent" />
|
<SolidColorBrush x:Key="ProgressBarRootBorderBrush" Color="Transparent" />
|
||||||
<StaticResource x:Key="ProgressBarPrimaryForeground" ResourceKey="SemiColorPrimary" />
|
<StaticResource x:Key="ProgressBarPrimaryForeground" ResourceKey="SemiColorPrimary" />
|
||||||
<StaticResource x:Key="ProgressBarSecondaryForeground" ResourceKey="SemiColorSecondary" />
|
<StaticResource x:Key="ProgressBarSecondaryForeground" ResourceKey="SemiColorSecondary" />
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
<ResourceInclude Source="Carousel.axaml" />
|
<ResourceInclude Source="Carousel.axaml" />
|
||||||
<ResourceInclude Source="CheckBox.axaml" />
|
<ResourceInclude Source="CheckBox.axaml" />
|
||||||
<ResourceInclude Source="ComboBox.axaml" />
|
<ResourceInclude Source="ComboBox.axaml" />
|
||||||
|
<ResourceInclude Source="CommandBar.axaml" />
|
||||||
<ResourceInclude Source="DataValidationErrors.axaml" />
|
<ResourceInclude Source="DataValidationErrors.axaml" />
|
||||||
<ResourceInclude Source="DatePicker.axaml" />
|
<ResourceInclude Source="DatePicker.axaml" />
|
||||||
<ResourceInclude Source="DateTimePickerShared.axaml" />
|
<ResourceInclude Source="DateTimePickerShared.axaml" />
|
||||||
|
|||||||
21
src/Semi.Avalonia/Themes/HighContrast/CommandBar.axaml
Normal file
21
src/Semi.Avalonia/Themes/HighContrast/CommandBar.axaml
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
|
<!-- AppBarButton / AppBarToggleButton -->
|
||||||
|
<SolidColorBrush x:Key="AppBarButtonBackground" Color="Transparent" />
|
||||||
|
<StaticResource x:Key="AppBarButtonForeground" ResourceKey="SemiColorWindowText" />
|
||||||
|
<StaticResource x:Key="AppBarButtonPointeroverBackground" ResourceKey="SemiColorHighlight" />
|
||||||
|
<StaticResource x:Key="AppBarButtonPressedBackground" ResourceKey="SemiColorHighlight" />
|
||||||
|
<StaticResource x:Key="AppBarButtonDisabledForeground" ResourceKey="SemiColorGrayText" />
|
||||||
|
<!-- AppBarToggleButton checked state -->
|
||||||
|
<StaticResource x:Key="AppBarToggleButtonCheckedForeground" ResourceKey="SemiColorHighlightText" />
|
||||||
|
<StaticResource x:Key="AppBarToggleButtonCheckedBackground" ResourceKey="SemiColorHighlight" />
|
||||||
|
<StaticResource x:Key="AppBarToggleButtonCheckedPointeroverBackground" ResourceKey="SemiColorButtonText" />
|
||||||
|
<!-- AppBarSeparator -->
|
||||||
|
<StaticResource x:Key="AppBarSeparatorBackground" ResourceKey="SemiColorWindowText" />
|
||||||
|
<!-- CommandBar -->
|
||||||
|
<StaticResource x:Key="CommandBarBackground" ResourceKey="SemiColorWindow" />
|
||||||
|
<StaticResource x:Key="CommandBarForeground" ResourceKey="SemiColorWindowText" />
|
||||||
|
<StaticResource x:Key="CommandBarBorderBrush" ResourceKey="SemiColorWindowText" />
|
||||||
|
<!-- CommandBar overflow popup -->
|
||||||
|
<StaticResource x:Key="CommandBarOverflowBackground" ResourceKey="SemiColorWindow" />
|
||||||
|
<StaticResource x:Key="CommandBarOverflowBorderBrush" ResourceKey="SemiColorWindowText" />
|
||||||
|
</ResourceDictionary>
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
<StaticResource x:Key="ProgressBarIndicatorBrush" ResourceKey="SemiColorHighlight" />
|
<StaticResource x:Key="ProgressBarIndicatorBrush" ResourceKey="SemiColorHighlight" />
|
||||||
<StaticResource x:Key="ProgressBarBackground" ResourceKey="SemiColorHighlightText" />
|
<StaticResource x:Key="ProgressBarBackground" ResourceKey="SemiColorHighlightText" />
|
||||||
<StaticResource x:Key="ProgressBarTextForeground" ResourceKey="SemiColorWindowText" />
|
<StaticResource x:Key="ProgressBarTextForeground" ResourceKey="SemiColorWindowText" />
|
||||||
|
<StaticResource x:Key="ProgressBarOuterTextForeground" ResourceKey="SemiColorWindowText" />
|
||||||
<StaticResource x:Key="ProgressBarRootBorderBrush" ResourceKey="SemiColorWindowText" />
|
<StaticResource x:Key="ProgressBarRootBorderBrush" ResourceKey="SemiColorWindowText" />
|
||||||
<StaticResource x:Key="ProgressBarPrimaryForeground" ResourceKey="SemiColorHighlight" />
|
<StaticResource x:Key="ProgressBarPrimaryForeground" ResourceKey="SemiColorHighlight" />
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
@@ -11,6 +11,7 @@
|
|||||||
<ResourceInclude Source="Carousel.axaml" />
|
<ResourceInclude Source="Carousel.axaml" />
|
||||||
<ResourceInclude Source="CheckBox.axaml" />
|
<ResourceInclude Source="CheckBox.axaml" />
|
||||||
<ResourceInclude Source="ComboBox.axaml" />
|
<ResourceInclude Source="ComboBox.axaml" />
|
||||||
|
<ResourceInclude Source="CommandBar.axaml" />
|
||||||
<ResourceInclude Source="DataValidationErrors.axaml" />
|
<ResourceInclude Source="DataValidationErrors.axaml" />
|
||||||
<ResourceInclude Source="DatePicker.axaml" />
|
<ResourceInclude Source="DatePicker.axaml" />
|
||||||
<ResourceInclude Source="DateTimePickerShared.axaml" />
|
<ResourceInclude Source="DateTimePickerShared.axaml" />
|
||||||
|
|||||||
22
src/Semi.Avalonia/Themes/Light/CommandBar.axaml
Normal file
22
src/Semi.Avalonia/Themes/Light/CommandBar.axaml
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
|
<!-- AppBarButton / AppBarToggleButton -->
|
||||||
|
<SolidColorBrush x:Key="AppBarButtonBackground" Color="Transparent" />
|
||||||
|
<StaticResource x:Key="AppBarButtonForeground" ResourceKey="SemiColorText0" />
|
||||||
|
<StaticResource x:Key="AppBarButtonPointeroverBackground" ResourceKey="SemiColorFill0" />
|
||||||
|
<StaticResource x:Key="AppBarButtonPressedBackground" ResourceKey="SemiColorFill1" />
|
||||||
|
<StaticResource x:Key="AppBarButtonDisabledForeground" ResourceKey="SemiColorDisabledText" />
|
||||||
|
<!-- AppBarToggleButton checked state -->
|
||||||
|
<StaticResource x:Key="AppBarToggleButtonCheckedForeground" ResourceKey="SemiColorPrimary" />
|
||||||
|
<StaticResource x:Key="AppBarToggleButtonCheckedBackground" ResourceKey="SemiColorPrimaryLight" />
|
||||||
|
<StaticResource x:Key="AppBarToggleButtonCheckedPointeroverBackground" ResourceKey="SemiColorPrimaryLightPointerover" />
|
||||||
|
<!-- AppBarSeparator -->
|
||||||
|
<StaticResource x:Key="AppBarSeparatorBackground" ResourceKey="SemiColorBorder" />
|
||||||
|
<!-- CommandBar -->
|
||||||
|
<StaticResource x:Key="CommandBarBackground" ResourceKey="SemiColorBackground1" />
|
||||||
|
<StaticResource x:Key="CommandBarForeground" ResourceKey="SemiColorText0" />
|
||||||
|
<StaticResource x:Key="CommandBarBorderBrush" ResourceKey="SemiColorBorder" />
|
||||||
|
<!-- CommandBar overflow popup -->
|
||||||
|
<StaticResource x:Key="CommandBarOverflowBackground" ResourceKey="SemiColorBackground3" />
|
||||||
|
<StaticResource x:Key="CommandBarOverflowBorderBrush" ResourceKey="SemiColorBorder" />
|
||||||
|
<StaticResource x:Key="CommandBarOverflowBoxShadow" ResourceKey="SemiShadowElevated" />
|
||||||
|
</ResourceDictionary>
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
<StaticResource x:Key="ProgressBarIndicatorBrush" ResourceKey="SemiColorPrimary" />
|
<StaticResource x:Key="ProgressBarIndicatorBrush" ResourceKey="SemiColorPrimary" />
|
||||||
<StaticResource x:Key="ProgressBarBackground" ResourceKey="SemiColorFill0" />
|
<StaticResource x:Key="ProgressBarBackground" ResourceKey="SemiColorFill0" />
|
||||||
<StaticResource x:Key="ProgressBarTextForeground" ResourceKey="SemiColorText0" />
|
<StaticResource x:Key="ProgressBarTextForeground" ResourceKey="SemiColorText0" />
|
||||||
|
<StaticResource x:Key="ProgressBarOuterTextForeground" ResourceKey="SemiColorText0" />
|
||||||
<SolidColorBrush x:Key="ProgressBarRootBorderBrush" Color="Transparent" />
|
<SolidColorBrush x:Key="ProgressBarRootBorderBrush" Color="Transparent" />
|
||||||
<StaticResource x:Key="ProgressBarPrimaryForeground" ResourceKey="SemiColorPrimary" />
|
<StaticResource x:Key="ProgressBarPrimaryForeground" ResourceKey="SemiColorPrimary" />
|
||||||
<StaticResource x:Key="ProgressBarSecondaryForeground" ResourceKey="SemiColorSecondary" />
|
<StaticResource x:Key="ProgressBarSecondaryForeground" ResourceKey="SemiColorSecondary" />
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
<ResourceInclude Source="Carousel.axaml" />
|
<ResourceInclude Source="Carousel.axaml" />
|
||||||
<ResourceInclude Source="CheckBox.axaml" />
|
<ResourceInclude Source="CheckBox.axaml" />
|
||||||
<ResourceInclude Source="ComboBox.axaml" />
|
<ResourceInclude Source="ComboBox.axaml" />
|
||||||
|
<ResourceInclude Source="CommandBar.axaml" />
|
||||||
<ResourceInclude Source="DataValidationErrors.axaml" />
|
<ResourceInclude Source="DataValidationErrors.axaml" />
|
||||||
<ResourceInclude Source="DatePicker.axaml" />
|
<ResourceInclude Source="DatePicker.axaml" />
|
||||||
<ResourceInclude Source="DateTimePickerShared.axaml" />
|
<ResourceInclude Source="DateTimePickerShared.axaml" />
|
||||||
|
|||||||
29
src/Semi.Avalonia/Themes/Shared/CommandBar.axaml
Normal file
29
src/Semi.Avalonia/Themes/Shared/CommandBar.axaml
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
|
<!-- AppBarButton / AppBarToggleButton -->
|
||||||
|
<x:Double x:Key="AppBarButtonWidth">68</x:Double>
|
||||||
|
<x:Double x:Key="AppBarButtonCompactWidth">40</x:Double>
|
||||||
|
<x:Double x:Key="AppBarButtonMinHeight">40</x:Double>
|
||||||
|
<x:Double x:Key="AppBarButtonIconSize">20</x:Double>
|
||||||
|
<Thickness x:Key="AppBarButtonPadding">8 4</Thickness>
|
||||||
|
<StaticResource x:Key="AppBarButtonCornerRadius" ResourceKey="SemiBorderRadiusSmall" />
|
||||||
|
<StaticResource x:Key="AppBarButtonLabelFontSize" ResourceKey="SemiFontSizeSmall" />
|
||||||
|
<x:Double x:Key="AppBarButtonOverflowMinHeight">36</x:Double>
|
||||||
|
<Thickness x:Key="AppBarButtonOverflowPadding">12 6</Thickness>
|
||||||
|
<!-- AppBarSeparator -->
|
||||||
|
<x:Double x:Key="AppBarSeparatorWidth">1</x:Double>
|
||||||
|
<x:Double x:Key="AppBarSeparatorMinHeight">24</x:Double>
|
||||||
|
<Thickness x:Key="AppBarSeparatorMargin">8 4</Thickness>
|
||||||
|
<x:Double x:Key="AppBarSeparatorOverflowHeight">1</x:Double>
|
||||||
|
<Thickness x:Key="AppBarSeparatorOverflowMargin">4 4</Thickness>
|
||||||
|
<!-- CommandBar -->
|
||||||
|
<x:Double x:Key="CommandBarMinHeight">48</x:Double>
|
||||||
|
<Thickness x:Key="CommandBarPadding">4 0</Thickness>
|
||||||
|
<StaticResource x:Key="CommandBarCornerRadius" ResourceKey="SemiBorderRadiusMedium" />
|
||||||
|
<StaticResource x:Key="CommandBarBorderThickness" ResourceKey="SemiBorderThicknessControl" />
|
||||||
|
<!-- CommandBar overflow popup -->
|
||||||
|
<StaticResource x:Key="CommandBarOverflowCornerRadius" ResourceKey="SemiBorderRadiusMedium" />
|
||||||
|
<Thickness x:Key="CommandBarOverflowPadding">0 4</Thickness>
|
||||||
|
<x:Double x:Key="CommandBarOverflowMinWidth">160</x:Double>
|
||||||
|
<!-- Overflow button glyph -->
|
||||||
|
<StaticResource x:Key="CommandBarOverflowButtonGlyph" ResourceKey="SemiIconMore" />
|
||||||
|
</ResourceDictionary>
|
||||||
@@ -11,6 +11,7 @@
|
|||||||
<ResourceInclude Source="Carousel.axaml" />
|
<ResourceInclude Source="Carousel.axaml" />
|
||||||
<ResourceInclude Source="CheckBox.axaml" />
|
<ResourceInclude Source="CheckBox.axaml" />
|
||||||
<ResourceInclude Source="ComboBox.axaml" />
|
<ResourceInclude Source="ComboBox.axaml" />
|
||||||
|
<ResourceInclude Source="CommandBar.axaml" />
|
||||||
<ResourceInclude Source="DataValidationErrors.axaml" />
|
<ResourceInclude Source="DataValidationErrors.axaml" />
|
||||||
<ResourceInclude Source="DatePicker.axaml" />
|
<ResourceInclude Source="DatePicker.axaml" />
|
||||||
<ResourceInclude Source="DateTimePickerShared.axaml" />
|
<ResourceInclude Source="DateTimePickerShared.axaml" />
|
||||||
|
|||||||
Reference in New Issue
Block a user