欧美一级特黄大片做受成人-亚洲成人一区二区电影-激情熟女一区二区三区-日韩专区欧美专区国产专区

WPF如何實(shí)現(xiàn)圖片按鈕-創(chuàng)新互聯(lián)

這篇文章給大家分享的是有關(guān)WPF如何實(shí)現(xiàn)圖片按鈕的內(nèi)容。小編覺得挺實(shí)用的,因此分享給大家做個參考,一起跟隨小編過來看看吧。

成都創(chuàng)新互聯(lián)公司是專業(yè)的龍文網(wǎng)站建設(shè)公司,龍文接單;提供做網(wǎng)站、網(wǎng)站設(shè)計(jì),網(wǎng)頁設(shè)計(jì),網(wǎng)站設(shè)計(jì),建網(wǎng)站,PHP網(wǎng)站建設(shè)等專業(yè)做網(wǎng)站服務(wù);采用PHP框架,可快速的進(jìn)行龍文網(wǎng)站開發(fā)網(wǎng)頁制作和功能擴(kuò)展;專業(yè)做搜索引擎喜愛的網(wǎng)站,專業(yè)的做網(wǎng)站團(tuán)隊(duì),希望更多企業(yè)前來合作!

,具體內(nèi)容如下

直接代碼

public class ImageButton : System.Windows.Controls.Button
 {

 /// <summary>
 /// 圖片
 /// </summary>
 public static readonly DependencyProperty ImageProperty = DependencyProperty.Register("Image", typeof(ImageSource), typeof(ImageButton),
  new PropertyMetadata(null));

 /// <summary>
 /// 圖片的寬度
 /// </summary>
 public static readonly DependencyProperty ImageWidthProperty = DependencyProperty.Register("ImageWidth", typeof(double), typeof(ImageButton),
  new PropertyMetadata(double.NaN));

 /// <summary>
 /// 圖片的高度
 /// </summary>
 public static readonly DependencyProperty ImageHeightProperty = DependencyProperty.Register("ImageHeight", typeof(double), typeof(ImageButton),
  new PropertyMetadata(double.NaN));

 /// <summary>
 /// 構(gòu)造函數(shù)
 /// </summary>
 static ImageButton()
 {
  DefaultStyleKeyProperty.OverrideMetadata(typeof(ImageButton), 
  new System.Windows.FrameworkPropertyMetadata(typeof(ImageButton)));
 }

 /// <summary>
 /// 設(shè)置圖片
 /// </summary>
 public ImageSource Image
 {
  get
  {
  return GetValue(ImageProperty) as ImageSource;
  }
  set
  {
  SetValue(ImageProperty, value);
  }
 }

 /// <summary>
 /// 圖片寬度(屬性)
 /// </summary>
 public double ImageWidth
 {
  get
  {
  return (double)GetValue(ImageWidthProperty);
  }
  set
  {
  SetValue(ImageWidthProperty, value);
  }
 }

 /// <summary>
 /// 圖片高度(屬性)
 /// </summary>
 public double ImageHeight
 {
  get
  {
  return (double)GetValue(ImageHeightProperty);
  }
  set
  {
  SetValue(ImageHeightProperty, value);
  }
 }

 }

樣式代碼

<Style TargetType="{x:Type xi:ImageButton}">
 <Setter Property="Template">
  <Setter.Value>
  <ControlTemplate TargetType="{x:Type xi:ImageButton}">
   <Grid>
   <Grid.RowDefinitions>
    <RowDefinition Height="*"/>
    <RowDefinition Height="Auto"/>
   </Grid.RowDefinitions>
   <Border x:Name="border" Grid.RowSpan="2" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" 
    SnapsToDevicePixels="true" CornerRadius="3,3,3,3"/>
   <Image Grid.Row="0" Source="{TemplateBinding Image}"
     Width="{TemplateBinding ImageWidth}"
     Height="{TemplateBinding ImageHeight}"
     VerticalAlignment="{TemplateBinding VerticalAlignment}"/>
   <ContentPresenter Grid.Row="1" HorizontalAlignment="Center" Margin="{TemplateBinding Padding}" 
     VerticalAlignment="Center" RecognizesAccessKey="True" />
   </Grid>
   <ControlTemplate.Triggers>
   <Trigger Property="IsPressed" Value="True">
    <Setter Property="Foreground" Value="#999999"/>
   </Trigger>
   </ControlTemplate.Triggers>

  </ControlTemplate>
  </Setter.Value>
 </Setter>
 </Style>

調(diào)用實(shí)例

復(fù)制代碼 代碼如下:

 <xi:ImageButton Image="../Image/設(shè)置.png" Content="新增會員" ImageHeight="52" ImageWidth="52" Width="72" Height="72" Margin="30,10,10,10"/>

效果展示

WPF如何實(shí)現(xiàn)圖片按鈕

感謝各位的閱讀!關(guān)于“WPF如何實(shí)現(xiàn)圖片按鈕”這篇文章就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,讓大家可以學(xué)到更多知識,如果覺得文章不錯,可以把它分享出去讓更多的人看到吧!

網(wǎng)頁題目:WPF如何實(shí)現(xiàn)圖片按鈕-創(chuàng)新互聯(lián)
URL分享:http://aaarwkj.com/article44/cdhshe.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站策劃、用戶體驗(yàn)、域名注冊商城網(wǎng)站、云服務(wù)器、手機(jī)網(wǎng)站建設(shè)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

綿陽服務(wù)器托管
中文字幕色视频在线观看| 风韵丰满熟妇老熟女啪啪| 少妇午夜福利一区二区| 国产欧美激情一区二区 | 天堂在线手机av观看| 91精品国语对白人妻刺激| 亚洲国产丁香综合激情啪| 日韩精品人妻中文字幕满员| 蜜桃视频手机在线观看| 国产亚洲精品美女视频| 欧美一区二区三在线| 蜜臀91精品视频在线观看| 成人午夜欧美熟妇小视频| 亚洲精品一区二区三区中文字幕| 在线播放国内自拍情侣酒店| 一区二区三区在线观看精品| 国产看片色网站亚洲av| 日韩经典三级精品自拍| 手机在线观看午夜小视频| 成年爽片在线观看播放欧美| 亚洲欧洲美洲中文天堂| 精品人妻一区三区蜜桃| 色婷婷亚洲综合色一区二区| 一区二区三区成人高清视频| 91嫩草国产在线观看| 亚洲老熟女老妇老女人| 成人av在线天堂一区二区三区| 99热国产这里只有精品| 亚洲av偷拍一区二区三区不卡| 亚洲国产成人精品福利| 日本乱一区二区三区在线| 亚洲 综合 久久久| 亚洲一区二区在线视频在线观看| 日韩有码大片最新自拍| 日本福利写真在线观看| 亚洲成人永久免费精品| 粉嫩在线一区二区懂色| 日韩在线视频这里只有精品| 91精品麻豆国产自产在线| 丝袜亚洲激情欧美日韩偷拍| 国产精品网站在线观看不卡|