Quantcast
Channel: Caliburn.Micro: Xaml Made Easy
Viewing all articles
Browse latest Browse all 1760

New Post: RadContextMenu with caliburn.micro

$
0
0
Hello, i use a RadContextMenu of telerik and MVVM Caliburn.Micro.

i have this xaml
<Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <myclass:LongListSelector ItemsSource="{Binding Collections}" LayoutMode="Grid" GridCellSize="215,240" SelectedItem="{Binding Path=CurrentCollection, Mode=TwoWay}"
                      cal:Message.Attach="[Event Tap] = [Action OnSelectionChangedCommand]">
                <telerikPrimitives:RadContextMenu.ContextMenu>
                    <telerikPrimitives:RadContextMenu x:Name="menu" cal:Action.TargetWithoutContext="{Binding DataContext, ElementName=LayoutRoot}">
                        <telerikPrimitives:RadContextMenuItem Content="EDIT"
                                                              cal:Message.Attach="ExecuteAction1" />
                        <telerikPrimitives:RadContextMenuItem Content="DELETE"
                                                              cal:Message.Attach="ExecuteAction1"  />
                    </telerikPrimitives:RadContextMenu>
                </telerikPrimitives:RadContextMenu.ContextMenu>
                <myclass:LongListSelector.ItemTemplate>
                    <DataTemplate>
                        .....
                    </DataTemplate>
                </myclass:LongListSelector.ItemTemplate>
            </myclass:LongListSelector>

        </Grid>
    </Grid>
in my viewmodel c#

public void ExecuteAction1()
    { 
    }
receive this error

{System.Exception: No target found for method ExecuteAction1.
at Caliburn.Micro.ActionMessage.Invoke(Object eventArgs)
at System.Windows.Interactivity.TriggerAction.CallInvoke(Object parameter)

why?

Viewing all articles
Browse latest Browse all 1760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>