mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-03-07 02:00:48 +08:00
Compare commits
30 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3f1a1ae823 | ||
|
|
6758686c44 | ||
|
|
f08a26bc60 | ||
|
|
de3ffc97b6 | ||
|
|
7da8a03f84 | ||
|
|
ab03be1aea | ||
|
|
4ec2d0cf86 | ||
|
|
757f91a140 | ||
|
|
f6d068b722 | ||
|
|
3a6452cccd | ||
|
|
5ea834d57e | ||
|
|
1d9fe693a3 | ||
|
|
2b867f9c6f | ||
|
|
5ea42844ea | ||
|
|
f819531465 | ||
|
|
8f24b2f332 | ||
|
|
a309729c11 | ||
|
|
d57c843032 | ||
|
|
a56b1e374a | ||
|
|
664d05db45 | ||
|
|
fdbfd91b8f | ||
|
|
3b0b007a40 | ||
|
|
c1eff9ddf8 | ||
|
|
4285e6e227 | ||
|
|
edacd88fa7 | ||
|
|
136d577667 | ||
|
|
4ef1520e64 | ||
|
|
5e751ccdbb | ||
|
|
13dcdbdd07 | ||
|
|
185fe8c984 |
6
Nuget.Config
Normal file
6
Nuget.Config
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<configuration>
|
||||||
|
<packageSources>
|
||||||
|
<add key="avalonia-nightly" value="https://nuget-feed-nightly.avaloniaui.net/v3/index.json" />
|
||||||
|
</packageSources>
|
||||||
|
</configuration>
|
||||||
14
README.md
14
README.md
@@ -75,14 +75,12 @@ We offer limited free community support for Semi Avalonia and Ursa. If you have
|
|||||||
|
|
||||||
## Version compatibility
|
## Version compatibility
|
||||||
|
|
||||||
| Semi Design Version | Avalonia Version |
|
| Semi Avalonia Version | Avalonia Version |
|
||||||
|:--------------------|:-----------------|
|
|:----------------------|:-----------------|
|
||||||
| 11.3.7 | 11.3.7 |
|
| 11.3.7 | >=11.3.7 |
|
||||||
| 11.2.1 | >=11.2.1 |
|
| 11.2.1 | >=11.2.1 |
|
||||||
| 11.2.0 | 11.2.0 |
|
| 11.2.0 | End of Life |
|
||||||
| 11.1.0 | >=11.1.0 |
|
| 11.1.x | End of Life |
|
||||||
| 11.0.7 | >=11.0.7 |
|
|
||||||
| 11.0.1 | <=11.0.6 |
|
|
||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
|
|||||||
14
README_CN.md
14
README_CN.md
@@ -75,14 +75,12 @@ dotnet add package Semi.Avalonia.AvaloniaEdit
|
|||||||
|
|
||||||
## 版本兼容性
|
## 版本兼容性
|
||||||
|
|
||||||
| Semi Design Version | Avalonia Version |
|
| Semi Avalonia Version | Avalonia Version |
|
||||||
|:--------------------|:-----------------|
|
|:----------------------|:-----------------|
|
||||||
| 11.3.7 | 11.3.7 |
|
| 11.3.7 | >=11.3.7 |
|
||||||
| 11.2.1 | >=11.2.1 |
|
| 11.2.1 | >=11.2.1 |
|
||||||
| 11.2.0 | 11.2.0 |
|
| 11.2.0 | End of Life |
|
||||||
| 11.1.0 | >=11.1.0 |
|
| 11.1.x | End of Life |
|
||||||
| 11.0.7 | >=11.0.7 |
|
|
||||||
| 11.0.1 | <=11.0.6 |
|
|
||||||
|
|
||||||
## 致谢
|
## 致谢
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
<Project>
|
<Project>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
||||||
<AvaloniaVersion>11.3.10</AvaloniaVersion>
|
<AvaloniaVersion>12.0.0-preview1</AvaloniaVersion>
|
||||||
<DataGridVersion>11.3.10</DataGridVersion>
|
<DataGridVersion>11.3.10</DataGridVersion>
|
||||||
<SkiaSharpVersion>3.119.1</SkiaSharpVersion>
|
<SkiaSharpVersion>3.119.1</SkiaSharpVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageVersion Include="Avalonia" Version="$(AvaloniaVersion)"/>
|
<PackageVersion Include="Avalonia" Version="$(AvaloniaVersion)"/>
|
||||||
<PackageVersion Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)" />
|
<!-- <PackageVersion Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)" />-->
|
||||||
<PackageVersion Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" />
|
<PackageVersion Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" />
|
||||||
<PackageVersion Include="Avalonia.LinuxFramebuffer" Version="$(AvaloniaVersion)"/>
|
<PackageVersion Include="Avalonia.LinuxFramebuffer" Version="$(AvaloniaVersion)"/>
|
||||||
<PackageVersion Include="Avalonia.iOS" Version="$(AvaloniaVersion)" />
|
<PackageVersion Include="Avalonia.iOS" Version="$(AvaloniaVersion)" />
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ namespace Semi.Avalonia.Demo.Android;
|
|||||||
MainLauncher = true,
|
MainLauncher = true,
|
||||||
LaunchMode = LaunchMode.SingleTop,
|
LaunchMode = LaunchMode.SingleTop,
|
||||||
ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize | ConfigChanges.UiMode)]
|
ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize | ConfigChanges.UiMode)]
|
||||||
public class MainActivity : AvaloniaMainActivity<App>
|
public class MainActivity : AvaloniaMainActivity
|
||||||
{
|
{
|
||||||
protected override AppBuilder CustomizeAppBuilder(AppBuilder builder)
|
protected override AppBuilder CustomizeAppBuilder(AppBuilder builder)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,8 +10,8 @@
|
|||||||
<semi:SemiTheme Locale="zh-CN" />
|
<semi:SemiTheme Locale="zh-CN" />
|
||||||
<semi:SemiPopupAnimations />
|
<semi:SemiPopupAnimations />
|
||||||
<semi:ColorPickerSemiTheme />
|
<semi:ColorPickerSemiTheme />
|
||||||
<semi:DataGridSemiTheme />
|
<!-- <semi:DataGridSemiTheme /> -->
|
||||||
<semi:TreeDataGridSemiTheme />
|
<!-- <semi:TreeDataGridSemiTheme /> -->
|
||||||
</Application.Styles>
|
</Application.Styles>
|
||||||
<Application.Resources>
|
<Application.Resources>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ public partial class App : Application
|
|||||||
case IClassicDesktopStyleApplicationLifetime desktop:
|
case IClassicDesktopStyleApplicationLifetime desktop:
|
||||||
// Line below is needed to remove Avalonia data validation.
|
// Line below is needed to remove Avalonia data validation.
|
||||||
// Without this line you will get duplicate validations from both Avalonia and CT
|
// Without this line you will get duplicate validations from both Avalonia and CT
|
||||||
BindingPlugins.DataValidators.RemoveAt(0);
|
// BindingPlugins.DataValidators.RemoveAt(0);
|
||||||
desktop.MainWindow = new MainWindow();
|
desktop.MainWindow = new MainWindow();
|
||||||
break;
|
break;
|
||||||
case ISingleViewApplicationLifetime singleView:
|
case ISingleViewApplicationLifetime singleView:
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using System.Threading.Tasks;
|
|||||||
using Avalonia;
|
using Avalonia;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Controls.Primitives;
|
using Avalonia.Controls.Primitives;
|
||||||
|
using Avalonia.Input.Platform;
|
||||||
using Avalonia.Media;
|
using Avalonia.Media;
|
||||||
using Semi.Avalonia.Demo.Converters;
|
using Semi.Avalonia.Demo.Converters;
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
</StackPanel.Styles>
|
</StackPanel.Styles>
|
||||||
|
|
||||||
<AutoCompleteBox
|
<AutoCompleteBox
|
||||||
Watermark="Please select a State"
|
PlaceholderText="Please select a State"
|
||||||
ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
|
ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
|
||||||
<AutoCompleteBox
|
<AutoCompleteBox
|
||||||
Classes="Large"
|
Classes="Large"
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
|
ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
|
||||||
<AutoCompleteBox
|
<AutoCompleteBox
|
||||||
IsEnabled="False"
|
IsEnabled="False"
|
||||||
Watermark="Disabled"
|
PlaceholderText="Disabled"
|
||||||
ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
|
ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
|
||||||
<AutoCompleteBox
|
<AutoCompleteBox
|
||||||
InnerLeftContent="https://"
|
InnerLeftContent="https://"
|
||||||
@@ -52,16 +52,16 @@
|
|||||||
<AutoCompleteBox
|
<AutoCompleteBox
|
||||||
Width="100"
|
Width="100"
|
||||||
Classes="Large"
|
Classes="Large"
|
||||||
Watermark="Large"
|
PlaceholderText="Large"
|
||||||
ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
|
ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
|
||||||
<AutoCompleteBox
|
<AutoCompleteBox
|
||||||
Width="100"
|
Width="100"
|
||||||
Watermark="Default"
|
PlaceholderText="Default"
|
||||||
ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
|
ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
|
||||||
<AutoCompleteBox
|
<AutoCompleteBox
|
||||||
Width="100"
|
Width="100"
|
||||||
Classes="Small"
|
Classes="Small"
|
||||||
Watermark="Small"
|
PlaceholderText="Small"
|
||||||
ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
|
ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
@@ -69,12 +69,12 @@
|
|||||||
<AutoCompleteBox
|
<AutoCompleteBox
|
||||||
Width="100"
|
Width="100"
|
||||||
IsEnabled="False"
|
IsEnabled="False"
|
||||||
Watermark="Disabled"
|
PlaceholderText="Disabled"
|
||||||
ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
|
ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
|
||||||
<AutoCompleteBox
|
<AutoCompleteBox
|
||||||
Width="100"
|
Width="100"
|
||||||
Classes="Bordered"
|
Classes="Bordered"
|
||||||
Watermark="Bordered"
|
PlaceholderText="Bordered"
|
||||||
ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
|
ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
|
||||||
<AutoCompleteBox
|
<AutoCompleteBox
|
||||||
Width="100"
|
Width="100"
|
||||||
|
|||||||
@@ -1,179 +0,0 @@
|
|||||||
<UserControl
|
|
||||||
x:Class="Semi.Avalonia.Demo.Pages.DataGridDemo"
|
|
||||||
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:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels;assembly=Semi.Avalonia.Demo"
|
|
||||||
d:DesignHeight="450"
|
|
||||||
d:DesignWidth="800"
|
|
||||||
x:DataType="vm:DataGridDemoViewModel"
|
|
||||||
mc:Ignorable="d">
|
|
||||||
<TabControl>
|
|
||||||
<TabItem Header="DataGrid">
|
|
||||||
<Grid RowDefinitions="Auto, *">
|
|
||||||
<StackPanel Grid.Row="0" Orientation="Horizontal">
|
|
||||||
<ToggleSwitch Content="Enable" Name="enable" IsChecked="True" />
|
|
||||||
<ToggleSwitch Content="Inset Content" Name="inset" />
|
|
||||||
<ToggleSwitch Content="ScrollBar Auto Hide" Name="autohide" />
|
|
||||||
</StackPanel>
|
|
||||||
<DataGrid Grid.Row="1"
|
|
||||||
Margin="8"
|
|
||||||
CanUserReorderColumns="True"
|
|
||||||
CanUserResizeColumns="True"
|
|
||||||
CanUserSortColumns="True"
|
|
||||||
HeadersVisibility="All"
|
|
||||||
IsReadOnly="True"
|
|
||||||
Classes.InsetContent="{Binding #inset.IsChecked}"
|
|
||||||
ScrollViewer.AllowAutoHide="{Binding #autohide.IsChecked}"
|
|
||||||
IsEnabled="{Binding #enable.IsChecked}"
|
|
||||||
ItemsSource="{Binding GridData1}">
|
|
||||||
<DataGrid.Columns>
|
|
||||||
<DataGridTextColumn
|
|
||||||
Width="6*"
|
|
||||||
x:DataType="vm:Song"
|
|
||||||
Binding="{Binding Title}"
|
|
||||||
Header="Title" />
|
|
||||||
<DataGridTextColumn
|
|
||||||
Width="6*"
|
|
||||||
x:DataType="vm:Song"
|
|
||||||
Binding="{Binding Artist}"
|
|
||||||
Header="Artist" />
|
|
||||||
<DataGridTextColumn
|
|
||||||
Width="6*"
|
|
||||||
x:DataType="vm:Song"
|
|
||||||
Binding="{Binding Album}"
|
|
||||||
Header="Album" />
|
|
||||||
<DataGridTemplateColumn Header="Duration" SortMemberPath="Duration">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<TextBlock
|
|
||||||
Margin="8,0,0,0"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Text="{Binding Duration}" />
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
</DataGrid.Columns>
|
|
||||||
|
|
||||||
</DataGrid>
|
|
||||||
|
|
||||||
</Grid>
|
|
||||||
</TabItem>
|
|
||||||
<TabItem Header="Grouping">
|
|
||||||
<DataGrid
|
|
||||||
Margin="8"
|
|
||||||
CanUserReorderColumns="True"
|
|
||||||
CanUserResizeColumns="True"
|
|
||||||
CanUserSortColumns="True"
|
|
||||||
HeadersVisibility="All"
|
|
||||||
IsReadOnly="True"
|
|
||||||
ItemsSource="{Binding GridData2}">
|
|
||||||
<DataGrid.Columns>
|
|
||||||
<DataGridTextColumn
|
|
||||||
Width="6*"
|
|
||||||
x:DataType="vm:Song"
|
|
||||||
Binding="{Binding Title}"
|
|
||||||
Header="Title" />
|
|
||||||
<DataGridTextColumn
|
|
||||||
Width="6*"
|
|
||||||
x:DataType="vm:Song"
|
|
||||||
Binding="{Binding Artist}"
|
|
||||||
Header="Artist" />
|
|
||||||
<DataGridTextColumn
|
|
||||||
Width="6*"
|
|
||||||
x:DataType="vm:Song"
|
|
||||||
Binding="{Binding Album}"
|
|
||||||
Header="Album" />
|
|
||||||
<DataGridTemplateColumn
|
|
||||||
x:DataType="vm:Song"
|
|
||||||
Header="Duration"
|
|
||||||
SortMemberPath="Duration">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate x:DataType="vm:Song">
|
|
||||||
<TextBlock
|
|
||||||
Margin="8,0,0,0"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Text="{Binding Duration}" />
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
</DataGrid.Columns>
|
|
||||||
</DataGrid>
|
|
||||||
</TabItem>
|
|
||||||
<TabItem Name="EditableTab" Header="Editable">
|
|
||||||
<Grid Margin="8" RowDefinitions="Auto,*,Auto">
|
|
||||||
<StackPanel
|
|
||||||
Grid.Row="0"
|
|
||||||
Orientation="Horizontal"
|
|
||||||
Spacing="4">
|
|
||||||
<TextBlock VerticalAlignment="Center" Text="FontSize:" />
|
|
||||||
<Slider
|
|
||||||
Name="FontSizeSlider"
|
|
||||||
Width="100"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Maximum="30"
|
|
||||||
Minimum="5"
|
|
||||||
Value="14" />
|
|
||||||
<CheckBox
|
|
||||||
Name="IsThreeStateCheckBox"
|
|
||||||
Content="IsThreeState"
|
|
||||||
IsChecked="False" />
|
|
||||||
</StackPanel>
|
|
||||||
<DataGrid
|
|
||||||
Grid.Row="1"
|
|
||||||
Margin="8"
|
|
||||||
ItemsSource="{Binding GridData3}">
|
|
||||||
<DataGrid.Columns>
|
|
||||||
<DataGridCheckBoxColumn
|
|
||||||
Width="2*"
|
|
||||||
Binding="{Binding IsSelected}"
|
|
||||||
Header="Select"
|
|
||||||
IsThreeState="{Binding #IsThreeStateCheckBox.IsChecked, Mode=OneWay}" />
|
|
||||||
<DataGridTextColumn
|
|
||||||
Width="6*"
|
|
||||||
x:DataType="vm:SongViewModel"
|
|
||||||
Binding="{Binding Title}"
|
|
||||||
FontSize="{Binding #FontSizeSlider.Value, Mode=OneWay}"
|
|
||||||
Header="Title" />
|
|
||||||
<DataGridTextColumn
|
|
||||||
Width="6*"
|
|
||||||
x:DataType="vm:SongViewModel"
|
|
||||||
Binding="{Binding Artist}"
|
|
||||||
Header="Artist" />
|
|
||||||
<DataGridTextColumn
|
|
||||||
Width="6*"
|
|
||||||
x:DataType="vm:SongViewModel"
|
|
||||||
Binding="{Binding Album}"
|
|
||||||
Header="Album" />
|
|
||||||
<DataGridTemplateColumn Width="2*" Header="Comments">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<TextBlock
|
|
||||||
HorizontalAlignment="Center"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Text="{Binding CountOfComment}" />
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataGridTemplateColumn.CellEditingTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<NumericUpDown
|
|
||||||
HorizontalAlignment="Stretch"
|
|
||||||
FormatString="N0"
|
|
||||||
Minimum="0"
|
|
||||||
Value="{Binding CountOfComment}" />
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellEditingTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
</DataGrid.Columns>
|
|
||||||
</DataGrid>
|
|
||||||
<Button
|
|
||||||
Grid.Row="2"
|
|
||||||
Margin="12,0,12,12"
|
|
||||||
HorizontalAlignment="Right"
|
|
||||||
Command="{Binding AddCommand}"
|
|
||||||
Content="Add" />
|
|
||||||
</Grid>
|
|
||||||
</TabItem>
|
|
||||||
</TabControl>
|
|
||||||
</UserControl>
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
using Avalonia.Controls;
|
|
||||||
using Semi.Avalonia.Demo.ViewModels;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
|
||||||
|
|
||||||
public partial class DataGridDemo : UserControl
|
|
||||||
{
|
|
||||||
public DataGridDemo()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
DataContext = new DataGridDemoViewModel();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -36,10 +36,20 @@
|
|||||||
<HyperlinkButton HorizontalAlignment="Right" Content="更多" />
|
<HyperlinkButton HorizontalAlignment="Right" Content="更多" />
|
||||||
</Panel>
|
</Panel>
|
||||||
</HeaderedContentControl.Header>
|
</HeaderedContentControl.Header>
|
||||||
<HeaderedContentControl.Content>
|
<SelectableTextBlock Text="Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统。设计系统包含设计语言以及一整套可复用的前端组件,帮助设计师与开发者更容易地打造高质量的、用户体验一致的、符合设计规范的 Web 应用。" />
|
||||||
<SelectableTextBlock Text="Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统。设计系统包含设计语言以及一整套可复用的前端组件,帮助设计师与开发者更容易地打造高质量的、用户体验一致的、符合设计规范的 Web 应用。" />
|
|
||||||
</HeaderedContentControl.Content>
|
|
||||||
</HeaderedContentControl>
|
</HeaderedContentControl>
|
||||||
|
<TextBlock>Real GroupBox</TextBlock>
|
||||||
|
<GroupBox
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
MaxWidth="360">
|
||||||
|
<HeaderedContentControl.Header>
|
||||||
|
<Panel>
|
||||||
|
<SelectableTextBlock Text="Semi Design" />
|
||||||
|
<HyperlinkButton HorizontalAlignment="Right" Content="更多" />
|
||||||
|
</Panel>
|
||||||
|
</HeaderedContentControl.Header>
|
||||||
|
<SelectableTextBlock Text="Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统。设计系统包含设计语言以及一整套可复用的前端组件,帮助设计师与开发者更容易地打造高质量的、用户体验一致的、符合设计规范的 Web 应用。" />
|
||||||
|
</GroupBox>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@@ -1,327 +0,0 @@
|
|||||||
<UserControl 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:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels"
|
|
||||||
xmlns:controls="clr-namespace:Semi.Avalonia.Demo.Controls"
|
|
||||||
xmlns:cvt="clr-namespace:Semi.Avalonia.Demo.Converters"
|
|
||||||
xmlns:pages="clr-namespace:Semi.Avalonia.Demo.Pages"
|
|
||||||
mc:Ignorable="d" d:DesignWidth="1000" d:DesignHeight="1450"
|
|
||||||
x:DataType="vm:HighContrastDemoViewModel"
|
|
||||||
x:Class="Semi.Avalonia.Demo.Pages.HighContrastDemo">
|
|
||||||
<Design.DataContext>
|
|
||||||
<vm:HighContrastDemoViewModel />
|
|
||||||
</Design.DataContext>
|
|
||||||
<SplitView
|
|
||||||
Name="splitView"
|
|
||||||
CompactPaneLength="50"
|
|
||||||
DisplayMode="CompactInline"
|
|
||||||
IsPaneOpen="{Binding #toggle.IsChecked, Mode=TwoWay}"
|
|
||||||
OpenPaneLength="300"
|
|
||||||
PanePlacement="Right">
|
|
||||||
<SplitView.Pane>
|
|
||||||
<StackPanel>
|
|
||||||
<ToggleSwitch
|
|
||||||
Name="toggle"
|
|
||||||
HorizontalAlignment="Right"
|
|
||||||
IsChecked="True"
|
|
||||||
Theme="{DynamicResource IconBorderlessToggleSwitch}"
|
|
||||||
Content="{StaticResource SemiIconSidebar}" />
|
|
||||||
<Border IsVisible="{Binding #splitView.IsPaneOpen}" Theme="{DynamicResource CardBorder}">
|
|
||||||
<Panel>
|
|
||||||
<TextBlock
|
|
||||||
IsVisible="{Binding SelectedColorResource, Converter={x:Static ObjectConverters.IsNull}}"
|
|
||||||
Text="Click on Color to Check Details"
|
|
||||||
TextWrapping="Wrap" />
|
|
||||||
<controls:ColorDetailControl
|
|
||||||
Background="{Binding SelectedColorResource.Brush}"
|
|
||||||
IsVisible="{Binding SelectedColorResource, Converter={x:Static ObjectConverters.IsNotNull}}"
|
|
||||||
ResourceKey="{Binding SelectedColorResource.ResourceKey}"
|
|
||||||
ResourceName="{Binding SelectedColorResource.ResourceKey}" />
|
|
||||||
</Panel>
|
|
||||||
</Border>
|
|
||||||
</StackPanel>
|
|
||||||
</SplitView.Pane>
|
|
||||||
<SplitView.Content>
|
|
||||||
<ScrollViewer>
|
|
||||||
<StackPanel Spacing="10">
|
|
||||||
<TextBlock Text="Theme Preview" FontWeight="SemiBold" />
|
|
||||||
<ListBox
|
|
||||||
Theme="{StaticResource PureCardRadioGroupListBox}"
|
|
||||||
ItemsSource="{Binding ThemeVariants}"
|
|
||||||
SelectedItem="{Binding SelectedThemeVariant}">
|
|
||||||
<ListBox.ItemsPanel>
|
|
||||||
<ItemsPanelTemplate>
|
|
||||||
<WrapPanel Orientation="Horizontal" />
|
|
||||||
</ItemsPanelTemplate>
|
|
||||||
</ListBox.ItemsPanel>
|
|
||||||
<ListBox.ItemTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<StackPanel HorizontalAlignment="Left" Spacing="5" MinWidth="200">
|
|
||||||
<ThemeVariantScope RequestedThemeVariant="{Binding}">
|
|
||||||
<Border
|
|
||||||
Padding="5 25 5 5"
|
|
||||||
HorizontalAlignment="Left"
|
|
||||||
Background="{DynamicResource WindowColor}"
|
|
||||||
BorderBrush="{DynamicResource WindowTextColor}"
|
|
||||||
BorderThickness="1"
|
|
||||||
CornerRadius="3">
|
|
||||||
<StackPanel Spacing="10">
|
|
||||||
<StackPanel Orientation="Horizontal" Spacing="50">
|
|
||||||
<StackPanel Spacing="5">
|
|
||||||
<TextBlock
|
|
||||||
FontSize="50"
|
|
||||||
Text="Aa" />
|
|
||||||
<StackPanel Orientation="Horizontal" Spacing="3">
|
|
||||||
<StackPanel.Styles>
|
|
||||||
<Style Selector="Border">
|
|
||||||
<Setter Property="BorderThickness" Value="1" />
|
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource WindowTextColor}" />
|
|
||||||
<Setter Property="CornerRadius" Value="5" />
|
|
||||||
<Setter Property="Width" Value="10" />
|
|
||||||
<Setter Property="Height" Value="{Binding $self.Width}" />
|
|
||||||
</Style>
|
|
||||||
</StackPanel.Styles>
|
|
||||||
<Border Background="{DynamicResource WindowColor}" />
|
|
||||||
<Border Background="{DynamicResource HotlightColor}" />
|
|
||||||
<Border Background="{DynamicResource GrayTextColor}" />
|
|
||||||
<Border Background="{DynamicResource HighlightTextColor}" />
|
|
||||||
<Border Background="{DynamicResource HighlightColor}" />
|
|
||||||
</StackPanel>
|
|
||||||
</StackPanel>
|
|
||||||
<Border
|
|
||||||
BorderThickness="1"
|
|
||||||
BorderBrush="{DynamicResource WindowTextColor}"
|
|
||||||
CornerRadius="3"
|
|
||||||
Padding="8">
|
|
||||||
<Panel>
|
|
||||||
<StackPanel Spacing="5">
|
|
||||||
<Border
|
|
||||||
Width="50"
|
|
||||||
Height="1"
|
|
||||||
Background="{DynamicResource WindowTextColor}" />
|
|
||||||
<Border
|
|
||||||
Height="1"
|
|
||||||
Background="{DynamicResource WindowTextColor}" />
|
|
||||||
<Border
|
|
||||||
Height="1"
|
|
||||||
Background="{DynamicResource WindowTextColor}" />
|
|
||||||
</StackPanel>
|
|
||||||
<StackPanel
|
|
||||||
HorizontalAlignment="Right"
|
|
||||||
VerticalAlignment="Bottom"
|
|
||||||
Orientation="Horizontal"
|
|
||||||
Spacing="2">
|
|
||||||
<Border
|
|
||||||
Width="20"
|
|
||||||
Height="5"
|
|
||||||
Background="{DynamicResource HighlightColor}"
|
|
||||||
CornerRadius="1" />
|
|
||||||
<Border
|
|
||||||
Width="20"
|
|
||||||
Height="5"
|
|
||||||
BorderThickness="1"
|
|
||||||
BorderBrush="{DynamicResource ButtonTextColor}"
|
|
||||||
CornerRadius="1" />
|
|
||||||
</StackPanel>
|
|
||||||
</Panel>
|
|
||||||
</Border>
|
|
||||||
</StackPanel>
|
|
||||||
<Border
|
|
||||||
Height="1"
|
|
||||||
Background="{DynamicResource WindowTextColor}" />
|
|
||||||
</StackPanel>
|
|
||||||
</Border>
|
|
||||||
</ThemeVariantScope>
|
|
||||||
<TextBlock Text="{Binding}" FontWeight="SemiBold" />
|
|
||||||
</StackPanel>
|
|
||||||
</DataTemplate>
|
|
||||||
</ListBox.ItemTemplate>
|
|
||||||
</ListBox>
|
|
||||||
|
|
||||||
<ThemeVariantScope
|
|
||||||
MinWidth="400"
|
|
||||||
RequestedThemeVariant="{Binding SelectedThemeVariant}">
|
|
||||||
<Border Padding="10" Background="{DynamicResource WindowColor}">
|
|
||||||
<StackPanel Spacing="16">
|
|
||||||
<StackPanel.Styles>
|
|
||||||
<Style Selector="TextBlock">
|
|
||||||
<Setter Property="HorizontalAlignment" Value="Left" />
|
|
||||||
<Setter Property="VerticalAlignment" Value="Center" />
|
|
||||||
<Setter Property="FontWeight" Value="SemiBold" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="controls|ColorItemControl.ColorBlock">
|
|
||||||
<Setter Property="Width" Value="44" />
|
|
||||||
<Setter Property="Height" Value="{Binding $self.Width}" />
|
|
||||||
<Setter Property="HorizontalAlignment" Value="Right" />
|
|
||||||
<Setter Property="BorderThickness" Value="1" />
|
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource WindowTextColor}" />
|
|
||||||
<Setter Property="CornerRadius" Value="3" />
|
|
||||||
</Style>
|
|
||||||
</StackPanel.Styles>
|
|
||||||
<Panel>
|
|
||||||
<TextBlock
|
|
||||||
Foreground="{DynamicResource WindowTextColor}"
|
|
||||||
Text="Background" />
|
|
||||||
<controls:ColorItemControl
|
|
||||||
Classes="ColorBlock"
|
|
||||||
DataContext="{Binding ColorResources[0]}"
|
|
||||||
Background="{DynamicResource WindowColor}" />
|
|
||||||
</Panel>
|
|
||||||
<Panel>
|
|
||||||
<TextBlock
|
|
||||||
Foreground="{DynamicResource WindowTextColor}"
|
|
||||||
Text="Text" />
|
|
||||||
<controls:ColorItemControl
|
|
||||||
Classes="ColorBlock"
|
|
||||||
DataContext="{Binding ColorResources[1]}"
|
|
||||||
Background="{DynamicResource WindowTextColor}" />
|
|
||||||
</Panel>
|
|
||||||
<Panel>
|
|
||||||
<TextBlock
|
|
||||||
Foreground="{DynamicResource HotlightColor}"
|
|
||||||
TextDecorations="Underline"
|
|
||||||
Text="Hyperlink" />
|
|
||||||
<controls:ColorItemControl
|
|
||||||
Classes="ColorBlock"
|
|
||||||
DataContext="{Binding ColorResources[2]}"
|
|
||||||
Background="{DynamicResource HotlightColor}" />
|
|
||||||
</Panel>
|
|
||||||
<Panel>
|
|
||||||
<TextBlock
|
|
||||||
Foreground="{DynamicResource GrayTextColor}"
|
|
||||||
Text="Inactive Text" />
|
|
||||||
<controls:ColorItemControl
|
|
||||||
Classes="ColorBlock"
|
|
||||||
DataContext="{Binding ColorResources[3]}"
|
|
||||||
Background="{DynamicResource GrayTextColor}" />
|
|
||||||
</Panel>
|
|
||||||
<Panel>
|
|
||||||
<TextBlock
|
|
||||||
Foreground="{DynamicResource HighlightTextColor}"
|
|
||||||
Background="{DynamicResource HighlightColor}"
|
|
||||||
Text="Selected text" />
|
|
||||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Spacing="4">
|
|
||||||
<controls:ColorItemControl
|
|
||||||
Classes="ColorBlock"
|
|
||||||
DataContext="{Binding ColorResources[4]}"
|
|
||||||
Background="{DynamicResource HighlightTextColor}" />
|
|
||||||
<controls:ColorItemControl
|
|
||||||
Classes="ColorBlock"
|
|
||||||
DataContext="{Binding ColorResources[5]}"
|
|
||||||
Background="{DynamicResource HighlightColor}" />
|
|
||||||
</StackPanel>
|
|
||||||
</Panel>
|
|
||||||
<Panel>
|
|
||||||
<Border
|
|
||||||
HorizontalAlignment="Left"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
BorderBrush="{DynamicResource ButtonTextColor}"
|
|
||||||
Background="{DynamicResource ButtonFaceColor}"
|
|
||||||
BorderThickness="2"
|
|
||||||
CornerRadius="3">
|
|
||||||
<TextBlock
|
|
||||||
Foreground="{DynamicResource ButtonTextColor}"
|
|
||||||
Padding="16 6"
|
|
||||||
Text="Button text" />
|
|
||||||
</Border>
|
|
||||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Spacing="4">
|
|
||||||
<controls:ColorItemControl
|
|
||||||
Classes="ColorBlock"
|
|
||||||
DataContext="{Binding ColorResources[6]}"
|
|
||||||
Background="{DynamicResource ButtonTextColor}" />
|
|
||||||
<controls:ColorItemControl
|
|
||||||
Classes="ColorBlock"
|
|
||||||
DataContext="{Binding ColorResources[7]}"
|
|
||||||
Background="{DynamicResource ButtonFaceColor}" />
|
|
||||||
</StackPanel>
|
|
||||||
</Panel>
|
|
||||||
</StackPanel>
|
|
||||||
</Border>
|
|
||||||
</ThemeVariantScope>
|
|
||||||
|
|
||||||
<DataGrid
|
|
||||||
HorizontalAlignment="Left"
|
|
||||||
CanUserSortColumns="False"
|
|
||||||
AutoGenerateColumns="False"
|
|
||||||
ItemsSource="{Binding ColorResources}"
|
|
||||||
GridLinesVisibility="All"
|
|
||||||
BorderBrush="{DynamicResource SemiColorBorder}"
|
|
||||||
BorderThickness="1"
|
|
||||||
Padding="5">
|
|
||||||
<DataGrid.Columns>
|
|
||||||
<DataGridTemplateColumn Header="Color">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<controls:ColorItemControl
|
|
||||||
Width="40"
|
|
||||||
Height="20"
|
|
||||||
CornerRadius="3"
|
|
||||||
Background="{Binding Brush}" />
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
|
|
||||||
<DataGridTemplateColumn Header="ResourceKey">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<SelectableTextBlock
|
|
||||||
Margin="12 0"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Text="{Binding ResourceKey}" />
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
|
|
||||||
<DataGridTemplateColumn Header="Hex">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<SelectableTextBlock
|
|
||||||
Margin="12 0"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Text="{Binding Brush,
|
|
||||||
Converter={x:Static cvt:ColorConverter.ToHex},ConverterParameter={x:False}}" />
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
|
|
||||||
<DataGridTemplateColumn Header="Description">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<SelectableTextBlock
|
|
||||||
Margin="12 0"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Text="{Binding Description}" />
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
|
|
||||||
<DataGridTemplateColumn Header="Pair With">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<SelectableTextBlock
|
|
||||||
Margin="12 0"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Text="{Binding PairWith}" />
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
|
|
||||||
<DataGridTemplateColumn Width="100" Header="CopyText">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate DataType="vm:ColorResource">
|
|
||||||
<Button
|
|
||||||
Command="{Binding $parent[pages:HighContrastDemo].Copy}"
|
|
||||||
CommandParameter="{Binding CopyText}"
|
|
||||||
Theme="{DynamicResource IconBorderlessButton}"
|
|
||||||
Content="{StaticResource SemiIconCopy}" />
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
</DataGrid.Columns>
|
|
||||||
</DataGrid>
|
|
||||||
</StackPanel>
|
|
||||||
</ScrollViewer>
|
|
||||||
</SplitView.Content>
|
|
||||||
</SplitView>
|
|
||||||
</UserControl>
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
using System.Threading.Tasks;
|
|
||||||
using Avalonia.Controls;
|
|
||||||
using Semi.Avalonia.Demo.ViewModels;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
|
||||||
|
|
||||||
public partial class HighContrastDemo : UserControl
|
|
||||||
{
|
|
||||||
public HighContrastDemo()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
this.DataContext = new HighContrastDemoViewModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task Copy(object? o)
|
|
||||||
{
|
|
||||||
if (o is null) return;
|
|
||||||
var toplevel = TopLevel.GetTopLevel(this);
|
|
||||||
if (toplevel?.Clipboard is { } c)
|
|
||||||
{
|
|
||||||
await c.SetTextAsync(o.ToString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -28,15 +28,15 @@
|
|||||||
<NumericUpDown
|
<NumericUpDown
|
||||||
Width="100"
|
Width="100"
|
||||||
Classes="Large"
|
Classes="Large"
|
||||||
Watermark="Large"
|
PlaceholderText="Large"
|
||||||
ButtonSpinnerLocation="Left" />
|
ButtonSpinnerLocation="Left" />
|
||||||
<NumericUpDown
|
<NumericUpDown
|
||||||
Width="100"
|
Width="100"
|
||||||
Watermark="Default"
|
PlaceholderText="Default"
|
||||||
ShowButtonSpinner="False" />
|
ShowButtonSpinner="False" />
|
||||||
<NumericUpDown
|
<NumericUpDown
|
||||||
Width="100"
|
Width="100"
|
||||||
Watermark="Small"
|
PlaceholderText="Small"
|
||||||
Classes="Small" />
|
Classes="Small" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
|
|||||||
@@ -353,12 +353,12 @@
|
|||||||
<StackPanel>
|
<StackPanel>
|
||||||
<TextBlock Text="Install via nuget: " />
|
<TextBlock Text="Install via nuget: " />
|
||||||
<Border Margin="0,16" Classes="CodeBlock">
|
<Border Margin="0,16" Classes="CodeBlock">
|
||||||
<SelectableTextBlock FontFamily="Consolas" Text="{Binding $parent[local:Overview].MainInstall}" />
|
<SelectableTextBlock Text="{Binding $parent[local:Overview].MainInstall}" />
|
||||||
</Border>
|
</Border>
|
||||||
<TextBlock Text="Reference styles: " />
|
<TextBlock Text="Reference styles: " />
|
||||||
<Border Margin="0,16" Classes="CodeBlock">
|
<Border Margin="0,16" Classes="CodeBlock">
|
||||||
<SelectableTextBlock
|
<SelectableTextBlock
|
||||||
FontFamily="Consolas"
|
|
||||||
Text="{Binding $parent[local:Overview].MainStyle}"
|
Text="{Binding $parent[local:Overview].MainStyle}"
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
</Border>
|
</Border>
|
||||||
@@ -368,12 +368,12 @@
|
|||||||
<StackPanel>
|
<StackPanel>
|
||||||
<TextBlock Text="Install via nuget: " />
|
<TextBlock Text="Install via nuget: " />
|
||||||
<Border Margin="0,16" Classes="CodeBlock">
|
<Border Margin="0,16" Classes="CodeBlock">
|
||||||
<SelectableTextBlock FontFamily="Consolas" Text="{Binding $parent[local:Overview].ColorPickerInstall}" />
|
<SelectableTextBlock Text="{Binding $parent[local:Overview].ColorPickerInstall}" />
|
||||||
</Border>
|
</Border>
|
||||||
<TextBlock Text="Reference styles: " />
|
<TextBlock Text="Reference styles: " />
|
||||||
<Border Margin="0,16" Classes="CodeBlock">
|
<Border Margin="0,16" Classes="CodeBlock">
|
||||||
<SelectableTextBlock
|
<SelectableTextBlock
|
||||||
FontFamily="Consolas"
|
|
||||||
Text="{Binding $parent[local:Overview].ColorPickerStyle}"
|
Text="{Binding $parent[local:Overview].ColorPickerStyle}"
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
</Border>
|
</Border>
|
||||||
@@ -383,12 +383,12 @@
|
|||||||
<StackPanel>
|
<StackPanel>
|
||||||
<TextBlock Text="Install via nuget: " />
|
<TextBlock Text="Install via nuget: " />
|
||||||
<Border Margin="0,16" Classes="CodeBlock">
|
<Border Margin="0,16" Classes="CodeBlock">
|
||||||
<SelectableTextBlock FontFamily="Consolas" Text="{Binding $parent[local:Overview].DataGridInstall}" />
|
<SelectableTextBlock Text="{Binding $parent[local:Overview].DataGridInstall}" />
|
||||||
</Border>
|
</Border>
|
||||||
<TextBlock Text="Reference styles: " />
|
<TextBlock Text="Reference styles: " />
|
||||||
<Border Margin="0,16" Classes="CodeBlock">
|
<Border Margin="0,16" Classes="CodeBlock">
|
||||||
<SelectableTextBlock
|
<SelectableTextBlock
|
||||||
FontFamily="Consolas"
|
|
||||||
Text="{Binding $parent[local:Overview].DataGridStyle}"
|
Text="{Binding $parent[local:Overview].DataGridStyle}"
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
</Border>
|
</Border>
|
||||||
@@ -398,12 +398,12 @@
|
|||||||
<StackPanel>
|
<StackPanel>
|
||||||
<TextBlock Text="Install via nuget: " />
|
<TextBlock Text="Install via nuget: " />
|
||||||
<Border Margin="0,16" Classes="CodeBlock">
|
<Border Margin="0,16" Classes="CodeBlock">
|
||||||
<SelectableTextBlock FontFamily="Consolas" Text="{Binding $parent[local:Overview].TreeDataGridInstall}" />
|
<SelectableTextBlock Text="{Binding $parent[local:Overview].TreeDataGridInstall}" />
|
||||||
</Border>
|
</Border>
|
||||||
<TextBlock Text="Reference styles: " />
|
<TextBlock Text="Reference styles: " />
|
||||||
<Border Margin="0,16" Classes="CodeBlock">
|
<Border Margin="0,16" Classes="CodeBlock">
|
||||||
<SelectableTextBlock
|
<SelectableTextBlock
|
||||||
FontFamily="Consolas"
|
|
||||||
Text="{Binding $parent[local:Overview].TreeDataGridStyle}"
|
Text="{Binding $parent[local:Overview].TreeDataGridStyle}"
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
</Border>
|
</Border>
|
||||||
@@ -413,12 +413,12 @@
|
|||||||
<StackPanel>
|
<StackPanel>
|
||||||
<TextBlock Text="Install via nuget: " />
|
<TextBlock Text="Install via nuget: " />
|
||||||
<Border Margin="0,16" Classes="CodeBlock">
|
<Border Margin="0,16" Classes="CodeBlock">
|
||||||
<SelectableTextBlock FontFamily="Consolas" Text="{Binding $parent[local:Overview].DockInstall}" />
|
<SelectableTextBlock Text="{Binding $parent[local:Overview].DockInstall}" />
|
||||||
</Border>
|
</Border>
|
||||||
<TextBlock Text="Reference styles: " />
|
<TextBlock Text="Reference styles: " />
|
||||||
<Border Margin="0,16" Classes="CodeBlock">
|
<Border Margin="0,16" Classes="CodeBlock">
|
||||||
<SelectableTextBlock
|
<SelectableTextBlock
|
||||||
FontFamily="Consolas"
|
|
||||||
Text="{Binding $parent[local:Overview].DockStyle}"
|
Text="{Binding $parent[local:Overview].DockStyle}"
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
</Border>
|
</Border>
|
||||||
@@ -428,12 +428,12 @@
|
|||||||
<StackPanel>
|
<StackPanel>
|
||||||
<TextBlock Text="Install via nuget: " />
|
<TextBlock Text="Install via nuget: " />
|
||||||
<Border Margin="0,16" Classes="CodeBlock">
|
<Border Margin="0,16" Classes="CodeBlock">
|
||||||
<SelectableTextBlock FontFamily="Consolas" Text="{Binding $parent[local:Overview].TabaloniaInstall}" />
|
<SelectableTextBlock Text="{Binding $parent[local:Overview].TabaloniaInstall}" />
|
||||||
</Border>
|
</Border>
|
||||||
<TextBlock Text="Reference styles: " />
|
<TextBlock Text="Reference styles: " />
|
||||||
<Border Margin="0,16" Classes="CodeBlock">
|
<Border Margin="0,16" Classes="CodeBlock">
|
||||||
<SelectableTextBlock
|
<SelectableTextBlock
|
||||||
FontFamily="Consolas"
|
|
||||||
Text="{Binding $parent[local:Overview].TabaloniaStyle}"
|
Text="{Binding $parent[local:Overview].TabaloniaStyle}"
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
</Border>
|
</Border>
|
||||||
@@ -443,12 +443,12 @@
|
|||||||
<StackPanel>
|
<StackPanel>
|
||||||
<TextBlock Text="Install via nuget: " />
|
<TextBlock Text="Install via nuget: " />
|
||||||
<Border Margin="0,16" Classes="CodeBlock">
|
<Border Margin="0,16" Classes="CodeBlock">
|
||||||
<SelectableTextBlock FontFamily="Consolas" Text="{Binding $parent[local:Overview].AvaloniaEditInstall}" />
|
<SelectableTextBlock Text="{Binding $parent[local:Overview].AvaloniaEditInstall}" />
|
||||||
</Border>
|
</Border>
|
||||||
<TextBlock Text="Reference styles: " />
|
<TextBlock Text="Reference styles: " />
|
||||||
<Border Margin="0,16" Classes="CodeBlock">
|
<Border Margin="0,16" Classes="CodeBlock">
|
||||||
<SelectableTextBlock
|
<SelectableTextBlock
|
||||||
FontFamily="Consolas"
|
|
||||||
Text="{Binding $parent[local:Overview].AvaloniaEditStyle}"
|
Text="{Binding $parent[local:Overview].AvaloniaEditStyle}"
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
</Border>
|
</Border>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Controls.Primitives;
|
using Avalonia.Controls.Primitives;
|
||||||
|
using Avalonia.Input.Platform;
|
||||||
using Avalonia.Threading;
|
using Avalonia.Threading;
|
||||||
using Semi.Avalonia.Demo.ViewModels;
|
using Semi.Avalonia.Demo.ViewModels;
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,15 @@
|
|||||||
TickFrequency="10"
|
TickFrequency="10"
|
||||||
TickPlacement="Outside"
|
TickPlacement="Outside"
|
||||||
Value="0" />
|
Value="0" />
|
||||||
|
<Slider
|
||||||
|
Value="0"
|
||||||
|
Minimum="0"
|
||||||
|
Maximum="100"
|
||||||
|
TickPlacement="BottomRight"
|
||||||
|
IsSnapToTickEnabled="True"
|
||||||
|
IsDirectionReversed="True"
|
||||||
|
Ticks="0,20,25,40,75,100"
|
||||||
|
Width="300" />
|
||||||
<Slider
|
<Slider
|
||||||
Width="300"
|
Width="300"
|
||||||
Classes="ToolTip"
|
Classes="ToolTip"
|
||||||
|
|||||||
@@ -23,36 +23,36 @@
|
|||||||
<TextBox
|
<TextBox
|
||||||
Width="100"
|
Width="100"
|
||||||
Classes="Large"
|
Classes="Large"
|
||||||
Watermark="Large" />
|
PlaceholderText="Large" />
|
||||||
<TextBox
|
<TextBox
|
||||||
Width="100"
|
Width="100"
|
||||||
Watermark="Default" />
|
PlaceholderText="Default" />
|
||||||
<TextBox
|
<TextBox
|
||||||
Width="100"
|
Width="100"
|
||||||
Classes="Small"
|
Classes="Small"
|
||||||
Watermark="Small" />
|
PlaceholderText="Small" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<TextBox
|
<TextBox
|
||||||
Width="100"
|
Width="100"
|
||||||
IsEnabled="False"
|
IsEnabled="False"
|
||||||
Watermark="Disabled" />
|
PlaceholderText="Disabled" />
|
||||||
<TextBox
|
<TextBox
|
||||||
Width="100"
|
Width="100"
|
||||||
Classes="Bordered"
|
Classes="Bordered"
|
||||||
Watermark="Bordered" />
|
PlaceholderText="Bordered" />
|
||||||
<TextBox
|
<TextBox
|
||||||
Width="100"
|
Width="100"
|
||||||
Classes="Bordered"
|
Classes="Bordered"
|
||||||
IsEnabled="False" />
|
IsEnabled="False" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<TextBox Width="300" Classes="TextArea" Watermark="TextArea TextBox" />
|
<TextBox Width="300" Classes="TextArea" PlaceholderText="TextArea TextBox" />
|
||||||
<TextBox Width="300" Classes="TextArea ClearButton" Text="TextArea with ClearButton - text should be clearable" />
|
<TextBox Width="300" Classes="TextArea ClearButton" Text="TextArea with ClearButton - text should be clearable" />
|
||||||
<TextBox
|
<TextBox
|
||||||
Width="300"
|
Width="300"
|
||||||
Theme="{StaticResource LooklessTextBox}"
|
Theme="{StaticResource LooklessTextBox}"
|
||||||
Watermark="Lookless TextBox"
|
PlaceholderText="Lookless TextBox"
|
||||||
InnerLeftContent="https://"
|
InnerLeftContent="https://"
|
||||||
InnerRightContent=".com" />
|
InnerRightContent=".com" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|||||||
@@ -1,126 +0,0 @@
|
|||||||
<UserControl 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:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels"
|
|
||||||
xmlns:converters="clr-namespace:Semi.Avalonia.Demo.Converters"
|
|
||||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
|
||||||
x:Class="Semi.Avalonia.Demo.Pages.TreeDataGridDemo"
|
|
||||||
x:DataType="vm:TreeDataGridDemoViewModel">
|
|
||||||
<UserControl.Resources>
|
|
||||||
<converters:FileIconConverter x:Key="FileIconConverter">
|
|
||||||
<StaticResource x:Key="file" ResourceKey="SemiIconFile" />
|
|
||||||
<StaticResource x:Key="folderOpen" ResourceKey="SemiIconFolderOpen" />
|
|
||||||
<StaticResource x:Key="folderClosed" ResourceKey="SemiIconFolder" />
|
|
||||||
</converters:FileIconConverter>
|
|
||||||
</UserControl.Resources>
|
|
||||||
<TabControl>
|
|
||||||
<TabItem Header="Songs">
|
|
||||||
<TreeDataGrid
|
|
||||||
AutoDragDropRows="True"
|
|
||||||
DataContext="{Binding SongsContext}"
|
|
||||||
Source="{Binding Songs}">
|
|
||||||
<TreeDataGrid.Resources>
|
|
||||||
<DataTemplate x:Key="AlbumCell" DataType="vm:SongViewModel">
|
|
||||||
<TextBlock
|
|
||||||
HorizontalAlignment="Stretch"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Background="Transparent"
|
|
||||||
Text="{Binding Album}" />
|
|
||||||
</DataTemplate>
|
|
||||||
<DataTemplate x:Key="AlbumEditCell" DataType="vm:SongViewModel">
|
|
||||||
<ComboBox
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Classes="Small"
|
|
||||||
ItemsSource="{x:Static vm:Song.Albums}"
|
|
||||||
SelectedItem="{Binding Album}" />
|
|
||||||
</DataTemplate>
|
|
||||||
<DataTemplate x:Key="CommentsCell" DataType="vm:SongViewModel">
|
|
||||||
<TextBlock VerticalAlignment="Center" Text="{Binding CountOfComment}" />
|
|
||||||
</DataTemplate>
|
|
||||||
<DataTemplate x:Key="CommentsEditCell" DataType="vm:SongViewModel">
|
|
||||||
<NumericUpDown
|
|
||||||
Width="100"
|
|
||||||
HorizontalAlignment="Left"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Classes="Small"
|
|
||||||
Value="{Binding CountOfComment}" />
|
|
||||||
</DataTemplate>
|
|
||||||
</TreeDataGrid.Resources>
|
|
||||||
<TreeDataGrid.Styles>
|
|
||||||
<Style Selector="TreeDataGrid TreeDataGridRow:nth-last-child(2n)">
|
|
||||||
<Setter Property="Background" Value="{DynamicResource SemiColorFill0}" />
|
|
||||||
</Style>
|
|
||||||
</TreeDataGrid.Styles>
|
|
||||||
</TreeDataGrid>
|
|
||||||
</TabItem>
|
|
||||||
<TabItem Header="Files">
|
|
||||||
<Grid DataContext="{Binding FilesContext}" RowDefinitions="Auto, *">
|
|
||||||
<DockPanel Margin="0,4" DockPanel.Dock="Top">
|
|
||||||
<ComboBox
|
|
||||||
DockPanel.Dock="Left"
|
|
||||||
ItemsSource="{Binding Drives}"
|
|
||||||
SelectedItem="{Binding SelectedDrive}" />
|
|
||||||
<TextBox
|
|
||||||
Margin="4,0,0,0"
|
|
||||||
VerticalContentAlignment="Center"
|
|
||||||
KeyDown="SelectedPath_KeyDown"
|
|
||||||
Text="{Binding SelectedPath, Mode=OneWay}" />
|
|
||||||
</DockPanel>
|
|
||||||
<TreeDataGrid
|
|
||||||
Name="fileViewer"
|
|
||||||
Grid.Row="1"
|
|
||||||
Source="{Binding Source}">
|
|
||||||
<TreeDataGrid.Resources>
|
|
||||||
|
|
||||||
<!-- Template for Name column cells -->
|
|
||||||
<DataTemplate x:Key="FileNameCell" DataType="vm:FileNodeViewModel">
|
|
||||||
<StackPanel Orientation="Horizontal">
|
|
||||||
<PathIcon
|
|
||||||
Theme="{StaticResource InnerPathIcon}"
|
|
||||||
Margin="8,0">
|
|
||||||
<PathIcon.Data>
|
|
||||||
<MultiBinding Converter="{StaticResource FileIconConverter}">
|
|
||||||
<Binding Path="IsDirectory" />
|
|
||||||
<Binding Path="IsExpanded" />
|
|
||||||
</MultiBinding>
|
|
||||||
</PathIcon.Data>
|
|
||||||
</PathIcon>
|
|
||||||
<TextBlock VerticalAlignment="Center" Text="{Binding Name}" />
|
|
||||||
</StackPanel>
|
|
||||||
</DataTemplate>
|
|
||||||
|
|
||||||
<!-- Edit template for Name column cells -->
|
|
||||||
<DataTemplate x:Key="FileNameEditCell" DataType="vm:FileNodeViewModel">
|
|
||||||
<StackPanel Orientation="Horizontal">
|
|
||||||
<Image Margin="0,0,4,0" VerticalAlignment="Center">
|
|
||||||
<Image.Source>
|
|
||||||
<MultiBinding Converter="{StaticResource FileIconConverter}">
|
|
||||||
<Binding Path="IsDirectory" />
|
|
||||||
<Binding Path="IsExpanded" />
|
|
||||||
</MultiBinding>
|
|
||||||
</Image.Source>
|
|
||||||
</Image>
|
|
||||||
<TextBox
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Classes="Small"
|
|
||||||
Text="{Binding Name}">
|
|
||||||
<TextBox.Styles>
|
|
||||||
<Style Selector="DataValidationErrors">
|
|
||||||
<Setter Property="Theme" Value="{DynamicResource TooltipDataValidationErrors}" />
|
|
||||||
</Style>
|
|
||||||
</TextBox.Styles>
|
|
||||||
</TextBox>
|
|
||||||
</StackPanel>
|
|
||||||
</DataTemplate>
|
|
||||||
</TreeDataGrid.Resources>
|
|
||||||
<TreeDataGrid.Styles>
|
|
||||||
<Style Selector="TreeDataGrid TreeDataGridRow:nth-child(2n)">
|
|
||||||
<Setter Property="Background" Value="{DynamicResource SemiColorFill0}" />
|
|
||||||
</Style>
|
|
||||||
</TreeDataGrid.Styles>
|
|
||||||
</TreeDataGrid>
|
|
||||||
</Grid>
|
|
||||||
</TabItem>
|
|
||||||
</TabControl>
|
|
||||||
</UserControl>
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
using Avalonia.Controls;
|
|
||||||
using Avalonia.Input;
|
|
||||||
using Semi.Avalonia.Demo.ViewModels;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
|
||||||
|
|
||||||
public partial class TreeDataGridDemo : UserControl
|
|
||||||
{
|
|
||||||
public TreeDataGridDemo()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
this.DataContext = new TreeDataGridDemoViewModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void SelectedPath_KeyDown(object? sender, KeyEventArgs e)
|
|
||||||
{
|
|
||||||
if (e.Key == Key.Enter && DataContext is TreeDataGridDemoViewModel vm)
|
|
||||||
{
|
|
||||||
vm.FilesContext.SelectedPath = (sender as TextBox)?.Text;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,104 +0,0 @@
|
|||||||
<UserControl 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:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels"
|
|
||||||
xmlns:pages="clr-namespace:Semi.Avalonia.Demo.Pages"
|
|
||||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
|
||||||
x:Class="Semi.Avalonia.Demo.Pages.VariablesDemo"
|
|
||||||
x:DataType="vm:VariablesDemoViewModel">
|
|
||||||
<Design.DataContext>
|
|
||||||
<vm:VariablesDemoViewModel />
|
|
||||||
</Design.DataContext>
|
|
||||||
<Grid RowDefinitions="Auto, *">
|
|
||||||
<TextBox
|
|
||||||
Grid.Row="0"
|
|
||||||
Width="600"
|
|
||||||
Margin="8"
|
|
||||||
Classes="ClearButton"
|
|
||||||
Text="{Binding SearchText}"
|
|
||||||
Watermark="Input Variable Category/ResourceKey/Type/Value/Description" />
|
|
||||||
|
|
||||||
<DataGrid
|
|
||||||
Grid.Row="1"
|
|
||||||
Margin="8"
|
|
||||||
CanUserReorderColumns="True"
|
|
||||||
CanUserResizeColumns="True"
|
|
||||||
CanUserSortColumns="True"
|
|
||||||
HeadersVisibility="All"
|
|
||||||
IsReadOnly="True"
|
|
||||||
ItemsSource="{Binding GridData}">
|
|
||||||
<DataGrid.Columns>
|
|
||||||
<DataGridTemplateColumn
|
|
||||||
Width="300"
|
|
||||||
x:DataType="vm:VariableItem"
|
|
||||||
Header="ResourceKey">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate DataType="vm:VariableItem">
|
|
||||||
<SelectableTextBlock
|
|
||||||
Margin="12,0"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Text="{Binding ResourceKey}" />
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
<DataGridTemplateColumn
|
|
||||||
Width="200"
|
|
||||||
x:DataType="vm:VariableItem"
|
|
||||||
Header="Type">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate DataType="vm:VariableItem">
|
|
||||||
<SelectableTextBlock
|
|
||||||
Margin="12,0"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Text="{Binding Type.Name}" />
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
<DataGridTemplateColumn
|
|
||||||
Width="200"
|
|
||||||
x:DataType="vm:VariableItem"
|
|
||||||
Header="Value">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate DataType="vm:VariableItem">
|
|
||||||
<SelectableTextBlock
|
|
||||||
Margin="12,0"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Text="{Binding Value}"
|
|
||||||
TextWrapping="Wrap" />
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
<DataGridTemplateColumn
|
|
||||||
Width="*"
|
|
||||||
x:DataType="vm:VariableItem"
|
|
||||||
Header="Description">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate DataType="vm:VariableItem">
|
|
||||||
<SelectableTextBlock
|
|
||||||
Margin="12,0"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Text="{Binding Description}"
|
|
||||||
TextWrapping="Wrap" />
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
<DataGridTemplateColumn
|
|
||||||
Width="100"
|
|
||||||
x:DataType="vm:VariableItem"
|
|
||||||
Header="CopyText"
|
|
||||||
SortMemberPath="Duration">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate DataType="vm:VariableItem">
|
|
||||||
<Button
|
|
||||||
Command="{Binding $parent[pages:VariablesDemo].Copy}"
|
|
||||||
CommandParameter="{Binding CopyText}"
|
|
||||||
Theme="{DynamicResource IconBorderlessButton}"
|
|
||||||
Content="{StaticResource SemiIconCopy}" />
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
</DataGrid.Columns>
|
|
||||||
</DataGrid>
|
|
||||||
</Grid>
|
|
||||||
</UserControl>
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
using System.Threading.Tasks;
|
|
||||||
using Avalonia.Controls;
|
|
||||||
using Semi.Avalonia.Demo.ViewModels;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
|
||||||
|
|
||||||
public partial class VariablesDemo : UserControl
|
|
||||||
{
|
|
||||||
public VariablesDemo()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
this.DataContext = new VariablesDemoViewModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task Copy(object? o)
|
|
||||||
{
|
|
||||||
if (o is null) return;
|
|
||||||
var toplevel = TopLevel.GetTopLevel(this);
|
|
||||||
if (toplevel?.Clipboard is { } c)
|
|
||||||
{
|
|
||||||
await c.SetTextAsync(o.ToString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -13,20 +13,23 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Avalonia"/>
|
<PackageReference Include="Avalonia"/>
|
||||||
<PackageReference Include="Avalonia.Controls.ColorPicker"/>
|
<PackageReference Include="Avalonia.Controls.ColorPicker"/>
|
||||||
<PackageReference Include="Avalonia.Controls.DataGrid"/>
|
<!-- <PackageReference Include="Avalonia.Controls.DataGrid"/>-->
|
||||||
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
|
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
|
||||||
<PackageReference Include="Avalonia.Diagnostics">
|
<!-- <PackageReference Include="Avalonia.Diagnostics">-->
|
||||||
<IncludeAssets Condition="'$(Configuration)' != 'Debug'">None</IncludeAssets>
|
<!-- <IncludeAssets Condition="'$(Configuration)' != 'Debug'">None</IncludeAssets>-->
|
||||||
<PrivateAssets Condition="'$(Configuration)' != 'Debug'">All</PrivateAssets>
|
<!-- <PrivateAssets Condition="'$(Configuration)' != 'Debug'">All</PrivateAssets>-->
|
||||||
</PackageReference>
|
<!-- </PackageReference>-->
|
||||||
<PackageReference Include="CommunityToolkit.Mvvm"/>
|
<PackageReference Include="CommunityToolkit.Mvvm"/>
|
||||||
<PackageReference Include="Irihi.Avalonia.Shared"/>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\..\src\Semi.Avalonia\Semi.Avalonia.csproj"/>
|
<ProjectReference Include="..\..\src\Semi.Avalonia\Semi.Avalonia.csproj"/>
|
||||||
<ProjectReference Include="..\..\src\Semi.Avalonia.ColorPicker\Semi.Avalonia.ColorPicker.csproj"/>
|
<ProjectReference Include="..\..\src\Semi.Avalonia.ColorPicker\Semi.Avalonia.ColorPicker.csproj"/>
|
||||||
<ProjectReference Include="..\..\src\Semi.Avalonia.DataGrid\Semi.Avalonia.DataGrid.csproj"/>
|
<!-- <ProjectReference Include="..\..\src\Semi.Avalonia.DataGrid\Semi.Avalonia.DataGrid.csproj"/>-->
|
||||||
<ProjectReference Include="..\..\src\Semi.Avalonia.TreeDataGrid\Semi.Avalonia.TreeDataGrid.csproj"/>
|
<!-- <ProjectReference Include="..\..\src\Semi.Avalonia.TreeDataGrid\Semi.Avalonia.TreeDataGrid.csproj"/>-->
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<AvaloniaXaml Remove="Pages\VariablesDemo.axaml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -1,152 +0,0 @@
|
|||||||
<ResourceDictionary
|
|
||||||
xmlns="https://github.com/avaloniaui"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:controls="clr-namespace:Semi.Avalonia.Demo.Controls"
|
|
||||||
xmlns:viewModels="clr-namespace:Semi.Avalonia.Demo.ViewModels"
|
|
||||||
xmlns:pages="clr-namespace:Semi.Avalonia.Demo.Pages"
|
|
||||||
x:DataType="viewModels:FunctionalColorGroupViewModel">
|
|
||||||
<ControlTheme x:Key="{x:Type controls:FunctionalColorGroupControl}" TargetType="controls:FunctionalColorGroupControl">
|
|
||||||
<Setter Property="Template">
|
|
||||||
<ControlTemplate TargetType="controls:FunctionalColorGroupControl">
|
|
||||||
<Grid RowDefinitions="Auto, *">
|
|
||||||
<SelectableTextBlock
|
|
||||||
Grid.Row="0"
|
|
||||||
Margin="0,16,0,0"
|
|
||||||
Classes="H3"
|
|
||||||
Text="{TemplateBinding Title}"
|
|
||||||
Theme="{DynamicResource TitleSelectableTextBlock}" />
|
|
||||||
<TabControl Grid.Row="1">
|
|
||||||
<TabItem Header="Light">
|
|
||||||
<DataGrid IsReadOnly="True" ItemsSource="{TemplateBinding LightColors}">
|
|
||||||
<DataGrid.Columns>
|
|
||||||
<DataGridTemplateColumn Width="70" Header="Color">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate DataType="viewModels:ColorItemViewModel">
|
|
||||||
<controls:ColorItemControl
|
|
||||||
Width="40"
|
|
||||||
Height="20"
|
|
||||||
Background="{Binding Brush}"
|
|
||||||
CornerRadius="3" />
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
<DataGridTemplateColumn Width="300" Header="ResourceKey">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate DataType="viewModels:ColorItemViewModel">
|
|
||||||
<SelectableTextBlock
|
|
||||||
Margin="12,0"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Text="{Binding ResourceKey}" />
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
<DataGridTemplateColumn Width="100" Header="Hex">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate DataType="viewModels:ColorItemViewModel">
|
|
||||||
<SelectableTextBlock
|
|
||||||
Margin="12,0"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Text="{Binding Hex}" />
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
<DataGridTemplateColumn Width="80" Header="Opacity">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate DataType="viewModels:ColorItemViewModel">
|
|
||||||
<SelectableTextBlock
|
|
||||||
Margin="12,0"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Text="{Binding Brush.Opacity}" />
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
<DataGridTextColumn
|
|
||||||
Width="*"
|
|
||||||
x:DataType="viewModels:ColorItemViewModel"
|
|
||||||
Binding="{Binding ColorDisplayName}"
|
|
||||||
CanUserSort="False"
|
|
||||||
Header="Description" />
|
|
||||||
<DataGridTemplateColumn Width="100" Header="CopyText">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate DataType="viewModels:ColorItemViewModel">
|
|
||||||
<Button
|
|
||||||
Command="{Binding $parent[pages:PaletteDemo].Copy}"
|
|
||||||
CommandParameter="{Binding CopyText}"
|
|
||||||
Theme="{DynamicResource IconBorderlessButton}"
|
|
||||||
Content="{StaticResource SemiIconCopy}" />
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
</DataGrid.Columns>
|
|
||||||
</DataGrid>
|
|
||||||
</TabItem>
|
|
||||||
<TabItem Header="Dark">
|
|
||||||
<DataGrid IsReadOnly="True" ItemsSource="{TemplateBinding DarkColors}">
|
|
||||||
<DataGrid.Columns>
|
|
||||||
<DataGridTemplateColumn Width="70" Header="Color">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate DataType="viewModels:ColorItemViewModel">
|
|
||||||
<controls:ColorItemControl
|
|
||||||
Width="40"
|
|
||||||
Height="20"
|
|
||||||
Background="{Binding Brush}"
|
|
||||||
CornerRadius="3" />
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
<DataGridTemplateColumn Width="300" Header="ResourceKey">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate DataType="viewModels:ColorItemViewModel">
|
|
||||||
<SelectableTextBlock
|
|
||||||
Margin="12,0"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Text="{Binding ResourceKey}" />
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
<DataGridTemplateColumn Width="100" Header="Hex">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate DataType="viewModels:ColorItemViewModel">
|
|
||||||
<SelectableTextBlock
|
|
||||||
Margin="12,0"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Text="{Binding Hex}" />
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
<DataGridTemplateColumn Width="80" Header="Opacity">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate DataType="viewModels:ColorItemViewModel">
|
|
||||||
<SelectableTextBlock
|
|
||||||
Margin="12,0"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Text="{Binding Brush.Opacity}" />
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
<DataGridTextColumn
|
|
||||||
Width="*"
|
|
||||||
x:DataType="viewModels:ColorItemViewModel"
|
|
||||||
Binding="{Binding ColorDisplayName}"
|
|
||||||
CanUserSort="False"
|
|
||||||
Header="Description" />
|
|
||||||
<DataGridTemplateColumn Width="100" Header="CopyText">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate DataType="viewModels:ColorItemViewModel">
|
|
||||||
<Button
|
|
||||||
Command="{Binding $parent[pages:PaletteDemo].Copy}"
|
|
||||||
CommandParameter="{Binding CopyText}"
|
|
||||||
Theme="{DynamicResource IconBorderlessButton}"
|
|
||||||
Content="{StaticResource SemiIconCopy}" />
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
</DataGrid.Columns>
|
|
||||||
</DataGrid>
|
|
||||||
</TabItem>
|
|
||||||
</TabControl>
|
|
||||||
</Grid>
|
|
||||||
</ControlTemplate>
|
|
||||||
</Setter>
|
|
||||||
</ControlTheme>
|
|
||||||
</ResourceDictionary>
|
|
||||||
@@ -1,110 +0,0 @@
|
|||||||
<ResourceDictionary
|
|
||||||
xmlns="https://github.com/avaloniaui"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:controls="clr-namespace:Semi.Avalonia.Demo.Controls"
|
|
||||||
xmlns:viewModels="clr-namespace:Semi.Avalonia.Demo.ViewModels"
|
|
||||||
xmlns:pages="clr-namespace:Semi.Avalonia.Demo.Pages"
|
|
||||||
x:DataType="viewModels:ShadowGroupViewModel">
|
|
||||||
<ControlTheme x:Key="{x:Type controls:ShadowGroupControl}" TargetType="controls:ShadowGroupControl">
|
|
||||||
<Setter Property="Template">
|
|
||||||
<ControlTemplate TargetType="controls:ShadowGroupControl">
|
|
||||||
<Grid RowDefinitions="Auto, *">
|
|
||||||
<SelectableTextBlock
|
|
||||||
Grid.Row="0"
|
|
||||||
Margin="0,16,0,0"
|
|
||||||
Classes="H3"
|
|
||||||
Text="{TemplateBinding Title}"
|
|
||||||
Theme="{DynamicResource TitleSelectableTextBlock}" />
|
|
||||||
<TabControl Grid.Row="1">
|
|
||||||
<TabItem Header="Light">
|
|
||||||
<DataGrid IsReadOnly="True" ItemsSource="{TemplateBinding LightShadows}">
|
|
||||||
<DataGrid.Columns>
|
|
||||||
<DataGridTemplateColumn Width="300" Header="ResourceKey">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate DataType="viewModels:ShadowItemViewModel">
|
|
||||||
<SelectableTextBlock
|
|
||||||
Margin="12,0"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Text="{Binding ResourceKey}" />
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
<DataGridTemplateColumn Width="300" Header="BoxShadows">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate DataType="viewModels:ShadowItemViewModel">
|
|
||||||
<SelectableTextBlock
|
|
||||||
Margin="12,0"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Text="{Binding BoxShadowValue}" />
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
<DataGridTextColumn
|
|
||||||
Width="*"
|
|
||||||
x:DataType="viewModels:ShadowItemViewModel"
|
|
||||||
Binding="{Binding ShadowDisplayName}"
|
|
||||||
CanUserSort="False"
|
|
||||||
Header="Description" />
|
|
||||||
<DataGridTemplateColumn Width="100" Header="CopyText">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate DataType="viewModels:ShadowItemViewModel">
|
|
||||||
<Button
|
|
||||||
Command="{Binding $parent[pages:PaletteDemo].Copy}"
|
|
||||||
CommandParameter="{Binding CopyText}"
|
|
||||||
Theme="{DynamicResource IconBorderlessButton}"
|
|
||||||
Content="{StaticResource SemiIconCopy}" />
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
</DataGrid.Columns>
|
|
||||||
</DataGrid>
|
|
||||||
</TabItem>
|
|
||||||
<TabItem Header="Dark">
|
|
||||||
<DataGrid IsReadOnly="True" ItemsSource="{TemplateBinding DarkShadows}">
|
|
||||||
<DataGrid.Columns>
|
|
||||||
<DataGridTemplateColumn Width="300" Header="ResourceKey">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate DataType="viewModels:ShadowItemViewModel">
|
|
||||||
<SelectableTextBlock
|
|
||||||
Margin="12,0"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Text="{Binding ResourceKey}" />
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
<DataGridTemplateColumn Width="300" Header="BoxShadows">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate DataType="viewModels:ShadowItemViewModel">
|
|
||||||
<SelectableTextBlock
|
|
||||||
Margin="12,0"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Text="{Binding BoxShadowValue}" />
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
<DataGridTextColumn
|
|
||||||
Width="*"
|
|
||||||
x:DataType="viewModels:ShadowItemViewModel"
|
|
||||||
Binding="{Binding ShadowDisplayName}"
|
|
||||||
CanUserSort="False"
|
|
||||||
Header="Description" />
|
|
||||||
<DataGridTemplateColumn Width="100" Header="CopyText">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate DataType="viewModels:ShadowItemViewModel">
|
|
||||||
<Button
|
|
||||||
Command="{Binding $parent[pages:PaletteDemo].Copy}"
|
|
||||||
CommandParameter="{Binding CopyText}"
|
|
||||||
Theme="{DynamicResource IconBorderlessButton}"
|
|
||||||
Content="{StaticResource SemiIconCopy}" />
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
</DataGrid.Columns>
|
|
||||||
</DataGrid>
|
|
||||||
</TabItem>
|
|
||||||
</TabControl>
|
|
||||||
</Grid>
|
|
||||||
</ControlTemplate>
|
|
||||||
</Setter>
|
|
||||||
</ControlTheme>
|
|
||||||
</ResourceDictionary>
|
|
||||||
@@ -2,8 +2,6 @@
|
|||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
<ResourceInclude Source="ColorDetailControl.axaml" />
|
<ResourceInclude Source="ColorDetailControl.axaml" />
|
||||||
<ResourceInclude Source="ColorItemControl.axaml" />
|
<ResourceInclude Source="ColorItemControl.axaml" />
|
||||||
<ResourceInclude Source="FunctionalColorGroupControl.axaml" />
|
|
||||||
<ResourceInclude Source="ShadowGroupControl.axaml" />
|
|
||||||
<ResourceInclude Source="ToggleSwitch.axaml" />
|
<ResourceInclude Source="ToggleSwitch.axaml" />
|
||||||
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary.MergedDictionaries>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
@@ -1,154 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Collections.ObjectModel;
|
|
||||||
using System.Linq;
|
|
||||||
using Avalonia.Collections;
|
|
||||||
using CommunityToolkit.Mvvm.ComponentModel;
|
|
||||||
using CommunityToolkit.Mvvm.Input;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.ViewModels;
|
|
||||||
|
|
||||||
public class DataGridDemoViewModel : ObservableObject
|
|
||||||
{
|
|
||||||
public ObservableCollection<Song> GridData1 { get; set; }
|
|
||||||
|
|
||||||
public DataGridCollectionView GridData2 { get; set; }
|
|
||||||
|
|
||||||
public ObservableCollection<SongViewModel> GridData3 { get; set; }
|
|
||||||
|
|
||||||
public RelayCommand AddCommand { get; set; }
|
|
||||||
|
|
||||||
public DataGridDemoViewModel()
|
|
||||||
{
|
|
||||||
GridData1 = new ObservableCollection<Song>(Song.Songs);
|
|
||||||
GridData2 = new DataGridCollectionView(Song.Songs);
|
|
||||||
GridData2.GroupDescriptions.Add(new DataGridPathGroupDescription("Album"));
|
|
||||||
GridData3 = new ObservableCollection<SongViewModel>(Song.Songs.Take(10).Select(a => new SongViewModel()
|
|
||||||
{
|
|
||||||
Title = a.Title,
|
|
||||||
Artist = a.Artist,
|
|
||||||
Album = a.Album,
|
|
||||||
CountOfComment = a.CountOfComment,
|
|
||||||
IsSelected = false
|
|
||||||
}));
|
|
||||||
AddCommand = new RelayCommand(Add);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Add()
|
|
||||||
{
|
|
||||||
GridData3.Add(new SongViewModel());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Song
|
|
||||||
{
|
|
||||||
public string? Title { get; set; }
|
|
||||||
public string? Artist { get; set; }
|
|
||||||
public TimeSpan? Duration { get; set; }
|
|
||||||
public string? Album { get; set; }
|
|
||||||
public int CountOfComment { get; set; }
|
|
||||||
public string Url { get; set; }
|
|
||||||
|
|
||||||
public Song(string title, string artist, int m, int s, string album, int countOfComment, int netEaseId)
|
|
||||||
{
|
|
||||||
Title = title;
|
|
||||||
Artist = artist;
|
|
||||||
Duration = new TimeSpan(0, m, s);
|
|
||||||
Album = album;
|
|
||||||
CountOfComment = countOfComment;
|
|
||||||
Url = $"https://music.163.com/song?id={netEaseId}";
|
|
||||||
}
|
|
||||||
|
|
||||||
public static List<string> Albums =>
|
|
||||||
[
|
|
||||||
"A.S.I.A",
|
|
||||||
"饕餮人间",
|
|
||||||
"七步咙咚呛",
|
|
||||||
"大惊小怪",
|
|
||||||
"The ONE",
|
|
||||||
"以梦为马 (壮志骄阳版)",
|
|
||||||
"emo了",
|
|
||||||
"一眼万年",
|
|
||||||
"冲刺吧",
|
|
||||||
"爱的赏味期限",
|
|
||||||
"COSMIC ANTHEM / 手紙",
|
|
||||||
"世界晚安",
|
|
||||||
"明年也要好好长大",
|
|
||||||
"320万年前",
|
|
||||||
"W.O.R.L.D."
|
|
||||||
];
|
|
||||||
|
|
||||||
public static List<Song> Songs =>
|
|
||||||
[
|
|
||||||
new("好肚有肚(feat.李玲玉)", "熊猫堂ProducePandas", 2, 50, "A.S.I.A", 730, 1487039339),
|
|
||||||
new("荒诞秀", "熊猫堂ProducePandas", 3, 15, "A.S.I.A", 639, 1487037601),
|
|
||||||
new("长大", "熊猫堂ProducePandas", 4, 6, "A.S.I.A", 1114, 1487037690),
|
|
||||||
new("招财猫(feat.纪粹希(G-Tracy))", "熊猫堂ProducePandas", 3, 37, "A.S.I.A", 361, 1487039632),
|
|
||||||
new("千转", "熊猫堂ProducePandas", 4, 0, "A.S.I.A", 1115, 1477312398),
|
|
||||||
new("辣辣辣", "熊猫堂ProducePandas", 3, 24, "A.S.I.A", 1873, 1465043716),
|
|
||||||
new("碎碎念", "熊猫堂ProducePandas", 3, 25, "A.S.I.A", 676, 1474142064),
|
|
||||||
new("盘他", "熊猫堂ProducePandas", 2, 16, "A.S.I.A", 365, 1481652786),
|
|
||||||
new("Na Na Na", "熊猫堂ProducePandas", 3, 26, "A.S.I.A", 312, 1469022662),
|
|
||||||
new("Indigo", "熊猫堂ProducePandas", 3, 15, "A.S.I.A", 137, 1487039517),
|
|
||||||
new("饕餮人间", "熊猫堂ProducePandas", 3, 20, "饕餮人间", 1295, 1499584605),
|
|
||||||
new("七步咙咚呛", "熊猫堂ProducePandas", 3, 10, "七步咙咚呛", 175, 1809095152),
|
|
||||||
new("大惊小怪", "熊猫堂ProducePandas", 3, 32, "大惊小怪", 10420, 1847477425),
|
|
||||||
new("工具人", "熊猫堂ProducePandas", 2, 46, "大惊小怪", 1135, 1847476499),
|
|
||||||
new("以梦为马", "熊猫堂ProducePandas", 4, 19, "大惊小怪", 18361, 1836034373),
|
|
||||||
new("以梦为马(Piano Version)", "熊猫堂ProducePandas", 3, 4, "大惊小怪", 570, 1847477423),
|
|
||||||
new("The ONE", "熊猫堂ProducePandas", 2, 58, "The ONE", 1508, 1864329424),
|
|
||||||
new("The ONE(日文版)", "熊猫堂ProducePandas", 2, 57, "The ONE", 385, 1864329429),
|
|
||||||
new("以梦为马 (壮志骄阳版)", "熊猫堂ProducePandas", 4, 19, "以梦为马 (壮志骄阳版)", 161, 1865138896),
|
|
||||||
new("New Horse", "熊猫堂ProducePandas", 2, 30, "emo了", 643, 1887021307),
|
|
||||||
new("不例外", "熊猫堂ProducePandas", 3, 31, "emo了", 1818, 1887022665),
|
|
||||||
new("满意", "熊猫堂ProducePandas", 4, 32, "emo了", 1081, 1882433472),
|
|
||||||
new("就算与全世界为敌也要跟你在一起", "熊猫堂ProducePandas", 3, 32, "emo了", 2119, 1881759960),
|
|
||||||
new("The ONE", "熊猫堂ProducePandas", 2, 58, "emo了", 67, 1887022648),
|
|
||||||
new("口香糖", "熊猫堂ProducePandas", 3, 10, "emo了", 2181, 1885502254),
|
|
||||||
new("Suuuuuuper Mario", "熊猫堂ProducePandas", 3, 32, "emo了", 1010, 1887021318),
|
|
||||||
new("饕餮人间", "熊猫堂ProducePandas", 3, 22, "emo了", 109, 1887021320),
|
|
||||||
new("以梦为马 (壮志骄阳版)", "熊猫堂ProducePandas", 4, 21, "emo了", 34, 1887022666),
|
|
||||||
new("The ONE(日文版)", "熊猫堂ProducePandas", 2, 57, "emo了", 27, 1887022646),
|
|
||||||
new("满意(DJheap九天版)", "熊猫堂ProducePandas", 4, 31, "emo了", 31, 1901605941),
|
|
||||||
new("一眼万年", "熊猫堂ProducePandas", 3, 54, "一眼万年", 20, 1922599361),
|
|
||||||
new("冲刺", "熊猫堂ProducePandas", 3, 49, "冲刺吧", 1006, 1932878194),
|
|
||||||
new("滴答滴", "熊猫堂ProducePandas", 2, 30, "爱的赏味期限", 86, 1957515790),
|
|
||||||
new("热带季风", "熊猫堂ProducePandas", 2, 45, "爱的赏味期限", 212, 1957514964),
|
|
||||||
new("渣", "熊猫堂ProducePandas", 3, 28, "爱的赏味期限", 22, 1957514965),
|
|
||||||
new("独特", "熊猫堂ProducePandas", 3, 33, "爱的赏味期限", 62, 1957514966),
|
|
||||||
new("雨后", "熊猫堂ProducePandas", 4, 15, "爱的赏味期限", 23, 1957514967),
|
|
||||||
new("然后然后", "熊猫堂ProducePandas", 3, 50, "爱的赏味期限", 108, 1957514968),
|
|
||||||
new("丢", "熊猫堂ProducePandas", 3, 26, "爱的赏味期限", 30, 1957515792),
|
|
||||||
new("热带疾风(FACEVOID桃心连哥 Remix)", "熊猫堂ProducePandas", 3, 23, "爱的赏味期限", 55, 1957515793),
|
|
||||||
new("COSMIC ANTHEM -Japanese Ver.-", "熊猫堂ProducePandas", 3, 11, "COSMIC ANTHEM / 手紙", 0, 1977171493),
|
|
||||||
new("手紙 (「長大-You Raise Me Up-」-Japanese Ver.-)", "熊猫堂ProducePandas", 4, 11, "COSMIC ANTHEM / 手紙", 0,
|
|
||||||
1977171494),
|
|
||||||
new("COSMIC ANTHEM -Chinese Ver.-", "熊猫堂ProducePandas", 3, 31, "COSMIC ANTHEM / 手紙", 0, 1977172202),
|
|
||||||
new("世界晚安", "熊猫堂ProducePandas", 2, 59, "世界晚安", 652, 1985063377),
|
|
||||||
new("世界晚安(泰文版)", "熊猫堂ProducePandas", 2, 59, "世界晚安", 134, 1987842504),
|
|
||||||
new("世界晚安(钢琴版)", "熊猫堂ProducePandas", 3, 2, "世界晚安", 76, 1990475933),
|
|
||||||
new("世界晚安(泰文钢琴版)", "熊猫堂ProducePandas", 3, 2, "世界晚安", 29, 1990475934),
|
|
||||||
new("世界晚安(DJ沈念版)", "熊猫堂ProducePandas", 3, 9, "世界晚安", 34, 2014263184),
|
|
||||||
new("世界晚安(钢琴配乐)", "熊猫堂ProducePandas", 2, 59, "世界晚安", 11, 2014263185),
|
|
||||||
new("明年也要好好长大", "熊猫堂ProducePandas", 3, 12, "明年也要好好长大", 0, 2010515162),
|
|
||||||
new("320万年前(DJ沈念版)", "熊猫堂ProducePandas", 3, 21, "320万年前", 8, 2055888636),
|
|
||||||
new("320万年前", "熊猫堂ProducePandas", 3, 7, "W.O.R.L.D.", 329, 2049770469),
|
|
||||||
new("隐德来希", "熊猫堂ProducePandas", 3, 3, "W.O.R.L.D.", 594, 2061317924),
|
|
||||||
new("孔明", "熊猫堂ProducePandas", 3, 59, "W.O.R.L.D.", 91, 2063175274),
|
|
||||||
new("锦鲤卟噜噜", "熊猫堂ProducePandas", 3, 5, "W.O.R.L.D.", 67, 2059208262),
|
|
||||||
new("指鹿为马", "熊猫堂ProducePandas", 3, 12, "W.O.R.L.D.", 74, 2063175272),
|
|
||||||
new("热带季风Remix", "熊猫堂ProducePandas", 3, 22, "W.O.R.L.D.", 23, 2063173319),
|
|
||||||
new("加州梦境", "熊猫堂ProducePandas", 2, 56, "W.O.R.L.D.", 1662, 2063173324),
|
|
||||||
new("渐近自由", "熊猫堂ProducePandas", 4, 19, "W.O.R.L.D.", 124, 2063173321),
|
|
||||||
new("世界所有的烂漫", "熊猫堂ProducePandas", 3, 30, "W.O.R.L.D.", 335, 2053388775)
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
public partial class SongViewModel : ObservableObject
|
|
||||||
{
|
|
||||||
[ObservableProperty] private string? _title;
|
|
||||||
[ObservableProperty] private string? _artist;
|
|
||||||
[ObservableProperty] private string? _album;
|
|
||||||
[ObservableProperty] private int _countOfComment;
|
|
||||||
[ObservableProperty] private bool? _isSelected;
|
|
||||||
}
|
|
||||||
@@ -1,363 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Collections.ObjectModel;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using Avalonia.Controls;
|
|
||||||
using Avalonia.Controls.Models.TreeDataGrid;
|
|
||||||
using Avalonia.Controls.Selection;
|
|
||||||
using Avalonia.Threading;
|
|
||||||
using CommunityToolkit.Mvvm.ComponentModel;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.ViewModels;
|
|
||||||
|
|
||||||
public partial class FilesPageViewModel : ObservableObject
|
|
||||||
{
|
|
||||||
public IList<string> Drives { get; }
|
|
||||||
public HierarchicalTreeDataGridSource<FileNodeViewModel> Source { get; }
|
|
||||||
[ObservableProperty] private string _selectedDrive;
|
|
||||||
private string? _selectedPath;
|
|
||||||
[ObservableProperty] private FileNodeViewModel? _root;
|
|
||||||
|
|
||||||
public string? SelectedPath
|
|
||||||
{
|
|
||||||
get => _selectedPath;
|
|
||||||
set => SetSelectedPath(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
partial void OnSelectedDriveChanged(string value)
|
|
||||||
{
|
|
||||||
Root = new FileNodeViewModel(value, true, true);
|
|
||||||
if (Source is not null)
|
|
||||||
{
|
|
||||||
Source.Items = [Root];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public FilesPageViewModel()
|
|
||||||
{
|
|
||||||
Drives = DriveInfo.GetDrives().Select(x => x.Name).ToList();
|
|
||||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
|
||||||
{
|
|
||||||
SelectedDrive = @"C:\";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SelectedDrive = Drives.FirstOrDefault() ?? "/";
|
|
||||||
}
|
|
||||||
|
|
||||||
Source = new HierarchicalTreeDataGridSource<FileNodeViewModel>([])
|
|
||||||
{
|
|
||||||
Columns =
|
|
||||||
{
|
|
||||||
new CheckBoxColumn<FileNodeViewModel>(
|
|
||||||
null,
|
|
||||||
x => x.IsChecked,
|
|
||||||
(o, v) => o.IsChecked = v,
|
|
||||||
options: new CheckBoxColumnOptions<FileNodeViewModel>
|
|
||||||
{
|
|
||||||
CanUserResizeColumn = false,
|
|
||||||
}),
|
|
||||||
new HierarchicalExpanderColumn<FileNodeViewModel>(
|
|
||||||
new TemplateColumn<FileNodeViewModel>(
|
|
||||||
"Name",
|
|
||||||
"FileNameCell",
|
|
||||||
"FileNameEditCell",
|
|
||||||
new GridLength(1, GridUnitType.Star),
|
|
||||||
new TemplateColumnOptions<FileNodeViewModel>
|
|
||||||
{
|
|
||||||
CompareAscending = FileNodeViewModel.SortAscending(vm => vm.Name),
|
|
||||||
CompareDescending = FileNodeViewModel.SortDescending(vm => vm.Name),
|
|
||||||
IsTextSearchEnabled = true,
|
|
||||||
TextSearchValueSelector = vm => vm.Name
|
|
||||||
}),
|
|
||||||
vm => vm.Children,
|
|
||||||
vm => vm.HasChildren,
|
|
||||||
vm => vm.IsExpanded),
|
|
||||||
new TextColumn<FileNodeViewModel, long?>(
|
|
||||||
"Size",
|
|
||||||
vm => vm.Size,
|
|
||||||
options: new TextColumnOptions<FileNodeViewModel>
|
|
||||||
{
|
|
||||||
CompareAscending = FileNodeViewModel.SortAscending(x => x.Size),
|
|
||||||
CompareDescending = FileNodeViewModel.SortDescending(x => x.Size),
|
|
||||||
}),
|
|
||||||
new TextColumn<FileNodeViewModel, DateTimeOffset?>(
|
|
||||||
"Modified",
|
|
||||||
x => x.Modified,
|
|
||||||
options: new TextColumnOptions<FileNodeViewModel>
|
|
||||||
{
|
|
||||||
CompareAscending = FileNodeViewModel.SortAscending(x => x.Modified),
|
|
||||||
CompareDescending = FileNodeViewModel.SortDescending(x => x.Modified),
|
|
||||||
}),
|
|
||||||
}
|
|
||||||
};
|
|
||||||
Source.RowSelection!.SingleSelect = false;
|
|
||||||
Source.RowSelection.SelectionChanged += SelectionChanged;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void SelectionChanged(object? sender, TreeSelectionModelSelectionChangedEventArgs<FileNodeViewModel> e)
|
|
||||||
{
|
|
||||||
var selectedPath = Source.RowSelection?.SelectedItem?.Path;
|
|
||||||
this.SetProperty(ref _selectedPath, selectedPath, nameof(SelectedPath));
|
|
||||||
|
|
||||||
foreach (var i in e.DeselectedItems)
|
|
||||||
Trace.WriteLine($"Deselected '{i?.Path}'");
|
|
||||||
foreach (var i in e.SelectedItems)
|
|
||||||
Trace.WriteLine($"Selected '{i?.Path}'");
|
|
||||||
}
|
|
||||||
private void SetSelectedPath(string? path)
|
|
||||||
{
|
|
||||||
if (string.IsNullOrEmpty(path))
|
|
||||||
{
|
|
||||||
Source.RowSelection!.Clear();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var components = new Stack<string>();
|
|
||||||
DirectoryInfo? d = null;
|
|
||||||
|
|
||||||
if (File.Exists(path))
|
|
||||||
{
|
|
||||||
var f = new FileInfo(path);
|
|
||||||
components.Push(f.Name);
|
|
||||||
d = f.Directory;
|
|
||||||
}
|
|
||||||
else if (Directory.Exists(path))
|
|
||||||
{
|
|
||||||
d = new DirectoryInfo(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
while (d is not null)
|
|
||||||
{
|
|
||||||
components.Push(d.Name);
|
|
||||||
d = d.Parent;
|
|
||||||
}
|
|
||||||
|
|
||||||
var index = IndexPath.Unselected;
|
|
||||||
|
|
||||||
if (components.Count > 0)
|
|
||||||
{
|
|
||||||
var drive = components.Pop();
|
|
||||||
var driveIndex = Drives.FindIndex(x => string.Equals(x, drive, StringComparison.OrdinalIgnoreCase));
|
|
||||||
|
|
||||||
if (driveIndex >= 0)
|
|
||||||
SelectedDrive = Drives[driveIndex];
|
|
||||||
|
|
||||||
var node = Root;
|
|
||||||
index = new IndexPath(0);
|
|
||||||
|
|
||||||
while (node is not null && components.Count > 0)
|
|
||||||
{
|
|
||||||
node.IsExpanded = true;
|
|
||||||
|
|
||||||
var component = components.Pop();
|
|
||||||
var i = node.Children.FindIndex(x => string.Equals(x.Name, component, StringComparison.OrdinalIgnoreCase));
|
|
||||||
node = i >= 0 ? node.Children[i] : null;
|
|
||||||
index = i >= 0 ? index.Append(i) : default;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Source.Items = [Root!];
|
|
||||||
Source.RowSelection!.SelectedIndex = index;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public partial class FileNodeViewModel : ObservableObject, IEditableObject
|
|
||||||
{
|
|
||||||
[ObservableProperty] private string _path;
|
|
||||||
[ObservableProperty] private string _name;
|
|
||||||
private string? _undoName;
|
|
||||||
[ObservableProperty] private long? _size;
|
|
||||||
[ObservableProperty] private DateTimeOffset? _modified;
|
|
||||||
private FileSystemWatcher? _watcher;
|
|
||||||
private ObservableCollection<FileNodeViewModel>? _children;
|
|
||||||
[ObservableProperty] private bool _hasChildren = true;
|
|
||||||
[ObservableProperty] private bool _isExpanded;
|
|
||||||
|
|
||||||
public FileNodeViewModel(string path, bool isDirectory, bool isRoot = false)
|
|
||||||
{
|
|
||||||
Path = path;
|
|
||||||
Name = isRoot ? path : System.IO.Path.GetFileName(Path);
|
|
||||||
IsExpanded = isRoot;
|
|
||||||
IsDirectory = isDirectory;
|
|
||||||
HasChildren = isDirectory;
|
|
||||||
|
|
||||||
if (!isDirectory)
|
|
||||||
{
|
|
||||||
var info = new FileInfo(path);
|
|
||||||
Size = info.Length;
|
|
||||||
Modified = info.LastWriteTimeUtc;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool IsChecked { get; set; }
|
|
||||||
public bool IsDirectory { get; }
|
|
||||||
public IReadOnlyList<FileNodeViewModel> Children => _children ??= LoadChildren();
|
|
||||||
|
|
||||||
private ObservableCollection<FileNodeViewModel> LoadChildren()
|
|
||||||
{
|
|
||||||
if (!IsDirectory)
|
|
||||||
{
|
|
||||||
throw new NotSupportedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
var options = new EnumerationOptions { IgnoreInaccessible = true };
|
|
||||||
var result = new ObservableCollection<FileNodeViewModel>();
|
|
||||||
|
|
||||||
foreach (var d in Directory.EnumerateDirectories(Path, "*", options))
|
|
||||||
{
|
|
||||||
result.Add(new FileNodeViewModel(d, true));
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var f in Directory.EnumerateFiles(Path, "*", options))
|
|
||||||
{
|
|
||||||
result.Add(new FileNodeViewModel(f, false));
|
|
||||||
}
|
|
||||||
|
|
||||||
_watcher = new FileSystemWatcher
|
|
||||||
{
|
|
||||||
Path = Path,
|
|
||||||
NotifyFilter = NotifyFilters.FileName | NotifyFilters.Size | NotifyFilters.LastWrite,
|
|
||||||
};
|
|
||||||
|
|
||||||
_watcher.Changed += OnChanged;
|
|
||||||
_watcher.Created += OnCreated;
|
|
||||||
_watcher.Deleted += OnDeleted;
|
|
||||||
_watcher.Renamed += OnRenamed;
|
|
||||||
_watcher.EnableRaisingEvents = true;
|
|
||||||
|
|
||||||
if (result.Count == 0)
|
|
||||||
HasChildren = false;
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Comparison<FileNodeViewModel?> SortAscending<T>(Func<FileNodeViewModel, T> selector)
|
|
||||||
{
|
|
||||||
return (x, y) =>
|
|
||||||
{
|
|
||||||
if (x is null && y is null)
|
|
||||||
return 0;
|
|
||||||
else if (x is null)
|
|
||||||
return -1;
|
|
||||||
else if (y is null)
|
|
||||||
return 1;
|
|
||||||
if (x.IsDirectory == y.IsDirectory)
|
|
||||||
return Comparer<T>.Default.Compare(selector(x), selector(y));
|
|
||||||
else if (x.IsDirectory)
|
|
||||||
return -1;
|
|
||||||
else
|
|
||||||
return 1;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Comparison<FileNodeViewModel?> SortDescending<T>(Func<FileNodeViewModel, T> selector)
|
|
||||||
{
|
|
||||||
return (x, y) =>
|
|
||||||
{
|
|
||||||
if (x is null && y is null)
|
|
||||||
return 0;
|
|
||||||
else if (x is null)
|
|
||||||
return 1;
|
|
||||||
else if (y is null)
|
|
||||||
return -1;
|
|
||||||
if (x.IsDirectory == y.IsDirectory)
|
|
||||||
return Comparer<T>.Default.Compare(selector(y), selector(x));
|
|
||||||
else if (x.IsDirectory)
|
|
||||||
return -1;
|
|
||||||
else
|
|
||||||
return 1;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
void IEditableObject.BeginEdit() => _undoName = Name;
|
|
||||||
void IEditableObject.CancelEdit() => Name = _undoName ?? string.Empty;
|
|
||||||
void IEditableObject.EndEdit() => _undoName = null;
|
|
||||||
|
|
||||||
private void OnChanged(object sender, FileSystemEventArgs e)
|
|
||||||
{
|
|
||||||
if (e.ChangeType == WatcherChangeTypes.Changed && File.Exists(e.FullPath))
|
|
||||||
{
|
|
||||||
Dispatcher.UIThread.Post(() =>
|
|
||||||
{
|
|
||||||
foreach (var child in _children!)
|
|
||||||
{
|
|
||||||
if (child.Path == e.FullPath)
|
|
||||||
{
|
|
||||||
if (!child.IsDirectory)
|
|
||||||
{
|
|
||||||
var info = new FileInfo(e.FullPath);
|
|
||||||
child.Size = info.Length;
|
|
||||||
child.Modified = info.LastWriteTimeUtc;
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnCreated(object sender, FileSystemEventArgs e)
|
|
||||||
{
|
|
||||||
Dispatcher.UIThread.Post(() =>
|
|
||||||
{
|
|
||||||
var node = new FileNodeViewModel(
|
|
||||||
e.FullPath,
|
|
||||||
File.GetAttributes(e.FullPath).HasFlag(FileAttributes.Directory));
|
|
||||||
_children!.Add(node);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnDeleted(object sender, FileSystemEventArgs e)
|
|
||||||
{
|
|
||||||
Dispatcher.UIThread.Post(() =>
|
|
||||||
{
|
|
||||||
for (var i = 0; i < _children!.Count; ++i)
|
|
||||||
{
|
|
||||||
if (_children[i].Path == e.FullPath)
|
|
||||||
{
|
|
||||||
_children.RemoveAt(i);
|
|
||||||
Debug.WriteLine($"Removed {e.FullPath}");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnRenamed(object sender, RenamedEventArgs e)
|
|
||||||
{
|
|
||||||
Dispatcher.UIThread.Post(() =>
|
|
||||||
{
|
|
||||||
foreach (var child in _children!)
|
|
||||||
{
|
|
||||||
if (child.Path == e.OldFullPath)
|
|
||||||
{
|
|
||||||
child.Path = e.FullPath;
|
|
||||||
child.Name = e.Name ?? string.Empty;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
internal static class ListExtensions
|
|
||||||
{
|
|
||||||
public static int FindIndex<T>(this IEnumerable<T> source, Func<T, bool> predicate)
|
|
||||||
{
|
|
||||||
int i = 0;
|
|
||||||
foreach (var item in source)
|
|
||||||
{
|
|
||||||
if (predicate(item))
|
|
||||||
return i;
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
using System.Collections.ObjectModel;
|
|
||||||
using System.Linq;
|
|
||||||
using Avalonia.Controls;
|
|
||||||
using Avalonia.Controls.Models.TreeDataGrid;
|
|
||||||
using CommunityToolkit.Mvvm.ComponentModel;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.ViewModels;
|
|
||||||
|
|
||||||
public class SongsPageViewModel : ObservableObject
|
|
||||||
{
|
|
||||||
public FlatTreeDataGridSource<SongViewModel> Songs { get; }
|
|
||||||
|
|
||||||
public SongsPageViewModel()
|
|
||||||
{
|
|
||||||
var songs = new ObservableCollection<SongViewModel>(Song.Songs.Select(a => new SongViewModel()
|
|
||||||
{
|
|
||||||
Title = a.Title,
|
|
||||||
Artist = a.Artist,
|
|
||||||
Album = a.Album,
|
|
||||||
CountOfComment = a.CountOfComment,
|
|
||||||
IsSelected = false
|
|
||||||
}));
|
|
||||||
|
|
||||||
Songs = new FlatTreeDataGridSource<SongViewModel>(songs)
|
|
||||||
{
|
|
||||||
Columns =
|
|
||||||
{
|
|
||||||
new CheckBoxColumn<SongViewModel>(
|
|
||||||
"IsSelected",
|
|
||||||
a => a.IsSelected,
|
|
||||||
(model, b) => { model.IsSelected = b; },
|
|
||||||
new GridLength(108, GridUnitType.Pixel)),
|
|
||||||
new TextColumn<SongViewModel, string>(
|
|
||||||
"Title",
|
|
||||||
a => a.Title,
|
|
||||||
(o, a) => o.Title = a,
|
|
||||||
new GridLength(6, GridUnitType.Star)),
|
|
||||||
new TextColumn<SongViewModel, string>("Artist",
|
|
||||||
a => a.Artist,
|
|
||||||
(o, a) => o.Artist = a,
|
|
||||||
new GridLength(6, GridUnitType.Star)),
|
|
||||||
new TemplateColumn<SongViewModel>("Album",
|
|
||||||
"AlbumCell",
|
|
||||||
"AlbumEditCell",
|
|
||||||
new GridLength(6, GridUnitType.Star)),
|
|
||||||
new TemplateColumn<SongViewModel>(
|
|
||||||
"Comments",
|
|
||||||
"CommentsCell",
|
|
||||||
"CommentsEditCell",
|
|
||||||
new GridLength(6, GridUnitType.Star)),
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
using CommunityToolkit.Mvvm.ComponentModel;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.ViewModels;
|
|
||||||
|
|
||||||
public class TreeDataGridDemoViewModel : ObservableObject
|
|
||||||
{
|
|
||||||
public SongsPageViewModel SongsContext { get; } = new();
|
|
||||||
public FilesPageViewModel FilesContext { get; } = new();
|
|
||||||
}
|
|
||||||
@@ -1,151 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Globalization;
|
|
||||||
using Avalonia;
|
|
||||||
using Avalonia.Collections;
|
|
||||||
using Avalonia.Controls;
|
|
||||||
using Avalonia.Media;
|
|
||||||
using CommunityToolkit.Mvvm.ComponentModel;
|
|
||||||
using Semi.Avalonia.Tokens;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.ViewModels;
|
|
||||||
|
|
||||||
public partial class VariablesDemoViewModel : ObservableObject
|
|
||||||
{
|
|
||||||
public DataGridCollectionView GridData { get; set; }
|
|
||||||
[ObservableProperty] private string _searchText = string.Empty;
|
|
||||||
|
|
||||||
public VariablesDemoViewModel()
|
|
||||||
{
|
|
||||||
IResourceDictionary dictionary = new Variables();
|
|
||||||
foreach (var token in Tokens)
|
|
||||||
{
|
|
||||||
if (token.ResourceKey is not null && dictionary.TryGetValue(token.ResourceKey, out var value))
|
|
||||||
{
|
|
||||||
token.Type = value?.GetType();
|
|
||||||
token.Value = GetValueString(value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
GridData = new DataGridCollectionView(Tokens);
|
|
||||||
GridData.GroupDescriptions.Add(new DataGridPathGroupDescription(nameof(VariableItem.Category)));
|
|
||||||
}
|
|
||||||
|
|
||||||
private static string? GetValueString(object? value)
|
|
||||||
{
|
|
||||||
if (value is null) return string.Empty;
|
|
||||||
|
|
||||||
return value switch
|
|
||||||
{
|
|
||||||
double d => d.ToString(CultureInfo.InvariantCulture),
|
|
||||||
CornerRadius c => c.IsUniform ? $"{c.TopLeft}" : c.ToString(),
|
|
||||||
Thickness t => t.IsUniform ? $"{t.Left}" : t.ToString(),
|
|
||||||
FontWeight fontWeight => Convert.ToInt32(fontWeight).ToString(),
|
|
||||||
FontFamily fontFamily => fontFamily.FamilyNames.ToString(),
|
|
||||||
_ => value.ToString()
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
partial void OnSearchTextChanged(string value)
|
|
||||||
{
|
|
||||||
if (string.IsNullOrWhiteSpace(value))
|
|
||||||
{
|
|
||||||
GridData.Filter = _ => true;
|
|
||||||
GridData.Refresh();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var search = value.Trim();
|
|
||||||
GridData.Filter = item =>
|
|
||||||
{
|
|
||||||
if (item is not VariableItem variableItem) return false;
|
|
||||||
return (variableItem.Category?.Contains(search, StringComparison.InvariantCultureIgnoreCase) ?? false) ||
|
|
||||||
(variableItem.ResourceKey?.Contains(search, StringComparison.InvariantCultureIgnoreCase) ?? false) ||
|
|
||||||
(variableItem.Value?.Contains(search, StringComparison.InvariantCultureIgnoreCase) ?? false) ||
|
|
||||||
(variableItem.Type?.Name.Contains(search, StringComparison.InvariantCultureIgnoreCase) ?? false) ||
|
|
||||||
(variableItem.Description?.Contains(search, StringComparison.InvariantCultureIgnoreCase) ?? false);
|
|
||||||
};
|
|
||||||
GridData.Refresh();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static List<VariableItem> Tokens { get; set; } =
|
|
||||||
[
|
|
||||||
new("Height", "SemiHeightControlSmall"),
|
|
||||||
new("Height", "SemiHeightControlDefault"),
|
|
||||||
new("Height", "SemiHeightControlLarge"),
|
|
||||||
new("Icon Size", "SemiWidthIconExtraSmall"),
|
|
||||||
new("Icon Size", "SemiWidthIconSmall"),
|
|
||||||
new("Icon Size", "SemiWidthIconMedium"),
|
|
||||||
new("Icon Size", "SemiWidthIconLarge"),
|
|
||||||
new("Icon Size", "SemiWidthIconExtraLarge"),
|
|
||||||
new("Border CornerRadius Spacing", "SemiBorderRadiusSpacingExtraSmall"),
|
|
||||||
new("Border CornerRadius Spacing", "SemiBorderRadiusSpacingSmall"),
|
|
||||||
new("Border CornerRadius Spacing", "SemiBorderRadiusSpacingMedium"),
|
|
||||||
new("Border CornerRadius Spacing", "SemiBorderRadiusSpacingLarge"),
|
|
||||||
new("Border CornerRadius Spacing", "SemiBorderRadiusSpacingFull"),
|
|
||||||
new("Border CornerRadius", "SemiBorderRadiusExtraSmall"),
|
|
||||||
new("Border CornerRadius", "SemiBorderRadiusSmall"),
|
|
||||||
new("Border CornerRadius", "SemiBorderRadiusMedium"),
|
|
||||||
new("Border CornerRadius", "SemiBorderRadiusLarge"),
|
|
||||||
new("Border CornerRadius", "SemiBorderRadiusFull"),
|
|
||||||
new("Border Spacing", "SemiBorderSpacing"),
|
|
||||||
new("Border Spacing", "SemiBorderSpacingControl"),
|
|
||||||
new("Border Spacing", "SemiBorderSpacingControlFocus"),
|
|
||||||
new("Border Thickness", "SemiBorderThickness"),
|
|
||||||
new("Border Thickness", "SemiBorderThicknessControl"),
|
|
||||||
new("Border Thickness", "SemiBorderThicknessControlFocus"),
|
|
||||||
new("Spacing", "SemiSpacingNone"),
|
|
||||||
new("Spacing", "SemiSpacingSuperTight"),
|
|
||||||
new("Spacing", "SemiSpacingExtraTight"),
|
|
||||||
new("Spacing", "SemiSpacingTight"),
|
|
||||||
new("Spacing", "SemiSpacingBaseTight"),
|
|
||||||
new("Spacing", "SemiSpacingBase"),
|
|
||||||
new("Spacing", "SemiSpacingBaseLoose"),
|
|
||||||
new("Spacing", "SemiSpacingLoose"),
|
|
||||||
new("Spacing", "SemiSpacingExtraLoose"),
|
|
||||||
new("Spacing", "SemiSpacingSuperLoose"),
|
|
||||||
new("Thickness", "SemiThicknessNone"),
|
|
||||||
new("Thickness", "SemiThicknessSuperTight"),
|
|
||||||
new("Thickness", "SemiThicknessExtraTight"),
|
|
||||||
new("Thickness", "SemiThicknessTight"),
|
|
||||||
new("Thickness", "SemiThicknessBaseTight"),
|
|
||||||
new("Thickness", "SemiThicknessBase"),
|
|
||||||
new("Thickness", "SemiThicknessBaseLoose"),
|
|
||||||
new("Thickness", "SemiThicknessLoose"),
|
|
||||||
new("Thickness", "SemiThicknessExtraLoose"),
|
|
||||||
new("Thickness", "SemiThicknessSuperLoose"),
|
|
||||||
new("FontSize", "SemiFontSizeSmall"),
|
|
||||||
new("FontSize", "SemiFontSizeRegular"),
|
|
||||||
new("FontSize", "SemiFontSizeHeader6"),
|
|
||||||
new("FontSize", "SemiFontSizeHeader5"),
|
|
||||||
new("FontSize", "SemiFontSizeHeader4"),
|
|
||||||
new("FontSize", "SemiFontSizeHeader3"),
|
|
||||||
new("FontSize", "SemiFontSizeHeader2"),
|
|
||||||
new("FontSize", "SemiFontSizeHeader1"),
|
|
||||||
new("FontWeight", "SemiFontWeightLight"),
|
|
||||||
new("FontWeight", "SemiFontWeightRegular"),
|
|
||||||
new("FontWeight", "SemiFontWeightBold"),
|
|
||||||
new("FontFamily", "SemiFontFamilyRegular"),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
public class VariableItem()
|
|
||||||
{
|
|
||||||
public string? Category { get; set; }
|
|
||||||
public string? ResourceKey { get; set; }
|
|
||||||
public Type? Type { get; set; }
|
|
||||||
public string? Value { get; set; }
|
|
||||||
public string? Description { get; set; }
|
|
||||||
|
|
||||||
public VariableItem(string category, string resourceKey, string description = "") : this()
|
|
||||||
{
|
|
||||||
Category = category;
|
|
||||||
ResourceKey = resourceKey;
|
|
||||||
Description = description;
|
|
||||||
}
|
|
||||||
|
|
||||||
public string CopyText =>
|
|
||||||
$"""
|
|
||||||
<StaticResource x:Key="" ResourceKey="{ResourceKey}" />
|
|
||||||
""";
|
|
||||||
}
|
|
||||||
@@ -116,15 +116,15 @@
|
|||||||
<TabItem
|
<TabItem
|
||||||
Theme="{DynamicResource CategoryTabItem}"
|
Theme="{DynamicResource CategoryTabItem}"
|
||||||
Header="Resource Browser" />
|
Header="Resource Browser" />
|
||||||
<TabItem Header="Palette">
|
<!-- <TabItem Header="Palette"> -->
|
||||||
<pages:PaletteDemo />
|
<!-- <pages:PaletteDemo /> -->
|
||||||
</TabItem>
|
<!-- </TabItem> -->
|
||||||
<TabItem Header="HighContrastTheme">
|
<!-- <TabItem Header="HighContrastTheme"> -->
|
||||||
<pages:HighContrastDemo />
|
<!-- <pages:HighContrastDemo /> -->
|
||||||
</TabItem>
|
<!-- </TabItem> -->
|
||||||
<TabItem Header="Variables">
|
<!-- <TabItem Header="Variables"> -->
|
||||||
<pages:VariablesDemo />
|
<!-- <pages:VariablesDemo /> -->
|
||||||
</TabItem>
|
<!-- </TabItem> -->
|
||||||
<TabItem Header="Icon">
|
<TabItem Header="Icon">
|
||||||
<pages:IconDemo />
|
<pages:IconDemo />
|
||||||
</TabItem>
|
</TabItem>
|
||||||
@@ -134,12 +134,12 @@
|
|||||||
<TabItem Header="ColorPicker">
|
<TabItem Header="ColorPicker">
|
||||||
<pages:ColorPickerDemo />
|
<pages:ColorPickerDemo />
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem Header="DataGrid">
|
<!-- <TabItem Header="DataGrid"> -->
|
||||||
<pages:DataGridDemo />
|
<!-- <pages:DataGridDemo /> -->
|
||||||
</TabItem>
|
<!-- </TabItem> -->
|
||||||
<TabItem Header="TreeDataGrid">
|
<!-- <TabItem Header="TreeDataGrid"> -->
|
||||||
<pages:TreeDataGridDemo />
|
<!-- <pages:TreeDataGridDemo /> -->
|
||||||
</TabItem>
|
<!-- </TabItem> -->
|
||||||
<TabItem
|
<TabItem
|
||||||
Theme="{DynamicResource CategoryTabItem}"
|
Theme="{DynamicResource CategoryTabItem}"
|
||||||
Header="Basic" />
|
Header="Basic" />
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
<PackageProjectUrl>https://github.com/irihitech/Semi.Avalonia</PackageProjectUrl>
|
<PackageProjectUrl>https://github.com/irihitech/Semi.Avalonia</PackageProjectUrl>
|
||||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||||
<PackageIcon>irihi.png</PackageIcon>
|
<PackageIcon>irihi.png</PackageIcon>
|
||||||
|
<PackageProjectUrl>https://github.com/irihitech/Semi.Avalonia</PackageProjectUrl>
|
||||||
<PackageReadmeFile>README.md</PackageReadmeFile>
|
<PackageReadmeFile>README.md</PackageReadmeFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
<Project>
|
<Project>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
||||||
<AvaloniaVersion>11.3.7</AvaloniaVersion>
|
<AvaloniaVersion>12.0.0-preview1</AvaloniaVersion>
|
||||||
<DataGridVersion>11.3.7</DataGridVersion>
|
<DataGridVersion>11.3.7</DataGridVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageVersion Include="Avalonia" Version="$(AvaloniaVersion)"/>
|
<PackageVersion Include="Avalonia" Version="$(AvaloniaVersion)"/>
|
||||||
<PackageVersion Include="Avalonia.Controls.ColorPicker" Version="$(AvaloniaVersion)"/>
|
<PackageVersion Include="Avalonia.Controls.ColorPicker" Version="$(AvaloniaVersion)"/>
|
||||||
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="$(DataGridVersion)"/>
|
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="$(DataGridVersion)"/>
|
||||||
<PackageVersion Include="Avalonia.Controls.TreeDataGrid" Version="11.0.10"/>
|
<PackageVersion Include="Avalonia.Controls.TreeDataGrid" Version="11.1.1"/>
|
||||||
|
<PackageVersion Include="Irihi.Avalonia.Shared" Version="0.4.0-preview1"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
<ResourceDictionary
|
<ResourceDictionary
|
||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:iri="https://irihi.tech/shared"
|
||||||
xmlns:converters="using:Avalonia.Controls.Converters">
|
xmlns:converters="using:Avalonia.Controls.Converters">
|
||||||
<converters:CornerRadiusFilterConverter x:Key="LeftCornerRadiusFilterConverter" Filter="TopLeft, BottomLeft" />
|
|
||||||
<converters:ToBrushConverter x:Key="ToBrushConverter" />
|
<converters:ToBrushConverter x:Key="ToBrushConverter" />
|
||||||
|
|
||||||
<ControlTheme x:Key="{x:Type ColorPicker}" TargetType="ColorPicker">
|
<ControlTheme x:Key="{x:Type ColorPicker}" TargetType="ColorPicker">
|
||||||
@@ -16,11 +16,11 @@
|
|||||||
<Border
|
<Border
|
||||||
Margin="1,1,0,1"
|
Margin="1,1,0,1"
|
||||||
Background="{DynamicResource ColorControlCheckeredBackgroundBrush}"
|
Background="{DynamicResource ColorControlCheckeredBackgroundBrush}"
|
||||||
CornerRadius="{TemplateBinding CornerRadius, Converter={StaticResource LeftCornerRadiusFilterConverter}}" />
|
CornerRadius="{TemplateBinding CornerRadius, Converter={iri:CornerRadiusMixerConverter Left}}" />
|
||||||
<Border
|
<Border
|
||||||
Margin="1,1,0,1"
|
Margin="1,1,0,1"
|
||||||
Background="{TemplateBinding HsvColor, Converter={StaticResource ToBrushConverter}}"
|
Background="{TemplateBinding HsvColor, Converter={StaticResource ToBrushConverter}}"
|
||||||
CornerRadius="{TemplateBinding CornerRadius, Converter={StaticResource LeftCornerRadiusFilterConverter}}" />
|
CornerRadius="{TemplateBinding CornerRadius, Converter={iri:CornerRadiusMixerConverter Left}}" />
|
||||||
</Panel>
|
</Panel>
|
||||||
</Template>
|
</Template>
|
||||||
</Setter>
|
</Setter>
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
<ResourceDictionary
|
<ResourceDictionary
|
||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:converters="using:Avalonia.Controls.Converters"
|
xmlns:iri="https://irihi.tech/shared"
|
||||||
xmlns:pc="using:Avalonia.Controls.Primitives.Converters">
|
xmlns:pc="using:Avalonia.Controls.Primitives.Converters">
|
||||||
<pc:AccentColorConverter x:Key="AccentColorConverter" />
|
<pc:AccentColorConverter x:Key="AccentColorConverter" />
|
||||||
<converters:CornerRadiusFilterConverter x:Key="LeftCornerRadiusFilterConverter" Filter="TopLeft, BottomLeft" />
|
|
||||||
<converters:CornerRadiusFilterConverter x:Key="RightCornerRadiusFilterConverter" Filter="TopRight, BottomRight" />
|
|
||||||
|
|
||||||
<ControlTheme x:Key="{x:Type ColorPreviewer}" TargetType="ColorPreviewer">
|
<ControlTheme x:Key="{x:Type ColorPreviewer}" TargetType="ColorPreviewer">
|
||||||
<Setter Property="Height" Value="{DynamicResource ColorPreviewerHeight}" />
|
<Setter Property="Height" Value="{DynamicResource ColorPreviewerHeight}" />
|
||||||
@@ -34,7 +32,7 @@
|
|||||||
Background="{TemplateBinding HsvColor,
|
Background="{TemplateBinding HsvColor,
|
||||||
Converter={StaticResource AccentColorConverter},
|
Converter={StaticResource AccentColorConverter},
|
||||||
ConverterParameter='-2'}"
|
ConverterParameter='-2'}"
|
||||||
CornerRadius="{TemplateBinding CornerRadius,Converter={StaticResource LeftCornerRadiusFilterConverter}}"
|
CornerRadius="{TemplateBinding CornerRadius,Converter={iri:CornerRadiusMixerConverter Left}}"
|
||||||
Tag="-2" />
|
Tag="-2" />
|
||||||
<Border
|
<Border
|
||||||
Name="PART_AccentDecrement1Border"
|
Name="PART_AccentDecrement1Border"
|
||||||
@@ -70,7 +68,7 @@
|
|||||||
Background="{TemplateBinding HsvColor,
|
Background="{TemplateBinding HsvColor,
|
||||||
Converter={StaticResource AccentColorConverter},
|
Converter={StaticResource AccentColorConverter},
|
||||||
ConverterParameter='2'}"
|
ConverterParameter='2'}"
|
||||||
CornerRadius="{TemplateBinding CornerRadius,Converter={StaticResource RightCornerRadiusFilterConverter}}"
|
CornerRadius="{TemplateBinding CornerRadius,Converter={iri:CornerRadiusMixerConverter Right}}"
|
||||||
Tag="2" />
|
Tag="2" />
|
||||||
</Grid>
|
</Grid>
|
||||||
<!-- Preview color: Must be last for drop shadow Z-index -->
|
<!-- Preview color: Must be last for drop shadow Z-index -->
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
|
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
|
||||||
<Version>11.3.7.2</Version>
|
<Version>12.0.0-preview1</Version>
|
||||||
<PackageReleaseNotes>Update to Semi.Avalonia.ColorPicker 11.3.7.2</PackageReleaseNotes>
|
<PackageReleaseNotes>Update to Semi.Avalonia.ColorPicker 12.0.0-preview1</PackageReleaseNotes>
|
||||||
<Title>Semi.Avalonia.ColorPicker</Title>
|
<Title>Semi.Avalonia.ColorPicker</Title>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Avalonia.Controls.ColorPicker"/>
|
<PackageReference Include="Avalonia.Controls.ColorPicker"/>
|
||||||
|
<PackageReference Include="Irihi.Avalonia.Shared"/>
|
||||||
<None Include="README.md" Pack="true" PackagePath="\"/>
|
<None Include="README.md" Pack="true" PackagePath="\"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
|
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
|
||||||
<Version>11.3.7.2</Version>
|
<Version>11.3.7.3</Version>
|
||||||
<PackageReleaseNotes>Update to Semi.Avalonia.DataGrid 11.3.7.2</PackageReleaseNotes>
|
<PackageReleaseNotes>Update to Semi.Avalonia.DataGrid 11.3.7.3</PackageReleaseNotes>
|
||||||
<Title>Semi.Avalonia.DataGrid</Title>
|
<Title>Semi.Avalonia.DataGrid</Title>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
<Version>11.1.1</Version>
|
<Version>11.1.1.1</Version>
|
||||||
<PackageReleaseNotes>Update to Semi.Avalonia.TreeDataGrid 11.1.1</PackageReleaseNotes>
|
<PackageReleaseNotes>Update to Semi.Avalonia.TreeDataGrid 11.1.1.1</PackageReleaseNotes>
|
||||||
<Title>Semi.Avalonia.TreeDataGrid</Title>
|
<Title>Semi.Avalonia.TreeDataGrid</Title>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
x:Class="Semi.Avalonia.SemiPopupAnimations"
|
x:Class="Semi.Avalonia.SemiPopupAnimations"
|
||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:converters="clr-namespace:Semi.Avalonia.Converters">
|
xmlns:semi="https://irihi.tech/semi">
|
||||||
<Style Selector="Popup LayoutTransformControl#PART_LayoutTransform">
|
<Style Selector="Popup LayoutTransformControl#PART_LayoutTransform">
|
||||||
<Setter Property="RenderTransformOrigin" Value="{Binding $parent[Popup].Placement, Converter={x:Static converters:PlacementToRenderTransformOriginConverter.Instance}}" />
|
<Setter Property="RenderTransformOrigin" Value="{Binding $parent[Popup].Placement, Converter={semi:PlacementToRenderTransformOriginConverter}}" />
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style Selector="Popup[IsOpen=True] LayoutTransformControl#PART_LayoutTransform">
|
<Style Selector="Popup[IsOpen=True] LayoutTransformControl#PART_LayoutTransform">
|
||||||
|
|||||||
@@ -1,14 +1,16 @@
|
|||||||
<ResourceDictionary
|
<ResourceDictionary
|
||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:iri="https://irihi.tech/shared">
|
||||||
<Design.PreviewWith>
|
<Design.PreviewWith>
|
||||||
<StackPanel Margin="20" Spacing="20">
|
<StackPanel Margin="20" Spacing="20">
|
||||||
<TextBox Text="Hello" />
|
<TextBox Text="Hello" />
|
||||||
<AutoCompleteBox Width="100" />
|
<AutoCompleteBox Width="100" PlaceholderText="Hello" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Design.PreviewWith>
|
</Design.PreviewWith>
|
||||||
<ControlTheme x:Key="{x:Type AutoCompleteBox}" TargetType="AutoCompleteBox">
|
<ControlTheme x:Key="{x:Type AutoCompleteBox}" TargetType="AutoCompleteBox">
|
||||||
<Setter Property="VerticalAlignment" Value="Center" />
|
<Setter Property="VerticalAlignment" Value="Center" />
|
||||||
|
<Setter Property="PlaceholderForeground" Value="{DynamicResource TextBoxPlaceholderForeground}" />
|
||||||
<Setter Property="MinHeight" Value="{DynamicResource AutoCompleteBoxDefaultHeight}" />
|
<Setter Property="MinHeight" Value="{DynamicResource AutoCompleteBoxDefaultHeight}" />
|
||||||
<Setter Property="MaxDropDownHeight" Value="{DynamicResource AutoCompleteMaxDropdownHeight}" />
|
<Setter Property="MaxDropDownHeight" Value="{DynamicResource AutoCompleteMaxDropdownHeight}" />
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
@@ -19,11 +21,13 @@
|
|||||||
Name="PART_TextBox"
|
Name="PART_TextBox"
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
MinHeight="{TemplateBinding MinHeight}"
|
MinHeight="{TemplateBinding MinHeight}"
|
||||||
|
ClearSelectionOnLostFocus="{TemplateBinding ClearSelectionOnLostFocus}"
|
||||||
DataValidationErrors.Errors="{TemplateBinding (DataValidationErrors.Errors)}"
|
DataValidationErrors.Errors="{TemplateBinding (DataValidationErrors.Errors)}"
|
||||||
Theme="{DynamicResource NonErrorTextBox}"
|
Theme="{DynamicResource NonErrorTextBox}"
|
||||||
InnerLeftContent="{TemplateBinding InnerLeftContent}"
|
InnerLeftContent="{TemplateBinding InnerLeftContent}"
|
||||||
InnerRightContent="{TemplateBinding InnerRightContent}"
|
InnerRightContent="{TemplateBinding InnerRightContent}"
|
||||||
Watermark="{TemplateBinding Watermark}" />
|
PlaceholderForeground="{TemplateBinding PlaceholderForeground}"
|
||||||
|
PlaceholderText="{TemplateBinding PlaceholderText}" />
|
||||||
<Popup
|
<Popup
|
||||||
Name="PART_Popup"
|
Name="PART_Popup"
|
||||||
MaxHeight="{TemplateBinding MaxDropDownHeight}"
|
MaxHeight="{TemplateBinding MaxDropDownHeight}"
|
||||||
@@ -54,43 +58,13 @@
|
|||||||
</Setter>
|
</Setter>
|
||||||
|
|
||||||
<Style Selector="^.Bordered">
|
<Style Selector="^.Bordered">
|
||||||
<Setter Property="Template">
|
<Style Selector="^ /template/ TextBox#PART_TextBox">
|
||||||
<ControlTemplate TargetType="AutoCompleteBox">
|
<Setter Property="MinHeight" Value="0" />
|
||||||
<Panel>
|
<Setter Property="iri:ClassHelper.Classes" Value="Bordered" />
|
||||||
<TextBox
|
</Style>
|
||||||
Name="PART_TextBox"
|
<Style Selector="^ /template/ ListBox#PART_SelectingItemsControl">
|
||||||
VerticalAlignment="Stretch"
|
<Setter Property="ScrollViewer.IsScrollChainingEnabled" Value="False" />
|
||||||
MinHeight="0"
|
</Style>
|
||||||
Classes="Bordered"
|
|
||||||
DataValidationErrors.Errors="{TemplateBinding (DataValidationErrors.Errors)}"
|
|
||||||
Watermark="{TemplateBinding Watermark}" />
|
|
||||||
<Popup
|
|
||||||
Name="PART_Popup"
|
|
||||||
MaxHeight="{TemplateBinding MaxDropDownHeight}"
|
|
||||||
InheritsTransform="True"
|
|
||||||
IsLightDismissEnabled="True"
|
|
||||||
PlacementTarget="{TemplateBinding}">
|
|
||||||
<Border
|
|
||||||
MinWidth="{Binding Bounds.Width, RelativeSource={RelativeSource TemplatedParent}}"
|
|
||||||
Margin="{DynamicResource AutoCompleteBoxPopupMargin}"
|
|
||||||
Padding="{DynamicResource AutoCompleteBoxPopupPadding}"
|
|
||||||
HorizontalAlignment="Stretch"
|
|
||||||
Background="{DynamicResource AutoCompleteBoxPopupBackground}"
|
|
||||||
BorderBrush="{DynamicResource AutoCompleteBoxPopupBorderBrush}"
|
|
||||||
BorderThickness="{DynamicResource AutoCompleteBoxPopupBorderThickness}"
|
|
||||||
BoxShadow="{DynamicResource AutoCompleteBoxPopupBoxShadow}"
|
|
||||||
CornerRadius="{DynamicResource AutoCompleteBoxPopupCornerRadius}">
|
|
||||||
<ListBox
|
|
||||||
Name="PART_SelectingItemsControl"
|
|
||||||
Foreground="{TemplateBinding Foreground}"
|
|
||||||
ItemTemplate="{TemplateBinding ItemTemplate}"
|
|
||||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
|
||||||
ScrollViewer.VerticalScrollBarVisibility="Auto" />
|
|
||||||
</Border>
|
|
||||||
</Popup>
|
|
||||||
</Panel>
|
|
||||||
</ControlTemplate>
|
|
||||||
</Setter>
|
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^.Large">
|
<Style Selector="^.Large">
|
||||||
<Setter Property="MinHeight" Value="{DynamicResource AutoCompleteBoxLargeHeight}" />
|
<Setter Property="MinHeight" Value="{DynamicResource AutoCompleteBoxLargeHeight}" />
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
<ControlTheme x:Key="{x:Type CalendarDatePicker}" TargetType="CalendarDatePicker">
|
<ControlTheme x:Key="{x:Type CalendarDatePicker}" TargetType="CalendarDatePicker">
|
||||||
<Setter Property="Background" Value="{DynamicResource CalendarDatePickerBackground}" />
|
<Setter Property="Background" Value="{DynamicResource CalendarDatePickerBackground}" />
|
||||||
<Setter Property="Foreground" Value="{DynamicResource CalendarDatePickerForeground}" />
|
<Setter Property="Foreground" Value="{DynamicResource CalendarDatePickerForeground}" />
|
||||||
|
<Setter Property="PlaceholderForeground" Value="{DynamicResource TextBoxPlaceholderForeground}" />
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource CalendarDatePickerBorderBrush}" />
|
<Setter Property="BorderBrush" Value="{DynamicResource CalendarDatePickerBorderBrush}" />
|
||||||
<Setter Property="BorderThickness" Value="{DynamicResource CalendarDatePickerBorderThickness}" />
|
<Setter Property="BorderThickness" Value="{DynamicResource CalendarDatePickerBorderThickness}" />
|
||||||
<Setter Property="CornerRadius" Value="{DynamicResource CalendarDatePickerCornerRadius}" />
|
<Setter Property="CornerRadius" Value="{DynamicResource CalendarDatePickerCornerRadius}" />
|
||||||
@@ -52,8 +53,9 @@
|
|||||||
CornerRadius="{TemplateBinding CornerRadius}"
|
CornerRadius="{TemplateBinding CornerRadius}"
|
||||||
Foreground="{TemplateBinding Foreground}"
|
Foreground="{TemplateBinding Foreground}"
|
||||||
Theme="{DynamicResource NonErrorTextBox}"
|
Theme="{DynamicResource NonErrorTextBox}"
|
||||||
UseFloatingWatermark="{TemplateBinding UseFloatingWatermark}"
|
UseFloatingPlaceholder="{TemplateBinding UseFloatingPlaceholder}"
|
||||||
Watermark="{TemplateBinding Watermark}">
|
PlaceholderForeground="{TemplateBinding PlaceholderForeground}"
|
||||||
|
PlaceholderText="{TemplateBinding PlaceholderText}">
|
||||||
<TextBox.Styles>
|
<TextBox.Styles>
|
||||||
<Style Selector="TextBox#PART_TextBox:pointerover /template/ Border#PART_ContentPresenterBorder">
|
<Style Selector="TextBox#PART_TextBox:pointerover /template/ Border#PART_ContentPresenterBorder">
|
||||||
<!-- By default the TextBox has its own focused state, override this to disable it here -->
|
<!-- By default the TextBox has its own focused state, override this to disable it here -->
|
||||||
|
|||||||
@@ -50,21 +50,33 @@
|
|||||||
Data="{StaticResource WindowExpandGlyph}"
|
Data="{StaticResource WindowExpandGlyph}"
|
||||||
Foreground="{Binding $parent[Button].Foreground}" />
|
Foreground="{Binding $parent[Button].Foreground}" />
|
||||||
</Button>
|
</Button>
|
||||||
<Button Name="PART_MinimizeButton" Theme="{StaticResource CaptionButton}">
|
<Button
|
||||||
|
Name="PART_MinimizeButton"
|
||||||
|
Theme="{StaticResource CaptionButton}"
|
||||||
|
AutomationProperties.Name="Minimize"
|
||||||
|
Win32Properties.NonClientHitTestResult="MinButton">
|
||||||
<PathIcon
|
<PathIcon
|
||||||
Name="PART_MinimizeButtonIcon"
|
Name="PART_MinimizeButtonIcon"
|
||||||
Theme="{StaticResource InnerPathIcon}"
|
Theme="{StaticResource InnerPathIcon}"
|
||||||
Data="{StaticResource WindowMinimizeGlyph}"
|
Data="{StaticResource WindowMinimizeGlyph}"
|
||||||
Foreground="{Binding $parent[Button].Foreground}" />
|
Foreground="{Binding $parent[Button].Foreground}" />
|
||||||
</Button>
|
</Button>
|
||||||
<Button Name="PART_RestoreButton" Theme="{StaticResource CaptionButton}">
|
<Button
|
||||||
|
Name="PART_RestoreButton"
|
||||||
|
Theme="{StaticResource CaptionButton}"
|
||||||
|
AutomationProperties.Name="Maximize"
|
||||||
|
Win32Properties.NonClientHitTestResult="MaxButton">
|
||||||
<PathIcon
|
<PathIcon
|
||||||
Name="PART_RestoreButtonIcon"
|
Name="PART_RestoreButtonIcon"
|
||||||
Theme="{StaticResource InnerPathIcon}"
|
Theme="{StaticResource InnerPathIcon}"
|
||||||
Data="{StaticResource WindowMaximizeGlyph}"
|
Data="{StaticResource WindowMaximizeGlyph}"
|
||||||
Foreground="{Binding $parent[Button].Foreground}" />
|
Foreground="{Binding $parent[Button].Foreground}" />
|
||||||
</Button>
|
</Button>
|
||||||
<Button Name="PART_CloseButton" Theme="{StaticResource CaptionButton}">
|
<Button
|
||||||
|
Name="PART_CloseButton"
|
||||||
|
Theme="{StaticResource CaptionButton}"
|
||||||
|
AutomationProperties.Name="Close"
|
||||||
|
Win32Properties.NonClientHitTestResult="Close">
|
||||||
<PathIcon
|
<PathIcon
|
||||||
Name="PART_CloseButtonIcon"
|
Name="PART_CloseButtonIcon"
|
||||||
Theme="{StaticResource InnerPathIcon}"
|
Theme="{StaticResource InnerPathIcon}"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<ResourceDictionary
|
<ResourceDictionary
|
||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:converter="clr-namespace:Semi.Avalonia.Converters">
|
xmlns:semi="https://irihi.tech/semi">
|
||||||
<Design.PreviewWith>
|
<Design.PreviewWith>
|
||||||
<StackPanel Spacing="20" Width="800" Height="800">
|
<StackPanel Spacing="20" Width="800" Height="800">
|
||||||
<StackPanel.Styles>
|
<StackPanel.Styles>
|
||||||
@@ -197,8 +197,8 @@
|
|||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
ItemContainerTheme="{DynamicResource CarouselIndicatorDotListBoxItem}"
|
ItemContainerTheme="{DynamicResource CarouselIndicatorDotListBoxItem}"
|
||||||
ItemsSource="{TemplateBinding ItemCount, Converter={x:Static converter:ItemConverter.ItemToObjectConverter}}"
|
ItemsSource="{TemplateBinding ItemCount, Converter={x:Static semi:ItemConverter.ItemToObjectConverter}}"
|
||||||
IsVisible="{TemplateBinding ItemCount, Converter={x:Static converter:ItemConverter.ItemVisibleConverter}}"
|
IsVisible="{TemplateBinding ItemCount, Converter={x:Static semi:ItemConverter.ItemVisibleConverter}}"
|
||||||
SelectedIndex="{TemplateBinding SelectedIndex, Mode=TwoWay}">
|
SelectedIndex="{TemplateBinding SelectedIndex, Mode=TwoWay}">
|
||||||
<ListBox.ItemsPanel>
|
<ListBox.ItemsPanel>
|
||||||
<ItemsPanelTemplate>
|
<ItemsPanelTemplate>
|
||||||
@@ -213,7 +213,7 @@
|
|||||||
Theme="{DynamicResource CarouselButton}"
|
Theme="{DynamicResource CarouselButton}"
|
||||||
Margin="{DynamicResource CarouselButtonMargin}"
|
Margin="{DynamicResource CarouselButtonMargin}"
|
||||||
Foreground="{DynamicResource CarouselButtonForeground}"
|
Foreground="{DynamicResource CarouselButtonForeground}"
|
||||||
IsVisible="{TemplateBinding ItemCount, Converter={x:Static converter:ItemConverter.ItemVisibleConverter}}"
|
IsVisible="{TemplateBinding ItemCount, Converter={x:Static semi:ItemConverter.ItemVisibleConverter}}"
|
||||||
Command="{Binding $parent[Carousel].Previous}" />
|
Command="{Binding $parent[Carousel].Previous}" />
|
||||||
<Button
|
<Button
|
||||||
Grid.Row="0"
|
Grid.Row="0"
|
||||||
@@ -222,7 +222,7 @@
|
|||||||
Theme="{DynamicResource CarouselButton}"
|
Theme="{DynamicResource CarouselButton}"
|
||||||
Margin="{DynamicResource CarouselButtonMargin}"
|
Margin="{DynamicResource CarouselButtonMargin}"
|
||||||
Foreground="{DynamicResource CarouselButtonForeground}"
|
Foreground="{DynamicResource CarouselButtonForeground}"
|
||||||
IsVisible="{TemplateBinding ItemCount, Converter={x:Static converter:ItemConverter.ItemVisibleConverter}}"
|
IsVisible="{TemplateBinding ItemCount, Converter={x:Static semi:ItemConverter.ItemVisibleConverter}}"
|
||||||
Command="{Binding $parent[Carousel].Next}"
|
Command="{Binding $parent[Carousel].Next}"
|
||||||
RenderTransform="rotate(180deg)" />
|
RenderTransform="rotate(180deg)" />
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@@ -92,7 +92,7 @@
|
|||||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||||
Foreground="{TemplateBinding Foreground}"
|
Foreground="{TemplateBinding Foreground}"
|
||||||
Text="{TemplateBinding Text, Mode=TwoWay}"
|
Text="{TemplateBinding Text, Mode=TwoWay}"
|
||||||
Watermark="{TemplateBinding PlaceholderText}"
|
PlaceholderText="{TemplateBinding PlaceholderText}"
|
||||||
IsVisible="{TemplateBinding IsEditable}" />
|
IsVisible="{TemplateBinding IsEditable}" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@@ -2,9 +2,10 @@
|
|||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
<Design.PreviewWith>
|
<Design.PreviewWith>
|
||||||
<Border Padding="20">
|
<StackPanel Margin="20">
|
||||||
<DatePickerPresenter />
|
<DatePickerPresenter />
|
||||||
</Border>
|
<DatePicker Width="500" />
|
||||||
|
</StackPanel>
|
||||||
</Design.PreviewWith>
|
</Design.PreviewWith>
|
||||||
<ControlTheme x:Key="{x:Type DatePickerPresenter}" TargetType="DatePickerPresenter">
|
<ControlTheme x:Key="{x:Type DatePickerPresenter}" TargetType="DatePickerPresenter">
|
||||||
<Setter Property="Width" Value="296" />
|
<Setter Property="Width" Value="296" />
|
||||||
@@ -141,6 +142,7 @@
|
|||||||
<Setter Property="HorizontalAlignment" Value="Left" />
|
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||||
<Setter Property="VerticalAlignment" Value="Center" />
|
<Setter Property="VerticalAlignment" Value="Center" />
|
||||||
<Setter Property="MinHeight" Value="{DynamicResource DateTimePickerButtonDefaultHeight}" />
|
<Setter Property="MinHeight" Value="{DynamicResource DateTimePickerButtonDefaultHeight}" />
|
||||||
|
<Setter Property="MinWidth" Value="296" />
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<ControlTemplate TargetType="DatePicker">
|
<ControlTemplate TargetType="DatePicker">
|
||||||
<DataValidationErrors>
|
<DataValidationErrors>
|
||||||
@@ -152,8 +154,8 @@
|
|||||||
Name="PART_FlyoutButton"
|
Name="PART_FlyoutButton"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Grid.ColumnSpan="2"
|
Grid.ColumnSpan="2"
|
||||||
Width="298"
|
MinWidth="{TemplateBinding MinWidth}"
|
||||||
MinWidth="298"
|
MaxWidth="{TemplateBinding MaxWidth}"
|
||||||
MinHeight="{TemplateBinding MinHeight}"
|
MinHeight="{TemplateBinding MinHeight}"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
|
|||||||
5
src/Semi.Avalonia/Controls/GroupBox.axaml
Normal file
5
src/Semi.Avalonia/Controls/GroupBox.axaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<ResourceDictionary
|
||||||
|
xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
|
<StaticResource x:Key="{x:Type GroupBox}" ResourceKey="GroupBox"/>
|
||||||
|
</ResourceDictionary>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<ResourceDictionary
|
<ResourceDictionary
|
||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:converters="clr-namespace:Avalonia.Controls.Converters;assembly=Avalonia.Controls">
|
xmlns:iri="https://irihi.tech/shared">
|
||||||
<Design.PreviewWith>
|
<Design.PreviewWith>
|
||||||
<StackPanel Spacing="20">
|
<StackPanel Spacing="20">
|
||||||
<HeaderedContentControl
|
<HeaderedContentControl
|
||||||
@@ -23,7 +23,6 @@
|
|||||||
</HeaderedContentControl>
|
</HeaderedContentControl>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Design.PreviewWith>
|
</Design.PreviewWith>
|
||||||
<converters:MarginMultiplierConverter x:Key="SeparatorBorderMultiplier" Top="True" Indent="1" />
|
|
||||||
|
|
||||||
<ControlTheme x:Key="{x:Type HeaderedContentControl}" TargetType="HeaderedContentControl">
|
<ControlTheme x:Key="{x:Type HeaderedContentControl}" TargetType="HeaderedContentControl">
|
||||||
<Setter Property="Padding" Value="3" />
|
<Setter Property="Padding" Value="3" />
|
||||||
@@ -97,7 +96,7 @@
|
|||||||
Name="SeparatorBorder"
|
Name="SeparatorBorder"
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
BorderBrush="{TemplateBinding BorderBrush}"
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||||||
BorderThickness="{TemplateBinding BorderThickness, Converter={StaticResource SeparatorBorderMultiplier}}">
|
BorderThickness="{TemplateBinding BorderThickness, Converter={iri:ThicknessMixerConverter Top}}">
|
||||||
<Border.IsVisible>
|
<Border.IsVisible>
|
||||||
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
||||||
<TemplateBinding Property="Header" Converter="{x:Static ObjectConverters.IsNotNull}" />
|
<TemplateBinding Property="Header" Converter="{x:Static ObjectConverters.IsNotNull}" />
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
<ResourceDictionary
|
<ResourceDictionary
|
||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:converters="using:Semi.Avalonia.Converters"
|
xmlns:iri="https://irihi.tech/shared"
|
||||||
xmlns:dialogs="clr-namespace:Avalonia.Dialogs;assembly=Avalonia.Dialogs"
|
xmlns:dialogs="using:Avalonia.Dialogs"
|
||||||
xmlns:internal="clr-namespace:Avalonia.Dialogs.Internal;assembly=Avalonia.Dialogs"
|
xmlns:internal="using:Avalonia.Dialogs.Internal"
|
||||||
xmlns:cvt="using:Avalonia.Controls.Converters">
|
xmlns:cvt="using:Avalonia.Controls.Converters">
|
||||||
<Design.PreviewWith>
|
<Design.PreviewWith>
|
||||||
<Border
|
<Border
|
||||||
@@ -14,11 +14,11 @@
|
|||||||
</Border>
|
</Border>
|
||||||
</Design.PreviewWith>
|
</Design.PreviewWith>
|
||||||
|
|
||||||
<converters:KeyToPathConverter x:Key="Icons">
|
<iri:ResourceConverter x:Key="Icons">
|
||||||
<StreamGeometry x:Key="Icon_Folder">M19,20H4C2.89,20 2,19.1 2,18V6C2,4.89 2.89,4 4,4H10L12,6H19A2,2 0 0,1 21,8H21L4,8V18L6.14,10H23.21L20.93,18.5C20.7,19.37 19.92,20 19,20Z</StreamGeometry>
|
<StreamGeometry x:Key="Icon_Folder">M19,20H4C2.89,20 2,19.1 2,18V6C2,4.89 2.89,4 4,4H10L12,6H19A2,2 0 0,1 21,8H21L4,8V18L6.14,10H23.21L20.93,18.5C20.7,19.37 19.92,20 19,20Z</StreamGeometry>
|
||||||
<StreamGeometry x:Key="Icon_File">M13,9H18.5L13,3.5V9M6,2H14L20,8V20A2,2 0 0,1 18,22H6C4.89,22 4,21.1 4,20V4C4,2.89 4.89,2 6,2M15,18V16H6V18H15M18,14V12H6V14H18Z</StreamGeometry>
|
<StreamGeometry x:Key="Icon_File">M13,9H18.5L13,3.5V9M6,2H14L20,8V20A2,2 0 0,1 18,22H6C4.89,22 4,21.1 4,20V4C4,2.89 4.89,2 6,2M15,18V16H6V18H15M18,14V12H6V14H18Z</StreamGeometry>
|
||||||
<StreamGeometry x:Key="Icon_Volume">M6,2H18A2,2 0 0,1 20,4V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V4A2,2 0 0,1 6,2M12,4A6,6 0 0,0 6,10C6,13.31 8.69,16 12.1,16L11.22,13.77C10.95,13.29 11.11,12.68 11.59,12.4L12.45,11.9C12.93,11.63 13.54,11.79 13.82,12.27L15.74,14.69C17.12,13.59 18,11.9 18,10A6,6 0 0,0 12,4M12,9A1,1 0 0,1 13,10A1,1 0 0,1 12,11A1,1 0 0,1 11,10A1,1 0 0,1 12,9M7,18A1,1 0 0,0 6,19A1,1 0 0,0 7,20A1,1 0 0,0 8,19A1,1 0 0,0 7,18M12.09,13.27L14.58,19.58L17.17,18.08L12.95,12.77L12.09,13.27Z</StreamGeometry>
|
<StreamGeometry x:Key="Icon_Volume">M6,2H18A2,2 0 0,1 20,4V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V4A2,2 0 0,1 6,2M12,4A6,6 0 0,0 6,10C6,13.31 8.69,16 12.1,16L11.22,13.77C10.95,13.29 11.11,12.68 11.59,12.4L12.45,11.9C12.93,11.63 13.54,11.79 13.82,12.27L15.74,14.69C17.12,13.59 18,11.9 18,10A6,6 0 0,0 12,4M12,9A1,1 0 0,1 13,10A1,1 0 0,1 12,11A1,1 0 0,1 11,10A1,1 0 0,1 12,9M7,18A1,1 0 0,0 6,19A1,1 0 0,0 7,20A1,1 0 0,0 8,19A1,1 0 0,0 7,18M12.09,13.27L14.58,19.58L17.17,18.08L12.95,12.77L12.09,13.27Z</StreamGeometry>
|
||||||
</converters:KeyToPathConverter>
|
</iri:ResourceConverter>
|
||||||
<ControlTheme x:Key="{x:Type dialogs:ManagedFileChooser}" TargetType="dialogs:ManagedFileChooser">
|
<ControlTheme x:Key="{x:Type dialogs:ManagedFileChooser}" TargetType="dialogs:ManagedFileChooser">
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<ControlTemplate x:DataType="internal:ManagedFileChooserViewModel" TargetType="dialogs:ManagedFileChooser">
|
<ControlTemplate x:DataType="internal:ManagedFileChooserViewModel" TargetType="dialogs:ManagedFileChooser">
|
||||||
@@ -77,7 +77,7 @@
|
|||||||
<TextBox
|
<TextBox
|
||||||
IsVisible="{Binding !SelectingFolder}"
|
IsVisible="{Binding !SelectingFolder}"
|
||||||
Text="{Binding FileName}"
|
Text="{Binding FileName}"
|
||||||
Watermark="{DynamicResource STRING_CHOOSER_FILE_NAME}" />
|
PlaceholderText="{DynamicResource STRING_CHOOSER_FILE_NAME}" />
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
<CheckBox
|
<CheckBox
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
<ControlTheme x:Key="MenuScrollViewer" TargetType="ScrollViewer">
|
<ControlTheme x:Key="MenuScrollViewer" TargetType="ScrollViewer">
|
||||||
<Setter Property="Background" Value="Transparent" />
|
<Setter Property="Background" Value="Transparent" />
|
||||||
|
<Setter Property="ScrollViewer.IsScrollChainingEnabled" Value="False" />
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<ControlTemplate TargetType="ScrollViewer">
|
<ControlTemplate TargetType="ScrollViewer">
|
||||||
<DockPanel>
|
<DockPanel>
|
||||||
@@ -349,7 +350,7 @@
|
|||||||
BorderThickness="{DynamicResource MenuFlyoutBorderThickness}"
|
BorderThickness="{DynamicResource MenuFlyoutBorderThickness}"
|
||||||
BoxShadow="{DynamicResource MenuFlyoutBorderBoxShadow}"
|
BoxShadow="{DynamicResource MenuFlyoutBorderBoxShadow}"
|
||||||
CornerRadius="{DynamicResource MenuFlyoutCornerRadius}">
|
CornerRadius="{DynamicResource MenuFlyoutCornerRadius}">
|
||||||
<ScrollViewer Theme="{StaticResource MenuScrollViewer}" CornerRadius="{DynamicResource MenuFlyoutCornerRadius}">
|
<ScrollViewer Theme="{StaticResource MenuScrollViewer}" IsScrollChainingEnabled="False" CornerRadius="{DynamicResource MenuFlyoutCornerRadius}">
|
||||||
<ItemsPresenter
|
<ItemsPresenter
|
||||||
Name="PART_ItemsPresenter"
|
Name="PART_ItemsPresenter"
|
||||||
Grid.IsSharedSizeScope="True"
|
Grid.IsSharedSizeScope="True"
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||||
<Setter Property="CornerRadius" Value="{DynamicResource NumericUpDownCornerRadius}" />
|
<Setter Property="CornerRadius" Value="{DynamicResource NumericUpDownCornerRadius}" />
|
||||||
<Setter Property="MinHeight" Value="{DynamicResource NumericUpDownDefaultHeight}" />
|
<Setter Property="MinHeight" Value="{DynamicResource NumericUpDownDefaultHeight}" />
|
||||||
|
<Setter Property="PlaceholderForeground" Value="{DynamicResource TextBoxPlaceholderForeground}" />
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<ControlTemplate TargetType="NumericUpDown">
|
<ControlTemplate TargetType="NumericUpDown">
|
||||||
<DataValidationErrors>
|
<DataValidationErrors>
|
||||||
@@ -38,7 +39,8 @@
|
|||||||
Theme="{DynamicResource NonErrorTextBox}"
|
Theme="{DynamicResource NonErrorTextBox}"
|
||||||
InnerLeftContent="{TemplateBinding InnerLeftContent}"
|
InnerLeftContent="{TemplateBinding InnerLeftContent}"
|
||||||
InnerRightContent="{TemplateBinding InnerRightContent}"
|
InnerRightContent="{TemplateBinding InnerRightContent}"
|
||||||
Watermark="{TemplateBinding Watermark}" />
|
PlaceholderForeground="{TemplateBinding PlaceholderForeground}"
|
||||||
|
PlaceholderText="{TemplateBinding PlaceholderText}" />
|
||||||
</ButtonSpinner>
|
</ButtonSpinner>
|
||||||
</DataValidationErrors>
|
</DataValidationErrors>
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
<Setter Property="FontSize" Value="{DynamicResource DefaultFontSize}" />
|
<Setter Property="FontSize" Value="{DynamicResource DefaultFontSize}" />
|
||||||
<Setter Property="FontWeight" Value="{DynamicResource DefaultFontWeight}" />
|
<Setter Property="FontWeight" Value="{DynamicResource DefaultFontWeight}" />
|
||||||
<Setter Property="FontFamily" Value="{DynamicResource DefaultFontFamily}" />
|
<Setter Property="FontFamily" Value="{DynamicResource DefaultFontFamily}" />
|
||||||
|
<Setter Property="Inline.TextDecorations" Value="" />
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<ControlTemplate TargetType="PopupRoot">
|
<ControlTemplate TargetType="PopupRoot">
|
||||||
<LayoutTransformControl LayoutTransform="{TemplateBinding Transform}">
|
<LayoutTransformControl LayoutTransform="{TemplateBinding Transform}">
|
||||||
@@ -29,6 +30,10 @@
|
|||||||
</ControlTheme>
|
</ControlTheme>
|
||||||
|
|
||||||
<ControlTheme x:Key="{x:Type OverlayPopupHost}" TargetType="OverlayPopupHost">
|
<ControlTheme x:Key="{x:Type OverlayPopupHost}" TargetType="OverlayPopupHost">
|
||||||
|
<Setter Property="FontSize" Value="{DynamicResource DefaultFontSize}" />
|
||||||
|
<Setter Property="FontWeight" Value="{DynamicResource DefaultFontWeight}" />
|
||||||
|
<Setter Property="FontFamily" Value="{DynamicResource DefaultFontFamily}" />
|
||||||
|
<Setter Property="Inline.TextDecorations" Value="" />
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<ControlTemplate>
|
<ControlTemplate>
|
||||||
<LayoutTransformControl LayoutTransform="{TemplateBinding Transform}">
|
<LayoutTransformControl LayoutTransform="{TemplateBinding Transform}">
|
||||||
|
|||||||
@@ -1,90 +1,57 @@
|
|||||||
<ResourceDictionary
|
<ResourceDictionary
|
||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:converters="using:Avalonia.Controls.Converters"
|
xmlns:semi="https://irihi.tech/semi"
|
||||||
xmlns:semiConverters="clr-namespace:Semi.Avalonia.Converters">
|
xmlns:converters="using:Avalonia.Controls.Converters">
|
||||||
<Design.PreviewWith>
|
<Design.PreviewWith>
|
||||||
<StackPanel Margin="20" Spacing="20">
|
<StackPanel Width="400" Margin="20">
|
||||||
<ProgressBar
|
<ProgressBar />
|
||||||
Width="200"
|
<ProgressBar Value="20" />
|
||||||
Maximum="100"
|
<ProgressBar Value="50" Classes="Success" />
|
||||||
Minimum="0"
|
<ProgressBar Value="80" Classes="Warning" />
|
||||||
ShowProgressText="True"
|
<ProgressBar Value="100" Classes="Error" />
|
||||||
Value="20" />
|
<ProgressBar ShowProgressText="True" />
|
||||||
<ProgressBar
|
<ProgressBar Value="20" ShowProgressText="True" />
|
||||||
Width="200"
|
<ProgressBar Value="50" Classes="Success" ShowProgressText="True" />
|
||||||
IsIndeterminate="True"
|
<ProgressBar Value="80" Classes="Warning" ShowProgressText="True" />
|
||||||
Maximum="100"
|
<ProgressBar Value="100" Classes="Error" ShowProgressText="True" />
|
||||||
Minimum="0"
|
<ProgressBar Classes="Left" ShowProgressText="True" />
|
||||||
ShowProgressText="True"
|
<ProgressBar Value="20" Classes="Left" ShowProgressText="True" />
|
||||||
Value="20" />
|
<ProgressBar Value="50" Classes="Left Success" ShowProgressText="True" />
|
||||||
<ProgressBar
|
<ProgressBar Value="80" Classes="Left Warning" ShowProgressText="True" />
|
||||||
Width="200"
|
<ProgressBar Value="100" Classes="Left Error" ShowProgressText="True" />
|
||||||
Classes="Left"
|
<ProgressBar Classes="Right" ShowProgressText="True" />
|
||||||
IsIndeterminate="True"
|
<ProgressBar Value="20" Classes="Right" ShowProgressText="True" />
|
||||||
Maximum="100"
|
<ProgressBar Value="50" Classes="Right Success" ShowProgressText="True" />
|
||||||
Minimum="0"
|
<ProgressBar Value="80" Classes="Right Warning" ShowProgressText="True" />
|
||||||
ShowProgressText="True"
|
<ProgressBar Value="100" Classes="Right Error" ShowProgressText="True" />
|
||||||
Value="20" />
|
|
||||||
<ProgressBar
|
<StackPanel Orientation="Horizontal">
|
||||||
Width="200"
|
<StackPanel.Styles>
|
||||||
Classes="Left"
|
<Style Selector="ProgressBar">
|
||||||
Maximum="100"
|
<Setter Property="Orientation" Value="Vertical" />
|
||||||
Minimum="0"
|
</Style>
|
||||||
ShowProgressText="True"
|
</StackPanel.Styles>
|
||||||
Value="20" />
|
<ProgressBar />
|
||||||
<ProgressBar
|
<ProgressBar Value="20" />
|
||||||
Width="200"
|
<ProgressBar Value="50" Classes="Success" />
|
||||||
Classes="Right"
|
<ProgressBar Value="80" Classes="Warning" />
|
||||||
Maximum="100"
|
<ProgressBar Value="100" Classes="Error" />
|
||||||
Minimum="0"
|
<ProgressBar ShowProgressText="True" />
|
||||||
ShowProgressText="True"
|
<ProgressBar Value="20" ShowProgressText="True" />
|
||||||
Value="20" />
|
<ProgressBar Value="50" Classes="Success" ShowProgressText="True" />
|
||||||
<StackPanel
|
<ProgressBar Value="80" Classes="Warning" ShowProgressText="True" />
|
||||||
HorizontalAlignment="Left"
|
<ProgressBar Value="100" Classes="Error" ShowProgressText="True" />
|
||||||
Orientation="Horizontal"
|
<ProgressBar Classes="Top" ShowProgressText="True" />
|
||||||
Spacing="20">
|
<ProgressBar Value="20" Classes="Top" ShowProgressText="True" />
|
||||||
<ProgressBar
|
<ProgressBar Value="50" Classes="Top Success" ShowProgressText="True" />
|
||||||
Classes="Left"
|
<ProgressBar Value="80" Classes="Top Warning" ShowProgressText="True" />
|
||||||
Maximum="100"
|
<ProgressBar Value="100" Classes="Top Error" ShowProgressText="True" />
|
||||||
Minimum="0"
|
<ProgressBar Classes="Bottom" ShowProgressText="True" />
|
||||||
Orientation="Vertical"
|
<ProgressBar Value="20" Classes="Bottom" ShowProgressText="True" />
|
||||||
ShowProgressText="True"
|
<ProgressBar Value="50" Classes="Bottom Success" ShowProgressText="True" />
|
||||||
Value="20" />
|
<ProgressBar Value="80" Classes="Bottom Warning" ShowProgressText="True" />
|
||||||
<ProgressBar
|
<ProgressBar Value="100" Classes="Bottom Error" ShowProgressText="True" />
|
||||||
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>
|
||||||
@@ -115,7 +82,7 @@
|
|||||||
<Panel Name="DeterminateRoot" Opacity="1">
|
<Panel Name="DeterminateRoot" Opacity="1">
|
||||||
<Panel.Transitions>
|
<Panel.Transitions>
|
||||||
<Transitions>
|
<Transitions>
|
||||||
<DoubleTransition Property="Opacity" Duration="0:0:0.197" />
|
<DoubleTransition Property="Opacity" Duration="0:0:0.2" />
|
||||||
</Transitions>
|
</Transitions>
|
||||||
</Panel.Transitions>
|
</Panel.Transitions>
|
||||||
<Border
|
<Border
|
||||||
@@ -127,7 +94,7 @@
|
|||||||
<Panel Name="IndeterminateRoot" Opacity="0">
|
<Panel Name="IndeterminateRoot" Opacity="0">
|
||||||
<Panel.Transitions>
|
<Panel.Transitions>
|
||||||
<Transitions>
|
<Transitions>
|
||||||
<DoubleTransition Property="Opacity" Duration="0:0:0.197" />
|
<DoubleTransition Property="Opacity" Duration="0:0:0.2" />
|
||||||
</Transitions>
|
</Transitions>
|
||||||
</Panel.Transitions>
|
</Panel.Transitions>
|
||||||
<Border
|
<Border
|
||||||
@@ -158,7 +125,7 @@
|
|||||||
<TextBlock.Text>
|
<TextBlock.Text>
|
||||||
<MultiBinding Converter="{StaticResource StringFormatConverter}">
|
<MultiBinding Converter="{StaticResource StringFormatConverter}">
|
||||||
<TemplateBinding Property="ProgressTextFormat" />
|
<TemplateBinding Property="ProgressTextFormat" />
|
||||||
<Binding Path="Value" RelativeSource="{RelativeSource TemplatedParent}" />
|
<TemplateBinding Property="Value" />
|
||||||
<TemplateBinding Property="Percentage" />
|
<TemplateBinding Property="Percentage" />
|
||||||
<TemplateBinding Property="Minimum" />
|
<TemplateBinding Property="Minimum" />
|
||||||
<TemplateBinding Property="Maximum" />
|
<TemplateBinding Property="Maximum" />
|
||||||
@@ -191,155 +158,159 @@
|
|||||||
<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>
|
<Style Selector="^ /template/ Border#PART_Indicator">
|
||||||
<Style Selector="^:vertical /template/ LayoutTransformControl#PART_LayoutTransformControl">
|
<Setter Property="VerticalAlignment" Value="Top" />
|
||||||
<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="^:vertical /template/ LayoutTransformControl#PART_LayoutTransformControl">
|
<Style Selector="^ /template/ Border#IndeterminateProgressBarIndicator">
|
||||||
<Setter Property="Grid.Column" Value="1" />
|
<Setter Property="Height" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerWidth}" />
|
||||||
<Setter Property="Grid.Row" Value="0" />
|
|
||||||
<Setter Property="Margin" Value="0 4" />
|
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^:horizontal /template/ Border#ProgressBarRoot">
|
<Style Selector="^ /template/ Border#IndeterminateProgressBarIndicator2">
|
||||||
<Setter Property="MinHeight" Value="4" />
|
<Setter Property="Height" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2Width}" />
|
||||||
<Setter Property="VerticalAlignment" Value="Center" />
|
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^:vertical /template/ Border#ProgressBarRoot">
|
<Style Selector="^.Left,^.Top">
|
||||||
<Setter Property="MinWidth" Value="4" />
|
<Style Selector="^ /template/ LayoutTransformControl#PART_LayoutTransformControl">
|
||||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
<Setter Property="Grid.Column" Value="1" />
|
||||||
|
<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="^ /template/ TextBlock#PART_ProgressText">
|
<Style Selector="^.Right,^.Bottom">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource ProgressBarOuterTextForeground}" />
|
<Style Selector="^ /template/ LayoutTransformControl#PART_LayoutTransformControl">
|
||||||
|
<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="^:horizontal /template/ LayoutTransformControl#PART_LayoutTransformControl">
|
<Style Selector="^:indeterminate">
|
||||||
<Setter Property="Grid.Column" Value="2" />
|
<Style Selector="^ /template/ Panel#DeterminateRoot">
|
||||||
<Setter Property="Grid.Row" Value="1" />
|
<Setter Property="Opacity" Value="0" />
|
||||||
<Setter Property="Margin" Value="4 0" />
|
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^:vertical /template/ LayoutTransformControl#PART_LayoutTransformControl">
|
<Style Selector="^ /template/ Panel#IndeterminateRoot">
|
||||||
<Setter Property="Grid.Column" Value="1" />
|
<Setter Property="Opacity" Value="1" />
|
||||||
<Setter Property="Grid.Row" Value="2" />
|
|
||||||
<Setter Property="Margin" Value="0 4" />
|
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^:horizontal /template/ Border#ProgressBarRoot">
|
<Style Selector="^:horizontal /template/ Border#IndeterminateProgressBarIndicator">
|
||||||
<Setter Property="MinHeight" Value="4" />
|
<Style.Animations>
|
||||||
<Setter Property="VerticalAlignment" Value="Center" />
|
<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>
|
||||||
<Style Selector="^:vertical /template/ Border#ProgressBarRoot">
|
<Style Selector="^:horizontal /template/ Border#IndeterminateProgressBarIndicator2">
|
||||||
<Setter Property="MinWidth" Value="4" />
|
<Style.Animations>
|
||||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
<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>
|
||||||
<Style Selector="^ /template/ TextBlock#PART_ProgressText">
|
<Style Selector="^:vertical /template/ Border#IndeterminateProgressBarIndicator">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource ProgressBarOuterTextForeground}" />
|
<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 /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>
|
||||||
|
|
||||||
<semiConverters:PositionToAngleConverter x:Key="AngleConverter" />
|
|
||||||
|
|
||||||
<ControlTheme x:Key="ProgressRing" TargetType="ProgressBar">
|
<ControlTheme x:Key="ProgressRing" TargetType="ProgressBar">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource ProgressBarIndicatorBrush}" />
|
<Setter Property="Foreground" Value="{DynamicResource ProgressBarIndicatorBrush}" />
|
||||||
<Setter Property="Background" Value="{DynamicResource ProgressBarBackground}" />
|
<Setter Property="Background" Value="{DynamicResource ProgressBarBackground}" />
|
||||||
@@ -365,8 +336,7 @@
|
|||||||
StrokeJoin="Round"
|
StrokeJoin="Round"
|
||||||
StrokeLineCap="Round"
|
StrokeLineCap="Round"
|
||||||
StrokeThickness="{Binding BorderThickness.Left, RelativeSource={RelativeSource TemplatedParent}}"
|
StrokeThickness="{Binding BorderThickness.Left, RelativeSource={RelativeSource TemplatedParent}}"
|
||||||
SweepAngle="{TemplateBinding Percentage,
|
SweepAngle="{TemplateBinding Percentage,Converter={semi:PositionToAngleConverter}}" />
|
||||||
Converter={StaticResource AngleConverter}}" />
|
|
||||||
<Arc
|
<Arc
|
||||||
Name="IndeterminateIndicator"
|
Name="IndeterminateIndicator"
|
||||||
Opacity="0"
|
Opacity="0"
|
||||||
@@ -376,8 +346,7 @@
|
|||||||
StrokeJoin="Round"
|
StrokeJoin="Round"
|
||||||
StrokeLineCap="Round"
|
StrokeLineCap="Round"
|
||||||
StrokeThickness="{Binding BorderThickness.Left, RelativeSource={RelativeSource TemplatedParent}}"
|
StrokeThickness="{Binding BorderThickness.Left, RelativeSource={RelativeSource TemplatedParent}}"
|
||||||
SweepAngle="{TemplateBinding Percentage,
|
SweepAngle="{TemplateBinding Percentage,Converter={semi:PositionToAngleConverter}}" />
|
||||||
Converter={StaticResource AngleConverter}}" />
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Name="PART_ProgressText"
|
Name="PART_ProgressText"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
@@ -443,4 +412,4 @@
|
|||||||
</Style.Animations>
|
</Style.Animations>
|
||||||
</Style>
|
</Style>
|
||||||
</ControlTheme>
|
</ControlTheme>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
<ResourceDictionary
|
<ResourceDictionary
|
||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
xmlns:converters="using:Avalonia.Controls.Converters">
|
|
||||||
<Design.PreviewWith>
|
<Design.PreviewWith>
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<ScrollBar Width="200" Orientation="Horizontal" />
|
<ScrollBar Width="200" Orientation="Horizontal" />
|
||||||
@@ -54,6 +53,7 @@
|
|||||||
MinWidth="{StaticResource ScrollBarThickness}"
|
MinWidth="{StaticResource ScrollBarThickness}"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Focusable="False"
|
Focusable="False"
|
||||||
|
AutomationProperties.Name="Column left"
|
||||||
Theme="{StaticResource ScrollBarRepeatButton}">
|
Theme="{StaticResource ScrollBarRepeatButton}">
|
||||||
<PathIcon
|
<PathIcon
|
||||||
Theme="{StaticResource InnerPathIcon}"
|
Theme="{StaticResource InnerPathIcon}"
|
||||||
@@ -76,6 +76,7 @@
|
|||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
CornerRadius="0"
|
CornerRadius="0"
|
||||||
Focusable="False"
|
Focusable="False"
|
||||||
|
AutomationProperties.Name="Page left"
|
||||||
Theme="{StaticResource ScrollBarRepeatButton}" />
|
Theme="{StaticResource ScrollBarRepeatButton}" />
|
||||||
</Track.DecreaseButton>
|
</Track.DecreaseButton>
|
||||||
<Track.IncreaseButton>
|
<Track.IncreaseButton>
|
||||||
@@ -86,9 +87,10 @@
|
|||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
CornerRadius="0"
|
CornerRadius="0"
|
||||||
Focusable="False"
|
Focusable="False"
|
||||||
|
AutomationProperties.Name="Page right"
|
||||||
Theme="{StaticResource ScrollBarRepeatButton}" />
|
Theme="{StaticResource ScrollBarRepeatButton}" />
|
||||||
</Track.IncreaseButton>
|
</Track.IncreaseButton>
|
||||||
<Thumb Name="thumb" />
|
<Thumb Name="thumb" AutomationProperties.Name="Position" />
|
||||||
</Track>
|
</Track>
|
||||||
<RepeatButton
|
<RepeatButton
|
||||||
Name="PART_LineDownButton"
|
Name="PART_LineDownButton"
|
||||||
@@ -97,6 +99,7 @@
|
|||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
VerticalContentAlignment="Center"
|
VerticalContentAlignment="Center"
|
||||||
Focusable="False"
|
Focusable="False"
|
||||||
|
AutomationProperties.Name="Column right"
|
||||||
Theme="{DynamicResource ScrollBarRepeatButton}">
|
Theme="{DynamicResource ScrollBarRepeatButton}">
|
||||||
<PathIcon
|
<PathIcon
|
||||||
Theme="{DynamicResource InnerPathIcon}"
|
Theme="{DynamicResource InnerPathIcon}"
|
||||||
@@ -124,6 +127,7 @@
|
|||||||
HorizontalContentAlignment="Center"
|
HorizontalContentAlignment="Center"
|
||||||
VerticalContentAlignment="Center"
|
VerticalContentAlignment="Center"
|
||||||
Focusable="False"
|
Focusable="False"
|
||||||
|
AutomationProperties.Name="Line up"
|
||||||
Theme="{StaticResource ScrollBarRepeatButton}">
|
Theme="{StaticResource ScrollBarRepeatButton}">
|
||||||
<PathIcon
|
<PathIcon
|
||||||
Theme="{StaticResource InnerPathIcon}"
|
Theme="{StaticResource InnerPathIcon}"
|
||||||
@@ -147,6 +151,7 @@
|
|||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
CornerRadius="0"
|
CornerRadius="0"
|
||||||
Focusable="False"
|
Focusable="False"
|
||||||
|
AutomationProperties.Name="Page up"
|
||||||
Theme="{StaticResource ScrollBarRepeatButton}" />
|
Theme="{StaticResource ScrollBarRepeatButton}" />
|
||||||
</Track.DecreaseButton>
|
</Track.DecreaseButton>
|
||||||
<Track.IncreaseButton>
|
<Track.IncreaseButton>
|
||||||
@@ -157,9 +162,10 @@
|
|||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
CornerRadius="0"
|
CornerRadius="0"
|
||||||
Focusable="False"
|
Focusable="False"
|
||||||
|
AutomationProperties.Name="Page down"
|
||||||
Theme="{StaticResource ScrollBarRepeatButton}" />
|
Theme="{StaticResource ScrollBarRepeatButton}" />
|
||||||
</Track.IncreaseButton>
|
</Track.IncreaseButton>
|
||||||
<Thumb Name="thumb" />
|
<Thumb Name="thumb" AutomationProperties.Name="Position" />
|
||||||
</Track>
|
</Track>
|
||||||
<RepeatButton
|
<RepeatButton
|
||||||
Name="PART_LineDownButton"
|
Name="PART_LineDownButton"
|
||||||
@@ -168,6 +174,7 @@
|
|||||||
HorizontalContentAlignment="Center"
|
HorizontalContentAlignment="Center"
|
||||||
VerticalContentAlignment="Center"
|
VerticalContentAlignment="Center"
|
||||||
Focusable="False"
|
Focusable="False"
|
||||||
|
AutomationProperties.Name="Line down"
|
||||||
Theme="{StaticResource ScrollBarRepeatButton}">
|
Theme="{StaticResource ScrollBarRepeatButton}">
|
||||||
<PathIcon
|
<PathIcon
|
||||||
Theme="{StaticResource InnerPathIcon}"
|
Theme="{StaticResource InnerPathIcon}"
|
||||||
|
|||||||
@@ -2,7 +2,10 @@
|
|||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
|
|
||||||
<MenuFlyout x:Key="SelectableTextBlockContextFlyout" Placement="Bottom">
|
<MenuFlyout
|
||||||
|
x:Key="SelectableTextBlockContextFlyout"
|
||||||
|
ShowMode="{OnFormFactor Desktop=Standard, Mobile=Transient}"
|
||||||
|
Placement="Bottom">
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Command="{Binding $parent[SelectableTextBlock].Copy}"
|
Command="{Binding $parent[SelectableTextBlock].Copy}"
|
||||||
Header="{DynamicResource STRING_MENU_COPY}"
|
Header="{DynamicResource STRING_MENU_COPY}"
|
||||||
|
|||||||
@@ -92,11 +92,12 @@
|
|||||||
VerticalAlignment="Bottom"
|
VerticalAlignment="Bottom"
|
||||||
Fill="{DynamicResource SliderTickForeground}"
|
Fill="{DynamicResource SliderTickForeground}"
|
||||||
IsVisible="False"
|
IsVisible="False"
|
||||||
Maximum="{TemplateBinding Slider.Maximum}"
|
Maximum="{TemplateBinding Maximum}"
|
||||||
Minimum="{TemplateBinding Slider.Minimum}"
|
Minimum="{TemplateBinding Minimum}"
|
||||||
Orientation="{TemplateBinding Slider.Orientation}"
|
Orientation="{TemplateBinding Orientation}"
|
||||||
Placement="Top"
|
Placement="Top"
|
||||||
TickFrequency="{TemplateBinding Slider.TickFrequency}"
|
IsDirectionReversed="{TemplateBinding IsDirectionReversed}"
|
||||||
|
TickFrequency="{TemplateBinding TickFrequency}"
|
||||||
Ticks="{TemplateBinding Ticks}" />
|
Ticks="{TemplateBinding Ticks}" />
|
||||||
<TickBar
|
<TickBar
|
||||||
Name="BottomTickBar"
|
Name="BottomTickBar"
|
||||||
@@ -106,11 +107,12 @@
|
|||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
Fill="{DynamicResource SliderTickForeground}"
|
Fill="{DynamicResource SliderTickForeground}"
|
||||||
IsVisible="False"
|
IsVisible="False"
|
||||||
Maximum="{TemplateBinding Slider.Maximum}"
|
Maximum="{TemplateBinding Maximum}"
|
||||||
Minimum="{TemplateBinding Slider.Minimum}"
|
Minimum="{TemplateBinding Minimum}"
|
||||||
Orientation="{TemplateBinding Slider.Orientation}"
|
Orientation="{TemplateBinding Orientation}"
|
||||||
Placement="Bottom"
|
Placement="Bottom"
|
||||||
TickFrequency="{TemplateBinding Slider.TickFrequency}"
|
IsDirectionReversed="{TemplateBinding IsDirectionReversed}"
|
||||||
|
TickFrequency="{TemplateBinding TickFrequency}"
|
||||||
Ticks="{TemplateBinding Ticks}" />
|
Ticks="{TemplateBinding Ticks}" />
|
||||||
<Track
|
<Track
|
||||||
Name="PART_Track"
|
Name="PART_Track"
|
||||||
@@ -169,11 +171,12 @@
|
|||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
Fill="{DynamicResource SliderTickForeground}"
|
Fill="{DynamicResource SliderTickForeground}"
|
||||||
IsVisible="False"
|
IsVisible="False"
|
||||||
Maximum="{TemplateBinding Slider.Maximum}"
|
Maximum="{TemplateBinding Maximum}"
|
||||||
Minimum="{TemplateBinding Slider.Minimum}"
|
Minimum="{TemplateBinding Minimum}"
|
||||||
Orientation="{TemplateBinding Slider.Orientation}"
|
Orientation="{TemplateBinding Orientation}"
|
||||||
Placement="Left"
|
Placement="Left"
|
||||||
TickFrequency="{TemplateBinding Slider.TickFrequency}"
|
IsDirectionReversed="{TemplateBinding IsDirectionReversed}"
|
||||||
|
TickFrequency="{TemplateBinding TickFrequency}"
|
||||||
Ticks="{TemplateBinding Ticks}" />
|
Ticks="{TemplateBinding Ticks}" />
|
||||||
<TickBar
|
<TickBar
|
||||||
Name="RightTickBar"
|
Name="RightTickBar"
|
||||||
@@ -183,11 +186,12 @@
|
|||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Fill="{DynamicResource SliderTickForeground}"
|
Fill="{DynamicResource SliderTickForeground}"
|
||||||
IsVisible="False"
|
IsVisible="False"
|
||||||
Maximum="{TemplateBinding Slider.Maximum}"
|
Maximum="{TemplateBinding Maximum}"
|
||||||
Minimum="{TemplateBinding Slider.Minimum}"
|
Minimum="{TemplateBinding Minimum}"
|
||||||
Orientation="{TemplateBinding Slider.Orientation}"
|
Orientation="{TemplateBinding Orientation}"
|
||||||
Placement="Right"
|
Placement="Right"
|
||||||
TickFrequency="{TemplateBinding Slider.TickFrequency}"
|
IsDirectionReversed="{TemplateBinding IsDirectionReversed}"
|
||||||
|
TickFrequency="{TemplateBinding TickFrequency}"
|
||||||
Ticks="{TemplateBinding Ticks}" />
|
Ticks="{TemplateBinding Ticks}" />
|
||||||
<Track
|
<Track
|
||||||
Name="PART_Track"
|
Name="PART_Track"
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
<ResourceDictionary
|
<ResourceDictionary
|
||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:iri="https://irihi.tech/shared">
|
||||||
<Design.PreviewWith>
|
<Design.PreviewWith>
|
||||||
<StackPanel Width="500" Height="500" Margin="20" Spacing="8">
|
<StackPanel Width="500" Height="500" Margin="20" Spacing="8">
|
||||||
<SplitButton
|
<SplitButton
|
||||||
Theme="{DynamicResource SolidSplitButton}"
|
Theme="{DynamicResource OutlineSplitButton}"
|
||||||
|
Classes="Danger"
|
||||||
|
CornerRadius="12"
|
||||||
Content="Hello" />
|
Content="Hello" />
|
||||||
<ToggleSplitButton
|
<ToggleSplitButton
|
||||||
IsChecked="True"
|
IsChecked="True"
|
||||||
@@ -73,47 +76,40 @@
|
|||||||
<Setter Property="Cursor" Value="Hand" />
|
<Setter Property="Cursor" Value="Hand" />
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<ControlTemplate TargetType="SplitButton">
|
<ControlTemplate TargetType="SplitButton">
|
||||||
<Border
|
<Grid
|
||||||
BackgroundSizing="OuterBorderEdge"
|
ColumnDefinitions="*,Auto"
|
||||||
ClipToBounds="True"
|
ColumnSpacing="{DynamicResource SplitButtonSeparatorWidth}">
|
||||||
CornerRadius="{TemplateBinding CornerRadius}">
|
<Button
|
||||||
<DockPanel>
|
Name="PART_PrimaryButton"
|
||||||
<Button
|
Grid.Column="0"
|
||||||
Name="PART_SecondaryButton"
|
Padding="{TemplateBinding Padding}"
|
||||||
Padding="4,0"
|
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||||
BorderThickness="{TemplateBinding BorderThickness}"
|
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||||
CornerRadius="0"
|
BorderThickness="{TemplateBinding BorderThickness}"
|
||||||
DockPanel.Dock="Right"
|
Command="{TemplateBinding Command}"
|
||||||
Theme="{DynamicResource SemiSplitButtonElement}">
|
CommandParameter="{TemplateBinding CommandParameter}"
|
||||||
<PathIcon
|
Content="{TemplateBinding Content}"
|
||||||
Theme="{DynamicResource InnerPathIcon}"
|
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||||
Data="{DynamicResource SplitButtonIconGlyph}"
|
CornerRadius="{TemplateBinding CornerRadius, Converter={iri:CornerRadiusMixerConverter Left}}"
|
||||||
Foreground="{Binding $parent[Button].Foreground}" />
|
FontFamily="{TemplateBinding FontFamily}"
|
||||||
</Button>
|
FontSize="{TemplateBinding FontSize}"
|
||||||
<Rectangle
|
FontWeight="{TemplateBinding FontWeight}"
|
||||||
Name="SeparatorBorder"
|
Theme="{DynamicResource SemiSplitButtonElement}" />
|
||||||
Width="{DynamicResource SplitButtonSeparatorWidth}"
|
<Button
|
||||||
VerticalAlignment="Stretch"
|
Name="PART_SecondaryButton"
|
||||||
DockPanel.Dock="Right"
|
Grid.Column="1"
|
||||||
Fill="Transparent"
|
Padding="0"
|
||||||
StrokeThickness="0" />
|
MinHeight="{TemplateBinding MinHeight}"
|
||||||
<Button
|
MinWidth="{Binding $self.MinHeight}"
|
||||||
Name="PART_PrimaryButton"
|
BorderThickness="{TemplateBinding BorderThickness}"
|
||||||
Padding="{TemplateBinding Padding}"
|
CornerRadius="{TemplateBinding CornerRadius, Converter={iri:CornerRadiusMixerConverter Right}}"
|
||||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
Theme="{DynamicResource SemiSplitButtonElement}">
|
||||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
<PathIcon
|
||||||
BorderThickness="{TemplateBinding BorderThickness}"
|
Theme="{DynamicResource InnerPathIcon}"
|
||||||
Command="{TemplateBinding Command}"
|
Data="{DynamicResource SplitButtonIconGlyph}"
|
||||||
CommandParameter="{TemplateBinding CommandParameter}"
|
Foreground="{Binding $parent[Button].Foreground}" />
|
||||||
Content="{TemplateBinding Content}"
|
</Button>
|
||||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
</Grid>
|
||||||
CornerRadius="0"
|
|
||||||
FontFamily="{TemplateBinding FontFamily}"
|
|
||||||
FontSize="{TemplateBinding FontSize}"
|
|
||||||
FontWeight="{TemplateBinding FontWeight}"
|
|
||||||
Theme="{DynamicResource SemiSplitButtonElement}" />
|
|
||||||
</DockPanel>
|
|
||||||
</Border>
|
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter>
|
</Setter>
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
<ResourceDictionary
|
||||||
|
xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
x:CompileBindings="True">
|
||||||
<ControlTheme x:Key="{x:Type SplitView}" TargetType="SplitView">
|
<ControlTheme x:Key="{x:Type SplitView}" TargetType="SplitView">
|
||||||
<Setter Property="OpenPaneLength" Value="{DynamicResource SplitViewOpenPaneThemeLength}" />
|
<Setter Property="OpenPaneLength" Value="{DynamicResource SplitViewOpenPaneThemeLength}" />
|
||||||
<Setter Property="CompactPaneLength" Value="{DynamicResource SplitViewCompactPaneThemeLength}" />
|
<Setter Property="CompactPaneLength" Value="{DynamicResource SplitViewCompactPaneThemeLength}" />
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
<ResourceDictionary
|
<ResourceDictionary
|
||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
<MenuFlyout x:Key="DefaultTextBoxContextFlyout" Placement="Bottom">
|
<MenuFlyout
|
||||||
|
x:Key="DefaultTextBoxContextFlyout"
|
||||||
|
ShowMode="{OnFormFactor Desktop=Standard, Mobile=Transient}"
|
||||||
|
Placement="Bottom">
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Command="{Binding $parent[TextBox].Cut}"
|
Command="{Binding $parent[TextBox].Cut}"
|
||||||
Header="{DynamicResource STRING_MENU_CUT}"
|
Header="{DynamicResource STRING_MENU_CUT}"
|
||||||
@@ -21,6 +24,7 @@
|
|||||||
|
|
||||||
<ControlTheme x:Key="{x:Type TextBox}" TargetType="TextBox">
|
<ControlTheme x:Key="{x:Type TextBox}" TargetType="TextBox">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource TextBoxForeground}" />
|
<Setter Property="Foreground" Value="{DynamicResource TextBoxForeground}" />
|
||||||
|
<Setter Property="PlaceholderForeground" Value="{DynamicResource TextBoxPlaceholderForeground}" />
|
||||||
<Setter Property="Background" Value="{DynamicResource TextBoxDefaultBackground}" />
|
<Setter Property="Background" Value="{DynamicResource TextBoxDefaultBackground}" />
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource TextBoxDefaultBorderBrush}" />
|
<Setter Property="BorderBrush" Value="{DynamicResource TextBoxDefaultBorderBrush}" />
|
||||||
<Setter Property="SelectionBrush" Value="{DynamicResource TextBoxSelectionBackground}" />
|
<Setter Property="SelectionBrush" Value="{DynamicResource TextBoxSelectionBackground}" />
|
||||||
@@ -66,8 +70,8 @@
|
|||||||
Name="PART_Watermark"
|
Name="PART_Watermark"
|
||||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||||
Opacity="0.5"
|
Foreground="{TemplateBinding PlaceholderForeground}"
|
||||||
Text="{TemplateBinding Watermark}"
|
Text="{TemplateBinding PlaceholderText}"
|
||||||
TextAlignment="{TemplateBinding TextAlignment}"
|
TextAlignment="{TemplateBinding TextAlignment}"
|
||||||
TextWrapping="{TemplateBinding TextWrapping}">
|
TextWrapping="{TemplateBinding TextWrapping}">
|
||||||
<TextBlock.IsVisible>
|
<TextBlock.IsVisible>
|
||||||
@@ -254,6 +258,7 @@
|
|||||||
|
|
||||||
<ControlTheme x:Key="NonErrorTextBox" TargetType="TextBox">
|
<ControlTheme x:Key="NonErrorTextBox" TargetType="TextBox">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource TextBoxForeground}" />
|
<Setter Property="Foreground" Value="{DynamicResource TextBoxForeground}" />
|
||||||
|
<Setter Property="PlaceholderForeground" Value="{DynamicResource TextBoxPlaceholderForeground}" />
|
||||||
<Setter Property="Background" Value="{DynamicResource TextBoxDefaultBackground}" />
|
<Setter Property="Background" Value="{DynamicResource TextBoxDefaultBackground}" />
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource TextBoxDefaultBorderBrush}" />
|
<Setter Property="BorderBrush" Value="{DynamicResource TextBoxDefaultBorderBrush}" />
|
||||||
<Setter Property="SelectionBrush" Value="{DynamicResource TextBoxSelectionBackground}" />
|
<Setter Property="SelectionBrush" Value="{DynamicResource TextBoxSelectionBackground}" />
|
||||||
@@ -300,7 +305,8 @@
|
|||||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||||
Opacity="0.5"
|
Opacity="0.5"
|
||||||
Text="{TemplateBinding Watermark}"
|
Foreground="{TemplateBinding PlaceholderForeground}"
|
||||||
|
Text="{TemplateBinding PlaceholderText}"
|
||||||
TextAlignment="{TemplateBinding TextAlignment}"
|
TextAlignment="{TemplateBinding TextAlignment}"
|
||||||
TextWrapping="{TemplateBinding TextWrapping}">
|
TextWrapping="{TemplateBinding TextWrapping}">
|
||||||
<TextBlock.IsVisible>
|
<TextBlock.IsVisible>
|
||||||
@@ -487,6 +493,7 @@
|
|||||||
|
|
||||||
<ControlTheme x:Key="LooklessTextBox" TargetType="TextBox">
|
<ControlTheme x:Key="LooklessTextBox" TargetType="TextBox">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource TextBoxForeground}" />
|
<Setter Property="Foreground" Value="{DynamicResource TextBoxForeground}" />
|
||||||
|
<Setter Property="PlaceholderForeground" Value="{DynamicResource TextBoxPlaceholderForeground}" />
|
||||||
<Setter Property="SelectionBrush" Value="{DynamicResource TextBoxSelectionBackground}" />
|
<Setter Property="SelectionBrush" Value="{DynamicResource TextBoxSelectionBackground}" />
|
||||||
<Setter Property="SelectionForegroundBrush" Value="{DynamicResource TextBoxSelectionForeground}" />
|
<Setter Property="SelectionForegroundBrush" Value="{DynamicResource TextBoxSelectionForeground}" />
|
||||||
<Setter Property="CaretBrush" Value="{DynamicResource TextBoxTextCaretBrush}" />
|
<Setter Property="CaretBrush" Value="{DynamicResource TextBoxTextCaretBrush}" />
|
||||||
@@ -520,7 +527,8 @@
|
|||||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||||
Opacity="0.5"
|
Opacity="0.5"
|
||||||
Text="{TemplateBinding Watermark}"
|
Foreground="{TemplateBinding PlaceholderForeground}"
|
||||||
|
Text="{TemplateBinding PlaceholderText}"
|
||||||
TextAlignment="{TemplateBinding TextAlignment}"
|
TextAlignment="{TemplateBinding TextAlignment}"
|
||||||
TextWrapping="{TemplateBinding TextWrapping}">
|
TextWrapping="{TemplateBinding TextWrapping}">
|
||||||
<TextBlock.IsVisible>
|
<TextBlock.IsVisible>
|
||||||
|
|||||||
@@ -2,9 +2,10 @@
|
|||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
<Design.PreviewWith>
|
<Design.PreviewWith>
|
||||||
<Border Padding="20">
|
<StackPanel Margin="20">
|
||||||
<TimePickerPresenter />
|
<TimePickerPresenter />
|
||||||
</Border>
|
<TimePicker UseSeconds="True" Width="500" />
|
||||||
|
</StackPanel>
|
||||||
</Design.PreviewWith>
|
</Design.PreviewWith>
|
||||||
<ControlTheme x:Key="{x:Type TimePickerPresenter}" TargetType="TimePickerPresenter">
|
<ControlTheme x:Key="{x:Type TimePickerPresenter}" TargetType="TimePickerPresenter">
|
||||||
<Setter Property="Width" Value="242" />
|
<Setter Property="Width" Value="242" />
|
||||||
@@ -163,6 +164,7 @@
|
|||||||
<Setter Property="HorizontalAlignment" Value="Left" />
|
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||||
<Setter Property="VerticalAlignment" Value="Center" />
|
<Setter Property="VerticalAlignment" Value="Center" />
|
||||||
<Setter Property="MinHeight" Value="{DynamicResource DateTimePickerButtonDefaultHeight}" />
|
<Setter Property="MinHeight" Value="{DynamicResource DateTimePickerButtonDefaultHeight}" />
|
||||||
|
<Setter Property="MinWidth" Value="242" />
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<ControlTemplate>
|
<ControlTemplate>
|
||||||
<DataValidationErrors>
|
<DataValidationErrors>
|
||||||
@@ -174,8 +176,8 @@
|
|||||||
Name="PART_FlyoutButton"
|
Name="PART_FlyoutButton"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Grid.ColumnSpan="2"
|
Grid.ColumnSpan="2"
|
||||||
Width="242"
|
MinWidth="{TemplateBinding MinWidth}"
|
||||||
MinWidth="242"
|
MaxWidth="{TemplateBinding MaxWidth}"
|
||||||
MinHeight="{TemplateBinding MinHeight}"
|
MinHeight="{TemplateBinding MinHeight}"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
|
|||||||
@@ -16,12 +16,14 @@
|
|||||||
<Border
|
<Border
|
||||||
Name="PART_Background"
|
Name="PART_Background"
|
||||||
Background="{TemplateBinding Background}"
|
Background="{TemplateBinding Background}"
|
||||||
IsHitTestVisible="False" />
|
IsHitTestVisible="False"
|
||||||
|
Win32Properties.NonClientHitTestResult="Caption" />
|
||||||
<CaptionButtons
|
<CaptionButtons
|
||||||
Name="PART_CaptionButtons"
|
Name="PART_CaptionButtons"
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
Foreground="{TemplateBinding Foreground}" />
|
Foreground="{TemplateBinding Foreground}"
|
||||||
|
Win32Properties.NonClientHitTestResult="Client" />
|
||||||
</Panel>
|
</Panel>
|
||||||
</Panel>
|
</Panel>
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<ResourceDictionary
|
<ResourceDictionary
|
||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:converters="clr-namespace:Semi.Avalonia.Converters">
|
xmlns:converters="using:Avalonia.Controls.Converters">
|
||||||
|
|
||||||
<Design.PreviewWith>
|
<Design.PreviewWith>
|
||||||
<StackPanel
|
<StackPanel
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
<ResourceInclude Source="Expander.axaml" />
|
<ResourceInclude Source="Expander.axaml" />
|
||||||
<ResourceInclude Source="FlyoutPresenter.axaml" />
|
<ResourceInclude Source="FlyoutPresenter.axaml" />
|
||||||
<ResourceInclude Source="GridSplitter.axaml" />
|
<ResourceInclude Source="GridSplitter.axaml" />
|
||||||
|
<ResourceInclude Source="GroupBox.axaml" />
|
||||||
<ResourceInclude Source="HeaderedContentControl.axaml" />
|
<ResourceInclude Source="HeaderedContentControl.axaml" />
|
||||||
<ResourceInclude Source="HyperlinkButton.axaml" />
|
<ResourceInclude Source="HyperlinkButton.axaml" />
|
||||||
<ResourceInclude Source="ItemsControl.axaml" />
|
<ResourceInclude Source="ItemsControl.axaml" />
|
||||||
|
|||||||
@@ -1,26 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Globalization;
|
|
||||||
using Avalonia;
|
|
||||||
using Avalonia.Data.Converters;
|
|
||||||
using Avalonia.Metadata;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Converters;
|
|
||||||
|
|
||||||
public class KeyToPathConverter: IValueConverter
|
|
||||||
{
|
|
||||||
[Content]
|
|
||||||
public IDictionary<string, object?> Resources { get; } = new Dictionary<string, object?>();
|
|
||||||
|
|
||||||
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
|
||||||
{
|
|
||||||
if(value is string s && Resources.TryGetValue(s, out var v))
|
|
||||||
return v;
|
|
||||||
return AvaloniaProperty.UnsetValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -2,56 +2,36 @@ using System;
|
|||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using Avalonia;
|
using Avalonia;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Data.Converters;
|
using Irihi.Avalonia.Shared.Converters;
|
||||||
|
|
||||||
namespace Semi.Avalonia.Converters;
|
namespace Semi.Avalonia.Converters;
|
||||||
|
|
||||||
public class PlacementToRenderTransformOriginConverter: IValueConverter
|
public class PlacementToRenderTransformOriginConverter : MarkupValueConverter
|
||||||
{
|
{
|
||||||
public static PlacementToRenderTransformOriginConverter Instance { get; } = new PlacementToRenderTransformOriginConverter();
|
public override object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||||
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
|
||||||
{
|
{
|
||||||
if (value is not PlacementMode p)
|
if (value is not PlacementMode p)
|
||||||
{
|
{
|
||||||
return new RelativePoint(0.5, 0.5, RelativeUnit.Relative);
|
return new RelativePoint(0.5, 0.5, RelativeUnit.Relative);
|
||||||
}
|
}
|
||||||
switch (p)
|
|
||||||
{
|
|
||||||
case PlacementMode.Bottom:
|
|
||||||
return new RelativePoint(0.5, 0.0, RelativeUnit.Relative);
|
|
||||||
case PlacementMode.Left:
|
|
||||||
return new RelativePoint(1.0, 0.5, RelativeUnit.Relative);
|
|
||||||
case PlacementMode.Right:
|
|
||||||
return new RelativePoint(0.0, 0.5, RelativeUnit.Relative);
|
|
||||||
case PlacementMode.Top:
|
|
||||||
return new RelativePoint(0.5, 1.0, RelativeUnit.Relative);
|
|
||||||
case PlacementMode.Pointer:
|
|
||||||
return new RelativePoint(0.0, 0.0, RelativeUnit.Relative);
|
|
||||||
case PlacementMode.Center:
|
|
||||||
case PlacementMode.AnchorAndGravity:
|
|
||||||
return new RelativePoint(0.5, 0.5, RelativeUnit.Relative);
|
|
||||||
case PlacementMode.BottomEdgeAlignedLeft:
|
|
||||||
return new RelativePoint(0.0, 0.0, RelativeUnit.Relative);
|
|
||||||
case PlacementMode.BottomEdgeAlignedRight:
|
|
||||||
return new RelativePoint(1.0, 0.0, RelativeUnit.Relative);
|
|
||||||
case PlacementMode.LeftEdgeAlignedTop:
|
|
||||||
return new RelativePoint(1.0, 1.0, RelativeUnit.Relative);
|
|
||||||
case PlacementMode.LeftEdgeAlignedBottom:
|
|
||||||
return new RelativePoint(1.0, 0.0, RelativeUnit.Relative);
|
|
||||||
case PlacementMode.RightEdgeAlignedTop:
|
|
||||||
return new RelativePoint(0.0, 1.0, RelativeUnit.Relative);
|
|
||||||
case PlacementMode.RightEdgeAlignedBottom:
|
|
||||||
return new RelativePoint(0.0, 0.0, RelativeUnit.Relative);
|
|
||||||
case PlacementMode.TopEdgeAlignedLeft:
|
|
||||||
return new RelativePoint(0.0, 1.0, RelativeUnit.Relative);
|
|
||||||
case PlacementMode.TopEdgeAlignedRight:
|
|
||||||
return new RelativePoint(1.0, 1.0, RelativeUnit.Relative);
|
|
||||||
}
|
|
||||||
return new RelativePoint(0.5, 0.5, RelativeUnit.Relative);
|
|
||||||
}
|
|
||||||
|
|
||||||
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
return p switch
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
PlacementMode.Bottom => new RelativePoint(0.5, 0.0, RelativeUnit.Relative),
|
||||||
|
PlacementMode.Left => new RelativePoint(1.0, 0.5, RelativeUnit.Relative),
|
||||||
|
PlacementMode.Right => new RelativePoint(0.0, 0.5, RelativeUnit.Relative),
|
||||||
|
PlacementMode.Top => new RelativePoint(0.5, 1.0, RelativeUnit.Relative),
|
||||||
|
PlacementMode.Pointer => new RelativePoint(0.0, 0.0, RelativeUnit.Relative),
|
||||||
|
PlacementMode.Center or PlacementMode.AnchorAndGravity => new RelativePoint(0.5, 0.5, RelativeUnit.Relative),
|
||||||
|
PlacementMode.BottomEdgeAlignedLeft => new RelativePoint(0.0, 0.0, RelativeUnit.Relative),
|
||||||
|
PlacementMode.BottomEdgeAlignedRight => new RelativePoint(1.0, 0.0, RelativeUnit.Relative),
|
||||||
|
PlacementMode.LeftEdgeAlignedTop => new RelativePoint(1.0, 1.0, RelativeUnit.Relative),
|
||||||
|
PlacementMode.LeftEdgeAlignedBottom => new RelativePoint(1.0, 0.0, RelativeUnit.Relative),
|
||||||
|
PlacementMode.RightEdgeAlignedTop => new RelativePoint(0.0, 1.0, RelativeUnit.Relative),
|
||||||
|
PlacementMode.RightEdgeAlignedBottom => new RelativePoint(0.0, 0.0, RelativeUnit.Relative),
|
||||||
|
PlacementMode.TopEdgeAlignedLeft => new RelativePoint(0.0, 1.0, RelativeUnit.Relative),
|
||||||
|
PlacementMode.TopEdgeAlignedRight => new RelativePoint(1.0, 1.0, RelativeUnit.Relative),
|
||||||
|
_ => new RelativePoint(0.5, 0.5, RelativeUnit.Relative)
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,27 +1,18 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using Avalonia.Data.Converters;
|
using Irihi.Avalonia.Shared.Converters;
|
||||||
|
|
||||||
namespace Semi.Avalonia.Converters;
|
namespace Semi.Avalonia.Converters;
|
||||||
|
|
||||||
public class PositionToAngleConverter: IValueConverter
|
public class PositionToAngleConverter : MarkupValueConverter
|
||||||
{
|
{
|
||||||
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
public override object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||||
{
|
{
|
||||||
if (value is double d)
|
return value is double d ? d * 3.6 : 0;
|
||||||
{
|
|
||||||
return d * 3.6;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
public override object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||||
{
|
{
|
||||||
if (value is double d)
|
return value is double d ? d / 3.6 : 0;
|
||||||
{
|
|
||||||
return d / 3.6;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Globalization;
|
|
||||||
using Avalonia;
|
|
||||||
using Avalonia.Data.Converters;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Converters;
|
|
||||||
|
|
||||||
public class TreeViewItemIndentConverter : IMultiValueConverter
|
|
||||||
{
|
|
||||||
public static readonly TreeViewItemIndentConverter Instance = new();
|
|
||||||
|
|
||||||
public object? Convert(IList<object?> values, Type targetType, object? parameter, CultureInfo culture)
|
|
||||||
{
|
|
||||||
if (values.Count > 1 && values[0] is int level && values[1] is double indent)
|
|
||||||
{
|
|
||||||
return new Thickness(indent * level, 0, 0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
return new Thickness(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using Avalonia.Metadata;
|
using Avalonia.Metadata;
|
||||||
|
|
||||||
[assembly:XmlnsPrefix("https://irihi.tech/semi", "semi")]
|
[assembly: XmlnsPrefix("https://irihi.tech/semi", "semi")]
|
||||||
[assembly:XmlnsDefinition("https://irihi.tech/semi", "Semi.Avalonia")]
|
[assembly: XmlnsDefinition("https://irihi.tech/semi", "Semi.Avalonia")]
|
||||||
|
[assembly: XmlnsDefinition("https://irihi.tech/semi", "Semi.Avalonia.Converters")]
|
||||||
@@ -1,14 +1,15 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
|
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
|
||||||
<Version>11.3.7.2</Version>
|
<Version>12.0.0-preview1</Version>
|
||||||
<PackageReleaseNotes>Update to Semi.Avalonia 11.3.7.2</PackageReleaseNotes>
|
<PackageReleaseNotes>Update to Semi.Avalonia 12.0.0-preview1</PackageReleaseNotes>
|
||||||
<Title>Semi.Avalonia</Title>
|
<Title>Semi.Avalonia</Title>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Avalonia"/>
|
<PackageReference Include="Avalonia"/>
|
||||||
|
<PackageReference Include="Irihi.Avalonia.Shared"/>
|
||||||
<None Include="README.md" Pack="true" PackagePath="\"/>
|
<None Include="README.md" Pack="true" PackagePath="\"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
<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" />
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
<StaticResource x:Key="TextBoxPressedBackground" ResourceKey="SemiColorFill2" />
|
<StaticResource x:Key="TextBoxPressedBackground" ResourceKey="SemiColorFill2" />
|
||||||
<StaticResource x:Key="TextBoxFocusBorderBrush" ResourceKey="SemiColorPrimary" />
|
<StaticResource x:Key="TextBoxFocusBorderBrush" ResourceKey="SemiColorPrimary" />
|
||||||
<StaticResource x:Key="TextBoxForeground" ResourceKey="SemiColorText0" />
|
<StaticResource x:Key="TextBoxForeground" ResourceKey="SemiColorText0" />
|
||||||
|
<StaticResource x:Key="TextBoxPlaceholderForeground" ResourceKey="SemiColorText2" />
|
||||||
<StaticResource x:Key="TextBoxInnerForeground" ResourceKey="SemiColorText2" />
|
<StaticResource x:Key="TextBoxInnerForeground" ResourceKey="SemiColorText2" />
|
||||||
<StaticResource x:Key="TextBoxDisabledBackground" ResourceKey="SemiColorDisabledFill" />
|
<StaticResource x:Key="TextBoxDisabledBackground" ResourceKey="SemiColorDisabledFill" />
|
||||||
<StaticResource x:Key="TextBoxDisabledForeground" ResourceKey="SemiColorDisabledText" />
|
<StaticResource x:Key="TextBoxDisabledForeground" ResourceKey="SemiColorDisabledText" />
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
<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>
|
||||||
@@ -7,6 +7,7 @@
|
|||||||
<StaticResource x:Key="TextBoxPressedBackground" ResourceKey="SemiColorHighlightText" />
|
<StaticResource x:Key="TextBoxPressedBackground" ResourceKey="SemiColorHighlightText" />
|
||||||
<StaticResource x:Key="TextBoxFocusBorderBrush" ResourceKey="SemiColorHighlight" />
|
<StaticResource x:Key="TextBoxFocusBorderBrush" ResourceKey="SemiColorHighlight" />
|
||||||
<StaticResource x:Key="TextBoxForeground" ResourceKey="SemiColorWindowText" />
|
<StaticResource x:Key="TextBoxForeground" ResourceKey="SemiColorWindowText" />
|
||||||
|
<StaticResource x:Key="TextBoxPlaceholderForeground" ResourceKey="SemiColorWindowText" />
|
||||||
<StaticResource x:Key="TextBoxInnerForeground" ResourceKey="SemiColorWindowText" />
|
<StaticResource x:Key="TextBoxInnerForeground" ResourceKey="SemiColorWindowText" />
|
||||||
<StaticResource x:Key="TextBoxDisabledBackground" ResourceKey="SemiColorWindow" />
|
<StaticResource x:Key="TextBoxDisabledBackground" ResourceKey="SemiColorWindow" />
|
||||||
<StaticResource x:Key="TextBoxDisabledForeground" ResourceKey="SemiColorGrayText" />
|
<StaticResource x:Key="TextBoxDisabledForeground" ResourceKey="SemiColorGrayText" />
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
<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" />
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
<StaticResource x:Key="TextBoxPressedBackground" ResourceKey="SemiColorFill2" />
|
<StaticResource x:Key="TextBoxPressedBackground" ResourceKey="SemiColorFill2" />
|
||||||
<StaticResource x:Key="TextBoxFocusBorderBrush" ResourceKey="SemiColorPrimary" />
|
<StaticResource x:Key="TextBoxFocusBorderBrush" ResourceKey="SemiColorPrimary" />
|
||||||
<StaticResource x:Key="TextBoxForeground" ResourceKey="SemiColorText0" />
|
<StaticResource x:Key="TextBoxForeground" ResourceKey="SemiColorText0" />
|
||||||
|
<StaticResource x:Key="TextBoxPlaceholderForeground" ResourceKey="SemiColorText2" />
|
||||||
<StaticResource x:Key="TextBoxInnerForeground" ResourceKey="SemiColorText2" />
|
<StaticResource x:Key="TextBoxInnerForeground" ResourceKey="SemiColorText2" />
|
||||||
<StaticResource x:Key="TextBoxDisabledBackground" ResourceKey="SemiColorDisabledFill" />
|
<StaticResource x:Key="TextBoxDisabledBackground" ResourceKey="SemiColorDisabledFill" />
|
||||||
<StaticResource x:Key="TextBoxDisabledForeground" ResourceKey="SemiColorDisabledText" />
|
<StaticResource x:Key="TextBoxDisabledForeground" ResourceKey="SemiColorDisabledText" />
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
<StaticResource x:Key="TextBoxSmallHeight" ResourceKey="SemiHeightControlSmall" />
|
<StaticResource x:Key="TextBoxSmallHeight" ResourceKey="SemiHeightControlSmall" />
|
||||||
<StaticResource x:Key="TextBoxLargeHeight" ResourceKey="SemiHeightControlLarge" />
|
<StaticResource x:Key="TextBoxLargeHeight" ResourceKey="SemiHeightControlLarge" />
|
||||||
<StaticResource x:Key="TextBoxDefaultCornerRadius" ResourceKey="SemiBorderRadiusSmall" />
|
<StaticResource x:Key="TextBoxDefaultCornerRadius" ResourceKey="SemiBorderRadiusSmall" />
|
||||||
<Thickness x:Key="TextBoxInnerLeftContentPadding">0 0 8 0</Thickness>
|
<Thickness x:Key="TextBoxInnerLeftContentPadding">0 0 12 0</Thickness>
|
||||||
<Thickness x:Key="TextBoxInnerRightContentPadding">8 0 0 0</Thickness>
|
<Thickness x:Key="TextBoxInnerRightContentPadding">12 0 0 0</Thickness>
|
||||||
<Thickness x:Key="TextBoxContentPadding">8 0</Thickness>
|
<Thickness x:Key="TextBoxContentPadding">12 0</Thickness>
|
||||||
<StaticResource x:Key="TextBoxBorderThickness" ResourceKey="SemiBorderThicknessControl" />
|
<StaticResource x:Key="TextBoxBorderThickness" ResourceKey="SemiBorderThicknessControl" />
|
||||||
<Thickness x:Key="TextBoxTextAreaContentPadding">12 5</Thickness>
|
<Thickness x:Key="TextBoxTextAreaContentPadding">12 5</Thickness>
|
||||||
<x:Double x:Key="TextBoxTextAreaHeight">90</x:Double>
|
<x:Double x:Key="TextBoxTextAreaHeight">90</x:Double>
|
||||||
|
|||||||
@@ -67,7 +67,7 @@
|
|||||||
<FontWeight x:Key="SemiFontWeightRegular">400</FontWeight> <!-- 字重 - 常规 -->
|
<FontWeight x:Key="SemiFontWeightRegular">400</FontWeight> <!-- 字重 - 常规 -->
|
||||||
<FontWeight x:Key="SemiFontWeightBold">600</FontWeight> <!-- 字重 - 粗 -->
|
<FontWeight x:Key="SemiFontWeightBold">600</FontWeight> <!-- 字重 - 粗 -->
|
||||||
<FontFamily x:Key="SemiFontFamilyRegular">
|
<FontFamily x:Key="SemiFontFamilyRegular">
|
||||||
Inter, -apple-system, BlinkMacSystemFont, PingFang SC,
|
fonts:Inter#Inter, Inter, -apple-system, BlinkMacSystemFont, PingFang SC,
|
||||||
Microsoft YaHei, Segoe UI, Hiragino Sans GB, Helvetica Neue,
|
Microsoft YaHei, Segoe UI, Hiragino Sans GB, Helvetica Neue,
|
||||||
Helvetica, Arial, sans-serif
|
Helvetica, Arial, sans-serif
|
||||||
</FontFamily>
|
</FontFamily>
|
||||||
|
|||||||
Reference in New Issue
Block a user