In my main window named (MainWindow by mistake) I have a method for getting a value once it has been triggered, this works for my usercontrols but for some reason when I attempt this on my MainWindow there are no definitions for OnStudentIDChanged.
public static readonly DependencyProperty StudentIDProperty = DependencyProperty.Register("StudentID", typeof(String), typeof(LoginWindow), new PropertyMetadata(OnStudentIDChanged));
public string StudentID
{
get { return (string)GetValue(StudentIDProperty); }
set { SetValue(StudentIDProperty, value); }
}
static void OnStudentIDChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
(d as LoginWindow).OnStudentIDChanged(e); // OnStudentIDChanged no definition?
}
Perhaps your intention was to cast
dtoMainWindowinstead ofLoginWindow?but that is still wrong because it’s an infinite recursion (guessing from your previous post)…