tidy the codes
This commit is contained in:
1 parent
e02b420634
commit
97e8d0b8c3
33 files changed
+455
-1319
No files matched your search
@@ -4,7 +4,7 @@ using System.Windows.Data;
|
||||
|
||||
namespace HandyControl.Tools.Converter
|
||||
{
|
||||
public class Boolean2StrConverter : IValueConverter
|
||||
public class Boolean2StringConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@ using System.Windows.Media;
|
||||
|
||||
namespace HandyControl.Tools.Converter
|
||||
{
|
||||
public class Color2HexStrConverter : IValueConverter
|
||||
public class Color2HexStringConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
|
||||
@@ -4,24 +4,27 @@ using System.Windows.Data;
|
||||
|
||||
namespace HandyControl.Tools.Converter
|
||||
{
|
||||
public class Int2StrConverter : IValueConverter
|
||||
public class Int2StringConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (value is int intValue)
|
||||
if (value != null)
|
||||
{
|
||||
if (parameter is string str)
|
||||
if (int.TryParse(value.ToString(), out var intValue))
|
||||
{
|
||||
var arr = str.Split(';');
|
||||
if (arr.Length > intValue)
|
||||
if (parameter is string str)
|
||||
{
|
||||
return arr[intValue];
|
||||
var arr = str.Split(';');
|
||||
if (arr.Length > intValue)
|
||||
{
|
||||
return arr[intValue];
|
||||
}
|
||||
|
||||
return intValue;
|
||||
}
|
||||
|
||||
return intValue;
|
||||
}
|
||||
|
||||
return intValue;
|
||||
}
|
||||
|
||||
return value;
|
||||
|
||||
Reference in new issue
Block a user