Why would these lines of code cause that exception
private Dispatcher dispatcher = null;
public DownloadManager(Dispatcher dispatcher = null)
{
this.dispatcher = dispatcher ?? Dispatcher.CurrentDispatcher;
}
When the DownloadManager
is instantiated in the XAML like
<Window.DataContext>
<c:DownloadManager />
</Window.DataContext>
?
Note that the debugger doesn't specifically highlight any of these lines; all I know is that if I delete them, my program doesn't crash.