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

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| 国产一区二区黑丝美女| 色婷婷国产精品高潮呻吟| 精品欧美熟妇高潮喷水特黄| 日本一区二区在线高清| av小说亚洲激情乱| 精品视频日韩在线观看| 亚洲av毛片一区二区| 加勒比久久精品网址系列| 亚洲国产精品综合久久久| 亚洲中文无码亚洲人vr在线| 国产又粗又猛又爽黄老大爷 | 国产91黑丝视频在线观看| 国产精品久久中文字幕亚洲| 久章草在线免费视频播放| 欧美一区二区日本国产激情| 亚洲av一区二区三区色多多| 亚洲欧美精品福利在线| 蜜臀av成人精品蜜臀av| 久久东京热日韩精品一区| 国产又粗又长在线视频| 国产一区二区在线不卡播放| 日本成人一区二区三区在线| 成人黄色av在线看| 精品一区二区亚洲精品| 人妻av在线中文字幕| 日韩欧美国产亚洲在线| 中文乱幕亚洲无套内射| 国产一区二区黄色录像| 男女生做刺激性视频网站| 国产三级三级三级三级三级| 婷婷色爱区综合五月激情 | 亚洲天堂av福利在线观看| 国产高跟丝袜av专区| 日韩成人在线视频观看| 国产午夜视频成人无遮挡| av熟女乱一区二区三区|