This is a migrated thread and some comments may be shown as answers.

RadDocking.ElementLoading Issue...

6 Answers 163 Views
Docking
This is a migrated thread and some comments may be shown as answers.
RoadWarrior
Top achievements
Rank 1
RoadWarrior asked on 26 Mar 2010, 07:26 PM
There is an issue with the RadDocking.ElementLoading event argument.  The e.AffectedElement property always equals null.  This is unexpected given the Telerik documentation examples.  Below is a code snippet from the Telerik help file in the topic "Save/Load the Content of the Panes".  Note, that the content will never be set!!!

private void radDocking_ElementLoading( object sender, Telerik.Windows.Controls.LayoutSerializationLoadingEventArgs e )
{
   var pane = e.AffectedElement
as RadPane;
   
if ( pane != null )
   {
       pane.Content =
this.GetPaneContent( e.AffectedElementSerializationTag );
   }
}

FYI, it is populated, however, in the RadDocking.ElementLoaded event. 

6 Answers, 1 is accepted

Sort by
0
Miroslav Nedyalkov
Telerik team
answered on 29 Mar 2010, 12:20 PM
Hi Rick,

 This is expected as the element is not created yet in this event. This event lets you create the element yourself and pass it using the arguments. The element is created if you don't pass anything. I couldn't find where in the documentation it is set that this property shouldn't be null. Could please sent us a link - this way we will be able to find the error and fix it.

Regards,
Miroslav Nedyalkov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
RoadWarrior
Top achievements
Rank 1
answered on 29 Mar 2010, 01:58 PM
This is an example from the local Telerik help topic in your Q1 release entitled:  "Save/Load the Content of the Panes". The URI to the help topic is :

ms-help://telerik.windows.controls.Silverlight/telerik.windows.controls.docking/raddocking-save-load-the-content-of-the-panes.html


0
Miroslav Nedyalkov
Telerik team
answered on 30 Mar 2010, 09:43 AM
Hello Rick,

 Thank you for the provided information!

Does this article correspond to the following online help article: http://www.telerik.com/help/wpf/raddocking-features-save-load-layout.html?

If yes - do you mean the part at the end where is explained what which events does (this is the only part of the article where ElementLoading is mentioned)?

We will consider making the article more clear to avoid further misunderstandings.

Once again, thank you for the provided information! Your Telerik points were updated.

Kind regards,
Miroslav Nedyalkov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
RoadWarrior
Top achievements
Rank 1
answered on 03 Apr 2010, 06:47 PM
The article you linked to is not the correct article.  The correct article is:Save and Load Content

Also, I think you may be incorrect that the e.AffectedElement should be expected to be null.  Otherwise, there is no point to even having the ElementLoading event without a reference to the element being loaded.  I don't think you need to fix your documentation, I think you need to fix the bug.


0
Miroslav Nedyalkov
Telerik team
answered on 06 Apr 2010, 11:51 AM
Hello Rick,

 The property is null, because the element is not created yet. There is no point to allow the user to replace already created elements, because this way the element could be created twice. There is such property, because the event args inherit from the event args of the other events and the property is inherited as well.

Regards,
Miroslav Nedyalkov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
RoadWarrior
Top achievements
Rank 1
answered on 06 Apr 2010, 03:44 PM
There is an important distinction between an element being "Created" and "Loaded".  In fact, this is probably why the  Telerik API was designed as it was. Having the ElementLoading event pass in the Created but not Loaded element provides the ability to allow for decisions to made whether to (Modify, Cancel, or Replace) prior to incurring the cost associated to the element being loaded.

Your logic doesn't really make sense in your last post.  If I decide to replace an element whether that be in the Loading or Loaded event, regardless the item will be created twice.  The main difference is that if it is done in the Loading (Prior to Load) we remove the cost of Adding/Removing the discarded element from the visual tree.


Tags
Docking
Asked by
RoadWarrior
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
RoadWarrior
Top achievements
Rank 1
Share this question
or