
Can the width be set to 0 at least (as well as the application icon)? In trying to implement 2013-style auto-hide behavior, I've found I can't get the restore/ellipsis button to span the width of the window because the App Icon and QAT never fully collapse even when the ApplicationIcon is set to null and QuickAccessToolBarLocation is set to None.
Incidentally, if the application opens without Icon set and then one is applied, the Icon and the QAT will overlap:
<ribbon:RibbonWindow x:Class="WpfApplication5.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ribbon="http://schemas.actiprosoftware.com/winfx/xaml/ribbon" xmlns:local="clr-namespace:WpfApplication5" Title="MainWindow" Height="350" Width="525">
<ribbon:RibbonWindow.Resources>
<local:IconConverter x:Key="IconConverter" />
</ribbon:RibbonWindow.Resources>
<ribbon:RibbonWindow.Icon>
<Binding RelativeSource="{RelativeSource Self}" Path="RibbonState" Converter="{StaticResource IconConverter}" />
</ribbon:RibbonWindow.Icon>
<ribbon:Ribbon>
<ribbon:Tab Label="Tab">
<ribbon:Group Label="Group">
<ribbon:Button Click="Button_Click" ImageSourceLarge="ToyVortininja.png"/>
</ribbon:Group>
</ribbon:Tab>
<ribbon:Tab Label="Tab 2" />
<ribbon:Tab Label="Tab 3" />
</ribbon:Ribbon>
</ribbon:RibbonWindow>
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow
{
public MainWindow()
{
InitializeComponent();
}
private void Button_Click(object sender, ActiproSoftware.Windows.Controls.Ribbon.Controls.ExecuteRoutedEventArgs e)
{
RibbonState = string.Equals("AutoHide", RibbonState, StringComparison.Ordinal) ? "Normal" : "AutoHide";
}
public string RibbonState
{
get { return (string)GetValue(RibbonStateProperty); }
set { SetValue(RibbonStateProperty, value); }
}
public static readonly DependencyProperty RibbonStateProperty = DependencyProperty.Register("RibbonState", typeof(string), typeof(MainWindow), new PropertyMetadata("AutoHide"));
}
internal sealed class IconConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
string ribbonState = (string)value;
return string.Equals(ribbonState, "AutoHide", StringComparison.Ordinal) ? null : new BitmapImage(new Uri("pack://application:,,,/WpfApplication5;component/ToyVortininja.png", UriKind.RelativeOrAbsolute));
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotSupportedException();
}
}
[Modified 12 years ago]