mirror of
https://github.com/bitwarden/mobile
synced 2025-12-23 11:43:49 +00:00
34 lines
893 B
C#
34 lines
893 B
C#
using System;
|
|
using System.Globalization;
|
|
using Bit.Core.Models.View;
|
|
using Microsoft.Maui.Controls;
|
|
using Microsoft.Maui;
|
|
|
|
namespace Bit.App.Utilities
|
|
{
|
|
public class IconGlyphConverter : IValueConverter
|
|
{
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
if (value is CipherView cipher)
|
|
{
|
|
return cipher.GetIcon();
|
|
}
|
|
|
|
if (value is bool boolVal
|
|
&&
|
|
parameter is BooleanGlyphType boolGlyphType)
|
|
{
|
|
return IconGlyphExtensions.GetBooleanIconGlyph(boolVal, boolGlyphType);
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
}
|