SuffixesConverter.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 System; 6 using System.Globalization; 7 using System.Windows.Data; 8 using System.Windows.Markup; 9 10 namespace Microsoft.Plugin.Program 11 { 12 public class SuffixesConverter : MarkupExtension, IValueConverter 13 { 14 public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 15 { 16 if (value is string[] text) 17 { 18 return string.Join(";", text); 19 } 20 else 21 { 22 return string.Empty; 23 } 24 } 25 26 public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 27 { 28 throw new NotSupportedException(); 29 } 30 31 public override object ProvideValue(IServiceProvider serviceProvider) 32 { 33 return this; 34 } 35 } 36 }