2024-02-13 02:59:40 +01:00
|
|
|
|
using Microsoft.UI.Xaml.Data;
|
|
|
|
|
|
using Microsoft.UI.Xaml;
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
2022-02-26 14:32:34 +01:00
|
|
|
|
|
2024-02-13 02:59:40 +01:00
|
|
|
|
namespace VDownload.GUI.Converters
|
2022-02-26 14:32:34 +01:00
|
|
|
|
{
|
|
|
|
|
|
public class StringToVisibilityConverter : IValueConverter
|
|
|
|
|
|
{
|
|
|
|
|
|
public object Convert(object value, Type targetType, object parameter, string language)
|
|
|
|
|
|
{
|
2024-02-13 02:59:40 +01:00
|
|
|
|
if (value is not string str || string.IsNullOrWhiteSpace(str))
|
2022-02-26 14:32:34 +01:00
|
|
|
|
{
|
|
|
|
|
|
return Visibility.Collapsed;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
return Visibility.Visible;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|