fluentribbon / fluent.ribbon Goto Github PK
View Code? Open in Web Editor NEWWPF Ribbon control like in Office
Home Page: http://fluentribbon.github.io
License: MIT License
WPF Ribbon control like in Office
Home Page: http://fluentribbon.github.io
License: MIT License
The following works in v 2.1
Fluent:MetroWindow x:Class="WpfApplication1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Fluent="clr-namespace:Fluent;assembly=Fluent"
Title="Window1" Height="300" Width="300"
Grid
Grid
Fluent:MetroWindow
However, if i run the same code in v 3.0.3.0, i get an error indicating that Fluent:MetroWindow was not found. I have the the correct reference. when i try to build i get the following error.
The name "MetroWindow" does not exist in the namespace "clr-namespace:Fluent;assembly=Fluent".
The tag 'MetroWindow' does not exist in XML namespace 'clr-namespace:Fluent;assembly=Fluent'. Line 1 Position 21
The type 'Fluent:MetroWindow' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built
I've looked all over and tried a couple of suggestion without success. Any help would be appreciated.
Thanks
Look at a screenshot of the Menu of DropdownButton :
https://skydrive.live.com/redir?resid=FF860405C40AB4A9!7492
There are many menuitems in this DropdownMenu, so a button appears on the bottom of the menu.When I put my cursor on it, the menu will scroll down.
But once I resize the menu, this bottom disappears!
It may like this:
https://skydrive.live.com/redir?resid=FF860405C40AB4A9!7493
I cannot find it any longer.
Ribbon does not derive from ItemsControl or Selector. Thus, it is not possible to implement MVVM design directly with binding and template selection.
Itโs possible to change the menu font size in the screen settings in Windows. But this could mess up the Ribbon quite a bit I think. It could look like this:
Personally I think itโs a good idea to respect the Window settings, but maybe not in this case. Interestingly the ribbon in Office 2013 do this, but not the ribbon used in Windows 8 (and also in Windows 10 preview).
I have an application with several ribbon buttons, to which I pass icon files to the properties Icon and LargeIcon.
The thing is that button controls don't seem to take the good icon frame for the property Icon.
For instance, I have an icon file, which have several frames from 16x16 to 64x64. When looking at the resulting ribbon button, it seems to always take the 32x32 frame and then resize this one to fit within the button instead of taking the 32x32 frame for LargeIcon and the 16x16 frame for Icon.
Well, it would be the ideal behaviour at 96dpi. But at higher dpi, buttons should try to grab frames with higher pixel sizes.
It seems that, when WPF is left alone with ClearType activation management, WPF is really too aggressive at disabling ClearType (see http://blogs.msdn.com/b/text/archive/2010/01/15/cleartypehint.aspx).
It's really visible with the Fluent ribbon control as labels and texts are randomly changing from sharp and clear to smudged and clogged. Sometimes, it can happen simply by hovering in and out with the mouse changing the text background.
So it would probably be good to use RenderOptions.ClearTypeHint="Enabled" wherever needed.
Hello
I put the the "Fluent:Ribbon" component in a Page. Everything works fine except the BackButton form the Backstage. The Button is visible but I can't click the button. I don't know if this is a bug or if I just can't place the Ribbon in a Page. Hopefully you guys have a solution for me ...
Copied from CodePlex https://fluent.codeplex.com/workitem/22510 and from https://fluent.codeplex.com/workitem/22496
Before the main window loads, our software may ask the user to supply some additional information so it can start correctly. After we implemented the appropriate dialogs, we noticed that bound quick access items no longer display. We are using the stable version of the Ribbon from Nuget (2.0.2).
To reproduce, I downloaded the current source and tested in the 'Fluent dotNET 4.5' solution. We don't currently use state management in our app, so I changed that setting in TestContent.
<Fluent:Ribbon AutomaticStateManagement="False" x:Name="ribbon">
I then added a MessageBox in the TestWindow constructor. After running and dismissing the message box, the result is as shown in the attached image. Only the non-bound quick access item displays. The drop-down has several empty spots where the bound items would have presented.
Also note that the contextual groups are absent.
Hi, I have created a really simple Ribbon. The following is the Quick Access Toolbar Section of code:
<r:QuickAccessMenuItem IsChecked="True" Visibility="Visible">
<r:Button Header="Tasks" Icon="Images/tasksicon.png" Visibility="Visible"/>
</r:QuickAccessMenuItem>
<r:QuickAccessMenuItem IsChecked="True" Visibility="Visible">
<r:Button Header="Messages" Icon="Images/messagesicon.png" Visibility="Visible"/>
</r:QuickAccessMenuItem>
</r:Ribbon.QuickAccessItems>
With that whenever I load the application the Messages and Tasks Items are both hidden and I have to click to select them for them to appear. And yet if I was to select them and then close the application and re-run it the items appear again. However, If I close Blend down and reopen then the items are again not shown.
Hi,
i think i have found a bug when set a color with SelectedColor to a ColorGallery. The color is after "SelectedColor = Colors.Red", as sample, set in the ColorGallery. But the ListBox in the Gallery don't change the SelectedItem. So the ListBox ignore the new color which i have set.
In the code of the Gallery, i see the isLoaded-Property in "UpdateSelectedColor"-function is always false when color is set manually, because the control is not visible (loaded).
Thx
Copied from CodePlex https://fluent.codeplex.com/workitem/22408
I was wondering is there any chance of implementing a touch screen mode like Office 2013.
I have had some thoughts to create a "Windows 8"-theme to the Fluent Ribbon project. Today I spend some hours and I've now have something that looks like this:
This is just my playing around. Nothing serious, I just took the white Office 2010 theme and tweaked it. There is several things still that needs to be solved. I wanted to see if this is feasible to do and I think it is. But I must say that all these controls in borders in other borders that is in other borders could be confusing :-).
If I decide to do this more serious, is there a chance that this will be merged into the main project? If yes, is there any guide lines I should follow? Should I create a totally new theme or just a new "Color" to the Office 2010 theme? Just changing colors is not enough - Windows 8 theme doesn't have any gradients or rounded corners but if these things also getting theme based it might be possible.
My ambition is to have something that looks like the ribbon bar in Explorer, Wordpad and Paint in Windows 8. I can't promise that I will be able to solve everything but I think it is worth to try :-)
App crashes if to press alt several times.
Application: SIM.Tool.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentNullException
Stack:
at MS.Internal.Media.VisualTreeUtils.AsNonNullVisual(System.Windows.DependencyObject, System.Windows.Media.Visual ByRef, System.Windows.Media.Media3D.Visual3D ByRef)
at System.Windows.Media.VisualTreeHelper.GetChildrenCount(System.Windows.DependencyObject)
at Fluent.Internal.UIHelper.FindImmediateVisualChild[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Windows.DependencyObject, System.Predicate`1<System.__Canon)
at Fluent.KeyTipService.GetBackstage()
at Fluent.KeyTipService.Show()
at Fluent.KeyTipService.ShowImmediatly()
at Fluent.KeyTipService.OnWindowKeyUp(System.Object, System.Windows.Input.KeyEventArgs)
at System.Windows.Input.KeyEventArgs.InvokeEventHandler(System.Delegate, System.Object)
at System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate, System.Object)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)
at System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject, System.Windows.RoutedEventArgs)
at System.Windows.UIElement.RaiseTrustedEvent(System.Windows.RoutedEventArgs)
at System.Windows.UIElement.RaiseEvent(System.Windows.RoutedEventArgs, Boolean)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(System.Windows.Input.InputEventArgs)
at System.Windows.Input.InputProviderSite.ReportInput(System.Windows.Input.InputReport)
at System.Windows.Interop.HwndKeyboardInputProvider.ReportInput(IntPtr, System.Windows.Input.InputMode, Int32, System.Windows.Input.RawKeyboardActions, Int32, Boolean, Boolean, Int32)
at System.Windows.Interop.HwndKeyboardInputProvider.ProcessKeyAction(System.Windows.Interop.MSG ByRef, Boolean ByRef)
at System.Windows.Interop.HwndSource.CriticalTranslateAccelerator(System.Windows.Interop.MSG ByRef, System.Windows.Input.ModifierKeys)
at System.Windows.Interop.HwndSource.OnPreprocessMessage(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
at System.Windows.Threading.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority, System.Delegate, System.Object)
at System.Windows.Interop.HwndSource.OnPreprocessMessageThunk(System.Windows.Interop.MSG ByRef, Boolean ByRef)
at System.Windows.Interop.HwndSource+WeakEventPreprocessMessage.OnPreprocessMessage(System.Windows.Interop.MSG ByRef, Boolean ByRef)
at System.Windows.Interop.ComponentDispatcherThread.RaiseThreadMessage(System.Windows.Interop.MSG ByRef)
at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
at System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame)
at System.Windows.Threading.Dispatcher.Run()
at System.Windows.Application.RunDispatcher(System.Object)
at System.Windows.Application.RunInternal(System.Windows.Window)
at System.Windows.Application.Run(System.Windows.Window)
at SIM.Tool.App.Main()
I'm using Office2013 Fluent theme without Backstage menu.
โ It raises ArgumentNullException when I type Alt key. (Without Backstage menu)
โ It will display popup [F] around Backstage menu, when I type Alt key. (With a dummy Backstage menu)
Hmm.. Is there good workaround?
Modern Fluent theme is very very beautiful. I love it!
Thanks!
kenji uno
I will drop support for .NET 3.5 in version 3.2.
If you got any reasons to keep it, feel free to comment this issue and start a discussion.
Since NuGet 2, you don't need to use the NuGet Restore option. Nuget will automatically restore missing packages on build. Means you can remove the Nuget Folder and the 3 binary files from repository.
I found a way to make the icon shown in the title bar clear, but I don't know how to send a patch.
Just open Themes\Office2013\RibbonWindow.xaml, then find the "PART_Icon" and change its Margin to "8,1,0,0", and the Icon will be clear.
By the way, I find it possible to enable "Touching Mode", changing the margin and size in the xaml of controls, but it seems too hard for me to change many files.
My English isn't very good..
License linked via main page no longer exists.
In the test project you have the code below, but it doesn't deal with Icons, can you please provide an example of the below which deals with large and small icons... along with the test icons as I can't get it to happen
public Button CreateRibbonButton()
{
var button = new Button();
var fooCommand1 = new FooCommand1();
button.Command = fooCommand1.ItemCommand;
button.Header = "Foo";
this.CommandBindings.Add(fooCommand1.ItemCommandBinding);
return button;
}
See https://github.com/particular/gitversion for auto version generation. See https://github.com/Particular/GitVersion/wiki/GitFlow for examples.
When referencing a viewmodel in the view, only the active tab's buttons are enabled. All other functions seem to be disabled: backstage, tabs, collapse, etc.
To duplicate the problem, in the TestWindow.xaml, replace the following code and run the test project:
<FluentTest:TestContent x:Name="TestContent" />
<DataTemplate DataType="{x:Type viewModels:MainViewModel}">
<FluentTest:TestContent />
</DataTemplate>
</Window.Resources>
<viewModels:MainViewModel></viewModels:MainViewModel>
command
Hallo,
I dont know where to place these kind of questions. I updated from version 2.1 to 3.2. Now my Commands are not working everywhere. Have something changed about commands?
Little style bug in Windows 8 theme
Review TODO:s in Windows 8 theme
In the Windows 8 theme I have left 6 TODO:s in the XAML-code for review. I think most of them are for components that are not in use and could be removed. If not I want to know how they are used so I could test them :-).
Line break in _minimizeButtonScreenTipText
In RibbonLocation.cs there is this line:
_minimizeButtonScreenTipText = "Need a bit more space? Collapse the\nribbon so only the tab names show.";
The line break before "ribbon" looks quite funny in the tooltip I think.
Backstage does not open at application start anymore
For some reason it stopped working in my project. I had Backstage opening initially when run and specifically selecting the Recent Files Tab on Backstage. When I Compiled the new 3.0.3 into my project it seems to not be working now. I added a Print Tab to the TabItems around the same time but Removing that tabs contents don't seem to return the Backstage Is Open functionality.
I have a Trigger setup with OnIsOpenChanged and it triggers when the Window is supposed to be opening but now I get an error that Backstage cannot see one of my Tabs.
Could someone please confirm the backstage.IsOpen = true; command still opens the Backstage window? It would at least tell me it's something I've added in my code.
RibbonTitleBar.MeasureOverride should not return the constraint parameter value
Hi,
I am trying to use FluentRibbon in a WPF app which use Caliburn.Micro.
Certainly because of the way caliburn micro (and my code) instanciates my UserControl where my ribbon is defined, the MeasureOverride
for the RibbonTitleBar
control is called with my entire screen width as constraint
.
And because the methods returns the parameter instead of returning the real control dimension, my window's width is set to my entire screen width (instead of just what is needed).
MSDN states that MeasureOverride should return the real minimum size required by the control, and not the constraint size, as it could be interpreted as a required size for the control to be correctly displayed.
I have found a way to get the correct behavior, it requires 2 modifications:
- Update
MeasureOverride
in RibbonTitleBar
to return the real size instead of the constraint:
/// <summary>
/// Called to remeasure a control.
/// </summary>
/// <param name="constraint">The maximum size that the method can return.</param>
/// <returns>The size of the control, up to the maximum specified by constraint.</returns>
protected override Size MeasureOverride(Size constraint)
{
if (this.isAtLeastOneRequiredControlPresent == false)
{
return base.MeasureOverride(constraint);
}
if (this.IsCollapsed)
{
return base.MeasureOverride(constraint);
}
var resultSize = constraint;
if (double.IsPositiveInfinity(resultSize.Width)
|| double.IsPositiveInfinity(resultSize.Height))
{
resultSize = base.MeasureOverride(resultSize);
}
this.Update(resultSize);
this.itemsContainer.Measure(this.itemsRect.Size);
this.headerHolder.Measure(this.headerRect.Size);
this.quickAccessToolbarHolder.Measure(this.quickAccessToolbarRect.Size);
// We do not return resultsize anymore, instead we compute the real size required by the controls
//return resultSize;
var maxHeight = Math.Max(Math.Max(this.itemsRect.Height, this.headerRect.Height), this.quickAccessToolbarRect.Height);
var width = this.itemsRect.Width + this.headerRect.Width + this.quickAccessToolbarRect.Width;
return new Size(width, maxHeight);
}
- Update the theme files. The previous change results in the titlebar being centered on the top of the window instead of using all the available space. The
RibbonControlTemplate
in Ribbon.xaml
must be updated to set the Fluent:RibbonTitleBar
left aligned. For example in Office2013 theme:
<Fluent:RibbonTitleBar x:Name="PART_RibbonTitleBar"
Height="{Binding Path=(Fluent:RibbonProperties.TitleBarHeight), RelativeSource={RelativeSource Self}}"
Style="{DynamicResource RibbonTitleBarStyle}"
Margin="36,0,113,0"
VerticalAlignment="Top"
HorizontalAlignment="Left"
IsCollapsed="{TemplateBinding IsCollapsed}">
I can submit a PR with this bug, or let you fix this issue by yourself, as you prefer.
Thanks !
Blurred Window Icon in Office 2013 Style
Little Bug in Office2010 style
Ribbon app background is black
Simplified Chinese translation may be wrong
https://skydrive.live.com/redir?resid=FF860405C40AB4A9!7499
A file changed:
Fluent\RibbonLocalization.cs
Line No. 1326
and
Line No. 1328
Create single solution with all projects
There are 3 solutions with platform targeted projects. I recommend to create a single solution as well with all the projects in a single sln. Makes things much more manageable.
Update nuspec to new info
I think a few things need to be changed:
- License url
- Project url
- Release notes url
ContextMenu and Popup has 10px space at bottom and right side
On a touch screen, Menu is displayed on the left of focus. Look at the picture below:
It is a dropdownbutton, the right edge of the menu and the right edge of the button are right-aligned. But there is 10px to display the shadow!
The picture below shows a contextmenu:
This may caused by these code(XAML), these code exist in all kind of controls which contains menus.
So, some measures should be taken to deal with it.
the ToolTip of a RibbonTabItem
According to the behavior of Microsoft Office Ribbon, the ToolTip of a RibbonTabItem will not display unless the Header is not long enough, when you put the mouse over the Header of a RibbonTabItem. But this library does not act as this.
hiding keytips
Dear sir,
i am using document editor from codeplex.it has 3 buttons on top,new open and close.all these 3 buttons show 1,2,3 as keytip.when i try to change and remove that keytips nothing happens.i use the code in vb.net.
OpenMenuItem.KeyTip = "aa"
OpenMenuItem.KeyTip = nothing
thanks
A simple code to enable RibbonTabControl react to touch manipulation
When the width of the window is small, but there are many contents in ribbon, some of which will be hidden.
https://skydrive.live.com/redir?resid=FF860405C40AB4A9!7494
If you add such a simple code
<Setter Property="PanningMode" Value="HorizontalOnly"/>
to file:
Fluent\Themes\Office2010\Controls\RibbonTabControl.xaml
Line No. 327
and file:
Fluent\Themes\Office2013\Controls\RibbonTabControl.xaml
Line No. 325
just like this:
https://skydrive.live.com/redir?resid=FF860405C40AB4A9!7495
will enable RibbonTabControl react to touch manipulation.
If you have a touch screen, you may put your finger on the blank of a RibbonTabItem which contains too many contents, and move your finger, the contents will move horizontally.
By the way, some code in xaml files are not well organized, you may format them.
Fluent:RibbonProperties.TitleBarHeight="0" no longer works!
Hi,
Seems like after upgrading to 3.2 i can no longer have a TitleBarHeight = 0 because a MinTitleBarHeight=25 was introduced...
What am i suppose to do if i don't want Fluent to manage my TitleBar? (I'm using MahApps)
Thanks
Problem with Mouse Capture on SplitButton
Hello,
We are using FluentRibbon in a Complex Layout with AvalonDock, and much more...
Since we have upgraded to the last Version we have the Problem, that when we Open a new Tab in Avalondock, via Press on a FluentSplitButton DropDown, the MouseCapture is not Released, and nothing is clickable, till we press the right mouse button. If we use the main Button on the FluentSplitButton, not one from the DropDown, everything works....
RegionAdapter for Prism
Hi List,
i run Prism 5.x together with Fluent.Ribbon 2.x, all work's perfectly. After update to Fluent.Ribbon 3.xx from Nuget the RegionManger is unable to find my Regions.
The code below works with Fluent.Ribbon 2.x
public class RibbonTabRegionAdapter : RegionAdapterBase
{
public RibbonTabRegionAdapter(IRegionBehaviorFactory behaviorFactory)
: base(behaviorFactory)
{
}
protected override void Adapt(IRegion region, Ribbon regionTarget)
{
if (region == null) throw new ArgumentNullException("Region");
if (regionTarget == null) throw new ArgumentNullException("RegionTarget");
region.ActiveViews.CollectionChanged += (s, args) =>
{
switch (args.Action)
{
case NotifyCollectionChangedAction.Add:
{
foreach (Object view in args.NewItems)
{
AddViewToRegion(view, regionTarget);
}
break;
}
case NotifyCollectionChangedAction.Remove:
{
foreach (Object view in args.OldItems)
{
RemoveViewFromRegion(view, regionTarget);
}
break;
}
default:
{
// Do nothing.
break;
}
}
};
}
protected override IRegion CreateRegion()
{
return new AllActiveRegion();
}
static void AddViewToRegion(Object view, Ribbon wpfRibbon)
{
var ribbonTab = view as RibbonTabItem;
if (ribbonTab != null)
wpfRibbon.Tabs.Add(ribbonTab);
}
static void RemoveViewFromRegion(Object view, Ribbon wpfRibbon)
{
var ribbonTab = view as RibbonTabItem;
if (ribbonTab != null)
wpfRibbon.Tabs.Remove(ribbonTab);
}
}
public class TabItemRegionAdapter : RegionAdapterBase
{
public TabItemRegionAdapter(IRegionBehaviorFactory regionBehaviorFactory) : base(regionBehaviorFactory)
{
}
protected override void Adapt(IRegion region, RibbonTabItem regionTarget)
{
region.Views.CollectionChanged += (sender, args) => ViewsOnCollectionChanged(regionTarget, args);
}
private static void ViewsOnCollectionChanged(RibbonTabItem regionTarget, NotifyCollectionChangedEventArgs e)
{
switch (e.Action)
{
case NotifyCollectionChangedAction.Add:
foreach (var newItem in e.NewItems)
{
regionTarget.Groups.Add((RibbonGroupBox) newItem);
}
regionTarget.BringIntoView();
break;
case NotifyCollectionChangedAction.Remove:
foreach (var oldItem in e.OldItems)
{
regionTarget.Groups.Remove((RibbonGroupBox) oldItem);
}
break;
}
}
protected override IRegion CreateRegion()
{
return new AllActiveRegion();
}
}
Any ideas
Thanks in advance
Peter
Organize ribbon xaml file
Our ribbon starts to have many tabs, containing many controls.
As a consequence the ribbon xaml is endless, thwarting easy navigation or search.
It would be ideal if the big xaml could be split into multiple xaml files, but alas...
Or have I missed an efficient way to organize the ribbon xaml ?
Application menu button has wrong height
In the current source the Application menu button seems to have the wrong height. Just switch to application menu in the test application to see the difference. The button should be one pixel higher or so.
Maximising a ribbon window with DWM enabled results in it not maximising properly
Backstage flicker
The top of the backstage menu flickers white when it animates open/closed. I don't think I'm doing anything different than the demo app, which does animate properly.
It seems to just happen where the window's title bar is underneath. Rest of the backstage animates smoothly. I was able to capture it:
Any ideas? Thanks
Recommend Projects
-
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
-
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
-