private void UnhookAssociatedObject() { if (AssociatedObject == null) { return; } // Stop listening for PasswordChanged routed event PasswordChangedWeakEventManager.RemoveListener(AssociatedObject, this); }
private void HookAssociatedObject() { if (AssociatedObject == null) { return; } // make sure the AssociatedObject is not already hooked UnhookAssociatedObject(); // setup the PasswordBox with the current password OnSecurePasswordChanged(); // Listen for PasswordChanged routed event PasswordChangedWeakEventManager.AddListener(AssociatedObject, this); }