相关疑难解决方法(0)

属性内容设置不止一次

我的代码如下所示,我收到以下错误.

错误:"属性'内容'设置多次"

码:

        <controls:PanoramaItem Header="headlines">
            <TextBlock Text="{Binding Tones}" />
          <!--Double line list with image placeholder and text wrapping-->
            <ListBox Margin="0,0,-12,0" ItemsSource="{Binding Tones}">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal" Margin="0,0,0,17">
                            <!--Replace rectangle with image-->
                            <Image Source="{Binding ImageUrl}" Height="75" Width="100" Margin="12,10,9,0" VerticalAlignment="Top"/>
                            <!--<Rectangle Height="100" Width="100" Fill="#FFE5001b" Margin="12,0,9,0"/>-->
                            <StackPanel Width="311">
                                <TextBlock Text="{Binding Title}" TextWrapping="Wrap" Style="{StaticResource PhoneTextLargeStyle}"/>
                                <!--<TextBlock Text="{Binding LineTwo}" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextSubtleStyle}"/>-->
                            </StackPanel>
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>                
        </controls:PanoramaItem>
Run Code Online (Sandbox Code Playgroud)

xaml windows-phone-7

24
推荐指数
1
解决办法
4万
查看次数

属性"内容"设置不止一次

我有以下XAML代码,在指向第16行的错误后抛出错误.

属性"内容"设置不止一次

有什么想法吗?

1       <Grid x:Name="LayoutRoot" Width="970" Height="460" Background="White">  
2           <Grid.RowDefinitions>  
3               <RowDefinition Height="*"/>
4               <RowDefinition Height="80"/>
5           </Grid.RowDefinitions>
6           <Border Margin="3" BorderBrush="#FF464646" BorderThickness="1" CornerRadius="5" Grid.Row="0">
7               <Border.Background>
8                   <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
9                       <GradientStop Color="#FF5B5A5A" Offset="0.02"/>
10                      <GradientStop Color="#FF3B3B3B" Offset="0.213"/>
11                      <GradientStop Color="#FF535151" Offset="0.807"/>
12                  </LinearGradientBrush>
13              </Border.Background>
14   
15               <Liquid:Viewer Content="Viewer">
16                   <Image Source="Images/planet.jpg" Opacity="0.8" Stretch="Fill" />
17               </Liquid:Viewer>
18   
19           </Border>
20          <Border Margin="3" BorderThickness="1" CornerRadius="5" Grid.Row="1">
21              <Border.Background>
Run Code Online (Sandbox Code Playgroud)

silverlight xaml

9
推荐指数
1
解决办法
2万
查看次数

属性内容设置不止一次

我想在一个scrollviewer中有文本块和超链接按钮,但是它说属性内容被设置多次...

        <!--ContentPanel - place additional content here-->

        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0">
            <ScrollViewer>
                <TextBlock HorizontalAlignment="Left" Margin="1,15,0,85" Width="460" Height="1500" Name="TextBlock1" TextWrapping="Wrap"> 
            <LineBreak />
        <Run FontFamily="Segoe WP" FontSize="27" FontWeight="ExtraBlack" TextDecorations="Underline">
           Weider 6 pack Training is a perfect exercise for flat stomach. 
            </Run>
            <LineBreak />
        <Run Text="This easy training programme has many advantages." FontSize="27" />
        <LineBreak />
        <Run Text="1. It's perfect for beginners and for experts" FontWeight="ExtraBlack" TextDecorations="Underline" FontSize="27" />
        <Run Text=" – exercises are easy and begin with the basic level, so every …
Run Code Online (Sandbox Code Playgroud)

c# visual-studio-2010 windows-phone-7

2
推荐指数
1
解决办法
5109
查看次数

内容设置不止一次

在Visual Studio 2013中使用WPF时,我遇到了一个错误:

错误2属性"内容"设置了多次.

错误1属性"内容"只能设置一次

现在,首先.我转向谷歌的错误消息,并获得了一个链接到StackOverflow的顶级结果.

XAML - 属性"内容"设置不止一次

属性"内容"设置不止一次

属性内容设置不止一次

包括MSDN帖子:

http://social.msdn.microsoft.com/Forums/vstudio/en-US/686be076-954f-4373-a2e6-fc42a6a27718/error-the-property-content-is-set-more-than-once?forum= WPF

虽然基于原始海报代码提供了信息丰富的定制解决方案,但我还没有遇到一个实际的基本解决方案,详细说明了这个错误的原因(XAML新手),虽然这可能是多个报告问题的重复.我个人宁愿避免发布有问题的代码来获得量身定制的解决方案.我更愿意来到这里,并询问社区的原因,为什么新手XAMP/WPF开发人员可能会遇到这个应用程序和解决方案,而不是顶级,顶级的最佳实践.而是来自更多WPF/XAMP开发人员的建议,关于如何轻松识别解决方案并继续进行更远的调试步骤


为了论证:

<Window x:Class="WPFT.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="197.198" Width="427.95">
    <TextBlock>Hello</TextBlock>
    <TextBlock>World</TextBlock>
</Window>
Run Code Online (Sandbox Code Playgroud)

c# wpf xaml

2
推荐指数
2
解决办法
1万
查看次数

错误属性"内容"不能设置多次

我正在尝试在我的wpf应用程序中设置选项卡,但是当我尝试在选项卡中创建元素时,我不断收到此错误.

</Grid.ColumnDefinitions>
    <TabControl>
        <TabItem Header="Tab1">
            <Label x:Name="WorkingLabe1" Content="Test1"/>
            <Label x:Name="WorkingLabelTest"/>
        </TabItem>
        <TabItem Header="Tab2">
            <Label x:Name="WorkingLabel2" Content="Test2"/>
        </TabItem>
    </TabControl>
</Grid>
Run Code Online (Sandbox Code Playgroud)

c# wpf tabs

0
推荐指数
1
解决办法
39
查看次数

标签 统计

c# ×3

xaml ×3

windows-phone-7 ×2

wpf ×2

silverlight ×1

tabs ×1

visual-studio-2010 ×1