本文整理汇总了C#中Entry.Tick方法的典型用法代码示例。如果您正苦于以下问题:C# Entry.Tick方法的具体用法?C# Entry.Tick怎么用?C# Entry.Tick使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Entry
的用法示例。
在下文中一共展示了Entry.Tick方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SimpleCarouselControl
public SimpleCarouselControl(int DefaultWidth, int DefaultHeight)
{
this.Container = new Canvas
{
Width = DefaultWidth,
Height = DefaultHeight
};
var ContentContainer = new Canvas
{
Width = DefaultWidth,
Height = DefaultHeight
}.AttachTo(this.Container);
this.Caption = new TextBox
{
Width = DefaultWidth,
Height = 32,
TextAlignment = TextAlignment.Center,
Foreground = Brushes.White,
BorderThickness = new Thickness(0),
Background = Brushes.Transparent,
IsReadOnly = true
}.MoveTo(0, (DefaultHeight - 32) / 2).AttachTo(this.Container);
this.Overlay = new Canvas
{
Width = DefaultWidth,
Height = DefaultHeight,
};
var OverlayFill = new Rectangle
{
Width = DefaultWidth,
Height = DefaultHeight,
Fill = Brushes.Red,
Opacity = 0
}.AttachTo(this.Overlay);
var a = new List<Entry>();
var OverlayReorderingEnabled = true;
#region Timer
this.Timer = (1000 / 30).AtInterval(
delegate
{
a.ForEach(k => k.Tick());
a.OrderBy(k => k.cy).ForEach(
k =>
{
if (OverlayReorderingEnabled)
{
// in javascript reordering an element under mouse
// will leave you without the leave event
// we could sort other nodes around it tho
k.Overlay.Orphanize();
k.Overlay.AttachTo(this.Overlay);
}
k.pc.Orphanize();
k.pc.AttachTo(this.Container);
}
);
}
);
#endregion
var s = 0.01;
this.AddEntry =
e =>
{
var pc_Width = 166 + 9;
var pc_Height = 90 + 9 * 2;
var pc = new Canvas
{
//Background = Brushes.Green,
Width = pc_Width,
Height = pc_Height
}.AttachTo(ContentContainer);
const string Assets = "assets/ScriptCoreLib.Avalon.Carousel";
var p = new Image
{
Width = 166,
Height = 90,
Stretch = Stretch.Fill,
Source = (Assets + "/PreviewShadow.png").ToSource()
}.AttachTo(pc);
var ps = new Image
//.........这里部分代码省略.........