当前位置: 首页 > news >正文

如何找外贸网站建设公司百度竞价排名什么意思

如何找外贸网站建设公司,百度竞价排名什么意思,wordpress过滤插件,网站合作推广方案目录 前言一、Style1.1 例子1.2 为样式起名字1.3 BasedOn 继承上一个样式 二、外部StyleStep1 创建资源字典BaseButtonStyle.xamlStep2 在资源字典中写入StyleStep3 App.xaml中写引用路径【全局】Step4 调用三、代码提供四、x:Key和x:Name区别 更新时间 前言 参考文章&#xff…

目录

  • 前言
  • 一、Style
    • 1.1 例子
    • 1.2 为样式起名字
    • 1.3 BasedOn 继承上一个样式
  • 二、外部Style
    • Step1 创建资源字典BaseButtonStyle.xaml
    • Step2 在资源字典中写入Style
    • Step3 App.xaml中写引用路径【全局】
    • Step4 调用
    • 三、代码提供
    • 四、x:Key和x:Name区别
  • 更新时间


前言

参考文章:
参考视频:【WPF入门教程 Visual Studio 2022】WPF界面开发入门

自己的感想


一、Style

如下图所示,在Windows.Resources中设置的Style属性,只在当前界面产生效果。
在这里插入图片描述

1.1 例子

在这里插入图片描述

<Window x:Class="WPF_Study.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:WPF_Study"mc:Ignorable="d"Title="WPF入门.txt" Height="600" Width="800"><Window.Resources><Style TargetType="Button"><Setter Property="Background" Value="Red"/><Setter Property="FontSize" Value="20"/><Setter Property="Height" Value="40"/><Setter Property="Width" Value="70"/></Style></Window.Resources><StackPanel><Button Content="登录" /><Button Content="帮助" /><Button Content="退出" /></StackPanel></Window>

1.2 为样式起名字

为啥要起别名?1.1中的案例导致所有的Button组件都是这个红色样式,但是如果我们只想让退出按钮为红色,其他三个按钮为绿色,该怎么操作?
在这里插入图片描述

<Window x:Class="WPF_Study.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:WPF_Study"mc:Ignorable="d"Title="WPF入门.txt" Height="600" Width="800"><Window.Resources><Style x:Key="QuitStyle" TargetType="Button"><Setter Property="Background" Value="Red"/><Setter Property="FontSize" Value="20"/><Setter Property="Height" Value="40"/><Setter Property="Width" Value="70"/></Style><Style x:Key="loginStyle" TargetType="Button"><Setter Property="Background" Value="Green"/><Setter Property="FontSize" Value="20"/><Setter Property="Height" Value="40"/><Setter Property="Width" Value="70"/></Style></Window.Resources><StackPanel><Button Style="{StaticResource loginStyle}" Content="登录" /><Button Style="{StaticResource loginStyle}" Content="帮助" /><Button Style="{StaticResource QuitStyle}" Content="退出" /></StackPanel></Window>

1.3 BasedOn 继承上一个样式

在这里插入图片描述

<Window x:Class="WPF_Study.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:WPF_Study"mc:Ignorable="d"Title="WPF入门.txt" Height="600" Width="800"><Window.Resources><Style TargetType="Button"><Setter Property="Background" Value="WhiteSmoke"/><Setter Property="FontSize" Value="20"/><Setter Property="Margin" Value="20,10"/></Style><Style x:Key="QuitStyle" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}"><Setter Property="Background" Value="Red"/></Style><Style x:Key="loginStyle" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}"><Setter Property="Background" Value="Green"/></Style></Window.Resources><StackPanel><Button Style="{StaticResource loginStyle}" Content="登录" /><Button Content="帮助" /><Button Style="{StaticResource QuitStyle}" Content="退出" /></StackPanel></Window>

二、外部Style

需要我们把style放入xaml文件中。

Step1 创建资源字典BaseButtonStyle.xaml

在这里插入图片描述

Step2 在资源字典中写入Style

在这里插入图片描述

Step3 App.xaml中写引用路径【全局】

在这里插入图片描述

Step4 调用

在这里插入图片描述


三、代码提供

C# WPF中的Style写入xaml中进行全局引用——点击下载代码


四、x:Key和x:Name区别

  • 在Resources中进行唯一标定。

在这里插入图片描述
在这里插入图片描述


更新时间

  • 2025-02-06:创建。
  • 2025-02-07:补充x:key和x:name之间区别。
http://www.zhongyajixie.com/news/12952.html

相关文章:

  • 中企动力做的网站怎么登陆百度一下百度首页
  • 手机网站制作细节怎么做网站关键词优化
  • 河津网站建设成都网站seo费用
  • 物流网站制作seo方案书案例
  • 网站模板怎么做有创意的网络营销案例
  • 西宁高端网站建设央视新闻
  • 网站建设知识百度如何搜索网址
  • wordpress模板页面说明宁波seo搜索排名优化
  • 哈尔滨建设集团有限公司seo免费软件
  • 一键建站哪家信誉好长春网站优化方案
  • 网站制作项目执行新闻类软文营销案例
  • 医疗科技网站建设如何营销
  • 企业网站建设记什么会计科目网络科技有限公司
  • 07年做网站网络推广山东
  • 东莞网站开发微营销平台
  • 甘肃 网站备案百度指数怎么查
  • 免费b2b网站源码最火网站排名
  • jsp怎么做视频网站凡科建站多少钱
  • 一个人做两个博客网站友情链接平台
  • 衢州网站建设公司网络营销和网站推广的区别
  • 有哪些做平面设计好素材网站有哪些石家庄seo按天扣费
  • 邯郸专业网络营销优化百度涨
  • 万江网站制作时事新闻最新2022
  • 做网站的基本要素成都优化网站哪家公司好
  • 免费网站新域名杭州网站优化搜索
  • 搜索引擎培训班沈阳seo顾问
  • 网站里面发消息怎么做超链接vi设计公司
  • 用php做动态网站樱桃磁力bt天堂
  • 初中毕业学网站开发工程师steam交易链接怎么获取
  • 做现货需要关注的网站最有效的15个营销方法