diff --git a/src/modules/Projects/ProjectsEditor/Converters/BooleanToInvertedVisibilityConverter.cs b/src/modules/Projects/ProjectsEditor/Converters/BooleanToInvertedVisibilityConverter.cs new file mode 100644 index 0000000000..1714df9d22 --- /dev/null +++ b/src/modules/Projects/ProjectsEditor/Converters/BooleanToInvertedVisibilityConverter.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Globalization; +using System.Windows; +using System.Windows.Data; + +namespace ProjectsEditor.Converters +{ + public class BooleanToInvertedVisibilityConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if ((bool)value) + { + return Visibility.Collapsed; + } + + return Visibility.Visible; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/src/modules/Projects/ProjectsEditor/MainPage.xaml b/src/modules/Projects/ProjectsEditor/MainPage.xaml index a3a8eb16f9..5e827ad797 100644 --- a/src/modules/Projects/ProjectsEditor/MainPage.xaml +++ b/src/modules/Projects/ProjectsEditor/MainPage.xaml @@ -5,11 +5,14 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:props="clr-namespace:ProjectsEditor.Properties" + xmlns:converters="clr-namespace:ProjectsEditor.Converters" xmlns:local="clr-namespace:ProjectsEditor" mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800" Title="MainPage"> + + 24,16,0,24 0,24,24,0