-
Notifications
You must be signed in to change notification settings - Fork 450
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue where packaged apps don't respond to Windows theme changes (#…
…175)
- Loading branch information
Showing
5 changed files
with
129 additions
and
79 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System.Runtime.InteropServices; | ||
using System.Text; | ||
|
||
namespace ModernWpf | ||
{ | ||
internal static class PackagedAppHelper | ||
{ | ||
private const long APPMODEL_ERROR_NO_PACKAGE = 15700L; | ||
|
||
public static bool IsPackagedApp | ||
{ | ||
get | ||
{ | ||
if (OSVersionHelper.IsWindows8OrGreater) | ||
{ | ||
int length = 0; | ||
var sb = new StringBuilder(0); | ||
GetCurrentPackageFullName(ref length, sb); | ||
|
||
sb.Length = length; | ||
int result = GetCurrentPackageFullName(ref length, sb); | ||
|
||
return result != APPMODEL_ERROR_NO_PACKAGE; | ||
} | ||
|
||
return false; | ||
} | ||
} | ||
|
||
[DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)] | ||
private static extern int GetCurrentPackageFullName(ref int packageFullNameLength, StringBuilder packageFullName); | ||
} | ||
} |
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