Popup popUpControl = new Popup(); popUpControl.PlacementTarget = this; popUpControl.StaysOpen = true; popUpControl.Child = new MyUserControl(); /// my user control popUpControl.Opacity = 0.5; // this code has no effect in the appearance of the popup popUpControl.IsOpen = true;
Как это сделать?
Вы должны включить всплывающее окно, чтобы иметь прозрачность. Добавьте следующую строку кода.
popUpControl.AllowsTransparency=true;
Вам нужно установить прозрачность всплывающего содержимого. Так что для вашей кнопки есть
popUp.Child = new Button() { Width = 300, Height = 50, Background = Brushes.Gray, Opacity = 0.5 // set opacity here };