Today we released minor version of DotNetBar for WPF 2.1.0.5 which includes the feature to provide the Live Preview functionality in your applications.

Live Preview allows your end users to preview what the effect of the command will be without making permanent change by invoking the command. In Office 2007 for example, there are paragraph styles that when you move mouse over them, preview the style without making permanent change. If you move the mouse out, the preview gets removed, or if you click the button the preview gets applied.

DotNetBar for WPF lets you implement that very easily. In nutshell here is what you do:

  1. On ButtonDropDown control set attached property Ribbon.LivePreviewEnabled=”true”
  2.  Handle attached event Ribbon.LivePreview
    1.  Save the current state so you can restore it if users chooses to back out
    2. Apply the effect of the command to let user preview what it does
  3. Handle attached event Ribbon.UndoLivePreview in which you undo using information saved at point 2.1 the preview you applied in point 2.2

That’s pretty much it. The nice thing is that events are bubbling type. That means that for example if you are enabling live preview on gallery, you add handlers on Gallery level. Here is little XAML that has Gallery and couple of buttons with Live Preview enabled:

<dc:Gallery Header=Quick Styles SuggestedContainerWidth=300 Height=56 dc:Ribbon.LivePreview=RibbonLivePreview dc:Ribbon.UndoLivePreview=RibbonUndoLivePreview>

  <dc:ButtonDropDown Header=Apex ImagePosition=Top PartVisibility=ImageOnly dc:Gallery.Category=Standard dc:Ribbon.LivePreviewEnabled=true>

    <dc:ButtonDropDown.Image>

      <Image Source=images/Apex.png/>

    </dc:ButtonDropDown.Image>

  </dc:ButtonDropDown>

  <dc:ButtonDropDown Header=Aspect ImagePosition=Top PartVisibility=ImageOnly dc:Gallery.Category=Standard dc:Ribbon.LivePreviewEnabled=true>

    <dc:ButtonDropDown.Image>

      <Image Source=images/Aspect.png/>

    </dc:ButtonDropDown.Image>

  </dc:ButtonDropDown>

Professional looking applications made easy with DotNetBar for WinForms, Silverlight and WPF User Interface components. Click here to find out more.