mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-05-01 21:41:27 +08:00
feat: add menu infra.
This commit is contained in:
20
demo/Semi.Avalonia.Demo/Pages/MenuDemo.axaml
Normal file
20
demo/Semi.Avalonia.Demo/Pages/MenuDemo.axaml
Normal file
@@ -0,0 +1,20 @@
|
||||
<UserControl
|
||||
x:Class="Semi.Avalonia.Demo.Pages.MenuDemo"
|
||||
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">
|
||||
<Menu>
|
||||
<MenuItem Header="File">
|
||||
<MenuItem Header="Create" />
|
||||
<MenuItem Header="Delete" />
|
||||
</MenuItem>
|
||||
<MenuItem Header="View" />
|
||||
<MenuItem Header="Tools" />
|
||||
</Menu>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
18
demo/Semi.Avalonia.Demo/Pages/MenuDemo.axaml.cs
Normal file
18
demo/Semi.Avalonia.Demo/Pages/MenuDemo.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 MenuDemo : UserControl
|
||||
{
|
||||
public MenuDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user