Extension methods for saving and restoring the position of a WPF Window using JSON strings.
public static string GetWindowPositionString(Window w)Gets the window position as a JSON string.
Window w - The Window
String The window position as a JSON string.
public static void RestoreWindowPosition(Window w, string wpStr)Restores the window position from a JSON string.
Window w - The Window
wpStr String JSON string
public static void EnsureIsVisible(Window w)Ensure a window is visible on the screen. If it is partially hidden, snap it on screen.
Window w - The Window