Xceed Pro Themes for WPF v3.0 Documentation
Licensing
Welcome to Xceed Pro Themes for WPF v3.0 > Getting Started > Licensing

There are two possible licensing scenarios.

1. Using the default 45-day trial mode

You can evaluate this product for 45 days from the time of installation. During this period, the product is fully functional. You must however license the product with a trial key during this period; otherwise, an exception will be thrown.

Your trial license key can be retrieved from the Resource Center installed with this product. It will start with "XPT" (the license key prefix for Xceed Pro Themes for WPF), which means it will unlock all of Xceed's WPF themes for the duration of the trial period. See How to Use Your License Key below for details.

2.  Licensing the product with a purchased license key

If you have purchased a license key for this product, you should have received an e-mail from Xceed containing your registered license key.

Xceed's .NET products are currently distributed for both .NET 4 and .NET 3.5; the product version numbers for these builds are different. However, only keys whose prefix contains .NET 4.0 build version numbers are distributed, which can be used to unlock both the .NET 4 and the corresponding .NET 3.5 version of the product.

How to Use Your License Key

Once the references to the assemblies have been added to your project, the LicenseKey property must be set in order to register your Xceed component for runtime use. If a license key is not set, an exception will be thrown. If you use an invalid license key, expired trial key, or license the product in the wrong place in your code, an exception will be thrown at runtime.

The LicenseKey property must be set the first time that a theme resource dictionary is loaded. If the same type of theme resource dictionary is loaded subsequently, the LicenseKey property does not need to be set at that point. The following code demonstrates how to license the product when adding the Glass resource dictionary to an application's Window:

XAML
Copy Code
<Window.Resources>

    <xcpt:GlassResourceDictionary LicenseKey="XXXXX-XXXXX-XXXXX-XXXX" />

</Window.Resources>

Adding a theme resource dictionary to the resources of a standard WPF control may cause licensing problems. For example, the following will cause a license exception because the implicit Media Button style is applied before the LicenseKey property is assigned to by XamlLoader:

XAML
Copy Code
<Button Content="Button">

  <Button.Resources>

      <xcpt:MediaResourceDictionary LicenseKey="XXXXX-XXXXX-XXXXX-XXXX" />

  </Button.Resources>

</Button>

There are three solutions for this.

1. Include the theme resource dictionary with StyleUsageMode set to Explicit earlier in the XAML so the LicenseKey is set before adding to the Button control's resources.

2. Include the theme resource dictionary in a parent that is not a control styled by Xceed.

XAML
Copy Code
<Grid>

  <Grid.Resources>

    <xcpt:MediaResourceDictionary LicenseKey="XXXXX-XXXXX-XXXXX-XXXX" />

  </Grid.Resources>

  <Button Content="Button" />

</Grid>

3. Place the theme resource dictionary in the MergedDictionaries collection.

XAML
Copy Code
<Button Content="Button">

  <Button.Resources>

      <ResourceDictionary>

        <ResourceDictionary.MergedDictionaries>

          <xcpt:MediaResourceDictionary LicenseKey="XXXXX-XXXXX-XXXXX-XXXX" />

        </ResourceDictionary.MergedDictionaries>

      </ResourceDictionary>

  </Button.Resources>

</Button>