Tell me how to display the same element in different places.
It is necessary to make a checkbox in the menu and exactly the same checkbox in the context menu.

  • one
    You cannot display the same item in different places. You can only display the same elements. To synchronize the state, connect the same VM to them. - VladD

2 answers 2

You can use styles , or create your own UserControl

    Well, for example, create a static helper that returns your checkbox.

    public static class Helper { public CheckBox _cb; public static CheckBox GetCheckBoxForMenu { get { _cb = new CheckBox(); _cb.Text = "text"; _cb.CheckedChanged += (s,e) => { //handler } return _cb; } } } 

    And add to any menu or somewhere Helper.GetCheckBoxForMenu

    • 2
      @ Max Zhukov: this is somehow too WinForms-like. Moreover, it is not good when getter returns a new object each time. - VladD