MsgBox のスタイルを設定する必要があるため、カスタム WPFMessageBox (wpfmessagebox.codeplex.com/) を使用しようとしました。すべてのファイルをプロジェクトにコピーし、ウィンドウにスタイルを追加しました
<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>
この後、WPF メッセージボックスは次のようになります: http://imgur.com/amw0eqw,IoqQyPY#0
しかし、そのスタイルの通常の Windows は次のようになります。
http://imgur.com/amw0eqw,IoqQyPY#1
WPFMessageBox に二重の「ヘッダー」があるのはなぜですか? また、スタイル付きのものは、通常のウィンドウのようにウィンドウ クロームを介してドラッグすることはできません。スタイルが正しく適用されないように WPFMessageBox と何が違うのですか?
助けてthx
編集:正常に動作する他のウィンドウのコードは次のとおりです
<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>