Views/MenuView.xaml

(开头部分) 10KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<UserControl x:Class="MahAppsMetro.Demo.Views.MenuView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:MahAppsMetro.Demo.Views"
             xmlns:metro="http://metro.mahapps.com/winfx/xaml/controls"
             xmlns:iconPack ="http://metro.mahapps.com/winfx/xaml/iconpacks"
             mc:Ignorable="d" 
             d:DesignHeight="700" d:DesignWidth="800">
    <Grid>
        <TabControl metro:TabControlHelper.Underlined="TabPanel">
            <TabItem Header="Menu1">
                <Grid>
                    <TabControl TabStripPlacement="Left" metro:TabControlHelper.Underlined="TabPanel">
                        <TabControl.Resources>
                            <Style TargetType="{x:Type TabControl}">
                                <Setter Property="Background" Value="{DynamicResource WhiteBrush}"/>
                                <Setter Property="BorderBrush" Value="{x:Null}"/>
                                <Setter Property="metro:TabControlHelper.UnderlineBrush" Value="{DynamicResource GrayNormalBrush}"/>
                                <Setter Property="metro:TabControlHelper.UnderlineMouseOverBrush" Value="{DynamicResource GrayHoverBrush}"/>
                                <Setter Property="metro:TabControlHelper.UnderlineMouseOverSelectedBrush" Value="{DynamicResource HighlightBrush}"/>
                                <Setter Property="metro:TabControlHelper.UnderlineSelectedBrush" Value="{DynamicResource AccentColorBrush}"/>
                                <Setter Property="SnapsToDevicePixels" Value="True"/>
                                <Setter Property="Template">
                                    <Setter.Value>
                                        <ControlTemplate TargetType="{x:Type TabControl}">
                                            <Grid>
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition x:Name="ColumnDefinition0"/>
                                                    <ColumnDefinition x:Name="ColumnDefinition1" Width="0"/>
                                                </Grid.ColumnDefinitions>
                                                <Grid.RowDefinitions>
                                                    <RowDefinition x:Name="RowDefinition0" Height="Auto"/>
                                                    <RowDefinition x:Name="RowDefinition1" Height="*"/>
                                                </Grid.RowDefinitions>
                                                <Grid x:Name="HeaderPanelGrid" Grid.Column="0" Grid.Row="0" Panel.ZIndex="1">
                                                    <metro:Underline x:Name="Underline" BorderBrush="{TemplateBinding metro:TabControlHelper.UnderlineBrush}" Background="Transparent" LineThickness="1" Placement="Bottom" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Visibility="Collapsed"/>
                                                    <TabPanel x:Name="HeaderPanel" IsItemsHost="True" KeyboardNavigation.TabIndex="1" Margin="0,200,0,0"/>
                                                    <StackPanel HorizontalAlignment="Center" VerticalAlignment="Top" Margin="20">
                                                        <Image Source="/Resources/Images/timg.jpg" Width="100" Height="100" VerticalAlignment="Center" HorizontalAlignment="Center" Stretch="Fill">
                                                            <Image.Clip>
                                                                <GeometryGroup FillRule="Nonzero">
                                                                    <EllipseGeometry RadiusX="50" RadiusY="50" Center="50,50" />
                                                                </GeometryGroup>
                                                            </Image.Clip>
                                                        </Image>
                                                        <TextBlock Text="Sunshine" Margin="0,5" FontSize="20" Foreground="#73B3DF" HorizontalAlignment="Center" />
                                                    </StackPanel>
                                                </Grid>
                                                <Border x:Name="ContentPanel" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.Column="0" KeyboardNavigation.DirectionalNavigation="Contained" Grid.Row="1" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" KeyboardNavigation.TabIndex="2" KeyboardNavigation.TabNavigation="Local">
                                                    <ContentPresenter x:Name="PART_SelectedContentHost" ContentTemplate="{TemplateBinding SelectedContentTemplate}" Content="{TemplateBinding SelectedContent}" ContentStringFormat="{TemplateBinding SelectedContentStringFormat}" ContentSource="SelectedContent" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                                                </Border>
                                            </Grid>
                                            <ControlTemplate.Triggers>
                                                <Trigger Property="metro:TabControlHelper.Underlined" Value="TabPanel">
                                                    <Setter Property="Visibility" TargetName="Underline" Value="Visible"/>
                                                </Trigger>
                                                <Trigger Property="TabStripPlacement" Value="Bottom">
                                                    <Setter Property="Grid.Row" TargetName="ContentPanel" Value="0"/>
后面还有 60 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。