wpfui
wpfui copied to clipboard
Vertical Scrollbar doesn't appear and Scrolling is disabled when WPF UI Style is applied (window-wide)
Describe the bug
Problem was described in this pull request:
https://github.com/lepoco/wpfui/pull/76
To Reproduce
Steps to reproduce the behavior:
- Create a Grid
- Put a TreeView into it
- use WPF UI Themes in Window.ResourceDictionary
- add more items to the screen than can fit into it
- run
Expected behavior
A vertical scrollbar should appear when content takes more space than TreeView got from its parent layout (e.g., Grid)
Screenshots
If applicable, add screenshots to help explain your problem.
As you can see here, vertical scrollbar doesn't exist.
Desktop (please complete the following information):
- OS: Windows 11 22H2 RP
- .NET: .NET 6.02 x64
- Version: 2.02 (latest)
Additional context
Add any other context about the problem here.
I've ultimately got style for TreeView from here: https://docs.microsoft.com/en-us/dotnet/desktop/wpf/controls/treeview-styles-and-templates?view=netframeworkdesktop-4.8
This helped me to get what I've needed but I've found this solution only after analyzing control tree in running app and learned that VerticalScrollBar wasn't even enabled (even though I've specifically told the ScrollViewer of the TreeView to set visibility of Vertical Scroll Bar to Visible.
+1 Unfortunately, i have the exact same Problem. Thanks to @danielkornev.
Adding
<Style TargetType="TreeView"> <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" /> </Style>
to <TreeView.Resources> </TreeView.Resources> fixed it for now.
+1 Unfortunately, i have the exact same Problem. Thanks to @danielkornev.
Adding
<Style TargetType="TreeView"> <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" /> </Style>to <TreeView.Resources> </TreeView.Resources> fixed it for now.
By this style you completely eliminate the TreeView style from Wpf.UI library. You should add BaseOn to run DefaultTreeViewStyle overriding.
Thank you very much. Using "BaseOn" made it