mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-04-27 11:43:23 +08:00
feat: implement CardBorder.
This commit is contained in:
@@ -20,5 +20,8 @@
|
||||
<TabItem Header="Label">
|
||||
<pages:LabelDemo />
|
||||
</TabItem>
|
||||
<TabItem Header="Border">
|
||||
<pages:BorderDemo />
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</Window>
|
||||
|
||||
17
src/Semi.Avalonia.Demo/Pages/BorderDemo.axaml
Normal file
17
src/Semi.Avalonia.Demo/Pages/BorderDemo.axaml
Normal file
@@ -0,0 +1,17 @@
|
||||
<UserControl
|
||||
x:Class="Semi.Avalonia.Demo.Pages.BorderDemo" xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" d:DesignHeight="450"
|
||||
d:DesignWidth="800" mc:Ignorable="d">
|
||||
<StackPanel Margin="20" Spacing="20">
|
||||
<Border Theme="{StaticResource CardBorder}">
|
||||
<TextBlock>Card</TextBlock>
|
||||
</Border>
|
||||
<Border Classes="Shadow" Theme="{StaticResource CardBorder}">
|
||||
<TextBlock>Shadow Always Applied</TextBlock>
|
||||
</Border>
|
||||
<Border Classes="Hover" Theme="{StaticResource CardBorder}">
|
||||
<TextBlock>Shadow on Pointerover</TextBlock>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
18
src/Semi.Avalonia.Demo/Pages/BorderDemo.axaml.cs
Normal file
18
src/Semi.Avalonia.Demo/Pages/BorderDemo.axaml.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
public partial class BorderDemo : UserControl
|
||||
{
|
||||
public BorderDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@ namespace Semi.Avalonia.Demo
|
||||
public static AppBuilder BuildAvaloniaApp()
|
||||
=> AppBuilder.Configure<App>()
|
||||
.UsePlatformDetect()
|
||||
.With(new Win32PlatformOptions(){ UseCompositor = false})
|
||||
.With(new Win32PlatformOptions(){ UseCompositor = true})
|
||||
.LogToTrace();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user