开发者

XamlParseException when using ExpressionDark in Silverlight

开发者 https://www.devze.com 2023-02-19 14:06 出处:网络
I am currently using the ExpressionDark theme in a Silverlight project I am working on. I am having an issue where it throws an exception when I debug.

I am currently using the ExpressionDark theme in a Silverlight project I am working on. I am having an issue where it throws an exception when I debug.

A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in System.Windows.dll

Additional information: Invalid attribute value dataForm:DataForm for property TargetType. [Line: 1 Position: 233]

This doesn't really affect anything because it still works fine, its just annoying. Here is a co开发者_JAVA百科de example.

<UserControl x:Class="MyProject.Controls.Test"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:expressionDark="clr-namespace:System.Windows.Controls.Theming;assembly=System.Windows.Controls.Theming.ExpressionDark" 
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">
    <expressionDark:ExpressionDarkTheme ApplyMode="Auto" Background="#00000000">
        <Grid x:Name="LayoutRoot" Background="#00000000">
        </Grid>
    </expressionDark:ExpressionDarkTheme>
</UserControl>

If I comment out the expressionDark lines the exception goes away. Any idea on how to fix the exception or ignore it somehow?


The needed reference has not been added for the DataForm within the consuming assembly.

Add a reference to the System.Windows.Controls.Data.DataForm assembly. If you need to make use of the DataForm within the UserControl explicitly you can define a namespace.

    xmlns:dataControls="clr-namespace:System.Windows.Controls;
assembly=System.Windows.Controls.Data.DataForm"
0

精彩评论

暂无评论...
验证码 换一张
取 消