I want to change a label in my c# .net wpf program but im getting an error nobody else gets.
i've tried different text boxes and looked up tutorials they all say to do this but it doesn't work ;(
namespace p1_start
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
XmlDocument data = new XmlDocument();
data.Load("sata.xml");
username.Content = "test"; //--error
InitializeComponent();
}
}
}
System.NullReferenceException: 'Object reference not set to an instance of an object.'