wpf ribboncontrol QAT - wpf

When using Ribboncontrol october 2010 release from Microsoft, even if I don't use QAT I get a right click event "show quick access toolbar" (which doesn't do anything). How can this be disabled ?

Unfortunately the following does not do the task:
<r:Ribbon x:Name="Ribbon"
Title="title" IsMinimized="False">
<r:Ribbon.ApplicationMenu>
<r:RibbonApplicationMenu Visibility="Collapsed"/>
</r:Ribbon.ApplicationMenu>
<r:Ribbon.QuickAccessToolBar>
<r:RibbonQuickAccessToolBar Visibility="Collapsed" />
</r:Ribbon.QuickAccessToolBar>
...
Take care that the context-menu also does not disapear, when you have disabled all other features of the ribbon.
Sorry, I thought I solved the problem some time ago, but actually I didn't.

Related

Avalon Edit Cut\Copy\Paste Commands from MahApps.Metro Button

I'm implementing a custom simplified editor in WPF using AvalonEdit and MahApps.Metro. I am stuck trying to get the cut/copy/paste/undo/redo commands working using MahApps.Metro icon/circle buttons instead of a toolbar.
The AvalonEdit sample uses a toolbar, and if I add a similar toolbar to my current application, it works as expected.
I want to call the Cut/Copy/Paste from a series of icon buttons on my app layout instead of inside a toolbar. My MahApps.Metro buttons are as follows. I've tried it with and without the Command Target set. In both cases nothing happens when I click them.
<Button Width="48"
Height="48"
Margin="24,0,0,0"
Style="{DynamicResource MahApps.Metro.Styles.MetroCircleButtonStyle}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Command="Undo"
CommandTarget="{Binding ElementName=xmlTextEditor.TextArea}">
<iconPacks:PackIconMaterial Kind="UndoVariant" />
</Button>
I'm relatively new to WPF so I might be missing something really basic here. Any help is appreciated.

How to start using Ribbons in WPF

I tried referencing the System.Windows.Controls.Ribbon, the toolbox tab does not show up. If I right-click a tab and click show all, the tab is there, but controls aren't light up. I can add a tab and controls related manually, but after adding the ribbon, things like quickaccesstoolbar and menuitem does not work properly - they are being treated as tabs for some reason. Control groups don't work as well. Simply nothing works as it's supposed to.
I have tried editing XAML directly. It fails in the same manner as using the designer.
The tutorials online are either outdated, for a paid control suite, or simply don't work.
I don't want to use mark-up solutions like http://www.codeproject.com/Articles/364272/Easily-Add-a-Ribbon-into-a-WinForms-Application-Cs , I want something that works in a designer -- Is that too much to ask? If so I'll gladly go back to winforms.
If you work with ribbons, how did you do it? This question seems simple, but after digging for hours I still don't have an answer.
I'm an individual developer, making an open source, free software. As a student I really can't afford 1000$ control suites. I use VS2013 community, I tried using 2015 instead, but all the problems above are the same.
Add this reference:
and this namespace in the XAML file:
and try working with this code example:
<DockPanel>
<Ribbon DockPanel.Dock="Top" Margin="0,-22,0,0">
<Ribbon.ApplicationMenu>
<RibbonApplicationMenu SmallImageSource="Images/list.png">
<RibbonApplicationMenu.AuxiliaryPaneContent>
<RibbonGallery ScrollViewer.VerticalScrollBarVisibility="Auto">
<RibbonGalleryCategory MaxColumnCount="1">
<RibbonGalleryItem
x:Name="GalleryItem1" Content="Application menu content"
MouseOverBackground="Transparent"
MouseOverBorderBrush="Transparent"
CheckedBackground="Transparent"
CheckedBorderBrush="Transparent"
/>
<RibbonGalleryItem>
<Hyperlink x:Name="hl1" Click="hl1_Click">
<Run Text="http://www.bing.com"/>
</Hyperlink>
</RibbonGalleryItem>
</RibbonGalleryCategory>
</RibbonGallery>
</RibbonApplicationMenu.AuxiliaryPaneContent>
<RibbonApplicationMenuItem x:Name="menuItem1" Header="Add"
ImageSource="Images/add.png"/>
<RibbonApplicationMenuItem x:Name="menuItem2" Header="Settings"
ImageSource="Images/system_preferences.png"/>
<RibbonApplicationMenu>
</Ribbon.ApplicationMenu>
<RibbonTab x:Name="rbnTab1" Header="Tab1">
<RibbonGroup x:Name="rbnGr1" Header="General">
<RibbonButton x:Name="btnRibbon1" Label="Save"
LargeImageSource="Images/filesave.png"/>
<RibbonButton x:Name="btnRibbon2" Label="Open"
LargeImageSource="Images/load.png"/>
</RibbonGroup>
<RibbonGroup x:Name="rbnGr2" Header="New group">
<RibbonButton x:Name="btnRibbon3" Label="Font"
LargeImageSource="Images/fonts.png"/>
<RibbonButton x:Name="btnRibbon4" Label="Delete"
LargeImageSource="Images/recycle_bin.png"/>
</RibbonGroup>
</RibbonTab>
<RibbonTab x:Name="rbnTab2" Header="Tab2">
<RibbonGroup x:Name="rbnGr3" Header="Other Group">
<RibbonButton x:Name="btnRibbon5" Label="Play"
LargeImageSource="Images/play.png"/>
<RibbonButton x:Name="btnRibbon6" Label="List"
LargeImageSource="Images/kmenuedit.png"/>
</RibbonGroup>
<RibbonGroup x:Name="rbnGr4" Header="What a group">
<RibbonButton x:Name="btnRibbon7" Label="Sleep"
LargeImageSource="Images/icon_sleep.png"/>
<RibbonButton x:Name="btnRibbon8" Label="Add"
LargeImageSource="Images/add.png"/>
</RibbonGroup>
</RibbonTab>
</Ribbon>
<Grid>
<!-- add your content here-->
</Grid>
</DockPanel>
You can remove the <Ribbon.ApplicationMenu> if you don't like it by addin this property Visibility="Collapsed"
<Ribbon.ApplicationMenu>
<RibbonApplicationMenu Visibility="Collapsed">
</RibbonApplicationMenu>
</Ribbon.ApplicationMenu>
Please take a look at the following. You should be able to have a very basic idea about Ribbon.
http://blogs.msdn.com/b/wpf/archive/2010/08/03/introducing-microsoft-ribbon-for-wpf.aspx
Sample project download
If you want to run the project, you need to change the project's .NET Framework version to 4.0 or above.
Add System.Window.Controls.Ribbon reference to the project
Remove reference like System.Window.Shell and RibbonControlLibrary
The sample should be able to run after you fixed all the namespaces in xmal and the codebehind .cs
http://blogs.msdn.com/b/wpf/archive/2010/08/03/building-a-simple-ribbon-application-in-wpf.aspx
Microsoft Ribbon for WPF (Get the one with Sample for more comprehensive sample)
http://www.microsoft.com/en-us/download/details.aspx?id=11877

MahApps.Metro 0.13.1: Show window commands without display the titlebar

I am developing an application in WPF using MahApps.Metro 0.12.1. In this application I don't show the titlebar, staying visible minimize, maximize and close commands. Below I show the code:
<controls:MetroWindow xmlns:views="clr-namespace:View.Views"
xmlns:titleBar="clr-namespace:View.Views.TitleBar"
x:Class="View.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
GlowBrush="{DynamicResource AccentColorBrush}"
ShowWindowCommandsOnTop="False"
ShowTitleBar="False"
Title="MainWindow" Height="400" Width="600"
AllowsTransparency="False">
<Grid>
...
</Grid>
The problem arises when I upgrade to the version 0.13.1 of MathApps.Metro, where these commands are not displayed, forcing me to re-establish the titlebar to display the commands again ShowTitleBar="True" and this is what I do not want: display the titlebar.
I was looking at the release notes of MathApps.Metro 0.13.1 and reports that changes were made to the section of the titlebar​​, but no further details are given.
My questions are: Is there a simple way to display the minimize, maximize and close commands without showing the title bar? What is the best way to do this?
thanks
you can put the window buttons directly in your main window like this
<Grid>
<!-- the window button commands -->
<Controls:WindowButtonCommands Panel.ZIndex="1"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Height="{Binding TitlebarHeight, Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:MetroWindow}}}" />
...
</Grid>
hope that helps
Is there a simple way to display the minimize, maximize and close commands without showing the title bar? What is the best way to do this?
Actually not very simple, but possible. Basically you need to create your own Style template and override the ContentPresenter for your window to do so.
You may take a look at this question.
Besides that, this post will guide you through the process of designing your own titlebar.

ShowDuration attribute cannot resolve in tooltip at silverlight 4

i want use to ShowDuration attribute in a tooltip at silverlight project. but ShowDuration not exist in ToolTip control
for example:
<Button x:Name="btnAppUserRoleAdd" Style="{StaticResource GlassButton}" Content="button" Width="100" Height="36" Margin="0 0 40 0">
<ToolTipService.ToolTip>
<ToolTip ShowDuration="10000" Template="{StaticResource ToolTipTemplate}" HorizontalOffset="2" VerticalOffset="5">
<ToolTip.Content>
<TextBlock Text="any test"
TextWrapping="Wrap" Style="{StaticResource ButtonTooltipFontStyle}" />
</ToolTip.Content>
</ToolTip>
</ToolTipService.ToolTip>
"ShowDuration="10000" this attribute have not known by intellisence in VS2010 and that say: cannot resolve symbol ShowDuration
my tooltip without ShowDuration working properly and not problem. but i want use this attribute. of course, i use tooltip class in code (c#) but problem not solved.
please help me
i use silverlight4, visual studio 2010.
The Silverlight implementation of a ToolTip does not have a ShowDuration property.
The referenced Tooltip opensource lib has big problem when use with Silverlight DataGrid control, it open many tooltips which are not closed when mouse moved away, it can open many of the same tooltips if you you move mouse arround in a cell. We are forced to take it out from project. We are still looking for a solution just to extend the display duration of tooltips.
Here is a Advanced Silverlight Tooltip Control. This Tooltip has the DisplayTime property. Maybe it is helpful.
You have to download the dll file and reference it.
Silverlight tooltips currently don't have the extended functionality that WPF provide to set delay or duration.
As much as I'd like to see this functionality baked into Silverlight, I've had to build something myself. This also meant I had to create my own ToolTipService as lots of the code I needed to hook into was internal.
Replace your references to ToolTipService and ToolTip to the ones in the library and you'll get more properties to exploit :-)
You can find it on Codeplex as well as on NuGet.
Hope that helps!
Cheers,
Xavier

WPF Ribbon ApplicationMenu Alignment on the Right?

When going through a tutorial, the 'ribbon.ApplicationhMenu' always comes up on the left hand of the screen, rather than the right, as it does in Office 2007, Paint (on Windows 7), and WordPad (on Windows 7).
Is there some way to change this?
Thank you
(Example of the issue is here http://cid-a45fe702de180b23.skydrive.live.com/self.aspx/Public/RibbonAnnoyance.png (as a new user, I can only post 1 hyperlink))
Thank you for your reply. Yes, I am using the Ribbon / FluentUI from the Office Team
Sorry, I was unable to log-on to the 'M.Ahrens' account that I create about 22 hours ago (it wasn't an OpenID one, and I am unsure how to log on without an OpenID, so I am now made my self an OpenID).
I was unable to post the link to the tutorial previously (as a new user can only post 1 hyperlink), but here it is:
http://www.renevo.com/blogs/dotnet/archive/2009/02/10/your-first-wpf-ribbon-application.aspx
It doesn't just happen in this tutorial, it happens in every other ribbon app that I make (including Microsoft samples). I have tried the flowing:
*HorizontalAlignment="Right"
*HorizontalContentAlignment="Right"
*FlowDirection="RightToLeft" (makes the ApplicationMenu go to the right, but switches the columns around)
*Default
But it doesn't seem to make a different, the ApplicationMenu is still on the 'left' hand side (unless I maximize the window).
M.Ahrens
+++++++++++++++++++++++++
Edit (added a code sample):
<r:RibbonWindow
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:r="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"
Height="400" Width="400">
<DockPanel>
<r:Ribbon DockPanel.Dock="Top">
<r:Ribbon.ApplicationMenu>
<r:RibbonApplicationMenu>
</r:RibbonApplicationMenu>
</r:Ribbon.ApplicationMenu>
</r:Ribbon>
</DockPanel>
</r:RibbonWindow>
Are you using the WPF Ribbon from the OfficeUI team?
We are using that one and don't get anything happening like that. Possibly post some of the XAML you are using to create the App Menu.
EDIT: Having a look at your code, i suspect the DockPanel is being a bit silly.
This is how we structure out layout to add the ribbon
<r:RibbonWindow x:Class="MyAssembly.Main"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:r="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"
Title="The Title"
Height="450"
Width="600" >
<Grid x:Name="grdMain">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<r:Ribbon Title="The Title" x:Name="ribbonMain" Grid.Row="0">
<!--Quick Access Toolbar-->
<r:Ribbon.QuickAccessToolBar>
<r:RibbonQuickAccessToolBar>
</r:RibbonQuickAccessToolBar>
</r:Ribbon.QuickAccessToolBar>
<!--Application Menu-->
<r:Ribbon.ApplicationMenu>
<r:RibbonApplicationMenu x:Name="mnuApplication">
<!--App Menu Items-->
<r:RibbonApplicationMenu.Items>
</r:RibbonApplicationMenu.Items>
<!--App Menu Recent Item List-->
<r:RibbonApplicationMenu.RecentItemList>
<StackPanel>
<r:RibbonLabel>Recent Items</r:RibbonLabel>
<r:RibbonSeparator/>
<r:RibbonHighlightingList x:Name="lstRecentItems"/>
</StackPanel>
</r:RibbonApplicationMenu.RecentItemList>
<!--App Menu Footer-->
<r:RibbonApplicationMenu.Footer>
</r:RibbonApplicationMenu.Footer>
</r:RibbonApplicationMenu>
</r:Ribbon.ApplicationMenu>
</r:Ribbon>
<Grid Grid.Row="1">
<!--This is the aread under the ribbon. Place layout things inside of this space-->
</Grid>
</Grid> </r:RibbonWindow> <!--This is closing tag is on this line as SO is being silly-->
As I mentioned, I suspect the DockPanel is being just abit silly, tho it's a bit late (12am) for me to test it right now.
Try copying this code into your XAML and see what happens.
To be frank, I don't trust DockPanels a whole lot, Grids work much better for me :D

Resources