I have been having numerous problems concerning "unhandled win32 exceptions". They seem to crop up a lot of the time when I use data bindings, although not always. I have not found a solution to them yet, I have instead managed to find a way around the data bindings in the cases encountered so far, like in the question I have already posted on the matter, which is available here:
Bind to UIElement in code-behind crashing
However, I cannot use some other technique with my current issue, which is why I would like to be able to clear this up:
The exception appears as soon as the property that is bound to is changed, firing the OnPropertyChanged
event, which is set up as follows:
private ObservableCollection<Element> elements;
public ObservableCollection<Element> Elements
{
get { return elements; }
set
{
elements = value;
OnPropertyChanged("Elements");
}
}
public event PropertyChangedEventHandler propertyChanged;
public void OnPropertyChanged(string propertyName)
{
propertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
The markdown is as follows:
<ListView x:Name="taskList" Grid.Row="1" Grid.Column="1" Margin="10,10,20,20" Background="White" ItemsSource="{Binding Elements, UpdateSourceTrigger=PropertyChanged}">
In case you were wondering, this behaviour does not seem to be exclusive to ListViews
with IEnumerables
, as it appeared when binding to the UIElement
in the previous question as well.
The exception presents this text in a warning window, followed by this menu:
Warning
A debugger is attached to [Project Name.exe] but not configured to debug this unhandled exception. To debug this exception, detach the current debugger.
Win32 exception choose debugger (The name is edited out for legal reasons)
If I choose to attach a instance of VS, it instantly stops debugging after realizing that another instance of VS is already attached. If I pick "No", the application stops execution. The error code in brackets in different upon every execution.
This error is driving me up the wall, so any pointers to what might be causing this are appreciated, since my project is suffering tremendously from it and progress stangates every time I run into it.
If you need any more code or information, just write a comment and I'll supply it.
Thank you very much for taking the time to look into this issue!
EDIT: I have further observed the issue and have found that using x:Bind
does not help either, the exception is still thrown.