🚑 修复可能导致输入法特定场景卡顿的问题

This commit is contained in:
BookerLiu
2022-08-30 09:06:27 +08:00
parent cbaeb71a0c
commit e82af431b5
31 changed files with 2687 additions and 430 deletions

View File

@@ -0,0 +1,40 @@
using GeekDesk.Constant;
using GeekDesk.ViewModel;
using System;
using System.Globalization;
using System.Windows.Data;
namespace GeekDesk.Converts
{
/// <summary>
/// 根据主窗口width 和传入类型 获取其它宽度
/// </summary>
class GetWidthByWWConvert : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
WidthTypeEnum type = (WidthTypeEnum)parameter;
AppConfig config = MainWindow.appData.AppConfig;
if (WidthTypeEnum.LEFT_CARD == type)
{
return config.MenuCardWidth;
}
else if (WidthTypeEnum.RIGHT_CARD == type)
{
return config.WindowWidth - config.MenuCardWidth;
} else if (WidthTypeEnum.RIGHT_CARD_HALF == type)
{
return (config.WindowWidth - config.MenuCardWidth) / 2;
}
return config.WindowWidth;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return null;
}
}
}