![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | RE: Loading Menu and Toolbar Items From a Resource File(Page?) in WPF<1163454875.783518.140940@m73g2000cwd.googlegroups.com> I had trouble with this as well, but finally figured it out. Here's what I did. 1. Menu defined in resource file <Application.Resources> <!-- Menu and Context menu resources --> <Menu x:Key="Menu.File"> <MenuItem Header="_File" > <MenuItem Header="E_xit" Command="{x:Static pw:ApplicationCommands.Exit}" /> </MenuItem> </Menu> </Application.Resources> 2.Reference the menu resource in a Window <DockPanel x:Name="DockPanel" LastChildFill="False"> <ToolBarTray DockPanel.Dock="Top" MinHeight="24" x:Name="ToolBarTray"> <ToolBar x:Name="Standard"> <StaticResource ResourceKey="Menu.File" /> </ToolBar> </ToolBarTray> </DockPanel> You should be able to reference icons/images, etc in a similar manner. Hope this helps EggHeadCafe.com - .NET Developer Portal of Choice http://www.eggheadcafe.com |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Send To Context Menu - Restore Default Menu Items | Brink | Tutorials | 4 | 1 Week Ago 04:34 PM |
| Missing Start Menu/Toolbar and desktop items! | caraz | Vista General | 1 | 02-16-2008 07:25 AM |
| Toolbar with menu as toolbar item | Yoavo | Avalon | 0 | 10-18-2007 09:12 AM |
| loading Markup::XamlReader::Load from resource file | John Dunn | Avalon | 14 | 12-05-2006 01:04 AM |
| Loading Menu and Toolbar Items From a Resource File (Page?) in WPF | Bree | Avalon | 3 | 11-28-2006 10:25 AM |