Add rectangle & trigger to xaml (#2120)

- added rectangle with backgroundcolor
- added xName for Application ScrollViewer for identification
- added style to rectangle to show itself if horizontal & vertical scrollviewers are shown
This commit is contained in:
MyDrift 2024-06-25 22:15:20 +02:00 committed by GitHub
parent acaad991a7
commit 98f8b07951
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -571,6 +571,18 @@
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ScrollVisibilityRectangle" TargetType="Rectangle">
<Setter Property="Visibility" Value="Collapsed"/>
<Style.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding Path=ComputedHorizontalScrollBarVisibility, ElementName=scrollViewer}" Value="Visible"/>
<Condition Binding="{Binding Path=ComputedVerticalScrollBarVisibility, ElementName=scrollViewer}" Value="Visible"/>
</MultiDataTrigger.Conditions>
<Setter Property="Visibility" Value="Visible"/>
</MultiDataTrigger>
</Style.Triggers>
</Style>
</Window.Resources>
<Grid Background="{MainBackgroundColor}" ShowGridLines="False" Name="WPFMainGrid" Width="Auto" Height="Auto" HorizontalAlignment="Stretch">
<Grid.RowDefinitions>
@ -706,13 +718,15 @@
<Button Name="WPFclearWinget" Content=" Clear Selection" Margin="2"/>
</StackPanel>
<ScrollViewer Grid.Row="1" Grid.Column="0" Padding="-1" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto"
<ScrollViewer x:Name="scrollViewer" Grid.Row="1" Grid.Column="0" Padding="-1" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto"
BorderBrush="Transparent" BorderThickness="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
{{InstallPanel_applications}}
</Grid>
</ScrollViewer>
<Rectangle Grid.Row="1" Grid.Column="0" Width="18" Height="18" Fill="{MainBackgroundColor}" HorizontalAlignment="Right" VerticalAlignment="Bottom" Style="{StaticResource ScrollVisibilityRectangle}"/>
</Grid>
</TabItem>
<TabItem Header="Tweaks" Visibility="Collapsed" Name="WPFTab2">