async Task CloudBoxVisibilityChanged() { if (CloudBox.Visible == false) { if (CloudBox.Margin.Left.CurrentValue == 150) { CloudBox.Visible = true; await Task.Delay(1000); await CloudBox.Animate(new Animation { Duration = 1.Seconds(), Change = () => CloudBox.Animate(10.Seconds(), x => x.Margin(left: 50)) }); CloudBox.Visible = false; } else if (CloudBox.Margin.Left.CurrentValue == 50) { CloudBox.Visible = true; await Task.Delay(1000); await CloudBox.Animate(new Animation { Duration = 1.Seconds(), Change = () => CloudBox.Animate(10.Seconds(), x => x.Margin(left: 150)) }); CloudBox.Visible = false; } } }
public override async Task OnInitializing() { await base.OnInitializing(); ForegroundStack.Y.Set(10); await CloudBox.Animate(new Animation { Change = () => CloudBox.Animate(2.Seconds(), x => x.Margin(left: 70), x => x.Visible = false), Repeats = 100 }); }
public override async Task OnInitializing() { await base.OnInitializing(); ForegroundStack.Y.Set(10); await SunBox.Animate(new Animation { Duration = 100000.Milliseconds(), Change = () => SunBox.Rotation(360), Repeats = 600 }); await CloudBox.Animate(new Animation { Change = () => CloudBox.Animate(2.Seconds(), x => x.Margin(left: 150), x => x.Visible = false), Repeats = 100 }); }