mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
Remove some useless code (again)
Improve some visuals
This commit is contained in:
@@ -1,24 +0,0 @@
|
||||
using System;
|
||||
using Windows.UI.Xaml.Data;
|
||||
|
||||
namespace ModernKeePass.Converters
|
||||
{
|
||||
public class PluralizationConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, string language)
|
||||
{
|
||||
var pluralizationOptionString = parameter as string;
|
||||
var pluralizationOptions = pluralizationOptionString?.Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries);
|
||||
if (pluralizationOptions == null || pluralizationOptions.Length != 2) return string.Empty;
|
||||
var count = value is int ? (int) value : 0;
|
||||
var text = count == 1 ? pluralizationOptions[0] : pluralizationOptions[1];
|
||||
return $"{count} {text}";
|
||||
}
|
||||
|
||||
// No need to implement this
|
||||
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,20 +0,0 @@
|
||||
using System;
|
||||
using Windows.UI.Xaml.Data;
|
||||
|
||||
namespace ModernKeePass.Converters
|
||||
{
|
||||
public class TextToWidthConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, string language)
|
||||
{
|
||||
var fontSize = double.Parse(parameter as string);
|
||||
var text = value as string;
|
||||
return text?.Length * fontSize ?? 0;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,12 +1,10 @@
|
||||
using GalaSoft.MvvmLight;
|
||||
using ModernKeePass.Domain.Dtos;
|
||||
using ModernKeePass.Domain.Interfaces;
|
||||
|
||||
namespace ModernKeePass.ViewModels.ListItems
|
||||
{
|
||||
public class RecentItemVm: ObservableObject, ISelectableModel
|
||||
public class RecentItemVm: ObservableObject
|
||||
{
|
||||
private bool _isSelected;
|
||||
private string _name;
|
||||
private string _token;
|
||||
private string _path;
|
||||
@@ -29,12 +27,6 @@ namespace ModernKeePass.ViewModels.ListItems
|
||||
set { Set(() => Path, ref _path, value); }
|
||||
}
|
||||
|
||||
public bool IsSelected
|
||||
{
|
||||
get { return _isSelected; }
|
||||
set { Set(() => IsSelected, ref _isSelected, value); }
|
||||
}
|
||||
|
||||
public RecentItemVm(FileInfo file)
|
||||
{
|
||||
Token = file.Id;
|
||||
|
@@ -27,9 +27,7 @@
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Converters\IconToSymbolConverter.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Converters\InverseBooleanToVisibilityConverter.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Converters\NullToBooleanConverter.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Converters\PluralizationConverter.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Converters\ProgressBarLegalValuesConverter.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Converters\TextToWidthConverter.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Extensions\ColorExtensions.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Extensions\DispatcherTaskExtensions.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Messages\CredentialsMessage.cs" />
|
||||
|
Reference in New Issue
Block a user