aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/MachineConnectionIcon.xaml
blob: 3bf760ae04448d37a476612fcb5351bded7848a3 (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
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:material="http://materialdesigninxaml.net/winfx/xaml/themes"
                    xmlns:local="clr-namespace:Tango.FSE.Common.Controls">

    <Style TargetType="{x:Type local:MachineConnectionIcon}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:MachineConnectionIcon}">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">
                        <Grid DataContext="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:MachineConnectionIcon}}">
                            <Image Margin="0 5 10 0" RenderOptions.BitmapScalingMode="Fant">
                                <Image.Style>
                                    <Style TargetType="Image">
                                        <Setter Property="Source" Value="../Images/Connections/ts1800.png"></Setter>
                                        <Style.Triggers>
                                            <DataTrigger Binding="{Binding MachineType}" Value="Eureka">
                                                <Setter Property="Source" Value="../Images/Connections/eureka.png"></Setter>
                                            </DataTrigger>
                                            <DataTrigger Binding="{Binding MachineType}" Value="X1">
                                                <Setter Property="Source" Value="../Images/Connections/xx1.png"></Setter>
                                            </DataTrigger>
                                        </Style.Triggers>
                                    </Style>
                                </Image.Style>
                            </Image>

                            <material:PackIcon RenderOptions.BitmapScalingMode="Fant" Width="20" Height="20" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0 0 -1 0">
                                <material:PackIcon.Style>
                                    <Style TargetType="material:PackIcon">
                                        <Setter Property="Kind" Value="Usb"></Setter>
                                        <Setter Property="Foreground" Value="{StaticResource FSE_UsbBrush}"></Setter>
                                        <Style.Triggers>
                                            <DataTrigger Binding="{Binding ExternalBridgeClientType}" Value="USB">
                                                <Setter Property="Kind" Value="Usb"></Setter>
                                                <Setter Property="Foreground" Value="{StaticResource FSE_UsbBrush}"></Setter>
                                            </DataTrigger>
                                            <DataTrigger Binding="{Binding ExternalBridgeClientType}" Value="TCP">
                                                <Setter Property="Kind" Value="Lan"></Setter>
                                                <Setter Property="Foreground" Value="{StaticResource FSE_LanBrush}"></Setter>
                                            </DataTrigger>
                                            <DataTrigger Binding="{Binding ExternalBridgeClientType}" Value="Wifi">
                                                <Setter Property="Kind" Value="Wifi"></Setter>
                                                <Setter Property="Foreground" Value="{StaticResource FSE_WifiBrush}"></Setter>
                                            </DataTrigger>
                                            <DataTrigger Binding="{Binding ExternalBridgeClientType}" Value="SignalR">
                                                <Setter Property="Kind" Value="Cloud"></Setter>
                                                <Setter Property="Foreground" Value="{StaticResource FSE_SignalRBrush}"></Setter>
                                            </DataTrigger>
                                            <DataTrigger Binding="{Binding ExternalBridgeClientType}" Value="Emulator">
                                                <Setter Property="Kind" Value="SdCard"></Setter>
                                                <Setter Property="Foreground" Value="{StaticResource FSE_EmulatorBrush}"></Setter>
                                            </DataTrigger>
                                        </Style.Triggers>
                                    </Style>
                                </material:PackIcon.Style>
                            </material:PackIcon>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
</ResourceDictionary>