mirror of
https://github.com/bitwarden/mobile
synced 2025-12-23 11:43:49 +00:00
PM-3349 PM-3350 MAUI Migration Initial
This commit is contained in:
33
src/Core/Utilities/IconGlyphConverter.cs
Normal file
33
src/Core/Utilities/IconGlyphConverter.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user