当前位置:网站首页>Blend for visual studio overview
Blend for visual studio overview
2022-06-11 00:58:00 【Nidhogg_ com】
Blend for Visual Studio Can be used to design based on XAML Of Windows and Web Applications . It provides And Visual studio Same basic XAML Design experience , And added a visual designer , For advanced tasks , Such as animation and behavior . of Blend and Visual Studio Comparison between , Please refer to at Visual Studio and Blend for Visual Studio Middle design XAML. Blend for Visual Studio yes Visual Studio A component of . If you want to install Blend, Please be there. Visual Studio In setup , choice “ Universal Windows Platform development ” or “.NET Desktop development ” The workload . Both workloads include Blend for Visual Studio Components .
WPF Control's default style
( One ) Check the style
WPF Common controls in have a default custom style , stay Visual Studio Cannot be viewed directly in , But in
Blend for Visual Studio Can be viewed through templates .
As shown below :
(1) In the lower left corner “ Objects and timelines ” The palette , Find the corresponding control , Right click to open the context menu , Click on Edit templates -> Edit copy
(2) Select the name of the style ( keyword ) And define the location .
stay “ name ( keyword )” in , If you choose the first line , Then the style contains custom x:Key attribute ; If second is selected That's ok , There is no key, Will be automatically assigned to Type Application style .
stay “ Define the location ” in , first line “ Applications ” The presentation style will be placed in app.xaml in , The second line goes to the current xaml In the document ; The third line represents the custom resource dictionary .
(3) Click OK to generate the corresponding style , The style also contains ControlTemplate. You can change it yourself .
WPF Medium ControlTemplate
WPF Contains data templates and control templates , The control template also includes ControlTemplate and ItemsPanelTemplate, Let's talk about ControlTemplate.
Actually WPF Each control of the has a default template , This template describes the appearance of the control ( Visual tree ) as well as The response of appearance to external stimuli ( trigger ). We can customize a template to replace the control Default templates to create personalized controls .
And Style Different ,Style Only the existing property values of the control can be changed ( Such as color font ) To customize the controls , But the control template can change the internal structure of the control (VisualTree, Visual tree ) To complete more complex customization , For example, we can To customize such buttons : It displays a small icon in the left part and text in the right part . want Replace the template of the control , We just need to declare one ControlTemplate object , And ControlTemplate Yes Like making corresponding configuration , Then the ControlTemplate Object assigned to the control Template Properties will do .
ControlTemplate Contains two important properties :
1.VisualTree, The visual tree of the template , In fact, we use this property to describe the appearance of the control
2.Triggers, Trigger list , It contains some triggers Trigger, We can customize this trigger column Table to make the control respond to external stimuli , For example, the text becomes bold when the mouse passes .
边栏推荐
- How to install mathtype6.9 and related problem solutions in office2016 (word2016)
- Adapter mode
- table_exists_action=append和table_exists_action=truncate
- [network planning] 2.1.2 transport layer services that can be selected by the application
- [no title] 66666
- [untitled]
- Test it first
- AQS explanation of concurrent programming
- [network planning] 2.4 DNS: directory service of the Internet
- Slam Kalman filter & nonlinear optimization
猜你喜欢

海贼oj#148.字符串反转

微信小程序实现OCR扫描识别

compiler explorer

SQL audit | "cloud" users can use the SQL audit service with one click

如何在office2016(word2016)中安装mathtype6.9及相关问题解决方案

SQL审核 | “云上”用户可以一键使用 SQLE 审核服务啦

浅谈有赞搜索质量保障体系 v2021

如何保证消息的顺序性、消息不丢失、不被重复消费

Random points in non overlapping rectangles

How to ensure the sequence of messages, that messages are not lost or consumed repeatedly
随机推荐
嵌入式学习资料和项目汇总
Pirate OJ 146 character string
oracle带xy字段值的关系表同步到pg数据库转为几何字段
Wechat applet to realize OCR scanning recognition
SLAM卡尔曼滤波&&非线性优化
Load balancing strategy graphic explanation
SqlServer中的鎖
【ROS入门教程】---- 03 ROS基本概念及指令
浅谈IEEE会议论文的不出席政策Non-Presented Paper(No-Show)Policy
About log traffic monitoring and early warning small project | flask
自动化测试系列
Introduction and basic construction of kubernetes
lucene思维导图,让搜索引擎不再难懂
Unity points that are vulnerable to pit
Serrures dans SQLSERVER
Deep copy and shallow copy in golang
Win11 uninstall widget
Network Engineer required course firewall security zone and basic operation of security policy
[no title] 66666
UUID quick explanation