简体   繁体   中英

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".

Here are my xaml and code-behind snippets. 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.

<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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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