相关疑难解决方法(0)

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

对WPF和XAML来说很新.我无法理解为什么我不能在下面的代码中将WPF控件放在我想要的位置.我的问题是<canvas></canvas>标签的位置.我放在这个地方的任何东西都给了我'属性'内容'设置不止一次'

如果有人能用简单的术语解释内容属性设置哪个最有帮助.

我查看了以下文章无济于事: 属性'内容'被多次 设置属性内容被设置多次 属性内容被设置多次 属性'内容'被设置多次按钮WPF ControlTemplate导致错误"属性'内容'设置不止一次"

<Window x:Class="PDFIndexer.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="MainWindow" Height="350" Width="525">
<Grid x:Name="ParentGrid">
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto" />
        <RowDefinition Height="1*" />
        <RowDefinition Height="25" />
    </Grid.RowDefinitions>
    <Menu Grid.Row="0" >
        <MenuItem Header="File" >
            <MenuItem Header="Open Project" Click="MenuItem_Click_1"></MenuItem>
            <MenuItem Header="Save Project"></MenuItem>
            <MenuItem Header="Close Project"></MenuItem>
            <Separator></Separator>
            <MenuItem Header="Exit"></MenuItem>
        </MenuItem>
        <MenuItem Header="Edit"></MenuItem>
    </Menu>
    <TabControl Grid.Row="1">
        <TabItem Header="Document Flow" >
            This is where the outline of the entire document will be placed.
            <Canvas></Canvas>
         </TabItem>
        <TabItem Header="Preview">
            This is where the preview …
Run Code Online (Sandbox Code Playgroud)

wpf

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

标签 统计

wpf ×1