.net – 没有’WPF功能区应用程序’的项目模板
我无法获得在Visual Studio中显示的
WPF功能区项目.
Here是指向Visual Studio 2010中存在问题的人的线程的链接.
我已经尝试了那里建议的一切,但无济于事. 我安装了Visual Studio 2012 Express for Desktop但没有显示任何内容.我试过卸载并重新安装,但没有运气.
一个简单的解决方法是简单地替换< Window>与< RibbonWindow>和< Ribbon>作为第一个孩子.请记住,Ribbon control已集成到.NET 4.5中.
首先通过用RibbonWindow替换Window来编辑MainWindow.xaml并添加< Ribbon x:Name =“Ribbon”Title =“Ribbon Title”>. 例: <RibbonWindow x:Class="WpfApplication3.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" x:Name="RibbonWindow" Width="640" Height="480"> <Grid x:Name="LayoutRoot"> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <Ribbon x:Name="Ribbon" Title="Ribbon Title"> ........... </Ribbon> </Grid> </RibbonWindow> 您还需要编辑MainWindow.xaml.cs以继承RibbonWindow类而不是Window. public partial class MainWindow : RibbonWindow 最后记得从.NET Framework导入引用. System.Windows.Controls.Ribbon 编辑:使用VB.Net解决方案进行更新. 1)添加参考 >右键单击您的项目,然后选择“添加引用”. 2)编辑您的MainWindow.xaml >备份任何现有代码. 3)编辑Mainwindow.xaml.vb >右键单击MainWindow.xaml,然后单击“查看代码”. 4)运行程序! (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |