Remove LocationConverter

This commit is contained in:
Vic 2022-12-07 01:09:26 +08:00
parent 7bc4cfb964
commit 7362bd26cf
3 changed files with 1 additions and 36 deletions

View file

@ -1,33 +0,0 @@
using System;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Markup;
namespace Flow.Launcher.Plugin.Program
{
public class LocationConverter : MarkupExtension, IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var text = value as string;
if (string.IsNullOrEmpty(text))
{
return string.Empty;
}
else
{
return text;
}
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotSupportedException();
}
public override object ProvideValue(IServiceProvider serviceProvider)
{
return this;
}
}
}

View file

@ -101,7 +101,6 @@ namespace Flow.Launcher.Plugin.Program.ViewModels
public (bool, string) UpdateProgramSource()
{
// Separate checks to avoid changing UniqueIdentifier of UWP when changing Enabled
if (LocationModified)
{
if (!Directory.Exists(Location))

View file

@ -4,7 +4,6 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:program="clr-namespace:Flow.Launcher.Plugin.Program"
Height="520"
DataContext="{Binding RelativeSource={RelativeSource Self}}"
mc:Ignorable="d">
@ -172,7 +171,7 @@
<GridViewColumn Width="550" Header="{DynamicResource flowlauncher_plugin_program_location}">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Location, ConverterParameter=(null), Converter={program:LocationConverter}}" />
<TextBlock Text="{Binding Location}" />
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>