Files
GeekDesk/Converts/SearchResWidth.cs

34 lines
982 B
C#
Raw Normal View History

2022-03-25 16:24:03 +08:00
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
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
{
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;
}
}
}