You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
73 lines
3.8 KiB
73 lines
3.8 KiB
<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>
|
|
|
|
|
|
</StackPanel>
|
|
|
|
<!-- Display for Remote Endpoint Address (outside of Not changeable range) -->
|
|
<StackPanel Orientation="Horizontal" Margin="20 0 10 0">
|
|
<StackPanel.Style>
|
|
<Style TargetType="{x:Type StackPanel}">
|
|
<!-- Defaults to visible -->
|
|
<Setter Property="Visibility" Value="Visible"/>
|
|
<Style.Triggers>
|
|
<!-- Collapsed when Remote Endpoint 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 Margin="20 0 10 0" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="DarkGray">Remote Endpoint:</Label>
|
|
<TextBox IsReadOnly="True" VerticalContentAlignment="Center" Text="{Binding ResolvedAddress}"/>
|
|
</StackPanel>
|
|
|
|
</DockPanel>
|
|
|
|
</UserControl>
|
|
|