开发者

WPF contextmenu not fired on Windows Server 2003

开发者 https://www.devze.com 2023-02-24 09:19 出处:网络
I have a class like this: public class MenuItem { private string _text; public string Text { get { return _text; }

I have a class like this:

public class MenuItem
{
    private string _text;
    public string Text
    {
        get { return _text; }
        set { _text = value; }
    }
    public List<MenuItem> Children { get; private set; }
    public ICommand Command { get; private set; }
    private BitmapImage _icon;
    public BitmapImage Icon
    {
        get { return _icon; }
  开发者_如何学Go      private set { _icon = value; }
    }

    public MenuItem(string text, ICommand command)
    {
        this.Text = text;
        this.Command = command;
        this.Children = new List<MenuItem>();
    }
    public MenuItem(string text, ICommand command, BitmapImage icon)
        : this(text, command)
    {

        this.Icon = icon;            
    }
}

from my VM, I am creating an instance of this class and send in a command (refresh), this is a context menu for a TreeViewItem. everything works as expected on Windows 2008, Windows 7, but doesn't fire on Windows 2003

0

精彩评论

暂无评论...
验证码 换一张
取 消