TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Roberto Salemi
NA
146
142.1k
[ModernDialog][MessageBoxResult] Cancel Button on second win
Apr 23 2015 11:07 AM
Hi,
I'm using the ModernDialog that contains a UserControl, it has a custom button:
Button customButtonClose = new Button() { Content = "Close" };
customButtonClose.Click += (ss, ee) =>
{
CheckPendingChanges();
dialog.Close();
};
dialog.Buttons = new Button[] { customButtonSave, customButtonClose };
In CheckPendingChanges():
var rsltDialog = Utils.ShowMessageYesNoClose("Are there a pending changes, save?");
if (rsltDialog == MessageBoxResult.Yes)
{
result = customFunction();
}
where Utils.ShowMessageYesNoClose() is:
public static MessageBoxResult ShowMessageYesNoClose(string text)
{
var dlg = new ModernDialog
{
Title = (string)Application.Current.FindResource("mdAppTitle"),
Content = new BBCodeBlock { BBCode = text, Margin = new Thickness(0, 0, 0, 8) },
MinHeight = 0,
MinWidth = 0,
MaxHeight = 480,
MaxWidth = 640,
};
dlg.YesButton.Content = (string)Application.Current.FindResource("msgBoxResultYes");
dlg.NoButton.Content = (string)Application.Current.FindResource("msgBoxResultNo");
dlg.Buttons = new[] { dlg.YesButton, dlg.NoButton, customCancelClose, dlg.CancelButton };
dlg.ShowDialog();
return dlg.MessageBoxResult;
}
I have this problem: when I click on CancelButton, the two windows are closing together, but I would close only second window, the one with the application.
Where is the error?
Reply
Answers (
1
)
RDLC Reports
Application print some weird data