Skip to content

Compatibility

BSick7 edited this page Mar 18, 2015 · 13 revisions

Fayde provides a high level of compatibility with Silverlight. This document will ease transitions with incompabilities and adaptations.

Fayde fully embraces MVVM. There are a plethora of features supporting MVVM in a more elegant manner than Silverlight. Keep this in mind when understanding the adaptations.

The following is a list of sections for this document:

Namespace Declaration

Namespaces are not declared the same way in Fayde. Due to the asynchronous nature of dependency loading, a slight adaptation is necessary to provide a fast experience.

Workaround

As shown in Release Notes 0.14, namespaces have 3 classes of declaration: Directory, Basic, and Full.

UserControl

UserControl is not supported. We believe UserControl to be an anti-pattern.

Workaround

Assess the reasons for building a UserControl.

If your UserControl is domain-specific to provide view reusability, we have provided ContentControl.ContentUri. This will load any XAML document assuming the root element is a UIElement. DataContext will flow into your XAML document seamlessly.

# Main View
...
    <ContentControl ContentUri="path/to/document.fayde" />
...

# document.fayde
<Grid 
    xmlns="http://schemas.wsick.com/fayde"
    xmlns:x="http://schemas.wsick.com/fayde/x">
    ...
</Grid>

If your UserControl has code-behind to automate the UI, consider building a Control. You will get elegant management that should rarely be domain-specific. Learn how to build a control.

Themes

When building control libraries in Silverlight, a themes/generic.xaml file is required. To override existing, developers include a ResourceDictionary (or many) that overrides the implicit styles. themes/generic.xaml does not exist in Fayde. Global Resource Dictionaries are supported, but this is not the recommended approach.

Workaround

Fayde Application contains a property ThemeName. Changing ThemeName will cause every library to asynchronously resolve its Theme using fayde.json. Controls declared in "Library A" will not resolve implicit styles contained within the theme for "Library B". If a control library does not contain a particular theme, fayde.json provides tight control to change the theme path.

ChildWindow

ChildWindow follows the same anti-pattern as UserControl.

Workaround

Starting with v0.16.20, OverlayLauncher and Dialog are provided as better ways to show overlay visuals and dialogs. See Overlays and Dialogs for more information.