public MainWindow() { InitializeComponent(); CreatePopup(true); CreatePopup(false); } private void CreatePopup(bool hasChild) { Popup popup = new Popup(); popup.Width = 200; popup.Height = 200; popup.HorizontalOffset = 500; popup.VerticalOffset = 50; if (hasChild) { var tb = new TextBlock() { Text = "TextBlock1", Background = Brushes.Yellow, Width = 200, Height = 200 }; tb.FlowDirection = FlowDirection.LeftToRight; popup.Child = tb; } popup.StaysOpen = true; popup.IsOpen = true; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)