Here is something that I've done that some other people might find useful (maybe it will be included in a future version? :) )
Anyway, the purpose here is to allow setting of the default ribbon color scheme from within your xaml code. I'm using an attached property on my ribbon tag to achieve the result.
Here is the class defining the attached property.And here is the usage within xaml code.
Anyway, the purpose here is to allow setting of the default ribbon color scheme from within your xaml code. I'm using an attached property on my ribbon tag to achieve the result.
Here is the class defining the attached property.
using System.Windows;
using ActiproSoftware.Windows.Controls.Ribbon.UI;
namespace Common.UI
{
public class RibbonColorSchemeSetter
{
public static readonly DependencyProperty ValueProperty;
static RibbonColorSchemeSetter()
{
ValueProperty = DependencyProperty.RegisterAttached("Value", typeof(RibbonColorScheme), typeof(RibbonColorSchemeSetter),
new PropertyMetadata(OnValueChanged));
}
public static RibbonColorScheme GetValue(DependencyObject sender)
{
return (RibbonColorScheme)sender.GetValue(ValueProperty);
}
public static void SetValue(DependencyObject sender, RibbonColorScheme value)
{
sender.SetValue(ValueProperty, value);
}
private static void OnValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
{
RibbonColorScheme.Default = (RibbonColorScheme)e.NewValue;
}
}
}
<r:Ribbon ui:RibbonColorSchemeSetter.Value="{x:Static r:RibbonColorScheme.Office2007Black}"/>