ItemsButtonsContextMenu

Aug 31, 2011 at 10:10 PM

Is there a way to disable or configure the ItemButtonsContextMenu?  Or at the very least replace/remove the MenuItems (specifically remove Open in new Window). 

Thanks in advance,

Steve

 

Coordinator
Aug 31, 2011 at 11:56 PM
Edited Aug 31, 2011 at 11:57 PM
Yes there is:
To completely remove the menu: 
<s:NavigationPane ItemsButtonsContextMenu="{x:Null}" ... >
...
</s:NavigationPane>

To keep just the options Menu voice:
</s:NavigationPane ..>
  <s:NavigationPane.ItemsButtonsContextMenu>
    <ContextMenu>
      <s:ConfigureMenuItem MenuType="Options" />
    </ContextMenu>
  </s:NavigationPane.ItemsButtonsContextMenu>
  ...
  ...
</s:NavigationPane>
To Add your own voices, simply add menuitems to the context menu as you would with other ContextMenus

ConfigureItem is a specialized MenuItem used to create the NavigationPane MenuItems.
The type of item depends on MenuType property, which can be any of the fallowing values:

FewerButtons
MoreButtons
Options
HiddenItems
AddRemove
NewWindow
MenuItem

Each one of these as its own Command associated which triggers when the menu is selected

0xfefi

Sep 1, 2011 at 7:14 PM

Good deal; I had a feeling configuration would be easy.  Btw  -Great Control!

Best,

Steve

 

Oct 4, 2011 at 10:19 AM
<Window 
    x:Class="STDWindowEV"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:ribbon="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"
	xmlns:s="http://www.stemasoft.com/xaml"
    Title="Window" Height="412" Width="521"
    AllowsTransparency="False"  WindowStyle="ThreeDBorderWindow">
    
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="140.16"/>
            <RowDefinition />
            <RowDefinition Height="26" MinHeight="26"></RowDefinition>
        </Grid.RowDefinitions>
        <ribbon:Ribbon Grid.Row="0" x:Name="Ribbon" >
        </ribbon:Ribbon>
        <DockPanel Grid.Row="1">
            <s:NavigationPane ItemsButtonsContextMenu="{x:Null}" x:Name="navigationPane" SelectedIndex="0" LargeItems="2" Margin="2,0,0,1" IsMinimized="True" Width="160">
                <!-- 
                <s:NavigationPane.ItemsButtonsContextMenu>
                    <ContextMenu>
                        <s:ConfigureMenuItem MenuType="Options" />
                    </ContextMenu>
                </s:NavigationPane.ItemsButtonsContextMenu>
                -->
                <s:NavigationPaneItem Header="Item1" Image="Images\Settings.png" Name="itm1"> 
                    <TextBlock x:Name="TextBlock5" Height="40" Width="200" Text="Hello! This is WPF TextBlock Example." 
                        Foreground="Red" Margin="10,10,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" FontSize="14" FontFamily="Verdana"                    FontWeight="Bold" TextWrapping="Wrap" TextAlignment="Center" Padding="2">
                    </TextBlock>
                </s:NavigationPaneItem>     
            </s:NavigationPane>      
            <Border BorderBrush="{Binding BorderBrush, ElementName=navigationPane}" BorderThickness="1" Background="White" Padding="6" Margin="2,2,4,4">
                <Border.Effect>
                    <DropShadowEffect BlurRadius="4" ShadowDepth="0" Opacity="0.3" Color="#AC000000"/>
                </Border.Effect>
                <Canvas Name="WinCanvas" Margin="0,0,0,0">
                    <Button Canvas.Left="0" Canvas.Top="0" Content="Button" Height="52" Name="Button1" Width="50" />
                </Canvas>
            </Border>
           
         </DockPanel>
        <StatusBar Grid.Row="2" Height="26" Margin="0,0,0,0"  >
        <StatusBar.Background>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#FFD3CCF5" Offset="0" />
                <GradientStop Color="#FF0F3D5C" Offset="1" />
            </LinearGradientBrush>
        </StatusBar.Background>
        <StatusBarItem Name="sbPath" Content="Database" Margin="5,0,0,0" FontSize="11"  Foreground="White"></StatusBarItem>
        <StatusBarItem Name="sbStatus" Content="Stato" Margin="15,0,0,0" FontSize="11" Foreground="White">
            <StatusBarItem.Resources>
                <Storyboard x:Key="statusanimation">
                    <DoubleAnimation BeginTime="00:00:00" Duration="00:00:01" 
                                  Storyboard.TargetName="sbStatus" 
                                  Storyboard.TargetProperty="Opacity" 
                                  From="1" To="0" FillBehavior="Stop" />
                </Storyboard>
            </StatusBarItem.Resources>
        </StatusBarItem>
    </StatusBar>
    </Grid>
</Window>

I'did what you suggest to remove or change the context menu but nothing change, it still appear.

Great control .

 Regards

 

 Andrea

 

Coordinator
Oct 4, 2011 at 12:12 PM
Edited Oct 4, 2011 at 12:13 PM

I've triyed in both framework 4 and 3.5.. it worked

If you are trying to modify the configuration menu ( the one that opens with the bottom arrow )
Then you should use the Property "ConfigureMenu" rather than "ItemButtonsContextMenu"
since the ItemButtonsContextMenu only affects the items buttons context menu
ConfigureMenu works the same as ItemButtonsContextMenu.

To completely remove the configuration menu:
<s:NavigationPane ConfigureMenu="{x:Null}" ... >
...
</s:NavigationPane>

...

Stefano ( 0xfefi ) 

Coordinator
Oct 26, 2011 at 5:43 PM

There is a property IsSmallItemsVisible which hides the bottom small buttons and associated configure button, but due to a bug it wasn't working properly

I fixed the errors and added a new property IsMinimizeButtonVisible in both Navigationpane and NavigationPaneExpander ( since it can be useful ) which allow to hide the button.

You can download the updated version from the dowload section.

0xfefi

Coordinator
Oct 27, 2011 at 11:07 AM

1) added new property HasSplitter to hide the buttons splitter , I was actually thinking to add this too when I added IsSmallItemsVisible... it was not added yet
2) while for controlling the resizing of the control you could use the property named HasResizeThumb, when set to false avoid the control to be resized

0xfefi

Coordinator
Oct 31, 2011 at 1:25 PM

Hi sushilange,

I made some changes: added two new poroperties.. if you download the source and build it you should have all you need.
I haven't uploaded those to the release to avoid change the release too often.

They are:
CanMinimize, you can still resize but MinWidt doesn't trigger Minimizin anymore if set to false
IsSplitterEnabled, if you leave HasSplitter to true ( default value ) and set IsSplitterEnabled to false.. simply disable the splitter

Those changes would be included in the next release... but for now you can download the latest source.

0xfefi