feat: Add EmbeddableControlRoot

This commit is contained in:
rabbitism 2023-03-21 19:19:51 +08:00
parent 2461c4a5c1
commit eca7d32ba9
3 changed files with 28 additions and 1 deletions

View File

@ -19,6 +19,7 @@
<ResourceInclude Source="avares://Semi.Avalonia/Controls/DatePicker.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Controls/DateTimePickerShared.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Controls/DropdownButton.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Controls/EmbeddableControlRoot.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Controls/Expander.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Controls/FlyoutPresenter.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Controls/GridSplitter.axaml" />

View File

@ -0,0 +1,26 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- Add Resources Here -->
<ControlTheme x:Key="{x:Type EmbeddableControlRoot}" TargetType="EmbeddableControlRoot">
<Setter Property="Background" Value="{DynamicResource WindowDefaultBackground}" />
<Setter Property="Foreground" Value="{DynamicResource WindowDefaultForeground}" />
<Setter Property="FontSize" Value="{DynamicResource DefaultFontSize}" />
<Setter Property="FontFamily" Value="{DynamicResource DefaultFontFamily}" />
<Setter Property="Template">
<ControlTemplate>
<Panel>
<Border Name="PART_TransparencyFallback" IsHitTestVisible="False" />
<Border Background="{TemplateBinding Background}">
<VisualLayerManager>
<ContentPresenter
Name="PART_ContentPresenter"
Margin="{TemplateBinding Padding}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}" />
</VisualLayerManager>
</Border>
</Panel>
</ControlTemplate>
</Setter>
</ControlTheme>
</ResourceDictionary>

View File

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../Package.props"/>
<Import Project="../Package.props" />
<PropertyGroup>
<Title>Semi.Avalonia</Title>