RadDocking PaneStateChange

1 Answer 20 Views
Docking
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Deltaohm asked on 02 Nov 2023, 04:23 PM

Hi

I set the PaneStateChange event in RadDocking, but the argument of method is of type RadRoutedEventArgs that is useless  because it not contains information about the pane and the state. In https://docs.telerik.com/devtools/wpf/controls/raddocking/events/overview is written that the argument should be ActivePangeChangedEventArgs (that inherits from RadRoutedEventArgs but the cast give me null).

Telerik is 2023.02

Thank you

Luigi

 

1 Answer, 1 is accepted

Sort by
0
Dinko
Telerik team
answered on 07 Nov 2023, 03:17 PM

Hello Luigi,

I have reviewed the article, and it seems that it contains false information regarding the type of the event's arguments for the PaneStateChange event. As a result of this, I have updated the article. I also updated your Telerik points as a small gesture of gratitude for bringing this to our attention.

Regarding the arguments, they are of the type RadRoutedEventArgs, which extends the native RoutedEventArgs. Through the exposed properties from the native RoutedEventArgs, you could retrieve the RadPane element that has raised this event and use its properties to implement the desired logic. You can take the current RadPane element through the e.OriginalSource property of the RadRoutedEventArgs class.

The following article shows a sample scenario of the above-shared information:

<telerik:RadDocking x:Name="radDocking"
                    PaneStateChange="radDocking_PaneStateChange" />
private void radDocking_PaneStateChange(object sender, RadRoutedEventArgs e)
{
	RadPane pane = (RadPane)e.OriginalSource;

	if (!pane.IsPinned)
	{
		var paneHeader = pane.Header;
		MessageBox.Show($"Pane Header: {paneHeader}\nPane State: Unpinned");
	}
	else
	{
		var paneHeader = pane.Header;
		MessageBox.Show($"Pane Header: {paneHeader}\nPane State: Pinned");
	}
}

For your convenience I attached a sample solution where this behavior is implemented.

Regards,
Dinko
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Docking
Asked by
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Answers by
Dinko
Telerik team
Share this question
or