public ChatBackgroundPresenter() { _parallaxEffect = new BackgroundParallaxEffect(); _imageBackground = new Rectangle(); _colorBackground = new Rectangle(); _colorBackground.SizeChanged += OnSizeChanged; Children.Add(_colorBackground); Children.Add(_imageBackground); RegisterPropertyChangedCallback(OpacityProperty, OnOpacityChanged); _motionVisual = ElementCompositionPreview.GetElementVisual(_colorBackground); _compositor = _motionVisual.Compositor; ElementCompositionPreview.GetElementVisual(this).Clip = _compositor.CreateInsetClip(); }
private async void InitializeMotion() { _parallaxEffect = new BackgroundParallaxEffect(); Motion.Visibility = (await _parallaxEffect.IsSupportedAsync()) ? Visibility.Visible : Visibility.Collapsed; }