AvaloniaUI 中的 WPF CompositionTarget.Rendering 替代品

来源: https://github.com/AvaloniaUI/Avalonia/discussions/13697

2024-3-9 实测可用

 1 public MainWindow()
 2 {
 3     InitializeComponent();
 4     RequestAnimationFrame(Tick);
 5 }
 6 
 7 public void Tick(TimeSpan time) // total elapsed time, not frame time
 8 {
 9     textBlock.Text = time.TotalMilliseconds.ToString();
10     RequestAnimationFrame(Tick);
11 }
posted @ 2024-03-09 00:37  xiejiang  阅读(60)  评论(0编辑  收藏  举报