MiniLanguage.axaml代码
<Window 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" Height="380" Width="336" x:Class="AvaloniaUI.MiniLanguage" Title="MiniLanguage"> <StackPanel> <Path Stroke="Blue" StrokeThickness="1"> <Path.Data> <PathGeometry> <PathFigure IsClosed="True" StartPoint="10,100"> <LineSegment Point="100,100" /> <LineSegment Point="100,50" /> </PathFigure> </PathGeometry> </Path.Data> </Path> <Path Stroke="Blue" StrokeThickness="1"> <Path.Data> <!--M 起点; L 连线; Z 结束--> <PathGeometry Figures="M 10,100 L 100,100 L 100,50 Z"></PathGeometry> </Path.Data> </Path> <Path Stroke="Blue" StrokeThickness="1" Data="M 10,100 L 100,100 L 100,50 Z"/> </StackPanel> </Window>
MiniLanguage.axaml.cs代码
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace AvaloniaUI;
public partial class MiniLanguage : Window
{
public MiniLanguage()
{
InitializeComponent();
}
}
运行效果

浙公网安备 33010602011771号