Crunchy-Downloader/CRD/Utils/UI/UiListHasElementsConverter.cs
Elwador 93244a749f Add - Added **Skip Unmonitored Sonarr Episodes** option to settings
Add - Added **Include Crunchyroll Artists (Music)** in history to settings for expanded tracking
Add - Added **filters to history tab** to hide series or artists for a cleaner view
Add - Added a **toggle to include featured music** in series search results
Chg - Made small changes to **sync timing** to more accurately detect delays
Chg - Migrated settings to json file
Fix - Fixed a **sync timing issue** with longer comparison videos to ensure proper synchronization
Fix - Fixed issues with artist urls
2025-01-29 19:57:20 +01:00

26 lines
No EOL
859 B
C#

using System;
using System.Collections;
using System.Globalization;
using Avalonia.Data.Converters;
namespace CRD.Utils.UI;
public class UiListHasElementsConverter : IValueConverter{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture){
if (value is IEnumerable enumerable){
// Check if the collection has any elements
foreach (var _ in enumerable){
return true; // At least one element exists
}
return false; // No elements
}
// Return false if the input is not a collection or is null
return false;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture){
throw new NotSupportedException("ListToBooleanConverter does not support ConvertBack.");
}
}