2013-04-05 29 views
0

是否有一個交互式XAML編輯器,可以與WPF一起使用,或者在XamlPadX 4.0中使用VisualStateManager?WPF的任何交互式XAML編輯器?

我試過XamlPadX 4.0,這很棒,直到我嘗試使用VisualStateManager進行一些操作時,它會窒息。 Cursory研究表明,VisualStateManager支持在Dotnet 4中得到WPF,而XamlPadX 4則由Dotnet 2.5構建。嘗試重定向XamlPadX以使用Dotnet 4尚未成功。

就我而言,混合似乎沒有交互模式,只是一個標準的VS樣式代碼/運行迭代循環。

我已經快速瀏覽過Kaxaml。它似乎有效,但是相當有限,例如沒有視覺樹探險家。

通過colinsmith

建議UPDATE混合功能我有VS2012更新2安裝,我已經使用混合,但沒有成功嘗試。例如,輸入下面的代碼,並從「對象和時間線」面板中選擇按鈕,結果「對象和時間線」面板顯示「(沒有故事板打開)」,並且在狀態面板中什麼也沒有。單擊Blend中的幫助將我帶到MSDN頁面,指出「我們很抱歉,無法找到您請求的頁面。」並在網上搜索使用Blend for WP20的指導,WPF拋出什麼都不會引起什麼驚訝,因爲WPF的支持僅僅在Blend for VS2012的VS2012 Update 2中增加了,而VS2012 Update 2是幾天前才發佈的。

<Window x:Class="BlendScratchProject.MainWindow" 
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
     Title="MainWindow" Height="91" Width="192"> 

    <Grid HorizontalAlignment="Center" VerticalAlignment="Center"> 
     <Button Content="Button"> 
      <Button.Template> 
       <ControlTemplate TargetType="Button"> 
        <Border x:Name="_rootElement"> 
         <Border.Background> 
          <SolidColorBrush x:Name="_borderBrush" Color="Black"/> 
         </Border.Background> 

         <Grid Margin="4"> 
          <Grid.Background> 
           <SolidColorBrush x:Name="_backgroundBrush" Color="Green"/> 
          </Grid.Background> 

          <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
           VerticalAlignment="{TemplateBinding VerticalContentAlignment}" 
           Margin="5"/> 
         </Grid> 

         <VisualStateManager.VisualStateGroups> 
          <VisualStateGroup x:Name="CommonStates"> 

           <VisualState x:Name="Normal"/> 

           <VisualState x:Name="MouseOver"> 
            <Storyboard> 
             <ColorAnimation Storyboard.TargetName="_borderBrush" 
              Storyboard.TargetProperty="Color" To="Red" Duration="0:0:0"/> 
            </Storyboard> 
           </VisualState> 

          </VisualStateGroup> 
         </VisualStateManager.VisualStateGroups> 
        </Border> 
       </ControlTemplate> 
      </Button.Template> 
     </Button> 
    </Grid> 

</Window> 
+0

你可能已經知道這一點......但總是有表情混合....你可以看看預覽http://www.microsoft。com/en-us/download/details.aspx?id = 30702 ...可以與WPF/.NET 4一起工作....不知道它是否需要VS2012存在於您的系統中...查看。或者你正在尋找一個「免費」選項? – 2013-04-05 13:41:12

+0

我在Blend中找不到任何交互模式,是否有一個? – Neutrino 2013-04-05 14:17:21

+0

您需要States面板才能爲您的VSM設計狀態。 http://www.oshyn.com/_blog/General/post/Using_Visual_State_Manager_and_Toggle_Button/ ...確保您使用的Blend預覽版本提及....或者您應該可以使用EXpression Blend 4. Visual Studio 2012 Update 2 ,現在將WPF支持構建到Visual Studio Blend中。 – 2013-04-05 14:24:40

回答

1

在Blend確保「過渡預覽」在美國的面板被激活,那麼您可以在狀態之間的狀態組只需切換(通過點擊)看到動畫。此鏈接

見選項5:

(注意:圖標看起來不同,取決於Blend的版本!)。

除此之外,您還可以看到XAML文本編輯器並輸入原始XAML並在輸入時看到它呈現(即按照Kaxaml等)。

對不起,如果這不是你想要的東西,或者我被密集理解你......下面

圖片,彰顯位來選擇。

enter image description here

警告:

只要確保你有一個支持WPF混合的版本...支持WPF留下的是與Visual Studio 2012 RTM來到交融的...來得到它回來你不得不使用下載和使用「混合+ SKETCHFLOW預覽視覺工作室2012」....但現在有一個適當的RTM版本在Visual Studio更新2.

如果您未使用Visual Studio 2012 ,那麼只需使用單獨的Expression Blend 4產品(或將其作爲Expression Studio的一部分)。

+0

謝謝,請參閱OP中的更新。 – Neutrino 2013-04-08 09:44:01