Files
WinWARP/WinWARP.Ui/Converters/ItemInvokedEventArgsConverter.cs
T
2026-08-22 19:11:00 +03:00

27 lines
731 B
C#

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();
}
}