blob: 8f03202a1c7242fbfcee39824a16676e7fb25dc5 (
plain)
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
|
<UserControl x:Class="Tango.MachineStudio.UI.Views.MachineConnectionView"
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:mahapps="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300" Width="600" Height="400" Background="White" DataContext="{Binding MachineConnectionViewVM, Source={StaticResource Locator}}">
<UserControl.Resources>
<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"></converters:BooleanToVisibilityConverter>
<converters:BooleanToVisibilityInverseConverter x:Key="BooleanToVisibilityInverseConverter"></converters:BooleanToVisibilityInverseConverter>
<converters:BooleanInverseConverter x:Key="BooleanInverseConverter"></converters:BooleanInverseConverter>
</UserControl.Resources>
<Grid>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="80"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Grid>
<StackPanel Orientation="Horizontal" Margin="10">
<Image Source="/Images/machine-trans.png" RenderOptions.BitmapScalingMode="Fant"></Image>
<TextBlock Text="Machine Connection" VerticalAlignment="Center" Margin="10 0 0 0" FontSize="20"></TextBlock>
</StackPanel>
</Grid>
<Grid Grid.Row="1" Margin="10 0 10 10">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="50"/>
</Grid.RowDefinitions>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition Height="223*"/>
</Grid.RowDefinitions>
<Grid>
<TextBlock VerticalAlignment="Center" Margin="0 0 0 0" Text="Scanning for machine on your local network..."></TextBlock>
<!--<Button Command="{Binding ScanCommand}" HorizontalAlignment="Right" Width="40" Padding="0" Style="{StaticResource MaterialDesignFlatButton}" Foreground="Black" ToolTip="Scan">
<materialDesign:PackIcon Kind="Refresh" Width="24" Height="24"></materialDesign:PackIcon>
</Button>-->
</Grid>
<Grid Grid.Row="1">
<ListBox ItemsSource="{Binding Scanner.AvailableMachines}" SelectedItem="{Binding SelectedMachine}" Margin="0 0 0 7" BorderThickness="1" BorderBrush="Gainsboro">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<StackPanel Orientation="Horizontal">
<StackPanel.Style>
<Style TargetType="StackPanel">
<Setter Property="Visibility" Value="Visible"></Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding Type}" Value="USB">
<Setter Property="Visibility" Value="Collapsed"></Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</StackPanel.Style>
<Image Source="/Images/machine-trans.png" Width="38" Height="38" RenderOptions.BitmapScalingMode="Fant"></Image>
<StackPanel Margin="10 0 0 0">
<TextBlock FontSize="11">
<Run FontWeight="Bold">S/N:</Run> <Run Text="{Binding SerialNumber,Mode=OneWay}"></Run>
</TextBlock>
<TextBlock FontSize="11">
<Run FontWeight="Bold">IP Address:</Run> <Run Text="{Binding IPAddress,Mode=OneWay}"></Run>
</TextBlock>
<TextBlock FontSize="11">
<Run FontWeight="Bold">Organization:</Run> <Run Text="{Binding Organization,Mode=OneWay}"></Run>
</TextBlock>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Horizontal">
<StackPanel.Style>
<Style TargetType="StackPanel">
<Setter Property="Visibility" Value="Collapsed"></Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding Type}" Value="USB">
<Setter Property="Visibility" Value="Visible"></Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</StackPanel.Style>
<Image Source="/Images/machine-trans.png" Width="38" Height="38" RenderOptions.BitmapScalingMode="Fant"></Image>
<StackPanel Margin="10 0 0 0">
<TextBlock FontSize="11">
<Run FontWeight="Bold">Port:</Run> <Run Text="{Binding ComPort,Mode=OneWay}"></Run>
</TextBlock>
<TextBlock FontSize="11">
<Run FontWeight="Bold">Device:</Run> <Run Text="{Binding Device,Mode=OneWay}"></Run>
</TextBlock>
</StackPanel>
</StackPanel>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<mahapps:MetroProgressBar VerticalAlignment="Bottom" Height="1" IsIndeterminate="True"></mahapps:MetroProgressBar>
</Grid>
</Grid>
<Grid Grid.Row="1">
<Button HorizontalAlignment="Right" Width="140" Command="{Binding ConnectCommand}">CONNECT</Button>
</Grid>
</Grid>
</Grid>
</Grid>
</UserControl>
|