VSSDK Howto Fill MRUList into MRUListBox
Thomas Goessi (Step Ahead Schweiz AG)
1
Reputation point
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
Sign in to answer