■ InsertMainMenuIfNotExistAction 엘리먼트를 사용하는 방법을 보여준다.
▶ 예제 코드 (XAML)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
<DataTemplate x:Key="DataTemplateKey1"> <dxb:BarManagerActionContainer> <dxb:CreateStandardLayoutAction /> <dxb:InsertMainMenuIfNotExistAction> <dxb:InsertMainMenuIfNotExistAction.Bar> <dxb:Bar x:Name="mainMenu" UseWholeRow="True" Caption="Main menu"> <dxb:Bar.DockInfo> <dxb:BarDockInfo ContainerType="Top" /> </dxb:Bar.DockInfo> </dxb:Bar> </dxb:InsertMainMenuIfNotExistAction.Bar> </dxb:InsertMainMenuIfNotExistAction> <dxb:BarSubItem x:Name="fileBarSubItem" dxb:BarItemLinkActionBase.TargetType="mainMenu" dxb:BarItemLinkActionBase.ItemLinkIndex="0" Content="File" /> <dxb:BarButtonItem x:Name="newBarButtonItem" dxb:BarItemLinkActionBase.Target="fileBarSubItem" dxb:BarItemLinkActionBase.ItemLinkIndex="0" Content="New" /> <dxb:BarButtonItem x:Name="openBarButtonItem" dxb:BarItemLinkActionBase.Target="fileBarSubItem" dxb:BarItemLinkActionBase.ItemLinkIndex="1" Content="Open" /> <dxb:BarButtonItem x:Name="saveBarButtonItem" dxb:BarItemLinkActionBase.Target="fileBarSubItem" dxb:BarItemLinkActionBase.ItemLinkIndex="2" Content="Save" /> <dxb:BarButtonItem x:Name="exitBarButtonItem" dxb:BarItemLinkActionBase.Target="fileBarSubItem" dxb:BarItemLinkActionBase.ItemLinkIndex="3" Content="Exit" /> <dxb:BarSubItem x:Name="helpBarSubItem" dxb:BarItemLinkActionBase.TargetType="mainMenu" Content="Help" /> <dxb:BarButtonItem x:Name="aboutBarButtonItem" dxb:BarItemLinkActionBase.Target="helpBarSubItem" Content="About" /> </dxb:BarManagerActionContainer> </DataTemplate> |
※ xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"