示例#1
0
        private void UnhookAssociatedObject()
        {
            if (AssociatedObject == null)
            {
                return;
            }

            // Stop listening for PasswordChanged routed event
            PasswordChangedWeakEventManager.RemoveListener(AssociatedObject, this);
        }
示例#2
0
        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);
        }