Good evening everyone! I am trying to initialize a new VisualElement element, but for some reason it remains empty. How can this be? Below is the code to do it.

VisualElement vs = new VisualElement { X = MapsElement._PositionX, Y = MapsElement._PositionY, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Bottom, UIElement = new System.Windows.Controls.Image { Source = new BitmapImage(uri), Width = MapsElement._ElementWidth, Height = MapsElement._ElementHeight, Opacity = opacity, IsHitTestVisible = true } }; 
  • And what is the VisualElement class? - VladD
  • Did you add it to VisualTree? - Leonid Malyshev

0