本文整理汇总了C#中System.Windows.Controls.Button.AttachTo方法的典型用法代码示例。如果您正苦于以下问题:C# Button.AttachTo方法的具体用法?C# Button.AttachTo怎么用?C# Button.AttachTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Controls.Button
的用法示例。
在下文中一共展示了Button.AttachTo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ApplicationCanvas
public ApplicationCanvas()
{
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);
var btn = new Button { Content = "Hello" }.MoveTo(16, 16).SizeTo(96, 32);
btn.Click +=
delegate
{
var w = new Window();
//w = new ApplicationCanvas().ToW
w.Content = new ApplicationCanvas();
w.ShowInTaskbar = false;
var p = this.Parent as FrameworkElement;
while (!(p is Window))
{
p = p.Parent as FrameworkElement;
}
var Owner = p as Window;
w.WindowStartupLocation = WindowStartupLocation.CenterScreen;
w.Owner = Owner;
w.ShowDialog();
};
btn.AttachTo(this);
}
示例2: Main
public static void Main(string[] e)
{
var w = new Window { Title = "JSC - Android Project" }.SizeTo(400 + 48, 300);
var c = new Canvas();
c.AttachTo(w);
new global::AndroidVortexLesson1.Avalon.Images.jsc().AttachTo(c).MoveTo(300, 16);
var button1 = new Button { Content = "Debug in Android Emulator" };
button1.MoveTo(16, 128).SizeTo(400, 32);
button1.AttachTo(c);
var button2 = new Button { Content = "Debug on Device" };
button2.MoveTo(16, 128 + 48).SizeTo(400, 32);
button2.AttachTo(c);
w.ShowDialog();
}