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>
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.
Separator line on bottom of Ribbon has to be "#FFD5D5D5"
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
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.
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
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 !
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?
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 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.
Hi all,
When I apply Generic.xaml style, the size of MenuItem become incorrect.
Any ideal about this problem?
Thanks.
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 ?
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 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 :-)
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"
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
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;
}
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....
The row below the selected tabs no longer disappears (v 3.2.0)
I've tried setting it to hidden, auto, and even disabled and it can still be seen.
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 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
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.
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.
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 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.
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.
-