/ src / modules / cmdpal / Microsoft.CmdPal.UI / Converters / PlaceholderTextConverter.cs
PlaceholderTextConverter.cs
 1  // Copyright (c) Microsoft Corporation
 2  // The Microsoft Corporation licenses this file to you under the MIT license.
 3  // See the LICENSE file in the project root for more information.
 4  
 5  using Microsoft.UI.Xaml.Data;
 6  using RS_ = Microsoft.CmdPal.UI.Helpers.ResourceLoaderInstance;
 7  
 8  namespace Microsoft.CmdPal.UI;
 9  
10  public partial class PlaceholderTextConverter : IValueConverter
11  {
12      public object Convert(object value, Type targetType, object parameter, string language)
13      {
14          return value is string placeholder && !string.IsNullOrEmpty(placeholder)
15              ? placeholder
16              : (object)RS_.GetString("DefaultSearchPlaceholderText");
17      }
18  
19      public object ConvertBack(object value, Type targetType, object parameter, string language)
20      {
21          throw new NotImplementedException();
22      }
23  }