Mahapps中的自定义弹出验证消息

时间:2016-04-17 07:13:51

标签: c# wpf mahapps.metro

我正在使用Mahapps创建一个WPF应用程序,当我输入错误的值时,我正在尝试更改弹出消息(如下图所示) 我想改变"价值' e'无法转换。"

Example

1 个答案:

答案 0 :(得分:0)

我不知道Mahapps.Metro,但覆盖地铁窗口样式似乎足够了。

例如,此问题之一answers

<Style x:Key="newDialogStyle" BasedOn="{StaticResource MetroDialogStyle}" TargetType="{x:Type Dialogs:BaseMetroDialog}">
     <!-- ur design of Control Template -->
</Style>

<Dialogs:CustomDialog Style="{StaticResource newDialogStyle}" Title="Custom Dialog which is awaitable">
    <StackPanel>
        <TextBlock  Height="30" 
                    Text="This dialog allows arbitrary content. You have to close it yourself by clicking the close button below."
                    TextWrapping="Wrap"
                    Foreground="{DynamicResource AccentColorBrush}" />
        <Button Content="Close Me!"/>
    </StackPanel>
</Dialogs:CustomDialog>