RadTileView events handling in mvvm

2 posts, 0 answers
  1. Sajid Ali
    Sajid Ali avatar
    12 posts
    Member since:
    Aug 2010

    Posted 10 Dec 2012 Link to this post

    Very straight forward question.

    I want to handle the 

    TileStateChanged

    of RadTileView in my viewmodel.

    Can anybody please point out the code.

  2. Sajid Ali
    Sajid Ali avatar
    12 posts
    Member since:
    Aug 2010

    Posted 11 Dec 2012 Link to this post

    We can use MVVM light for this purpose.

     xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
        xmlns:mvvmlight="http://www.galasoft.ch/mvvmlight"

    Referenced assemblies ...
    XAML

     <telerik:RadTileView Name="rtvViews" ItemsSource="{Binding ViewItems,Mode=TwoWay}" Grid.Row="1">
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="TilesPositionChanged">
                        <mvvmlight:EventToCommand Command="{Binding TileStateCommand,Mode=TwoWay}"
                                          MustToggleIsEnabledValue="True" 
                                          PassEventArgsToCommand="True"/>
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </telerik:RadTileView>

    ViewModel

     TileStateCommand = new DelegateCommand(ChangedStateAction);
    

     private void ChangedStateAction(object args)
            {
                ... your code
            }


    Hope it will help somebody...
  3. DevCraft banner
Back to Top