Files
Future/Example/CustomWindow.xaml
2025-08-30 17:19:57 +08:00

63 lines
6.5 KiB
XML

<Window x:Class="Example.CustomWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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"
xmlns:local="clr-namespace:Example"
mc:Ignorable="d"
Title="CustomWindow" Height="450" Width="800" Background="Gray" WindowStyle="ToolWindow">
<Window.Resources>
<Viewbox x:Key="MinButton">
<Path Fill="White" Height="1024" Width="1024" Data="M130 545.3h766c17.7 0 32-14.3 32-32s-14.3-32-32-32H130c-17.7 0-32 14.3-32 32 0 17.6 14.3 32 32 32z"/>
</Viewbox>
<Viewbox x:Key="CloseButton">
<Path Fill="White" Height="1024" Width="1024" Data="M548.992 503.744L885.44 167.328a31.968 31.968 0 1 0-45.248-45.248L503.744 458.496 167.328 122.08a31.968 31.968 0 1 0-45.248 45.248l336.416 336.416L122.08 840.16a31.968 31.968 0 1 0 45.248 45.248l336.416-336.416L840.16 885.44a31.968 31.968 0 1 0 45.248-45.248L548.992 503.744z"/>
</Viewbox>
<Viewbox x:Key="MaxButton">
<Path Fill="White" Height="1024" Width="1024" Data="M959.72 0H294.216a63.96 63.96 0 0 0-63.96 63.96v127.92H64.28A63.96 63.96 0 0 0 0.32 255.84V959.4a63.96 63.96 0 0 0 63.96 63.96h703.56a63.96 63.96 0 0 0 63.96-63.96V792.465h127.92a63.96 63.96 0 0 0 63.96-63.96V63.96A63.96 63.96 0 0 0 959.72 0zM767.84 728.505V959.4H64.28V255.84h703.56z m189.322 0H831.8V255.84a63.96 63.96 0 0 0-63.96-63.96H294.216V63.96H959.72z"/>
</Viewbox>
<Viewbox x:Key="TitleIcon">
<Path Fill="Yellow" Width="1024" Height="1024">
<Path.Data>
<GeometryGroup>
<PathGeometry Figures="M844.318261 412.021885c-9.195123-27.108025-28.565176-78.309281-52.60816-109.562649a26.806546 26.806546 0 0 0-26.128217-10.049314c-68.938296 12.787752-354.740793 76.098432-405.037612 254.574253a26.60556 26.60556 0 0 0 6.255699 25.650875c9.471479 10.049314 29.168135 21.756765 70.093967 25.927231a28.791285 28.791285 0 0 0 2.939424 0.150739c18.515862-0.15074 198.473957-5.602493 395.490763-156.769302a26.756299 26.756299 0 0 0 8.994136-29.921833z m-4.597561 22.78682c0 0.854192-0.401973 1.105425-1.105425 1.582767-186.490149 125.139086-322.507618 144.082043-322.507618 144.082043-107.000074 13.466081-128.128757-24.84693-130.314482-51.427366a49.24164 49.24164 0 0 1 10.551779-34.318408c117.074511-150.488481 353.760985-194.228121 375.392135-197.946368a2.512329 2.512329 0 0 1 2.512328 1.080302c51.15101 72.606296 61.049584 122.099168 62.355995 130.038126a6.858657 6.858657 0 0 0 1.582767 3.090164l0.351726 1.105425c0.301479 0.703452 1.205918 1.281288 1.205918 2.160603z"/>
<PathGeometry Figures="M558.214284 476.764592m-41.026326 0a41.026325 41.026325 0 1 0 82.052651 0 41.026325 41.026325 0 1 0-82.052651 0Z"/>
<PathGeometry Figures="M739.529037 348.736328a36.378518 36.378518 0 1 0 36.378517 36.378518 36.378518 36.378518 0 0 0-36.378517-36.378518z m-0.175863 57.783557a20.977944 20.977944 0 1 1 20.977943-20.977943 20.977944 20.977944 0 0 1-20.977943 20.927697z"/>
<PathGeometry Figures="M745.181776 543.064943s-105.115827-378.884271-462.921662-246.2082c0-0.025123 302.861209-110.944429 462.921662 246.2082zM819.898427 547.93886c-142.800756 153.252042-302.18288 88.710322-323.185946 79.238843a0.854192 0.854192 0 0 0-1.080302 1.205918c49.040654 89.187664 127.676538 98.608896 158.653549 99.061115a71.601364 71.601364 0 0 0 23.364656-3.567506c145.539194-47.2569 145.564317-156.36733 144.333276-175.209795a1.180794 1.180794 0 0 0-2.085233-0.728575z m-136.042591 159.432371s-98.156677 32.409038-147.699797-55.798818a1.030055 1.030055 0 0 1 1.306411-1.432027c19.922766 8.742903 142.44903 55.472215 253.192473-60.923968a2.788685 2.788685 0 0 1 4.748301 1.532521c2.788685 20.299615 3.51726 83.158076-111.547388 116.622292z"/>
<PathGeometry Figures="M125.239579 608.661842a101.045855 81.851665 90 1 0 163.703329 0 101.045855 81.851665 90 1 0-163.703329 0Z"/>
<PathGeometry Figures="M517.162835 168.552123S198.750313 162.422042 200.40845 500.38048l-41.754901 17.410437S165.813685 156.844672 517.162835 168.552123zM222.140092 709.707696s125.264702 173.702397 350.670821 140.313551c0 0 272.261047-45.046051 287.284771-342.380137 0.07537 0-151.920508 554.496038-637.955592 202.066586z"/>
<PathGeometry Figures="M935.365048 266.256581m-45.071174 0a45.071174 45.071174 0 1 0 90.142349 0 45.071174 45.071174 0 1 0-90.142349 0Z"/>
<PathGeometry Figures="M255.704801 928.380775m-45.071174 0a45.071174 45.071174 0 1 0 90.142349 0 45.071174 45.071174 0 1 0-90.142349 0Z"/>
</GeometryGroup>
</Path.Data>
</Path>
</Viewbox>
</Window.Resources>
<WindowChrome.WindowChrome>
<WindowChrome CaptionHeight="40"/>
</WindowChrome.WindowChrome>
<Grid Margin="8">
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition/>
<RowDefinition Height="8"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0" Background="Gray">
<Grid HorizontalAlignment="Left" Width="auto">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="32"/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<ContentControl Content="{StaticResource TitleIcon}" Margin="2"/>
</Grid>
<TextBlock HorizontalAlignment="Center" Text="自动化测试系统" Foreground="White" VerticalAlignment="Center"/>
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal" WindowChrome.IsHitTestVisibleInChrome="True">
<Button Height="auto" Width="{Binding RelativeSource={RelativeSource Mode=Self}}" Background="Transparent" BorderBrush="Transparent" Content="{StaticResource MinButton}" Padding="6"/>
<Button Height="auto" Width="{Binding RelativeSource={RelativeSource Mode=Self}}" Background="Transparent" BorderBrush="Transparent" Content="{StaticResource MaxButton}" Padding="6"/>
<Button Height="auto" Width="{Binding RelativeSource={RelativeSource Mode=Self}}" Background="Transparent" BorderBrush="Transparent" Content="{StaticResource CloseButton}" Padding="6"/>
</StackPanel>
</Grid>
<Button Grid.Row="1" BorderBrush="Red">测试</Button>
</Grid>
</Window>