Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5993511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:41:08+00:00 2026-05-22T23:41:08+00:00

Currenlty, I’m using as Below. In xaml, <Button Content=X Width=33 Height=16 Padding=1,-2,1,0 Command={Binding ElementName=UserControlName,

  • 0

Currenlty, I’m using as Below.

In xaml,

<Button Content="X" Width="33" Height="16" Padding="1,-2,1,0"  
 Command="{Binding ElementName=UserControlName, Path=DataContext.DenyCommand}"
   <Button.CommandParameter>
     <wpfext:UICommandParameter UICommandCallerCallback="{Binding ElementName=UserControlName, Path=UIDenyCallBackCommand}"/>
   </Button.CommandParameter>
</Button>

In xaml.cs,

 public UICommandCallerCallback UIDenyCallBackCommand
        {
            get;
            private set;
        }
public UserControlName()
        {

            this.UIDenyCallBackCommand = this.UIAccessDenyCallBack;
            this.InitializeComponent();

        }

 public void UIAccessDenyCallBack(object commandParameter, object callbackData)
        {
            ShowADenyMsgBox();
        }

private void ShowDenyMsgBox()
{
             RightsDenied win = new RightsDenied(); //xaml window
            win.Owner = GetImmediateWindow();
            win.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            win.ShowDialog();
}

In ViewModel.cs,

internal ViewModel()
        {
         this.DenyCommand= new DenyCommand(this.AccessDeny);
        }
public void AccessDeny(ICommandState commandState)
        {
            commandState.InvokeCallerCallback("AccessDenied");
        }

public CommandCallback DenyCommand
        {
            get;
            private set;
        }

UICommandCallerCallback is declared as below.

public delegate void UICommandCallerCallback(object commandParameter, object callbackData);

CommandCallback class is as below.

public class CommandCallback:ICommand
    {
        private readonly Action<ICommandState> executeMethod;

        private readonly Func<ICommandState, bool> canExecuteMethod;

        public CommandCallback(Action<ICommandState> executeMethod)
            : this(executeMethod, null)
        {
        }

        public CommandCallback(Action<ICommandState> executeMethod, Func<ICommandState, bool> canExecuteMethod)
        {
            if (executeMethod == null)
            {
                throw new ArgumentNullException("executeMethod");
            }
            this.executeMethod = executeMethod;
            this.canExecuteMethod = canExecuteMethod;
        }  

        public bool CanExecute(object parameter)
        {
            return this.canExecuteMethod != null ? this.canExecuteMethod((ICommandState)parameter) : true;
        }

        public void Execute(object parameter)
        {
            if (parameter == null)
            {
                throw new ArgumentNullException("parameter","CommandCallback parameter cannot be null");
            }
            if (!(parameter is ICommandState))
            {
                throw new ArgumentException("expects a parameter of type ICommandState","parameter");
            }

            ICommandState state = (ICommandState)parameter;
            this.executeMethod.Invoke(state);
        }

        public event EventHandler CanExecuteChanged
        {
            add
            {
                CommandManager.RequerySuggested += value;
            }

            remove
            {
                CommandManager.RequerySuggested -= value;
            }
        }
    }

It’s working fine if it just to pop up the dialog box, but I want to wait for the result of the dialog and want to continue AccessDeny() function. For eg.

public void AccessDeny(ICommandState commandState)
            {
               1. processs
               2. open xaml window and wait for the dialogresult. (i.e Yes No or Cancel)
               3. Based on the result, continue processing.

            }

What could be the best way to do this work flow? Please advise. Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T23:41:09+00:00Added an answer on May 22, 2026 at 11:41 pm

    Read through User Interaction Patterns in this documentation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an XML file that needs parsing in PHP. I am currenlty using
Currenlty I am trying to publish usinf aspnet compiler using a batch file start
I'm currenlty using SSIS for some process flow, scripting, and straight data import. Most
I am currenlty using the JTable rowFilter for filtering my rows. The filter hide
I'm currenlty using Asp.Net Dynamic Data, with Linq to Sql, to create an simple
I am having an issue with Dynamic Binding in JSF page I am using
How can I filter a datatable without using LINQ? I am currenlty using .NET
I have to draw precise archs in java. I am currenlty using Graphics2D.fillArc(). The
Currently, I am developing a product that does fairly intensive calculations using MS SQL
Currently I using the following code to get my JSON output from MySQL. <?php

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.