Search code examples
.netwpfsketchflow

Can you use sketchflow controls/styles in a WPF application?


I really love the sketchy-ness of the Sketchflow buttons and controls, and would love to use those controls/styles in my own WPF app, can this be done in anyway? Perhaps just reference the Sketchflow binaries?


Solution

  • I believe this should work if you do the following:

    • Add SketchStyles.xaml to your wpf project (easiest way is to find it by creating a wpf SketchFlow project and copying it from there)
    • Reference Microsoft.Expression.Prototyping.SketchControls.dll in your project (found here on my system: C:\Program Files (x86)\Microsoft SDKs\Expression\Blend.NETFramework\v4.0\Libraries)
    • Add a directory named "Fonts"
    • In that directory, add the 3 fonts found in a SketchFlow project
    • To make the default Sketch font work, open SketchStyles.xaml in xaml editing mode, and find the line with "Buxton Sketch", it will have a reference to your old project, it should be changed to look like this: < FontFamily x:Key="FontFamily-Sketch">Fonts/#Buxton Sketch< /FontFamily>
    • Last, edit app.xaml in xaml editing mode and make sure it looks like this:

      <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>