(精华)2020年01月03日 WPF综合案例(菜单布局)

<Window x:Class="MicrosoftToDO.MainWindow"
        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:MicrosoftToDO"
        mc:Ignorable="d" Height="650" Width="1000">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="280"/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>

        <DockPanel LastChildFill="True">

            <TextBlock Text="Microsoft ToDo" Margin="10 10 0 20" DockPanel.Dock="Top"/>

            <DockPanel DockPanel.Dock="Top" LastChildFill="False">
                <Image Source="logo.jpg" Width="30" Height="30" Margin="10 0 0 0"/>
                <TextBlock Text="henji" VerticalAlignment="Center" Margin="10 0 0 0"/>

                <TextBlock Text="&#xe645;" FontFamily="./Fonts/#iconfont" Margin="0 0 10 0" FontSize="22"
                           DockPanel.Dock="Right" VerticalAlignment="Center"/>
            </DockPanel>

            <ListBox BorderThickness="0">
                <ListBox.ItemContainerStyle>
                    <Style TargetType="ListBoxItem">
                        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                        <Setter Property="Height" Value="45"/>
                        <Setter Property="Margin" Value="0 3 0 0"/>
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type ListBoxItem}">
                                    <ContentPresenter/>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </ListBox.ItemContainerStyle>
                
                <RadioButton>
                    <DockPanel LastChildFill="False" Margin="10 0 0 0">
                        <TextBlock Text="&#xe635;" Style="{StaticResource iconTextBlockStyle}"/>
                        <TextBlock Text="我的一天" Margin="10 0 0 0" VerticalAlignment="Center"/>
                        <TextBlock Text="1" DockPanel.Dock="Right" Margin="0 0 10 0" VerticalAlignment="Center"/>
                    </DockPanel>
                </RadioButton>

                <RadioButton>
                    <DockPanel LastChildFill="False" Margin="10 0 0 0">
                        <TextBlock Text="&#xe6b6;" Style="{StaticResource iconTextBlockStyle}"/>
                        <TextBlock Text="重要" Margin="10 0 0 0" VerticalAlignment="Center"/>
                        <TextBlock Text="1" DockPanel.Dock="Right" Margin="0 0 10 0" VerticalAlignment="Center"/>
                    </DockPanel>
                </RadioButton>

                <RadioButton>
                    <DockPanel LastChildFill="False" Margin="10 0 0 0">
                        <TextBlock Text="&#xe6e1;" Style="{StaticResource iconTextBlockStyle}"/>
                        <TextBlock Text="已计划日程" Margin="10 0 0 0" VerticalAlignment="Center"/>
                        <TextBlock Text="1" DockPanel.Dock="Right" Margin="0 0 10 0" VerticalAlignment="Center"/>
                    </DockPanel>
                </RadioButton>

                <RadioButton>
                    <DockPanel LastChildFill="False" Margin="10 0 0 0">
                        <TextBlock Text="&#xe614;" Style="{StaticResource iconTextBlockStyle}"/>
                        <TextBlock Text="已分配给你" Margin="10 0 0 0" VerticalAlignment="Center"/>
                        <TextBlock Text="1" DockPanel.Dock="Right" Margin="0 0 10 0" VerticalAlignment="Center"/>
                    </DockPanel>
                </RadioButton>

                <RadioButton>
                    <DockPanel LastChildFill="False" Margin="10 0 0 0">
                        <TextBlock Text="&#xe755;" Style="{StaticResource iconTextBlockStyle}"/>
                        <TextBlock Text="任务" Margin="10 0 0 0" VerticalAlignment="Center"/>
                        <TextBlock Text="1" DockPanel.Dock="Right" Margin="0 0 10 0" VerticalAlignment="Center"/>
                    </DockPanel>
                </RadioButton>



            </ListBox>

        </DockPanel>

        <Border Background="Green" Grid.Column="1"/>

    </Grid>
</Window>
已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: 猿与汪的秘密 设计师:白松林 返回首页