简体   繁体   English

为什么我的xaml看不到我的代码在后面?

[英]Why won't my xaml see my code behind?

I am getting the following error: 我收到以下错误:

The name MinMaxOverlay does not exist in the namespace "clr-namespace:Shadow_App". MinMaxOverlay名称在名称空间“ clr-namespace:Shadow_App”中不存在。

Here are my xaml and code-behind snippets. 这是我的xaml和代码隐藏的片段。 Please be warned that the code I use is much much longer, but I removed only the relevant portions. 请注意,我使用的代码要长得多,但是我只删除了相关部分。 The error when all of the code (1000's of lines) is still the same. 所有代码(1000行)时的错误仍然相同。

<UserControl xmlns:igWPF="http://schemas.infragistics.com/xaml/wpf"  
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:local="http://schemas.AvalonControls/AvalonControlsLibrary/Controls"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
             x:Class="Shadow_App.MainView"
             xmlns:myLocal="clr-namespace:Shadow_App"
             mc:Ignorable="d" Height="900" Width="1000" x:Name="window">
    <Border BorderBrush="Black" BorderThickness="1">
        <Grid>
            <Border BorderBrush="Black" BorderThickness="1">
                <Grid Background="Black" Margin="0,50,-4,-1" Width ="1000" HorizontalAlignment="Left" Height="847" VerticalAlignment="Top">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>
                    <myLocal:MinMaxOverlay/>
                </Grid>
            </Border>
        </Grid>
    </Border>

</UserControl>
using System.Windows.Controls;
using Bloomberglp.AppPortalApi;

namespace Shadow_App
{
    [BlpApplication]
    public partial class MainView : UserControl
    {
        public MainView()
        {
            InitializeComponent();
        }
    }
    public class ChartOverlay:UIElementCollection
    {
    }
    public class MinMaxOverlay : ChartOverlay
    {
    }
}

向您的类添加公共构造函数将使其可见。

So, I had to clear all other errors out of my code (they were related to the reference not working), clean and then build the project with that still in it. 因此,我必须清除代码中的所有其他错误(它们与无法正常工作的引用有关),清理后再在其中构建项目。 Damn to the depths whatever muttonhead thought of WPF! 不管笨蛋对WPF的想法如何,都该死的深处!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM