private void EnableFrameProvider() { if (frameProvider == null) { frameProvider = new FrameProvider(mainWindow); frameProvider.Shown += FrameProvider_Shown; frameProvider.Hidden += FrameProvider_Hidden; } }