I'm trying to subclass the RadRibbonTab as a custom UserControl to be able to use PRISM to navigate to a specific ribbon tab.
However the subclassed RibbonTab never appears in the tab bar of the ribbon. I created a sample to demonstrate the problem:
MainWindow.xaml:
UserControl1.xaml:
UserControl1.xaml.cs:
I'm probably missing something obvious, however I don't know what. Thanks for your help.
However the subclassed RibbonTab never appears in the tab bar of the ribbon. I created a sample to demonstrate the problem:
MainWindow.xaml:
<
Window
x:Class
=
"RadControlsWpfApp1.MainWindow"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
xmlns:local
=
"clr-namespace:RadControlsWpfApp1"
Title
=
"MainWindow"
Height
=
"350"
Width
=
"525"
>
<
telerik:RadRibbonView
>
<
telerik:RadRibbonTab
Header
=
"Tab 1"
>
<
telerik:RadRibbonGroup
Header
=
"Group 1"
>
<
telerik:RadRibbonButton
Size
=
"Large"
>Button 1</
telerik:RadRibbonButton
>
</
telerik:RadRibbonGroup
>
</
telerik:RadRibbonTab
>
<
local:UserControl1
/>
</
telerik:RadRibbonView
>
</
Window
>
UserControl1.xaml:
<
telerik:RadRibbonTab
x:Class
=
"RadControlsWpfApp1.UserControl1"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable
=
"d"
d:DesignHeight
=
"300"
d:DesignWidth
=
"300"
Header
=
"Tab 2"
>
<
telerik:RadRibbonGroup
Header
=
"Group 2"
>
<
telerik:RadRibbonButton
Size
=
"Large"
>Button 2</
telerik:RadRibbonButton
>
</
telerik:RadRibbonGroup
>
</
telerik:RadRibbonTab
>
UserControl1.xaml.cs:
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Text;
using
System.Windows;
using
System.Windows.Controls;
using
System.Windows.Data;
using
System.Windows.Documents;
using
System.Windows.Input;
using
System.Windows.Media;
using
System.Windows.Media.Imaging;
using
System.Windows.Navigation;
using
System.Windows.Shapes;
using
Telerik.Windows.Controls;
namespace
RadControlsWpfApp1
{
/// <summary>
/// Interaction logic for UserControl1.xaml
/// </summary>
public
partial
class
UserControl1 : RadRibbonTab
{
public
UserControl1()
{
InitializeComponent();
}
}
}
I'm probably missing something obvious, however I don't know what. Thanks for your help.