Discovering open source WPF components – Orc.Snapshots

In the discovering open source WPF components series, I will look into useful open source components that can be used to create WPF apps. This weeks component is Orc.Snapshots.

Snapshots are like save games. They represent a set of data and/or values from a specific moment in time in an application. Using snapshots allows an application (and thus eventually the end-user) to store data (in memory, in a file or any in other persistence tech) which can later be retrieved. The advantage of using this library is that it will zip all the data into a single snapshot package

Whenever a snapshot is created, the SnapshotManager will:

  1. Create a zip memory stream
  2. For each provider, it will ask the provider to fill up a memory stream which is stored as a separate file
  3. Persist the snapshot memory stream to the required persistence store

Below is an animated gif of the example app that is available in the component repository:

orc_snapshots

The library makes it super convenient to add custom data to a snapshot. Just create a provider and register it in the manager and you’re done. This way you can even store (multiple) files (representing a specific moment in time) in a snapshot. Then the users can restore the snapshots whenever they want to.

Discovering open source WPF components – Orc.Wizard

In the discovering open source WPF components series, I will look into useful open source components that can be used to create WPF apps. This weeks component is Orc.Wizard.

A wizard is a great way to guide users through a process. Every wizard should behave the same, but there is no great out-of-the-box experience in WPF. The wizard included in this library has a few nice features:

  1. Automatic page management (with everything you expect from next / previous / finish, etc)
  2. Automatic (but optional) summary page that gathers all the information from each page to summarize what has been selected inside the wizard
  3. Optional pages that allow users to skip to a next page. It is also possible to enforce validation on a wizard page.
  4. Nice looking wizard header that is generated automatically based on the accent color

In summary, this library allows you to focus on the actual wizard content (the pages), not the wizard itself which is fully taken care of for you.

wizard

Creating wizard pages

A wizard page contains of three parts which are explained below.

Creating the wizard page model

The wizard model will hold all the information of the wizard page and return the summary (which is optional).

Creating the wizard page view model

The view model is responsible for the actual view logic. There can be a lot of stuff in here that is view-specific, as long as the results are stored into the model. This example uses the ViewModelToModel feature of Catel to automatically map the values between the view model and model. As you can see this example even contains validation, so users cannot continue to the next page when the validation does not succeed.

Creating the wizard page view

Below is the xaml view for the wizard page. Note that it’s just an ordinary Catel UserControl.

Creating the wizard

Once all the wizard pages have been created, it’s time to wrap it inside an actual wizard. Below is an example:

Using the wizard

Using the wizard can be done via the IWizardService. Below is an example on how to show a wizard:

Discovering open source WPF components – Orc.Controls

In the discovering open source WPF components series, I will look into useful open source components that can be used to create WPF apps. This weeks component is Orc.Controls.

Controls are an important part of WPF applications. Although Microsoft provides lots of controls out of the box, a few were missing or not working as an end-user might expect. The Orc.Controls component tries to fill that gap by providing very useful controls that will automatically adapt styling based on accent colors.

The controls listed below isn’t the complete list of controls provided by the component. It does give you a good idea about the look and feel of the controls though.

AnimatedGif

It’s so simple, but WPF does not provide this out of the box. Use the AnimatedGif control to easily add animated gifs to an application.

animatedgif

ColorLegend

Sometimes you need to show a legend that represents a list of values, where each value represents a color. This might become quite a complex control when you have to write it yourself, but the team of Orc.Controls has written this for you so you can immediately start using it.

image

ColorPicker

A color picker is something that exists in Windows, but not in WPF. Thanks to Orc.Controls, you can let the user pick any color.

image

DatePicker

The WPF date picker isn’t the best looking date picker you can imagine. I think the one below looks much better!

datepicker

TimeSpanPicker

Picking a TimeSpan is something that lots of apps need, but there are no decent controls available. The TimeSpanPicker inside Orc.Controls does an excellent job at filling up that gap.

timespanpicker

DateTimePicker

The DateTimePicker combines the power of the Date and TimeSpan pickers as you can see in the animated gif below:

datetimepicker

PinnableToolTip

Tool tips are extremely useful. Imagine a user that wants to compare multiple tool tips, then they are not as handy as we might think. Allowing users to pin tool tips gives them the option to compare the tooltips and place them where the end-users wants them to be visible.

pinnabletooltips