0
<Window x:Class="AutoMerge2013.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="AutoMerge2013" Height="350" Width="525"
    Style="{StaticResource VS2012WindowStyle}">
    <TabControl x:Name="tbControl">
    <TabItem Header="Main">
        <Canvas>
            <Button Name="btnOpen" Content="Open files" Canvas.Left="40" Canvas.Top="20" Width="98" Click="btnOpen_Click_1"/>
            <Button Name="btnUpload" Content="Upload files" Canvas.Left="181" Canvas.Top="20" Width="98" Visibility="Hidden" Click="btnUpload_Click_1"/>
            <Button Name="btnMerge" Content="AutoMerge" Canvas.Left="338" Canvas.Top="20" Width="98" Visibility="Hidden" Click="btnMerge_Click_1"/>


            <StatusBar Canvas.Top="247" Width="499">
                <TextBlock x:Name="txtInfo"></TextBlock>
                <StatusBarItem HorizontalAlignment="Right">
                    <ResizeGrip />
                </StatusBarItem>
            </StatusBar>
    </TabItem>
    <TabItem Header="Original">

    </TabItem>
</TabControl>

当我单击“原始”选项卡时,它会引发异常:

PresentationCore.dll 中出现“System.InvalidOperationException”类型的未处理异常

附加信息:指定的 Visual 不是此 Visual 的后代。

我在我的应用程序中使用Style="{StaticResource VS2012WindowStyle}" 也许这是一个问题......你能给一些建议如何避免这个异常并保存我的风格吗?

4

0 回答 0