diff --git a/VirtualListView/Platforms/Windows/VirtualListViewHandler.windows.cs b/VirtualListView/Platforms/Windows/VirtualListViewHandler.windows.cs index c6ccb7d..9c0d766 100644 --- a/VirtualListView/Platforms/Windows/VirtualListViewHandler.windows.cs +++ b/VirtualListView/Platforms/Windows/VirtualListViewHandler.windows.cs @@ -4,6 +4,7 @@ using WGrid = Microsoft.UI.Xaml.Controls.Grid; using WVisibility = Microsoft.UI.Xaml.Visibility; using WFrameworkElement = Microsoft.UI.Xaml.FrameworkElement; +using WScrollBarVisibility = Microsoft.UI.Xaml.Controls.ScrollBarVisibility; using Microsoft.Maui.Platform; using Microsoft.UI.Xaml; @@ -164,4 +165,26 @@ void UpdateEmptyView() UpdateEmptyViewVisibility(); } + + void UpdateVerticalScrollbarVisibility(ScrollBarVisibility scrollBarVisibility) + { + scrollViewer.VerticalScrollBarVisibility = scrollBarVisibility switch + { + ScrollBarVisibility.Default => WScrollBarVisibility.Auto, + ScrollBarVisibility.Always => WScrollBarVisibility.Visible, + ScrollBarVisibility.Never => WScrollBarVisibility.Hidden, + _ => WScrollBarVisibility.Auto + }; + } + + void UpdateHorizontalScrollbarVisibility(ScrollBarVisibility scrollBarVisibility) + { + scrollViewer.HorizontalScrollBarVisibility = scrollBarVisibility switch + { + ScrollBarVisibility.Default => WScrollBarVisibility.Auto, + ScrollBarVisibility.Always => WScrollBarVisibility.Visible, + ScrollBarVisibility.Never => WScrollBarVisibility.Hidden, + _ => WScrollBarVisibility.Auto + }; + } }