|
3 | 3 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
4 | 4 | xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
5 | 5 | xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
6 |
| - mc:Ignorable="d"> |
| 6 | + xmlns:viewModels="clr-namespace:GitHub.UI.ViewModels;assembly=GitHub.UI.Shared" |
| 7 | + xmlns:converters="clr-namespace:Microsoft.Git.CredentialManager.UI.Converters;assembly=Microsoft.Git.CredentialManager.UI.Windows" |
| 8 | + xmlns:controls="clr-namespace:GitHub.UI.Controls" |
| 9 | + xmlns:sharedControls="clr-namespace:Microsoft.Git.CredentialManager.UI.Controls;assembly=Microsoft.Git.CredentialManager.UI.Windows" |
| 10 | + mc:Ignorable="d" |
| 11 | + d:DataContext="{d:DesignInstance viewModels:CredentialsViewModel}" |
| 12 | + d:DesignWidth="300"> |
| 13 | + <UserControl.Resources> |
| 14 | + <ResourceDictionary> |
| 15 | + <ResourceDictionary.MergedDictionaries> |
| 16 | + <ResourceDictionary Source="../Assets/Styles.xaml"/> |
| 17 | + </ResourceDictionary.MergedDictionaries> |
| 18 | + <converters:NonEmptyStringToVisibleConverter x:Key="NonEmptyStringToVisibleConverter"/> |
| 19 | + <converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/> |
| 20 | + <converters:BooleanOrToVisibilityConverter x:Key="BooleanOrToVisibilityConverter"/> |
| 21 | + <converters:BooleanOrConverter x:Key="BooleanOrConverter"/> |
| 22 | + <converters:BooleanNotConverter x:Key="BooleanNotConverter"/> |
| 23 | + </ResourceDictionary> |
| 24 | + </UserControl.Resources> |
| 25 | + |
| 26 | + <DockPanel> |
| 27 | + <StackPanel DockPanel.Dock="Top" Margin="0,0,0,15"> |
| 28 | + <!-- TODO: replace with GitHub logo --> |
| 29 | + <TextBlock Text="GitHub" |
| 30 | + HorizontalAlignment="Center" |
| 31 | + FontSize="20" |
| 32 | + FontWeight="Bold"/> |
| 33 | + <TextBlock Text="Sign in" |
| 34 | + HorizontalAlignment="Center" |
| 35 | + FontSize="24" |
| 36 | + FontWeight="Light" |
| 37 | + Margin="0,0,0,10" /> |
| 38 | + <controls:HorizontalShadowDivider/> |
| 39 | + <StackPanel Visibility="{Binding EnterpriseUrl, Converter={StaticResource NonEmptyStringToVisibleConverter}}" |
| 40 | + Margin="0,10,0,0"> |
| 41 | + <TextBlock Text="GitHub Enterprise" HorizontalAlignment="Center" |
| 42 | + FontSize="14"/> |
| 43 | + <TextBlock Text="{Binding EnterpriseUrl}" |
| 44 | + HorizontalAlignment="Center" |
| 45 | + FontSize="14"/> |
| 46 | + </StackPanel> |
| 47 | + </StackPanel> |
| 48 | + |
| 49 | + <WrapPanel DockPanel.Dock="Bottom" HorizontalAlignment="Center" VerticalAlignment="Center" |
| 50 | + Margin="0,20,0,0"> |
| 51 | + <TextBlock Text="Don't have an account? " |
| 52 | + Margin="0,0,5,0" |
| 53 | + FontSize="14"> |
| 54 | + <Hyperlink Command="{Binding SignUpCommand}">Sign Up</Hyperlink> |
| 55 | + </TextBlock> |
| 56 | + </WrapPanel> |
| 57 | + |
| 58 | + <TabControl x:Name="tabControl" |
| 59 | + BorderThickness="0" |
| 60 | + Background="Transparent" |
| 61 | + IsTabStop="False"> |
| 62 | + <TabControl.Resources> |
| 63 | + <Style TargetType="TabPanel"> |
| 64 | + <Setter Property="HorizontalAlignment" Value="Center"/> |
| 65 | + </Style> |
| 66 | + <Style TargetType="TabItem"> |
| 67 | + <Setter Property="Template"> |
| 68 | + <Setter.Value> |
| 69 | + <ControlTemplate TargetType="TabItem"> |
| 70 | + <Border Name="Border" Margin="10,0,10,10" |
| 71 | + BorderThickness="0,0,0,2" |
| 72 | + BorderBrush="Transparent"> |
| 73 | + <ContentPresenter x:Name="ContentSite" |
| 74 | + VerticalAlignment="Center" |
| 75 | + HorizontalAlignment="Center" |
| 76 | + ContentSource="Header" |
| 77 | + Margin="0,0,0,5"/> |
| 78 | + </Border> |
| 79 | + <ControlTemplate.Triggers> |
| 80 | + <Trigger Property="IsSelected" Value="True"> |
| 81 | + <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource AccentBrush}"/> |
| 82 | + </Trigger> |
| 83 | + </ControlTemplate.Triggers> |
| 84 | + </ControlTemplate> |
| 85 | + </Setter.Value> |
| 86 | + </Setter> |
| 87 | + </Style> |
| 88 | + </TabControl.Resources> |
| 89 | + |
| 90 | + <TabItem IsEnabled="{Binding ShowBrowserLogin}" |
| 91 | + Visibility="{Binding ShowBrowserLogin, Converter={StaticResource BooleanToVisibilityConverter}}"> |
| 92 | + <TabItem.Header> |
| 93 | + <TextBlock Text="Browser" FontSize="12" /> |
| 94 | + </TabItem.Header> |
| 95 | + <StackPanel x:Name="oauthPanel" |
| 96 | + Margin="0,10"> |
| 97 | + <Button x:Name="browserButton" |
| 98 | + Content="Sign in with your browser" |
| 99 | + IsDefault="True" |
| 100 | + Command="{Binding SignInBrowserCommand}" |
| 101 | + Visibility="{Binding ShowBrowserLogin}" |
| 102 | + HorizontalAlignment="Center" |
| 103 | + Margin="0,0,0,10" |
| 104 | + Style="{StaticResource AccentButton}"/> |
| 105 | + </StackPanel> |
| 106 | + </TabItem> |
| 107 | + |
| 108 | + <TabItem IsEnabled="{Binding ShowTokenLogin}" |
| 109 | + Visibility="{Binding ShowTokenLogin, Converter={StaticResource BooleanToVisibilityConverter}}"> |
| 110 | + <TabItem.Header> |
| 111 | + <TextBlock Text="Token" FontSize="12" /> |
| 112 | + </TabItem.Header> |
| 113 | + <StackPanel x:Name="tokenPanel" |
| 114 | + Margin="0,10"> |
| 115 | + <sharedControls:PasswordPromptTextBox x:Name="tokenTextBox" |
| 116 | + Margin="0,0,0,10" |
| 117 | + PromptText="Personal access token" |
| 118 | + Password="{Binding Token, UpdateSourceTrigger=PropertyChanged, Delay=300, Mode=OneWayToSource}"/> |
| 119 | + <Button Content="Sign in" |
| 120 | + IsDefault="True" |
| 121 | + Command="{Binding SignInTokenCommand}" |
| 122 | + HorizontalAlignment="Center" |
| 123 | + Style="{StaticResource AccentButton}"/> |
| 124 | + </StackPanel> |
| 125 | + </TabItem> |
| 126 | + |
| 127 | + <TabItem IsEnabled="{Binding ShowBasicLogin}" |
| 128 | + Visibility="{Binding ShowBasicLogin, Converter={StaticResource BooleanToVisibilityConverter}}"> |
| 129 | + <TabItem.Header> |
| 130 | + <TextBlock Text="Password" FontSize="12" /> |
| 131 | + </TabItem.Header> |
| 132 | + <StackPanel x:Name="basicPanel" |
| 133 | + Margin="0,10"> |
| 134 | + <sharedControls:PromptTextBox x:Name="userNameTextBox" |
| 135 | + Margin="0,0,0,10" |
| 136 | + PromptText="Username or email" |
| 137 | + Text="{Binding UserName}"/> |
| 138 | + <sharedControls:PasswordPromptTextBox x:Name="passwordTextBox" |
| 139 | + Margin="0,0,0,10" |
| 140 | + PromptText="Password" |
| 141 | + Password="{Binding Password, UpdateSourceTrigger=PropertyChanged, Delay=300, Mode=OneWayToSource}"/> |
| 142 | + <Button Content="Sign in" |
| 143 | + IsDefault="True" |
| 144 | + Command="{Binding SignInBasicCommand}" |
| 145 | + HorizontalAlignment="Center" |
| 146 | + Style="{StaticResource AccentButton}"/> |
| 147 | + </StackPanel> |
| 148 | + </TabItem> |
| 149 | + </TabControl> |
| 150 | + </DockPanel> |
7 | 151 | </UserControl>
|
0 commit comments