本文整理汇总了C#中System.Windows.Controls.PasswordBox.AttachTo方法的典型用法代码示例。如果您正苦于以下问题:C# PasswordBox.AttachTo方法的具体用法?C# PasswordBox.AttachTo怎么用?C# PasswordBox.AttachTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Controls.PasswordBox
的用法示例。
在下文中一共展示了PasswordBox.AttachTo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ApplicationCanvas
public ApplicationCanvas()
{
var p = new PasswordBox
{
Password = "auto size me",
Background = Brushes.Transparent
};
r.Fill = Brushes.Red;
r.AttachTo(this);
//r.MoveTo(8, 8);
//this.SizeChanged += (s, e) => r.SizeTo(this.Width - 16.0, this.Height - 16.0);
this.SizeChanged += (s, e) => r.SizeTo(p.ActualWidth, p.ActualHeight);
p.AttachTo(this);
//NotImplementedException
// at ScriptCoreLib.ActionScript.BCLImplementation.System.Windows::__FrameworkElement/InternalSetWidth_79f8bffe_06000042()[V:\web\ScriptCoreLib\ActionScript\BCLImplementation\System\Windows\__FrameworkElement.as:48]
// at ScriptCoreLib.ActionScript.BCLImplementation.System.Windows::__FrameworkElement/set Width()[V:\web\ScriptCoreLib\ActionScript\BCLImplementation\System\Windows\__FrameworkElement.as:63]
// at AIRAvalonPasswordField::ApplicationCanvas()[V:\web\AIRAvalonPasswordField\ApplicationCanvas.as:57]
// at AIRAvalonPasswordField::ApplicationSprite()[V:\web\AIRAvalonPasswordField\ApplicationSprite.as:34]
//p.Width = 400;
p.Width = 350;
//Implementation not found for type import :
//type: System.Windows.Media.ScaleTransform
//method: Void .ctor(Double, Double)
//Did you forget to add the [Script] attribute?
//Please double check the signature!
var aspect = 1.0;
this.SizeChanged +=
delegate
{
aspect = this.ActualWidth / 400.0;
//this.LayoutTransform = new ScaleTransform { ScaleX = aspect, ScaleY = aspect };
this.RenderTransform = new ScaleTransform { ScaleX = aspect, ScaleY = aspect };
};
this.RenderTransform = new ScaleTransform { ScaleX = 2.0, ScaleY = 2.0 };
//this.LayoutTransform = new ScaleTransform { ScaleX = 2.0, ScaleY = 2.0 };
}