Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9b8408d

Browse files
feat: enter submits sign in information (#90)
Closes:#88---------Co-authored-by: Dean Sheather <dean@deansheather.com>
1 parent2a4814e commit9b8408d

File tree

4 files changed

+24
-2
lines changed

4 files changed

+24
-2
lines changed

‎App/Views/Pages/SignInTokenPage.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,9 @@
6262
Grid.Row="2"
6363
HorizontalAlignment="Stretch"
6464
PlaceholderText="Paste your token here"
65+
KeyDown="PasswordBox_KeyDown"
6566
LostFocus="{x:Bind ViewModel.ApiToken_FocusLost, Mode=OneWay}"
66-
Password="{x:Bind ViewModel.ApiToken, Mode=TwoWay}" />
67+
Password="{x:Bind ViewModel.ApiToken, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
6768

6869
<TextBlock
6970
Grid.Column="1"

‎App/Views/Pages/SignInTokenPage.xaml.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
usingCoder.Desktop.App.ViewModels;
22
usingMicrosoft.UI.Xaml.Controls;
3+
usingWindows.System;
34

45
namespaceCoder.Desktop.App.Views.Pages;
56

@@ -17,4 +18,13 @@ public SignInTokenPage(SignInWindow parent, SignInViewModel viewModel)
1718
ViewModel=viewModel;
1819
SignInWindow=parent;
1920
}
21+
22+
privateasyncvoidPasswordBox_KeyDown(objectsender,Microsoft.UI.Xaml.Input.KeyRoutedEventArgse)
23+
{
24+
if(e.Key==VirtualKey.Enter)
25+
{
26+
awaitViewModel.TokenPage_SignIn(SignInWindow);
27+
e.Handled=true;
28+
}
29+
}
2030
}

‎App/Views/Pages/SignInUrlPage.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@
4848
PlaceholderText="https://coder.example.com"
4949
Loaded="{x:Bind ViewModel.CoderUrl_Loaded, Mode=OneWay}"
5050
LostFocus="{x:Bind ViewModel.CoderUrl_FocusLost, Mode=OneWay}"
51-
Text="{x:Bind ViewModel.CoderUrl, Mode=TwoWay}" />
51+
Text="{x:Bind ViewModel.CoderUrl, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
52+
KeyDown="TextBox_KeyDown"/>
5253

5354
<TextBlock
5455
Grid.Column="1"

‎App/Views/Pages/SignInUrlPage.xaml.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
usingCoder.Desktop.App.ViewModels;
22
usingMicrosoft.UI.Xaml.Controls;
3+
usingWindows.System;
34

45
namespaceCoder.Desktop.App.Views.Pages;
56

@@ -17,4 +18,13 @@ public SignInUrlPage(SignInWindow parent, SignInViewModel viewModel)
1718
ViewModel=viewModel;
1819
SignInWindow=parent;
1920
}
21+
22+
privatevoidTextBox_KeyDown(objectsender,Microsoft.UI.Xaml.Input.KeyRoutedEventArgse)
23+
{
24+
if(e.Key==VirtualKey.Enter)
25+
{
26+
ViewModel.UrlPage_Next(SignInWindow);
27+
e.Handled=true;
28+
}
29+
}
2030
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp