一个射频标准支持多种带宽,多个频点,级联Combobox用两个Dictionary实现

ListView第一列时一个自定义控件,图片根据标准切换,Checkbox默认null,标准下的带宽和频点全部测试完毕后改为 true

采用了 MVVM框架,简单自定义一个Command

    internal class RelayCommand : ICommand{public event EventHandler CanExecuteChanged;public Action action;public RelayCommand(Action action){this.action = action;}public bool CanExecute(object parameter){return true;}public void Execute(object parameter){action?.Invoke();}}internal class RelayCommand<T> : ICommand{public event EventHandler CanExecuteChanged;public Action<T> action;public RelayCommand(Action<T> action){this.action = action;}public bool CanExecute(object parameter){return true;}public void Execute(object parameter){action?.Invoke((T)parameter);}}

Combobox实体。中心频点要做成Checkbox,就加了个IsChecked属性单独封装了

    public class ComboboxSignal{public ComboboxSignal(string standard, List<string> bandWidthList, List<CenterFreq> centerFreqList){Standard = standard;BandWidthList = bandWidthList;CenterFreqList = centerFreqList;}public string Standard { get; set; }public List<string> BandWidthList { get; set; } = new List<string>();public List<CenterFreq> CenterFreqList { get; set; } = new List<CenterFreq>();}public class CenterFreq : INotifyPropertyChanged{public event Action<CenterFreq> CheckedChanged;public event PropertyChangedEventHandler PropertyChanged;public CenterFreq(string freq, bool isChecked){Freq = freq;IsChecked = isChecked;}private string freq = string.Empty;public string Freq { get { return freq; } set { freq = value; PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Freq"));}}private bool isChecked = false;public bool IsChecked{get { return isChecked; }set{isChecked = value;PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("IsChecked"));if (isChecked){CheckedChanged?.Invoke(this);}}}}

填充数据源,第一个频点默认选中

        private static List<ComboboxSignal> m_signalList = new List<ComboboxSignal>();//信号列表/// <summary>/// 信号标准/// </summary>public List<string> StandardList { get; set; } = new List<string> { "802.11a/g", "802.11b", "802.11n", "802.11ac" };private void InitSignals(){List<CenterFreq> centerFreqList0 = new List<CenterFreq>();centerFreqList0.Add(new CenterFreq("36/5180M/Hz", true));centerFreqList0.Add(new CenterFreq("40/5200M/Hz", false));centerFreqList0.Add(new CenterFreq("44/5220M/Hz", false));List<CenterFreq> centerFreqList1 = new List<CenterFreq>();centerFreqList1.Add(new CenterFreq("1/2412M/Hz", true));centerFreqList1.Add(new CenterFreq("2/2417M/Hz", false));centerFreqList1.Add(new CenterFreq("3/2422M/Hz", false));List<CenterFreq> centerFreqList2 = new List<CenterFreq>();centerFreqList2.Add(new CenterFreq("36/5180M/Hz", true));centerFreqList2.Add(new CenterFreq("40/5200M/Hz", false));centerFreqList2.Add(new CenterFreq("44/5220M/Hz", false));List<CenterFreq> centerFreqList3 = new List<CenterFreq>();centerFreqList3.Add(new CenterFreq("1/2412M/Hz", true));centerFreqList3.Add(new CenterFreq("2/2417M/Hz", false));centerFreqList3.Add(new CenterFreq("3/2422M/Hz", false));m_signalList.Add(new ComboboxSignal(StandardList[0], new List<string> { "20M" }, centerFreqList0));m_signalList.Add(new ComboboxSignal(StandardList[1], new List<string> { "20M" }, centerFreqList1));m_signalList.Add(new ComboboxSignal(StandardList[2], new List<string> { "20M", "40M" }, centerFreqList2));m_signalList.Add(new ComboboxSignal(StandardList[3], new List<string> { "20M", "40M", "80M", "160M" }, centerFreqList3));CurrentSignal = m_signalList[0];ListViewSignalCollection.Add(new ListViewSignal(CurrentSignal));}

前端绑定,下载Interactivity库,为Combobox提供命令支持

<Grid><StackPanel HorizontalAlignment="Left" Margin="50"><TextBlock Margin="0 10 0 0" Text="{DynamicResource txtLanguage}" FontSize="30" HorizontalAlignment="Center" VerticalAlignment="Center"/><TextBlock Margin="0 25 0 0" Text="{DynamicResource txtStandard}" FontSize="30" HorizontalAlignment="Center" VerticalAlignment="Center"/><TextBlock Margin="0 25 0 0" Text="{DynamicResource txtBandWidth}" FontSize="30" HorizontalAlignment="Center" VerticalAlignment="Center"/><TextBlock Margin="0 25 0 0" Text="{DynamicResource txtCenterFreq}" FontSize="30" HorizontalAlignment="Center" VerticalAlignment="Center"/></StackPanel><StackPanel HorizontalAlignment="Center" Margin="0 50 0 0"><ComboBox SelectedIndex="0" FontSize="20" Height="50" Width="200" Margin="0 0 0 10"><i:Interaction.Triggers><i:EventTrigger EventName="SelectionChanged" ><i:InvokeCommandAction Command="{Binding LanguageChangedCommand}"CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ComboBox}}"/></i:EventTrigger></i:Interaction.Triggers><ComboBoxItem Content="{DynamicResource contChinese}"/><ComboBoxItem Content="{DynamicResource contEnglish}"/></ComboBox><ComboBox SelectedIndex="0" ItemsSource="{Binding StandardList}" Style="{StaticResource DefaultComboboxStyle}" FontSize="20" Height="50"  Width="200" Margin="0 10 0 0" ><i:Interaction.Triggers><i:EventTrigger EventName="SelectionChanged" ><i:InvokeCommandAction Command="{Binding StandardChangedCommand}"CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ComboBox}}"/></i:EventTrigger></i:Interaction.Triggers></ComboBox><ComboBox SelectedIndex="0" SelectedItem="{Binding DefaultBandWidth}" ItemsSource="{Binding CurrentSignal.BandWidthList}" Style="{StaticResource DefaultComboboxStyle}" FontSize="20" Height="50"  Width="200" Margin="0 10 0 0"><i:Interaction.Triggers><i:EventTrigger EventName="SelectionChanged" ><i:InvokeCommandAction Command="{Binding BandWidthChangedCommand}"CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ComboBox}}"/></i:EventTrigger></i:Interaction.Triggers></ComboBox><ComboBox  SelectedIndex="0" SelectedItem="{Binding DefaultCenterFreq}" ItemsSource="{Binding CurrentSignal.CenterFreqList}" Style="{StaticResource CheckCombobox}" FontSize="20" Height="50" Margin="0 10 0 0" ><ComboBox.ItemTemplate><DataTemplate DataType="{x:Type model:CenterFreq}"><StackPanel Orientation="Horizontal"><CheckBox IsChecked="{Binding IsChecked}" /><TextBlock Text="{Binding Freq}" /></StackPanel></DataTemplate></ComboBox.ItemTemplate><!--<i:Interaction.Triggers><i:EventTrigger EventName="SelectionChanged" ><i:InvokeCommandAction Command="{Binding CenterFreqChangedCommand}"CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ComboBox}}"/></i:EventTrigger></i:Interaction.Triggers>--></ComboBox></StackPanel></Grid>

Combobox设置了SelectedIndex,但有时候切换标准会不生效,新增两个属性绑定到SelectedItem上,切换标准时更新属性值

        private string defaultBandWidth;/// <summary>/// 默认带宽/// </summary>public string DefaultBandWidth{get { return defaultBandWidth; }set{defaultBandWidth = value;RaiseProertyChanged("DefaultBandWidth");}}private CenterFreq defaultCenterFreq;/// <summary>/// 默认频点/// </summary>public CenterFreq DefaultCenterFreq{get { return defaultCenterFreq; }set{defaultCenterFreq = value;RaiseProertyChanged("DefaultCenterFreq");}}

ListView实体

public class ListViewSignal : INotifyPropertyChanged{public event PropertyChangedEventHandler PropertyChanged;private ComboboxSignal m_comboboxSignal = null;//当前选中信号public ListViewSignal(ComboboxSignal comboboxSignal){m_comboboxSignal = comboboxSignal;Standard = m_comboboxSignal.Standard;BandWidthTestedCollection.Add(m_comboboxSignal.BandWidthList[0]);CenterFreqTestedCollection.Add(m_comboboxSignal.CenterFreqList[0].Freq);}/// <summary>/// 带宽和频点全部测试完毕后修改 IsAllTested 属性/// </summary>public void OnCollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e){if (BandWidthTestedCollection.Count == m_comboboxSignal.BandWidthList.Count &&CenterFreqTestedCollection.Count == m_comboboxSignal.CenterFreqList.Count){IsAllTested = true;}}#region Propertiesprivate string standard = "";/// <summary>/// 标准/// </summary>public string Standard{get { return standard; }set{standard = value;RaisePropertyChanged("Standard");}}private ObservableCollection<string> bandWidthTestedCollection = new ObservableCollection<string>();/// <summary>/// 已测带宽/// </summary>public ObservableCollection<string> BandWidthTestedCollection{get { return bandWidthTestedCollection; }set{bandWidthTestedCollection = value;RaisePropertyChanged("BandWidthTestedCollection");}}private ObservableCollection<string> centerFreqTestedCollection = new ObservableCollection<string>();/// <summary>/// 已测频点/// </summary>public ObservableCollection<string> CenterFreqTestedCollection{get { return centerFreqTestedCollection; }set{centerFreqTestedCollection = value;RaisePropertyChanged("CenterFreqTestedCollection");}}private bool isAllTested = false;/// <summary>/// 标准下的带宽和频点是否全部测完/// </summary>public bool IsAllTested{get { return isAllTested; }set{isAllTested = value;RaisePropertyChanged("isAllTested");}}#endregionprivate void RaisePropertyChanged(string propertyName){if (!string.IsNullOrEmpty(propertyName)){PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));}}}

前端

        <ListView  Margin="0 30 0 0" ItemsSource="{Binding ListViewSignalCollection}"><ListView.View><GridView><GridViewColumn Header="射频标准" Width="100"><GridViewColumn.CellTemplate><DataTemplate><StackPanel><controls:SignalCheckedControl Standard="{Binding Standard}" IsAllTested="{Binding IsAllTested}" ImgPath="{Binding Standard}"/></StackPanel></DataTemplate></GridViewColumn.CellTemplate></GridViewColumn><GridViewColumn Header="已测带宽" Width="100"><GridViewColumn.CellTemplate><DataTemplate><ListBox ItemsSource="{Binding BandWidthTestedCollection}"></ListBox></DataTemplate></GridViewColumn.CellTemplate></GridViewColumn><GridViewColumn Header="已测频点" Width="150"><GridViewColumn.CellTemplate><DataTemplate><ListBox ItemsSource="{Binding CenterFreqTestedCollection}"/></DataTemplate></GridViewColumn.CellTemplate></GridViewColumn></GridView></ListView.View></ListView>

自定义控件

    <StackPanel Orientation="Horizontal" Background="White"><Image x:Name="img" Height="14" Width="14"/><CheckBox x:Name="checkbox"  Grid.Column="1" IsThreeState="True" IsChecked="{x:Null}" Margin="5 0 5 0"/><TextBlock x:Name="textblock" Grid.Column="2" FontSize="10" Text="12345"/></StackPanel>
    public partial class SignalCheckedControl : UserControl{public SignalCheckedControl(){InitializeComponent();}/// <summary>/// 射频标准/// </summary>public string Standard{get { return (string)GetValue(StandardProperty); }set { SetValue(StandardProperty, value); }}public static readonly DependencyProperty StandardProperty =DependencyProperty.Register("Standard", typeof(string), typeof(SignalCheckedControl), new PropertyMetadata("", (d, e) =>{(d as SignalCheckedControl).textblock.Text = e.NewValue.ToString();}));/// <summary>/// 图片/// </summary>public string ImgPath{get { return (string)GetValue(ImgPathProperty); }set { SetValue(ImgPathProperty, value); }}// Using a DependencyProperty as the backing store for ImgPath.  This enables animation, styling, binding, etc...public static readonly DependencyProperty ImgPathProperty =DependencyProperty.Register("ImgPath", typeof(string), typeof(SignalCheckedControl), new PropertyMetadata("", (d, e) =>{string uriStr = string.Format(@"\Resource\Images\{0}.jpg", e.NewValue.ToString().Replace("/", "").Trim());(d as SignalCheckedControl).img.Source = new BitmapImage(new Uri(uriStr, UriKind.Relative));}));/// <summary>/// 标准下支持的带宽和频点是否全部测试完/// </summary>public bool IsAllTested{get { return (bool)GetValue(IsAllTestedProperty); }set { SetValue(IsAllTestedProperty, value); }}public static readonly DependencyProperty IsAllTestedProperty =DependencyProperty.Register("IsAllTested", typeof(bool), typeof(SignalCheckedControl), new PropertyMetadata(false, (d, e) =>{var control = d as SignalCheckedControl;var isAll = e.NewValue is bool;if (isAll){control.checkbox.IsChecked = true;}else{control.checkbox.IsChecked = null;}}));}
}

射频标准改变时更新级联Combobox数据源、默认值,Listview新增一条记录,但不重复新增

        private ObservableCollection<ListViewSignal> listViewSignalList = new ObservableCollection<ListViewSignal>();public ObservableCollection<ListViewSignal> ListViewSignalCollection{get { return listViewSignalList; }set{listViewSignalList = value;RaiseProertyChanged("ListViewSignalList");}}public RelayCommand<ComboBox> StandardChangedCommand{get{return new RelayCommand<ComboBox>((cbb) =>{CurrentSignal = m_signalList.Find((s) => s.Standard == cbb.SelectedItem.ToString());DefaultBandWidth = CurrentSignal.BandWidthList[0];DefaultCenterFreq = CurrentSignal.CenterFreqList[0];var listViewSignal = ListViewSignalCollection.FirstOrDefault((s) => s.Standard == CurrentSignal.Standard);if (listViewSignal == null){ListViewSignalCollection.Add(new ListViewSignal(CurrentSignal));}});}}

当前信号改变时为频点和已测项绑定变更通知事件(这个似乎也可以放在StandardChangedCommand里面做)

        public ComboboxSignal CurrentSignal{get { return currentSignal; }set{currentSignal = value;RaiseProertyChanged("CurrentSignal");currentSignal.CenterFreqList.ForEach(t => t.CheckedChanged += (sender) =>{//更新listviewvar list = ListViewSignalCollection;var signal = ListViewSignalCollection.FirstOrDefault((s) => s.Standard == currentSignal.Standard);if (signal != null){if (signal.CenterFreqTestedCollection.IndexOf(sender.Freq) == -1){signal.CenterFreqTestedCollection.CollectionChanged -= signal.OnCollectionChanged;signal.CenterFreqTestedCollection.CollectionChanged += signal.OnCollectionChanged;signal.CenterFreqTestedCollection.Add(sender.Freq);}}});               }}

带宽切换时更新已测带宽

        /// <summary>/// 带宽切换命令/// </summary>public RelayCommand<ComboBox> BandWidthChangedCommand{get{return new RelayCommand<ComboBox>((cbb) =>{var listViewSignal = ListViewSignalCollection.FirstOrDefault((s) => s.Standard == CurrentSignal.Standard);if (listViewSignal != null && cbb.SelectedItem != null){var bandWidth = listViewSignal.BandWidthTestedCollection.FirstOrDefault((s) => s == cbb.SelectedItem.ToString());if (bandWidth == null){listViewSignal.BandWidthTestedCollection.CollectionChanged -= listViewSignal.OnCollectionChanged;listViewSignal.BandWidthTestedCollection.CollectionChanged += listViewSignal.OnCollectionChanged;listViewSignal.BandWidthTestedCollection.Add(cbb.SelectedItem.ToString());}}});}}

完整ViewModel:

    internal class MainViewModel : INotifyPropertyChanged{public event PropertyChangedEventHandler PropertyChanged;private List<ResourceDictionary> m_dictionaryList = new List<ResourceDictionary>(); //资源文件列表private static List<ComboboxSignal> m_signalList = new List<ComboboxSignal>();//信号列表public MainViewModel(){InitSignals();}/// <summary>/// 信号标准/// </summary>public List<string> StandardList { get; set; } = new List<string> { "802.11a/g", "802.11b", "802.11n", "802.11ac" };private ObservableCollection<ListViewSignal> listViewSignalList = new ObservableCollection<ListViewSignal>();public ObservableCollection<ListViewSignal> ListViewSignalCollection{get { return listViewSignalList; }set{listViewSignalList = value;RaiseProertyChanged("ListViewSignalList");}}private ComboboxSignal currentSignal;/// <summary>/// 当前信号/// </summary>public ComboboxSignal CurrentSignal{get { return currentSignal; }set{currentSignal = value;RaiseProertyChanged("CurrentSignal");currentSignal.CenterFreqList.ForEach(t => t.CheckedChanged += (sender) =>{//更新listviewvar list = ListViewSignalCollection;var signal = ListViewSignalCollection.FirstOrDefault((s) => s.Standard == currentSignal.Standard);if (signal != null){if (signal.CenterFreqTestedCollection.IndexOf(sender.Freq) == -1){signal.CenterFreqTestedCollection.CollectionChanged -= signal.OnCollectionChanged;signal.CenterFreqTestedCollection.CollectionChanged += signal.OnCollectionChanged;signal.CenterFreqTestedCollection.Add(sender.Freq);}}});               }}private string defaultBandWidth;/// <summary>/// 默认带宽/// </summary>public string DefaultBandWidth{get { return defaultBandWidth; }set{defaultBandWidth = value;RaiseProertyChanged("DefaultBandWidth");}}private CenterFreq defaultCenterFreq;/// <summary>/// 默认频点/// </summary>public CenterFreq DefaultCenterFreq{get { return defaultCenterFreq; }set{defaultCenterFreq = value;RaiseProertyChanged("DefaultCenterFreq");}}/// <summary>/// 语言切换命令/// </summary>public RelayCommand<ComboBox> LanguageChangedCommand{get{return new RelayCommand<ComboBox>((cbb) =>{var languageType = "";var selectItem = (cbb.SelectedItem as ComboBoxItem).Content;switch (selectItem.ToString()){case "中文":languageType = "zh-CN";break;case "英文":languageType = "en-US";break;case "Chinese":languageType = "zh-CN";break;case "English":languageType = "en-US";break;default:break;}//更换资源文件foreach (ResourceDictionary dictionary in Application.Current.Resources.MergedDictionaries){m_dictionaryList.Add(dictionary);}string requestedCulture = string.Format(@"Resource\{0}.xaml", languageType);ResourceDictionary resourceDictionary = m_dictionaryList.FirstOrDefault(d => d.Source.OriginalString.Equals(requestedCulture));if (resourceDictionary == null){requestedCulture = @"Resource\zh-CN.xaml";resourceDictionary = m_dictionaryList.FirstOrDefault(d => d.Source.OriginalString.Equals(requestedCulture));}if (resourceDictionary != null){Application.Current.Resources.MergedDictionaries.Remove(resourceDictionary);Application.Current.Resources.MergedDictionaries.Add(resourceDictionary);}});}}/// <summary>/// Standard切换命令/// </summary>public RelayCommand<ComboBox> StandardChangedCommand{get{return new RelayCommand<ComboBox>((cbb) =>{CurrentSignal = m_signalList.Find((s) => s.Standard == cbb.SelectedItem.ToString());DefaultBandWidth = CurrentSignal.BandWidthList[0];DefaultCenterFreq = CurrentSignal.CenterFreqList[0];var listViewSignal = ListViewSignalCollection.FirstOrDefault((s) => s.Standard == CurrentSignal.Standard);if (listViewSignal == null){ListViewSignalCollection.Add(new ListViewSignal(CurrentSignal));}});}}/// <summary>/// 带宽切换命令/// </summary>public RelayCommand<ComboBox> BandWidthChangedCommand{get{return new RelayCommand<ComboBox>((cbb) =>{var listViewSignal = ListViewSignalCollection.FirstOrDefault((s) => s.Standard == CurrentSignal.Standard);if (listViewSignal != null && cbb.SelectedItem != null){var bandWidth = listViewSignal.BandWidthTestedCollection.FirstOrDefault((s) => s == cbb.SelectedItem.ToString());if (bandWidth == null){listViewSignal.BandWidthTestedCollection.CollectionChanged -= listViewSignal.OnCollectionChanged;listViewSignal.BandWidthTestedCollection.CollectionChanged += listViewSignal.OnCollectionChanged;listViewSignal.BandWidthTestedCollection.Add(cbb.SelectedItem.ToString());}}});}}private void RaiseProertyChanged(string propertyName){if (string.IsNullOrEmpty(propertyName)) return;PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));}private void InitSignals(){List<CenterFreq> centerFreqList0 = new List<CenterFreq>();centerFreqList0.Add(new CenterFreq("36/5180M/Hz", true));centerFreqList0.Add(new CenterFreq("40/5200M/Hz", false));centerFreqList0.Add(new CenterFreq("44/5220M/Hz", false));List<CenterFreq> centerFreqList1 = new List<CenterFreq>();centerFreqList1.Add(new CenterFreq("1/2412M/Hz", true));centerFreqList1.Add(new CenterFreq("2/2417M/Hz", false));centerFreqList1.Add(new CenterFreq("3/2422M/Hz", false));List<CenterFreq> centerFreqList2 = new List<CenterFreq>();centerFreqList2.Add(new CenterFreq("36/5180M/Hz", true));centerFreqList2.Add(new CenterFreq("40/5200M/Hz", false));centerFreqList2.Add(new CenterFreq("44/5220M/Hz", false));List<CenterFreq> centerFreqList3 = new List<CenterFreq>();centerFreqList3.Add(new CenterFreq("1/2412M/Hz", true));centerFreqList3.Add(new CenterFreq("2/2417M/Hz", false));centerFreqList3.Add(new CenterFreq("3/2422M/Hz", false));m_signalList.Add(new ComboboxSignal(StandardList[0], new List<string> { "20M" }, centerFreqList0));m_signalList.Add(new ComboboxSignal(StandardList[1], new List<string> { "20M" }, centerFreqList1));m_signalList.Add(new ComboboxSignal(StandardList[2], new List<string> { "20M", "40M" }, centerFreqList2));m_signalList.Add(new ComboboxSignal(StandardList[3], new List<string> { "20M", "40M", "80M", "160M" }, centerFreqList3));CurrentSignal = m_signalList[0];ListViewSignalCollection.Add(new ListViewSignal(CurrentSignal));}}

【WPF】级联Combobox及其与ListView的联动相关推荐

  1. 关于WPF的ComboBox中Items太多而导致加载过慢的问题

                                         [WFP疑难]关于WPF的ComboBox中Items太多而导致加载过慢的问题                         ...

  2. WPF之ComboBox的VisualTreeHelper

    WPF之ComboBox的VisualTreeHelper 用WPF的ComboBox控件的时候,需要用到TextChanged属性,但是这个属性属于TextBox控件,不用担心,ComboBox中存 ...

  3. WPF的ComboBox 数据模板自定义

    WPF的ComboBox 有些时候不能满足用户需求,需要对数据内容和样式进行自定义,下面就简要介绍一下用数据模板(DataTemplate)的方式对ComboBox 内容进行定制: 原型设计如下: 步 ...

  4. 22、wpf之Combobox使用小记

    前言:作为wpf中常用的列表控件之一,Combox既具备了列表控件的下拉功能,又具备了Selector 类的选择功能,算是个复合性控件.现记录下MVVM模式下常用属性. 一.简介 ComboBox是一 ...

  5. 解答WPF中ComboBox SelectedItem Binding不上的Bug

    原文:解答WPF中ComboBox SelectedItem Binding不上的Bug 正在做一个打印机列表,从中选择一个打印机(System.Printing) <ComboBox Widt ...

  6. 【WPF】自定义GridLineDecorator给ListView画网格

    感谢 rgqancy 指出的Bug,已经修正 先给个效果图: 使用时的代码: 代码 <l:GridLineDecorator> <ListView ItemsSource=" ...

  7. 仿饿了么,百度外卖这些App的双ListView列表联动效果

    仿饿了么,百度外卖这些App的双列表联动效果 思路: 1.自定义一个悬浮条目且带移动替换效果的ListView. 2.在界面中左边是个普通的ListView,右边是我们自定义带效果的ListView. ...

  8. wpf 将Style应用到 ListView 中的 ListViewItem 元素

    例: 为每个条目元素设置右键菜单 1. 新建右键菜单元素和样式元素 注意: 同时设置样式元素的 TargetType 属性和 x:Key 属性, 将样式元素限定为应用于 ListViewItem 类型 ...

  9. WPF 设置ComboBox下拉框默认选中第一个(All)

    设置ComboBox的SelectedIndex属性为0即可. <ComboBox  SelectedIndex="0"  />

最新文章

  1. 页面宽高,窗口宽高,元素宽高,元素位置,页面滚动距离
  2. 全栈工程师的学习笔记与工作记录
  3. Mybatis-Plus实战中的几个条件构造器Wrapper用法
  4. pycharm ctrl+s ctrl+alt+shift+x 同步上传代码到服务器
  5. docker 删除tag为none的docker镜像
  6. 城市间紧急救援 (25 分)【dijkstra模板 超时原因】
  7. 什么是通用字符名称?_通用名称
  8. Java 8可选:如何使用它
  9. 深入浅出:HTTP/2
  10. 设计模式 - 策略模式Strategy
  11. python读取多个文件夹_如何从python中的文件夹中读取多个NetCDF文件
  12. ubuntu 14.04下练习lua
  13. 什么叫做形态学图像处理_【视觉】机器视觉技术和无人天车有什么关系?
  14. Autocompletetextview width fill parent问题
  15. BZOJ-2768: [JLOI2010]冠军调查(超级裸的最小割)
  16. R语言使用:符号生成向量数据、使用pie函数可视化饼图、自定义设置饼图色彩为彩虹色
  17. 电脑安装不上chrome浏览器
  18. 多个视频合成一个视频(带合成工具)
  19. 史上最全阿里 Java 面试题总结及答案
  20. 有效沟通bic法则_猎头支招:工作中有效沟通的法则

热门文章

  1. Go 常量之 iota
  2. 光天化日电影真实有效的吗?
  3. 微软暗讽谷歌封杀Windows
  4. 调用百度地图接口获取城市住宅小区边界信息
  5. 网络工程防雷接地实训装置
  6. ISO 26262 Functional Safety Requirement Types】
  7. 全排列邻位对换法c语言算法,全排列及相关扩展算法(六)——全排列最蛋疼的算法:邻位对换法...
  8. 金融风暴会引发中国信用卡危机吗
  9. asp毕业设计——基于vb+VB.NET+SQL Server的数据存储与交换系统设计与实现(毕业论文+程序源码)——数据存储与交换系统
  10. AI制作牙膏笔刷文字