wpf - Custom Message Box Advice -
Well, I'm using a custom window box that comes with some custom control boxes that accompany the text The producers who are displayed are called.
I have a defined event, which has been subscribed through the original class, it gets burnt when clicking on the button.
However, I can not see how to use it effectively, I would like to return one yes, whether yes or not, but obviously my code will continue to execute, so this Below is some example code to clarify the problem that the method has subscibed by clicking on the button.
Message box window
Public partial class custom message box: window {public representative message messagebox object sender, event events e); Public event messagebox handler messagebox document; Public Customs Box () {Initial group (); } Public Customsbox (String Message) {InitializeComponent (); This.txtdescription.Text = Message; } Public Customsbox (String Message, String Title, String First BTNtext) {Initialization (); This.lbltitle.Content = Title; This.txtdescription.Text = Message; This.btnstart.Content = firstBtnText; }} Public Static Class Message Box Button Click {Public Static Ball Yes {get; Set; } Not receiving public stable bulls; Set; } Cancel public static block {get; Set; }}
window that instantiates the message box window
Hope this clarifies enough, I can not put any execution code i.e. meaning it uses a certain method in my application several times.
The problem is very difficult to understand, in addition to the code you have written, there is no call , Which will actually show the custom message box window.
But I'll take a knife on it ... First of all, am I right, it is being speculated that in your main window, if you want to wait your code (go ahead _msgbox) , The user will actually press a button currently in your custom message box (currently it only shows the message box and executes the next statement)?
If so, then I think you are showing your message box window with the show () method. Use ShowDialog () instead of the code box execution will stop, until the message box closes.
If you do not want to use a modal dialogue, then there are two options, either use thread sync objects (for example AutoResetEvent) or when a new event is set when the message box is closed Goes and executes its code execution in the closed event handler (the last line in StartProcess_Click will be the call to _msgbox.Show () and if (_msgbox go ahead) will be in the closed event handler.)
Comments
Post a Comment