Skip to content

Commit

Permalink
Add ControlTheme for UserControl
Browse files Browse the repository at this point in the history
  • Loading branch information
JanTamis committed Jun 5, 2023
1 parent 2b7d152 commit 38f5735
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Material.Styles/Material.Styles.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,25 @@
</PropertyGroup>

<ItemGroup>
<None Remove="Fonts\**"/>
<AvaloniaResource Include="Fonts\**"/>
<None Remove="Fonts\**" />
<AvaloniaResource Include="Fonts\**" />

<AvaloniaResource Include="**\*.xaml">
<SubType>Designer</SubType>
</AvaloniaResource>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Material.Colors\Material.Colors.csproj"/>
<ProjectReference Include="..\Material.Ripple\Material.Ripple.csproj"/>
<ProjectReference Include="..\Material.Colors\Material.Colors.csproj" />
<ProjectReference Include="..\Material.Ripple\Material.Ripple.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.Reactive"/>
<PackageReference Include="System.Reactive" />
</ItemGroup>

<ItemGroup>
<AvaloniaXaml Remove="Resources\Themes\WindowNotificationManager.axaml"/>
<AvaloniaXaml Remove="Resources\Themes\WindowNotificationManager.axaml" />
</ItemGroup>

</Project>
19 changes: 19 additions & 0 deletions Material.Styles/Resources/Themes/UserControl.axaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ControlTheme x:Key="{x:Type UserControl}"
TargetType="UserControl">
<Setter Property="Template">
<ControlTemplate>
<ContentPresenter Name="PART_ContentPresenter"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
ContentTemplate="{TemplateBinding ContentTemplate}"
Content="{TemplateBinding Content}"
Padding="{TemplateBinding Padding}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" />
</ControlTemplate>
</Setter>
</ControlTheme>
</ResourceDictionary>

0 comments on commit 38f5735

Please sign in to comment.