According to WPF Textbox's TextAlignment changes its default context menu item's alignment as well, you have to rebuild the context menu, since the default can't be changed.
<XceedToolkit:IntegerUpDown>
<XceedToolkit:IntegerUpDown.ContextMenu>
<ContextMenu TextBlock.TextAlignment="Left">
<MenuItem Command="ApplicationCommands.Copy" />
<MenuItem Command="ApplicationCommands.Cut" />
<MenuItem Command="ApplicationCommands.Paste" />
</ContextMenu>
</XceedToolkit:IntegerUpDown.ContextMenu>
</XceedToolkit:IntegerUpDown>
The issue is not specific to XceedToolkit:IntegerUpDown
but applies to many controls with default context menu and TextAlignment
property.
If you rather want to hack around with styles instead of replacing the context menu, your best bet for a target might be the Popup
, since the context menu elements are internal classes somewhere, so creating a style for them won't work out of the box.
<XceedToolkit:IntegerUpDown>
<xt:IntegerUpDown.Resources>
<Style TargetType="Popup">
<Setter Property="TextBlock.TextAlignment" Value="Left"/>
</Style>
</xt:IntegerUpDown.Resources>
</xt:IntegerUpDown>