2016-11-26 122 views
-1

我试图在C#XMAL WPF应用程序中设置材质设计。 我将"Material Design In XAML"添加到我的项目中,之后出现以下错误:The property 'Content' can only be set once哪里会出现问题?我提供这给下面的错误文件:XAML:属性“内容”只能设置一次 - 虽然只设置一次

<Window x:Class="e621_fetch.MainWindow" 
    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:local="clr-namespace:e621_fetch" 
    mc:Ignorable="d" 
    Title="MainWindow" Height="350" Width="525" 
    xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" 
    TextElement.Foreground="{DynamicResource MaterialDesignBody}" 
    TextElement.FontWeight="Regular" 
    TextElement.FontSize="13" 
    TextOptions.TextFormattingMode="Ideal" 
    TextOptions.TextRenderingMode="Auto" 
    Background="{DynamicResource MaterialDesignPaper}" 
    FontFamily="{DynamicResource MaterialDesignFont}"> 
<Grid> 
    <materialDesign:Card Padding="32" Margin="16"> //error on this line 
            
     <TextBlock Style="{DynamicResource MaterialDesignTitleTextBlock}">My First Material Design App</TextBlock> //error on this line 
          
    </materialDesign:Card> //error on this line 
</Grid> 

回答

-1

已经修好了,那是因为在标签之间的空行......

+0

不知道为什么downvote,它解决了这个问题,似乎足够清楚 – Grey

+0

downvotes可能与你在回答你自己的问题后2分钟的时间。看起来你甚至没有尝试自己修复它之前,你把它发布在这里在stackoverflow。 – opelhatza

+1

在发布xD问题后,我意识到了 – Grey