Provides conditional Uri in XAML markup.

Namespace: DevZest.Windows
Assembly: DevZest.WpfDocking (in DevZest.WpfDocking.dll)

Syntax

C#
[MarkupExtensionReturnTypeAttribute(typeof(Uri))]
public class ConditionalUriExtension : MarkupExtension
Visual Basic
<MarkupExtensionReturnTypeAttribute(GetType(Uri))> _
Public Class ConditionalUriExtension _
	Inherits MarkupExtension

Remarks

Use this markup extension to avoid SecurityException when providing resource dictionary for both full trust and partial trust (XBAP, for example) applications.

Examples

The following example shows how to avoid the SecurityException in XBAP application because NativeFloatingWindow requires UIPermission:
CopyXAML
<ResourceDictionary>
    <ResourceDictionary.Source>
        <dz:ConditionalUriExtension
            Condition="{x:Static dz:FloatingWindow.CanBeNative}"
            True="NativeFloatingWindow.xaml"
            False="Empty.xaml" />
    </ResourceDictionary.Source>
</ResourceDictionary>

Inheritance Hierarchy

System..::..Object
  System.Windows.Markup..::..MarkupExtension
    DevZest.Windows..::..ConditionalUriExtension

See Also