我有一个 .net 4.5 WPF 应用程序,它会自动(未额外编码)在任务栏中的 JumpList 中创建最近的条目。我想将这些 JumpList 项绑定到 RibbonApplicationMenu。我试图像这样获取当前的 JumpList:
this.JumpList = JumpList.GetJumpList(App.Current);
但我无法将列表绑定到 RibbonApplicationMenu。
<RibbonApplicationMenu.AuxiliaryPaneContent>
<RibbonGallery CanUserFilter="False" ScrollViewer.VerticalScrollBarVisibility="Auto" >
<RibbonGalleryCategory Header="Recent Documents" Background="Transparent" >
<JumpList JumpList="{Binding JumpList}"/>
</RibbonGalleryCategory>
</RibbonGallery>
</RibbonApplicationMenu.AuxiliaryPaneContent>
如何在不创建自己的列表的情况下将最近的列表放入我的 RibbonApplicationMenu。
编辑
我在我的 MainWpf 构造函数中这样做。
JumpList pJumpList = JumpList.GetJumpList(Application.Current);
pJumpList.ShowFrequentCategory = false;
pJumpList.ShowRecentCategory = true;
foreach (var item in this.pJumpList.JumpItems)
{
JumpPath path = item as JumpPath;
this.JumpListCollection.Add(path.Path);
}
我想从 RibbonMenu 的 Jumplist 中获取当前最近的项目
这个最近的项目是由 Windows 而不是我的应用程序中的代码创建的