コード例 #1
0
        protected override void OnApplyTemplate()
        {
            Header = GetTemplateChild("Header") as LottieView;

            base.OnApplyTemplate();
            VisualStateManager.GoToState(this, Content != null ? "ContentVisible" : "NoContent", false);
        }
コード例 #2
0
 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);
 }
コード例 #3
0
 protected override void OnApplyTemplate()
 {
     _player = GetTemplateChild("ContentPresenter") as LottieView;
     _player.IsLoopingEnabled  = false;
     _player.IsCachingEnabled  = false;
     _player.IsBackward        = ActualTheme == ElementTheme.Dark;
     _player.FrameSize         = new Size(22, 22);
     _player.DecodeFrameType   = Windows.UI.Xaml.Media.Imaging.DecodePixelType.Logical;
     _player.ColorReplacements = new Dictionary <int, int>
     {
         { 0xffffff, ActualTheme != ElementTheme.Dark ? 0x000000 : 0xffffff }
     };
     _player.Source = new Uri("ms-appx:///Assets/Animations/Sun.tgs");
 }
コード例 #4
0
        protected override void OnApplyTemplate()
        {
            var dpi  = DisplayInformation.GetForCurrentView().LogicalDpi / 96.0f;
            var size = (int)(24 * dpi);

            _player = GetTemplateChild("ContentPresenter") as LottieView;
            _player.IsLoopingEnabled = false;
            _player.IsCachingEnabled = false;
            _player.IsBackward       = ActualTheme == ElementTheme.Dark;
            _player.FrameSize        = new SizeInt32 {
                Width = size, Height = size
            };
            _player.Source = new Uri("ms-appx:///Assets/Animations/Sun.tgs");
        }