2012-09-04 124 views
1

因爲我沒有發現有關我對谷歌的關注的信息,所以我會在這裏嘗試。將Visual Studio 2010 StartPage升級到2012?

在Visual Studio 2010上,可以創建Custom Start Pages。 我一年前做過一次,現在我已經習慣了。

那麼,隨着Visual Studio 2012發佈,我無法再使用我的(VSIX)自定義開始頁面。

在MSDN上,我發現這個:How to: Upgrade Visual Studio SDK/VSIX Projects to Visual Studio 2012,但是在我做完所有事情之後,它仍然無法工作。

的問題其實是,有沒有「起始頁項目模板」(要查找在擴展管理器)在Visual Studio 2010中

所以我發現這一點:How to: Manually Create a Start Page,但其完全地錯誤和複製/粘貼,因爲它會導致Visual Studio 2010,但它會告訴Visual Studio 2012在頂部。

的教程後,我得到這個:

<Grid xmlns:sp="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.StartPage" 
     xmlns:vs="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.11.0" 
     xmlns:vsfx="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.11.0" 
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
     mc:Ignorable="d" 
     d:DesignHeight="300" d:DesignWidth="300"> 
<Grid> 
    <Label Content="My ListView:" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Foreground="White"/> 
    <ListView Width="Auto" Height="Auto" Margin="10,40,10,10" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"> 
     <ListView.View> 
      <GridView> 
       <GridViewColumn/> 
      </GridView> 
     </ListView.View> 
    </ListView> 
</Grid> 

這並不在VS2012工作,但在VS2010它就像一個魅力。

至少我沒有選擇,比自己嘗試一下。 我使用的教程中我提供的最後一個環節(How to: Manually Create a Start Page)

起點:創建一個空白起始頁和步驟5:在編輯器中,更改頂級用戶控件元素網格元素而不刪除任何命名空間聲明

我沒有這樣做 - 我讓它成爲一個UserControl,然後我可以從Tools> Options> StartPage> Customize Start Page選擇XAML,唯一的問題是現在,我不能CodeBehind,因爲我不得不刪除x:類(看看第6步)..

XAML中的內聯代碼不是一個選項,所以如果有人能幫助我,我如何將VSIX自定義起始頁升級到VS2012,或者我如何創建具有Codebehind功能的工作空白起始頁,或者如果我需要等到有人發佈VS2012的起始頁項目模板,我將非常感激。

回答

0

至少我沒能解決我的問題..我從頭開始,並與InlineCode創建那麼一切(肯定與XAML和WPF)

0

這個帶有Grid的xaml文件應該像真正的實現一樣處理爲'shell'。將網格的內容移動到單獨程序集中定義的單獨用戶控件(可以使用後面的代碼)。然後添加xmlns引用和這個新的控件到網格。

的XAML與電網進入到\ Documents \ Visual Studio 2010的\ StartPages \ 大會與您的用戶控制權轉至\ Common7 \ IDE \ PrivateAssemblies

+0

至少我能完成我的起始頁,我使用了XAML-Only而沒有Codebehind,所有代碼都被寫入到一個單獨的庫/ dll中,並且我正在xaml中引用它。 – eMi

相關問題