0
Reply

WPF Ribbon Control

John Lawrence

John Lawrence

Sep 27 2013 1:47 PM
1.4k
I have followed this Article http://www.c-sharpcorner.com/UploadFile/0b73e1/ribbon-control-in-wpf-4-5/ as it seems to be one of the few articles that cover the Ribbon in VS2012.

However I am trying to add a new routed event and I just cannot get it to fire.

My XAML header looks like:

<RibbonWindow x:Class="BloodHound.Case"  Icon="images/briefcase.png"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:RibbonWin="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Ribbon"
        Title="Case" Height="500" Width="600">

Then the Ribbon control itself works well on the UI, and so I added a button:

 <RibbonButton Name="rbtnMenuCalendar" LargeImageSource="Images\calendar.png" SmallImageSource="Images\calendar.png" 
                                      Label="Calendar" KeyTip="V"
                                      MouseLeftButtonUp="rbtnMenu_MouseLeftButtonUp" >

But I cannot get the event to fire, event coded as :

private void rbtnMenu_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
         
            LoadCalendar();
        }

Have Included the necessary Directives as well:

using System.Windows.Controls.Ribbon;

namespace BloodHound
{
    /// <summary>
    /// Interaction logic for Case.xaml
    /// </summary>
    public partial class Case : RibbonWindow
    {

Any assistance would be greatly appreciated.