0

MVVM パターンを使用して ComponentOne WPF コントロールを使用しています。

ViewModel には次のものがあります。

 public ICommand ClientsEnter
        {
            get
            {
                if (this.m_ClientsEnter == null)
                {
                    this.m_ClientsEnter = new DelegateCommand<string>(ClientsLostFocusExecute, ClientsLostFocusCanExecute);
                }
                return m_ClientsEnter;
            }
        }

そして観察可能なコレクション:

 public ObservableCollection<Client> Clients
        {
            get { return m_Clients; }
            set
            {
                m_Clients = value;
                RaisePropertyChanged("Clients");
            }
        }

Xaml で、ClientNameOrIDを入力して Enter キーを押してイベントを起動し、ClientsEnterコマンドを実行できる ComponentOne コンボ ボックスを追加しました。

<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"ません !何か案は?

4

1 に答える 1

1

この問題を調査するのに 2 日間費やした後、C1Combobox にバグがあることがわかりました。C1Combobox を telerik Comboxbox に置き換え、コントロール以外の xaml で何も変更せずに同じトリガーを追加すると、正常に動作します。

最後に、C1 wpf コントロールはお勧めしません

于 2013-08-24T00:16:45.027 に答える