【发布时间】:2015-02-04 20:06:56
【问题描述】:
我有一个 .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 而非我的应用程序中的代码创建的
【问题讨论】:
标签: c# wpf .net-4.5 ribbon recent-file-list