public StandardWindow() { Theme.Initialize(); Background = ThemeColours.Background_Brush_Blue_LightToDark; FontFamily = ThemeTextStyles.FontFamily_Standard; Icon = Icons.GetAppIconICO(Icons.Qiqqa); #if false // Set dimensions double w = Width; double h = Height; double width = Math.Max(800, SystemParameters.FullPrimaryScreenWidth - 20); double height = Math.Max(600, SystemParameters.FullPrimaryScreenHeight - 20); Width = width; Height = height; Top = 10; Left = 10; #endif UseLayoutRounding = true; if (SnapToPixels) { Logging.Info("Snapping to device pixels."); SnapsToDevicePixels = true; } this.ContentRendered += StandardWindow_ContentRendered; this.Initialized += StandardWindow_Initialized; this.Loaded += StandardWindow_Loaded; Closed += StandardWindow_Closed; Closing += StandardWindow_Closing; // keep a weak reference to this window instance to prevent GC hold-up and thus memory leaks: StandardWindowShutdownCbInstance.RegisterShutdownHandler(new StandardWindowShutdownCbInstance(this)); }
public static void RegisterShutdownHandler(StandardWindowShutdownCbInstance self) { ShutdownableManager.Instance.Register(self.HandleShutDownForWindow); }