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

wordpress 预订 插件苏州seo门户网

wordpress 预订 插件,苏州seo门户网,域名什么意思举个例子,17zwd一起做网站广州新塘有时候需要动态的设置一些按钮的状态模板。使一个button显示不同的内容,比如Button未点击安装显示: 安装后显示: 可以通过设置button的content,通过content来设置不同的模板来实现功能,以下是代码: MainWi…

有时候需要动态的设置一些按钮的状态模板。使一个button显示不同的内容,比如Button未点击安装显示:

安装后显示:

可以通过设置button的content,通过content来设置不同的模板来实现功能,以下是代码:

MainWindow.xaml

<Windowx:Class="WPF_ButtonTemplate.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:local="clr-namespace:WPF_ButtonTemplate"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"Title="MainWindow"Width="800"Height="450"mc:Ignorable="d"><Window.Resources><BitmapImage x:Key="Setting_Extension" UriSource="pack://application:,,,/Installed.png" /><ControlTemplate x:Key="UnInstallTemplate" TargetType="Button"><Borderx:Name="border1"Width="100"Height="30"Background="LightGray"BorderBrush="DarkGray"BorderThickness="1.5"CornerRadius="8"><TextBlockx:Name="contentTB"HorizontalAlignment="Center"VerticalAlignment="Center"Text="{TemplateBinding Content}" /></Border></ControlTemplate><ControlTemplate x:Key="InstalledTemplate" TargetType="Button"><Border x:Name="border1" Background="LightYellow" CornerRadius="8"><StackPanel Margin="13,7,13,7" Orientation="Horizontal"><ImageWidth="16"Height="16"HorizontalAlignment="Left"VerticalAlignment="Center"Source="{DynamicResource Setting_Extension}" /><TextBlockx:Name="contentTB"Margin="4,0,0,0"HorizontalAlignment="Center"VerticalAlignment="Center"FontSize="{TemplateBinding FontSize}"Foreground="{TemplateBinding Foreground}"Text="{TemplateBinding Content}" /></StackPanel></Border></ControlTemplate><Style x:Key="NomalBtn" TargetType="Button"><Setter Property="Width" Value="100" /><Setter Property="Height" Value="30" /><Style.Triggers><Trigger Property="Content" Value="未安装"><Setter Property="Template" Value="{StaticResource UnInstallTemplate}" /></Trigger><Trigger Property="Content" Value="已安装"><Setter Property="Template" Value="{StaticResource InstalledTemplate}" /></Trigger></Style.Triggers></Style></Window.Resources><Grid><Buttonx:Name="btn"Click="Button_Click"Content="未安装"Style="{StaticResource NomalBtn}" /></Grid>
</Window>

MainWindow.cs

using System.Windows;namespace WPF_ButtonTemplate
{/// <summary>/// Interaction logic for MainWindow.xaml/// </summary>public partial class MainWindow : Window{public MainWindow(){InitializeComponent();}private void Button_Click(object sender, RoutedEventArgs e){if (string.Equals(btn.Content, "未安装"))btn.Content = "已安装";elsebtn.Content = "未安装";}}
}

项目免费下载地址:

【免费】WPF-ButtonTemplate资源-CSDN文库

http://www.hrbkazy.com/news/28104.html

相关文章:

  • 口碑好的网站建设公司哪家好百度指数分析数据
  • 有服务器和域名怎么做网站推广宣传方式有哪些
  • 大企业网站建设公司排名帮我搜一下长沙做网络销售
  • 包头外贸网站建设网站名查询网址
  • 贵州两学一做专题网站如何找客户资源
  • 个人网站怎么做代码seo网络营销的技术
  • 湘潭市建设局网站网络项目平台
  • 怎么建设网站运城企业seo网络营销
  • 专业英文网站制作网站模板库
  • 外贸独立站模板足球最新世界排名表
  • 企业网站建设怎么样东莞seo建站优化工具
  • 网站建设 图片公司网站注册流程和费用
  • 政府信息公开和网站建设百度网页版浏览器
  • wordpress短信验证seo排名哪家正规
  • 河南企业网站建设公司贵港seo关键词整站优化
  • 外国网站设计素材今日大新闻
  • 用sql做简单的博客网站重庆放心seo整站优化
  • 岳池做网站电话百度收录提交入口网址
  • 网站后台密码忘记了怎么办 ftp进不去青岛快速排名优化
  • 重庆市建设工程信息网官网福海玻璃搜索引擎优化工作
  • 深圳网站建设商家淘宝运营培训课程
  • 长域名转换短域名北京seo助理
  • 讯响模板网站seo友情链接
  • 滕州网站搜索引擎优化2022年可以打开的网址
  • 网站建设设计师招募灰色关键词排名代发
  • 石家庄网站开发培训软文范例800字
  • 华能集团网站建设方案项目分析竞价托管开户
  • 问卷调查网站怎么做永久免费无代码开发平台网站
  • 做网站的公司有前途吗seo排名优化怎么样
  • 在哪些网站做推广搜索引擎seo关键词优化方法