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

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ù)器托管
一区二区先锋深夜中文字幕| 国产在线自拍一区二区| 国产精品国产高清国产一区| 丝袜美腿诱惑国产在线| 日韩黄片一区二区三区| 我想看亚洲一级黄色录像| 声入人心第一季在线观看| 亚洲国产日韩欧美综合久久| 欧美日韩视频一区二区| 99久久成人国产精品免费| 国产b片免费在线观看| 日本精品国产一区二区在线| 国产女主播在线观看一区| 欧美日韩亚洲精品瑜伽裤| 国产成人一区二区三区综合区| 97免费人妻在线视频| 日韩成人中文字幕在线视频| 日韩精品视频在线观看| 侵犯人妻中文字幕一区二区| 日本精品av一区二区| 久久综合久久狠狠激情| 久久精品资源综合网| 日日爱欧美精品亚洲成| 日本一本一道高清不卡视频| 少妇一夜一次一区二区| 亚洲精品天堂av免费看| 97成人在线视频免费播放| 欧美黄色日本一区二区| 国产又大又长又粗又硬又猛| 白虎亚洲福利精品一区| 色老头视频一区二区三区| 婷婷久久香蕉毛片毛片| 精品在线中文字幕不卡| 亚洲丰满毛茸茸毛茸茸| 国产一区丝袜高跟在线| 成人国产精品三上悠亚久久| 亚洲男人天堂在线观看| 青青青在线视频观看华人| 97精品少妇一区二区三区| 日本免费高清一区二区| 亚洲美女av一区二区三区|