WPF-色带的更换



我有一个WPF UI,里面有Ribbon类。我最近不得不将我的UI切换到旧的framework.net 3.5,Ribbon似乎是在.net 4.5中引入的。

如何切换和取消色带控制?

为了不需要替换太多源代码,什么是最合适的路径??

我当前的代码如下:

<RibbonToggleButton x:Name="_ribbon1" Grid.Row="0" Grid.Column="0">
<RibbonToggleButton.IsChecked>
<MultiBinding Converter="{StaticResource boolCopyPaster}">
<Binding ElementName="_copy" Path="IsSelected"></Binding>
<Binding ElementName="_paste" Path="IsSelected"></Binding>
</MultiBinding>
</RibbonToggleButton.IsChecked>
</RibbonToggleButton>
<RibbonMenuButton x:Name="_selectorMenu" Grid.Row="0" Grid.Column="1">
<RibbonGallery x:Name="_selector" Width="200">
<RibbonGalleryCategory Header="Selectors">
<RibbonGalleryItem x:Name="_item1">
<Line Y1="7" Y2="7" X2="25" Stroke="Black"></Line>
</RibbonGalleryItem>
</RibbonGalleryCategory>
</RibbonGalleryCategory>
</RibbonMenuButton>

如果使用.NET Framework 3.5 Service Pack 1或更高版本,则可以从Microsoft官方网站下载外部Ribbon程序集:https://www.microsoft.com/en-us/download/details.aspx?id=11877.这是Ribbon控件的原始版本,后来将其纳入.NETFramework4.5。

最新更新