Initial commit

This commit is contained in:
2026-08-22 19:11:00 +03:00 Unverified
commit db368674d4
74 changed files with 2739 additions and 0 deletions
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Data;
namespace WinWARP.Ui.Converters;
public class ItemInvokedEventArgsConverter : IValueConverter
{
public object? Convert(object value, Type targetType, object parameter, string language)
{
if (value is NavigationViewItemInvokedEventArgs args)
{
if (args.InvokedItemContainer?.Tag is Type viewModelType)
{
return viewModelType;
}
}
return null;
}
public object ConvertBack(object value, Type targetType, object parameter, string language)
{
throw new NotImplementedException();
}
}
@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using Microsoft.UI.Xaml.Data;
namespace WinWARP.Ui.Converters;
public class LanguageCodeToNameConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
if (value is string languageCode && !string.IsNullOrWhiteSpace(languageCode))
{
try
{
CultureInfo culture = new CultureInfo(languageCode);
// DisplayName returns "English (United States)"
// NativeName returns "English (United States)" or "Español (España)"
return culture.NativeName;
}
catch (CultureNotFoundException)
{
return value;
}
}
return string.Empty;
}
public object ConvertBack(object value, Type targetType, object parameter, string language)
{
throw new NotImplementedException();
}
}