aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/Views/MainView.xaml
blob: aa3623f4b14bb98e58cccbb2c337791c3f7f6396 (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
<UserControl x:Class="Tango.AzureUtils.UI.Views.MainView"
             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:helpers="clr-namespace:Tango.SharedUI.Helpers;assembly=Tango.SharedUI"
             xmlns:vm="clr-namespace:Tango.AzureUtils.UI.ViewModels"
             xmlns:global="clr-namespace:Tango.AzureUtils.UI"
             xmlns:views="clr-namespace:Tango.AzureUtils.UI.Views"
             xmlns:local="clr-namespace:Tango.AzureUtils.UI.Views"
             mc:Ignorable="d" 
             d:DesignHeight="900" 
             d:DesignWidth="1280" 
             d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" 
             DataContext="{x:Static global:ViewModelLocator.MainViewVM}" 
             Background="{StaticResource PrimaryBackgroundBrush}" 
             Foreground="{StaticResource PrimaryForegroundBrush}"
             IsEnabled="{Binding IsFree}">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="100"/>
            <RowDefinition Height="1*"/>
            <RowDefinition Height="70"/>
        </Grid.RowDefinitions>

        <TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10 0 0 0" FontSize="50">Azure Utils</TextBlock>

        <StackPanel HorizontalAlignment="Right" Orientation="Horizontal" IsEnabled="{Binding IsInitialized,Converter={StaticResource BooleanInverseConverter}}">

            <StackPanel>
                <StackPanel VerticalAlignment="Center" Width="150">
                    <TextBlock FontSize="10" Margin="0 10 0 0">Email</TextBlock>
                    <TextBox Margin="0 2 0 0" Text="{Binding Email}"></TextBox>
                </StackPanel>

                <StackPanel VerticalAlignment="Center" Width="150">
                    <TextBlock Margin="0 5 0 0" FontSize="10">Password</TextBlock>
                    <PasswordBox Margin="0 2 0 0" helpers:PasswordHelper.Attach="True" helpers:PasswordHelper.Password="{Binding Password,Mode=TwoWay}"></PasswordBox>
                </StackPanel>
            </StackPanel>
            <Button Command="{Binding InitCommand}" VerticalAlignment="Center" Padding="30 19" Margin="20 14 10 10" IsDefault="True">Authenticate</Button>
        </StackPanel>

        <Grid Grid.Row="1" IsEnabled="{Binding IsInitialized}">
            <TabControl Margin="10">
                <TabItem Header="Environment Upgrade" Padding="5">
                    <views:EnvironmentUpgradeView/>
                </TabItem>
                <TabItem Header="Environment Creation" Padding="5">
                    <views:EnvironmentCreationView/>
                </TabItem>
                <TabItem Header="Environment Removal" Padding="5">
                    <views:EnvironmentRemovalView/>
                </TabItem>
                <TabItem Header="Environment Firmware Injection" Padding="5">
                    <views:EnvironmentFirmwareUpgradeView/>
                </TabItem>
                <TabItem Header="Environment Rollback" Padding="5">
                    <views:EnvironmentRollbackView/>
                </TabItem>
                <TabItem Header="Environment Log Stream" Padding="5">
                    <views:EnvironmentLogStreamView/>
                </TabItem>
            </TabControl>
        </Grid>

        <Border Grid.Row="2" BorderBrush="{StaticResource LightBorderBrush}" BorderThickness="0 1 0 0">
            <Border.Style>
                <Style TargetType="Border">
                    <Setter Property="Background" Value="{StaticResource SecondaryBackgroundBrush}"></Setter>
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding ElementName=state,Path=Text}" Value="Error">
                            <Setter Property="Background" Value="#FCA4A4"></Setter>
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </Border.Style>
            <DockPanel Margin="10 0">
                <TextBlock x:Name="state" DockPanel.Dock="Top" VerticalAlignment="Center" FontSize="18" FontWeight="SemiBold" Text="{Binding Progress.Stage,Converter={StaticResource EnumToDescriptionConverter}}"></TextBlock>

                <StackPanel DockPanel.Dock="Top" VerticalAlignment="Bottom" Margin="0 0 0 5">
                    <TextBlock VerticalAlignment="Bottom" Text="{Binding Progress.Message}"></TextBlock>
                    <ProgressBar Foreground="{StaticResource PrimaryForegroundBrush}" Height="15" VerticalAlignment="Bottom" Margin="0 2 0 0" IsIndeterminate="{Binding Progress.IsIndeterminate}" Maximum="{Binding Progress.Maximum}" Value="{Binding Progress.Progress}"></ProgressBar>
                </StackPanel>
            </DockPanel>
        </Border>
    </Grid>
</UserControl>