Note that there are some explanatory texts on larger screens.

plurals
  1. POInteractions with MVVM wpf
    primarykey
    data
    text
    <p>I am working with ComponentOne WPF Controls with MVVM Pattern.</p> <p>I have the following in my ViewModel:</p> <pre><code>public ICommand ClientsEnter { get { if (this.m_ClientsEnter == null) { this.m_ClientsEnter = new DelegateCommand&lt;string&gt;(ClientsLostFocusExecute, ClientsLostFocusCanExecute); } return m_ClientsEnter; } } </code></pre> <p>And an observable collection:</p> <pre><code>public ObservableCollection&lt;Client&gt; Clients { get { return m_Clients; } set { m_Clients = value; RaisePropertyChanged("Clients"); } } </code></pre> <p>In Xaml I have Added A ComponentOne Combo Box where I can enter ClientName Or ID and press enter to fire Event to execute ClientsEnter Command:</p> <pre><code>&lt;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"&gt; &lt;i:Interaction.Triggers&gt; &lt;ei:KeyTrigger Key="enter" FiredOn="KeyUp" ActiveOnFocus="True" SourceName= "cmbClients"&gt; &lt;i:InvokeCommandAction Command="{Binding ClientsEnter, Mode=OneWay}" CommandParameter="{Binding Text,ElementName=cmbClients}" CommandName="KeyDown"/&gt; &lt;/ei:KeyTrigger&gt; &lt;/i:Interaction.Triggers&gt; &lt;/Custom1:C1ComboBox&gt; </code></pre> <p>I need to know why it doesn't work, after pressing enter the clientID Disappears and nothing happens. Even the text="Enter Client Name Or ID" doesn't appear! Any ideas? note that when i change the key to space it works but it doesnt take the text from combobox,</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload