VMRU Howto Fill MRUList

2020-08-07T06:41:04.65+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

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
38,709 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.