RibbonToolTip is inheriting alignment from a textbox
I'm having an issue with RibbonToolTips inheriting alignment from a
textbox in the ribbon. The problem is that I can't seem to override this
behavior no matter what I do. This only seems to manifest for Textboxes
and Labels and RibbonTextBoxes seem to be unaffected.
XAML:
<RibbonWindow x:Class="RibbonToolTipTest.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid x:Name="LayoutRoot">
<Ribbon Title="WPF Ribbon" x:Name="Ribbon">
<RibbonTab>
<RibbonGroup Width="300">
<StackPanel Orientation="Horizontal">
<TextBox Text="This is a test" TextAlignment="Right"
x:Name="RegularLabel" />
<TextBox Width="200" TextAlignment="Left"
x:Name="RegularTextBox"/>
</StackPanel>
<RibbonTextBox Width="200"
ToolTipTitle="Title"
ToolTipDescription="The moon was shining
sulkily, Because she thought the sun Had
got no business to be there After the day
was done — "It's very rude of
him," she said, "To come and
spoil the fun.""
Label="Label" />
</RibbonGroup>
</RibbonTab>
</Ribbon>
</Grid>
Code-behind:
using System.Windows.Controls.Ribbon;
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;
namespace RibbonToolTipTest
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : RibbonWindow
{
public MainWindow()
{
InitializeComponent();
RegularTextBox.ToolTip = RegularLabel.ToolTip = new
RibbonToolTip()
{
Title = "Title",
Description =
"The sun was shining on the sea, Shining with all his
might: He did his very best to make The billows smooth
and bright — And this was odd, because it was The
middle of the night. ",
HorizontalContentAlignment = HorizontalAlignment.Left,
HorizontalAlignment = HorizontalAlignment.Left
};
}
}
}
No comments:
Post a Comment