Exemplo n.º 1
0
        /// <inheritdoc/>
        protected override void OnViewChanged(PresentationFoundationView oldView, PresentationFoundationView newView)
        {
            if (oldView != null)
            {
                if (IsDefault)
                {
                    oldView.UnregisterDefaultButton(this);
                }

                if (IsCancel)
                {
                    oldView.UnregisterCancelButton(this);
                }
            }

            if (newView != null)
            {
                if (IsDefault)
                {
                    newView.RegisterDefaultButton(this);
                }

                if (IsCancel)
                {
                    newView.RegisterCancelButton(this);
                }
            }

            UpdateIsDefaulted();

            base.OnViewChanged(oldView, newView);
        }
Exemplo n.º 2
0
        /// <inheritdoc/>
        protected override void OnViewChanged(PresentationFoundationView oldView, PresentationFoundationView newView)
        {
            if (oldView != null)
            {
                if (IsDefault)
                    oldView.UnregisterDefaultButton(this);

                if (IsCancel)
                    oldView.UnregisterCancelButton(this);
            }

            if (newView != null)
            {
                if (IsDefault)
                    newView.RegisterDefaultButton(this);

                if (IsCancel)
                    newView.RegisterCancelButton(this);
            }

            UpdateIsDefaulted();

            base.OnViewChanged(oldView, newView);
        }