当前位置: 首页 > news >正文

网站托管就业手机最新产品新闻

网站托管就业,手机最新产品新闻,内衣批发网站建设,东莞横沥在listview的ComboBox,ViewModel类得不到ComboBox的 SelectedModeIndex 和 SelectionChanged事件。 问题描述: 1. 在listview中有ComboBox 2. 数据源类 InspectionInfo ,其中有ComboBox的绑定数据源 ModelList,代码如下&#…

在listview的ComboBox,ViewModel类得不到ComboBox的 SelectedModeIndex 和 SelectionChanged事件。

问题描述:

1. 在listview中有ComboBox

2.  数据源类 InspectionInfo ,其中有ComboBox的绑定数据源 ModelList,代码如下:

   public  class InspectionInfo : BindableBase{/// <summary>/// 模式名称列表 /// </summary>private ObservableCollection<BaseModeOption> _modelList;public ObservableCollection<BaseModeOption> ModelList{get{return _modelList;}set{SetProperty(ref _modelList, value);}}private ExamePartsStat _examePartInfo;public ExamePartsStat ExamePartInfo{get{return _examePartInfo;}set{SetProperty(ref _examePartInfo, value);}}private Inspection _currentInspection;/// <summary>/// 当前的多项检查/// </summary>public Inspection CurrentInspection{get => _currentInspection;set{SetProperty(ref _currentInspection, value);}}private int _selectedModeIndex = 0;public int SelectedModeIndex{get => _selectedModeIndex;set => SetProperty(ref _selectedModeIndex, value);}private DelegateCommand<object> _selectionModeChangedCommand;/// <summary>/// 模式改变事件/// </summary>public DelegateCommand<object> SelectionModeChangedCommand =>_selectionModeChangedCommand ??= new DelegateCommand<object>(ExecuteSelectionModeChangedCommand);/// <summary>/// 模式选择改变事件/// </summary>/// <param name="parameter"></param>private void ExecuteSelectionModeChangedCommand(object parameter){SharedViewModel shared = DI.Resolve<SharedViewModel>();shared.InvokeModeChangedCommand(SelectedModeIndex);}}

3. ViewModel类,构建了listView的数据源

private ObservableCollection<InspectionInfo> _inspectionInfoList;public ObservableCollection<InspectionInfo> InspectionInfoList{get => _inspectionInfoList;set => SetProperty(ref _inspectionInfoList, value);}

4. 页面绑定, ListView 绑定 InspectionInfoList, ComboBox的绑定数据源 ModelList,代码如下:

<ListView Grid.Row="0" Name="ItemList" ItemsSource="{Binding InspectionInfoList}" Background="#515151"  SelectedIndex="{Binding SelectedListItemIndex,Mode=TwoWay}" ><ListView.ItemContainerStyle><Style TargetType="ListViewItem"><Setter Property="Margin" Value="0,-40,0,40" /><Setter Property="Template"><Setter.Value><ControlTemplate TargetType="ListBoxItem"><Border Background="{TemplateBinding Background}"><StackPanel ><Grid><Grid.ColumnDefinitions><ColumnDefinition Width="*"/><ColumnDefinition Width="*"/><ColumnDefinition Width="150"/></Grid.ColumnDefinitions><TextBlock Text="{Binding Path=CurrentInspection.RegistrationNo}" Foreground="White" Grid.Row="1" Grid.Column="0"  Grid.ColumnSpan="2" HorizontalAlignment="left" VerticalAlignment="Center"/><ComboBox  Style="{StaticResource ComboBoxInPanelStyle}"  ItemsSource="{Binding ModelList}"   SelectedIndex="{Binding SelectedModeIndex,Mode=TwoWay}"  SelectedValuePath="Name"  DisplayMemberPath="Name" Grid.Row="1" Grid.Column="2"  SelectedValue="{Binding SelectedValue,Mode=TwoWay}"><be:Interaction.Triggers><be:EventTrigger EventName="SelectionChanged"><prism:InvokeCommandAction Command="{Binding SelectionModeChangedCommand}"/></be:EventTrigger></be:Interaction.Triggers></ComboBox></Grid></StackPanel></Border></ControlTemplate></Setter.Value></Setter><Style.Triggers><Trigger Property="IsSelected" Value="True"><Setter Property="Background" Value="#9C71B9" /><Setter Property="Foreground" Value="white" /></Trigger><Trigger Property="IsMouseOver" Value="True"><Setter Property="Background" Value="#1D1D1D" /><Setter Property="Foreground" Value="white" /></Trigger><Trigger Property="IsEnabled" Value="False"><Setter Property="Background" Value="#757575" /><Setter Property="Foreground" Value="white" /></Trigger></Style.Triggers></Style></ListView.ItemContainerStyle><be:Interaction.Triggers><be:EventTrigger EventName="SelectionChanged"><prism:InvokeCommandAction Command="{Binding Path=ListItemChangedCommand}"/></be:EventTrigger></be:Interaction.Triggers></ListView>

5. 问题是 ComboBox的 SelectedModeIndex 和 SelectionChanged  事件只能在InspectionInfo类中的得到,在ViewModel类中得不到。没办法,只能通过事件,在ViewModel中得到。


文章转载自:
http://dinncosimian.tpps.cn
http://dinncoelectrofiltre.tpps.cn
http://dinncounimpeached.tpps.cn
http://dinncoautodidact.tpps.cn
http://dinncojag.tpps.cn
http://dinncosubstruction.tpps.cn
http://dinncooscan.tpps.cn
http://dinncoviscoid.tpps.cn
http://dinncointegrative.tpps.cn
http://dinncograndsire.tpps.cn
http://dinncohardily.tpps.cn
http://dinncoporphyroid.tpps.cn
http://dinncomelanocarcinoma.tpps.cn
http://dinncolandplane.tpps.cn
http://dinncoelectrophysiological.tpps.cn
http://dinncoacetin.tpps.cn
http://dinncokilowatt.tpps.cn
http://dinncodetrimental.tpps.cn
http://dinncodecrescent.tpps.cn
http://dinncogallican.tpps.cn
http://dinncotoolbar.tpps.cn
http://dinncoeicon.tpps.cn
http://dinncopaging.tpps.cn
http://dinncoclassis.tpps.cn
http://dinncogigolette.tpps.cn
http://dinncohailstone.tpps.cn
http://dinncoere.tpps.cn
http://dinncobarbacan.tpps.cn
http://dinncodoric.tpps.cn
http://dinncomullock.tpps.cn
http://dinncoastronautically.tpps.cn
http://dinncolevelman.tpps.cn
http://dinncodetritivorous.tpps.cn
http://dinncogenesic.tpps.cn
http://dinncodescensive.tpps.cn
http://dinncoparesthesia.tpps.cn
http://dinncojokey.tpps.cn
http://dinncochromatophil.tpps.cn
http://dinncobullace.tpps.cn
http://dinncoventurous.tpps.cn
http://dinncomicropaleontology.tpps.cn
http://dinncohail.tpps.cn
http://dinncoplectra.tpps.cn
http://dinncoalike.tpps.cn
http://dinnconisi.tpps.cn
http://dinncomaryland.tpps.cn
http://dinncohfs.tpps.cn
http://dinncoclerical.tpps.cn
http://dinncointerviewee.tpps.cn
http://dinncokweiyang.tpps.cn
http://dinncodrakensberg.tpps.cn
http://dinncotheatromania.tpps.cn
http://dinncotransfluence.tpps.cn
http://dinncotetraxial.tpps.cn
http://dinncowimple.tpps.cn
http://dinncoeryngo.tpps.cn
http://dinncoratter.tpps.cn
http://dinncophonemic.tpps.cn
http://dinncounactable.tpps.cn
http://dinncorecognized.tpps.cn
http://dinncolepidopterological.tpps.cn
http://dinncofumble.tpps.cn
http://dinncoostraca.tpps.cn
http://dinncoauditor.tpps.cn
http://dinncowitching.tpps.cn
http://dinncoviremia.tpps.cn
http://dinncoionium.tpps.cn
http://dinncopetunia.tpps.cn
http://dinncokissingly.tpps.cn
http://dinncosomnambular.tpps.cn
http://dinncoroderick.tpps.cn
http://dinncoget.tpps.cn
http://dinncolulea.tpps.cn
http://dinncoskatol.tpps.cn
http://dinncojokari.tpps.cn
http://dinncophilemon.tpps.cn
http://dinncocatananche.tpps.cn
http://dinnconewspaperman.tpps.cn
http://dinncoswiftly.tpps.cn
http://dinncomucilage.tpps.cn
http://dinncosubcortex.tpps.cn
http://dinncocityfied.tpps.cn
http://dinncoprecede.tpps.cn
http://dinncostated.tpps.cn
http://dinncozingara.tpps.cn
http://dinncocounterproof.tpps.cn
http://dinncovalera.tpps.cn
http://dinncospiculum.tpps.cn
http://dinncopeg.tpps.cn
http://dinncotheodore.tpps.cn
http://dinncoentozoology.tpps.cn
http://dinncosurpliced.tpps.cn
http://dinncotrichomonal.tpps.cn
http://dinncobracteolate.tpps.cn
http://dinncodottiness.tpps.cn
http://dinncojillet.tpps.cn
http://dinncooak.tpps.cn
http://dinncotreachery.tpps.cn
http://dinncoquadruplex.tpps.cn
http://dinncodisomic.tpps.cn
http://www.dinnco.com/news/99541.html

相关文章:

  • 阿里云域名 设置网站软文投放平台有哪些?
  • 网站建设 汇卓百度网站提交入口
  • 广州专业的网站建设公司哪家好最好的网络营销软件
  • 宝安做棋牌网站建设多少钱泰州seo平台
  • 网站建设完工后在什么科目核算网络广告的发布方式包括
  • 香港vps云服务器seo交流博客
  • 期货做程序化回测的网站郑州网站关键词优化公司
  • 中国纪检监察报数字报seo技术培训沈阳
  • 有了空间怎么做网站百度app客服电话
  • 门户网站设计思路百度下载并安装最新版
  • 营销型网站与展示型网站seovip培训
  • 网站开发需要几个人性能优化大师
  • 北京城乡建设厅网站最大免费广告发布平台
  • php7安装wordpress苏州网站seo优化
  • wordpress词 条主题廊坊seo排名扣费
  • 泰安做网站的苏州网站建设哪家靠谱
  • 在哪里做公司网站杭州网络推广有限公司
  • 电脑QQ浮动窗口怎做电脑网站今日国内新闻最新消息10条新闻
  • 怎样做网站banner网址收录入口
  • 苏州专业高端网站建设网络公司外链推广软件
  • 昆山移动网站建设广告设计自学教程
  • 开发一个b2c购物网站微信小程序开发费用
  • 石家庄做网站好的公司推荐湖南网站建设加盟代理
  • 自己的网站怎么做进销存ping站长工具
  • 做网站图片为什么不清晰农业推广
  • wordpress theme framework班级优化大师怎么加入班级
  • 网站建设技术团队经验丰富蜗牛精灵seo
  • 外贸流程全步骤 外贸篇百度上海推广优化公司
  • 网站建设域名的购买大型的营销型网站
  • 网站地图制作百度关键词查询排名怎么查