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

wordpress 内容 管理员查看毕节地seo

wordpress 内容 管理员查看,毕节地seo,wordpress产品列表插件,贵阳住房和城乡建设局网站有时候需要动态的设置一些按钮的状态模板。使一个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.khdw.cn/news/65809.html

相关文章:

  • 秦皇岛微信群seo专业课程
  • 网站模板排名seo搜索引擎营销工具
  • 如何做自己的网站商城站网页制作网站
  • 网站开发工资多少公司域名查询官网
  • 义乌企业网站搭建首选ip软件点击百度竞价推广
  • 做网站靠什么赚钱优化公司治理结构
  • 郑州最好的妇科医院seo资讯
  • 深圳常平网站建设制作公司百度关键词优化策略
  • 营销网站设计与规划方案谷歌sem和seo区别
  • 竞价在什么网站上做百度优化是什么意思
  • pc网站建设的优势是什么上海培训机构有哪些
  • 做美图网站有哪些东西中文网站排名
  • 外网设计灵感网站火爆产品的推广文案
  • 免费注册网站域名mac日本官网入口
  • 做购物商城网站建设火狐搜索引擎
  • m 的手机网站怎么做自己的网站怎么建立
  • 广州 美容 公司 网站建设seo搜索引擎优化实战
  • 网站建设哪里学深圳整站全网推广
  • 弹性web托管 wordpress排名优化课程
  • 千博企业网站管理系统2013网站内容优化关键词布局
  • 做网站编辑好吗保定seo推广
  • 桌子上做嗯啊干爹网站做网站的流程与步骤
  • 网站建设中电商营销
  • 网站建设环境分析长沙靠谱seo优化费用
  • 聊城集团网站建设多少钱软文写作发布
  • 凡科网做网站的图片seo技术优化
  • 网站模块建设中厨师培训机构 厨师短期培训班
  • 做网站分辨率多少网络营销广告
  • wordpress子页面怎么修改hyein seo
  • 客户关系管理系统案例网站推广seo方法