0

i tried to use the Custom WPFMessageBox (wpfmessagebox.codeplex.com/) because i need to Style the MsgBox. I copied all files to my Projekt and added a Style to the Window

<Window x:Class="MessageBoxUtils.WPFMessageBoxWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:MessageBoxUtils"
    Style="{StaticResource DialogWindowStyle}"

    Title="{Binding Title}" ResizeMode="NoResize" SizeToContent="WidthAndHeight" FlowDirection="{Binding TitleFlowDirection}"

    ShowInTaskbar="False" WindowStartupLocation="CenterScreen" KeyDown="Window_KeyDown" MinWidth="250">
<Grid>
    <local:WPFMessageBoxControl />
</Grid>

After this the WPF Messagebox looks this: https://i.stack.imgur.com/0NU38.png

But normal Windows with that Style look this:

https://i.stack.imgur.com/z5Ku4.png

Why has the WPFMessageBox a double "Header"? And the styled one can not be dragged via window-chrome like the normal windows. What is different with WPFMessageBox so that the Style doesnt apply right?

thx for help

edit: here's the code from the other window which works fine

<Window x:Class="Mx.View.KonfigurationView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Style="{StaticResource DialogWindowStyle}"
    Title="Konfiguration" Height="860" Width="1024">
<Grid>
  • you have to hide the default Title bar of the Window by setting `WindowStyle="None"`. However to make the fake Title bar work, you may have to understand more about the custom control here. E.g, when mouse moves on the fake Title bar and has the left button pressed, just call `DragMove()` method to move the Window along. – King King Nov 07 '14 at 08:00
  • By setting WindowStyle="None" there is a little border left, it's a bit different from the normal Window. The titlebar works fine with other windows, so whats the difference to this one? – Michael Spannbauer Nov 07 '14 at 08:18
  • Solved. The problem was caused by some win-dlls. If there are dlls in the code, it prevents the style from being changed in some way. I don't have a real explanation here. – Michael Spannbauer Dec 01 '14 at 08:37

0 Answers0