private void OnActualThemeChanged(FrameworkElement sender, object args) { if (_player != null) { _player.SetPosition(ActualTheme != ElementTheme.Dark ? 1 : 0); _player.Play(ActualTheme != ElementTheme.Dark); } }
protected override void OnApplyTemplate() { _player = GetTemplateChild("ContentPresenter") as LottieView; _player.IsLoopingEnabled = false; _player.IsCachingEnabled = false; _player.FrameSize = new SizeInt32 { Width = 40, Height = 40 }; _player.Source = new Uri("ms-appx:///Assets/Animations/Sun.tgs"); _player.SetPosition(ActualTheme == ElementTheme.Dark ? 1 : 0); }