本文整理汇总了C#中System.Windows.Controls.Canvas.Orphanize方法的典型用法代码示例。如果您正苦于以下问题:C# Canvas.Orphanize方法的具体用法?C# Canvas.Orphanize怎么用?C# Canvas.Orphanize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Controls.Canvas
的用法示例。
在下文中一共展示了Canvas.Orphanize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Create
public static void Create(int _x, int _y, Canvas Content, double size)
{
("assets/AvalonMinesweeper.Core/explosion.mp3").PlaySound();
var exc = new Canvas
{
Width = size,
Height = size
}.MoveTo(_x - size / 2, _y - size / 2).AttachTo(Content);
Enumerable.Range(1, 16).ForEach(
(c, i, next) =>
{
var n = ("" + c).PadLeft(2, '0');
var ex = new Image
{
Source = ("assets/AvalonMinesweeper.Core/ani6_" + n + ".png").ToSource()
}.SizeTo(size, size).AttachTo(exc);
(1000 / 15).AtDelay(
delegate
{
ex.Orphanize();
next();
}
);
}
)(
delegate
{
exc.Orphanize();
}
);
}
示例2: ShowExplosion
private void ShowExplosion(int _x, int _y, Canvas Content)
{
var exc = new Canvas
{
Width = 64,
Height = 64
}.MoveTo(_x - 32, _y - 32).AttachTo(Content);
Enumerable.Range(1, 16).ForEach(
(c, i, next) =>
{
var n = ("" + c).PadLeft(2, '0');
var ex = new Image
{
Source = (KnownAssets.Path.Assets + "/ani6_" + n + ".png").ToSource()
}.AttachTo(exc);
(1000 / 24).AtDelay(
delegate
{
ex.Orphanize();
next();
}
);
}
)(
delegate
{
exc.Orphanize();
}
);
}
示例3: ApplicationCanvas
public ApplicationCanvas()
{
Width = DefaultWidth;
Height = DefaultHeight;
this.Background = Brushes.Blue;
var left = new PartialView(Colors.Blue, true).AttachTo(this);
var right = new PartialView(Colors.Green).AttachTo(this).MoveTo(DefaultWidth / 2, 0);
this.InfoOverlay = new Canvas().AttachTo(this);
this.About = new TextBox
{
BorderThickness = new Thickness(0),
Background = Brushes.Transparent,
Foreground = Brushes.Black,
AcceptsReturn = true,
Text =
@"Windows Presentation Foundation Touch demo
- Debuggable under .NET (fullscreen when maximized and touch events)
- Adobe Flash 10.1 version via jsc
No touch events in fullscreen
Browser fullscreen feature shall be used instead
Tested for IE, Firefox, Chrome
- Javascript version for Firefox4 via jsc
- Tested with 4 touch points on Dell Latitude XT
- Galaxy S/ Galaxy Tab within browser have only 1 touchpoint
- 2012.09 flash no longer available on android
- multitouch seems to work in firefox/ flash (11.0)
- multitouch seems to work in ie/flash (10.0)
- p2p LAN no longer works?
- Works on AIR for Android! :) 2013-03-05
- Works on AIR for iPad! :) 2014-03-01
"
}.AttachTo(InfoOverlay).MoveTo(128, 32);
var c1 = new cloud_mid().AttachTo(InfoOverlay);
var c2 = new cloud_mid().AttachTo(InfoOverlay);
this.TouchOverlay = new Canvas
{
}.AttachTo(this); //.SizeTo(DefaultWidth, DefaultHeight);
var TouchArea = new Rectangle
{
Width = DefaultWidth,
Height = DefaultHeight,
Fill = Brushes.White,
Opacity = 0
}.AttachTo(TouchOverlay);
var t = TouchOverlay.ToTouchEvents(
m =>
{
// a new reusable finger introduced by the system!
var Content = new Canvas();
new Avalon.Images.white_jsc().AttachTo(Content).MoveTo(
Avalon.Images.white_jsc.ImageDefaultWidth / -2,
Avalon.Images.white_jsc.ImageDefaultHeight / -2
);
var CurrentTouchPoint = default(Tuple<double, double>);
Func<Tuple<double, double>> GetTouchPoint = () => CurrentTouchPoint;
m.TouchDown += e =>
{
var p = e.GetTouchPoint(TouchOverlay).Position;
CurrentTouchPoint = Tuple.Create(p.X, p.Y);
Content.AttachTo(InfoOverlay);
};
m.TouchUp += e =>
{
CurrentTouchPoint = null;
Content.Orphanize();
};
m.TouchMove += e =>
{
var p = e.GetTouchPoint(TouchOverlay).Position;
CurrentTouchPoint = Tuple.Create(p.X, p.Y);
//.........这里部分代码省略.........