<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      C# ControlTemplate 和 DataTemplate 一起使用

      <Window x:Class="WpfApp1.Window2"
              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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
              xmlns:local="clr-namespace:WpfApp1"
              mc:Ignorable="d"
              Title="Window2" Height="450" Width="800">
          <Window.Resources>
              <Style x:Key="listBoxStyle" TargetType="{x:Type ListBox}">
                  <Setter Property="Template">
                      <Setter.Value>
                          <ControlTemplate TargetType="{x:Type ListBox}">
                              <Border x:Name="Bd" Background="LightBlue" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="1" SnapsToDevicePixels="true" CornerRadius="30">
                                  <ScrollViewer Focusable="false" Padding="{TemplateBinding Padding}">
                                      <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                                  </ScrollViewer>
                              </Border>
                              <ControlTemplate.Triggers>
                                  <Trigger Property="IsEnabled" Value="false">
                                      <Setter Property="Background" TargetName="Bd" Value="{StaticResource ListBox.Disabled.Background}"/>
                                      <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource ListBox.Disabled.Border}"/>
                                  </Trigger>
                                  <MultiTrigger>
                                      <MultiTrigger.Conditions>
                                          <Condition Property="IsGrouping" Value="true"/>
                                          <Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/>
                                      </MultiTrigger.Conditions>
                                      <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
                                  </MultiTrigger>
                              </ControlTemplate.Triggers>
                          </ControlTemplate>
                      </Setter.Value>
                  </Setter>
                  <Setter Property="ItemTemplate">
                      <Setter.Value>
                          <DataTemplate >
                              <Grid>
                                  <StackPanel Orientation="Horizontal">
                                      <Grid>
                                          <Rectangle Stroke="Red" Fill="Orange" Width="{Binding Price}"/>
                                          <TextBlock Text="{Binding Year}"/>
                                      </Grid>
                                      <TextBlock Text="{Binding Price}" Margin="5,0"/>
                                  </StackPanel>
                              </Grid>
                          </DataTemplate>
                      </Setter.Value>
                  </Setter>
              </Style>
          </Window.Resources>
          <Grid>
              <ListBox x:Name="listBox1" Style="{StaticResource listBoxStyle}" Height="200" Width="300"/>
          </Grid>
      </Window>
      
      
      
      using System;
      using System.Collections.Generic;
      using System.Linq;
      using System.Text;
      using System.Threading.Tasks;
      using System.Windows;
      using System.Windows.Controls;
      using System.Windows.Data;
      using System.Windows.Documents;
      using System.Windows.Input;
      using System.Windows.Media;
      using System.Windows.Media.Imaging;
      using System.Windows.Shapes;
      
      namespace WpfApp1
      {
          /// <summary>
          /// Interaction logic for Window2.xaml
          /// </summary>
          public partial class Window2 : Window
          {
              public Window2()
              {
                  InitializeComponent();
      
                  List<Abc> list = new List<Abc>()
                  {
                      new Abc(){ Price=100, Year=1990},
                      new Abc(){ Price=150, Year= 1991 },
                      new Abc(){ Price=200, Year= 2000},
                      new Abc(){ Price=80, Year= 1894 },
                  };
                  this.listBox1.ItemsSource = list;
              }
          }
      
      public class Abc
      {
          public int Price { get; set; }
          public int Year { get; set; }
      }    
      }

       

      posted @ 2024-08-18 11:15  竹樓風雨聲  閱讀(10)  評論(0)    收藏  舉報
      主站蜘蛛池模板: 久久这里只有精品好国产| 亚洲精品成人无限看| 丁香五月婷激情综合第九色| 日本视频高清一区二区三区| 国产片一区二区三区视频| 高清中文字幕国产精品| 最新国产精品中文字幕| 免费无码黄十八禁网站| 一本色道国产在线观看二区| 国产精品十八禁一区二区| 欧美中文字幕无线码视频| 国产一区二区三区在线观看免费| 亚洲综合国产一区二区三区| 国产l精品国产亚洲区| 丰满巨乳淫巨大爆乳| 中文字幕在线永久免费视频 | 最近中文字幕国产精品| a在线观看视频在线播放| 国产精品久久久久9999高清| 欧美日产国产精品| 亚洲qingse中文字幕久久| 成人无码区在线观看| 亚洲图片自拍偷图区| 重庆市| 龙胜| 四虎影视www在线播放| japanese无码中文字幕| 男人用嘴添女人私密视频| 国产乱人伦偷精品视频下| 熟妇的奶头又大又长奶水视频| 亚洲精品无码成人A片九色播放| 老司机午夜免费精品视频| аⅴ天堂中文在线网| 在线看av一区二区三区 | 久久精品国产亚洲av麻豆不卡| 国产亚洲精品一区二区不卡| 吉木萨尔县| 亚洲熟女一区二区av| 亚洲人成人伊人成综合网无码| 变态另类视频一区二区三区| 色综合久久网|