aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures/Views/ProcedureRunnerCatalogView.xaml
blob: 6d6ecac54d116d5e04c1943d47487398e05a6855 (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
<UserControl x:Class="Tango.FSE.Procedures.Views.ProcedureRunnerCatalogView"
             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:auth="clr-namespace:Tango.FSE.Common.Authorization;assembly=Tango.FSE.Common"
             xmlns:shapes="clr-namespace:Tango.SharedUI.Shapes;assembly=Tango.SharedUI"
             xmlns:global="clr-namespace:Tango.FSE.Procedures"
             xmlns:vm="clr-namespace:Tango.FSE.Procedures.ViewModels"
             xmlns:material="http://materialdesigninxaml.net/winfx/xaml/themes"
             xmlns:local="clr-namespace:Tango.FSE.Procedures.Views"
             xmlns:controls="clr-namespace:Tango.FSE.Common.Controls;assembly=Tango.FSE.Common"
             mc:Ignorable="d" 
             d:DesignHeight="720" d:DesignWidth="1280" d:DataContext="{d:DesignInstance Type=vm:ProcedureRunnerViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.ProcedureRunnerViewVM}" d:DesignStyle="{StaticResource FSE_User_Control_Designer}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}">
    <Grid Margin="10">
        <DockPanel>
            <Grid Margin="20 20 0 0" Height="200" VerticalAlignment="Top" DockPanel.Dock="Top">
                <DockPanel>
                    <Image Margin="0 10 0 0" Source="../Images/test_runner.png" Stretch="None" VerticalAlignment="Top" RenderOptions.BitmapScalingMode="Fant" />
                    <StackPanel Margin="20 0 0 0">
                        <TextBlock FontSize="{StaticResource FSE_ModuleHeaderFontSize}" Foreground="{StaticResource FSE_PrimaryAccentBrush}">Procedures</TextBlock>
                        <TextBlock Margin="0 5 0 0" Foreground="{StaticResource FSE_GrayBrush}" LineHeight="18">
                            <Run>Welcome to the procedure runner.</Run>
                            <LineBreak/>
                            <Run>Below is a collection of machine procedures that can be executed independently.</Run>
                            <LineBreak/>
                            <Run>Each procedure can yield one or more procedure results, and may require you to provide some input before execution.</Run>
                            <LineBreak/>
                            <Run>Pressing the 'run' button on the desired procedure will navigate you to the procedure execution screen.</Run>
                        </TextBlock>
                    </StackPanel>
                </DockPanel>
            </Grid>
            <Grid Margin="0 20 0 0">
                <ListBox Style="{StaticResource FSE_BlankListBox}" ItemsSource="{Binding PublishedProcedureProjects}">
                    <ListBox.ItemsPanel>
                        <ItemsPanelTemplate>
                            <WrapPanel Orientation="Horizontal" IsItemsHost="True" />
                        </ItemsPanelTemplate>
                    </ListBox.ItemsPanel>
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <Border>
                                <Border.Effect>
                                    <DropShadowEffect ShadowDepth="0" BlurRadius="10" Color="{StaticResource FSE_PrimaryBackgroundDarkColor}" Opacity="0.5" />
                                </Border.Effect>
                                <Border x:Name="border" Margin="10" Width="350" Height="200" Background="{StaticResource FSE_PrimaryBackgroundLightBrush}" CornerRadius="5" BorderThickness="0 1 1 0">
                                    <Border.BorderBrush>
                                        <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                                            <GradientStop Color="{StaticResource FSE_BorderColor}" Offset="0" />
                                            <GradientStop Color="Transparent" Offset="1" />
                                        </LinearGradientBrush>
                                    </Border.BorderBrush>

                                    <Border.Clip>
                                        <RectangleGeometry RadiusX="5" RadiusY="5" Rect="0,0,350,200" />
                                    </Border.Clip>
                                    <Grid>
                                        <Polygon Fill="{StaticResource FSE_PrimaryBackgroundLighterBrush}" Points="0,0 150,0 0,170"></Polygon>
                                        <DockPanel>
                                            <Border CornerRadius="0 0 5 5" Padding="8" BorderThickness="0 1 0 0" BorderBrush="{StaticResource FSE_BorderBrush}" DockPanel.Dock="Bottom" Background="{StaticResource FSE_PrimaryBackgroundDarkBrush}" >
                                                <Button material:ButtonAssist.CornerRadius="14" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.RunProjectCommand}" CommandParameter="{Binding}" Height="30" Width="140" HorizontalContentAlignment="Stretch" HorizontalAlignment="Right" Style="{StaticResource FSE_RaisedButton_Dark_Hover}">
                                                    <DockPanel>
                                                        <material:PackIcon Kind="Play" Height="24" Width="24" Foreground="{StaticResource FSE_GreenBrush}" />
                                                        <TextBlock Margin="20 2 0 0" VerticalAlignment="Center">RUN</TextBlock>
                                                    </DockPanel>
                                                </Button>
                                            </Border>
                                            <DockPanel Margin="10">
                                                <Image VerticalAlignment="Top" Source="../Images/project.png" Width="48" RenderOptions.BitmapScalingMode="Fant" />
                                                <DockPanel Margin="10 0 0 0">
                                                    <TextBlock Text="{Binding Name}" DockPanel.Dock="Top" TextWrapping="Wrap" FontSize="{StaticResource FSE_LargerFontSize}">
                                                        <TextBlock.Style>
                                                            <Style TargetType="TextBlock">
                                                                <Setter Property="Foreground" Value="{StaticResource FSE_PrimaryForegroundBrush}"></Setter>
                                                                <Style.Triggers>
                                                                    <DataTrigger Binding="{Binding ElementName=border,Path=IsMouseOver}" Value="True">
                                                                        <Setter Property="Foreground" Value="{StaticResource FSE_PrimaryAccentBrush}"></Setter>
                                                                    </DataTrigger>
                                                                </Style.Triggers>
                                                            </Style>
                                                        </TextBlock.Style>
                                                    </TextBlock>
                                                    <TextBlock Margin="0 5 0 0" Foreground="{StaticResource FSE_GrayBrush}" TextWrapping="Wrap" Text="{Binding Description}" />
                                                </DockPanel>
                                            </DockPanel>
                                        </DockPanel>

                                        <controls:IconButton auth:AuthorizationHelper.Mode="Collapsed" auth:AuthorizationHelper.Permission="FSE_RunProcedureDesigner" HorizontalAlignment="Right" VerticalAlignment="Top" Cursor="Hand" Width="30" Height="30" Icon="Cogs" ToolTip="Edit this project in Procedure Designer" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.EditProjectCommand}" CommandParameter="{Binding}" />
                                    </Grid>
                                </Border>
                            </Border>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>

                <Grid Background="Transparent" Visibility="{Binding IsLoadingProjects,Converter={StaticResource BooleanToVisibilityConverter}}">
                    <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
                        <ProgressBar HorizontalAlignment="Center" IsIndeterminate="{Binding IsLoadingProjects}" Style="{StaticResource FSE_CircularProgressBar}" Width="150" Height="150" />
                        <TextBlock HorizontalAlignment="Center" Margin="0 20 0 0">Loading procedures collection...</TextBlock>
                    </StackPanel>
                </Grid>
            </Grid>
        </DockPanel>
    </Grid>
</UserControl>