This is a migrated thread and some comments may be shown as answers.

Detecting whitch dialog is going to be displayed?

1 Answer 59 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Pavel
Top achievements
Rank 1
Pavel asked on 04 Feb 2011, 06:38 PM
Is possible to recognize whitch dialog is going to be displayed in ShowDialog event? I´d like to enable only Delete dialog to be displayed and to disable all other dialogs by e.Cancel = true.

1 Answer, 1 is accepted

Sort by
0
Pavel
Top achievements
Rank 1
answered on 05 Feb 2011, 12:58 PM
I found solution, so problem solved :-)

        public ScenarioScheduler()
        {
            InitializeComponent();
            CommandManager.AddPreviewExecutedHandler(this, OnCommandExecuted);
        }
 
        string commandName;
 
        private void OnCommandExecuted(object sender, ExecutedRoutedEventArgs e)
        {
            commandName = (e.Command as RoutedCommand).Name;
        }
 
private void radScheduler_ShowDialog(object sender, ShowDialogEventArgs e)
        
            if (!commandName.Equals("DeleteAppointment"))
                e.Cancel = true;
        }
Tags
ScheduleView
Asked by
Pavel
Top achievements
Rank 1
Answers by
Pavel
Top achievements
Rank 1
Share this question
or