public void PreviewScreen(IntPtr previewWindow) { Win32.RECT parentRect; Win32.GetWindowRect(previewWindow, out parentRect); var wpfWin32 = new HwndSource(0, Win32.WS_VISIBLE | Win32.WS_CHILD, 0, 0, 0, parentRect.Width, parentRect.Height, "RZ Screen Saver Preview", previewWindow, false); var source = createSourceFromSettings(); var slidePage = SlidePageFactory.Create(Settings.Default.SaverMode).Create(Settings.Default.DisplayMode); source.PictureChanged += slidePage.OnShowPicture; wpfWin32.RootVisual = (Visual)slidePage; wpfWin32.Disposed += delegate { Application.Current.Shutdown(); }; source.Start(); }
static SlidePageFactory.ICreator createPageFactoryFromSettings() { return(SlidePageFactory.Create(Settings.Default.SaverMode)); }