【问题标题】:Set Default FlowDirection Wpf toolkit extended MessageBox设置默认 FlowDirection Wpf 工具包扩展 MessageBox
【发布时间】:2012-08-20 23:30:10
【问题描述】:

我无法为 WPF Toolkit Extended 1.6 MessageBox 动态地设置默认 flowdirection 属性,知道我有一个静态字段myFlowDirection,有没有办法在代码和运行时做到这一点

我试过 它工作正常 & 它改变了流程,但我需要它动态

        <Style TargetType="{x:Type toolkit:MessageBox}">
        <Setter Property="FlowDirection"  Value="RightToLeft"/>
        </Style>

此 MessageBox 无法派生且没有构造函数

【问题讨论】:

    标签: c# wpf wpftoolkit


    【解决方案1】:

    只是猜测,但您是否尝试过绑定 Setter 属性?

    此链接是来自 SO 的问题,听起来与您的相似:

    WPF binding to another property's binding in a style

    这是另一个例子:

    http://forums.silverlight.net/t/130096.aspx/1

    【讨论】:

    • 是的,我已经尝试过 IValueConverter 工作正常,但速度很慢,所以窗口显示然后 FlowDirection 属性更改 about 300ms ,即使我有i7Core 处理器和出色的显卡
    【解决方案2】:

    是的,您可以通过 MessageBoxOptions.RtlReading

    设置消息框 FlowDirection

    例如:

    MessageBox.Show("Your RTL Text", "Message Box Title", MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.None, MessageBoxOptions.RtlReading);

    【讨论】:

      猜你喜欢
      • 2017-07-30
      • 1970-01-01
      • 1970-01-01
      • 2016-08-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多