Frage

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;

Wie es zu tun?

War es hilfreich?

Lösung

Sie müssen die Opazität im Popup-Inhalt setzen.
Also für Ihre Schaltfläche hat

popUp.Child = new Button() 
{
    Width = 300,
    Height = 50,
    Background = Brushes.Gray,
    Opacity = 0.5 // set opacity here
};

Andere Tipps

Sie sollten Popup aktivieren Transparenz haben. Fügen Sie folgende Zeile Code.

popUpControl.AllowsTransparency=true;
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top