学海无涯

导航

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

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 宁静致远. 阅读(45) 评论(0) 推荐(0)

2023年1月9日 #

控件

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

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

2023年1月8日 #

事件

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

posted @ 2023-01-08 11:57 宁静致远. 阅读(93) 评论(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 宁静致远. 阅读(168) 评论(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 宁静致远. 阅读(43) 评论(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 宁静致远. 阅读(39) 评论(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 宁静致远. 阅读(61) 评论(0) 推荐(0)

Wpf原生MvvM

摘要: using System.ComponentModel; namespace WpfTestBlankApp.Models { public class Nickname : INotifyPropertyChanged { public event PropertyChangedEventHand 阅读全文

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

2023年1月4日 #

Layout 布局

摘要: WPF 附带以下通用面板布局控件: Grid(网格) 按开发人员指定的行和列排列内容,不用固定大小和位置。最强大的内置布局控件 1 <Grid> 2 <Grid.RowDefinitions> 3 <RowDefinition /> 4 <RowDefinition /> 5 <RowDefinit 阅读全文

posted @ 2023-01-04 17:35 宁静致远. 阅读(115) 评论(0) 推荐(0)

2023年1月3日 #

特殊字符和空白

摘要: XMAL 字符实体 特殊字符 字符实体 < &lt; > &gt; & &amp; " &quot; <Button> &lt;Click Me&gt; </Button> 保留字符串的首尾空格 <TextBox xml:space="preserve" Foreground="White"> Th 阅读全文

posted @ 2023-01-03 16:13 宁静致远. 阅读(77) 评论(0) 推荐(0)

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