Changing ModalDialog Title bar background color

282 Views Asked by At

We have a WPF windows application, We need to change the Modal dialog title bar color, Below is the code snippet and also the screenshot of current dialog box. We are using WPF DevExpress.Xpf third party dlls.

We have tried background color change option also at various places but nothing works and title bar colro wont get changed.

enter image description here

<coreClient:BaseWindow x:Name="ModalDialogWindow"
                       xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                       xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                       ShowInTaskbar="False"
                       Height="10" Width="10"
                       Activated="ModalDialogWindowActivated"
                       Icon="/Images/app_icon_small.png" 
                       Title="{Binding Path=DialogTitle}">
    <coreClient:BaseWindow.Resources>
        <converter:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
        <converter:EmptyStringToVisibilityConverter x:Key="EmptyStringToVisibilityConverter" />
        <converter:ModalDialogActionCommandArgsConverter x:Key="ModalDialogActionCommandArgsConverter" />
    </coreClient:BaseWindow.Resources>

    <DockPanel LastChildFill="True">
        <Border Height="35" DockPanel.Dock="Bottom" Margin="0" Style="{StaticResource BdrModalDialogActionPanel}">
            <DockPanel LastChildFill="True">
                <StackPanel x:Name="actionButtonPanel" 
                            Orientation="Horizontal" 
                            DockPanel.Dock="Right"
                            HorizontalAlignment="Right"
                            VerticalAlignment="Center">

                    <ItemsControl Name="actionButtons"
                                  ItemsSource="{Binding ActionButtons}"
                                  HorizontalAlignment="Right" 
                                  Focusable="False"
                                  VerticalAlignment="Center">
                        <ItemsControl.ItemsPanel>
                            <ItemsPanelTemplate>
                                <StackPanel Orientation="Horizontal"/>
                            </ItemsPanelTemplate>
                        </ItemsControl.ItemsPanel>

                        <ItemsControl.ItemTemplate>
                            <DataTemplate>
                                <Button x:Name="additionalActionButton"
                                        IsDefault="{Binding IsButtonDefault}"
                                        IsCancel="{Binding IsButtonCancel}"
                                        IsEnabled="{Binding IsButtonEnabled}"
                                        Content="{Binding Path=Content}"
                                        HorizontalAlignment="Center" VerticalAlignment="Center"
                                        Margin="0,0,5,0"
                                        ToolTipService.ShowOnDisabled="True"
                                        Command="{Binding Path=ActionCommand}" Height="29">

                                    <Button.CommandParameter>
                                        <MultiBinding Converter="{StaticResource ModalDialogActionCommandArgsConverter}">
                                            <MultiBinding.Bindings>
                                                <Binding ElementName="ModalDialogWindow" />
                                                <Binding />
                                            </MultiBinding.Bindings>
                                        </MultiBinding>
                                    </Button.CommandParameter>
                                    <Button.Style>
                                        <Style TargetType="{x:Type Button}">
                                            <Style.Triggers>
                                                <Trigger Property="Content" Value="Search">
                                                    <Setter Property="Foreground" Value="White"/>
                                                    <Setter Property="Height" Value="29" />
                                                    <Setter Property="Width" Value="76" />
                                                    <Setter Property="Template">
                                                        <Setter.Value>
                                                            <ControlTemplate TargetType="Button">
                                                                <Grid Background="#0096d6" x:Name="RootElement">
                                                                    <TextBlock Text="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                                                </Grid>
                                                            </ControlTemplate>
                                                        </Setter.Value>
                                                    </Setter>
                                                </Trigger>
                                            </Style.Triggers>
                                        </Style>
                                    </Button.Style>
                                    <Button.ToolTip>
                                        <ToolTip Visibility="{Binding TooltipText, Converter={StaticResource EmptyStringToVisibilityConverter}, ConverterParameter='HIDDEN'}"
                                                 Content="{Binding TooltipText}" />
                                    </Button.ToolTip>
                                </Button>
                            </DataTemplate>
                        </ItemsControl.ItemTemplate>
                    </ItemsControl>
                </StackPanel>

                <StackPanel Orientation="Horizontal"
                            DockPanel.Dock="Left"
                            Visibility="{Binding IsActionInProgress, Converter={StaticResource BoolToVisibilityConverter}}">
                    <common:SpinnerControl x:Name="SpinnerControl" VerticalAlignment="Center" VerticalContentAlignment="Center" />
                    <TextBlock Text="{Binding ActionStatusMessage}"
                               Margin="5,0,0,0"
                               VerticalAlignment="Center"/>
                </StackPanel>
            </DockPanel>
        </Border>

        <ContentControl x:Name="MainControl" 
                        IsTabStop="False" 
                        Focusable="False" />
    </DockPanel>
</coreClient:BaseWindow>

0

There are 0 best solutions below