[WPF Ribbon] Creating custom Ribbon control

Nov 22, 2010 at 7:41 PM

Hi,

I've been trying to develop a custom control for the WPF ribbon. I've tried numerous things but I cannot get it to work properly. The control simply consists out of 2 RibbonGroups.

I've already tried:

  • UserControl>Grid>RibbonGroupItemsPanel
  • RibbonGroupItemsPanel>Children (by XAML and by code)
  • UserControl>RibbonGroupItemsPanel  (Source below)
  • etc

<UserControl x:Class="FilterView"  <!-- defaults left out for brevity -->xmlns:ribbon="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"  xmlns:p="clr-namespace:Microsoft.Windows.Controls.Ribbon.Primitives;assembly=RibbonControlsLibrary" mc:Ignorable="d">

<p:RibbonGroupItemsPanel>

<ribbon:RibbonGroup x:Name="CreateFilterGroup" Header="Maak Filter">

<ribbon:RibbonComboBox x:Name="FilterField" Label="Veld: " Text="Kies veld" Margin="20,0,0,0" SelectionBoxWidth="85" ToolTipDescription="Kies het veld waarop je wil filteren" ToolTipTitle="Kies veld"/>

<ribbon:RibbonTextBox x:Name="FilterValue" Label="Waarde:" TextBoxWidth="100" ToolTip="FilterWaarde"/>

<ribbon:RibbonButton x:Name="AddFilter" Label="Filter toevoegen" Height="20" Width="170"/>

</ribbon:RibbonGroup>        <ribbon:RibbonGroup x:Name="ActiveFilters" Header="Filters">

<ribbon:RibbonControlGroup x:Name="FilterView" Background="#33FFFFFF">NAAM BEVAT "Jorgen"<ribbon:RibbonButton x:Name="RemoveFilter" Height="20" Width="20" Label="X"/>

</ribbon:RibbonControlGroup>

</ribbon:RibbonGroup>

</p:RibbonGroupItemsPanel>

</UserControl>

Your help would be greatly appreciated,

W