|
3 | 3 | xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
4 | 4 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
5 | 5 | xmlns:components="clr-namespace:InternetTest.Components" |
| 6 | + xmlns:converters="clr-namespace:InternetTest.Converters" |
6 | 7 | xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
7 | 8 | xmlns:lang="clr-namespace:InternetTest.Properties" |
8 | 9 | xmlns:local="clr-namespace:InternetTest.Views" |
|
16 | 17 | <Grid> |
17 | 18 | <Grid.Resources> |
18 | 19 | <BooleanToVisibilityConverter x:Key="BoolToVis" /> |
| 20 | + <converters:InverseBoolToVisibilityConverter x:Key="InverseBoolToVis" /> |
19 | 21 | </Grid.Resources> |
20 | 22 | <Grid.RowDefinitions> |
21 | 23 | <RowDefinition Height="Auto" /> |
|
106 | 108 | <RowDefinition Height="Auto" /> |
107 | 109 | <RowDefinition /> |
108 | 110 | </Grid.RowDefinitions> |
| 111 | + <Grid.ColumnDefinitions> |
| 112 | + <ColumnDefinition /> |
| 113 | + <ColumnDefinition Width="Auto" /> |
| 114 | + </Grid.ColumnDefinitions> |
109 | 115 | <StackPanel> |
110 | 116 | <StackPanel Orientation="Horizontal"> |
111 | 117 | <TextBlock |
|
123 | 129 | <TextBlock Foreground="{DynamicResource DarkGray}" Text="{x:Static lang:Resources.AvailableNetworksDesc}" /> |
124 | 130 | </StackPanel> |
125 | 131 |
|
126 | | - <ItemsControl Grid.Row="1" ItemsSource="{Binding WiFiNetworks}"> |
| 132 | + <Button |
| 133 | + Grid.Column="1" |
| 134 | + Padding="5" |
| 135 | + VerticalAlignment="Center" |
| 136 | + Background="Transparent" |
| 137 | + Command="{Binding RefreshWiFiCommand}" |
| 138 | + Content="" |
| 139 | + Cursor="Hand" |
| 140 | + FontFamily="..\Fonts\#FluentSystemIcons-Regular" |
| 141 | + Foreground="{DynamicResource Foreground1}"> |
| 142 | + <Button.ToolTip> |
| 143 | + <ToolTip Content="{x:Static lang:Resources.Refresh}" /> |
| 144 | + </Button.ToolTip> |
| 145 | + </Button> |
| 146 | + |
| 147 | + <ItemsControl |
| 148 | + Grid.Row="1" |
| 149 | + Grid.ColumnSpan="2" |
| 150 | + ItemsSource="{Binding WiFiNetworks}" |
| 151 | + Visibility="{Binding IsRefreshing, Converter={StaticResource InverseBoolToVis}}"> |
127 | 152 | <ItemsControl.ItemsPanel> |
128 | 153 | <ItemsPanelTemplate> |
129 | 154 | <StackPanel /> |
|
135 | 160 | </DataTemplate> |
136 | 161 | </ItemsControl.ItemTemplate> |
137 | 162 | </ItemsControl> |
| 163 | + <StackPanel |
| 164 | + x:Name="ScanningPanel" |
| 165 | + Grid.Row="2" |
| 166 | + HorizontalAlignment="Center" |
| 167 | + VerticalAlignment="Center" |
| 168 | + Visibility="{Binding IsRefreshing, Converter={StaticResource BoolToVis}}"> |
| 169 | + <TextBlock |
| 170 | + HorizontalAlignment="Center" |
| 171 | + FontFamily="../Fonts/#FluentSystemIcons-Regular" |
| 172 | + FontSize="48" |
| 173 | + Foreground="{DynamicResource Accent}" |
| 174 | + RenderTransformOrigin="0.5,0.5" |
| 175 | + Text=""> |
| 176 | + <TextBlock.RenderTransform> |
| 177 | + <RotateTransform x:Name="SpinTransform" Angle="0" /> |
| 178 | + </TextBlock.RenderTransform> |
| 179 | + |
| 180 | + <TextBlock.Triggers> |
| 181 | + <EventTrigger RoutedEvent="TextBlock.Loaded"> |
| 182 | + <BeginStoryboard> |
| 183 | + <Storyboard> |
| 184 | + <DoubleAnimation |
| 185 | + RepeatBehavior="Forever" |
| 186 | + Storyboard.TargetName="SpinTransform" |
| 187 | + Storyboard.TargetProperty="Angle" |
| 188 | + From="0" |
| 189 | + To="360" |
| 190 | + Duration="0:0:1" /> |
| 191 | + </Storyboard> |
| 192 | + </BeginStoryboard> |
| 193 | + </EventTrigger> |
| 194 | + </TextBlock.Triggers> |
| 195 | + </TextBlock> |
| 196 | + <TextBlock |
| 197 | + HorizontalAlignment="Center" |
| 198 | + Text="{x:Static lang:Resources.ScanningInProgress}" |
| 199 | + TextWrapping="Wrap" /> |
| 200 | + </StackPanel> |
| 201 | + <StackPanel |
| 202 | + x:Name="NoNetworksPanel" |
| 203 | + Grid.Row="2" |
| 204 | + HorizontalAlignment="Center" |
| 205 | + VerticalAlignment="Center" |
| 206 | + Visibility="{Binding NoNetworks, Converter={StaticResource BoolToVis}}"> |
| 207 | + <TextBlock |
| 208 | + HorizontalAlignment="Center" |
| 209 | + FontFamily="../Fonts/#FluentSystemIcons-Regular" |
| 210 | + FontSize="48" |
| 211 | + Text="ﭩ" /> |
| 212 | + <TextBlock |
| 213 | + HorizontalAlignment="Center" |
| 214 | + Text="{x:Static lang:Resources.NoNetworks}" |
| 215 | + TextWrapping="Wrap" /> |
| 216 | + </StackPanel> |
138 | 217 | </Grid> |
139 | 218 |
|
140 | 219 | </Border> |
|
0 commit comments