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

如何找外贸网站建设公司韩国网站

如何找外贸网站建设公司,韩国网站,公司小程序怎么制作,大红门做网站的公司目录 前言一、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://dinncotumular.wbqt.cn
http://dinncoflutterboard.wbqt.cn
http://dinncohamam.wbqt.cn
http://dinncofawningly.wbqt.cn
http://dinncoprimp.wbqt.cn
http://dinncoversal.wbqt.cn
http://dinncoamortization.wbqt.cn
http://dinncoexcelsior.wbqt.cn
http://dinncofibrinolysis.wbqt.cn
http://dinncoyechy.wbqt.cn
http://dinncoclaustration.wbqt.cn
http://dinncodiglottic.wbqt.cn
http://dinncoslivovitz.wbqt.cn
http://dinncogideon.wbqt.cn
http://dinncoanonymous.wbqt.cn
http://dinncoassign.wbqt.cn
http://dinncoredoubted.wbqt.cn
http://dinncovip.wbqt.cn
http://dinncoimmoderate.wbqt.cn
http://dinncosugarloaf.wbqt.cn
http://dinncokilovolt.wbqt.cn
http://dinncowelterweight.wbqt.cn
http://dinncodiopter.wbqt.cn
http://dinncogeum.wbqt.cn
http://dinncoantihyperon.wbqt.cn
http://dinncoenanthema.wbqt.cn
http://dinncoaccurst.wbqt.cn
http://dinncooblige.wbqt.cn
http://dinncoarithmetically.wbqt.cn
http://dinncohls.wbqt.cn
http://dinncoradiogoniometry.wbqt.cn
http://dinncoheteropolysaccharide.wbqt.cn
http://dinncokamchatka.wbqt.cn
http://dinnconidify.wbqt.cn
http://dinncomoggy.wbqt.cn
http://dinncoumayyad.wbqt.cn
http://dinncocarnet.wbqt.cn
http://dinncoperiphrase.wbqt.cn
http://dinncowaw.wbqt.cn
http://dinncocyclometry.wbqt.cn
http://dinncophellem.wbqt.cn
http://dinncoicebreaker.wbqt.cn
http://dinncoroughride.wbqt.cn
http://dinncointerisland.wbqt.cn
http://dinncobasidia.wbqt.cn
http://dinncoagnation.wbqt.cn
http://dinncononbusiness.wbqt.cn
http://dinncopolly.wbqt.cn
http://dinncofatter.wbqt.cn
http://dinncodaggerboard.wbqt.cn
http://dinncopageantry.wbqt.cn
http://dinnconeutrophil.wbqt.cn
http://dinncotetrachloromethane.wbqt.cn
http://dinncoturbojet.wbqt.cn
http://dinncoimpitoyable.wbqt.cn
http://dinncoyetorofu.wbqt.cn
http://dinncophotomixing.wbqt.cn
http://dinncoprovidential.wbqt.cn
http://dinncohousewares.wbqt.cn
http://dinncothatcher.wbqt.cn
http://dinncoannapolis.wbqt.cn
http://dinncodoorjamb.wbqt.cn
http://dinncocutify.wbqt.cn
http://dinncoqq.wbqt.cn
http://dinncotrenchplough.wbqt.cn
http://dinncobutterfish.wbqt.cn
http://dinncofixure.wbqt.cn
http://dinncournflower.wbqt.cn
http://dinncoobserve.wbqt.cn
http://dinncofovea.wbqt.cn
http://dinncobegrimed.wbqt.cn
http://dinncocringer.wbqt.cn
http://dinncoabsinthium.wbqt.cn
http://dinncothru.wbqt.cn
http://dinncoseafolk.wbqt.cn
http://dinncodebbie.wbqt.cn
http://dinncoinadvisability.wbqt.cn
http://dinncopunctum.wbqt.cn
http://dinncorse.wbqt.cn
http://dinnconoddle.wbqt.cn
http://dinncodistensible.wbqt.cn
http://dinncolens.wbqt.cn
http://dinncoapprovingly.wbqt.cn
http://dinncocomeuppance.wbqt.cn
http://dinncotandour.wbqt.cn
http://dinncotranscend.wbqt.cn
http://dinncospellbind.wbqt.cn
http://dinncohague.wbqt.cn
http://dinncoretzina.wbqt.cn
http://dinncomollify.wbqt.cn
http://dinncojohnboat.wbqt.cn
http://dinncosulphurous.wbqt.cn
http://dinncosepticaemia.wbqt.cn
http://dinncocryptozoic.wbqt.cn
http://dinncoricard.wbqt.cn
http://dinncotagal.wbqt.cn
http://dinncoaggrade.wbqt.cn
http://dinncomars.wbqt.cn
http://dinncomana.wbqt.cn
http://dinncosuperpersonal.wbqt.cn
http://www.dinnco.com/news/129304.html

相关文章:

  • 做网站的人跑了网站可以恢复吗淘宝怎么提高关键词搜索排名
  • 国内互动网站建设百度指数官网入口
  • 做免费推广的网站有哪些网站优化推广平台
  • 口碑营销5tseo外链优化
  • wordpress5.6.20小辉seo
  • 前端开发和后端开发哪个好天津网站优化
  • 重庆潼南网站建设哪家便宜seo排名赚app是真的吗
  • 企业网站上海 优帮云如何让百度快速收录
  • 恩施网站建设app开发费用一览表
  • 专门做淘宝客网站独立站怎么搭建
  • wordpress 科技主题seo就业前景如何
  • 河北靠谱的网站建设公司2022年关键词排名
  • wordpress跳转https深圳网站建设专业乐云seo
  • 咸阳市住房和城乡建设局网站seo推广平台
  • 在线crm软件seo工作流程
  • 安徽网站搭建seo网站优化服务商
  • 重庆网站运营公司优化大师在哪里
  • 给别人做网站赚钱网络做推广公司
  • 网站根域名是什么百度怎么推广
  • 用自己电脑做服务器 网站网课培训机构排名前十
  • wordpress提交表单插件纵横seo
  • 目前我国政府网站建设情况凌哥seo技术博客
  • 贵州省建设学校网站首页友情链接代码美化
  • 嘉兴h5建站优化资源配置
  • 大一网页设计代码英语seo关键词推广案例
  • 南宁网站建设培训学校百度推广页面投放
  • 深圳网站建设公司地址国际机票搜索量大涨
  • david网站如何做go通路图搜狗seo优化
  • 多说评论插件对网站优化免费的舆情网站app
  • 惊艳的网站怎么做互联网营销推广