зеркало из https://github.com/github/VisualStudio.git
Fix up the login button bindings and positioning
This commit is contained in:
Родитель
5eee49126e
Коммит
9a1488f98f
|
@ -156,8 +156,8 @@ namespace GitHub.ViewModels
|
|||
|
||||
var canLogin = this.WhenAny(x => x.IsValid, x => x.Value);
|
||||
|
||||
this.WhenAny(x => x.LoginFailed, x => x.Value ? "Try again" : "Log in")
|
||||
.ToProperty(this, x => x.LoginButtonText, out loginButtonText);
|
||||
loginButtonText = this.WhenAny(x => x.LoginFailed, x => x.Value ? "Try again" : "Log in")
|
||||
.ToProperty(this, x => x.LoginButtonText, initialValue: "Log In");
|
||||
|
||||
LoginPrefix = "Log in";
|
||||
LoginFailedText = "Log in failed";
|
||||
|
|
|
@ -8,6 +8,8 @@ namespace GitHub.ViewModels
|
|||
{
|
||||
string UsernameOrEmail { get; set; }
|
||||
string Password { get; set; }
|
||||
string LoginButtonText { get; }
|
||||
bool IsLoginInProgress { get; }
|
||||
ICommand LoginCmd { get; }
|
||||
IObservable<AuthenticationResult> AuthenticationResults { get; }
|
||||
}
|
||||
|
|
|
@ -196,9 +196,14 @@
|
|||
Text="{Binding EnterpriseUrl, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True, NotifyOnValidationError=True}"
|
||||
Validation.ErrorTemplate="{DynamicResource ValidationAdorner}" />
|
||||
|
||||
<StackPanel Orientation="Horizontal" IsEnabled="{Binding IsLoginInProgress, Converter={ui:InverseBooleanConverter}}" Margin="0,12,0,0">
|
||||
<ui:OcticonCircleButton x:Name="loginButton" Icon="check" Content="{Binding LoginButtonText, FallbackValue=Log In}" IsDefault="True" />
|
||||
</StackPanel>
|
||||
<Border HorizontalAlignment="Center" Margin="0,12,0,0">
|
||||
<ui:OcticonCircleButton
|
||||
x:Name="loginButton"
|
||||
Icon="check"
|
||||
Content="Log In"
|
||||
IsEnabled="true"
|
||||
IsDefault="True" />
|
||||
</Border>
|
||||
|
||||
<StackPanel x:Name="gitHubSignupStackPanel">
|
||||
<TextBlock x:Name="signUpLabel" Style="{DynamicResource GitHubH1TextBlock}" Text="Sign up" Margin="0,10,0,0" />
|
||||
|
|
|
@ -28,6 +28,8 @@ namespace GitHub.VisualStudio.UI.Views.Controls
|
|||
{
|
||||
d(this.Bind(ViewModel, vm => vm.UsernameOrEmail, v => v.usernameOrEmailTextBox.Text));
|
||||
d(this.Bind(ViewModel, vm => vm.Password, v => v.passwordTextBox.Text));
|
||||
d(this.OneWayBind(ViewModel, vm => vm.LoginButtonText, v => v.loginButton.Content));
|
||||
d(this.OneWayBind(ViewModel, vm => vm.IsLoginInProgress, v => v.loginButton.IsEnabled, inProgress => !inProgress));
|
||||
d(this.BindCommand(ViewModel, vm => vm.LoginCmd, v => v.loginButton));
|
||||
});
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче