16

我真的很喜欢 Sketchflow 按钮和控件的粗略性,并且很想在我自己的 WPF 应用程序中使用这些控件/样式,无论如何都可以这样做吗?也许只是参考 Sketchflow 二进制文件?

4

2 回答 2

12

如果您执行以下操作,我相信这应该有效:

  • 将 SketchStyles.xaml 添加到您的 wpf 项目(最简单的方法是通过创建 wpf SketchFlow 项目并从那里复制它来找到它)
  • 在您的项目中引用 Microsoft.Expression.Prototyping.SketchControls.dll(在我的系统上找到:C:\Program Files (x86)\Microsoft SDKs\Expression\Blend.NETFramework\v4.0\Libraries)
  • 添加一个名为“字体”的目录
  • 在该目录中,添加在 SketchFlow 项目中找到的 3 种字体
  • 要使默认的 Sketch 字体工作,在 xaml 编辑模式下打开 SketchStyles.xaml,找到带有“Buxton Sketch”的行,它将引用您的旧项目,它应该更改为如下所示: < FontFamily x: Key="FontFamily-Sketch">字体/#Buxton Sketch</FontFamily>
  • 最后,在 xaml 编辑模式下编辑 app.xaml 并确保它看起来像这样:

    <Application.Resources>
        <!-- Resources scoped at the Application level should be defined here. -->
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Microsoft.Expression.Prototyping.SketchControls;component/ScrollViewerStyles.xaml"/>
                <ResourceDictionary Source="SketchStyles.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
    
于 2010-06-30T14:21:17.340 回答
3

Sketchflow 应用程序对所有 Sketch-Styles 使用“SketchStyle.xaml”。当您使用 Blend 创建新的 Sketchflow-Application 时,您可以找到此 xaml 文件。

从这个 xaml 文件中,您可以复制样式。您只需将所有样式复制到应用程序或 ResourceDictionary 的 app.xaml 中。而且您可以使用它们,例如用于您的按钮,具有:

<Button Content="My Button" Style="{DynamicResource Button-Sketch}"/>

我希望这对你有所帮助。

于 2010-06-30T08:29:27.797 回答