学海无涯

导航

上一页 1 ··· 24 25 26 27 28 29 30 31 32 ··· 45 下一页

2023年1月13日 #

Control Templates 控制模板

摘要: 简单控制模板 <Button Margin="0,0,2,2" Grid.Row="0" Grid.Column="0" Name="cell00" > <Button.Template> <ControlTemplate> <Grid> <Rectangle Fill="Orange"/> </G 阅读全文

posted @ 2023-01-13 18:21 宁静致远. 阅读(62) 评论(0) 推荐(0)

2023年1月12日 #

Styles 样式

摘要: Inline Styles 内联样式 <Button Margin="0,0,2,2" Grid.Row="0" Grid.Column="0" Name="cell00" > <Button.Style> <Style> <Setter Property="Button.FontSize" Val 阅读全文

posted @ 2023-01-12 16:25 宁静致远. 阅读(67) 评论(0) 推荐(0)

2023年1月11日 #

Binding to List Data 绑定到列表数据

摘要: 得到当前项 1 void birthdayButton_Click(object sender, RoutedEventArgs e) { 2 // Get the current person out of the collection view 3 People people = (People 阅读全文

posted @ 2023-01-11 10:57 宁静致远. 阅读(138) 评论(0) 推荐(0)

2023年1月10日 #

Data Binding 数据绑定

摘要: Person person = new Person("Tom", 11); public MainWindow(IRegionManager regionManager) { InitializeComponent(); birthdayButton.Click += BirthdayButton 阅读全文

posted @ 2023-01-10 09:48 宁静致远. 阅读(51) 评论(0) 推荐(0)

2023年1月9日 #

控件

摘要: 什么是控件? 大多数流行的 UI 框架都提供类似于控件的抽象,而 WPF 采用了一种稍微不寻常的方 法,因为控件通常不直接负责它们自己的外观。 WPF 中的控件都是关于行为的,它们 遵从模板来提供视觉效果。许多 GUI 框架要求您在自定义控件外观时编写自定义控 许多 WPF 用户界面元素不是控件。例 阅读全文

posted @ 2023-01-09 09:06 宁静致远. 阅读(167) 评论(0) 推荐(0)

2023年1月8日 #

事件

摘要: 事件分为:冒泡事件、隧道事件、和直接事件 隧道事件名称始终以Preview开头并首先引发。这使目标元素的父元素有机会在事件到达子元 素之前看到它(因此有Preview前缀)。隧道预览事件紧随冒泡事件之后。 在大多数情况下,只处理冒泡事件,隧道事件通常仅在你希望能够阻止该事件时,或者如果你需要父级在正 阅读全文

posted @ 2023-01-08 11:57 宁静致远. 阅读(102) 评论(0) 推荐(0)

2023年1月7日 #

共享尺寸组 SharedSizeGroup

摘要: 整体布局由DockPanel 定义,使用附加的Dock.Top属性将标头Grid定位在顶部,并 允许ScrollViewer填充剩余空间。 1 <DockPanel Grid.IsSharedSizeScope="True"> 2 <DockPanel.Resources> 3 <Style Tar 阅读全文

posted @ 2023-01-07 13:20 宁静致远. 阅读(171) 评论(0) 推荐(0)

绘图

摘要: 画线 <Rectangle Grid.Row="5" Grid.ColumnSpan="2" Height="1" Fill="Blue" /> <Border Grid.ColumnSpan="2" Grid.Row="4" VerticalAlignment="Top" BorderBrush= 阅读全文

posted @ 2023-01-07 12:30 宁静致远. 阅读(49) 评论(0) 推荐(0)

2023年1月5日 #

实现单应用程序,即只能启动一个实例

摘要: 1 using Prism.Ioc; 2 using System.Threading; 3 using System.Windows; 4 using WpfTestBlankApp.Views; 5 6 namespace WpfTestBlankApp 7 { 8 /// <summary> 阅读全文

posted @ 2023-01-05 17:09 宁静致远. 阅读(44) 评论(0) 推荐(0)

ListBox

摘要: 1 <ListBox ItemsSource="{Binding}" IsSynchronizedWithCurrentItem="True"> 2 <ListBox.ItemTemplate> 3 <DataTemplate> 4 <TextBlock> 5 <TextBlock Text="{B 阅读全文

posted @ 2023-01-05 09:05 宁静致远. 阅读(67) 评论(0) 推荐(0)

上一页 1 ··· 24 25 26 27 28 29 30 31 32 ··· 45 下一页