I am unable to get a WPF Ribbon project to show in Visual Studio. Here is a link to a thread for someone that had an issue in Visual Studio 2010.
I have tried everything suggested there but to no avail.
I have Visual Studio 2012 Express for Desktop installed but nothing is showing up. I have tried uninstalling and re-installing but no luck.
A simple work around would be to simply replace <Window>
with <RibbonWindow>
and <Ribbon>
as the first child. Keep in mind that the Ribbon control is already integrated into .NET 4.5.
First edit your MainWindow.xaml
by replacing Window
with RibbonWindow
and add <Ribbon x:Name="Ribbon" Title="Ribbon Title">
.
Example:
<RibbonWindow x:Class="WpfApplication3.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow"
x:Name="RibbonWindow"
Width="640" Height="480">
<Grid x:Name="LayoutRoot">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Ribbon x:Name="Ribbon" Title="Ribbon Title">
...........
</Ribbon>
</Grid>
</RibbonWindow>
You will also need to edit the MainWindow.xaml.cs
to inherit the RibbonWindow
class instead of Window
.
public partial class MainWindow : RibbonWindow
Last remember to import the reference from the .NET Framework.
System.Windows.Controls.Ribbon
Edit: Update with solution for VB.Net
.
1) Add reference
Add Reference
.System.Windows.Controls.Ribbon
under Assemblies and Framework.OK
to save.2) Edit your MainWindow.xaml
<Ribbon></Ribbon>
tag.3) Edit your Mainwindow.xaml.vb
MainWindow.xaml
and click View Code
.Class Window
to Class RibbonWindow
.4) Run the program!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With