我有一个上下文菜单样式,我希望将单击传递给具有style参数的方法,我该怎么做?
<Setter Property="ContextMenu">
<Setter.Value>
<ContextMenu FontFamily="{StaticResource BaseFontFamily}" FontSize="{StaticResource MediumFontSize}">
<MenuItem Header="ذخیره تنظیمات جدول" Margin="0,5,0,0" >
<MenuItem.Icon>
<Image Width="15" Height="15" Source="/KabiranNet.com;component/Resources/Icon-Backup.png" />
</MenuItem.Icon>
<MenuItem.Style>
<Style TargetType="MenuItem">
</Style>
</MenuItem.Style>
</MenuItem>
方法在另一个类中是这样的
public void grid_change_name(string win, string grid)
{
Win_RightClick Win = new Win_RightClick();
Win.DataGridRoot = grid;
Win.WinName = win;
Win.ShowDialog();
}