Commit 2c098e29 authored by SkinnySackboy's avatar SkinnySackboy Committed by Martin Finkel

WPF: The Loaded event may fire multiple times, whereas the Background_Loaded...

WPF: The Loaded event may fire multiple times, whereas the Background_Loaded is performing one-time initialization. Adding a guard to ensure this method is only called the first time the ForegroundWindow is loaded.
parent d39de069
......@@ -58,6 +58,11 @@ namespace LibVLCSharp.WPF
void Background_Loaded(object sender, RoutedEventArgs e)
{
if (_wndhost != null)
{
return;
}
_wndhost = GetWindow(_bckgnd);
Trace.Assert(_wndhost != null);
if (_wndhost == null)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment