Unsupported Controls and Features in Expression Blend (Compact 2013)

3/26/2014

This topic describes the controls and features that are not supported in a XAML for Windows Embedded project in Blend for Visual Studio.

Unsupported Expression Blend Controls and Behaviors

Expression Blend controls that are not compatible with XAML for Windows Embedded are generally hidden by the XAML for Windows Embedded Application project template to prevent their use; however, a number of unsupported controls and behaviors cannot be hidden by the template. The following controls and behaviors are available in the Expression Blend toolbox but are not supported in XAML for Windows Embedded and will be flagged as such when you use Windows Embedded XAML Tools to convert your Expression Blend project:

  • CallMethodAction
  • DataStateBehavior
  • FluidMoveSetTagBehavior
  • HyperlinkAction
  • InkPresenter
  • MultiScaleImage
  • PlaySoundAction
  • RichTextBlockOverflow
  • SetDataStoreValueAction
  • WebBrowser

Managed Code

When you press F5 in Expression Blend to run your project in a browser window, you might want it to look and behave as much like the final Windows Embedded Compact application as possible. For example, to demonstrate the interactivity of your design in Expression Blend, you might write a few lines of Visual C# code in event handler methods (or obtain code from a developer). You might also include Visual C# classes in your project for elements like custom UI controls or effects.

However, any Visual C# code, either in code-behind files (which contain managed code for elements defined in XAML) or in custom class files, is not converted when you use the Windows Embedded XAML Tools to convert your Expression Blend project to a Windows Embedded Compact project in Visual Studio. Instead, empty native C++ stub code is generated for each of your Visual C# methods and classes.

Important

To ensure that empty C++ stub code will be generated for your Visual C# event handlers, you must explicitly name the XAML elements that use event handler methods or that refer to custom controls. For example, the following XAML code shows a button that is named MyButton. MyButton is hooked up to a Visual C# event handler method named _Button_Click.

    <Button 
        x:Name="MyButton"
        MouseLeftButtonDown="_Button_Click "
    .../>

After the Expression Blend project that includes the preceding XAML is converted to a Windows Embedded Compact application, stub code will exist for a C++ version of the _Button_Click event handler method. If the XAML did not include the x:Name attribute, no stub code will be created.

If you are using the Windows Embedded XAML Tools to update a project that has already been converted previously, empty stub code is generated only for new Visual C# methods and classes that don’t already exist by the same name in the Visual Studio project.

After a project goes through an initial conversion, designers and developers can work on the project at the same time. For example, a developer can add code to the _Button_Click event handler method in the Visual Studio project, and a designer can modify the appearance of the MyButton button in the Expression Blend project. When the project is updated in Visual Studio, the modified XAML is incorporated into the Windows Embedded Compact project. Using the same names for XAML objects and event handler methods is part of the designer/developer contract, and it’s a process that enables a smooth transition from managed code to native C++ code. For more information, see The Designer/Developer Contract in Start a Project that Involves Designers and Developers.

Media

Microsoft Silverlight desktop and web applications in Expression Blend can use a MediaElement object to play video and audio files. However, MediaElement is not supported in a XAML for Windows Embedded project. You can still use Expression Blend to design the UI for a media player, for example, by designing a unique look for the playback buttons. After your project is imported into Visual Studio, a developer can create and position a DirectX content window that displays the media. If your UI is positioned on top of the DirectX content window in the Windows Embedded Compact project, it appears in front of the window.

Font Embedding

Silverlight desktop and web applications in Expression Blend can use font embedding to include specific fonts or subsets of fonts in an application that runs on a computer that doesn't have the fonts installed. Font embedding ensures that your application displays exactly the way you designed it.

However, font embedding is not supported in a XAML for Windows Embedded project in the same way. To embed a font in a XAML for Windows Embedded application, add the font (.ttf or .ttc) file to the project resource (.rc) file as a "XAML_RESOURCE" resource. Then set the FontFamily property to "<font file name>#<font name>". For example, in your XAML file, you could use the following element:

<TextBlock>
    <Run FontFamily="MyFont.TTF#MyFontName" Text="This text uses a different font face."/>
</TextBlock>

For more information, see Embed Fonts in a XAML for Windows Embedded Application.

The FontFamily property also supports absolute or relative paths such as "/My Documents/MyFont.TTF#MyFontName", but the path cannot contain a colon (:), two backslashes (\\), or two forward slashes (//). XAML for Windows Embedded does not support AC3 font compression.

Note

If you decide to embed or otherwise redistribute fonts in your application, it is your responsibility to make sure that you have the required license rights for those fonts.

Data Binding

Data binding is not supported in Expression Blend when you are working on a XAML for Windows Embedded project. The Data panel is not available, nor is Data binding available from the Advanced property options shortcut menu.

Note

The DataContext property is not hidden in the Properties panel of Expression Blend.

However, data binding features are supported in a XAML for Windows Embedded project if you add them manually in Visual Studio. Some data binding features are supported in XAML if you add them manually in the XAML view of Expression Blend. For information about which data binding features XAML for Windows Embedded supports, see Differences Between Microsoft Silverlight 3 and XAML for Windows Embedded.

Effects

Expression Blend comes with two graphic effects: the blur effect and the drop shadow effect.

These graphic effects are provided when you are working on a XAML for Windows Embedded project to help you make your prototype design more appealing. However, when you convert your Expression Blend project in Visual Studio, you cannot load and parse graphic effects created by using XAML. You must create custom effects using the IXRCustomEffect Visual C++ class, and apply them using the IXREffect Visual C++ class.

For information about how effects are implemented differently in XAML for Windows Embedded, see Differences Between Microsoft Silverlight 3 and XAML for Windows Embedded.

Custom Controls

Custom controls in an Expression Blend project are not supported in a XAML for Windows Embedded project and thus will not be included when the Expression Blend project is converted using the Windows Embedded XAML Tools.

Custom controls are different than user controls (UserControl objects). A user control is stored in XAML and a code-behind file. If there are event handler methods in the code-behind file, empty C++ stub methods will be created when the Expression Blend project is converted using the Windows Embedded XAML Tools. In contrast, custom controls are written in managed code, compiled into a DLL, and then added to your Expression Blend project so that you can instantiate the control in your application. There is no XAML file from which the Windows Embedded XAML Tools can detect the existence of event handler methods.

In Expression Blend, you can use the Win32Control placeholder control to represent the location of a custom control in the converted Windows Embedded Compact project. Alternatively, the developer who creates the XAML for Windows Embedded version of the custom control for the converted project might provide you with a .NET Framework version of the control that you can use when prototyping your application in Expression Blend.

Event Handler Methods

You can connect event handler methods to objects in your Expression Blend application by using the Events view of the Properties panel. Stubs for the event handler methods are automatically added to your code-behind files.

You can write code for those event handler methods to make your prototype application in Expression Blend more interactive. However, when you convert your application in Visual Studio, that .NET Framework code is ignored, and empty native Visual C++ stub code is generated for your event handler methods. For more information, see Managed Code above.

SketchFlow

SketchFlow is a feature of Expression Blend that provides extra functionality for the prototyping process. You can use it to draw a map of the structure of your application, animate possible user interaction sequences, and gather feedback using notations in your designs.

SketchFlow projects cannot be converted by the Windows Embedded XAML Tools in Visual Studio. However, you can manually copy and paste supported XAML elements from a SketchFlow project into a new XAML for Windows Embedded project in Expression Blend.

Merged Dictionaries

If your Expression Blend project uses individual dictionary files that are merged, the Windows Embedded XAML Tools will not be able to convert the resources found in those dictionary files. To preserve the resources that you have defined in dictionary files, you can move them to the App.xaml file or to any XAML page with a code-behind file (a .xaml.cs file). You can move them in Expression Blend by dragging them in the Resources panel. For more information, see Move, Copy, or Export a Resource.

See Also

Concepts

Expression Blend and XAML for Windows Embedded