|
|
|
|
@ -0,0 +1,72 @@ |
|
|
|
|
<UserControl x:Class="MultiTerm.Wpf.View.SettingsView.NetworkSettingsView" |
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
|
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
|
|
|
|
xmlns:conv="clr-namespace:MultiTerm.Wpf.ValueConverters" |
|
|
|
|
xmlns:local="clr-namespace:MultiTerm.Wpf.View.SettingsView" |
|
|
|
|
mc:Ignorable="d" |
|
|
|
|
d:DesignHeight="50" d:DesignWidth="800"> |
|
|
|
|
<UserControl.Resources> |
|
|
|
|
<!-- Converter --> |
|
|
|
|
<conv:IntToStringConverter x:Key="IntToStringConverter"/> |
|
|
|
|
|
|
|
|
|
</UserControl.Resources> |
|
|
|
|
<DockPanel> |
|
|
|
|
<Button DockPanel.Dock="Left" Command="{Binding ConnectDisconnectCommand}" Content="{Binding ConnectDisconnectButtonText}" Width="80"/> |
|
|
|
|
|
|
|
|
|
<StackPanel Orientation="Horizontal" IsEnabled="{Binding AreEditable}"> |
|
|
|
|
|
|
|
|
|
<!-- Hostname / IP --> |
|
|
|
|
<StackPanel Orientation="Horizontal" ToolTipService.InitialShowDelay="200"> |
|
|
|
|
<StackPanel.ToolTip> |
|
|
|
|
<StackPanel Orientation="Vertical"> |
|
|
|
|
<TextBlock Text="Examples:"></TextBlock> |
|
|
|
|
<UniformGrid Columns="2"> |
|
|
|
|
<TextBlock Text="IPv4:"/> |
|
|
|
|
<TextBlock Text="'192.168.1.20'"/> |
|
|
|
|
<TextBlock Text="IPv6:"/> |
|
|
|
|
<TextBlock Text="'FE80::AB8'"/> |
|
|
|
|
<TextBlock Text="Hostname:"/> |
|
|
|
|
<TextBlock Text="'exampleDevice'"/> |
|
|
|
|
<TextBlock Text="Hostname+Domain:"/> |
|
|
|
|
<TextBlock Text="'exampleDevice.local'"/> |
|
|
|
|
</UniformGrid> |
|
|
|
|
</StackPanel> |
|
|
|
|
</StackPanel.ToolTip> |
|
|
|
|
<Label Margin="10 0" VerticalAlignment="Center">Hostname/IP:</Label> |
|
|
|
|
<TextBox Text="{Binding Path=Hostname, Mode=TwoWay}" VerticalContentAlignment="Center" MinWidth="120" Width="Auto"/> |
|
|
|
|
</StackPanel> |
|
|
|
|
|
|
|
|
|
<!-- Port --> |
|
|
|
|
<StackPanel Orientation="Horizontal" ToolTipService.InitialShowDelay="200"> |
|
|
|
|
<StackPanel.ToolTip> |
|
|
|
|
<TextBlock>Port Number (0...65535)</TextBlock> |
|
|
|
|
</StackPanel.ToolTip> |
|
|
|
|
<Label Margin="20 0 10 0" VerticalAlignment="Center" HorizontalAlignment="Center">Port:</Label> |
|
|
|
|
<TextBox Text="{Binding Path=Port, Mode=TwoWay, Converter={StaticResource IntToStringConverter}}" Width="50" VerticalContentAlignment="Center"/> |
|
|
|
|
</StackPanel> |
|
|
|
|
|
|
|
|
|
<!-- Display for Resolved IP Address --> |
|
|
|
|
<StackPanel Orientation="Vertical" Margin="20 0 10 0"> |
|
|
|
|
<StackPanel.Style> |
|
|
|
|
<Style TargetType="{x:Type StackPanel}"> |
|
|
|
|
<!-- Defaults to visible --> |
|
|
|
|
<Setter Property="Visibility" Value="Visible"/> |
|
|
|
|
<Style.Triggers> |
|
|
|
|
<!-- Collapsed when Resolved Address String length is 0 --> |
|
|
|
|
<DataTrigger Binding="{Binding Path=ResolvedAddress.Length, FallbackValue=0, TargetNullValue=0}" Value="0"> |
|
|
|
|
<Setter Property="Visibility" Value="Collapsed"/> |
|
|
|
|
</DataTrigger> |
|
|
|
|
</Style.Triggers> |
|
|
|
|
</Style> |
|
|
|
|
</StackPanel.Style> |
|
|
|
|
<Label VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="DarkGray">Resolved IP Address:</Label> |
|
|
|
|
<TextBox IsReadOnly="True" Text="{Binding ResolvedAddress}"/> |
|
|
|
|
</StackPanel> |
|
|
|
|
|
|
|
|
|
</StackPanel> |
|
|
|
|
|
|
|
|
|
</DockPanel> |
|
|
|
|
|
|
|
|
|
</UserControl> |