Ticket Q298641
Visible to All Users

How do I make the Window's Title align in “Center” not in “Left”

created 14 years ago

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.

Comments (3)

    the finally page

    DevExpress Support Team 14 years ago

      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.

        Answers

        created 14 years ago

        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

          Show previous comments (11)
          DevExpress Support Team 14 years ago

            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?

              DevExpress Support Team 11 years ago

                Hi Fakhru,
                Sure! Please review the attachment.

                Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

                Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.