(精华)2020年01月03日 WPF综合案例(菜单布局)
【摘要】
<Window x:Class="MicrosoftToDO.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/x...
<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="" 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="" 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="" 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="" 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="" 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="" 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>
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
文章来源: codeboy.blog.csdn.net,作者:愚公搬代码,版权归原作者所有,如需转载,请联系作者。
原文链接:codeboy.blog.csdn.net/article/details/112416294
【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)