I have a subwindow that is supposed to get a string when initialized. The main window has this code:
CountryView cv = new CountryView(item.Country);
cv.Show();
item.Country being a string. While the subwindow has:
public partial class CountryView : Window
{
public CountryView(string thisCountry)
{
lblCountryName.Content = $"{thisCountry}";
InitializeComponent();
}
}
Label code:
<Label x:Name="lblCountryName" Content="" VerticalAlignment="Center" HorizontalAlignment="Center"/>
It keeps saying object reference not set to instance of an object. Anyone know what I'm doing wrong?