-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathMainWindow.xaml
51 lines (50 loc) · 4.11 KB
/
MainWindow.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<Window x:Class="MainPower.Com0com.Redirector.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Com0com Serial Port Redirector" Height="577" Width="690"
DataContext="{Binding RelativeSource={RelativeSource Self}}" Closing="Window_Closing" Icon="MainPowerIconGreen.ico">
<Grid>
<Menu Height="23" VerticalAlignment="Top">
<MenuItem Header="File">
<MenuItem Header="Add Port Pair" Click="mnuAddPair_Click"/>
<MenuItem Header="Remove Selected Port Pair" Click="mnuRemovePair_Click"/>
<MenuItem Header="Refresh Port Pairs" Click="mnuRefreshPairs_Click"/>
<MenuItem Header="Launch Setupg" Click="mnuLaunchSetupg_Click"/>
<MenuItem Header="Exit" Click="mnuExit_Click"/>
</MenuItem>
</Menu>
<ListView Name="listPorts" ItemsSource="{Binding PortPairs}" HorizontalAlignment="Left" Width="379" Height="152" VerticalAlignment="Top" Margin="0,23,0,0">
<ListView.View>
<GridView>
<GridViewColumn DisplayMemberBinding="{Binding PairNumber}" >
<GridViewColumnHeader Content="Number" />
</GridViewColumn>
<GridViewColumn DisplayMemberBinding="{Binding PortNameA}" >
<GridViewColumnHeader Content="Port A" />
</GridViewColumn>
<GridViewColumn DisplayMemberBinding="{Binding PortNameB}" >
<GridViewColumnHeader Content="Port B" />
</GridViewColumn>
<GridViewColumn DisplayMemberBinding="{Binding CommsMode}" >
<GridViewColumnHeader Content="Comms Mode" />
</GridViewColumn>
<GridViewColumn DisplayMemberBinding="{Binding CommsStatus}" >
<GridViewColumnHeader Content="Comms Status" />
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
<ComboBox Name="cboCommsMode" HorizontalAlignment="Left" Margin="546,24,0,0" VerticalAlignment="Top" Width="126" SelectedValue="{Binding Path=SelectedValue.CommsMode, ElementName=listPorts}"/>
<Label Content="Communications Mode" HorizontalAlignment="Left" Margin="384,20,0,0" VerticalAlignment="Top"/>
<Label Content="Destination IP" HorizontalAlignment="Left" Margin="384,47,0,0" VerticalAlignment="Top"/>
<Label Content="Detsination Port" HorizontalAlignment="Left" Margin="384,75,0,0" VerticalAlignment="Top"/>
<Label Content="Local Port (UDP only)" HorizontalAlignment="Left" Margin="384,103,0,0" VerticalAlignment="Top"/>
<TextBox HorizontalAlignment="Left" Height="23" Margin="546,51,0,0" TextWrapping="Wrap" Text="{Binding Path=SelectedValue.RemoteIP, ElementName=listPorts}" VerticalAlignment="Top" Width="126"/>
<TextBox HorizontalAlignment="Left" Height="23" Margin="546,79,0,0" TextWrapping="Wrap" Text="{Binding Path=SelectedValue.RemotePort, ElementName=listPorts}" VerticalAlignment="Top" Width="126"/>
<TextBox HorizontalAlignment="Left" Height="23" Margin="546,107,0,0" TextWrapping="Wrap" Text="{Binding Path=SelectedValue.LocalPort, ElementName=listPorts}" VerticalAlignment="Top" Width="126"/>
<Button Content="Start" HorizontalAlignment="Left" Margin="384,151,0,0" VerticalAlignment="Top" Width="75" Click="btnStart_Click" Height="24"/>
<Button Content="Stop" HorizontalAlignment="Left" Margin="464,151,0,0" VerticalAlignment="Top" Width="75" Click="btnStop_Click" Height="24"/>
<TextBox Margin="0,180,0,0" TextWrapping="Wrap" Text="{Binding Path=SelectedValue.OutputData, ElementName=listPorts, Mode=OneWay}" IsReadOnly="True" Background="Black" Foreground="White" FontFamily="Courier New"/>
<Button Content="Select from Database" HorizontalAlignment="Left" Margin="546,151,0,0" VerticalAlignment="Top" Width="126" Click="btnPortSelect_Click" RenderTransformOrigin="1.667,0.65" Height="24"/>
</Grid>
</Window>