diff --git a/ADIS_Csharp/RobotClientWpf/Utilities/UIAccessHelpers.cs b/ADIS_Csharp/RobotClientWpf/Utilities/UIAccessHelpers.cs index b43aa37..3ab21d9 100644 --- a/ADIS_Csharp/RobotClientWpf/Utilities/UIAccessHelpers.cs +++ b/ADIS_Csharp/RobotClientWpf/Utilities/UIAccessHelpers.cs @@ -3,6 +3,7 @@ using System.Windows; using System.Windows.Controls; using System.Windows.Controls.Primitives; using System.Windows.Media; +using System.Windows.Shapes; namespace RobotClientWpf.Utilities { @@ -99,5 +100,20 @@ namespace RobotClientWpf.Utilities textBlock.Foreground = foregroundColor; } } + + public static void SetShapeVisibility(Shape shape, bool visible) + { + if (!Application.Current.Dispatcher.CheckAccess()) + { + Application.Current.Dispatcher.BeginInvoke(new Action(() => + { + SetShapeVisibility(shape, visible); + })); + } + else + { + shape.Opacity = visible?100:0; + } + } } } diff --git a/ADIS_Csharp/RobotClientWpf/Views/ConfigView.xaml b/ADIS_Csharp/RobotClientWpf/Views/ConfigView.xaml index fc988b3..f5c20be 100644 --- a/ADIS_Csharp/RobotClientWpf/Views/ConfigView.xaml +++ b/ADIS_Csharp/RobotClientWpf/Views/ConfigView.xaml @@ -76,7 +76,7 @@