Skip to content

Commit 283f388

Browse files
committed
Scrollviewer fixed
1 parent deab674 commit 283f388

2 files changed

Lines changed: 21 additions & 14 deletions

File tree

‎Source/NETworkManager/Resources/Styles/ScrollBarStyles.xaml‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,22 @@
99
</Style.Triggers>
1010
</Style>
1111

12+
<Style x:Key="ListViewScrollBar" TargetType="{x:Type ScrollBar}" BasedOn="{StaticResource MetroScrollBar}">
13+
<Style.Triggers>
14+
<Trigger Property="Orientation" Value="Horizontal">
15+
<Setter Property="Width" Value="Auto"/>
16+
<Setter Property="Height" Value="8" />
17+
</Trigger>
18+
<Trigger Property="Orientation" Value="Vertical">
19+
<Setter Property="Width" Value="8"/>
20+
<Setter Property="Height" Value="Auto" />
21+
</Trigger>
22+
<DataTrigger Binding="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type ListView}}, Path=IsMouseOver}" Value="False">
23+
<Setter Property="Opacity" Value="0.5" />
24+
</DataTrigger>
25+
</Style.Triggers>
26+
</Style>
27+
1228
<Style x:Key="TextBoxScrollBar" TargetType="{x:Type ScrollBar}" BasedOn="{StaticResource MetroScrollBar}">
1329
<Style.Triggers>
1430
<Trigger Property="Orientation" Value="Horizontal">

‎Source/NETworkManager/Views/WiFiView.xaml‎

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,10 @@
128128
</Grid>
129129
</StackPanel>
130130
<TextBlock Grid.Row="1" Text="{x:Static localization:Strings.Networks}" Style="{StaticResource HeaderTextBlock}" />
131-
<ListView Grid.Row="2" Visibility="{Binding IsNetworksLoading, Converter={StaticResource BooleanReverseToVisibilityCollapsedConverter}}" ItemsSource="{Binding NetworksView}" SelectedItem="{Binding SelectedNetwork}" Background="Transparent" BorderThickness="0" SelectionMode="Single">
131+
<ListView Grid.Row="2" Visibility="{Binding IsNetworksLoading, Converter={StaticResource BooleanReverseToVisibilityCollapsedConverter}}" ScrollViewer.PanningMode="VerticalOnly" ItemsSource="{Binding NetworksView}" SelectedItem="{Binding SelectedNetwork}" Background="Transparent" BorderThickness="0" SelectionMode="Single">
132+
<ListView.Resources>
133+
<Style TargetType="{x:Type ScrollBar}" BasedOn="{StaticResource ListViewScrollBar}" />
134+
</ListView.Resources>
132135
<ListView.ItemTemplate>
133136
<DataTemplate>
134137
<Grid Margin="5">
@@ -184,24 +187,12 @@
184187
</Grid>
185188
</DataTemplate>
186189
</ListView.ItemTemplate>
187-
<!-- BUGFIX This has to be set, to enable mouse wheel scrolling -->
188-
<ListView.Template>
189-
<ControlTemplate>
190-
<ItemsPresenter />
191-
</ControlTemplate>
192-
</ListView.Template>
193-
<ListView.ItemsPanel>
194-
<ItemsPanelTemplate>
195-
<VirtualizingStackPanel />
196-
</ItemsPanelTemplate>
197-
</ListView.ItemsPanel>
198-
<!-- /BUGFIX-->
199190
</ListView>
200191
<StackPanel VerticalAlignment="Center" Grid.Row="2" Visibility="{Binding IsNetworksLoading, Converter={StaticResource BooleanToVisibilityCollapsedConverter}}">
201192
<loadingIndicators:LoadingIndicator IsActive="True" Style="{DynamicResource LoadingIndicatorArcsStyle}" SpeedRatio="1" Margin="0,0,0,10"/>
202193
<TextBlock Text="{x:Static localization:Strings.ScanningForNetworksDots}" Style="{StaticResource MessageTextBlock}" />
203194
</StackPanel>
204-
<Grid Grid.Column="0" Grid.Row="2">
195+
<Grid Grid.Column="0" Grid.Row="4">
205196
<Button Grid.Column="2" Command="{Binding ScanNetworksCommand}" Style="{StaticResource ImageWithTextButton}" VerticalAlignment="Bottom" HorizontalAlignment="Right">
206197
<Button.Content>
207198
<Grid>

0 commit comments

Comments
 (0)