Tech Off Thread

12 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Decent menu in Avalon

Back to Forum: Tech Off
  • User profile image
    ZippyV

    I'm trying to create a menu in my Avalon application but I don't know how to set the menubar to use the full width of the window. I tried to use the Dockpanel and put dockpanel.dock="top" in the menu tag but that didn't do anything.

    Except for the examples in the SDK are there any websites that provides lots of samples?

  • User profile image
    andokai

     <DockPanel>
      <Menu DockPanel.Dock="Top">
       <MenuItem Header="File">
        <MenuItem Header="New"/>
        <MenuItem Header="Open"/>
       </MenuItem>
      </Menu>
    </DockPanel>

    That should do it for you

  • User profile image
    footballism

    As an extra question, I think the default look and feel of menu in Avalon is quite ugly(some sort of traditional windows look and feel), how to spice it up? for example, if I wanna have the menu in Avalon displaying in Windows XP style, how can I achieve this?

  • User profile image
    andokai

    Check out here it shows you how to define custom styles for most ui elements.

  • User profile image
    footballism

    Thank you Andokai for your great link

  • User profile image
    Nate​Furtwangler

    footballism wrote:
    As an extra question, I think the default look and feel of menu in Avalon is quite ugly(some sort of traditional windows look and feel), how to spice it up? for example, if I wanna have the menu in Avalon displaying in Windows XP style, how can I achieve this?



    I recently made a Radial Menu in Avalon which of course is quite different in both style and function from a regular "traditional" menu, so you might want to check out the code for that too if you plan on getting in much deeper than a simple skin.  It's in the Sandbox here on C9 too.

  • User profile image
    footballism

    NateFurtwangler, I just get a "Net Timeout Error" Message when I try to open the link you provide in Firefox, please fix it.

  • User profile image
    Nate​Furtwangler

    footballism wrote:
    NateFurtwangler, I just get a "Net Timeout Error" Message when I try to open the link you provide in Firefox, please fix it.


    Hmm, just tried it in IE and Firefox, worked fine for me.  If you're still having trouble with the link just go to www.natefurtwangler.com and its the 2nd or 3rd item down.

    Also, it's up in the sandbox here on C9 (probably a page or two back)

  • User profile image
    footballism

    NateFurtwangler wrote:

    Hmm, just tried it in IE and Firefox, worked fine for me.  If you're still having trouble with the link just go to www.natefurtwangler.com and its the 2nd or 3rd item down.
    Also, it's up in the sandbox here on C9 (probably a page or two back)

    Well, probably your site is on my government's black list:p
    I've downloaded the zip file you posted in the sandbox, but it just contains dlls and exes but no source code:(

  • User profile image
    ZippyV

    I solved it. I was using Canvas as the root element which probably caused the problem. Now I have a decent menu.

    Next problem: I tried to call the OpenFileDialog (from system.windows.forms.openfiledialog) from my code but Intellisens doesn't show it (and it doesn't compile either). It only shows 3 web-classes in system.windows.forms. Are the other things not accessible when using Avalon?

  • User profile image
    footballism

    ZippyV wrote:

    Next problem: I tried to call the OpenFileDialog (from system.windows.forms.openfiledialog) from my code but Intellisens doesn't show it (and it doesn't compile either). It only shows 3 web-classes in system.windows.forms. Are the other things not accessible when using Avalon?

    Add reference to System.Windows.Forms.dll assembly.

    Sheva

  • User profile image
    ZippyV

    Tried that, didn't work. Application didn't want to compile.

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.