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;
How to do it?
You should Enable Popup to have Transparency. Add following line of code.
popUpControl.AllowsTransparency=true;
You need to set the opacity on the popup content.
So for your button have
popUp.Child = new Button()
{
Width = 300,
Height = 50,
Background = Brushes.Gray,
Opacity = 0.5 // set opacity here
};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With