Skip to content

Commit 7b33809

Browse files
committed
Fixed Password Binding Issue
1 parent 2498f2f commit 7b33809

File tree

17 files changed

+25
-12
lines changed

17 files changed

+25
-12
lines changed
-4 KB
Binary file not shown.

SyncPlayWPF/SyncPlayWPF/Common/Shared.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace SyncPlayWPF.Common {
88
public class Shared {
99
public static WpfPageTransitions.PageTransition WindowPageTransition;
1010
public static WpfPageTransitions.PageTransition LandingPageTransition;
11-
11+
public static SyncPlay.SyncPlayWrapper Wrapper;
1212

1313
}
1414
}

SyncPlayWPF/SyncPlayWPF/CustomControls/PromptingPasswordBox.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,26 +48,27 @@ public class PromptingPasswordBox : Control {
4848
static PromptingPasswordBox() {
4949
DefaultStyleKeyProperty.OverrideMetadata(typeof(PromptingPasswordBox), new FrameworkPropertyMetadata(typeof(PromptingPasswordBox)));
5050

51-
5251

52+
53+
5354
}
5455

56+
5557
public override void OnApplyTemplate() {
5658
var PasswordBox = GetTemplateChild("UserInputBox") as PasswordBox;
5759
PasswordBox.PasswordChanged += PasswordChanged;
5860
}
5961

6062
private void PasswordChanged(object sender, RoutedEventArgs e) {
61-
var password = ((PasswordBox)sender).Password;
62-
Console.WriteLine(password);
63-
this.FieldCompleted = !String.IsNullOrEmpty(password);
63+
this.ActualPassword = ((PasswordBox)sender).Password;
64+
this.FieldCompleted = !String.IsNullOrEmpty(this.ActualPassword);
6465
}
6566

6667
public static readonly DependencyProperty FieldCompletedProperty = DependencyProperty.Register("FieldCompleted", typeof(bool), typeof(PromptingPasswordBox), new PropertyMetadata(false));
6768
public static readonly DependencyProperty PromptingTextProperty = DependencyProperty.Register("PromptingText", typeof(string), typeof(PromptingPasswordBox), new PropertyMetadata(""));
6869
public static readonly DependencyProperty FocusedUnderlineBrushProperty = DependencyProperty.Register("FocusedUnderlineBrush", typeof(Brush), typeof(PromptingPasswordBox), new PropertyMetadata(default(Brush)));
6970
public static readonly DependencyProperty HoverUnderlineBrushProperty = DependencyProperty.Register("HoverUnderlineBrush", typeof(Brush), typeof(PromptingPasswordBox), new PropertyMetadata(default(Brush)));
70-
public static readonly DependencyProperty ActualPasswordProperty = DependencyProperty.Register("ActualPassword", typeof(SecureString), typeof(PromptingPasswordBox), new PropertyMetadata(default(SecureString)));
71+
public static readonly DependencyProperty ActualPasswordProperty = DependencyProperty.Register("ActualPassword", typeof(string), typeof(PromptingPasswordBox), new PropertyMetadata(default(SecureString)));
7172

7273
public bool FieldCompleted {
7374
get { return (bool)GetValue(FieldCompletedProperty); }
@@ -88,8 +89,8 @@ public Brush HoverUnderlineBrush {
8889
set { SetValue(HoverUnderlineBrushProperty, value); }
8990
}
9091

91-
public Brush ActualPassword {
92-
get { return (Brush)GetValue(ActualPasswordProperty); }
92+
public string ActualPassword {
93+
get { return (string)GetValue(ActualPasswordProperty); }
9394
set { SetValue(ActualPasswordProperty, value); }
9495
}
9596
}

SyncPlayWPF/SyncPlayWPF/Pages/NewSessionPage.xaml.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,19 @@ public NewSessionPage() {
2323
}
2424

2525
private void JoinRoom_Clicked(object sender, RoutedEventArgs e) {
26-
Common.Shared.WindowPageTransition.ShowPage(new Pages.SessionLandingPage());
2726

27+
var serverIp = ServerAddressField.Text.Split(':')[0];
28+
var serverPort = Int32.Parse(ServerAddressField.Text.Split(':')[1]);
29+
var username = UsernameField.Text;
30+
var password = PasswordField.ActualPassword;
31+
var roomName = RoomNameField.Text;
32+
33+
Console.WriteLine($"Server : {serverIp}:{serverPort}\n" +
34+
$"Username : {username}\n" +
35+
$"Password : {password}\n" +
36+
$"Room Name : {roomName}");
37+
38+
Common.Shared.WindowPageTransition.ShowPage(new Pages.SessionLandingPage());
2839

2940
}
3041
}

SyncPlayWPF/SyncPlayWPF/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@
5151
// You can specify all the values or you can default the Build and Revision Numbers
5252
// by using the '*' as shown below:
5353
// [assembly: AssemblyVersion("1.0.*")]
54-
[assembly: AssemblyVersion("2021.201.40.0")]
55-
[assembly: AssemblyFileVersion("2021.201.40.0")]
54+
[assembly: AssemblyVersion("2021.201.46.0")]
55+
[assembly: AssemblyFileVersion("2021.201.46.0")]
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)