Closed juliecantin closed 1 year ago
Additional info from duplicate issue:
Some styles are set for attached properties, as follows:
<Style TargetType="primitives:TabViewListView">
...
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Disabled" />
<Setter Property="ScrollViewer.HorizontalScrollMode" Value="Enabled" />
<Setter Property="ScrollViewer.IsHorizontalRailEnabled" Value="False" />
<Setter Property="ScrollViewer.VerticalScrollMode" Value="Disabled" />
<Setter Property="ScrollViewer.IsVerticalRailEnabled" Value="False" />
<Setter Property="ScrollViewer.ZoomMode" Value="Disabled" />
<Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False" />
<Setter Property="ScrollViewer.BringIntoViewOnFocusChange" Value="True" />
This is then referenced in the template:
<ScrollViewer x:Name="ScrollViewer"
Grid.Column="1"
AutomationProperties.AccessibilityView="Raw"
BringIntoViewOnFocusChange="{TemplateBinding ScrollViewer.BringIntoViewOnFocusChange}"
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}"
IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}"
IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}"
IsHorizontalScrollChainingEnabled="{TemplateBinding ScrollViewer.IsHorizontalScrollChainingEnabled}"
IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}"
IsVerticalScrollChainingEnabled="{TemplateBinding ScrollViewer.IsVerticalScrollChainingEnabled}"
TabNavigation="{TemplateBinding TabNavigation}"
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}"
ZoomMode="{TemplateBinding ScrollViewer.ZoomMode}"
Style="{StaticResource TabScrollViewerStyle}">
This should work also when the attached property is set in code-behind:
ScrollViewer.SetHorizontalScrollMode(tabListView, Visible);
This is not currently supported in Uno.
Reopened for backport
Backported, done!
Current behavior
This binding works on UWP but not on iOS/Android: HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}"
Expected behavior
TemplateBinding on an attached property works with this syntax.
How to reproduce it (as minimally and precisely as possible)
Clone this repo, checkout branch dev/juca/template-binding and launch the app On Windows, you can scroll to the right. On Android, iOS and WASM, you cannot scroll, because the properties we set in the style are ignored when the TemplateBinding fails.
Environment
Nuget Package:
Package Version(s): 1.45.0 and also 2.1.0-dev.90
Affected platform(s):
Visual Studio:
Relevant plugins:
Anything else we need to know?