Command

2 posts, 0 answers
  1. IRoman91
    IRoman91 avatar
    2 posts
    Member since:
    Nov 2013

    Posted 04 Nov 2013 Link to this post

    Hi!

     

    I'm using a MVVM Light for my WP8 application. So when an event from RadTextBox raised, i need to send command to the ViewModel.  I tried the solution below, but it doesn't work. Can you give another approach?


    View:
    <telerikPrimitives:RadTextBox x:Name="TestBox" Header="Test">
        <i:Interaction.Triggers>
            <i:EventTrigger EventName="LostFocus"  SourceName="TestBox">
                <i:InvokeCommandAction Command="{Binding BoxLostFocusCommand}" />
            </i:EventTrigger>
        </i:Interaction.Triggers>
    </telerikPrimitives:RadTextBox>

    ViewModel:

    public RelayCommand BoxLostFocusCommand
        {
            get; set;
        }
     
    public TestViewModel()
        {
            InitializeCommand();
        }
     
    public void InitializeCommand()
        {
            BoxLostFocusCommand = new RelayCommand(() =>
            {
     
            });
        }
  2. IRoman91
    IRoman91 avatar
    2 posts
    Member since:
    Nov 2013

    Posted 04 Nov 2013 Link to this post

    I found my mistake! Sorry for disturbing

  3. DevCraft banner
Back to Top