Add DashboardWindow, controlls to close the login than open the dashboard

This commit is contained in:
Rene Schwarz
2021-04-04 21:22:13 +02:00
parent 5a1681498a
commit 73f864ea20
49 changed files with 729 additions and 24 deletions

View File

@@ -16,5 +16,6 @@ namespace Server_Dashboard {
public static Property GetValue(DependencyObject d) => (Property)d.GetValue(ValueProperty);
public static void SetValue(DependencyObject d, Property value) => d.SetValue(ValueProperty, value);
public virtual void OnValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) { }
public virtual void OnClose(DependencyObject sender, DependencyPropertyChangedEventArgs e) { }
}
}

View File

@@ -27,4 +27,17 @@ namespace Server_Dashboard {
SetValue(sender, ((PasswordBox)sender).SecurePassword.Length < 1);
}
}
public class CloseProperty : BaseAttachedProperty<CloseProperty, bool> {
public override void OnValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) {
if(sender is Window window) {
window.Loaded += (s, e) => {
if(window.DataContext is IWindowHelper wh) {
wh.Close += () => {
window.Close();
};
}
};
}
}
}
}