├── donate.png ├── Sample ├── Assets │ ├── demo │ │ ├── dark.png │ │ ├── light.png │ │ ├── controls.gif │ │ ├── flicker.gif │ │ └── extented client area.jpg │ └── website-design-background-1.jpg ├── Properties │ ├── Settings.settings │ ├── Settings.Designer.cs │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── App.xaml.cs ├── App.xaml ├── MainWindow.xaml.cs ├── MainWindow.xaml └── Sample.csproj ├── Assets └── Fonts │ └── Segoe UI │ ├── SEGMDL2.TTF │ ├── SEGOEUI.TTF │ ├── SEGOEUIB.TTF │ ├── SEGOEUII.TTF │ ├── SEGOEUIL.TTF │ ├── SEGOEUIZ.TTF │ ├── SEGUIBL.TTF │ ├── SEGUIBLI.TTF │ ├── SEGUILI.TTF │ ├── SEGUISB.TTF │ ├── SEGUISBI.TTF │ ├── SEGUISLI.TTF │ └── SEGOEUISL.TTF ├── Properties ├── Settings.settings ├── AssemblyInfo.cs ├── Resources.Designer.cs ├── Settings.Designer.cs └── Resources.resx ├── app.config ├── UWPHost.sln ├── Themes ├── Generic.xaml └── Resources │ └── Window.xaml ├── .gitattributes ├── README.md ├── UWPHost.csproj ├── .gitignore └── Window.cs /donate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Selastin-George/UWP-Host/HEAD/donate.png -------------------------------------------------------------------------------- /Sample/Assets/demo/dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Selastin-George/UWP-Host/HEAD/Sample/Assets/demo/dark.png -------------------------------------------------------------------------------- /Sample/Assets/demo/light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Selastin-George/UWP-Host/HEAD/Sample/Assets/demo/light.png -------------------------------------------------------------------------------- /Sample/Assets/demo/controls.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Selastin-George/UWP-Host/HEAD/Sample/Assets/demo/controls.gif -------------------------------------------------------------------------------- /Sample/Assets/demo/flicker.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Selastin-George/UWP-Host/HEAD/Sample/Assets/demo/flicker.gif -------------------------------------------------------------------------------- /Assets/Fonts/Segoe UI/SEGMDL2.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Selastin-George/UWP-Host/HEAD/Assets/Fonts/Segoe UI/SEGMDL2.TTF -------------------------------------------------------------------------------- /Assets/Fonts/Segoe UI/SEGOEUI.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Selastin-George/UWP-Host/HEAD/Assets/Fonts/Segoe UI/SEGOEUI.TTF -------------------------------------------------------------------------------- /Assets/Fonts/Segoe UI/SEGOEUIB.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Selastin-George/UWP-Host/HEAD/Assets/Fonts/Segoe UI/SEGOEUIB.TTF -------------------------------------------------------------------------------- /Assets/Fonts/Segoe UI/SEGOEUII.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Selastin-George/UWP-Host/HEAD/Assets/Fonts/Segoe UI/SEGOEUII.TTF -------------------------------------------------------------------------------- /Assets/Fonts/Segoe UI/SEGOEUIL.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Selastin-George/UWP-Host/HEAD/Assets/Fonts/Segoe UI/SEGOEUIL.TTF -------------------------------------------------------------------------------- /Assets/Fonts/Segoe UI/SEGOEUIZ.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Selastin-George/UWP-Host/HEAD/Assets/Fonts/Segoe UI/SEGOEUIZ.TTF -------------------------------------------------------------------------------- /Assets/Fonts/Segoe UI/SEGUIBL.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Selastin-George/UWP-Host/HEAD/Assets/Fonts/Segoe UI/SEGUIBL.TTF -------------------------------------------------------------------------------- /Assets/Fonts/Segoe UI/SEGUIBLI.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Selastin-George/UWP-Host/HEAD/Assets/Fonts/Segoe UI/SEGUIBLI.TTF -------------------------------------------------------------------------------- /Assets/Fonts/Segoe UI/SEGUILI.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Selastin-George/UWP-Host/HEAD/Assets/Fonts/Segoe UI/SEGUILI.TTF -------------------------------------------------------------------------------- /Assets/Fonts/Segoe UI/SEGUISB.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Selastin-George/UWP-Host/HEAD/Assets/Fonts/Segoe UI/SEGUISB.TTF -------------------------------------------------------------------------------- /Assets/Fonts/Segoe UI/SEGUISBI.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Selastin-George/UWP-Host/HEAD/Assets/Fonts/Segoe UI/SEGUISBI.TTF -------------------------------------------------------------------------------- /Assets/Fonts/Segoe UI/SEGUISLI.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Selastin-George/UWP-Host/HEAD/Assets/Fonts/Segoe UI/SEGUISLI.TTF -------------------------------------------------------------------------------- /Assets/Fonts/Segoe UI/SEGOEUISL.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Selastin-George/UWP-Host/HEAD/Assets/Fonts/Segoe UI/SEGOEUISL.TTF -------------------------------------------------------------------------------- /Sample/Assets/demo/extented client area.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Selastin-George/UWP-Host/HEAD/Sample/Assets/demo/extented client area.jpg -------------------------------------------------------------------------------- /Sample/Assets/website-design-background-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Selastin-George/UWP-Host/HEAD/Sample/Assets/website-design-background-1.jpg -------------------------------------------------------------------------------- /Sample/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Sample/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Windows; 7 | 8 | namespace Sample 9 | { 10 | /// 11 | /// Interaction logic for App.xaml 12 | /// 13 | public partial class App : Application 14 | { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sample/App.xaml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Sample/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | using System.Windows.Controls; 7 | using System.Windows.Data; 8 | using System.Windows.Documents; 9 | using System.Windows.Input; 10 | using System.Windows.Media; 11 | using System.Windows.Media.Imaging; 12 | using System.Windows.Navigation; 13 | using System.Windows.Shapes; 14 | 15 | namespace Sample 16 | { 17 | /// 18 | /// Interaction logic for MainWindow.xaml 19 | /// 20 | public partial class MainWindow : UWPHost.Window 21 | { 22 | public MainWindow() 23 | { 24 | InitializeComponent(); 25 | } 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Sample/MainWindow.xaml: -------------------------------------------------------------------------------- 1 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 600 7 | 8 | 9 | 500 10 | 11 | 12 | 150 13 | 14 | 15 | 300 16 | 17 | 18 | Normal 19 | 20 | 21 | -------------------------------------------------------------------------------- /Sample/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Sample.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 600 12 | 13 | 14 | 500 15 | 16 | 17 | 150 18 | 19 | 20 | 300 21 | 22 | 23 | Normal 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /UWPHost.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28307.102 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UWPHost", "UWPHost.csproj", "{2823766D-82E7-41DB-886A-40C4AF09BB93}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample", "..\Sample\Sample.csproj", "{4B763AEB-AA4A-4A68-BD17-73686914BC5A}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Release|Any CPU = Release|Any CPU 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {2823766D-82E7-41DB-886A-40C4AF09BB93}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {2823766D-82E7-41DB-886A-40C4AF09BB93}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {2823766D-82E7-41DB-886A-40C4AF09BB93}.Release|Any CPU.ActiveCfg = Release|Any CPU 19 | {2823766D-82E7-41DB-886A-40C4AF09BB93}.Release|Any CPU.Build.0 = Release|Any CPU 20 | {4B763AEB-AA4A-4A68-BD17-73686914BC5A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {4B763AEB-AA4A-4A68-BD17-73686914BC5A}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {4B763AEB-AA4A-4A68-BD17-73686914BC5A}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {4B763AEB-AA4A-4A68-BD17-73686914BC5A}.Release|Any CPU.Build.0 = Release|Any CPU 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {4E8DBA25-AFC7-4559-9E9D-B93BC0998285} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /Themes/Generic.xaml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | 12 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("UWPHost")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("UWPHost")] 15 | [assembly: AssemblyCopyright("Copyright © 2018")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | //In order to begin building localizable applications, set 25 | //CultureYouAreCodingWith in your .csproj file 26 | //inside a . For example, if you are using US english 27 | //in your source files, set the to en-US. Then uncomment 28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in 29 | //the line below to match the UICulture setting in the project file. 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly:ThemeInfo( 35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 36 | //(used if a resource is not found in the page, 37 | // or application resource dictionaries) 38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 39 | //(used if a resource is not found in the page, 40 | // app, or any theme specific resource dictionaries) 41 | )] 42 | 43 | 44 | // Version information for an assembly consists of the following four values: 45 | // 46 | // Major Version 47 | // Minor Version 48 | // Build Number 49 | // Revision 50 | // 51 | // You can specify all the values or you can default the Build and Revision Numbers 52 | // by using the '*' as shown below: 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | [assembly: AssemblyVersion("1.0.0.0")] 55 | [assembly: AssemblyFileVersion("1.0.0.0")] 56 | -------------------------------------------------------------------------------- /Sample/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("Sample")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("Sample")] 15 | [assembly: AssemblyCopyright("Copyright © 2018")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | //In order to begin building localizable applications, set 25 | //CultureYouAreCodingWith in your .csproj file 26 | //inside a . For example, if you are using US english 27 | //in your source files, set the to en-US. Then uncomment 28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in 29 | //the line below to match the UICulture setting in the project file. 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly: ThemeInfo( 35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 36 | //(used if a resource is not found in the page, 37 | // or application resource dictionaries) 38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 39 | //(used if a resource is not found in the page, 40 | // app, or any theme specific resource dictionaries) 41 | )] 42 | 43 | 44 | // Version information for an assembly consists of the following four values: 45 | // 46 | // Major Version 47 | // Minor Version 48 | // Build Number 49 | // Revision 50 | // 51 | // You can specify all the values or you can default the Build and Revision Numbers 52 | // by using the '*' as shown below: 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | [assembly: AssemblyVersion("1.0.0.0")] 55 | [assembly: AssemblyFileVersion("1.0.0.0")] 56 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace UWPHost.Properties { 12 | 13 | 14 | /// 15 | /// A strongly-typed resource class, for looking up localized strings, etc. 16 | /// 17 | // This class was auto-generated by the StronglyTypedResourceBuilder 18 | // class via a tool like ResGen or Visual Studio. 19 | // To add or remove a member, edit your .ResX file then rerun ResGen 20 | // with the /str option, or rebuild your VS project. 21 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 22 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 23 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 24 | internal class Resources { 25 | 26 | private static global::System.Resources.ResourceManager resourceMan; 27 | 28 | private static global::System.Globalization.CultureInfo resourceCulture; 29 | 30 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 31 | internal Resources() { 32 | } 33 | 34 | /// 35 | /// Returns the cached ResourceManager instance used by this class. 36 | /// 37 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 38 | internal static global::System.Resources.ResourceManager ResourceManager { 39 | get { 40 | if ((resourceMan == null)) { 41 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("UWPHost.Properties.Resources", typeof(Resources).Assembly); 42 | resourceMan = temp; 43 | } 44 | return resourceMan; 45 | } 46 | } 47 | 48 | /// 49 | /// Overrides the current thread's CurrentUICulture property for all 50 | /// resource lookups using this strongly typed resource class. 51 | /// 52 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 53 | internal static global::System.Globalization.CultureInfo Culture { 54 | get { 55 | return resourceCulture; 56 | } 57 | set { 58 | resourceCulture = value; 59 | } 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Sample/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Sample.Properties 12 | { 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// Returns the cached ResourceManager instance used by this class. 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Sample.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// Overrides the current thread's CurrentUICulture property for all 56 | /// resource lookups using this strongly typed resource class. 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace UWPHost.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | 26 | [global::System.Configuration.UserScopedSettingAttribute()] 27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 28 | [global::System.Configuration.DefaultSettingValueAttribute("600")] 29 | public double Width { 30 | get { 31 | return ((double)(this["Width"])); 32 | } 33 | set { 34 | this["Width"] = value; 35 | } 36 | } 37 | 38 | [global::System.Configuration.UserScopedSettingAttribute()] 39 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 40 | [global::System.Configuration.DefaultSettingValueAttribute("500")] 41 | public double Height { 42 | get { 43 | return ((double)(this["Height"])); 44 | } 45 | set { 46 | this["Height"] = value; 47 | } 48 | } 49 | 50 | [global::System.Configuration.UserScopedSettingAttribute()] 51 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 52 | [global::System.Configuration.DefaultSettingValueAttribute("150")] 53 | public double Top { 54 | get { 55 | return ((double)(this["Top"])); 56 | } 57 | set { 58 | this["Top"] = value; 59 | } 60 | } 61 | 62 | [global::System.Configuration.UserScopedSettingAttribute()] 63 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 64 | [global::System.Configuration.DefaultSettingValueAttribute("300")] 65 | public double Left { 66 | get { 67 | return ((double)(this["Left"])); 68 | } 69 | set { 70 | this["Left"] = value; 71 | } 72 | } 73 | 74 | [global::System.Configuration.UserScopedSettingAttribute()] 75 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 76 | [global::System.Configuration.DefaultSettingValueAttribute("Normal")] 77 | public global::System.Windows.WindowState WindowState { 78 | get { 79 | return ((global::System.Windows.WindowState)(this["WindowState"])); 80 | } 81 | set { 82 | this["WindowState"] = value; 83 | } 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # UWP-Host 2 | UWP Host allows you to integrate UWP controls and windows to your wpf applications 3 | ```diff 4 | ! Note : This project is under development, more updates will be available soon. 5 | ``` 6 |
7 |

Overview

8 |
    9 |
  • UWP Window

  • 10 |
11 |        12 | The UWP Host library provides you coustom UWP application window layout for your WPF applications. 13 |

Features

14 |
    15 |
  • No flickering on resizing window (available only on windows 10 redstone update)
  • 16 |
  • Builtin ControlBox
  • 17 |
  • Extented Content Area
  • 18 |
19 |

Install

20 | 21 | *NuGet Package* 22 | ``` 23 | Install-Package UWPHost -Version 1.0.0 24 | ``` 25 | https://nuget.org/packages/UWPHost 26 | 27 | ### Preparation 28 | 29 | Add XAML namespace. 30 | 31 | ```xml 32 | xmlns:uwp="clr-namespace:UWPHost;assembly=UWPHost" 33 | ``` 34 | 35 | Add ResourceDictionary to App.xaml. 36 | 37 | ```xml 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | ``` 46 | 47 | ## Usage 48 | 49 | ### UWP Window 50 | 51 | MainWindow.xaml 52 | 53 | ```xml 54 | 64 | 65 | 66 | ``` 67 | MainWindow.xaml.cs 68 | 69 | ```cs 70 | public partial class MainWindow : UWPHost.Window 71 | { 72 | public MainWindow() 73 | { 74 | InitializeComponent(); 75 | } 76 | } 77 | ``` 78 | ##### Properties 79 | 80 | |Property Name|Type|Description| 81 | |-----|-----|-----| 82 | |ShowTitlebar|bool|Show or Hide the titlebar of the window.| 83 | |TitlebarBrush|SolidColorBrush|Sets the color of the titlebar.| 84 | |Theme|String|Set the theme of window. ie; Light or Dark. | 85 | 86 |
87 |
88 | 89 |

Screenshots

90 |
91 |

Dark Theme

92 | Dark Theme 93 |
94 |

Light Theme

95 | Light Theme 96 |
97 |

Control Box

98 | Control Box 99 |
100 |

Flickerless Resize

101 | Flickerless Resize 102 |
103 |

Extented Client Area

104 | Extented Client Area 105 |
106 |
107 |

Donate

108 | 109 | Donate us through paytm. 110 | 111 | Donate 112 | 113 | -------------------------------------------------------------------------------- /Sample/Sample.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {4B763AEB-AA4A-4A68-BD17-73686914BC5A} 8 | WinExe 9 | Sample 10 | Sample 11 | v4.0 12 | 512 13 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 14 | 4 15 | true 16 | 17 | 18 | AnyCPU 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | AnyCPU 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 4.0 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | MSBuild:Compile 54 | Designer 55 | 56 | 57 | MSBuild:Compile 58 | Designer 59 | 60 | 61 | App.xaml 62 | Code 63 | 64 | 65 | MainWindow.xaml 66 | Code 67 | 68 | 69 | 70 | 71 | Code 72 | 73 | 74 | True 75 | True 76 | Resources.resx 77 | 78 | 79 | True 80 | Settings.settings 81 | True 82 | 83 | 84 | ResXFileCodeGenerator 85 | Resources.Designer.cs 86 | 87 | 88 | SettingsSingleFileGenerator 89 | Settings.Designer.cs 90 | 91 | 92 | 93 | 94 | {2823766d-82e7-41db-886a-40c4af09bb93} 95 | UWPHost 96 | 97 | 98 | 99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /UWPHost.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {2823766D-82E7-41DB-886A-40C4AF09BB93} 8 | library 9 | UWPHost 10 | UWPHost 11 | v4.0 12 | 512 13 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 14 | 4 15 | true 16 | 17 | 18 | true 19 | full 20 | false 21 | bin\Debug\ 22 | DEBUG;TRACE 23 | prompt 24 | 4 25 | 26 | 27 | pdbonly 28 | true 29 | bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 34 | 35 | 36 | ..\..\Library Assistant\Extensions\UWP Host\UWP Host\Reference\Microsoft.Windows.Shell.dll 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 4.0 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | MSBuild:Compile 55 | Designer 56 | 57 | 58 | Designer 59 | MSBuild:Compile 60 | 61 | 62 | 63 | 64 | Code 65 | 66 | 67 | True 68 | True 69 | Resources.resx 70 | 71 | 72 | True 73 | Settings.settings 74 | True 75 | 76 | 77 | 78 | ResXFileCodeGenerator 79 | Resources.Designer.cs 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | SettingsSingleFileGenerator 97 | Settings.Designer.cs 98 | 99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /Properties/Resources.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /Sample/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.suo 8 | *.user 9 | *.userosscache 10 | *.sln.docstates 11 | 12 | # User-specific files (MonoDevelop/Xamarin Studio) 13 | *.userprefs 14 | 15 | # Build results 16 | [Dd]ebug/ 17 | [Dd]ebugPublic/ 18 | [Rr]elease/ 19 | [Rr]eleases/ 20 | x64/ 21 | x86/ 22 | bld/ 23 | [Bb]in/ 24 | [Oo]bj/ 25 | [Ll]og/ 26 | 27 | # Visual Studio 2015/2017 cache/options directory 28 | .vs/ 29 | # Uncomment if you have tasks that create the project's static files in wwwroot 30 | #wwwroot/ 31 | 32 | # Visual Studio 2017 auto generated files 33 | Generated\ Files/ 34 | 35 | # MSTest test Results 36 | [Tt]est[Rr]esult*/ 37 | [Bb]uild[Ll]og.* 38 | 39 | # NUNIT 40 | *.VisualState.xml 41 | TestResult.xml 42 | 43 | # Build Results of an ATL Project 44 | [Dd]ebugPS/ 45 | [Rr]eleasePS/ 46 | dlldata.c 47 | 48 | # Benchmark Results 49 | BenchmarkDotNet.Artifacts/ 50 | 51 | # .NET Core 52 | project.lock.json 53 | project.fragment.lock.json 54 | artifacts/ 55 | **/Properties/launchSettings.json 56 | 57 | # StyleCop 58 | StyleCopReport.xml 59 | 60 | # Files built by Visual Studio 61 | *_i.c 62 | *_p.c 63 | *_i.h 64 | *.ilk 65 | *.meta 66 | *.obj 67 | *.iobj 68 | *.pch 69 | *.pdb 70 | *.ipdb 71 | *.pgc 72 | *.pgd 73 | *.rsp 74 | *.sbr 75 | *.tlb 76 | *.tli 77 | *.tlh 78 | *.tmp 79 | *.tmp_proj 80 | *.log 81 | *.vspscc 82 | *.vssscc 83 | .builds 84 | *.pidb 85 | *.svclog 86 | *.scc 87 | 88 | # Chutzpah Test files 89 | _Chutzpah* 90 | 91 | # Visual C++ cache files 92 | ipch/ 93 | *.aps 94 | *.ncb 95 | *.opendb 96 | *.opensdf 97 | *.sdf 98 | *.cachefile 99 | *.VC.db 100 | *.VC.VC.opendb 101 | 102 | # Visual Studio profiler 103 | *.psess 104 | *.vsp 105 | *.vspx 106 | *.sap 107 | 108 | # Visual Studio Trace Files 109 | *.e2e 110 | 111 | # TFS 2012 Local Workspace 112 | $tf/ 113 | 114 | # Guidance Automation Toolkit 115 | *.gpState 116 | 117 | # ReSharper is a .NET coding add-in 118 | _ReSharper*/ 119 | *.[Rr]e[Ss]harper 120 | *.DotSettings.user 121 | 122 | # JustCode is a .NET coding add-in 123 | .JustCode 124 | 125 | # TeamCity is a build add-in 126 | _TeamCity* 127 | 128 | # DotCover is a Code Coverage Tool 129 | *.dotCover 130 | 131 | # AxoCover is a Code Coverage Tool 132 | .axoCover/* 133 | !.axoCover/settings.json 134 | 135 | # Visual Studio code coverage results 136 | *.coverage 137 | *.coveragexml 138 | 139 | # NCrunch 140 | _NCrunch_* 141 | .*crunch*.local.xml 142 | nCrunchTemp_* 143 | 144 | # MightyMoose 145 | *.mm.* 146 | AutoTest.Net/ 147 | 148 | # Web workbench (sass) 149 | .sass-cache/ 150 | 151 | # Installshield output folder 152 | [Ee]xpress/ 153 | 154 | # DocProject is a documentation generator add-in 155 | DocProject/buildhelp/ 156 | DocProject/Help/*.HxT 157 | DocProject/Help/*.HxC 158 | DocProject/Help/*.hhc 159 | DocProject/Help/*.hhk 160 | DocProject/Help/*.hhp 161 | DocProject/Help/Html2 162 | DocProject/Help/html 163 | 164 | # Click-Once directory 165 | publish/ 166 | 167 | # Publish Web Output 168 | *.[Pp]ublish.xml 169 | *.azurePubxml 170 | # Note: Comment the next line if you want to checkin your web deploy settings, 171 | # but database connection strings (with potential passwords) will be unencrypted 172 | *.pubxml 173 | *.publishproj 174 | 175 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 176 | # checkin your Azure Web App publish settings, but sensitive information contained 177 | # in these scripts will be unencrypted 178 | PublishScripts/ 179 | 180 | # NuGet Packages 181 | *.nupkg 182 | # The packages folder can be ignored because of Package Restore 183 | **/[Pp]ackages/* 184 | # except build/, which is used as an MSBuild target. 185 | !**/[Pp]ackages/build/ 186 | # Uncomment if necessary however generally it will be regenerated when needed 187 | #!**/[Pp]ackages/repositories.config 188 | # NuGet v3's project.json files produces more ignorable files 189 | *.nuget.props 190 | *.nuget.targets 191 | 192 | # Microsoft Azure Build Output 193 | csx/ 194 | *.build.csdef 195 | 196 | # Microsoft Azure Emulator 197 | ecf/ 198 | rcf/ 199 | 200 | # Windows Store app package directories and files 201 | AppPackages/ 202 | BundleArtifacts/ 203 | Package.StoreAssociation.xml 204 | _pkginfo.txt 205 | *.appx 206 | 207 | # Visual Studio cache files 208 | # files ending in .cache can be ignored 209 | *.[Cc]ache 210 | # but keep track of directories ending in .cache 211 | !*.[Cc]ache/ 212 | 213 | # Others 214 | ClientBin/ 215 | ~$* 216 | *~ 217 | *.dbmdl 218 | *.dbproj.schemaview 219 | *.jfm 220 | *.pfx 221 | *.publishsettings 222 | orleans.codegen.cs 223 | 224 | # Including strong name files can present a security risk 225 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 226 | #*.snk 227 | 228 | # Since there are multiple workflows, uncomment next line to ignore bower_components 229 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 230 | #bower_components/ 231 | 232 | # RIA/Silverlight projects 233 | Generated_Code/ 234 | 235 | # Backup & report files from converting an old project file 236 | # to a newer Visual Studio version. Backup files are not needed, 237 | # because we have git ;-) 238 | _UpgradeReport_Files/ 239 | Backup*/ 240 | UpgradeLog*.XML 241 | UpgradeLog*.htm 242 | ServiceFabricBackup/ 243 | *.rptproj.bak 244 | 245 | # SQL Server files 246 | *.mdf 247 | *.ldf 248 | *.ndf 249 | 250 | # Business Intelligence projects 251 | *.rdl.data 252 | *.bim.layout 253 | *.bim_*.settings 254 | *.rptproj.rsuser 255 | 256 | # Microsoft Fakes 257 | FakesAssemblies/ 258 | 259 | # GhostDoc plugin setting file 260 | *.GhostDoc.xml 261 | 262 | # Node.js Tools for Visual Studio 263 | .ntvs_analysis.dat 264 | node_modules/ 265 | 266 | # Visual Studio 6 build log 267 | *.plg 268 | 269 | # Visual Studio 6 workspace options file 270 | *.opt 271 | 272 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 273 | *.vbw 274 | 275 | # Visual Studio LightSwitch build output 276 | **/*.HTMLClient/GeneratedArtifacts 277 | **/*.DesktopClient/GeneratedArtifacts 278 | **/*.DesktopClient/ModelManifest.xml 279 | **/*.Server/GeneratedArtifacts 280 | **/*.Server/ModelManifest.xml 281 | _Pvt_Extensions 282 | 283 | # Paket dependency manager 284 | .paket/paket.exe 285 | paket-files/ 286 | 287 | # FAKE - F# Make 288 | .fake/ 289 | 290 | # JetBrains Rider 291 | .idea/ 292 | *.sln.iml 293 | 294 | # CodeRush 295 | .cr/ 296 | 297 | # Python Tools for Visual Studio (PTVS) 298 | __pycache__/ 299 | *.pyc 300 | 301 | # Cake - Uncomment if you are using it 302 | # tools/** 303 | # !tools/packages.config 304 | 305 | # Tabs Studio 306 | *.tss 307 | 308 | # Telerik's JustMock configuration file 309 | *.jmconfig 310 | 311 | # BizTalk build output 312 | *.btp.cs 313 | *.btm.cs 314 | *.odx.cs 315 | *.xsd.cs 316 | 317 | # OpenCover UI analysis results 318 | OpenCover/ 319 | 320 | # Azure Stream Analytics local run output 321 | ASALocalRun/ 322 | 323 | # MSBuild Binary and Structured Log 324 | *.binlog 325 | 326 | # NVidia Nsight GPU debugger configuration file 327 | *.nvuser 328 | 329 | # MFractors (Xamarin productivity tool) working folder 330 | .mfractor/ 331 | -------------------------------------------------------------------------------- /Window.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Windows.Shell; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Windows; 8 | using System.Windows.Controls; 9 | using System.Windows.Input; 10 | using System.Windows.Media; 11 | 12 | namespace UWPHost 13 | { 14 | public class Window :System.Windows.Window 15 | { 16 | Window Appx_GUI; 17 | public Window() 18 | { 19 | Appx_GUI = this as Window; 20 | } 21 | 22 | protected override void OnClosing(CancelEventArgs e) 23 | { 24 | base.OnClosing(e); 25 | if(this.WindowState!=WindowState.Maximized) 26 | { 27 | Properties.Settings.Default.Width = this.Width; 28 | Properties.Settings.Default.Height = this.Height; 29 | Properties.Settings.Default.Left = this.Left; 30 | Properties.Settings.Default.Top = this.Top; 31 | } 32 | 33 | Properties.Settings.Default.WindowState = this.WindowState; 34 | Properties.Settings.Default.Save(); 35 | } 36 | 37 | protected override void OnSourceInitialized(EventArgs e) 38 | { 39 | Window win = this; 40 | base.OnSourceInitialized(e); 41 | ResourceDictionary ThemeDictionary = new ResourceDictionary(); 42 | ThemeDictionary.Source = new Uri("UWPHOST;component/Themes/Generic.xaml", UriKind.RelativeOrAbsolute); 43 | var style = ThemeDictionary["Generic"] as Style; 44 | this.Style = style; 45 | 46 | win.CommandBindings.Add(new CommandBinding(SystemCommands.CloseWindowCommand, new ExecutedRoutedEventHandler(closeCommand_Executed))); 47 | win.CommandBindings.Add(new CommandBinding(SystemCommands.MinimizeWindowCommand, new ExecutedRoutedEventHandler(minimizeWindow_Executed))); 48 | win.CommandBindings.Add(new CommandBinding(SystemCommands.MaximizeWindowCommand, new ExecutedRoutedEventHandler(maximizeWindow_Executed))); 49 | win.CommandBindings.Add(new CommandBinding(SystemCommands.RestoreWindowCommand, new ExecutedRoutedEventHandler(restoreWindow_Executed))); 50 | 51 | 52 | this.Width = Properties.Settings.Default.Width; 53 | this.Height = Properties.Settings.Default.Height; 54 | this.Left = Properties.Settings.Default.Left; 55 | this.Top = Properties.Settings.Default.Top; 56 | this.WindowState = Properties.Settings.Default.WindowState; 57 | 58 | } 59 | 60 | 61 | protected override void OnStateChanged(EventArgs e) 62 | { 63 | Appx_GUI = this; 64 | base.OnStateChanged(e); 65 | if (this.WindowState == WindowState.Maximized) 66 | { 67 | Grid Container = (Grid)Appx_GUI.Template.FindName("container", Appx_GUI); 68 | Container.Margin = new Thickness(8, 8, 8, 8); 69 | try 70 | { 71 | Button btn = (Button)Appx_GUI.Template.FindName("maximize_btn", Appx_GUI); 72 | TextBlock icon_max = (TextBlock)btn.Template.FindName("maximize_icon", btn); 73 | TextBlock icon_res = (TextBlock)btn.Template.FindName("restore_icon", btn); 74 | icon_max.Visibility = Visibility.Hidden; 75 | icon_res.Visibility = Visibility.Visible; 76 | } 77 | catch (Exception ex) 78 | { 79 | MessageBox.Show(ex.Message); 80 | } 81 | } 82 | else 83 | { 84 | try 85 | { 86 | Appx_GUI = this as UWPHost.Window; 87 | Grid Container = (Grid)Appx_GUI.Template.FindName("container", Appx_GUI); 88 | Container.Margin = new Thickness(1, 1, 1, 1); 89 | Button btn = (Button)Container.FindName("maximize_btn"); 90 | TextBlock icon_max = (TextBlock)btn.Template.FindName("maximize_icon", btn); 91 | TextBlock icon_res = (TextBlock)btn.Template.FindName("restore_icon", btn); 92 | icon_max.Visibility = Visibility.Visible; 93 | icon_res.Visibility = Visibility.Hidden; 94 | } 95 | catch (Exception ex) 96 | { 97 | MessageBox.Show(ex.ToString()); 98 | } 99 | } 100 | } 101 | 102 | protected override void OnActivated(EventArgs e) 103 | { 104 | base.OnActivated(e); 105 | OnStateChanged(null); 106 | } 107 | 108 | private void closeCommand_Executed(object sender, ExecutedRoutedEventArgs e) 109 | { 110 | Close(); 111 | } 112 | 113 | private void minimizeWindow_Executed(object sender, ExecutedRoutedEventArgs e) 114 | { 115 | this.WindowState = WindowState.Minimized; 116 | } 117 | 118 | private void restoreWindow_Executed(object sender, ExecutedRoutedEventArgs e) 119 | { 120 | this.WindowState = WindowState.Normal; 121 | } 122 | 123 | private void maximizeWindow_Executed(object sender, ExecutedRoutedEventArgs e) 124 | { 125 | Appx_GUI = this; 126 | if (this.WindowState == WindowState.Maximized) 127 | { 128 | this.WindowState = WindowState.Normal; 129 | Grid Container = (Grid)Appx_GUI.Template.FindName("container", Appx_GUI); 130 | Container.Margin = new Thickness(1, 1, 1, 1); 131 | try 132 | { 133 | Button btn = (Button)Appx_GUI.Template.FindName("maximize_btn", Appx_GUI); 134 | TextBlock icon_max = (TextBlock)btn.Template.FindName("maximize_icon", btn); 135 | TextBlock icon_res = (TextBlock)btn.Template.FindName("restore_icon", btn); 136 | icon_max.Visibility = Visibility.Visible; 137 | icon_res.Visibility = Visibility.Hidden; 138 | } 139 | catch (Exception ex) 140 | { 141 | MessageBox.Show(ex.Message); 142 | } 143 | } 144 | else 145 | { 146 | this.WindowState = WindowState.Maximized; 147 | Grid Container = (Grid)Appx_GUI.Template.FindName("container", Appx_GUI); 148 | Container.Margin = new Thickness(8, 8, 8, 8); 149 | try 150 | { 151 | Button btn = (Button)Appx_GUI.Template.FindName("maximize_btn", Appx_GUI); 152 | TextBlock icon_max = (TextBlock)btn.Template.FindName("maximize_icon", btn); 153 | TextBlock icon_res = (TextBlock)btn.Template.FindName("restore_icon", btn); 154 | icon_max.Visibility = Visibility.Hidden; 155 | icon_res.Visibility = Visibility.Visible; 156 | } 157 | catch (Exception ex) 158 | { 159 | MessageBox.Show(ex.Message); 160 | } 161 | 162 | } 163 | } 164 | 165 | 166 | 167 | #region Dependency Properties 168 | 169 | public String Theme 170 | { 171 | get { return (String)GetValue(ThemeProperty); } 172 | set { SetValue(ThemeProperty, value); } 173 | } 174 | 175 | public static readonly DependencyProperty ThemeProperty = 176 | DependencyProperty.Register("Theme", typeof(String), typeof(Window), new PropertyMetadata("Light")); 177 | 178 | 179 | 180 | 181 | 182 | public bool ShowTitlebar 183 | { 184 | get { return (bool)GetValue(ShowTitlebarProperty); } 185 | set { SetValue(ShowTitlebarProperty, value); } 186 | } 187 | 188 | // Using a DependencyProperty as the backing store for ShowTitlebar. This enables animation, styling, binding, etc... 189 | public static readonly DependencyProperty ShowTitlebarProperty = 190 | DependencyProperty.Register("ShowTitlebar", typeof(bool), typeof(Window), new PropertyMetadata(true)); 191 | 192 | 193 | public SolidColorBrush TitlebarBrush 194 | { 195 | get { return (SolidColorBrush)GetValue(TitlebarBrushProperty); } 196 | set { SetValue(TitlebarBrushProperty, value); } 197 | } 198 | 199 | // Using a DependencyProperty as the backing store for TitlebarBrush. This enables animation, styling, binding, etc... 200 | public static readonly DependencyProperty TitlebarBrushProperty = 201 | DependencyProperty.Register("TitlebarBrush", typeof(SolidColorBrush), typeof(Window), new PropertyMetadata(new SolidColorBrush(Colors.Transparent))); 202 | 203 | 204 | #endregion 205 | } 206 | } 207 | -------------------------------------------------------------------------------- /Themes/Resources/Window.xaml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |