wpf - Open submenu on initialization -
How can I open a menu control submenu on the init of the page?
This is my menu:
& lt; Menu name = "mnuData" isMainMenu = "true" & gt; & Lt; MenuItem Header = "_Customer" & gt; & Lt; MenuItem Header = "Child 1" & gt; & Lt; / MenuItem & gt; & Lt; MenuItem Header = "Child 2" & gt; & Lt; / MenuItem & gt; & Lt; MenuItem Header = "Child 3" & gt; & Lt; / MenuItem & gt; & Lt; / MenuItem & gt; & Lt; MenuItem Header = "_Dr Drivers" & gt; & Lt; MenuItem Header = "Child 4" & gt; & Lt; / MenuItem & gt; & Lt; MenuItem Header = "Child 5" & gt; & Lt; / MenuItem & gt; & Lt; MenuItem Header = "Child 6" & gt; & Lt; / MenuItem & gt; & Lt; / MenuItem & gt; & Lt; MenuItem header = "_track" & gt; & Lt; MenuItem Header = "Child 7" & gt; & Lt; / MenuItem & gt; & Lt; MenuItem Header = "Child 8" & gt; & Lt; / MenuItem & gt; & Lt; / MenuItem & gt; & Lt; MenuItem Header = "T_Ransporters" & gt; & Lt; MenuItem Header = "Child 7" & gt; & Lt; / MenuItem & gt; & Lt; MenuItem Header = "Child 8" & gt; & Lt; / MenuItem & gt; & Lt; / MenuItem & gt; & Lt; / Menu & gt; Here's my code:
Namespace NJPTransport.Pages {/// & lt; Summary & gt; Interaction logic for /// Data.xaml /// & lt; / Summary & gt; Public partial class data: UserControl {public data} (InitializeComponent (); // MNU menu ... open submenu for specific items here}}} When I start the page class , Then I argue to the constructor that this submenu should be open, however, I am struggling to find an asset / event that opens a specific submenu.
UPDATE Please note that the menu is located in the tab control, if I The menu is added to the menu, which is open by default, then IsSubmenuOpen = "True" works fine, but as soon as I add a menu to a tab, which is not open by default It does not work as well. It is also being opened as changing the IsSubmenuOpen = "True" value as a tab, which is what I want to do.I regard it as tab switching I want to be open and open.
Use this ...
Already discussed it
& Lt; TabItem Header = "Tab2" isSelected = "False" & gt; & Lt; Menu name = "mnuData" isMainMenu = "True" & gt; & Lt; MenuItem x: name = "client menu" header = "_client" IsSubmenuOpen = "True" & gt; & Lt; MenuItem Header = "Child 1" /> & Lt; MenuItem Header = "Kid2" /> & Lt; MenuItem Header = "Baby3" /> & Lt; / MenuItem & gt; & Lt; MenuItem Header = "_Dr Drivers" & gt; & Lt; Menu item = "hair 4" /> & Lt; MenuItem Header = "Child 5" /> & Lt; MenuItem Header = "Child 6" /> & Lt; / MenuItem & gt; & Lt; MenuItem header = "_track" & gt; & Lt; MenuItem Header = "Child 7" /> & Lt; MenuItem Header = "Child 8" /> & Lt; / MenuItem & gt; & Lt; MenuItem Header = "T_Ransporters" & gt; & Lt; MenuItem Header = "Child 7" /> & Lt; MenuItem Header = "Child 8" /> & Lt; / MenuItem & gt; & Lt; / Menu & gt; & Lt; / TabItem & gt; & Lt; / TabControl & gt; Press Selection Selection for the first code and IsSubmenuOpen = "true" set item ..
Comments
Post a Comment