This question is locked. New answers and comments are not allowed.
Hi,
What is the best way to retrieve a result from a command? For example, I want to know whether or not a row was deleted when I do the above. When I do cutOption_Click I would like to know if the delete of the row actually happened. Should I use
an instance variable? Is the main class threadsafe? Or is their a way to pass in a parameter to the methods that can be inspected upon completion?
Thanks,
Carl
private void deleteOption_Click(object sender, RoutedEventArgs e) { var deleteCommand = RadGridViewCommands.Delete as RoutedUICommand; if (selectedItem == null) { return; } if (selectedItem.GetType() == typeof(RadGridView)) { var rgv = (RadGridView)selectedItem; deleteCommand.Execute(null, rgv); } } private void cut_Click(object sender, RoutedEventArgs e) { deleteOption_Click(sender, e); }
private void _deletingOption(object sender, GridViewDeletingEventArgs e) { IEnumerable<object> items = e.Items; if (items == null) { return; } IEnumerator<object> optionEnum = items.GetEnumerator(); optionEnum.MoveNext(); RadControlsSilverlightApp5.com.tradestonesoftware.optionssheet.model.Option option = (RadControlsSilverlightApp5.com.tradestonesoftware.optionssheet.model.Option)optionEnum.Current; if (option.boms != null && option.boms.Count != 0) { Dispatcher.BeginInvoke(() => { System.Windows.Browser.HtmlPage.Window.Alert("Row has children. Delete child rows first."); }); e.Cancel = true; } e.Handled = true; } an instance variable? Is the main class threadsafe? Or is their a way to pass in a parameter to the methods that can be inspected upon completion?
Thanks,
Carl