Skip to content

Commit

Permalink
🐛 修复列表显示不全的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
BookerLiu committed Apr 17, 2023
1 parent dd41635 commit 6072832
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions Constant/WidthTypeEnum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ public enum WidthTypeEnum
RIGHT_CARD_HALF_TEXT = 3, //右侧托盘宽度的一半 再减去左侧图像宽度
RIGHT_CARD_20 = 4, //右侧托盘宽度 - 20
RIGHT_CARD_40 = 5, //右侧托盘宽度 - 40
RIGHT_CARD_70 = 6, //右侧托盘宽度 - 70
}
}
6 changes: 2 additions & 4 deletions Control/UserControls/PannelCard/RightCardControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,7 @@
>
<Border BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderBrush}"
Width="{Binding AppConfig.WindowWidth, Mode=OneWay,
Converter={StaticResource GetWidthByWWConvert},
ConverterParameter={x:Static cst:WidthTypeEnum.RIGHT_CARD_40}}"

>
<ItemsPresenter/>
</Border>
Expand All @@ -212,7 +210,7 @@
VirtualizingPanel.ScrollUnit="Pixel"
Width="{Binding AppConfig.WindowWidth, Mode=OneWay,
Converter={StaticResource GetWidthByWWConvert},
ConverterParameter={x:Static cst:WidthTypeEnum.RIGHT_CARD_40}}"
ConverterParameter={x:Static cst:WidthTypeEnum.RIGHT_CARD_70}}"
/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
Expand Down
8 changes: 8 additions & 0 deletions Converts/GetWidthByWWConvert.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ public object Convert(object value, Type targetType, object parameter, CultureIn
{
return (config.WindowWidth - config.MenuCardWidth) - 20;
}
else if (WidthTypeEnum.RIGHT_CARD_40 == type)
{
return (config.WindowWidth - config.MenuCardWidth) - 40;
}
else if (WidthTypeEnum.RIGHT_CARD_70 == type)
{
return (config.WindowWidth - config.MenuCardWidth) - 70;
}

return config.WindowWidth;
}
Expand Down

0 comments on commit 6072832

Please sign in to comment.