How do I make the Window's Title aiign in “Center” not in “Left” .
When I create a wpf window inherit from DevExpress.Xpf.Core.DXWindow, how do I change the window's title alignment to center.
How do I make the Window's Title align in “Center” not in “Left”
Answers
Hello Stefen,
Thank you for the clarification. To resolve this task, you should override our following template:
<dx:DXWindow x:Class="DXWpfApplication.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:DXWpfApplication"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxt="http://schemas.devexpress.com/winfx/2008/xaml/core/themekeys"
xmlns:dxcore="http://schemas.devexpress.com/winfx/2008/xaml/core"
Title="DXWpfApplication" Height="600" Width="800"
>
<dx:DXWindow.Resources>
<DataTemplate x:Key="{dxt:FloatingContainerThemeKey ResourceKey=FloatingContainerCaptionTemplate}">
<StackPanel Width="Auto" Height="Auto" HorizontalAlignment="Center" Orientation="Horizontal">
<Image x:Name="PART_Icon" Width="Auto" Height="Auto" Margin="6,3,0,3" Stretch="None"
Source="{Binding Path=(dxcore:FloatingContainer.FloatingContainer).Icon, RelativeSource={RelativeSource AncestorType=ContentPresenter}}" />
<TextBlock x:Name="PART_Text" Background="{x:Null}" Foreground="#FFD4E4F8" TextWrapping="Wrap" Margin="6,3,6,3" VerticalAlignment="Center" IsHitTestVisible="False"
Text="{Binding Path=(dxcore:FloatingContainer.FloatingContainer).Caption, RelativeSource={RelativeSource AncestorType=ContentPresenter}}" />
</StackPanel>
<DataTemplate.Triggers>
<Trigger Property="Source" SourceName="PART_Icon" Value="{x:Null}">
<Setter TargetName="PART_Icon" Property="Visibility" Value="Collapsed" />
</Trigger>
</DataTemplate.Triggers>
</DataTemplate>
</dx:DXWindow.Resources>
<Grid >
</Grid>
</dx:DXWindow>
Please try this solution, and let me know your results. If you want to use the v10.1 version, please let me know.
Thank you, Marina
Hi Stephen,
Thank you for your feedback.
If everything goes according to our plans, we will release version 2010.2.4 this year :).
Thanks,
Andrew
Hi,
I need to make my dxwindow's title in centre position. Do you have any sample project for the solution mentioned above?
the finally page
Hello,
I suggest that you use our DXRibbonWindow. This window Title is aligned in "Center" by default:
DXRibbonWindow.
Feel free to ask additional questions.
Thank you, Marina
Thank you.
But I don't want to add "Ribbon Control" in my page, do we have some function can change the title align in “Center”.
I find that the DXRibbonWindow inherit from DevExpress.Xpf.Core.DXWindow, how did you do that you can change the title alignement.