♻️ 优化滚动条动画 :boom:增加触底切换菜单

This commit is contained in:
BookerLiu
2022-08-02 17:28:09 +08:00
parent aa2ca80822
commit 001270e4ad
12 changed files with 561 additions and 114 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;
}
}
}