SlideShare a Scribd company logo
1 of 18
Download to read offline
© Degtyarev Daniel, Rikker Serg
2009-2010. All rights reserved
http://fluent.codeplex.com
Overview
Fluent Ribbon Control Suite is a library that implements Microsoft® Office Fluent™ user interface
for the Windows Presentation Foundation (WPF).
This document covers the main features of this framework and highlights how to use it. It is a good
document to make fast inside in ribbon development. To get more practice you can download
samples from http://fluent.codeplex.com
Any portion of this document can be reprinted without restrictions except the reference to original is
required.
Fluent Ribbon Control Suite and this document are distributed under Microsoft Permissive License (Ms-PL).
This license governs use of the accompanying software. If you use the software, you accept this license.
If you do not accept the license, do not use the software.
1. Definitions
The terms “reproduce,” “reproduction,” “derivative works,” and “distribution” have the same meaning here as under U.S. copyright law.
A “contribution” is the original software, or any additions or changes to the software.
A “contributor” is any person that distributes its contribution under this license.
“Licensed patents” are a contributor‟s patent claims that read directly on its contribution.
2. Grant of Rights
(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-
exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its
contribution or any derivative works that you create.
(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-
exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its
contribution in the software or derivative works of the contribution in the software.
3. Conditions and Limitations
(A) No Trademark License- This license does not grant you rights to use any contributors‟ name, logo, or trademarks.
(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor
to the software ends automatically.
(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.
(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license
with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies
with this license.
(E) The software is licensed “as-is.” You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have
additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude
the implied warranties of merchantability, fitness for a particular purpose and non-infringement.
© Degtyarev Daniel, Rikker Serg
2009-2010. All rights reserved
http://fluent.codeplex.com
Foundation
Let‘s learn how to create a simple window with basic elements, such as RibbonTabItem,
RibbonGroupBox, Quick Access Toolbar and so on.
As you can see, the window above is not usual WPF window: it has aero style and some elements
located in the title bar area. To achieve this you need use Fluent.RibbonWindow. RibbonWindow is
designed to provide proper office-like glass style. RibbonWindow automatically will use special non-
DWM style in case of Windows XP or basic Windows 7/Vista theme (see below).
One of the way to create RibbonWindow is to create regular WPF window and change
System.Windows.Window to Fluent.RibbonWindow in code and XAML. You can still use regular
System.Windows.Window as you need. Your code and XAML will something like this:
© Degtyarev Daniel, Rikker Serg
2009-2010. All rights reserved
http://fluent.codeplex.com
/// <summary>
/// Represents the main window of the application
/// </summary>
public partial class Window : RibbonWindow
{
/// <summary>
/// Default constructor
/// </summary>
public Window()
{
InitializeComponent();
}
}
<Fluent:RibbonWindow x:Class="Fluent.Sample.Foundation.Window"
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="Fluent.Sample.Foundation" Width="500" Height="250" >
<Grid>
</Grid>
</Fluent:RibbonWindow>
BEAWARE: You need also add one of themes in App.xaml, for example:
<Application.Resources>
<!--Attach Default Fluent Control's Theme-->
<ResourceDictionary Source="pack://application:,,,/Fluent;
Component/Themes/Office2010/Silver.xaml" />
</Application.Resources>
Let‟s add Ribbon in the Window
<Fluent:Ribbon>
<!--Backstage-->
<Fluent:Ribbon.Menu>
<Fluent:Backstage>
</Fluent:Backstage>
</Fluent:Ribbon.Menu>
<!--Tabs-->
<Fluent:RibbonTabItem Header="Tab">
<Fluent:RibbonGroupBox Header="Group">
<Fluent:Button Name="buttonGreen" Header="Green"
Icon="ImagesGreen.png"
LargeIcon="ImagesGreenLarge.png" />
<Fluent:Button Name="buttonGray" Header="Grey" Icon="ImagesGray.png"
LargeIcon="ImagesGrayLarge.png" />
</Fluent:RibbonGroupBox>
</Fluent:RibbonTabItem>
</Fluent:Ribbon>
The code above produces the ribbon with single tab, group and two buttons. Quick Access Toolbar is a
toolbar with shortcuted controls. You can add any Fluent-based control using context menu (a control
has to implement IQuickAccessToolbarItem interface). You can also pin controls to Quick Access
Toolbar menu.
© Degtyarev Daniel, Rikker Serg
2009-2010. All rights reserved
http://fluent.codeplex.com
You can add pinned Quick Access Items named QuickAccessMenuItem to collection
Ribbon.QuickAccessItems. To associate target element you may bind it to
QuickAccessMenuItem.Target property or just set the content.
<!--Quick Access Toolbar Items-->
<Fluent:Ribbon.QuickAccessItems>
<!--Use Content or Target Property to set QAT item-->
<Fluent:QuickAccessMenuItem IsChecked="true">
<Fluent:Button Header="Pink" Icon="ImagesPink.png" />
</Fluent:QuickAccessMenuItem>
<!--You Can Just Bind with Any Control-->
<Fluent:QuickAccessMenuItem Target="{Binding ElementName=buttonGreen}"/>
</Fluent:Ribbon.QuickAccessItems>
The button “File” in left-top corner opens empty backstage, let‟s fill Backstage with items:
<!--Backstage-->
<Fluent:Ribbon.Menu>
<Fluent:Backstage>
<Fluent:BackstageTabControl>
<Fluent:BackstageTabItem Header="New"/>
<Fluent:BackstageTabItem Header="Print"/>
<Fluent:Button Header="Blue" Icon="ImagesBlue.png"/>
</Fluent:BackstageTabControl>
</Fluent:Backstage>
</Fluent:Ribbon.Menu>
© Degtyarev Daniel, Rikker Serg
2009-2010. All rights reserved
http://fluent.codeplex.com
The last step is to add contextual tab. Contextual tab is visible when a particular object in an app
selected. Contextual tabs cannot exist out of contextual tab group, so we need to create contextual tab
group (RibbonContextualTabGroup) and bind a tab to this group. RibbonContextualTabGroup need to
be added to Ribbon.ContextualGroups collection:
<!--Contextual Tab Groups-->
<Fluent:Ribbon.ContextualGroups>
<Fluent:RibbonContextualTabGroup Header="Tools" Visibility="Visible"
x:Name="toolsGroup" Background="Green" BorderBrush="Green" />
</Fluent:Ribbon.ContextualGroups>
And associate a tab to this group:
<!--Contextual Tabs-->
<Fluent:RibbonTabItem Header="CT" Group="{Binding ElementName=toolsGroup}"/>
RibbonContextualTabGroup is not visible by default. To show or hide contextual tab you must set
RibbonContextualTabGroup.Visibility property to Visible or Collapsed.
© Degtyarev Daniel, Rikker Serg
2009-2010. All rights reserved
http://fluent.codeplex.com
Resizing
All RibbonGroupBox can be in four states: Large->Middle->Small->Collapsed. By default
RibbonGroupBox‟s are in Large state. When a RibbonGroupBox changes its state it changes size of all
its controls.
RibbonTabItem has ReduceOrder property. This property defines order of group to reduce. You can
enumerate group names from the last to first to reduce.
All ribbon contols (Buttons, DropDownButtons, Spinners and so on) have SizeDefinition property.
You can define which size will be used when the group will be in the particular state. For example, if
you set SizeDefinition = "Middle, Middle, Small", that means:
Large State of the group -> Middle size of the control
Middle State of the group -> Middle size of the control
Small State of the group -> Small size of the control
<Fluent:RibbonTabItem ReduceOrder="Default,Default,Default,
Large,Large,Large,
Other,Other,Other" ...>
<!--By default ReduceOrder="Large, Middle, Small"-->
<Fluent:RibbonGroupBox Name="Default" Header="Default Behaviour">
<Fluent:Button ... />
<Fluent:Button ... />
<Fluent:Button ... />
<Fluent:Button ... />
</Fluent:RibbonGroupBox>
<!--You can use short form
(for ex, "Middle" is equal "Middle,Middle,Middle")-->
<Fluent:RibbonGroupBox Name="Large" Header="Large Only">
<Fluent:Button SizeDefinition="Large" .../>
<Fluent:Button SizeDefinition="Large" .../>
<Fluent:Button SizeDefinition="Large" .../>
<Fluent:Button SizeDefinition="Large" .../>
</Fluent:RibbonGroupBox>
<Fluent:RibbonGroupBox Name="Other" Header="Other">
<Fluent:Button SizeDefinition="Large, Large, Large" Icon="ImagesGreen.png" ../>
<Fluent:Button SizeDefinition="Large, Large, Small" Icon="ImagesGray.png" ../>
<Fluent:Button SizeDefinition="Middle, Small, Small" Icon="ImagesYellow.png" ..
<Fluent:Button SizeDefinition="Middle, Small, Small" Icon="ImagesBrown.png" ..
</Fluent:RibbonGroupBox>
</Fluent:RibbonTabItem>
The pseudo code above must produce the following reducing behavior:
© Degtyarev Daniel, Rikker Serg
2009-2010. All rights reserved
http://fluent.codeplex.com
© Degtyarev Daniel, Rikker Serg
2009-2010. All rights reserved
http://fluent.codeplex.com
KeyTips
KeyTips provide for users ability to interact with Ribbon using keyboard. To start process user must
press Alt or F10. KeyTips are shown upon controls.
To make KeyTips work it is enough to set attached property Fluent:KeyTip.Keys to the target control
and the ribbon will arrange and show the keytips automatically. It is possible to set KeyTips to menu
and/or submenu items. Also you need to set KeyTip for groups to open them while they are collapsed.
<Fluent:RibbonGroupBox Fluent:KeyTip.Keys="ZC" ... >
<Fluent:SplitButton Fluent:KeyTip.Keys="R" ... >
<Fluent:MenuItem Fluent:KeyTip.Keys="P" ... />
<Fluent:MenuItem Fluent:KeyTip.Keys="R" ... >
<Fluent:MenuItem Fluent:KeyTip.Keys="O" ... />
</Fluent:MenuItem>
</Fluent:SplitButton>
...
© Degtyarev Daniel, Rikker Serg
2009-2010. All rights reserved
http://fluent.codeplex.com
As you can see items in Quick Access Toolbar are keytipped automatically. Also KeyTips are placed
well automatically. However, there are cases when custom placement is required. In this case you have
to set Fluent:KeyTip.AutoPlacement to false and use additional attached properties:
Property Description
KeyTip.AutoPlacement True by default. You need set false to switch on custom placement
KeyTip.HorizontalAlignment Horizontal alignment relative to keytiped control
KeyTip.VerticalAlignment Vertical alignment relative to keytiped control
KeyTip.Margin Margin to offset KeyTip
<Fluent:RibbonGroupBox Header="Group">
<Fluent:Button Text="Center" LargeIcon="ImagesGreenLarge.png"
Fluent:KeyTip.AutoPlacement="False"
Fluent:KeyTip.HorizontalAlignment="Center"
Fluent:KeyTip.VerticalAlignment="Center"
Fluent:KeyTip.Keys="C" />
<Fluent:Button Text="Left" LargeIcon="ImagesGrayLarge.png"
Fluent:KeyTip.AutoPlacement="False"
Fluent:KeyTip.HorizontalAlignment="Left"
Fluent:KeyTip.VerticalAlignment="Center"
Fluent:KeyTip.Keys="L" />
<Fluent:Button Text="Top" LargeIcon="ImagesYellowLarge.png"
Fluent:KeyTip.AutoPlacement="False"
Fluent:KeyTip.HorizontalAlignment="Center"
Fluent:KeyTip.VerticalAlignment="Top"
Fluent:KeyTip.Keys="T"/>
</Fluent:RibbonGroupBox>
© Degtyarev Daniel, Rikker Serg
2009-2010. All rights reserved
http://fluent.codeplex.com
ScreenTips
To use ScreenTip you have to create Fluent.ScreenTip instance and set to ToolTip property:
<Fluent:Button ... >
<Fluent:Button.ToolTip>
<Fluent:ScreenTip Title="Gray"
HelpTopic="Help for Gray ScreenTip"
Image="ImagesGrayLarge.png"
Text="This ScreenTip is ribbon aligned. &#x0a;
It has the image and handles F1."/>
</Fluent:Button.ToolTip>
</Fluent:Button>
ScreenTip has a unique feature to invoke contextual help when it is in open state. To handle contextual
help you must set ScreenTip.HelpTopic in XAML and subscribe to ScreenTip.HelpPressed event. Be
aware, that the event is static, so you must manually unsubscribe from it when it is appropriate to avoid
memory leaks or subscribe application‟s lifetime object as shown below:
public partial class Application : System.Windows.Application
{
void OnStartup(object sender, StartupEventArgs e)
{
ScreenTip.HelpPressed += OnScreenTipHelpPressed;
}
/// <summary>
/// Handles F1 pressed on ScreenTip with help capability
/// </summary>
/// <param name="sender">Sender</param>
/// <param name="e">Arguments</param>
static void OnScreenTipHelpPressed(object sender, ScreenTipHelpEventArgs e)
{
// Show help according the given help topic
// (here just show help topic as string)
MessageBox.Show(e.HelpTopic.ToString());
}
}
© Degtyarev Daniel, Rikker Serg
2009-2010. All rights reserved
http://fluent.codeplex.com
ScreenTip shows on disabled Fluent-based controls automatically. Moreover you can set text which
should be shown when the target control is disabled.
<Fluent:Button IsEnabled="False" ... >
<Fluent:Button.ToolTip>
<Fluent:ScreenTip Title="Orange" Width ="250"
Image="ImagesOrangeLarge.png"
Text="This control is disabled and has fixed width 250px"
HelpTopic="Help for Orange ScreenTip"
DisableReason="This control is disabled
to show 'disable reason' section"/>
</Fluent:Button.ToolTip>
</Fluent:Button>
You can find main properties of ScreenTip in the table below.
Property Description
ScreenTip.Title The title of the ScreenTip
ScreenTip.Text The text of the ScreenTip
ScreenTip.Image Image
ScreenTip.Width Set this property if you want to make fixed sized ScreenTip
ScreenTip.DisableReason If target control is disabled this text will be shown to user
ScreenTip.HelpTopic Set this property and subscribe to ScreenTip.HelpPressed to execute your
contextual help.
© Degtyarev Daniel, Rikker Serg
2009-2010. All rights reserved
http://fluent.codeplex.com
Galleries
Fluent.Gallery is designed to be in ContextMenu. Actually, Gallery control is similar to ListBox.
Below we insert Gallery in DropDownButton's context menu as well as one MenuItem.
<Fluent:DropDownButton Header="DropDownButton" ... >
<Fluent:Gallery ItemsSource ="{Binding DataItems}"
ItemTemplate="{DynamicResource middleDataItemTemplate}" />
<Fluent:MenuItem Icon="ImagesPink.png" Header="Pink"/>
</Fluent:DropDownButton>
In the last example we have set ItemsSource and ItemTemplate to fill gallery with items. Though, you
may add children of the Gallery explicitly:
<Fluent:DropDownButton Text="Pink" ... >
<Fluent:Gallery>
<Image Source="ImagesRedLarge.png" Stretch="None"/>
<Image Source="ImagesGreenLarge.png" Stretch="None"/>
<Image Source="ImagesBlueLarge.png" Stretch="None"/>
</Fluent:Gallery>
</Fluent:DropDownButton>
© Degtyarev Daniel, Rikker Serg
2009-2010. All rights reserved
http://fluent.codeplex.com
Some of important properties of Gallery (and InRibbonGallery) are listed below:
Property Description
GroupBy Provides simplified way to group items. Read more about grouping feature below
Orientation Defines whether items must be arranged in horizontal or vertical direction
Filters Represents collection of filters. Read more about filtering feature below
SelectedFilter Is the currently selected filter. Read more about filtering feature below
Selectable Determines whether the gallery has ability to select an item
SelectedIndex Is the index of the selected item or -1 in case of no selection presents
SelectedItem Is the selected item or null in case of no selection is presented
ItemWidth Defines the fixed width of GalleryItem in the Gallery (Double.NaN by default)
ItemHeight Defines the fixed height of GalleryItem in the Gallery (Double.NaN by default)
Fluent.InRibbonGallery is similar to use:
<Fluent:InRibbonGallery MinItemsInRow="3" MaxItemsInRow="8"
ItemWidth="40" ItemHeight="56"
ItemsSource ="{Binding DataItems}"
ItemTemplate="{DynamicResource largeDataItemTemplate}"
ResizeMode="Both"/>
Set MinItemsInRow and MaxItemsInRow to define minimal and maximal width of a InRibbonGallery.
By default InRibbonGallery appears in maximal width. Use special syntax in
RibbonTabItem.ReduceOrder to reduce InRibbonGallery. To reduce all InRibbonGalleries in a
particular group you have to write name of this group in brackets:
<Fluent:RibbonTabItem ReduceOrder="(A),(A),(A),(A),(A),(B),(B),(B),(B)" ... >
<Fluent:RibbonGroupBox Header="Without Grouping" Name="A">
...
Gallery items can be grouped. To group items in Gallery (or InRibbonGallery) you may use GroupBy
for simplified grouping method or use GroupByAdvanced to introduce your own method. Note in the
example below each data item has Group property. You can use Tag property if you add controls in
Items.
© Degtyarev Daniel, Rikker Serg
2009-2010. All rights reserved
http://fluent.codeplex.com
<Fluent:InRibbonGallery MinItemsInRow="1" MaxItemsInRow="5"
ItemWidth="50" ItemHeight="18"
ItemsSource ="{Binding DataItems}"
ItemTemplate="{DynamicResource middleDataItemTemplate}"
GroupBy="Group" ResizeMode="Both"/>
Other unique feature of Gallery (and InRibbonGallery) is filtering. You can add filters and user will be
able to filter items using them. Filter is one or more group. To enable grouping just add the following
lines:
<Fluent:InRibbonGallery MinItemsInRow="1" MaxItemsInRow="5"
ItemWidth="50" ItemHeight="18"
ItemsSource ="{Binding DataItems}"
ItemTemplate="{DynamicResource middleDataItemTemplate}"
GroupBy="Group" ResizeMode="Both">
<!--Filters-->
<Fluent:InRibbonGallery.Filters>
<Fluent:GalleryGroupFilter Title="All" Groups="Group A,Group B"/>
<Fluent:GalleryGroupFilter Title="Group A" Groups="Group A"/>
<Fluent:GalleryGroupFilter Title="Group B" Groups="Group B"/>
</Fluent:InRibbonGallery.Filters>
</Fluent:InRibbonGallery>
© Degtyarev Daniel, Rikker Serg
2009-2010. All rights reserved
http://fluent.codeplex.com
Toolbars
Fluent Ribbon Control Suite provides capability to make toolbar-like layout. Usually this is used in
legacy-style controls such as font group in Microsoft Word. This layout is more complex and difficult
to code it. Let‟s try to make something like the following example:
We see here spinner and four buttons. In the large size controls are placed in two rows, brown button is
in middle size. In middle size brown button becomes small and in small size controls are relocated in
three rows.
The main concept of RibbonToolBar control is you add controls and add layout definitions to each size
of the toolbar. Layout definition (RibbonToolBarLayoutDefinition) is definition where controls are
located. Each layout definition has one or more rows (RibbonToolBarRow) with control definitions or
control group definitions (RibbonToolBarControlDefinition, RibbonToolBarControlGroup). Control
group must have one or more control definitions inside, it will be separated with special separator or
have other visual representation which is defined in the particular style. It‟s required to set Target
property of RibbonToolBarControlDefinition to name of one of toolbar controls. Also you can define
Size (Small, Middle or Large) and Width of control. By default size and width is Small and Auto
(Double.NaN).
© Degtyarev Daniel, Rikker Serg
2009-2010. All rights reserved
http://fluent.codeplex.com
<Fluent:RibbonToolBar>
<!--ToolBar Layout Definitions-->
<Fluent:RibbonToolBar.LayoutDefinitions>
<!--Large Size of the RibbonToolBar-->
<Fluent:RibbonToolBarLayoutDefinition Size="Large">
<Fluent:RibbonToolBarRow>
<Fluent:RibbonToolBarControlDefinition Target="spinner" Width="127"/>
</Fluent:RibbonToolBarRow>
<Fluent:RibbonToolBarRow>
<Fluent:RibbonToolBarControlDefinition Target="buttonGreen" />
<Fluent:RibbonToolBarControlDefinition Target="buttonGray" />
<Fluent:RibbonToolBarControlDefinition Target="buttonYellow" />
<Fluent:RibbonToolBarControlDefinition Target="buttonBrown" Size="Middle"/>
</Fluent:RibbonToolBarRow>
</Fluent:RibbonToolBarLayoutDefinition>
<!--Large Size of the RibbonToolBar-->
<Fluent:RibbonToolBarLayoutDefinition Size="Middle">
<Fluent:RibbonToolBarRow>
<Fluent:RibbonToolBarControlDefinition Target="spinner" Width="90"/>
</Fluent:RibbonToolBarRow>
<Fluent:RibbonToolBarRow>
<Fluent:RibbonToolBarControlDefinition Target="buttonGreen" />
<Fluent:RibbonToolBarControlDefinition Target="buttonGray" />
<Fluent:RibbonToolBarControlDefinition Target="buttonYellow" />
<Fluent:RibbonToolBarControlDefinition Target="buttonBrown"/>
</Fluent:RibbonToolBarRow>
</Fluent:RibbonToolBarLayoutDefinition>
<!--Middle Size of the RibbonToolBar-->
<Fluent:RibbonToolBarLayoutDefinition Size="Small">
<Fluent:RibbonToolBarRow>
<Fluent:RibbonToolBarControlDefinition Target="spinner" Width="45"/>
</Fluent:RibbonToolBarRow>
<Fluent:RibbonToolBarRow>
<Fluent:RibbonToolBarControlDefinition Target="buttonGreen" />
<Fluent:RibbonToolBarControlDefinition Target="buttonGray" />
</Fluent:RibbonToolBarRow>
<Fluent:RibbonToolBarRow>
<Fluent:RibbonToolBarControlDefinition Target="buttonYellow" />
<Fluent:RibbonToolBarControlDefinition Target="buttonBrown" />
</Fluent:RibbonToolBarRow>
</Fluent:RibbonToolBarLayoutDefinition>
</Fluent:RibbonToolBar.LayoutDefinitions>
<!--ToolBar Controls-->
<Fluent:Spinner x:Name="spinner" />
<Fluent:Button x:Name="buttonGreen" Header="Green" Icon="ImagesGreen.png” ... />
<Fluent:Button x:Name="buttonGray" Header="Gray" Icon="ImagesGray.png" ... />
<Fluent:Button x:Name="buttonYellow" Header="Yellow" Icon="ImagesYellow.png" ../>
<Fluent:Button x:Name="buttonBrown" Header="Brown" Icon="ImagesBrown.png" ... />
</Fluent:RibbonToolBar>
© Degtyarev Daniel, Rikker Serg
2009-2010. All rights reserved
http://fluent.codeplex.com
ColorGallery
Fluent Ribbon Control Suite provides capability to make color picker controls like color picker buttons
or split buttons or even insert in context menu.
As shown above the ColorGallery control have three modes of appearance (to set mode use
ColorGallery.Mode property):
 ColorGalleryMode.HighlightColors (color gallery displays only fixed highlight colors);
 ColorGalleryMode.StandardColors (color gallery displays only fixed standard colors);
 ColorGalleryMode.ThemeColors (color gallery displays theme colors and fixed standard
colors).
ColorGallery can be placed anywhere in your application. For example, we can place it in
DropDownButton as shown below:
<!-- The following code shows standard mode for color gallery -->
<Fluent:DropDownButton Name="colorPickerStandard"
SizeDefinition="Middle" Header="Standard" >
<!-- It's possible to create custom icon to present selected color -->
<Fluent:DropDownButton.Icon>
<Grid Width="16" Height="16">
<Image Source="ImagesFontColor.png"/>
<Border BorderThickness="0" VerticalAlignment="Bottom" Height="4">
<Border.Background>
<SolidColorBrush Color="{Binding ElementName=colorGalleryStandard,
Path=SelectedColor, FallbackValue=Black}" />
</Border.Background>
</Border>
</Grid>
</Fluent:DropDownButton.Icon>
<Fluent:ColorGallery x:Name="colorGalleryStandard"
SelectedColor="Red" IsNoColorButtonVisible="False" />
<Fluent:MenuItem Icon="ImagesPink.png" Header="A Menu Item"/>
</Fluent:DropDownButton>
© Degtyarev Daniel, Rikker Serg
2009-2010. All rights reserved
http://fluent.codeplex.com
Some of important properties of ColorGallery are listed below:
Property Description
SelectedColor Use this property to set or get currently selected color. Default value
is null
Mode You can set or get one of the three modes of appearance
ChipWidth You can set or get size of chips (boxes where color presented)
ChipHeight You can set or get size of chips (boxes where color presented)
IsAutomaticColorButtonVisible You can hide or show the button (1) (see the picture above)
IsNoColorButtonVisible You can hide or show the button (2) (see the picture above)
IsMoreColorsButtonVisible You can hide or show the button (6) (see the picture above).
Additionally you can subscribe MoreColorsExecuting event to use
you own „color choose‟ dialog (otherwise the default dialog will be
used).
IsRecentColorsVisible You can hide or show the bar where colors picked with MoreColors
appear
Columns You can manage number of color gallery columns. It works only
when Mode is ThemeColors
StandardColorGridRows You can set or get how many rows will be in standard colors area (4)
(see the picture above)
ThemeColorGridRows You can set or get how many rows will be in theme colors area (3)
(see the picture above)
ThemeColors
ThemeColorsSource
Theme colors must be setted to show it in the gallery. Use one of
these properties
IMPORTANT NOTES:
 SelectedColor property is Nullable (Color?).
 No Color value is Colors.Transparent.
 Automatic color value is null.

More Related Content

What's hot

Change, Release, Management In-Depth vTom.pptx
Change, Release, Management In-Depth vTom.pptxChange, Release, Management In-Depth vTom.pptx
Change, Release, Management In-Depth vTom.pptxAdilPatel34
 
Essential Habits for Salesforce Admins: Actionable Analytics
Essential Habits for Salesforce Admins: Actionable AnalyticsEssential Habits for Salesforce Admins: Actionable Analytics
Essential Habits for Salesforce Admins: Actionable AnalyticsSalesforce Admins
 
Architecting an Enterprise API Management Strategy
Architecting an Enterprise API Management StrategyArchitecting an Enterprise API Management Strategy
Architecting an Enterprise API Management StrategyWSO2
 
Salesforce integration best practices columbus meetup
Salesforce integration best practices   columbus meetupSalesforce integration best practices   columbus meetup
Salesforce integration best practices columbus meetupMuleSoft Meetup
 
Taking control of your queries with GraphQL, Alba Rivas
Taking control of your queries with GraphQL, Alba RivasTaking control of your queries with GraphQL, Alba Rivas
Taking control of your queries with GraphQL, Alba RivasCzechDreamin
 
Digital Transformation Solution Powerpoint Presentation Slides
Digital Transformation Solution Powerpoint Presentation SlidesDigital Transformation Solution Powerpoint Presentation Slides
Digital Transformation Solution Powerpoint Presentation SlidesSlideTeam
 
Software Architecture & Design of Modern Large Scale.pptx
Software Architecture & Design of Modern Large Scale.pptxSoftware Architecture & Design of Modern Large Scale.pptx
Software Architecture & Design of Modern Large Scale.pptxDavidVeraOlivera
 
Mastering the Lightning Framework - Part 1
Mastering the Lightning Framework - Part 1Mastering the Lightning Framework - Part 1
Mastering the Lightning Framework - Part 1Salesforce Developers
 
Salesforce Online Training
Salesforce Online TrainingSalesforce Online Training
Salesforce Online TrainingKeylabs
 
LWC Episode 3- Component Communication and Aura Interoperability
LWC Episode 3- Component Communication and Aura InteroperabilityLWC Episode 3- Component Communication and Aura Interoperability
LWC Episode 3- Component Communication and Aura InteroperabilitySalesforce Developers
 
Crafting an API Strategy with an API Marketplace
Crafting an API Strategy with an API MarketplaceCrafting an API Strategy with an API Marketplace
Crafting an API Strategy with an API MarketplaceWSO2
 
Salesforce Winter ’23 Release Highlights
Salesforce Winter ’23 Release HighlightsSalesforce Winter ’23 Release Highlights
Salesforce Winter ’23 Release HighlightsSkyPlanner
 
Lightning web components - Episode 4 : Security and Testing
Lightning web components  - Episode 4 : Security and TestingLightning web components  - Episode 4 : Security and Testing
Lightning web components - Episode 4 : Security and TestingSalesforce Developers
 
Implementation of Amazon Connect, Powered by Accenture (FSV306-S) - AWS re:In...
Implementation of Amazon Connect, Powered by Accenture (FSV306-S) - AWS re:In...Implementation of Amazon Connect, Powered by Accenture (FSV306-S) - AWS re:In...
Implementation of Amazon Connect, Powered by Accenture (FSV306-S) - AWS re:In...Amazon Web Services
 
From Sandbox To Production: An Introduction to Salesforce Release Management
From Sandbox To Production: An Introduction to Salesforce Release ManagementFrom Sandbox To Production: An Introduction to Salesforce Release Management
From Sandbox To Production: An Introduction to Salesforce Release ManagementSalesforce Developers
 
Salesforce Marketing Cloud overview demo
Salesforce Marketing Cloud overview demoSalesforce Marketing Cloud overview demo
Salesforce Marketing Cloud overview demoAdama Sidibé
 
TDX19 - Accelerate DevOps with GitLab and Salesforce
TDX19 - Accelerate DevOps with GitLab and SalesforceTDX19 - Accelerate DevOps with GitLab and Salesforce
TDX19 - Accelerate DevOps with GitLab and SalesforceDoug Ayers
 

What's hot (20)

Change, Release, Management In-Depth vTom.pptx
Change, Release, Management In-Depth vTom.pptxChange, Release, Management In-Depth vTom.pptx
Change, Release, Management In-Depth vTom.pptx
 
Essential Habits for Salesforce Admins: Actionable Analytics
Essential Habits for Salesforce Admins: Actionable AnalyticsEssential Habits for Salesforce Admins: Actionable Analytics
Essential Habits for Salesforce Admins: Actionable Analytics
 
Architecting an Enterprise API Management Strategy
Architecting an Enterprise API Management StrategyArchitecting an Enterprise API Management Strategy
Architecting an Enterprise API Management Strategy
 
Salesforce integration best practices columbus meetup
Salesforce integration best practices   columbus meetupSalesforce integration best practices   columbus meetup
Salesforce integration best practices columbus meetup
 
Api for dummies
Api for dummies  Api for dummies
Api for dummies
 
Taking control of your queries with GraphQL, Alba Rivas
Taking control of your queries with GraphQL, Alba RivasTaking control of your queries with GraphQL, Alba Rivas
Taking control of your queries with GraphQL, Alba Rivas
 
Digital Transformation Solution Powerpoint Presentation Slides
Digital Transformation Solution Powerpoint Presentation SlidesDigital Transformation Solution Powerpoint Presentation Slides
Digital Transformation Solution Powerpoint Presentation Slides
 
Software Architecture & Design of Modern Large Scale.pptx
Software Architecture & Design of Modern Large Scale.pptxSoftware Architecture & Design of Modern Large Scale.pptx
Software Architecture & Design of Modern Large Scale.pptx
 
Commerce Cloud 101
Commerce Cloud 101Commerce Cloud 101
Commerce Cloud 101
 
Mastering the Lightning Framework - Part 1
Mastering the Lightning Framework - Part 1Mastering the Lightning Framework - Part 1
Mastering the Lightning Framework - Part 1
 
Salesforce Online Training
Salesforce Online TrainingSalesforce Online Training
Salesforce Online Training
 
LWC Episode 3- Component Communication and Aura Interoperability
LWC Episode 3- Component Communication and Aura InteroperabilityLWC Episode 3- Component Communication and Aura Interoperability
LWC Episode 3- Component Communication and Aura Interoperability
 
Crafting an API Strategy with an API Marketplace
Crafting an API Strategy with an API MarketplaceCrafting an API Strategy with an API Marketplace
Crafting an API Strategy with an API Marketplace
 
Salesforce Winter ’23 Release Highlights
Salesforce Winter ’23 Release HighlightsSalesforce Winter ’23 Release Highlights
Salesforce Winter ’23 Release Highlights
 
Lightning web components - Episode 4 : Security and Testing
Lightning web components  - Episode 4 : Security and TestingLightning web components  - Episode 4 : Security and Testing
Lightning web components - Episode 4 : Security and Testing
 
Implementation of Amazon Connect, Powered by Accenture (FSV306-S) - AWS re:In...
Implementation of Amazon Connect, Powered by Accenture (FSV306-S) - AWS re:In...Implementation of Amazon Connect, Powered by Accenture (FSV306-S) - AWS re:In...
Implementation of Amazon Connect, Powered by Accenture (FSV306-S) - AWS re:In...
 
From Sandbox To Production: An Introduction to Salesforce Release Management
From Sandbox To Production: An Introduction to Salesforce Release ManagementFrom Sandbox To Production: An Introduction to Salesforce Release Management
From Sandbox To Production: An Introduction to Salesforce Release Management
 
Salesforce Marketing Cloud overview demo
Salesforce Marketing Cloud overview demoSalesforce Marketing Cloud overview demo
Salesforce Marketing Cloud overview demo
 
CPQ Solution Study
CPQ Solution StudyCPQ Solution Study
CPQ Solution Study
 
TDX19 - Accelerate DevOps with GitLab and Salesforce
TDX19 - Accelerate DevOps with GitLab and SalesforceTDX19 - Accelerate DevOps with GitLab and Salesforce
TDX19 - Accelerate DevOps with GitLab and Salesforce
 

Viewers also liked

Cortesgeolgicos 140528111340-phpapp02
Cortesgeolgicos 140528111340-phpapp02Cortesgeolgicos 140528111340-phpapp02
Cortesgeolgicos 140528111340-phpapp02biologiaricel
 
Volcanes: los latidos de la Tierra
Volcanes: los latidos de la TierraVolcanes: los latidos de la Tierra
Volcanes: los latidos de la Tierrabiologiaricel
 
El paso del Tiempo Geológico
El paso del Tiempo GeológicoEl paso del Tiempo Geológico
El paso del Tiempo Geológicobiologiaricel
 
Elementosdelmapageolgico 130306070408-phpapp01
Elementosdelmapageolgico 130306070408-phpapp01Elementosdelmapageolgico 130306070408-phpapp01
Elementosdelmapageolgico 130306070408-phpapp01biologiaricel
 

Viewers also liked (9)

Evolución humana
Evolución humanaEvolución humana
Evolución humana
 
Proyecto de ctma
Proyecto de ctmaProyecto de ctma
Proyecto de ctma
 
Cortesgeolgicos 140528111340-phpapp02
Cortesgeolgicos 140528111340-phpapp02Cortesgeolgicos 140528111340-phpapp02
Cortesgeolgicos 140528111340-phpapp02
 
Dinámica Litoral
Dinámica LitoralDinámica Litoral
Dinámica Litoral
 
Volcanes: los latidos de la Tierra
Volcanes: los latidos de la TierraVolcanes: los latidos de la Tierra
Volcanes: los latidos de la Tierra
 
El paso del Tiempo Geológico
El paso del Tiempo GeológicoEl paso del Tiempo Geológico
El paso del Tiempo Geológico
 
Puntos calientes
Puntos calientesPuntos calientes
Puntos calientes
 
Elementosdelmapageolgico 130306070408-phpapp01
Elementosdelmapageolgico 130306070408-phpapp01Elementosdelmapageolgico 130306070408-phpapp01
Elementosdelmapageolgico 130306070408-phpapp01
 
AHINGOE CV1 -Final
AHINGOE CV1 -FinalAHINGOE CV1 -Final
AHINGOE CV1 -Final
 

Similar to Fluent Ribbon Control Suite Walkthrough

Db designer4 manual_1.0.42
Db designer4 manual_1.0.42Db designer4 manual_1.0.42
Db designer4 manual_1.0.42Francisco Carlos
 
Successfully Implement Responsive Design Behavior with Adobe Experience Manager
Successfully Implement Responsive Design Behavior with Adobe Experience ManagerSuccessfully Implement Responsive Design Behavior with Adobe Experience Manager
Successfully Implement Responsive Design Behavior with Adobe Experience ManagerPerficient, Inc.
 
Day 2-presentation
Day 2-presentationDay 2-presentation
Day 2-presentationDeb Forsten
 
Dnn developer slider module user manual
Dnn developer slider module user manualDnn developer slider module user manual
Dnn developer slider module user manualDnn Developer
 
Streamlining React Component Development and Sharing with bit.pptx
Streamlining React Component Development and Sharing with bit.pptxStreamlining React Component Development and Sharing with bit.pptx
Streamlining React Component Development and Sharing with bit.pptxShubhamJayswal6
 
Integration of-click-install-apps
Integration of-click-install-appsIntegration of-click-install-apps
Integration of-click-install-appsSwarup Hait
 
Jbossworld Presentation
Jbossworld PresentationJbossworld Presentation
Jbossworld PresentationDan Hinojosa
 
Ascential DataStage Director Guide
Ascential DataStage Director GuideAscential DataStage Director Guide
Ascential DataStage Director GuideEmily Smith
 
Programming Without Coding Technology (PWCT) Environment
Programming Without Coding Technology (PWCT) EnvironmentProgramming Without Coding Technology (PWCT) Environment
Programming Without Coding Technology (PWCT) EnvironmentMahmoud Samir Fayed
 
WPF 4 Series: Getting Started
WPF 4 Series: Getting StartedWPF 4 Series: Getting Started
WPF 4 Series: Getting StartedGhasem Karimi
 
Wpf4 july2010
 Wpf4 july2010 Wpf4 july2010
Wpf4 july2010tedhu
 
Introduction to Aspect Oriented Software Development
Introduction to Aspect Oriented Software DevelopmentIntroduction to Aspect Oriented Software Development
Introduction to Aspect Oriented Software Developmentmukhtarhudaya
 
Ray flow release notes webconsole_ 1.9.0_0
Ray flow release notes webconsole_ 1.9.0_0Ray flow release notes webconsole_ 1.9.0_0
Ray flow release notes webconsole_ 1.9.0_0i4box Anon
 
NHibernate Explained By Example
NHibernate Explained By ExampleNHibernate Explained By Example
NHibernate Explained By ExampleFabricio Rojas
 
Control panel by
Control panel byControl panel by
Control panel byNoor Fatima
 

Similar to Fluent Ribbon Control Suite Walkthrough (20)

Db designer4 manual_1.0.42
Db designer4 manual_1.0.42Db designer4 manual_1.0.42
Db designer4 manual_1.0.42
 
Successfully Implement Responsive Design Behavior with Adobe Experience Manager
Successfully Implement Responsive Design Behavior with Adobe Experience ManagerSuccessfully Implement Responsive Design Behavior with Adobe Experience Manager
Successfully Implement Responsive Design Behavior with Adobe Experience Manager
 
Day 2-presentation
Day 2-presentationDay 2-presentation
Day 2-presentation
 
Dnn developer slider module user manual
Dnn developer slider module user manualDnn developer slider module user manual
Dnn developer slider module user manual
 
Streamlining React Component Development and Sharing with bit.pptx
Streamlining React Component Development and Sharing with bit.pptxStreamlining React Component Development and Sharing with bit.pptx
Streamlining React Component Development and Sharing with bit.pptx
 
Integration of-click-install-apps
Integration of-click-install-appsIntegration of-click-install-apps
Integration of-click-install-apps
 
Jbossworld Presentation
Jbossworld PresentationJbossworld Presentation
Jbossworld Presentation
 
Ascential DataStage Director Guide
Ascential DataStage Director GuideAscential DataStage Director Guide
Ascential DataStage Director Guide
 
Programming Without Coding Technology (PWCT) Environment
Programming Without Coding Technology (PWCT) EnvironmentProgramming Without Coding Technology (PWCT) Environment
Programming Without Coding Technology (PWCT) Environment
 
Introduction to FOSS world
Introduction to FOSS worldIntroduction to FOSS world
Introduction to FOSS world
 
WPF 4 Series: Getting Started
WPF 4 Series: Getting StartedWPF 4 Series: Getting Started
WPF 4 Series: Getting Started
 
Wpf4 july2010
 Wpf4 july2010 Wpf4 july2010
Wpf4 july2010
 
Introduction to Aspect Oriented Software Development
Introduction to Aspect Oriented Software DevelopmentIntroduction to Aspect Oriented Software Development
Introduction to Aspect Oriented Software Development
 
Ray flow release notes webconsole_ 1.9.0_0
Ray flow release notes webconsole_ 1.9.0_0Ray flow release notes webconsole_ 1.9.0_0
Ray flow release notes webconsole_ 1.9.0_0
 
NHibernate Explained By Example
NHibernate Explained By ExampleNHibernate Explained By Example
NHibernate Explained By Example
 
Dot Net Nuke
Dot Net NukeDot Net Nuke
Dot Net Nuke
 
License
LicenseLicense
License
 
Visual basic
Visual basicVisual basic
Visual basic
 
FreeBSD is not a Linux distribution
FreeBSD is not a Linux distribution FreeBSD is not a Linux distribution
FreeBSD is not a Linux distribution
 
Control panel by
Control panel byControl panel by
Control panel by
 

Fluent Ribbon Control Suite Walkthrough

  • 1. © Degtyarev Daniel, Rikker Serg 2009-2010. All rights reserved http://fluent.codeplex.com Overview Fluent Ribbon Control Suite is a library that implements Microsoft® Office Fluent™ user interface for the Windows Presentation Foundation (WPF). This document covers the main features of this framework and highlights how to use it. It is a good document to make fast inside in ribbon development. To get more practice you can download samples from http://fluent.codeplex.com Any portion of this document can be reprinted without restrictions except the reference to original is required. Fluent Ribbon Control Suite and this document are distributed under Microsoft Permissive License (Ms-PL). This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software. 1. Definitions The terms “reproduce,” “reproduction,” “derivative works,” and “distribution” have the same meaning here as under U.S. copyright law. A “contribution” is the original software, or any additions or changes to the software. A “contributor” is any person that distributes its contribution under this license. “Licensed patents” are a contributor‟s patent claims that read directly on its contribution. 2. Grant of Rights (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non- exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create. (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non- exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software. 3. Conditions and Limitations (A) No Trademark License- This license does not grant you rights to use any contributors‟ name, logo, or trademarks. (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically. (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software. (D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license. (E) The software is licensed “as-is.” You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.
  • 2. © Degtyarev Daniel, Rikker Serg 2009-2010. All rights reserved http://fluent.codeplex.com Foundation Let‘s learn how to create a simple window with basic elements, such as RibbonTabItem, RibbonGroupBox, Quick Access Toolbar and so on. As you can see, the window above is not usual WPF window: it has aero style and some elements located in the title bar area. To achieve this you need use Fluent.RibbonWindow. RibbonWindow is designed to provide proper office-like glass style. RibbonWindow automatically will use special non- DWM style in case of Windows XP or basic Windows 7/Vista theme (see below). One of the way to create RibbonWindow is to create regular WPF window and change System.Windows.Window to Fluent.RibbonWindow in code and XAML. You can still use regular System.Windows.Window as you need. Your code and XAML will something like this:
  • 3. © Degtyarev Daniel, Rikker Serg 2009-2010. All rights reserved http://fluent.codeplex.com /// <summary> /// Represents the main window of the application /// </summary> public partial class Window : RibbonWindow { /// <summary> /// Default constructor /// </summary> public Window() { InitializeComponent(); } } <Fluent:RibbonWindow x:Class="Fluent.Sample.Foundation.Window" 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="Fluent.Sample.Foundation" Width="500" Height="250" > <Grid> </Grid> </Fluent:RibbonWindow> BEAWARE: You need also add one of themes in App.xaml, for example: <Application.Resources> <!--Attach Default Fluent Control's Theme--> <ResourceDictionary Source="pack://application:,,,/Fluent; Component/Themes/Office2010/Silver.xaml" /> </Application.Resources> Let‟s add Ribbon in the Window <Fluent:Ribbon> <!--Backstage--> <Fluent:Ribbon.Menu> <Fluent:Backstage> </Fluent:Backstage> </Fluent:Ribbon.Menu> <!--Tabs--> <Fluent:RibbonTabItem Header="Tab"> <Fluent:RibbonGroupBox Header="Group"> <Fluent:Button Name="buttonGreen" Header="Green" Icon="ImagesGreen.png" LargeIcon="ImagesGreenLarge.png" /> <Fluent:Button Name="buttonGray" Header="Grey" Icon="ImagesGray.png" LargeIcon="ImagesGrayLarge.png" /> </Fluent:RibbonGroupBox> </Fluent:RibbonTabItem> </Fluent:Ribbon> The code above produces the ribbon with single tab, group and two buttons. Quick Access Toolbar is a toolbar with shortcuted controls. You can add any Fluent-based control using context menu (a control has to implement IQuickAccessToolbarItem interface). You can also pin controls to Quick Access Toolbar menu.
  • 4. © Degtyarev Daniel, Rikker Serg 2009-2010. All rights reserved http://fluent.codeplex.com You can add pinned Quick Access Items named QuickAccessMenuItem to collection Ribbon.QuickAccessItems. To associate target element you may bind it to QuickAccessMenuItem.Target property or just set the content. <!--Quick Access Toolbar Items--> <Fluent:Ribbon.QuickAccessItems> <!--Use Content or Target Property to set QAT item--> <Fluent:QuickAccessMenuItem IsChecked="true"> <Fluent:Button Header="Pink" Icon="ImagesPink.png" /> </Fluent:QuickAccessMenuItem> <!--You Can Just Bind with Any Control--> <Fluent:QuickAccessMenuItem Target="{Binding ElementName=buttonGreen}"/> </Fluent:Ribbon.QuickAccessItems> The button “File” in left-top corner opens empty backstage, let‟s fill Backstage with items: <!--Backstage--> <Fluent:Ribbon.Menu> <Fluent:Backstage> <Fluent:BackstageTabControl> <Fluent:BackstageTabItem Header="New"/> <Fluent:BackstageTabItem Header="Print"/> <Fluent:Button Header="Blue" Icon="ImagesBlue.png"/> </Fluent:BackstageTabControl> </Fluent:Backstage> </Fluent:Ribbon.Menu>
  • 5. © Degtyarev Daniel, Rikker Serg 2009-2010. All rights reserved http://fluent.codeplex.com The last step is to add contextual tab. Contextual tab is visible when a particular object in an app selected. Contextual tabs cannot exist out of contextual tab group, so we need to create contextual tab group (RibbonContextualTabGroup) and bind a tab to this group. RibbonContextualTabGroup need to be added to Ribbon.ContextualGroups collection: <!--Contextual Tab Groups--> <Fluent:Ribbon.ContextualGroups> <Fluent:RibbonContextualTabGroup Header="Tools" Visibility="Visible" x:Name="toolsGroup" Background="Green" BorderBrush="Green" /> </Fluent:Ribbon.ContextualGroups> And associate a tab to this group: <!--Contextual Tabs--> <Fluent:RibbonTabItem Header="CT" Group="{Binding ElementName=toolsGroup}"/> RibbonContextualTabGroup is not visible by default. To show or hide contextual tab you must set RibbonContextualTabGroup.Visibility property to Visible or Collapsed.
  • 6. © Degtyarev Daniel, Rikker Serg 2009-2010. All rights reserved http://fluent.codeplex.com Resizing All RibbonGroupBox can be in four states: Large->Middle->Small->Collapsed. By default RibbonGroupBox‟s are in Large state. When a RibbonGroupBox changes its state it changes size of all its controls. RibbonTabItem has ReduceOrder property. This property defines order of group to reduce. You can enumerate group names from the last to first to reduce. All ribbon contols (Buttons, DropDownButtons, Spinners and so on) have SizeDefinition property. You can define which size will be used when the group will be in the particular state. For example, if you set SizeDefinition = "Middle, Middle, Small", that means: Large State of the group -> Middle size of the control Middle State of the group -> Middle size of the control Small State of the group -> Small size of the control <Fluent:RibbonTabItem ReduceOrder="Default,Default,Default, Large,Large,Large, Other,Other,Other" ...> <!--By default ReduceOrder="Large, Middle, Small"--> <Fluent:RibbonGroupBox Name="Default" Header="Default Behaviour"> <Fluent:Button ... /> <Fluent:Button ... /> <Fluent:Button ... /> <Fluent:Button ... /> </Fluent:RibbonGroupBox> <!--You can use short form (for ex, "Middle" is equal "Middle,Middle,Middle")--> <Fluent:RibbonGroupBox Name="Large" Header="Large Only"> <Fluent:Button SizeDefinition="Large" .../> <Fluent:Button SizeDefinition="Large" .../> <Fluent:Button SizeDefinition="Large" .../> <Fluent:Button SizeDefinition="Large" .../> </Fluent:RibbonGroupBox> <Fluent:RibbonGroupBox Name="Other" Header="Other"> <Fluent:Button SizeDefinition="Large, Large, Large" Icon="ImagesGreen.png" ../> <Fluent:Button SizeDefinition="Large, Large, Small" Icon="ImagesGray.png" ../> <Fluent:Button SizeDefinition="Middle, Small, Small" Icon="ImagesYellow.png" .. <Fluent:Button SizeDefinition="Middle, Small, Small" Icon="ImagesBrown.png" .. </Fluent:RibbonGroupBox> </Fluent:RibbonTabItem> The pseudo code above must produce the following reducing behavior:
  • 7. © Degtyarev Daniel, Rikker Serg 2009-2010. All rights reserved http://fluent.codeplex.com
  • 8. © Degtyarev Daniel, Rikker Serg 2009-2010. All rights reserved http://fluent.codeplex.com KeyTips KeyTips provide for users ability to interact with Ribbon using keyboard. To start process user must press Alt or F10. KeyTips are shown upon controls. To make KeyTips work it is enough to set attached property Fluent:KeyTip.Keys to the target control and the ribbon will arrange and show the keytips automatically. It is possible to set KeyTips to menu and/or submenu items. Also you need to set KeyTip for groups to open them while they are collapsed. <Fluent:RibbonGroupBox Fluent:KeyTip.Keys="ZC" ... > <Fluent:SplitButton Fluent:KeyTip.Keys="R" ... > <Fluent:MenuItem Fluent:KeyTip.Keys="P" ... /> <Fluent:MenuItem Fluent:KeyTip.Keys="R" ... > <Fluent:MenuItem Fluent:KeyTip.Keys="O" ... /> </Fluent:MenuItem> </Fluent:SplitButton> ...
  • 9. © Degtyarev Daniel, Rikker Serg 2009-2010. All rights reserved http://fluent.codeplex.com As you can see items in Quick Access Toolbar are keytipped automatically. Also KeyTips are placed well automatically. However, there are cases when custom placement is required. In this case you have to set Fluent:KeyTip.AutoPlacement to false and use additional attached properties: Property Description KeyTip.AutoPlacement True by default. You need set false to switch on custom placement KeyTip.HorizontalAlignment Horizontal alignment relative to keytiped control KeyTip.VerticalAlignment Vertical alignment relative to keytiped control KeyTip.Margin Margin to offset KeyTip <Fluent:RibbonGroupBox Header="Group"> <Fluent:Button Text="Center" LargeIcon="ImagesGreenLarge.png" Fluent:KeyTip.AutoPlacement="False" Fluent:KeyTip.HorizontalAlignment="Center" Fluent:KeyTip.VerticalAlignment="Center" Fluent:KeyTip.Keys="C" /> <Fluent:Button Text="Left" LargeIcon="ImagesGrayLarge.png" Fluent:KeyTip.AutoPlacement="False" Fluent:KeyTip.HorizontalAlignment="Left" Fluent:KeyTip.VerticalAlignment="Center" Fluent:KeyTip.Keys="L" /> <Fluent:Button Text="Top" LargeIcon="ImagesYellowLarge.png" Fluent:KeyTip.AutoPlacement="False" Fluent:KeyTip.HorizontalAlignment="Center" Fluent:KeyTip.VerticalAlignment="Top" Fluent:KeyTip.Keys="T"/> </Fluent:RibbonGroupBox>
  • 10. © Degtyarev Daniel, Rikker Serg 2009-2010. All rights reserved http://fluent.codeplex.com ScreenTips To use ScreenTip you have to create Fluent.ScreenTip instance and set to ToolTip property: <Fluent:Button ... > <Fluent:Button.ToolTip> <Fluent:ScreenTip Title="Gray" HelpTopic="Help for Gray ScreenTip" Image="ImagesGrayLarge.png" Text="This ScreenTip is ribbon aligned. &#x0a; It has the image and handles F1."/> </Fluent:Button.ToolTip> </Fluent:Button> ScreenTip has a unique feature to invoke contextual help when it is in open state. To handle contextual help you must set ScreenTip.HelpTopic in XAML and subscribe to ScreenTip.HelpPressed event. Be aware, that the event is static, so you must manually unsubscribe from it when it is appropriate to avoid memory leaks or subscribe application‟s lifetime object as shown below: public partial class Application : System.Windows.Application { void OnStartup(object sender, StartupEventArgs e) { ScreenTip.HelpPressed += OnScreenTipHelpPressed; } /// <summary> /// Handles F1 pressed on ScreenTip with help capability /// </summary> /// <param name="sender">Sender</param> /// <param name="e">Arguments</param> static void OnScreenTipHelpPressed(object sender, ScreenTipHelpEventArgs e) { // Show help according the given help topic // (here just show help topic as string) MessageBox.Show(e.HelpTopic.ToString()); } }
  • 11. © Degtyarev Daniel, Rikker Serg 2009-2010. All rights reserved http://fluent.codeplex.com ScreenTip shows on disabled Fluent-based controls automatically. Moreover you can set text which should be shown when the target control is disabled. <Fluent:Button IsEnabled="False" ... > <Fluent:Button.ToolTip> <Fluent:ScreenTip Title="Orange" Width ="250" Image="ImagesOrangeLarge.png" Text="This control is disabled and has fixed width 250px" HelpTopic="Help for Orange ScreenTip" DisableReason="This control is disabled to show 'disable reason' section"/> </Fluent:Button.ToolTip> </Fluent:Button> You can find main properties of ScreenTip in the table below. Property Description ScreenTip.Title The title of the ScreenTip ScreenTip.Text The text of the ScreenTip ScreenTip.Image Image ScreenTip.Width Set this property if you want to make fixed sized ScreenTip ScreenTip.DisableReason If target control is disabled this text will be shown to user ScreenTip.HelpTopic Set this property and subscribe to ScreenTip.HelpPressed to execute your contextual help.
  • 12. © Degtyarev Daniel, Rikker Serg 2009-2010. All rights reserved http://fluent.codeplex.com Galleries Fluent.Gallery is designed to be in ContextMenu. Actually, Gallery control is similar to ListBox. Below we insert Gallery in DropDownButton's context menu as well as one MenuItem. <Fluent:DropDownButton Header="DropDownButton" ... > <Fluent:Gallery ItemsSource ="{Binding DataItems}" ItemTemplate="{DynamicResource middleDataItemTemplate}" /> <Fluent:MenuItem Icon="ImagesPink.png" Header="Pink"/> </Fluent:DropDownButton> In the last example we have set ItemsSource and ItemTemplate to fill gallery with items. Though, you may add children of the Gallery explicitly: <Fluent:DropDownButton Text="Pink" ... > <Fluent:Gallery> <Image Source="ImagesRedLarge.png" Stretch="None"/> <Image Source="ImagesGreenLarge.png" Stretch="None"/> <Image Source="ImagesBlueLarge.png" Stretch="None"/> </Fluent:Gallery> </Fluent:DropDownButton>
  • 13. © Degtyarev Daniel, Rikker Serg 2009-2010. All rights reserved http://fluent.codeplex.com Some of important properties of Gallery (and InRibbonGallery) are listed below: Property Description GroupBy Provides simplified way to group items. Read more about grouping feature below Orientation Defines whether items must be arranged in horizontal or vertical direction Filters Represents collection of filters. Read more about filtering feature below SelectedFilter Is the currently selected filter. Read more about filtering feature below Selectable Determines whether the gallery has ability to select an item SelectedIndex Is the index of the selected item or -1 in case of no selection presents SelectedItem Is the selected item or null in case of no selection is presented ItemWidth Defines the fixed width of GalleryItem in the Gallery (Double.NaN by default) ItemHeight Defines the fixed height of GalleryItem in the Gallery (Double.NaN by default) Fluent.InRibbonGallery is similar to use: <Fluent:InRibbonGallery MinItemsInRow="3" MaxItemsInRow="8" ItemWidth="40" ItemHeight="56" ItemsSource ="{Binding DataItems}" ItemTemplate="{DynamicResource largeDataItemTemplate}" ResizeMode="Both"/> Set MinItemsInRow and MaxItemsInRow to define minimal and maximal width of a InRibbonGallery. By default InRibbonGallery appears in maximal width. Use special syntax in RibbonTabItem.ReduceOrder to reduce InRibbonGallery. To reduce all InRibbonGalleries in a particular group you have to write name of this group in brackets: <Fluent:RibbonTabItem ReduceOrder="(A),(A),(A),(A),(A),(B),(B),(B),(B)" ... > <Fluent:RibbonGroupBox Header="Without Grouping" Name="A"> ... Gallery items can be grouped. To group items in Gallery (or InRibbonGallery) you may use GroupBy for simplified grouping method or use GroupByAdvanced to introduce your own method. Note in the example below each data item has Group property. You can use Tag property if you add controls in Items.
  • 14. © Degtyarev Daniel, Rikker Serg 2009-2010. All rights reserved http://fluent.codeplex.com <Fluent:InRibbonGallery MinItemsInRow="1" MaxItemsInRow="5" ItemWidth="50" ItemHeight="18" ItemsSource ="{Binding DataItems}" ItemTemplate="{DynamicResource middleDataItemTemplate}" GroupBy="Group" ResizeMode="Both"/> Other unique feature of Gallery (and InRibbonGallery) is filtering. You can add filters and user will be able to filter items using them. Filter is one or more group. To enable grouping just add the following lines: <Fluent:InRibbonGallery MinItemsInRow="1" MaxItemsInRow="5" ItemWidth="50" ItemHeight="18" ItemsSource ="{Binding DataItems}" ItemTemplate="{DynamicResource middleDataItemTemplate}" GroupBy="Group" ResizeMode="Both"> <!--Filters--> <Fluent:InRibbonGallery.Filters> <Fluent:GalleryGroupFilter Title="All" Groups="Group A,Group B"/> <Fluent:GalleryGroupFilter Title="Group A" Groups="Group A"/> <Fluent:GalleryGroupFilter Title="Group B" Groups="Group B"/> </Fluent:InRibbonGallery.Filters> </Fluent:InRibbonGallery>
  • 15. © Degtyarev Daniel, Rikker Serg 2009-2010. All rights reserved http://fluent.codeplex.com Toolbars Fluent Ribbon Control Suite provides capability to make toolbar-like layout. Usually this is used in legacy-style controls such as font group in Microsoft Word. This layout is more complex and difficult to code it. Let‟s try to make something like the following example: We see here spinner and four buttons. In the large size controls are placed in two rows, brown button is in middle size. In middle size brown button becomes small and in small size controls are relocated in three rows. The main concept of RibbonToolBar control is you add controls and add layout definitions to each size of the toolbar. Layout definition (RibbonToolBarLayoutDefinition) is definition where controls are located. Each layout definition has one or more rows (RibbonToolBarRow) with control definitions or control group definitions (RibbonToolBarControlDefinition, RibbonToolBarControlGroup). Control group must have one or more control definitions inside, it will be separated with special separator or have other visual representation which is defined in the particular style. It‟s required to set Target property of RibbonToolBarControlDefinition to name of one of toolbar controls. Also you can define Size (Small, Middle or Large) and Width of control. By default size and width is Small and Auto (Double.NaN).
  • 16. © Degtyarev Daniel, Rikker Serg 2009-2010. All rights reserved http://fluent.codeplex.com <Fluent:RibbonToolBar> <!--ToolBar Layout Definitions--> <Fluent:RibbonToolBar.LayoutDefinitions> <!--Large Size of the RibbonToolBar--> <Fluent:RibbonToolBarLayoutDefinition Size="Large"> <Fluent:RibbonToolBarRow> <Fluent:RibbonToolBarControlDefinition Target="spinner" Width="127"/> </Fluent:RibbonToolBarRow> <Fluent:RibbonToolBarRow> <Fluent:RibbonToolBarControlDefinition Target="buttonGreen" /> <Fluent:RibbonToolBarControlDefinition Target="buttonGray" /> <Fluent:RibbonToolBarControlDefinition Target="buttonYellow" /> <Fluent:RibbonToolBarControlDefinition Target="buttonBrown" Size="Middle"/> </Fluent:RibbonToolBarRow> </Fluent:RibbonToolBarLayoutDefinition> <!--Large Size of the RibbonToolBar--> <Fluent:RibbonToolBarLayoutDefinition Size="Middle"> <Fluent:RibbonToolBarRow> <Fluent:RibbonToolBarControlDefinition Target="spinner" Width="90"/> </Fluent:RibbonToolBarRow> <Fluent:RibbonToolBarRow> <Fluent:RibbonToolBarControlDefinition Target="buttonGreen" /> <Fluent:RibbonToolBarControlDefinition Target="buttonGray" /> <Fluent:RibbonToolBarControlDefinition Target="buttonYellow" /> <Fluent:RibbonToolBarControlDefinition Target="buttonBrown"/> </Fluent:RibbonToolBarRow> </Fluent:RibbonToolBarLayoutDefinition> <!--Middle Size of the RibbonToolBar--> <Fluent:RibbonToolBarLayoutDefinition Size="Small"> <Fluent:RibbonToolBarRow> <Fluent:RibbonToolBarControlDefinition Target="spinner" Width="45"/> </Fluent:RibbonToolBarRow> <Fluent:RibbonToolBarRow> <Fluent:RibbonToolBarControlDefinition Target="buttonGreen" /> <Fluent:RibbonToolBarControlDefinition Target="buttonGray" /> </Fluent:RibbonToolBarRow> <Fluent:RibbonToolBarRow> <Fluent:RibbonToolBarControlDefinition Target="buttonYellow" /> <Fluent:RibbonToolBarControlDefinition Target="buttonBrown" /> </Fluent:RibbonToolBarRow> </Fluent:RibbonToolBarLayoutDefinition> </Fluent:RibbonToolBar.LayoutDefinitions> <!--ToolBar Controls--> <Fluent:Spinner x:Name="spinner" /> <Fluent:Button x:Name="buttonGreen" Header="Green" Icon="ImagesGreen.png” ... /> <Fluent:Button x:Name="buttonGray" Header="Gray" Icon="ImagesGray.png" ... /> <Fluent:Button x:Name="buttonYellow" Header="Yellow" Icon="ImagesYellow.png" ../> <Fluent:Button x:Name="buttonBrown" Header="Brown" Icon="ImagesBrown.png" ... /> </Fluent:RibbonToolBar>
  • 17. © Degtyarev Daniel, Rikker Serg 2009-2010. All rights reserved http://fluent.codeplex.com ColorGallery Fluent Ribbon Control Suite provides capability to make color picker controls like color picker buttons or split buttons or even insert in context menu. As shown above the ColorGallery control have three modes of appearance (to set mode use ColorGallery.Mode property):  ColorGalleryMode.HighlightColors (color gallery displays only fixed highlight colors);  ColorGalleryMode.StandardColors (color gallery displays only fixed standard colors);  ColorGalleryMode.ThemeColors (color gallery displays theme colors and fixed standard colors). ColorGallery can be placed anywhere in your application. For example, we can place it in DropDownButton as shown below: <!-- The following code shows standard mode for color gallery --> <Fluent:DropDownButton Name="colorPickerStandard" SizeDefinition="Middle" Header="Standard" > <!-- It's possible to create custom icon to present selected color --> <Fluent:DropDownButton.Icon> <Grid Width="16" Height="16"> <Image Source="ImagesFontColor.png"/> <Border BorderThickness="0" VerticalAlignment="Bottom" Height="4"> <Border.Background> <SolidColorBrush Color="{Binding ElementName=colorGalleryStandard, Path=SelectedColor, FallbackValue=Black}" /> </Border.Background> </Border> </Grid> </Fluent:DropDownButton.Icon> <Fluent:ColorGallery x:Name="colorGalleryStandard" SelectedColor="Red" IsNoColorButtonVisible="False" /> <Fluent:MenuItem Icon="ImagesPink.png" Header="A Menu Item"/> </Fluent:DropDownButton>
  • 18. © Degtyarev Daniel, Rikker Serg 2009-2010. All rights reserved http://fluent.codeplex.com Some of important properties of ColorGallery are listed below: Property Description SelectedColor Use this property to set or get currently selected color. Default value is null Mode You can set or get one of the three modes of appearance ChipWidth You can set or get size of chips (boxes where color presented) ChipHeight You can set or get size of chips (boxes where color presented) IsAutomaticColorButtonVisible You can hide or show the button (1) (see the picture above) IsNoColorButtonVisible You can hide or show the button (2) (see the picture above) IsMoreColorsButtonVisible You can hide or show the button (6) (see the picture above). Additionally you can subscribe MoreColorsExecuting event to use you own „color choose‟ dialog (otherwise the default dialog will be used). IsRecentColorsVisible You can hide or show the bar where colors picked with MoreColors appear Columns You can manage number of color gallery columns. It works only when Mode is ThemeColors StandardColorGridRows You can set or get how many rows will be in standard colors area (4) (see the picture above) ThemeColorGridRows You can set or get how many rows will be in theme colors area (3) (see the picture above) ThemeColors ThemeColorsSource Theme colors must be setted to show it in the gallery. Use one of these properties IMPORTANT NOTES:  SelectedColor property is Nullable (Color?).  No Color value is Colors.Transparent.  Automatic color value is null.