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" />
With:
<DataTemplate DataType="{x:Type viewModels:MainViewModel}">
<FluentTest:TestContent />
</DataTemplate>
</Window.Resources>
<viewModels:MainViewModel></viewModels:MainViewModel>
You can see the top window border.
This has been happening since upgrading to 3.0.0, 3.0.3 samples still have the issue
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 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..
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.
Ribbon does not derive from ItemsControl or Selector. Thus, it is not possible to implement MVVM design directly with binding and template selection.
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.
I've tried setting it to hidden, auto, and even disabled and it can still be seen.
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;
}
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.
Hi,
in the new version 3.3.0.0 (SRC ) is available with the Theme Windows 8 in the backstage area again the button style bug.
And the backstage style is from Office 2010 , which is intentional?
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
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.
Hi all,
When I apply Generic.xaml style, the size of MenuItem become incorrect.
Any ideal about this problem?
Thanks.
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 !
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.
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.
Separator line on bottom of Ribbon has to be "#FFD5D5D5"
The row below the selected tabs no longer disappears (v 3.2.0)
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 ...
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.
I think a few things need to be changed:
- License url
- Project url
- Release notes url
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
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
First time to use ribbon, i followed the walkthrough to write my first ribbon app.when i run the app i got nothing but a window with black background. any help will be appreciate! thanks.
When using Theme Office2010 in the Backstage > New, the button and the Combobox is not fully subscribed. The DropDownButton is OK.
Little Bug in Style="{DynamicResource ButtonBackstageStyle}"??
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.
When using the Office 2013 style, the icon of the window gets stretched by 1px (height only), which results in a blurred icon. I was able to reproduce this bug using the FluentTest and my own application.
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.
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?
Different font settings between Fluent:DropDownButton and Fluent:Button.
Different lable position:
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....
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
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
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
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 :-).
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.
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 ?
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()
Recommend Projects
-
-
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
An Open Source Machine Learning Framework for Everyone
-
The Web framework for perfectionists with deadlines.
-
A PHP framework for web artisans
-
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
Some thing interesting about web. New door for the world.
-
A server is a program made to process requests and deliver data to clients.
-
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Some thing interesting about visualization, use data art
-
Some thing interesting about game, make everyone happy.
-
Recommend Org
-
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Open source projects and samples from Microsoft.
-
Google ❤️ Open Source for everyone.
-
Alibaba Open Source for everyone
-
Data-Driven Documents codes.
-
China tencent open source team.
-