当前位置:网站首页>.NET-7.WPF learning experience summary
.NET-7.WPF learning experience summary
2022-08-10 06:55:00 【joyyi9】
系列文章目录
前言
The following few are familiar enough.
好好学习,落到实处.
参考链接:
- 官方文档
- WPF从零到1教程详解
- 系列文章(I have gained、Understanding data binding)
- https://www.cnblogs.com/cdaniu/category/2167439.html
- 触发器
参考代码
//导航
<TextBlock HorizontalAlignment="Left"
Margin="10,10,10,10">
<Hyperlink NavigateUri="Page2.xaml">Go To Page 2</Hyperlink>
</TextBlock>
// 导航
ExpenseReportPage expenseReportPage = new ExpenseReportPage(this.peopleListBox.SelectedItem);
this.NavigationService.Navigate(expenseReportPage);
//get control element
var srcButton = e.Source as Button;
var fe = (FrameworkElement) sender;
var fe2 = (FrameworkElement) args.Source;
//Simple binding of data
xmlns:local="clr-namespace:WpfApp2"
<local:User x:Key="myData" Name="zhouyi"/>
<TextBox>
<TextBox.Text>
<Binding Source="{StaticResource myData}" Path="Name"
UpdateSourceTrigger="PropertyChanged"/>
</TextBox.Text>
</TextBox>
<TextBlock Text="{Binding Source={StaticResource myData}, Path=Name}"/>
public class User:INotifyPropertyChanged
{
private string _name;
public string? Name
{
get {
return _name; }
set
{
_name = value;
OnPropertyChanged("Name");
}
}
public event PropertyChangedEventHandler PropertyChanged;
protected void OnPropertyChanged(string name)
{
var handler = PropertyChanged;
handler?.Invoke(this, new PropertyChangedEventArgs(name));
}
}
//------------
<Border Margin="10" BorderBrush="Silver" BorderThickness="3" Padding="8">
<DockPanel>
<TextBlock>Choose a Color:</TextBlock>
<ComboBox Name="myComboBo" SelectedIndex="0">
<ComboBoxItem>Green</ComboBoxItem>
<ComboBoxItem>Blue</ComboBoxItem>
<ComboBoxItem>Red</ComboBoxItem>
</ComboBox>
<Canvas>
<Canvas.Background>
<Binding ElementName="myComboBo" Path="SelectedItem.Content"/>
</Canvas.Background>
</Canvas>
</DockPanel>
</Border>
边栏推荐
- 自动化测试框架Pytest(二)——前后置处理
- Ladies and gentlemen, oracle11g, cdc2.2, flink1.13.6, single-table incremental synchronization.Without adding data
- 排序二叉树代码
- 2022河南萌新联赛第(五)场:信息工程大学 J - AC自动机
- 1413. Stepwise Summation to Get Minimum Positive Numbers
- oracle业务表的数据发生增删改,该表的索引会写redo,undo吗?
- 2022河南萌新联赛第(五)场:信息工程大学 H - 小明喝奶茶
- 全连接神经网络结构图,神经网络示意图怎么画
- 2022河南萌新联赛第(五)场:信息工程大学 K - 矩阵生成
- 探索神经网络架构教程视频,设计神经网络的步骤
猜你喜欢

Data types for database learning

34. 谈谈为什么要拆分数据库?有哪些方法?

神经网络样本太少怎么办,神经网络训练样本太少
![Chapter 11 Database Design Specifications [2. Index and Tuning] [MySQL Advanced]](/img/a5/88699cf7b7fc0ca721977dc07b0602.png)
Chapter 11 Database Design Specifications [2. Index and Tuning] [MySQL Advanced]

关于MongoDb查询Decimal128转BigDecimal问题

Grammar Basics (Judgment Statements)

WooCommerce 安装和 rest api 使用

Elementary Structure

1413. 逐步求和得到正数的最小值

ESP32 485风速
随机推荐
ESP32 485风速
3.1-3.3 读书笔记
mysql数据库定时备份(保留近7天的备份)
CuteOneP is a PHP-based OneDrive multi-network disk mount program with member synchronization and other functions
[Reinforcement Learning] "Easy RL" - Q-learning - CliffWalking (cliff walking) code interpretation
【8月9日活动预告】Prometheus峰会
2022河南萌新联赛第(五)场:信息工程大学 C - 丢手绢
34. Talk about why you want to split the database?What methods are there?
2022河南萌新联赛第(五)场:信息工程大学 K - 矩阵生成
.NET-8. My Thought Notes
PLSQL学习第三天
Fiddler(八) - 抓取手机APP的流量-插件Fiddler Orchestra Beta安装&配置
Bigder:42/100 showCase多少bug可以打回去
S0:12345:respawn:/bin/start_getty 115200 ttyS0 vt102
JS中初始化对象为null和空对象的区别
2022河南萌新联赛第(五)场:信息工程大学 B - 交通改造
761. Special Binary Sequences
深入理解LTE网络的CDRX
如何设计神经网络结构,神经网络设计与实现
2022 Henan Mengxin League (fifth) game: University of Information Engineering H - Xiao Ming drinking milk tea