-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #346 from punker76/customwindowsettings
"save window settings elsewhere" scenario
- Loading branch information
Showing
6 changed files
with
109 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using MahApps.Metro.Controls; | ||
using MahApps.Metro.Native; | ||
|
||
namespace MetroDemo | ||
{ | ||
/// <summary> | ||
/// saves the window placement | ||
/// </summary> | ||
public class CustomWindowPlacementSettings : IWindowPlacementSettings | ||
{ | ||
private static CustomWindowPlacementSettings instance; | ||
|
||
// Explicit static constructor to tell C# compiler | ||
// not to mark type as beforefieldinit | ||
static CustomWindowPlacementSettings() { | ||
} | ||
|
||
private CustomWindowPlacementSettings() { | ||
} | ||
|
||
public static CustomWindowPlacementSettings Instance { | ||
get { return instance ?? (instance = new CustomWindowPlacementSettings()); } | ||
} | ||
|
||
public WINDOWPLACEMENT? Placement { get; set; } | ||
|
||
public void Reload() { | ||
// load the placement from your custom settings file or something else | ||
} | ||
|
||
public void Save() { | ||
// save the placement to your custom settings file or something else | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters