Files
GeekDesk/Converts/SearchResWidth.cs

30 lines
870 B
C#
Raw Normal View History

2022-03-25 16:24:03 +08:00
using System;
using System.Globalization;
using System.Windows.Data;
namespace GeekDesk.Converts
{
class SearchResWidth : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
2022-04-08 16:05:48 +08:00
string param = parameter as string;
if ("1".Equals(param))
{
double menuLeftWidth = double.Parse(value.ToString());
return MainWindow.mainWindow.Width - menuLeftWidth;
}
else
2022-04-08 16:05:48 +08:00
{
double menuLeftWidth = double.Parse(value.ToString());
return (MainWindow.mainWindow.Width - menuLeftWidth) / 2;
}
2022-03-25 16:24:03 +08:00
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return null;
}
}
}