aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/LoginView.xaml
blob: ca56e7b05983dc711d1343534e435a4fb1328401 (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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<UserControl x:Class="Tango.FSE.UI.Views.LoginView"
             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:global="clr-namespace:Tango.FSE.UI"
             xmlns:vm="clr-namespace:Tango.FSE.UI.ViewModels"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:animations="clr-namespace:Tango.SharedUI.Animations;assembly=Tango.SharedUI"
             xmlns:helpers="clr-namespace:Tango.SharedUI.Helpers;assembly=Tango.SharedUI"
             xmlns:material="http://materialdesigninxaml.net/winfx/xaml/themes"
             xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI"
             xmlns:mahApps="http://metro.mahapps.com/winfx/xaml/controls"
             xmlns:local="clr-namespace:Tango.FSE.UI.Views"
             mc:Ignorable="d" 
             d:DesignHeight="720" d:DesignWidth="1280" d:DataContext="{d:DesignInstance Type=vm:LoginViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.LoginViewVM}">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition MaxWidth="700">
                <ColumnDefinition.Style>
                    <Style TargetType="ColumnDefinition">
                        <Setter Property="Width" Value="317*"></Setter>
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding IsFree}" Value="False">
                                <DataTrigger.EnterActions>
                                    <BeginStoryboard>
                                        <Storyboard>
                                            <animations:GridLengthAnimation Storyboard.TargetProperty="Width" Duration="00:00:05" From="317*" To="200*" />
                                        </Storyboard>
                                    </BeginStoryboard>
                                </DataTrigger.EnterActions>
                                <DataTrigger.ExitActions>
                                    <BeginStoryboard>
                                        <Storyboard>
                                            <animations:GridLengthAnimation Storyboard.TargetProperty="Width" Duration="00:00:0.2" From="200*" To="317*" />
                                        </Storyboard>
                                    </BeginStoryboard>
                                </DataTrigger.ExitActions>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </ColumnDefinition.Style>
            </ColumnDefinition>
            <ColumnDefinition Width="483*"/>
        </Grid.ColumnDefinitions>
        <Grid ClipToBounds="True">
            <Image Source="/Images/Abstracts/abstract1.png" Stretch="UniformToFill" Opacity="0.8" HorizontalAlignment="Right" Width="{Binding RelativeSource={RelativeSource AncestorType=Grid},Path=ActualWidth,Converter={StaticResource MathOperatorConverter},ConverterParameter='*1.5'}"/>
            <StackPanel>
                <TextBlock HorizontalAlignment="Center" Margin="0 70 0 0" FontSize="40" TextAlignment="Center" FontWeight="Bold" TextWrapping="Wrap" Foreground="{StaticResource FSE_PrimaryForegroundBrush}" Text="{Binding BuildProvider.BuildName, Converter={StaticResource CapitalizationConverter}}"></TextBlock>
                <TextBlock FontStyle="Italic" HorizontalAlignment="Center" Foreground="{StaticResource FSE_PrimaryForegroundBrush}" Margin="0 10 0 0" FontSize="{StaticResource FSE_LargeFontSize}" FontWeight="Bold">
                    <Run FontSize="10">v</Run><Run Text="{Binding ApplicationVersion,Mode=OneWay,FallbackValue='1.0.0'}"></Run>
                </TextBlock>
            </StackPanel>
            <Image Source="{StaticResource FSE_Machines_Full}" VerticalAlignment="Bottom" RenderOptions.BitmapScalingMode="Fant" Margin="0 0 0 150" MaxWidth="300" MinWidth="100" />
            <Rectangle HorizontalAlignment="Right" StrokeThickness="1" Stroke="{StaticResource FSE_BorderBrush}" StrokeDashArray="5" />
        </Grid>

        <Grid Grid.Column="1">
            <Image Width="400" VerticalAlignment="Top" Margin="0 20 0 0" Canvas.Left="230" Source="{StaticResource FSE_Twine_Logo}"></Image>

            <controls:NavigationControl TransitionDuration="00:00:0.2" TransitionAlwaysFades="True" TransitionType="Fade" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0 130 0 0" SelectedObject="{Binding SelectedView}">
                <StackPanel  Width="300" TextElement.FontSize="16" controls:NavigationControl.NavigationName="Login">

                    <Image Source="/Images/login.png" Height="100" />

                    <TextBox Margin="0 20 0 0" Text="{Binding Email,UpdateSourceTrigger=PropertyChanged}" material:HintAssist.Hint="Email" material:HintAssist.IsFloating="True"></TextBox>
                    <PasswordBox Margin="0 20 0 0" helpers:PasswordHelper.Attach="True" helpers:PasswordHelper.Password="{Binding Password,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" material:HintAssist.Hint="Password" material:HintAssist.IsFloating="True"></PasswordBox>

                    <StackPanel MinHeight="100">
                    <StackPanel Visibility="{Binding DisplayEnvironment,Converter={StaticResource BooleanToVisibilityConverter}}">
                        <ToggleButton x:Name="chkEnv" Visibility="{Binding RelativeSource={RelativeSource Mode=Self},Path=IsChecked,Converter={StaticResource BooleanToVisibilityInverseConverter}}" HorizontalAlignment="Left" ToolTip="Select different environment" Margin="0 10 0 35" TextElement.Foreground="{StaticResource FSE_PrimaryAccentBrush}" Cursor="Hand">
                        <ToggleButton.Style>
                            <Style TargetType="ToggleButton">
                                <Setter Property="Template">
                                    <Setter.Value>
                                        <ControlTemplate TargetType="ToggleButton">
                                            <DockPanel Background="Transparent">
                                                <material:PackIcon VerticalAlignment="Center" Margin="5 -4 0 0" DockPanel.Dock="Right" Kind="ChevronDown" />
                                                <TextBlock Text="{Binding SelectedEnvironment.Description}" FontSize="{StaticResource FSE_SmallFontSize}"></TextBlock>
                                            </DockPanel>
                                        </ControlTemplate>
                                    </Setter.Value>
                                </Setter>
                            </Style>
                        </ToggleButton.Style>
                    </ToggleButton>

                        <ComboBox Visibility="{Binding Source={x:Reference Name=chkEnv},Path=IsChecked,Converter={StaticResource BooleanToVisibilityConverter}}" Margin="0 20 0 0" material:HintAssist.Hint="Environment" material:HintAssist.IsFloating="True" ItemsSource="{Binding Services.GatewayService.Environments}" SelectedItem="{Binding SelectedEnvironment}" DisplayMemberPath="Description"></ComboBox>
                    </StackPanel>
                    </StackPanel>

                    <CheckBox Margin="0 10 0 0" IsChecked="{Binding RememberMe}">remember my password</CheckBox>

                    <Button IsDefault="True" Margin="0 40 0 0" Height="50" material:ButtonAssist.CornerRadius="24" Command="{Binding LoginCommand}">LOGIN</Button>

                    <Button Command="{Binding ForgotPasswordCommand}" Margin="0 10 0 0" HorizontalAlignment="Right" Content="Forgot password">
                        <Button.Style>
                            <Style TargetType="Button" BasedOn="{StaticResource FSE_FlatButton_OpacityHover}">
                                <Setter Property="Foreground" Value="{StaticResource FSE_GrayBrush}"></Setter>
                            </Style>
                        </Button.Style>
                    </Button>
                </StackPanel>

                <StackPanel controls:NavigationControl.NavigationName="Logging">
                    <ProgressBar Width="200" Height="200" HorizontalAlignment="Center" VerticalAlignment="Center" IsIndeterminate="{Binding IsBusy}" Style="{StaticResource MaterialDesignCircularProgressBar}" Value="0" />
                    <TextBlock HorizontalAlignment="Center" Margin="0 40 0 0" FontSize="18">logging you in, please wait...</TextBlock>
                    <TextBlock HorizontalAlignment="Center" Margin="0 20 0 0" Text="{Binding Status}" Foreground="{StaticResource FSE_GrayBrush}"></TextBlock>
                </StackPanel>

                <StackPanel TextElement.FontSize="16" controls:NavigationControl.NavigationName="ChangePassword">

                    <Image Source="/Images/login.png" Height="100" />

                    <TextBlock FontSize="{StaticResource FSE_DefaultFontSize}" Margin="0 20 0 0" TextAlignment="Center">
                        <Run Foreground="{StaticResource FSE_OrangeBrush}" FontSize="{StaticResource FSE_LargeFontSize}">Password change required on first login</Run>
                        <LineBreak/>
                        <LineBreak/>
                        <Run Foreground="{StaticResource FSE_GrayBrush}" FontSize="{StaticResource FSE_SmallFontSize}">The system administrator requires you to change your password before proceeding to the system.</Run>
                    </TextBlock>

                    <StackPanel Width="300">
                    <PasswordBox Margin="0 20 0 0" helpers:PasswordHelper.Attach="True" helpers:PasswordHelper.Password="{Binding CurrentPassword,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" material:HintAssist.Hint="Current Password" material:HintAssist.IsFloating="True"></PasswordBox>
                    <PasswordBox Margin="0 20 0 0" helpers:PasswordHelper.Attach="True" helpers:PasswordHelper.Password="{Binding NewPassword,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" material:HintAssist.Hint="New Password" material:HintAssist.IsFloating="True"></PasswordBox>
                    <PasswordBox Margin="0 20 0 0" helpers:PasswordHelper.Attach="True" helpers:PasswordHelper.Password="{Binding NewPasswordConfirm,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" material:HintAssist.Hint="Confirm New Password" material:HintAssist.IsFloating="True"></PasswordBox>

                    <Button IsDefault="True" Margin="0 40 0 0" Height="50" material:ButtonAssist.CornerRadius="24" Style="{StaticResource FSE_Button_Orange}" Command="{Binding ChangePasswordCommand}">CHANGE PASSWORD</Button>
                    </StackPanel>
                </StackPanel>

                <StackPanel controls:NavigationControl.NavigationName="ChangingPassword">
                    <ProgressBar Width="200" Height="200" HorizontalAlignment="Center" VerticalAlignment="Center" IsIndeterminate="{Binding IsBusy}" Style="{StaticResource MaterialDesignCircularProgressBar}" Value="0" />
                    <TextBlock HorizontalAlignment="Center" Margin="0 40 0 0" FontSize="18">updating your password, please wait...</TextBlock>
                </StackPanel>

                <StackPanel TextElement.FontSize="16" controls:NavigationControl.NavigationName="ForgotPassword">

                    <Image Source="/Images/login.png" Height="100" />

                    <TextBlock FontSize="{StaticResource FSE_DefaultFontSize}" Margin="0 20 0 0" TextAlignment="Center">
                        <Run Foreground="{StaticResource FSE_OrangeBrush}" FontSize="{StaticResource FSE_LargeFontSize}">Password Reset</Run>
                        <LineBreak/>
                        <LineBreak/>
                        <Run Foreground="{StaticResource FSE_GrayBrush}" FontSize="{StaticResource FSE_SmallFontSize}">If you have forgotten your password we can send you an email with instructions on how to reset your password</Run>
                    </TextBlock>

                    <StackPanel Width="300">
                        <TextBox Margin="0 35 0 0" Text="{Binding Email,UpdateSourceTrigger=PropertyChanged}" material:HintAssist.Hint="Email" material:HintAssist.IsFloating="True"></TextBox>

                        <Button IsDefault="True" Margin="0 100 0 0" Height="50" material:ButtonAssist.CornerRadius="24" Style="{StaticResource FSE_Button_Orange}" Command="{Binding SendPasswordResetEmailCommand}">SEND EMAIL</Button>
                        <Button Command="{Binding CancelForgotPasswordCommand}" Style="{StaticResource FSE_FlatButton_OpacityHover}" Foreground="{StaticResource FSE_GrayBrush}" Margin="0 20 0 0">BACK</Button>
                    </StackPanel>
                </StackPanel>

                <StackPanel controls:NavigationControl.NavigationName="SendingForgotPasswordEmail">
                    <ProgressBar Width="200" Height="200" HorizontalAlignment="Center" VerticalAlignment="Center" IsIndeterminate="{Binding IsBusy}" Style="{StaticResource MaterialDesignCircularProgressBar}" Value="0" />
                    <TextBlock HorizontalAlignment="Center" Margin="0 40 0 0" FontSize="18">sending password reset email, please wait...</TextBlock>
                </StackPanel>
            </controls:NavigationControl>
        </Grid>
    </Grid>
</UserControl>