Exemplo n.º 1
0
        public ChatBackgroundPresenter()
        {
            _parallaxEffect = new WallpaperParallaxEffect();
            _container      = new ContentControl {
                HorizontalContentAlignment = HorizontalAlignment.Stretch, VerticalContentAlignment = VerticalAlignment.Stretch, IsTabStop = false
            };
            _container.SizeChanged += OnSizeChanged;

            Children.Add(_container);

            RegisterPropertyChangedCallback(OpacityProperty, OnOpacityChanged);



            _motionVisual = ElementCompositionPreview.GetElementVisual(_container);
            _compositor   = _motionVisual.Compositor;

            ElementCompositionPreview.GetElementVisual(this).Clip = _compositor.CreateInsetClip();
        }
        private async void InitializeMotion()
        {
            _parallaxEffect = new WallpaperParallaxEffect();

            Motion.Visibility = (await _parallaxEffect.IsSupportedAsync()) ? Visibility.Visible : Visibility.Collapsed;
        }