Compartir a través de


Customize themes in Unified Service Desk

Apart from being able to choose from various predefined themes, you can customize a theme in Unified Service Desk. This is done by updating selective controls and then merging it with the existing theme in Unified Service Desk to customize the appearance. Unified Service Desk provides a default style (XAML file) that you can use to understand the various WPF controls and layout that define the appearance of your agent application. You can find the default style for Unified Service Desk application, DefaultStyle.xaml, in the User Interface Integration SDK download package. Download the package, and extract it to view the file and its contents under the UII\USD Developer Assets\USD Layout and Style Sheet directory.

Note

WPF and XAML scripting are essential skills required for customizing the display of your agent applications by manipulating controls in a XAML file.

In This Topic

How to customize your display style?

Test the action call for customizing your display

How to customize your display style?

Use the SetTheme action for the Global Manager hosted application to customize the default style of the agent application. Unified Service Desk supports merging of your customizations with the existing theme or display style of the agent application. This effectively means that you just need to specify the controls or areas that you want to be changed along with the ResourceDictionary reference block to customize an existing display style. For general information about ResourceDictionary, click ResourceDictionary and XAML resource references.

Let us create an action call to change the text in the title and the skin color of the agent application to Yellow. Make sure you have the DefaultStyle.xaml file handy as we will need it.

  1. Sign in to Microsoft Dynamics CRM.

  2. Go to Settings > Unified Service Desk. (How do I get there?)

  3. Click Action Calls.

  4. Click NEW to create an action call.

  5. On the New Action Call page, set the general properties:

    1. In the Name field, type Action Call for Custom Display.

    2. In the Hosted Control field, select CRM Global Manager. If you have a different name for your Global Manager hosted control type, specify that name instead.

    3. In the Action field, select SetTheme.

  6. Now, we will set the parameter for customizing the display. In the Data field, copy the following ResourceDictionary reference:

    <ResourceDictionary xmlns="https://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="https://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Classic"
         xmlns:themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Luna"
         xmlns:ribbon="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"
         xmlns:classic="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Classic"
         xmlns:shell="clr-namespace:Microsoft.Windows.Shell;assembly=Microsoft.Windows.Shell"
         xmlns:system="clr-namespace:System;assembly=mscorlib">
    

    Important

    This ResourceDictionary reference must be included in every action call that you use to customize the default style.

  7. Copy the following command in the Data field after the ResourceDictionary reference that you copied earlier.

    <SolidColorBrush x:Key="WindowBackgroundStyle" Color="Yellow"/>
    

    This will change the skin of the agent application to Yellow. You will find this command to set the background color in the <!-- Region General --> section in the DefaultStyle.xaml file.

  8. Copy the following command after the command that you copied in the previous step:

    <Style x:Key="MainWindow" TargetType="{x:Type Window}" BasedOn="{StaticResource {x:Type Window}}">
        <Setter Property="Title" Value="CUSTOM TITLE: Agent Application for CONTOSO INC."/>
        <Setter Property="Icon" Value="/UnifiedServiceDesk;component/imageResources/dynamics16-32-48-256.ico"/>
        <Setter Property="FontFamily" Value="Segoe UI" />
    </Style>
    

    This will change the text in the title bar to “CUSTOM TITLE: Agent Application for CONTOSO INC.”. You will find this command to set the Window title in the <!-- Region Window --> section in the DefaultStyle.xaml file.

  9. Close the ResourceDictionary tag by adding the following at the end of the Data field:

    </ResourceDictionary>
    

    This is how your action call definition looks like:

    Define action call for customizing display

  10. Click Save.

You are done, and now ready to test the action call in the agent application.

Test the action call for customizing your display

You can call this action call by creating a toolbar button, and then attaching the action call to it. For the sake of brevity, we will use the Debugger hosted application to test the action call.

  1. Start Unified Service Desk client application, and sign in to your CRM server.

  2. In the client application, start Debugger by clicking down arrow next to the settings menu in the top-right corner, and clicking Debug.

  3. In Debugger, click the down arrow above the Action Calls tab to display the area where you can test action calls and UII actions.

    Expand the testing area in Debugger

  4. From the Action Calls drop-down list, select Action Call for Custom Theme, and click the Run Action Call icon (Run button). The text in the title bar and skin color of the agent application change.

    Customized display of the client application

To undo the changes, select one of the predefined themes in the client application.

See Also

Concepts

Use themes to customize the appearance of your application

Other Resources

Unified Service Desk configuration walkthroughs
Hosted control types and action/event reference
Administration Guide for Unified Service Desk for Microsoft Dynamics CRM

Unified Service Desk
Send comments about this topic to Microsoft.
© 2015 Microsoft. All rights reserved.