This is a migrated thread and some comments may be shown as answers.

RadTileView events handling in mvvm

1 Answer 77 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sajid Ali
Top achievements
Rank 2
Sajid Ali asked on 10 Dec 2012, 10:49 AM
Very straight forward question.

I want to handle the 

TileStateChanged

of RadTileView in my viewmodel.

Can anybody please point out the code.

1 Answer, 1 is accepted

Sort by
0
Sajid Ali
Top achievements
Rank 2
answered on 11 Dec 2012, 11:50 AM
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...
Tags
General Discussions
Asked by
Sajid Ali
Top achievements
Rank 2
Answers by
Sajid Ali
Top achievements
Rank 2
Share this question
or