|
1312 | 1312 | </TextBox.Text> |
1313 | 1313 | </TextBox> |
1314 | 1314 | <TextBlock Grid.Column="0" Grid.Row="2" Text="{x:Static localization:Strings.Host}" /> |
1315 | | - <TextBox x:Name="TextBoxHost" Grid.Column="2" Grid.Row="2" |
1316 | | - mah:TextBoxHelper.Watermark="{x:Static localization:StaticStrings.ExampleHostnameOrIPAddress}"> |
1317 | | - <TextBox.Text> |
1318 | | - <Binding Path="Host" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged"> |
1319 | | - <Binding.ValidationRules> |
1320 | | - <validators:EmptyValidator ValidatesOnTargetUpdated="True" /> |
1321 | | - <validators:IPAddressOrHostnameValidator |
1322 | | - ValidatesOnTargetUpdated="True" /> |
1323 | | - </Binding.ValidationRules> |
1324 | | - </Binding> |
1325 | | - </TextBox.Text> |
1326 | | - </TextBox> |
1327 | | - <Button Grid.Column="3" Grid.Row="2" Command="{Binding ResolveHostCommand}" |
1328 | | - ToolTip="{x:Static localization:Strings.ResolveIPAddressForThisHost}" |
1329 | | - IsEnabled="{Binding Host, Converter={StaticResource StringIsNotNullOrEmptyOrIPv4AddressToBooleanConverter}}" |
1330 | | - Margin="10,0,0,0"> |
1331 | | - <Button.Style> |
1332 | | - <Style TargetType="{x:Type Button}" BasedOn="{StaticResource CleanButton}"> |
1333 | | - <Style.Triggers> |
1334 | | - <DataTrigger Binding="{Binding IsResolveHostnameRunning}" Value="True"> |
1335 | | - <Setter Property="Visibility" Value="Collapsed" /> |
1336 | | - </DataTrigger> |
1337 | | - <DataTrigger Binding="{Binding ShowCouldNotResolveHostnameWarning}" |
1338 | | - Value="True"> |
1339 | | - <Setter Property="Visibility" Value="Collapsed" /> |
1340 | | - </DataTrigger> |
1341 | | - </Style.Triggers> |
1342 | | - </Style> |
1343 | | - </Button.Style> |
1344 | | - <Rectangle Width="24" Height="24"> |
1345 | | - <Rectangle.OpacityMask> |
1346 | | - <VisualBrush Stretch="Uniform" Visual="{iconPacks:Material Kind=SearchWeb}" /> |
1347 | | - </Rectangle.OpacityMask> |
1348 | | - <Rectangle.Style> |
1349 | | - <Style TargetType="{x:Type Rectangle}"> |
1350 | | - <Setter Property="Fill" Value="{DynamicResource MahApps.Brushes.Gray3}" /> |
| 1315 | + <Grid Grid.Column="2" Grid.Row="2"> |
| 1316 | + <Grid.ColumnDefinitions> |
| 1317 | + <ColumnDefinition Width="*" /> |
| 1318 | + <ColumnDefinition Width="10" /> |
| 1319 | + <ColumnDefinition Width="Auto" /> |
| 1320 | + </Grid.ColumnDefinitions> |
| 1321 | + <TextBox x:Name="TextBoxHost" Grid.Column="0" Grid.Row="0" |
| 1322 | + mah:TextBoxHelper.Watermark="{x:Static localization:StaticStrings.ExampleHostnameOrIPAddress}"> |
| 1323 | + <TextBox.Text> |
| 1324 | + <Binding Path="Host" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged"> |
| 1325 | + <Binding.ValidationRules> |
| 1326 | + <validators:EmptyValidator ValidatesOnTargetUpdated="True" /> |
| 1327 | + <validators:IPAddressOrHostnameValidator |
| 1328 | + ValidatesOnTargetUpdated="True" /> |
| 1329 | + </Binding.ValidationRules> |
| 1330 | + </Binding> |
| 1331 | + </TextBox.Text> |
| 1332 | + </TextBox> |
| 1333 | + <Button Grid.Column="2" Grid.Row="0" |
| 1334 | + Command="{Binding ResolveHostCommand}" |
| 1335 | + ToolTip="{x:Static localization:Strings.ResolveIPAddressForThisHost}"> |
| 1336 | + <Button.Resources> |
| 1337 | + <Style TargetType="{x:Type Button}" BasedOn="{StaticResource ImageButton}"> |
| 1338 | + <Setter Property="MinHeight" Value="0" /> |
| 1339 | + <Setter Property="MinWidth" Value="0" /> |
| 1340 | + <Setter Property="Width" Value="{Binding ElementName=TextBoxHost, Path=ActualHeight}" /> |
| 1341 | + <Setter Property="Height" Value="{Binding ElementName=TextBoxHost, Path=ActualHeight}" /> |
1351 | 1342 | <Style.Triggers> |
1352 | | - <DataTrigger |
1353 | | - Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Button}}, Path=IsMouseOver}" |
1354 | | - Value="True"> |
1355 | | - <Setter Property="Fill" |
1356 | | - Value="{DynamicResource MahApps.Brushes.Gray5}" /> |
| 1343 | + <DataTrigger Binding="{Binding Host, Converter={StaticResource StringIsNotNullOrEmptyOrIPv4AddressToBooleanConverter}}" Value="False"> |
| 1344 | + <Setter Property="IsEnabled" Value="False" /> |
| 1345 | + </DataTrigger> |
| 1346 | + <DataTrigger Binding="{Binding IsResolveHostnameRunning}" Value="True"> |
| 1347 | + <Setter Property="IsEnabled" Value="False" /> |
1357 | 1348 | </DataTrigger> |
1358 | 1349 | </Style.Triggers> |
1359 | 1350 | </Style> |
1360 | | - </Rectangle.Style> |
1361 | | - </Rectangle> |
1362 | | - </Button> |
| 1351 | + </Button.Resources> |
| 1352 | + <Rectangle Width="20" Height="20" Fill="{DynamicResource MahApps.Brushes.Gray3}"> |
| 1353 | + <Rectangle.OpacityMask> |
| 1354 | + <VisualBrush Stretch="Uniform" Visual="{iconPacks:Material Kind=SearchWeb}" /> |
| 1355 | + </Rectangle.OpacityMask> |
| 1356 | + </Rectangle> |
| 1357 | + </Button> |
| 1358 | + </Grid> |
1363 | 1359 | <mah:ProgressRing Grid.Column="3" Grid.Row="2" Width="24" Height="24" Margin="10,0,0,0" |
1364 | 1360 | Visibility="{Binding IsResolveHostnameRunning, Converter={StaticResource BooleanToVisibilityCollapsedConverter}}" /> |
1365 | 1361 | <Rectangle Width="24" Height="24" Grid.Column="3" Grid.Row="2" |
|
1396 | 1392 | </ComboBox.Text> |
1397 | 1393 | </ComboBox> |
1398 | 1394 | <TextBlock Grid.Column="0" Grid.Row="8" Text="{x:Static Member=localization:Strings.Tags}" /> |
1399 | | - <TextBox Grid.Column="2" Grid.Row="8" |
1400 | | - Text="{Binding Path=Tags, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" |
1401 | | - mah:TextBoxHelper.Watermark="{x:Static Member=localization:StaticStrings.ExampleTags}" /> |
| 1395 | + <Grid Grid.Column="2" Grid.Row="8"> |
| 1396 | + <Grid.ColumnDefinitions> |
| 1397 | + <ColumnDefinition Width="*" /> |
| 1398 | + <ColumnDefinition Width="10" /> |
| 1399 | + <ColumnDefinition Width="Auto" /> |
| 1400 | + </Grid.ColumnDefinitions> |
| 1401 | + <TextBox Grid.Column="0" Grid.Row="0" |
| 1402 | + x:Name="TextBoxTag" |
| 1403 | + Text="{Binding Path=Tag, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" |
| 1404 | + mah:TextBoxHelper.Watermark="{x:Static Member=localization:Strings.ExampleTag}" /> |
| 1405 | + <Button Grid.Column="2" Grid.Row="0" Command="{Binding AddTagCommand}" |
| 1406 | + ToolTip="{x:Static localization:Strings.AddTag}"> |
| 1407 | + <Button.Resources> |
| 1408 | + <Style TargetType="{x:Type Button}" BasedOn="{StaticResource ImageButton}"> |
| 1409 | + <Setter Property="MinHeight" Value="0" /> |
| 1410 | + <Setter Property="MinWidth" Value="0" /> |
| 1411 | + <Setter Property="Width" Value="{Binding ElementName=TextBoxTag, Path=ActualHeight}" /> |
| 1412 | + <Setter Property="Height" Value="{Binding ElementName=TextBoxTag, Path=ActualHeight}" /> |
| 1413 | + <Style.Triggers> |
| 1414 | + <MultiDataTrigger> |
| 1415 | + <MultiDataTrigger.Conditions> |
| 1416 | + <Condition |
| 1417 | + Binding="{Binding Path=(Validation.HasError), ElementName=TextBoxTag}" |
| 1418 | + Value="True" /> |
| 1419 | + </MultiDataTrigger.Conditions> |
| 1420 | + <MultiDataTrigger.Setters> |
| 1421 | + <Setter Property="IsEnabled" Value="False" /> |
| 1422 | + </MultiDataTrigger.Setters> |
| 1423 | + </MultiDataTrigger> |
| 1424 | + </Style.Triggers> |
| 1425 | + </Style> |
| 1426 | + </Button.Resources> |
| 1427 | + <Rectangle Width="20" Height="20" Fill="{DynamicResource MahApps.Brushes.Gray3}"> |
| 1428 | + <Rectangle.OpacityMask> |
| 1429 | + <VisualBrush Stretch="Uniform" Visual="{iconPacks:Material Kind=Plus}" /> |
| 1430 | + </Rectangle.OpacityMask> |
| 1431 | + </Rectangle> |
| 1432 | + </Button> |
| 1433 | + </Grid> |
1402 | 1434 | <Rectangle Width="24" Height="24" Grid.Column="3" Grid.Row="6" |
1403 | 1435 | ToolTip="{x:Static Member=localization:Strings.HelpMessage_Tags}" |
1404 | 1436 | Style="{StaticResource ResourceKey=HelpImageRectangle}" Margin="10,0,0,0"> |
|
0 commit comments