この機能はWPFプロジェクトでは使用できないようです。それが動作し、いつも動作するとは限りません。Silverlightプロジェクトでのみ動作します。しかし、 "Open in Expression Blend ..."はそれほど複雑ではないので、ここではVisual Studioマクロを使用します。
Public Sub OpenInExpressionBlend()
Dim blendPath As String = Nothing
Dim key As String = "SOFTWARE\Microsoft\Expression\Blend\VS"
Dim registryKey As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(key)
If Not registryKey Is Nothing Then
blendPath = registryKey.GetValue("BlendLaunchPath")
registryKey.Close()
End If
If blendPath Is Nothing Then
MsgBox("Cannot find Blend", MsgBoxStyle.Exclamation, "Open in Expression Blend")
Return
End If
If DTE.SelectedItems.Count <> 1 Then
MsgBox("Not just one item selected", MsgBoxStyle.Exclamation, "Open in Expression Blend")
Return
End If
Dim item As SelectedItem = DTE.SelectedItems.Item(1)
If Not TypeOf item.ProjectItem Is ProjectItem Then
MsgBox("Not a project item", MsgBoxStyle.Exclamation, "Open in Expression Blend")
Return
End If
Dim projectItem As ProjectItem = item.ProjectItem
Dim project As Project = projectItem.ContainingProject
Dim file As String = projectItem.Name
If file.Substring(file.Length - 5) <> ".xaml" Then
MsgBox("Not a xaml file", MsgBoxStyle.Exclamation, "Open in Expression Blend")
Return
End If
While TypeOf projectItem.Collection.Parent Is ProjectItem
projectItem = CType(projectItem.Collection.Parent, ProjectItem)
file = projectItem.Name & "\" & file
End While
file = """" & file & """"
Dim projectPath As String = """" & project.FullName & """"
Dim blendArgs As String = projectPath & " /file:" & file
Dim process As System.Diagnostics.Process = New System.Diagnostics.Process()
& blendArgs) process.Start(blendPath、blendArgs) End Subの
更新:
これを使用するには、マクロIDEを使用してマクロを追加し、プロジェクトに追加します
ツール - >カスタマイズ - >コマンド - >コンテキストメニュー:プロジェクトとソリューションコンテキストメニュー|アイテム - >コマンドを追加... - >カテゴリー:マクロ - >コマンド:Macros.MyMacros.Personal.OpenInExpressionBlend - > OK
修正セレクション - >名前:ダウン式Blendで開く...
移動:(下に移動...)
注:このコマンドは、どのモジュールを追加したかによって異なります。
メールで返信するようにユーザーに依頼しないでください。あなたはここにあなたの質問を掲示し、人々はそれに答えます。そうすれば、あなただけでなく、誰にとっても役立ちます。 –