We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

DocumentContainer

Thread ID:

Created:

Updated:

Platform:

Replies:

76013 Aug 20,2008 04:31 AM UTC Sep 28,2009 03:54 AM UTC WPF 6
loading
Tags: Tools
Erik Renaud
Asked On August 20, 2008 04:31 AM UTC

I am trying to capture an event that would signify that a loaded document is closing.

After adding a new UserControl to the Items collection, i try registering for the DocumentClosing event but don't receive anything.

Any thoughts ?


Balavasanth [Syncfusion]
Replied On August 22, 2008 07:56 AM UTC


Hi Erik,

Currently it is not possible to capture an event that would signify that a loaded document is closing. This has been considered as a defect with the Document Container. This will be fixed once DocumentContainer integration with DockingManager gets implemented.

Please let us know if you have any questions.

Thanks for your interests in Syncfusion products.

Regards,
Bala.




Paw Nielsen
Replied On September 22, 2009 09:56 AM UTC

Has this defect been rectified yet?

C. Sudha [Syncfusion]
Replied On September 23, 2009 10:05 AM UTC

Hi Paw,

Thank you for your interest in Syncfusion products.

We have implemented an event called DocumentClosing associated with the Document Container, using which you can achieve your requirements. Kindly make use of the code snippet for more idea.

In Document Container control:

[XAML]





[C# Code]

private void DocumentContainer_DocumentClosing(object sender, CancelingRoutedEventArgs e)
{
MessageBoxResult res = MessageBox.Show("Do you really want to close this window?", "Attention", MessageBoxButton.YesNo, MessageBoxImage.Asterisk);
e.Cancel = !(MessageBoxResult.Yes == res);
}


In DockingManager control:

[XAML]

ContainerMode="MDI">
syncfusion:DockingManager.Header="Docking Manager"
/>


[C# Code]

private void DockingManager_DocumentClosing(object sender, CancelingRoutedEventArgs e)
{
MessageBoxResult res = MessageBox.Show("Do you really want to close this window?", "Attention", MessageBoxButton.YesNo, MessageBoxImage.Asterisk);
e.Cancel = !(MessageBoxResult.Yes == res);
}

Please let me know if you have any question.

Regards,
SudhaC.

Paw Nielsen
Replied On September 24, 2009 12:42 PM UTC

Thanks SudhaC,

I am using the Docking Manager.
If the user opens the tab-context menu and clicks "Close" then the DocumentClosing event does not fire, I can catch CloseButtonClick but this event does not allow me to cancel the closure of the document.
I am missing something?

Paw Nielsen
Replied On September 25, 2009 08:45 AM UTC

FYI for now I have solved this problem by implementing my own context menu on the tab item:

XAML:



















C# Code-behind:

private void Tab_Close(object sender, RoutedEventArgs e)
{
// check if closing should be cancelled (add your own implementation)
if (!WasCanceled...)
{
// close the window
dockingManager.Children.Remove(dockingManager.ActiveWindow);
}
}
private void Tab_Float(object sender, RoutedEventArgs e)
{
dockingManager.ActiveWindow.SetValue(DockingManager.StateProperty, DockState.Float);
}

private void Tab_Dock(object sender, RoutedEventArgs e)
{ dockingManager.ActiveWindow.SetValue(DockingManager.StateProperty, DockState.Dock);
}

private void Tab_Document(object sender, RoutedEventArgs e)
{ dockingManager.ActiveWindow.SetValue(DockingManager.StateProperty, DockState.Document);
}

Hemanth Kumar K [Syncfusion]
Replied On September 28, 2009 03:54 AM UTC

Hi Paw,

Sorry for the inconvenience caused We found that this is an issue with DocumentContainer and we filed bug report for this. Kindly create new incident in our direct-trac system so that we can update you with custom assemblies. Also We have noticed you've submitted a number of specific technical inquiries here in the Forums which seem to indicate you are a current customer rather than an evaluator or tester. If so, you might like to
know that you have an existing personal Direct-Trac account available using your own email address, and we highly recommend using your personal account. You'll get a faster response along with an automatic update when your question is answered via DirectTrac, and you can login and view your
incident history 24x7.
Simply visit
https://www.syncfusion.com/Support/DirectTrac/logon.aspx?URL=/Support/DirectTrac/default.aspx to
login. If you have any further questions, we hope you will take advantage of your existing account and
available services as a license holder.


Regards,
Hemanth Kumar K

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;