Shell tree doesn't automagically scorll selected item into place when used in popupbutton

Shell for WPF Forum

Posted 5 years ago by Douglas Gerard - Jackalope Technologies, inc.
Version: 19.1.0682
Platform: .NET 4.8
Environment: Windows 10 (64-bit)
Avatar

I have a simple project that uses a popup button to select a folder.

When opened via the pop up the control displays, but doesn't scroll to the selected item.

Any help making this happen would be appreciated.

See project here.

(https://jackalopetechnologies-my.sharepoint.com/:u:/p/douglas/ETJTlx7Uo51No0Uj5-VsFCIBCKCzVQM8w49hNVo0lMC53g?e=izmVNF)

[Modified 5 years ago]

Comments (1)

Posted 5 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Thanks for the sample.  I believe the problem is that you might be setting SelectedDirectory too early, before shell data has loaded.  Then it fails to find anything and the control ends up selecting the first item as it loads, which replaces your SelectedDirectory value.  

If you remove all the popup event handlers and do this instead, it seems to work:

this.Dispatcher.BeginInvoke(DispatcherPriority.Loaded, (Action)(() => {
	SelectedDirectory = @"C:\Games";
}));


Actipro Software Support

The latest build of this product (v24.1.3) was released 28 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.