I've tried to make a custom UserControl, "UserControl1" in WPF that inherits from a base class. Among others I get this error in the XAML: Error XDG0008 The name "ControlBase" does not exist in the namespace "clr-namespace:Temp". I also get an error at DesignHeight & Width
The ControlBase class was availible in VS autocompletion.
The ControlBase class is defined in the namespace Temp.
I've tried changing keywords for the base class, for example adding partial.
UserControl1.xaml:
<local:ControlBase x:Class="Temp.UserControl1"
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:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Temp"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
</Grid>
</local:ControlBase>
UserControl1.xaml.cs:
namespace Temp
{
/// <summary>
/// Interaction logic for UserControl1.xaml
/// </summary>
public partial class UserControl1 : ControlBase
{
public UserControl1()
{
InitializeComponent();
}
}
}
ControlBase.cs:
using System.Windows.Controls;
namespace Temp
{
public class ControlBase : UserControl
{
public ControlBase() { }
}
}
I expected UserControl1 to inherit from ControlBase without compiler errors.
I don't know what I did, but it fixed itself.