当前位置: 首页>>代码示例>>C#>>正文


C# PasswordBox.UpdateLayout方法代码示例

本文整理汇总了C#中System.Windows.Controls.PasswordBox.UpdateLayout方法的典型用法代码示例。如果您正苦于以下问题:C# PasswordBox.UpdateLayout方法的具体用法?C# PasswordBox.UpdateLayout怎么用?C# PasswordBox.UpdateLayout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Controls.PasswordBox的用法示例。


在下文中一共展示了PasswordBox.UpdateLayout方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SelectionForeground

 public void SelectionForeground()
 {
     var box = new PasswordBox();
     Assert.IsNull(box.SelectionForeground, "#1");
     TestPanel.Children.Add(box);
     Assert.IsNull(box.SelectionForeground, "#2");
     box.UpdateLayout();
     Assert.IsNull(box.SelectionForeground, "#3");
     Enqueue(() => {
         Assert.IsNotNull(box.SelectionForeground, "#4");
         Assert.IsUnset(box, PasswordBox.SelectionForegroundProperty, "#5");
     });
     Enqueue (() => {
         box.ClearValue(PasswordBox.SelectionForegroundProperty);
         Assert.IsNull(box.SelectionForeground, "#6");
     });
     EnqueueTestComplete();
 }
开发者ID:snorp,项目名称:moon,代码行数:18,代码来源:PasswordBoxTest.cs

示例2: SelectionForeground_Styled

        public void SelectionForeground_Styled ()
        {
            var brush = new SolidColorBrush (Colors.Red);
            var style = new Style (typeof (PasswordBox));
            style.Setters.Add (new Setter (PasswordBox.SelectionForegroundProperty, brush));

            var box = new PasswordBox { Style = style };

            Assert.AreSame (brush, box.SelectionForeground, "#1");
            TestPanel.Children.Add(box);
            Assert.AreSame (brush, box.SelectionForeground, "#2");
            box.UpdateLayout();
            Assert.AreSame (brush, box.SelectionForeground, "#3");
            Enqueue(() => {
                Assert.AreSame (brush, box.SelectionForeground, "#4");
                Assert.IsUnset(box, PasswordBox.SelectionForegroundProperty, "#5");
            });
            Enqueue (() => {
                box.ClearValue(PasswordBox.SelectionForegroundProperty);
                Assert.AreSame (brush, box.SelectionForeground, "#6");
            });
            EnqueueTestComplete();
        }
开发者ID:dfr0,项目名称:moon,代码行数:23,代码来源:PasswordBoxTest.cs

示例3: SelectionForeground_SetStyle_RemoveStyle

        public void SelectionForeground_SetStyle_RemoveStyle()
        {
            var brush = new SolidColorBrush(Colors.Red);
            var style = new Style(typeof(PasswordBox));
            style.Setters.Add(new Setter(PasswordBox.SelectionForegroundProperty, brush));

            var box = new PasswordBox { Style = style };

            TestPanel.Children.Add(box);
            box.UpdateLayout();
            Enqueue(() => {
                box.Style = null;
                Assert.IsNull (box.SelectionForeground, "#1");
            });
            EnqueueTestComplete();
        }
开发者ID:dfr0,项目名称:moon,代码行数:16,代码来源:PasswordBoxTest.cs


注:本文中的System.Windows.Controls.PasswordBox.UpdateLayout方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。