my project is using MVVM Light Toolkit.
so, all property, all command binding
but, i can't bind CommandParameter with control in view
<telerikPrimitives:RadDataBoundListBox x:Name="lbStationDetail" Grid.Row="1" EmptyContent="검색된 결과가 없습니다."
ItemsSource="{Binding BusVM.StationNoCollection}" ItemTemplate="{StaticResource StationNoRouteDataTemplate}" >
<telerikPrimitives:RadContextMenu.ContextMenu>
<telerikPrimitives:RadContextMenu>
<telerikPrimitives:RadContextMenuItem Content="즐겨찾기 추가" Command="{Binding AddFavoriteCommand, Mode=OneWay}" CommandParameter="{Binding }"/>
</telerikPrimitives:RadContextMenu>
</telerikPrimitives:RadContextMenu.ContextMenu>
</telerikPrimitives:RadDataBoundListBox>
how can i know hold item?
add
i find somting. but, i can't get RadDataBoundListBoxItem
menu is get currentFocusedElement property.
how can i do get it?
RelayCommand<object> addFavoriteCommand;
/// <summary>
/// 즐겨찾기에 추가
/// </summary>
public RelayCommand<object> AddFavoriteCommand
{
get
{
if (addFavoriteCommand == null)
{
addFavoriteCommand = new RelayCommand<object>(item =>
{
var menuItem = item as RadContextMenuItem;
var menu = menuItem.Parent as RadContextMenu;
var tt = menu.GetElementUnderMenu<RadDataBoundListBoxItem>();
//var tt = menu.GetType().GetElementType();
//var lb = menu.Parent as RadDataBoundListBox;
if (tt != null)
{
}
});
}
return addFavoriteCommand;
}