Can't find explanation of Members

Jul 7, 2011 at 3:38 PM


This is a wonderful tool, and I look forward to getting it running.

I'm having touble getting it to behave as I thought it might.  In order to tweak the properties, I looked for some explanation of them but can't find any.

Can someone point me in the right direction to find out what each property does?

Thanks so much,


Jul 7, 2011 at 6:25 PM

Hi Jack,

Until I release the documentation help file which will be included in the next release you can access a brief explanation for most properties by hovering them or selecting them right inside your intellisense.

I haven't yet documented all of them however. This is often the case for methods or functions having several overloads in which case only the overload having the most parameters is documented.

I've included quite a few usage examples in the demo but if you're trying to achieve something different you can always ask me.



Jul 7, 2011 at 6:57 PM


You are the best.

I’ve made a tiny bit of progress since I posted my query, but I’m still in a confused state.

I will post what I’m working with, both Xaml and .cs as well as what I want to end up with.

Perhaps you can advise which properties to set to what in order for me to achieve the end goal.

Thanks Again,

Jack Webb

(904) 554-6392

From: ZiadJ [email removed]
Sent: Thursday, July 07, 2011 1:26 PM
Subject: Re: Can't find explanation of Members [SL4PopupMenu:264262]

From: ZiadJ

Hi Jack,

Until I release the documentation help file which will be included in the next release you can access a brief explanation for most properties by hovering them or selecting them right inside your intellisense.

I haven't yet documented all of them however. This is often the case for methods or functions having several overloads in which case only the overload having the most parameters is documented.

I've included quite a few usage examples in the demo but if you're trying to achieve something different you can always ask me.



Jul 7, 2011 at 7:23 PM

Here is what I'm trying to do:

The end objective is to have a plainly visible Menu with three sub menus that look like this:
  Job Report
  Update Hourly Wage Rates
  Edit a Job
  Enter Job PP Usage
  Job Projections
  Manage Users
  User Roles
  New User

To that End Here is my .xaml, follwed by my .xaml.cs:
    Title="Administrator Page"
    d:DesignWidth="1040" d:DesignHeight="480"
    xmlns:toolkit="" xmlns:my3="clr-namespace:SL4PopupMenu;assembly=SL4PopupMenu">
        <web:AgmaContext x:Key="AgmaContext"/>
        <!--<riaControls:DomainDataSource AutoLoad="False" d:DesignData="{d:DesignInstance my:QJob, CreateList=true}"
          Height="0" LoadedData="dds_qJobCurrent_LoadedData" x:Name="dds_qJobCurrent"
          QueryName="GetQJobsByContractorQuery" Width="0" DomainContext="{StaticResource AgmaContext}" DataContext="{Binding}" />-->
        <!--<riaControls:DomainDataSource AutoLoad="False" d:DesignData="{d:DesignInstance my:QJob, CreateList=true}"
          Height="0" LoadedData="dds_qJobNew_LoadedData" x:Name="dds_qJobNew"
          QueryName="GetQJobsByContractorNewQuery" Width="0" DomainContext="{StaticResource AgmaContext}"/>
        <riaControls:DomainDataSource AutoLoad="False" d:DesignData="{d:DesignInstance my:QJob, CreateList=true}"
          Height="0" LoadedData="dds_qJobOther_LoadedData" x:Name="dds_qJobOther"
          QueryName="GetQJobsByContractorOtherQuery" Width="0" DomainContext="{StaticResource AgmaContext}" DataContext="{Binding}"/>-->

    <Grid x:Name="LayoutRoot">
      <RowDefinition Height="0.15*"/>
      <RowDefinition Height="0.85*"/>
      <ColumnDefinition Width="0.25*"/>
      <ColumnDefinition Width="0.75*"/>
      <StackPanel x:Name="ContentStackPanel" Style="{StaticResource ContentStackPanelStyle}">
        <TextBlock Name="HeaderText" Style="{StaticResource HeaderTextStyle}" Text="{Binding Path=Strings.AdministratorPageTitle, Source={StaticResource ApplicationResources}}" />
    <StackPanel Grid.Row="0" Grid.Column="1" Margin="3" Visibility="Visible">
          <ListBox Grid.Row="0" Grid.Column="1" Margin="10" Style="{StaticResource TopMenuStyle1}"
            ItemContainerStyle="{StaticResource TopMenuItemContainerStyle1}"       
            ItemsPanel="{StaticResource TopMenuItemPanelStyle1}" HorizontalAlignment="Left">
          <ListBoxItem x:Name="TopHoverMenu2" Content="Click this to view Administrator's Menu" HorizontalAlignment="Left" />
    <StackPanel Grid.Row="1" Grid.Column="1">
      <Button Name="MenuItem" Click="MenuItem_Click" Content="Selection" HorizontalAlignment="Left" Margin="90,4,0,0" Padding="6" />
      <myMenu:PopupMenu x:Name="PopupMenu" HoverElements="MenuItem" LeftClickElements="MenuItem" Style="{StaticResource PopupMenuWithBorderMaskStyle1}" Margin="4" Height="276" Orientation="Bottom" BorderBrush="RoyalBlue" BorderThickness="8" OpenOnAccessKeyPressed="True" AccessShortcut="Ctrl+Alt+M" RightClickElements="MenuItem">
        <ListBox x:Name="lsToptMenu2" Style="{StaticResource MenuStyle1}" ItemContainerStyle="{StaticResource MenuItemContainerStyle1}" Margin="4" Padding="1">
          <myMenu:PopupMenuItem Header="Data" ImageRightSource="../images/arrow.png">
              <ListBox Style="{StaticResource MenuStyle1}" ItemContainerStyle="{StaticResource MenuItemContainerStyle1}">
                <myMenu:PopupMenuItem x:Name="JobReport" Header="Job Report" Click="MenuItem_Click"/>
                <myMenu:PopupMenuItem x:Name="UpdateHourlyWageRates" Header="Update Hourly Wage Rates" Click="MenuItem_Click"/>
                <myMenu:PopupMenuItem x:Name="EditJob" Header="Edit a Job" Click="MenuItem_Click"/>
            <myMenu:PopupMenuSeparator />
          <myMenu:PopupMenuItem Header="Projection" ImageRightSource="../images/arrow.png">
              <ListBox Style="{StaticResource MenuStyle1}" ItemContainerStyle="{StaticResource MenuItemContainerStyle1}">
                <myMenu:PopupMenuItem x:Name="JobPPUsage" Header="Job PP Usage" Click="MenuItem_Click"/>
                <myMenu:PopupMenuItem x:Name="JobProjection" Header="Job Projection" Click="MenuItem_Click" />
          <myMenu:PopupMenuSeparator />
          <myMenu:PopupMenuItem Header="Users" ImageRightSource="../images/arrow.png">
              <ListBox Style="{StaticResource MenuStyle1}" ItemContainerStyle="{StaticResource MenuItemContainerStyle1}">
                <myMenu:PopupMenuItem x:Name="ManageUsers" Header="Manage Users" Click="MenuItem_Click"/>
                <myMenu:PopupMenuItem x:Name="UserRoles" Header="User Roles" Click="MenuItem_Click"/>
                <myMenu:PopupMenuItem x:Name="NewUser" Header="New User" Click="MenuItem_Click"/>

namespace AgmaSL5
    using System;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Navigation;
    using SL4PopupMenu;

    /// <summary>
    /// Home page for the application.
    /// </summary>
    public partial class Administrator : Page
        string AccessShortcut = "";
        public Administrator()
            this.Title = ApplicationStrings.AdministratorPageTitle;

        /// <summary>
        /// Executes when the user navigates to this page.
        /// </summary>
        protected override void OnNavigatedTo(NavigationEventArgs e)
            PopupMenu.AccessShortcut = "Ctrl+Alt+M";
            PopupMenu.Visibility = System.Windows.Visibility.Visible;

        private void MenuItem_Click(object sender, System.Windows.RoutedEventArgs e)
            var pmiClicked = sender as PopupMenuItem;
            if (pmiClicked != null)
                String nUri = String.Format("/{0}", pmiClicked.Name);
                MessageBox.Show(String.Format("/{0}", pmiClicked.Name), "Going To", MessageBoxButton.OK);
                PopupMenu.Visibility = System.Windows.Visibility.Collapsed;
                NavigationService.Navigate(new Uri(nUri, UriKind.Relative));

Jul 8, 2011 at 4:16 AM
Edited Jul 8, 2011 at 7:02 AM's what I can suggest so far from your XAML:

1. The AccessKeyTargetName property needs to be set for the menu to respond properly(this is no longer required in the latest release though).

2. Consider moving the first PopupMenuSeparator up in the tree.

3. Remove the style for the parent PopupMenu(Style="{StaticResource PopupMenuWithBorderMaskStyle1}") since you most probably won't need a border mask right now.

4. You don't need to set the visibility for the menu in code. The latter handles it automatically.

5. Setting visual properties like BorderBrush="RoyalBlue" and BorderThickness="8" on the PopupMenu have no effect at runtime. You will want to use the ListBox for this.

6. OpenOnAccessKeyPressed="True" and Orientation="Bottom" don't need to be specified since they are both defaults.

By the way v2.6.4 is out already and its got a few bug fixes that might be helpful in your case. So I strongly recommend it!

Hope this helps.


Jul 8, 2011 at 9:23 AM

Again, Ziad, you continue to amaze and please this audience!

Your Points:

1. 'AccessKeyTargetName' is one of those properties that prompted my original query, i.e., what is it, what does it do? etc.  And what should it be set to?  Circuitous!  But in a search for the word I found it in the SL4PopupMenu base with a helpful comment, and set it up accordingly.

2. I moved the separator as recommended.

3. I removed the style as recommended.

4. I removed setting .visibility from .xaml.cs as recommended.

And now the menu works well but is only visible when I click the button (the 'AccessKeyTargetName').  While this is acceptable, I was hoping to have a static menu on the page.


Thank You, Ziad

Jack Webb

Jul 8, 2011 at 3:22 PM
Edited Jul 8, 2011 at 3:24 PM

The IsPinned property prevents the menu from closing. To open the menu however you can make use of the OpenNextTo method from code behind.

I haven't thought of implementing this in XAML even though this shouldn't be too difficult. So if you're badly in need of this feature please let me know and I'll fit it in the next release.



Jul 8, 2011 at 11:50 PM

Ok, you got me.  I found the OpenNextTo method, and in the .xaml.cs OnNavigatedTo handler I had

PopupMenu.OpenNextTo(MenuOrientationTypes.Right, MenuItem, true, true);


PopupMenu.IsPinned = true;

What I got was the menu showing up in the upper left corner of the screen (to the right of the page header), and the menu was not operational.

So I'm Lost.  Yet one more time!

Jul 10, 2011 at 12:53 AM
Edited Jul 14, 2011 at 2:50 PM

This usually happens when the OpenNextTo method is called before the page is loaded or navigated to.

But now that I got your point I realize you don't need to create the Data, Projection and Users menus as PopupMenuItems and there is no need to make them part of yet another PopupMenu. Therefore a plain ListBox for the main menu and plain ListBoxItems for the menu items would do instead.

In brief you will want to wrap a content with a PopupMenu only if is meant to be hidden from the default page layout.