首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ComponentOne组合框交互

ComponentOne组合框交互
EN

Stack Overflow用户
提问于 2013-08-21 19:01:07
回答 1查看 379关注 0票数 0

我正在使用MVVM模式的ComponentOne WPF控件。

我的ViewModel中有以下内容:

代码语言:javascript
复制
 public ICommand ClientsEnter
        {
            get
            {
                if (this.m_ClientsEnter == null)
                {
                    this.m_ClientsEnter = new DelegateCommand<string>(ClientsLostFocusExecute, ClientsLostFocusCanExecute);
                }
                return m_ClientsEnter;
            }
        }

和一个可观察的集合:

代码语言:javascript
复制
 public ObservableCollection<Client> Clients
        {
            get { return m_Clients; }
            set
            {
                m_Clients = value;
                RaisePropertyChanged("Clients");
            }
        }

在Xaml中,我添加了一个ComponentOne组合框,我可以在其中输入ClientNameID,然后按enter键触发事件以执行ClientsEnter命令:

代码语言:javascript
复制
<Custom1:C1ComboBox  Grid.Row="2" Grid.Column="1" Height="24" Name="cmbClients" HorizontalAlignment="Left" VerticalAlignment="Center"
                ItemsSource="{Binding Clients, Mode=OneWay}" SelectedValuePath="ClientID" DisplayMemberPath="NameE" IsEditable="True"
                Text="Enter Client Name Or ID" SelectedValue="{Binding Path=Filter.ClientID, Mode=TwoWay}" MinWidth="150" Margin="0,2" Width="189">
              <i:Interaction.Triggers>
                <ei:KeyTrigger Key="Tab"  FiredOn="KeyUp" ActiveOnFocus="True" SourceName="cmbClients">
                  <i:InvokeCommandAction Command="{Binding ClientsEnter, Mode=OneWay}" CommandParameter="{Binding Text,ElementName=cmbClients}" CommandName="KeyDown"/>
                </ei:KeyTrigger>
              </i:Interaction.Triggers>
            </Custom1:C1ComboBox>

我需要知道为什么它不工作,在按下enter后,clientID消失了,什么也没有发生。甚至text="Enter Client Name Or ID"都没有出现!有什么想法吗?

EN

回答 1

Stack Overflow用户

发布于 2013-08-24 08:16:45

在花了2天的时间调查这个问题后,我发现C1Combobox中有一个bug,因为我用telerik Comboxbox替换了它,并添加了相同的触发器,除了控件之外没有改变任何东西,它工作得很好。

最后,我不推荐使用C1 wpf控件

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18355655

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档