mayho33
Goto Top

C-Sharp CmdLet und WPF-UserControl.Visibility funktioniert nicht

Hallo @ All

Ich habe ein CmdLet in C# erstellt (liegt als DLL vor) und anschließend ein WPF-UserControl zur Solution hinzugefügt. Beide liegen unter dem gleichen Namespace. Unter anderem gibt es Bindings auf UserControl.Visibility.

Ziel ist es im gleichen Prozess, also solange ein Script läuft das mein CmdLet nutzt, ein Fenster anzuzeigen


Frage:
In der Nachverfolgung wird das Property braf angesteuert und geändert, Das userControll bleibt aber trotzdem unsichtbar.
Testweise habe ich das Binding auch schon auf das Grid gelegt. Hat aber auch nichts gebracht. In einem Testweisen WPF-Project fünktioniert das einwandfrei.

Was mache ich falsch? Ist ein BackgroundWorker notwendig?

XAML:
<UserControl x:Class="NameSpace.ClassName"  
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"  
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"  
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"   
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"   
             xmlns:local="clr-namespace:NameSpace"  
             xmlns:external="clr-namespace:NameSpace"  
             mc:Ignorable="d"   
             Background="White"  
             Width="600"  
             BorderBrush="{Binding Path=BorderBrush_Notification, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"  
             BorderThickness="{Binding Path=BorderThickness_Notification, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"  
             Height="{Binding Path=Height_Notification, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"   
             Visibility="{Binding Path=Visibility_Notification, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"  
             IsEnabled="{Binding Path=Enebility_Notification, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"  
             d:DesignHeight="450" d:DesignWidth="800">  
...
...
/>

Code Behind:
private static Visibility _Visibility_Notification = Visibility.Hidden;
public static Visibility Visibility_Notification
{
    get { return _Visibility_Notification; }
    set { _Visibility_Notification = value; ChangeProperty_STATIC(); }
}


Von CmdLet aus spreche ich das Property so an:

ClassName.Visibility_Notification = System.WindowsVisibility.Visible;


Danke für eure Unterstützung!

Mayho

Content-Key: 582045

Url: https://administrator.de/contentid/582045

Ausgedruckt am: 23.04.2024 um 13:04 Uhr

Mitglied: mayho33
mayho33 13.07.2020 um 11:14:31 Uhr
Goto Top
Hat niemand eine Idee? Vielleicht bin ich ja auf dem Holzweg und das geht so überhaupt nicht.

Danke!