2013-04-05 69 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