Skip to content

Commit e68ef63

Browse files
committed
changed binding type to instead update on every keystrok
1 parent bb24c80 commit e68ef63

File tree

4 files changed

+2
-4
lines changed

4 files changed

+2
-4
lines changed

App/Views/Pages/SignInTokenPage.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
PlaceholderText="Paste your token here"
6565
KeyDown="PasswordBox_KeyDown"
6666
LostFocus="{x:Bind ViewModel.ApiToken_FocusLost, Mode=OneWay}"
67-
Password="{x:Bind ViewModel.ApiToken, Mode=TwoWay}" />
67+
Password="{x:Bind ViewModel.ApiToken, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
6868

6969
<TextBlock
7070
Grid.Column="1"

App/Views/Pages/SignInTokenPage.xaml.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ private async void PasswordBox_KeyDown(object sender, Microsoft.UI.Xaml.Input.Ke
2323
{
2424
if (e.Key == VirtualKey.Enter)
2525
{
26-
ViewModel.ApiToken = ((PasswordBox)sender).Password;
2726
await ViewModel.TokenPage_SignIn(SignInWindow);
2827
e.Handled = true;
2928
}

App/Views/Pages/SignInUrlPage.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
PlaceholderText="https://coder.example.com"
5050
Loaded="{x:Bind ViewModel.CoderUrl_Loaded, Mode=OneWay}"
5151
LostFocus="{x:Bind ViewModel.CoderUrl_FocusLost, Mode=OneWay}"
52-
Text="{x:Bind ViewModel.CoderUrl, Mode=TwoWay}"
52+
Text="{x:Bind ViewModel.CoderUrl, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
5353
KeyDown="TextBox_KeyDown"/>
5454

5555
<TextBlock

App/Views/Pages/SignInUrlPage.xaml.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ private void TextBox_KeyDown(object sender, Microsoft.UI.Xaml.Input.KeyRoutedEve
2323
{
2424
if(e.Key == VirtualKey.Enter)
2525
{
26-
ViewModel.CoderUrl = ((TextBox)sender).Text;
2726
ViewModel.UrlPage_Next(SignInWindow);
2827
e.Handled = true;
2928
}

0 commit comments

Comments
 (0)