Tuesday, November 3, 2015

A C1 Visual Style aware Message Box - Our ComponentOne

Here ware two artcles about how to use the component one Message Box control for Silverlight.  The message box the comes with Silverlight is really limiting. It only allows users to send "OK" and "Cancel" as responses. the Component One version gives a lot more options but the problem is it does not return any values so instead you have to do the following:




C1MessageBox.Show("Do you want to delete?", "The question", C1MessageBoxButton.YesNoCancel, C1MessageBoxIcon.Question,
                new System.Action<MessageBoxResult>((result) =>
                {
                    switch (result)
                    {
                        case MessageBoxResult.Yes:
                            MessageBox.Show("You Pressed Yes");
                            break;
                        case MessageBoxResult.No:
                            MessageBox.Show("You Pressed No");
                            break;
                        case MessageBoxResult.Cancel:
                            MessageBox.Show("Are you sure you want to cancel");
                            break;
                    }
                }));




A C1 Visual Style aware Message Box - Our ComponentOne



and



http://our.componentone.com/groups/topic/c1messageboxresult/

No comments:

Post a Comment