【问题标题】:Align PasswordBox text to center Windows store apps将 PasswordBox 文本与 Windows 商店应用居中对齐
【发布时间】:2013-08-08 08:22:02
【问题描述】:

我需要像 TextBox 的 TextAlignment 属性一样将密码对齐到 PasswordBox 的中心,但不幸的是,没有使用 PasswordBox 元素定义 TextAlignment 属性,在 windows phone 8 中,我通过将 PasswordBox 模板修改为这篇文章 -PasswordBox textalignment in WP7 来实现这一点, 但是当搜索 Windows Store App 时,我发现很多关于 silverlight 和 wpf 的帖子,例如 This,但不适用于 Windows 商店应用程序。

谢谢:)

【问题讨论】:

    标签: alignment windows-store-apps text-alignment passwordbox


    【解决方案1】:

    包含命名空间:

    <!-- XML Namespace mapping. -->
    xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
    

    将非默认控件HorizontalContentAlignment 添加到样式模板。

    <control HorizontalContentAlignment="horizontalAlignmentValue"/>
    

    更多信息herehere

    【讨论】:

      猜你喜欢
      • 2022-03-04
      • 2015-10-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-11-01
      • 1970-01-01
      • 2018-05-12
      • 1970-01-01
      相关资源
      最近更新 更多