I have a requirement to monitor the topmost propertyvalue change on WPF Window. I am writing something like this:
static MainWindow()
{
TopmostProperty.OverrideMetadata(typeof(Window), new PropertyMetadata(new PropertyChangedCallback(Changed)));
}
public MainWindow()
{
InitializeComponent();
}
private static void Changed(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
throw new NotImplementedException();
}
But I am getting this exception: he invocation of the constructor on type 'WpfApplication4.MainWindow' that matches the specified binding constraints threw an exception.' Line number '4' and line position '9'."