From 90979cbecb04a1a2c91ad0593a0bd0defe387807 Mon Sep 17 00:00:00 2001 From: donlaci Date: Wed, 19 Jun 2024 14:58:29 +0200 Subject: [PATCH] [projects] Adding info message for cases: there are no projects or no results for the search --- .../BooleanToInvertedVisibilityConverter.cs | 29 +++++++++++++++++++ .../Projects/ProjectsEditor/MainPage.xaml | 14 +++++++-- .../Properties/Resources.Designer.cs | 9 ++++++ .../ProjectsEditor/Properties/Resources.resx | 3 ++ .../ViewModels/MainViewModel.cs | 19 +++++++++++- 5 files changed, 71 insertions(+), 3 deletions(-) create mode 100644 src/modules/Projects/ProjectsEditor/Converters/BooleanToInvertedVisibilityConverter.cs 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