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

Shell for WPF Forum

The latest build of this product (v2019.1 build 0682) was released 27 days ago, which was before this thread was created.
Posted 24 days 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 24 days ago]

Comments (1)

Posted 24 days 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

Add Comment

Please log in to a validated account to post comments.