using Avalonia; using Avalonia.Animation.Easings; using Avalonia.Animation; using Avalonia.Controls; using Avalonia.Markup.Xaml; using Avalonia.Media; using Avalonia.Styling; using AvaloniaApplicationKuzminIV.Models; using AvaloniaApplicationKuzminIV.ViewModels; using System; using System.Collections.Generic; namespace AvaloniaApplicationKuzminIV; public partial class UserControl1 : UserControl { public UserControl1() { InitializeComponent(); DataContext = new PageStartAdminViewModel(); } private void InitializeComponent() { AvaloniaXamlLoader.Load(this); } //private void StartColorAnimation() //{ // var textBlock = this.FindControl("ColorfulText"); // var animation = new Animation // { // Duration = TimeSpan.FromSeconds(5), // IterationCount = IterationCount.Infinite, // Easing = new SplineEasing(0.4, 0.0, 0.2, 1.0), // Children = // { // new KeyFrame // { // Cue = new Cue(0), // Setters = { new Setter(TextBlock.ForegroundProperty, Brushes.Red) } // }, // new KeyFrame // { // Cue = new Cue(0.33), // Setters = { new Setter(TextBlock.ForegroundProperty, Brushes.Green) } // }, // new KeyFrame // { // Cue = new Cue(0.66), // Setters = { new Setter(TextBlock.ForegroundProperty, Brushes.Blue) } // }, // new KeyFrame // { // Cue = new Cue(1), // Setters = { new Setter(TextBlock.ForegroundProperty, Brushes.Red) } // } // } // }; // animation.RunAsync(textBlock, null); //} }