VSSDK Howto Fill MRUList into MRUListBox

2020-08-07T06:43:48.447+00:00

I have an MruListBox container in a xaml and I want to fill them with the MruList of the latest used projects in VS2019.

The code I use in the XAML is:

<vs:MruListBox
    ItemsSource="{Binding Path=Items}"
    AutomationProperties.AutomationId="MruList" FontFamily="Segoe UI"/>

Now how can I get the MruList, which I want to set to the property Items so that the list is shown.

I tried to get the MruList with the command

IVsWebURLMRU weburlmru =this.GetService(typeof(SVsWebURLMRU)) as IVsWebURLMRU;

and also with

IVsWebURLMRU weburlmru =Package.GetGlobalService(typeof(SVsWebURLMRU)) as IVsWebURLMRU;

and then with

weburlmru.GetURLArray(out object list);

but the array is empty.

I also tried to use an example by Microsoft, where a menu with the last used items are shown, but I think this example was used in an older VisualStudio version. I need them for VS 2019.

Regards, Tom

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,189 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.