├── .gitattributes ├── .github └── FUNDING.yml ├── .gitignore ├── LICENSE ├── NotepadRs4 ├── NotepadRs4.sln └── NotepadRs4 │ ├── Activation │ ├── ActivationHandler.cs │ └── DefaultLaunchActivationHandler.cs │ ├── App.xaml │ ├── App.xaml.cs │ ├── Assets │ ├── Icons │ │ ├── BingIcon.png │ │ ├── WhatsNewDark.png │ │ └── WhatsNewLight.png │ ├── Logo │ │ ├── contrast-black │ │ │ ├── LargeTile.scale-100.png │ │ │ ├── LargeTile.scale-125.png │ │ │ ├── LargeTile.scale-150.png │ │ │ ├── LargeTile.scale-200.png │ │ │ ├── LargeTile.scale-400.png │ │ │ ├── SmallTile.scale-100.png │ │ │ ├── SmallTile.scale-125.png │ │ │ ├── SmallTile.scale-150.png │ │ │ ├── SmallTile.scale-200.png │ │ │ ├── SmallTile.scale-400.png │ │ │ ├── SplashScreen.scale-100.png │ │ │ ├── SplashScreen.scale-125.png │ │ │ ├── SplashScreen.scale-150.png │ │ │ ├── SplashScreen.scale-200.png │ │ │ ├── SplashScreen.scale-400.png │ │ │ ├── Square150x150Logo.scale-100.png │ │ │ ├── Square150x150Logo.scale-125.png │ │ │ ├── Square150x150Logo.scale-150.png │ │ │ ├── Square150x150Logo.scale-200.png │ │ │ ├── Square150x150Logo.scale-400.png │ │ │ ├── Square44x44Logo.altform-unplated_targetsize-16.png │ │ │ ├── Square44x44Logo.altform-unplated_targetsize-24.png │ │ │ ├── Square44x44Logo.altform-unplated_targetsize-256.png │ │ │ ├── Square44x44Logo.altform-unplated_targetsize-32.png │ │ │ ├── Square44x44Logo.altform-unplated_targetsize-48.png │ │ │ ├── Square44x44Logo.scale-100.png │ │ │ ├── Square44x44Logo.scale-125.png │ │ │ ├── Square44x44Logo.scale-150.png │ │ │ ├── Square44x44Logo.scale-200.png │ │ │ ├── Square44x44Logo.scale-400.png │ │ │ ├── Square44x44Logo.targetsize-16.png │ │ │ ├── Square44x44Logo.targetsize-24.png │ │ │ ├── Square44x44Logo.targetsize-256.png │ │ │ ├── Square44x44Logo.targetsize-32.png │ │ │ ├── Square44x44Logo.targetsize-48.png │ │ │ ├── StoreLogo.scale-100.png │ │ │ ├── StoreLogo.scale-125.png │ │ │ ├── StoreLogo.scale-150.png │ │ │ ├── StoreLogo.scale-200.png │ │ │ ├── StoreLogo.scale-400.png │ │ │ ├── Wide310x150Logo.scale-100.png │ │ │ ├── Wide310x150Logo.scale-125.png │ │ │ ├── Wide310x150Logo.scale-150.png │ │ │ ├── Wide310x150Logo.scale-200.png │ │ │ └── Wide310x150Logo.scale-400.png │ │ ├── contrast-standard │ │ │ ├── LargeTile.scale-100.png │ │ │ ├── LargeTile.scale-125.png │ │ │ ├── LargeTile.scale-150.png │ │ │ ├── LargeTile.scale-200.png │ │ │ ├── LargeTile.scale-400.png │ │ │ ├── SmallTile.scale-100.png │ │ │ ├── SmallTile.scale-125.png │ │ │ ├── SmallTile.scale-150.png │ │ │ ├── SmallTile.scale-200.png │ │ │ ├── SmallTile.scale-400.png │ │ │ ├── SplashScreen.scale-100.png │ │ │ ├── SplashScreen.scale-125.png │ │ │ ├── SplashScreen.scale-150.png │ │ │ ├── SplashScreen.scale-200.png │ │ │ ├── SplashScreen.scale-400.png │ │ │ ├── Square150x150Logo.scale-100.png │ │ │ ├── Square150x150Logo.scale-125.png │ │ │ ├── Square150x150Logo.scale-150.png │ │ │ ├── Square150x150Logo.scale-200.png │ │ │ ├── Square150x150Logo.scale-400.png │ │ │ ├── Square44x44Logo.altform-unplated_targetsize-16.png │ │ │ ├── Square44x44Logo.altform-unplated_targetsize-24.png │ │ │ ├── Square44x44Logo.altform-unplated_targetsize-256.png │ │ │ ├── Square44x44Logo.altform-unplated_targetsize-32.png │ │ │ ├── Square44x44Logo.altform-unplated_targetsize-48.png │ │ │ ├── Square44x44Logo.scale-100.png │ │ │ ├── Square44x44Logo.scale-125.png │ │ │ ├── Square44x44Logo.scale-150.png │ │ │ ├── Square44x44Logo.scale-200.png │ │ │ ├── Square44x44Logo.scale-400.png │ │ │ ├── Square44x44Logo.targetsize-16.png │ │ │ ├── Square44x44Logo.targetsize-24.png │ │ │ ├── Square44x44Logo.targetsize-256.png │ │ │ ├── Square44x44Logo.targetsize-32.png │ │ │ ├── Square44x44Logo.targetsize-48.png │ │ │ ├── StoreLogo.scale-100.png │ │ │ ├── StoreLogo.scale-125.png │ │ │ ├── StoreLogo.scale-150.png │ │ │ ├── StoreLogo.scale-200.png │ │ │ ├── StoreLogo.scale-400.png │ │ │ ├── Wide310x150Logo.scale-100.png │ │ │ ├── Wide310x150Logo.scale-125.png │ │ │ ├── Wide310x150Logo.scale-150.png │ │ │ ├── Wide310x150Logo.scale-200.png │ │ │ └── Wide310x150Logo.scale-400.png │ │ ├── contrast-white │ │ │ ├── LargeTile.scale-100.png │ │ │ ├── LargeTile.scale-125.png │ │ │ ├── LargeTile.scale-150.png │ │ │ ├── LargeTile.scale-200.png │ │ │ ├── LargeTile.scale-400.png │ │ │ ├── SmallTile.scale-100.png │ │ │ ├── SmallTile.scale-125.png │ │ │ ├── SmallTile.scale-150.png │ │ │ ├── SmallTile.scale-200.png │ │ │ ├── SmallTile.scale-400.png │ │ │ ├── SplashScreen.scale-100.png │ │ │ ├── SplashScreen.scale-125.png │ │ │ ├── SplashScreen.scale-150.png │ │ │ ├── SplashScreen.scale-200.png │ │ │ ├── SplashScreen.scale-400.png │ │ │ ├── Square150x150Logo.scale-100.png │ │ │ ├── Square150x150Logo.scale-125.png │ │ │ ├── Square150x150Logo.scale-150.png │ │ │ ├── Square150x150Logo.scale-200.png │ │ │ ├── Square150x150Logo.scale-400.png │ │ │ ├── Square44x44Logo.altform-unplated_targetsize-16.png │ │ │ ├── Square44x44Logo.altform-unplated_targetsize-24.png │ │ │ ├── Square44x44Logo.altform-unplated_targetsize-256.png │ │ │ ├── Square44x44Logo.altform-unplated_targetsize-32.png │ │ │ ├── Square44x44Logo.altform-unplated_targetsize-48.png │ │ │ ├── Square44x44Logo.scale-100.png │ │ │ ├── Square44x44Logo.scale-125.png │ │ │ ├── Square44x44Logo.scale-150.png │ │ │ ├── Square44x44Logo.scale-200.png │ │ │ ├── Square44x44Logo.scale-400.png │ │ │ ├── Square44x44Logo.targetsize-16.png │ │ │ ├── Square44x44Logo.targetsize-24.png │ │ │ ├── Square44x44Logo.targetsize-256.png │ │ │ ├── Square44x44Logo.targetsize-32.png │ │ │ ├── Square44x44Logo.targetsize-48.png │ │ │ ├── StoreLogo.scale-100.png │ │ │ ├── StoreLogo.scale-125.png │ │ │ ├── StoreLogo.scale-150.png │ │ │ ├── StoreLogo.scale-200.png │ │ │ ├── StoreLogo.scale-400.png │ │ │ ├── Wide310x150Logo.scale-100.png │ │ │ ├── Wide310x150Logo.scale-125.png │ │ │ ├── Wide310x150Logo.scale-150.png │ │ │ ├── Wide310x150Logo.scale-200.png │ │ │ └── Wide310x150Logo.scale-400.png │ │ └── in-app │ │ │ ├── logo-black.png │ │ │ └── logo-white.png │ └── StoreLogo.backup.png │ ├── Controls │ └── OpenDownCommandbar.cs │ ├── Helpers │ ├── BoolToTextWrappingConverter.cs │ ├── EnumToBooleanConverter.cs │ ├── Json.cs │ ├── Observable.cs │ ├── PrintHelper.cs │ ├── RelayCommand.cs │ ├── ResourceExtensions.cs │ ├── SettingsStorageExtensions.cs │ └── Singleton.cs │ ├── Models │ ├── DragDropCompletedData.cs │ ├── DragDropData.cs │ ├── DragDropStartingData.cs │ ├── LoadDataModel.cs │ └── TextDataModel.cs │ ├── NotepadRs4.csproj │ ├── NotepadRs4.csproj.user │ ├── Package.appxmanifest │ ├── Properties │ ├── AssemblyInfo.cs │ └── Default.rd.xml │ ├── Services │ ├── ActivationService.cs │ ├── DragAndDrop │ │ ├── DragDropService.cs │ │ ├── DropConfiguration.cs │ │ ├── ListViewDropConfiguration.cs │ │ └── VisualDropConfiguration.cs │ ├── FileAssociationService.cs │ ├── FileDataService.cs │ ├── NavigationService.cs │ ├── NotificationService.cs │ ├── OnBackgroundEnteringEventArgs.cs │ ├── SuspendAndResumeService.cs │ ├── SuspensionState.cs │ ├── ThemeSelectorService.cs │ ├── ViewLifetimeControl.cs │ ├── WhatsNewDisplayService.cs │ └── WindowManagerService.cs │ ├── Strings │ ├── en-us │ │ └── Resources.resw │ ├── nl-NL │ │ └── Resources.resw │ └── pl-PL │ │ └── Resources.resw │ ├── Styles │ ├── ContentDialog.xaml │ ├── Page.xaml │ ├── StackPanel.xaml │ ├── TextBlock.xaml │ ├── TextBox.xaml │ ├── ToggleButton.xaml │ ├── _Colors.xaml │ ├── _Corners.xaml │ ├── _FontSizes.xaml │ └── _Thickness.xaml │ ├── ViewModels │ ├── AboutViewModel.cs │ ├── MainViewModel.cs │ ├── NotificationBase.cs │ └── SettingsViewModel.cs │ └── Views │ ├── Dialogs │ ├── AboutDialog.xaml │ ├── AboutDialog.xaml.cs │ ├── ExitConfirmationDialog.xaml │ ├── ExitConfirmationDialog.xaml.cs │ ├── SettingsDialog.xaml │ ├── SettingsDialog.xaml.cs │ ├── UnsavedDialog.xaml │ ├── UnsavedDialog.xaml.cs │ ├── WhatsNewDialog.xaml │ └── WhatsNewDialog.xaml.cs │ ├── MainPage.xaml │ ├── MainPage.xaml.cs │ ├── XamlPlayground.xaml │ └── XamlPlayground.xaml.cs ├── README.md └── screenshots ├── 1.png ├── 2.png ├── 3.png ├── 4.png └── 5.png /.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 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [ikarago] 4 | patreon: ikarago 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: ikarago 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | custom: https://paypal.me/ikarago 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | project.fragment.lock.json 46 | artifacts/ 47 | 48 | *_i.c 49 | *_p.c 50 | *_i.h 51 | *.ilk 52 | *.meta 53 | *.obj 54 | *.pch 55 | *.pdb 56 | *.pgc 57 | *.pgd 58 | *.rsp 59 | *.sbr 60 | *.tlb 61 | *.tli 62 | *.tlh 63 | *.tmp 64 | *.tmp_proj 65 | *.log 66 | *.vspscc 67 | *.vssscc 68 | .builds 69 | *.pidb 70 | *.svclog 71 | *.scc 72 | 73 | # Chutzpah Test files 74 | _Chutzpah* 75 | 76 | # Visual C++ cache files 77 | ipch/ 78 | *.aps 79 | *.ncb 80 | *.opendb 81 | *.opensdf 82 | *.sdf 83 | *.cachefile 84 | *.VC.db 85 | *.VC.VC.opendb 86 | 87 | # Visual Studio profiler 88 | *.psess 89 | *.vsp 90 | *.vspx 91 | *.sap 92 | 93 | # TFS 2012 Local Workspace 94 | $tf/ 95 | 96 | # Guidance Automation Toolkit 97 | *.gpState 98 | 99 | # ReSharper is a .NET coding add-in 100 | _ReSharper*/ 101 | *.[Rr]e[Ss]harper 102 | *.DotSettings.user 103 | 104 | # JustCode is a .NET coding add-in 105 | .JustCode 106 | 107 | # TeamCity is a build add-in 108 | _TeamCity* 109 | 110 | # DotCover is a Code Coverage Tool 111 | *.dotCover 112 | 113 | # NCrunch 114 | _NCrunch_* 115 | .*crunch*.local.xml 116 | nCrunchTemp_* 117 | 118 | # MightyMoose 119 | *.mm.* 120 | AutoTest.Net/ 121 | 122 | # Web workbench (sass) 123 | .sass-cache/ 124 | 125 | # Installshield output folder 126 | [Ee]xpress/ 127 | 128 | # DocProject is a documentation generator add-in 129 | DocProject/buildhelp/ 130 | DocProject/Help/*.HxT 131 | DocProject/Help/*.HxC 132 | DocProject/Help/*.hhc 133 | DocProject/Help/*.hhk 134 | DocProject/Help/*.hhp 135 | DocProject/Help/Html2 136 | DocProject/Help/html 137 | 138 | # Click-Once directory 139 | publish/ 140 | 141 | # Publish Web Output 142 | *.[Pp]ublish.xml 143 | *.azurePubxml 144 | # TODO: Comment the next line if you want to checkin your web deploy settings 145 | # but database connection strings (with potential passwords) will be unencrypted 146 | #*.pubxml 147 | *.publishproj 148 | 149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 150 | # checkin your Azure Web App publish settings, but sensitive information contained 151 | # in these scripts will be unencrypted 152 | PublishScripts/ 153 | 154 | # NuGet Packages 155 | *.nupkg 156 | # The packages folder can be ignored because of Package Restore 157 | **/packages/* 158 | # except build/, which is used as an MSBuild target. 159 | !**/packages/build/ 160 | # Uncomment if necessary however generally it will be regenerated when needed 161 | #!**/packages/repositories.config 162 | # NuGet v3's project.json files produces more ignoreable files 163 | *.nuget.props 164 | *.nuget.targets 165 | 166 | # Microsoft Azure Build Output 167 | csx/ 168 | *.build.csdef 169 | 170 | # Microsoft Azure Emulator 171 | ecf/ 172 | rcf/ 173 | 174 | # Windows Store app package directories and files 175 | AppPackages/ 176 | BundleArtifacts/ 177 | Package.StoreAssociation.xml 178 | _pkginfo.txt 179 | 180 | # Visual Studio cache files 181 | # files ending in .cache can be ignored 182 | *.[Cc]ache 183 | # but keep track of directories ending in .cache 184 | !*.[Cc]ache/ 185 | 186 | # Others 187 | ClientBin/ 188 | ~$* 189 | *~ 190 | *.dbmdl 191 | *.dbproj.schemaview 192 | *.jfm 193 | *.pfx 194 | *.publishsettings 195 | node_modules/ 196 | orleans.codegen.cs 197 | 198 | # Since there are multiple workflows, uncomment next line to ignore bower_components 199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 200 | #bower_components/ 201 | 202 | # RIA/Silverlight projects 203 | Generated_Code/ 204 | 205 | # Backup & report files from converting an old project file 206 | # to a newer Visual Studio version. Backup files are not needed, 207 | # because we have git ;-) 208 | _UpgradeReport_Files/ 209 | Backup*/ 210 | UpgradeLog*.XML 211 | UpgradeLog*.htm 212 | 213 | # SQL Server files 214 | *.mdf 215 | *.ldf 216 | 217 | # Business Intelligence projects 218 | *.rdl.data 219 | *.bim.layout 220 | *.bim_*.settings 221 | 222 | # Microsoft Fakes 223 | FakesAssemblies/ 224 | 225 | # GhostDoc plugin setting file 226 | *.GhostDoc.xml 227 | 228 | # Node.js Tools for Visual Studio 229 | .ntvs_analysis.dat 230 | 231 | # Visual Studio 6 build log 232 | *.plg 233 | 234 | # Visual Studio 6 workspace options file 235 | *.opt 236 | 237 | # Visual Studio LightSwitch build output 238 | **/*.HTMLClient/GeneratedArtifacts 239 | **/*.DesktopClient/GeneratedArtifacts 240 | **/*.DesktopClient/ModelManifest.xml 241 | **/*.Server/GeneratedArtifacts 242 | **/*.Server/ModelManifest.xml 243 | _Pvt_Extensions 244 | 245 | # Paket dependency manager 246 | .paket/paket.exe 247 | paket-files/ 248 | 249 | # FAKE - F# Make 250 | .fake/ 251 | 252 | # JetBrains Rider 253 | .idea/ 254 | *.sln.iml 255 | 256 | # CodeRush 257 | .cr/ 258 | 259 | # Python Tools for Visual Studio (PTVS) 260 | __pycache__/ 261 | *.pyc -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Ikarago 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.28803.352 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NotepadRs4", "NotepadRs4\NotepadRs4.csproj", "{7A73946B-5716-4B11-99FE-FCD48B80893A}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|ARM = Debug|ARM 11 | Debug|ARM64 = Debug|ARM64 12 | Debug|x64 = Debug|x64 13 | Debug|x86 = Debug|x86 14 | Release|ARM = Release|ARM 15 | Release|ARM64 = Release|ARM64 16 | Release|x64 = Release|x64 17 | Release|x86 = Release|x86 18 | EndGlobalSection 19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 20 | {7A73946B-5716-4B11-99FE-FCD48B80893A}.Debug|ARM.ActiveCfg = Debug|ARM 21 | {7A73946B-5716-4B11-99FE-FCD48B80893A}.Debug|ARM.Build.0 = Debug|ARM 22 | {7A73946B-5716-4B11-99FE-FCD48B80893A}.Debug|ARM.Deploy.0 = Debug|ARM 23 | {7A73946B-5716-4B11-99FE-FCD48B80893A}.Debug|ARM64.ActiveCfg = Debug|ARM64 24 | {7A73946B-5716-4B11-99FE-FCD48B80893A}.Debug|ARM64.Build.0 = Debug|ARM64 25 | {7A73946B-5716-4B11-99FE-FCD48B80893A}.Debug|ARM64.Deploy.0 = Debug|ARM64 26 | {7A73946B-5716-4B11-99FE-FCD48B80893A}.Debug|x64.ActiveCfg = Debug|x64 27 | {7A73946B-5716-4B11-99FE-FCD48B80893A}.Debug|x64.Build.0 = Debug|x64 28 | {7A73946B-5716-4B11-99FE-FCD48B80893A}.Debug|x64.Deploy.0 = Debug|x64 29 | {7A73946B-5716-4B11-99FE-FCD48B80893A}.Debug|x86.ActiveCfg = Debug|x86 30 | {7A73946B-5716-4B11-99FE-FCD48B80893A}.Debug|x86.Build.0 = Debug|x86 31 | {7A73946B-5716-4B11-99FE-FCD48B80893A}.Debug|x86.Deploy.0 = Debug|x86 32 | {7A73946B-5716-4B11-99FE-FCD48B80893A}.Release|ARM.ActiveCfg = Release|ARM 33 | {7A73946B-5716-4B11-99FE-FCD48B80893A}.Release|ARM.Build.0 = Release|ARM 34 | {7A73946B-5716-4B11-99FE-FCD48B80893A}.Release|ARM.Deploy.0 = Release|ARM 35 | {7A73946B-5716-4B11-99FE-FCD48B80893A}.Release|ARM64.ActiveCfg = Release|ARM64 36 | {7A73946B-5716-4B11-99FE-FCD48B80893A}.Release|ARM64.Build.0 = Release|ARM64 37 | {7A73946B-5716-4B11-99FE-FCD48B80893A}.Release|ARM64.Deploy.0 = Release|ARM64 38 | {7A73946B-5716-4B11-99FE-FCD48B80893A}.Release|x64.ActiveCfg = Release|x64 39 | {7A73946B-5716-4B11-99FE-FCD48B80893A}.Release|x64.Build.0 = Release|x64 40 | {7A73946B-5716-4B11-99FE-FCD48B80893A}.Release|x64.Deploy.0 = Release|x64 41 | {7A73946B-5716-4B11-99FE-FCD48B80893A}.Release|x86.ActiveCfg = Release|x86 42 | {7A73946B-5716-4B11-99FE-FCD48B80893A}.Release|x86.Build.0 = Release|x86 43 | {7A73946B-5716-4B11-99FE-FCD48B80893A}.Release|x86.Deploy.0 = Release|x86 44 | EndGlobalSection 45 | GlobalSection(SolutionProperties) = preSolution 46 | HideSolutionNode = FALSE 47 | EndGlobalSection 48 | GlobalSection(ExtensibilityGlobals) = postSolution 49 | SolutionGuid = {4760E50F-0B15-4A69-9111-7627F261530C} 50 | EndGlobalSection 51 | EndGlobal 52 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Activation/ActivationHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | 4 | namespace NotepadRs4.Activation 5 | { 6 | // For more information on application activation see https://github.com/Microsoft/WindowsTemplateStudio/blob/master/docs/activation.md 7 | internal abstract class ActivationHandler 8 | { 9 | public abstract bool CanHandle(object args); 10 | 11 | public abstract Task HandleAsync(object args); 12 | } 13 | 14 | internal abstract class ActivationHandler : ActivationHandler 15 | where T : class 16 | { 17 | protected abstract Task HandleInternalAsync(T args); 18 | 19 | public override async Task HandleAsync(object args) 20 | { 21 | await HandleInternalAsync(args as T); 22 | } 23 | 24 | public override bool CanHandle(object args) 25 | { 26 | return args is T && CanHandleInternal(args as T); 27 | } 28 | 29 | protected virtual bool CanHandleInternal(T args) 30 | { 31 | return true; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Activation/DefaultLaunchActivationHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | 4 | using NotepadRs4.Services; 5 | 6 | using Windows.ApplicationModel.Activation; 7 | 8 | namespace NotepadRs4.Activation 9 | { 10 | internal class DefaultLaunchActivationHandler : ActivationHandler 11 | { 12 | private readonly Type _navElement; 13 | 14 | public DefaultLaunchActivationHandler(Type navElement) 15 | { 16 | _navElement = navElement; 17 | } 18 | 19 | protected override async Task HandleInternalAsync(LaunchActivatedEventArgs args) 20 | { 21 | // When the navigation stack isn't restored, navigate to the first page and configure 22 | // the new page by passing required information in the navigation parameter 23 | NavigationService.Navigate(_navElement, args.Arguments); 24 | 25 | await Task.CompletedTask; 26 | } 27 | 28 | protected override bool CanHandleInternal(LaunchActivatedEventArgs args) 29 | { 30 | // None of the ActivationHandlers has handled the app activation 31 | return NavigationService.Frame.Content == null; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/App.xaml: -------------------------------------------------------------------------------- 1 |  7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | using NotepadRs4.Services; 4 | 5 | using Windows.ApplicationModel; 6 | using Windows.ApplicationModel.Activation; 7 | using Windows.System.Profile; 8 | using Windows.UI.Xaml; 9 | 10 | namespace NotepadRs4 11 | { 12 | public sealed partial class App : Application 13 | { 14 | // Set a global variable for the App_CloseRequest so it can keep an eye on whether to show the confirm close-dialog. 15 | public static bool UnsavedChanges { get; set; } 16 | 17 | private Lazy _activationService; 18 | 19 | private ActivationService ActivationService 20 | { 21 | get { return _activationService.Value; } 22 | } 23 | 24 | public App() 25 | { 26 | InitializeComponent(); 27 | 28 | // Xbox stuff (Disabled, only here for testing) 29 | //this.RequiresPointerMode = Windows.UI.Xaml.ApplicationRequiresPointerMode.WhenRequested; 30 | //if (AnalyticsInfo.VersionInfo.DeviceFamily == "Windows.Xbox") 31 | //{ 32 | // this.FocusVisualKind = FocusVisualKind.Reveal; 33 | //} 34 | 35 | UnsavedChanges = false; // Setting it by default to false, because the app will open the files unedited anyway. :) 36 | 37 | EnteredBackground += App_EnteredBackground; 38 | 39 | // Deferred execution until used. Check https://msdn.microsoft.com/library/dd642331(v=vs.110).aspx for further info on Lazy class. 40 | _activationService = new Lazy(CreateActivationService); 41 | } 42 | 43 | protected override async void OnLaunched(LaunchActivatedEventArgs args) 44 | { 45 | if (!args.PrelaunchActivated) 46 | { 47 | await ActivationService.ActivateAsync(args); 48 | } 49 | } 50 | 51 | protected override async void OnActivated(IActivatedEventArgs args) 52 | { 53 | await ActivationService.ActivateAsync(args); 54 | } 55 | 56 | protected override async void OnFileActivated(FileActivatedEventArgs args) 57 | { 58 | await ActivationService.ActivateAsync(args); 59 | } 60 | 61 | private ActivationService CreateActivationService() 62 | { 63 | return new ActivationService(this, typeof(Views.MainPage)); 64 | } 65 | 66 | private async void App_EnteredBackground(object sender, EnteredBackgroundEventArgs e) 67 | { 68 | var deferral = e.GetDeferral(); 69 | await Helpers.Singleton.Instance.SaveStateAsync(); 70 | deferral.Complete(); 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Icons/BingIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Icons/BingIcon.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Icons/WhatsNewDark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Icons/WhatsNewDark.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Icons/WhatsNewLight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Icons/WhatsNewLight.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/LargeTile.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/LargeTile.scale-100.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/LargeTile.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/LargeTile.scale-125.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/LargeTile.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/LargeTile.scale-150.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/LargeTile.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/LargeTile.scale-200.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/LargeTile.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/LargeTile.scale-400.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/SmallTile.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/SmallTile.scale-100.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/SmallTile.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/SmallTile.scale-125.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/SmallTile.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/SmallTile.scale-150.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/SmallTile.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/SmallTile.scale-200.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/SmallTile.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/SmallTile.scale-400.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/SplashScreen.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/SplashScreen.scale-100.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/SplashScreen.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/SplashScreen.scale-125.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/SplashScreen.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/SplashScreen.scale-150.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/SplashScreen.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/SplashScreen.scale-200.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/SplashScreen.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/SplashScreen.scale-400.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Square150x150Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Square150x150Logo.scale-100.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Square150x150Logo.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Square150x150Logo.scale-125.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Square150x150Logo.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Square150x150Logo.scale-150.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Square150x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Square150x150Logo.scale-200.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Square150x150Logo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Square150x150Logo.scale-400.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Square44x44Logo.altform-unplated_targetsize-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Square44x44Logo.altform-unplated_targetsize-16.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Square44x44Logo.altform-unplated_targetsize-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Square44x44Logo.altform-unplated_targetsize-24.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Square44x44Logo.altform-unplated_targetsize-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Square44x44Logo.altform-unplated_targetsize-256.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Square44x44Logo.altform-unplated_targetsize-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Square44x44Logo.altform-unplated_targetsize-32.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Square44x44Logo.altform-unplated_targetsize-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Square44x44Logo.altform-unplated_targetsize-48.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Square44x44Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Square44x44Logo.scale-100.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Square44x44Logo.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Square44x44Logo.scale-125.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Square44x44Logo.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Square44x44Logo.scale-150.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Square44x44Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Square44x44Logo.scale-200.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Square44x44Logo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Square44x44Logo.scale-400.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Square44x44Logo.targetsize-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Square44x44Logo.targetsize-16.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Square44x44Logo.targetsize-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Square44x44Logo.targetsize-24.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Square44x44Logo.targetsize-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Square44x44Logo.targetsize-256.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Square44x44Logo.targetsize-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Square44x44Logo.targetsize-32.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Square44x44Logo.targetsize-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Square44x44Logo.targetsize-48.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/StoreLogo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/StoreLogo.scale-100.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/StoreLogo.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/StoreLogo.scale-125.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/StoreLogo.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/StoreLogo.scale-150.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/StoreLogo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/StoreLogo.scale-200.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/StoreLogo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/StoreLogo.scale-400.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Wide310x150Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Wide310x150Logo.scale-100.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Wide310x150Logo.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Wide310x150Logo.scale-125.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Wide310x150Logo.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Wide310x150Logo.scale-150.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Wide310x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Wide310x150Logo.scale-200.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Wide310x150Logo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-black/Wide310x150Logo.scale-400.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/LargeTile.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/LargeTile.scale-100.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/LargeTile.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/LargeTile.scale-125.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/LargeTile.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/LargeTile.scale-150.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/LargeTile.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/LargeTile.scale-200.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/LargeTile.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/LargeTile.scale-400.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/SmallTile.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/SmallTile.scale-100.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/SmallTile.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/SmallTile.scale-125.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/SmallTile.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/SmallTile.scale-150.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/SmallTile.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/SmallTile.scale-200.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/SmallTile.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/SmallTile.scale-400.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/SplashScreen.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/SplashScreen.scale-100.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/SplashScreen.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/SplashScreen.scale-125.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/SplashScreen.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/SplashScreen.scale-150.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/SplashScreen.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/SplashScreen.scale-200.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/SplashScreen.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/SplashScreen.scale-400.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Square150x150Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Square150x150Logo.scale-100.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Square150x150Logo.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Square150x150Logo.scale-125.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Square150x150Logo.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Square150x150Logo.scale-150.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Square150x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Square150x150Logo.scale-200.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Square150x150Logo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Square150x150Logo.scale-400.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Square44x44Logo.altform-unplated_targetsize-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Square44x44Logo.altform-unplated_targetsize-16.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Square44x44Logo.altform-unplated_targetsize-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Square44x44Logo.altform-unplated_targetsize-24.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Square44x44Logo.altform-unplated_targetsize-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Square44x44Logo.altform-unplated_targetsize-256.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Square44x44Logo.altform-unplated_targetsize-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Square44x44Logo.altform-unplated_targetsize-32.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Square44x44Logo.altform-unplated_targetsize-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Square44x44Logo.altform-unplated_targetsize-48.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Square44x44Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Square44x44Logo.scale-100.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Square44x44Logo.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Square44x44Logo.scale-125.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Square44x44Logo.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Square44x44Logo.scale-150.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Square44x44Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Square44x44Logo.scale-200.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Square44x44Logo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Square44x44Logo.scale-400.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Square44x44Logo.targetsize-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Square44x44Logo.targetsize-16.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Square44x44Logo.targetsize-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Square44x44Logo.targetsize-24.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Square44x44Logo.targetsize-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Square44x44Logo.targetsize-256.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Square44x44Logo.targetsize-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Square44x44Logo.targetsize-32.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Square44x44Logo.targetsize-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Square44x44Logo.targetsize-48.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/StoreLogo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/StoreLogo.scale-100.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/StoreLogo.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/StoreLogo.scale-125.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/StoreLogo.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/StoreLogo.scale-150.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/StoreLogo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/StoreLogo.scale-200.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/StoreLogo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/StoreLogo.scale-400.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Wide310x150Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Wide310x150Logo.scale-100.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Wide310x150Logo.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Wide310x150Logo.scale-125.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Wide310x150Logo.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Wide310x150Logo.scale-150.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Wide310x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Wide310x150Logo.scale-200.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Wide310x150Logo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-standard/Wide310x150Logo.scale-400.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/LargeTile.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/LargeTile.scale-100.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/LargeTile.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/LargeTile.scale-125.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/LargeTile.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/LargeTile.scale-150.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/LargeTile.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/LargeTile.scale-200.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/LargeTile.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/LargeTile.scale-400.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/SmallTile.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/SmallTile.scale-100.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/SmallTile.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/SmallTile.scale-125.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/SmallTile.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/SmallTile.scale-150.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/SmallTile.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/SmallTile.scale-200.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/SmallTile.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/SmallTile.scale-400.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/SplashScreen.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/SplashScreen.scale-100.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/SplashScreen.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/SplashScreen.scale-125.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/SplashScreen.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/SplashScreen.scale-150.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/SplashScreen.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/SplashScreen.scale-200.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/SplashScreen.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/SplashScreen.scale-400.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Square150x150Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Square150x150Logo.scale-100.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Square150x150Logo.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Square150x150Logo.scale-125.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Square150x150Logo.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Square150x150Logo.scale-150.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Square150x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Square150x150Logo.scale-200.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Square150x150Logo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Square150x150Logo.scale-400.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Square44x44Logo.altform-unplated_targetsize-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Square44x44Logo.altform-unplated_targetsize-16.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Square44x44Logo.altform-unplated_targetsize-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Square44x44Logo.altform-unplated_targetsize-24.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Square44x44Logo.altform-unplated_targetsize-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Square44x44Logo.altform-unplated_targetsize-256.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Square44x44Logo.altform-unplated_targetsize-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Square44x44Logo.altform-unplated_targetsize-32.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Square44x44Logo.altform-unplated_targetsize-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Square44x44Logo.altform-unplated_targetsize-48.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Square44x44Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Square44x44Logo.scale-100.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Square44x44Logo.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Square44x44Logo.scale-125.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Square44x44Logo.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Square44x44Logo.scale-150.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Square44x44Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Square44x44Logo.scale-200.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Square44x44Logo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Square44x44Logo.scale-400.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Square44x44Logo.targetsize-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Square44x44Logo.targetsize-16.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Square44x44Logo.targetsize-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Square44x44Logo.targetsize-24.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Square44x44Logo.targetsize-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Square44x44Logo.targetsize-256.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Square44x44Logo.targetsize-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Square44x44Logo.targetsize-32.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Square44x44Logo.targetsize-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Square44x44Logo.targetsize-48.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/StoreLogo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/StoreLogo.scale-100.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/StoreLogo.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/StoreLogo.scale-125.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/StoreLogo.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/StoreLogo.scale-150.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/StoreLogo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/StoreLogo.scale-200.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/StoreLogo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/StoreLogo.scale-400.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Wide310x150Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Wide310x150Logo.scale-100.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Wide310x150Logo.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Wide310x150Logo.scale-125.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Wide310x150Logo.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Wide310x150Logo.scale-150.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Wide310x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Wide310x150Logo.scale-200.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Wide310x150Logo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/contrast-white/Wide310x150Logo.scale-400.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/in-app/logo-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/in-app/logo-black.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/Logo/in-app/logo-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/Logo/in-app/logo-white.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Assets/StoreLogo.backup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikarago/Notepad/0595535e5466569fa8a391b8715e83a594c731c8/NotepadRs4/NotepadRs4/Assets/StoreLogo.backup.png -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Controls/OpenDownCommandbar.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Windows.UI.Xaml; 7 | using Windows.UI.Xaml.Controls; 8 | 9 | // Build with the sample of David Ewen at StackOverflow: http://stackoverflow.com/questions/33290361/ 10 | 11 | namespace NotepadRs4.Controls 12 | { 13 | // #ACTIVE CODE (AGAIN): This code isn't used anymore in this app, but it's still here so you might be able to learn something from it 14 | // Reason for abandoning this code is due to the CommandBar being able to function properly again, so no need for it anymore to force the DropDownMenu to go down. 15 | // UPDATE: 2019-11-04: After some UI updates, the CommandBar goes ugly again, so I re-enabled this to be able to make use of it again. 16 | 17 | public class OpenDownCommandBarVisualStateManager : VisualStateManager 18 | { 19 | protected override bool GoToStateCore(Control control, FrameworkElement templateRoot, string stateName, VisualStateGroup group, VisualState state, bool useTransitions) 20 | { 21 | // Replace the OpenUp state for the OpenDown one and continue like normal 22 | if (!string.IsNullOrWhiteSpace(stateName) && stateName.EndsWith("OpenUp")) 23 | { 24 | stateName = stateName.Substring(0, stateName.Length - 6) + "OpenDown"; 25 | } 26 | 27 | return base.GoToStateCore(control, templateRoot, stateName, group, state, useTransitions); 28 | } 29 | } 30 | 31 | public class OpenDownCommandBar : CommandBar 32 | { 33 | public OpenDownCommandBar() 34 | { 35 | 36 | } 37 | 38 | protected override void OnApplyTemplate() 39 | { 40 | base.OnApplyTemplate(); 41 | var layoutRoot = GetTemplateChild("LayoutRoot") as Grid; 42 | if (layoutRoot != null) 43 | { 44 | VisualStateManager.SetCustomVisualStateManager(layoutRoot, new OpenDownCommandBarVisualStateManager()); 45 | } 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Helpers/BoolToTextWrappingConverter.cs: -------------------------------------------------------------------------------- 1 | // --------------------------------------------------------------------------------- 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // 4 | // The MIT License (MIT) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // --------------------------------------------------------------------------------- 24 | 25 | // Based on the BooleanToVisibiltyConverter from the UWP RSS Reader sample 26 | // https://github.com/Microsoft/Windows-appsample-rssreader/blob/master/RssReader/Common/BooleanToVisibilityConverter.cs 27 | 28 | using System; 29 | 30 | using Windows.UI.Xaml; 31 | using Windows.UI.Xaml.Data; 32 | 33 | namespace NotepadRs4.Helpers 34 | { 35 | /// 36 | /// Converts between bool and TextWrapping values 37 | /// 38 | public class BoolToTextWrappingConverter : IValueConverter 39 | { 40 | /// 41 | /// Converts TextWrapping.Wrap values to 'true' and TextWrapping.NoWrap to 'false' 42 | /// 43 | public object Convert(object value, Type targetType, object parameter, string language) => 44 | (TextWrapping)value == TextWrapping.NoWrap ^ (parameter as string ?? string.Empty).Equals("Reverse"); 45 | 46 | /// 47 | /// Converts 'true' values to TextWrapping.Wrap and 'false' values to TextWrapping.NoWrap 48 | /// 49 | public object ConvertBack(object value, Type targetType, object parameter, string language) => 50 | (bool)value ^ (parameter as string ?? string.Empty).Equals("Reverse") ? 51 | TextWrapping.NoWrap : TextWrapping.Wrap; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Helpers/EnumToBooleanConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | using Windows.UI.Xaml.Data; 4 | 5 | namespace NotepadRs4.Helpers 6 | { 7 | public class EnumToBooleanConverter : IValueConverter 8 | { 9 | public Type EnumType { get; set; } 10 | 11 | public object Convert(object value, Type targetType, object parameter, string language) 12 | { 13 | if (parameter is string enumString) 14 | { 15 | if (!Enum.IsDefined(EnumType, value)) 16 | { 17 | throw new ArgumentException("ExceptionEnumToBooleanConverterValueMustBeAnEnum".GetLocalized()); 18 | } 19 | 20 | var enumValue = Enum.Parse(EnumType, enumString); 21 | 22 | return enumValue.Equals(value); 23 | } 24 | 25 | throw new ArgumentException("ExceptionEnumToBooleanConverterParameterMustBeAnEnumName".GetLocalized()); 26 | } 27 | 28 | public object ConvertBack(object value, Type targetType, object parameter, string language) 29 | { 30 | if (parameter is string enumString) 31 | { 32 | return Enum.Parse(EnumType, enumString); 33 | } 34 | 35 | throw new ArgumentException("ExceptionEnumToBooleanConverterParameterMustBeAnEnumName".GetLocalized()); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Helpers/Json.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | 4 | using Newtonsoft.Json; 5 | 6 | namespace NotepadRs4.Helpers 7 | { 8 | public static class Json 9 | { 10 | public static async Task ToObjectAsync(string value) 11 | { 12 | return await Task.Run(() => 13 | { 14 | return JsonConvert.DeserializeObject(value); 15 | }); 16 | } 17 | 18 | public static async Task StringifyAsync(object value) 19 | { 20 | return await Task.Run(() => 21 | { 22 | return JsonConvert.SerializeObject(value); 23 | }); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Helpers/Observable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | using System.Runtime.CompilerServices; 4 | 5 | namespace NotepadRs4.Helpers 6 | { 7 | public class Observable : INotifyPropertyChanged 8 | { 9 | public event PropertyChangedEventHandler PropertyChanged; 10 | 11 | protected void Set(ref T storage, T value, [CallerMemberName]string propertyName = null) 12 | { 13 | if (Equals(storage, value)) 14 | { 15 | return; 16 | } 17 | 18 | storage = value; 19 | OnPropertyChanged(propertyName); 20 | } 21 | 22 | protected void OnPropertyChanged(string propertyName) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Helpers/PrintHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using Windows.Graphics.Printing; 8 | using Windows.UI.Xaml; 9 | using Windows.UI.Xaml.Controls; 10 | using Windows.UI.Xaml.Printing; 11 | 12 | namespace NotepadRs4.Helpers 13 | { 14 | public class PrintHelper 15 | { 16 | protected PrintDocument printDocument; 17 | protected IPrintDocumentSource printDocumentSource; 18 | 19 | protected FrameworkElement firstPage; 20 | 21 | 22 | 23 | 24 | public virtual void RegisterForPrinting() 25 | { 26 | printDocument = new PrintDocument(); 27 | printDocumentSource = printDocument.DocumentSource; 28 | // Paginate 29 | printDocument.Paginate += Paginate; 30 | // Get Preview Pages 31 | // Add pages 32 | 33 | PrintManager printManager = PrintManager.GetForCurrentView(); 34 | printManager.PrintTaskRequested += PrintTaskRequested; 35 | } 36 | 37 | private void Paginate(object sender, PaginateEventArgs e) 38 | { 39 | throw new NotImplementedException(); 40 | } 41 | 42 | public virtual void UnregisterForPrinting() 43 | { 44 | if (printDocument == null) 45 | { 46 | return; 47 | } 48 | 49 | // Paginate 50 | // Get preview page 51 | // add pages 52 | 53 | PrintManager printManager = PrintManager.GetForCurrentView(); 54 | printManager.PrintTaskRequested -= PrintTaskRequested; 55 | 56 | // clear canvas 57 | } 58 | 59 | public virtual void PreparePrintContent(Page page) 60 | { 61 | if (firstPage == null) 62 | { 63 | firstPage = page; 64 | } 65 | 66 | // Add it to the print canvas 67 | } 68 | 69 | 70 | 71 | 72 | private void PrintTaskRequested(PrintManager sender, PrintTaskRequestedEventArgs e) 73 | { 74 | PrintTask printTask = null; 75 | printTask = e.Request.CreatePrintTask("Notepad", sourceRequested => 76 | { 77 | printTask.Completed += async (s, args) => 78 | { 79 | if (args.Completion == PrintTaskCompletion.Failed) 80 | { 81 | Debug.WriteLine("Printing failed"); 82 | // Notify back to the user 83 | 84 | } 85 | }; 86 | 87 | sourceRequested.SetSource(printDocumentSource); 88 | }); 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Helpers/RelayCommand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Input; 3 | 4 | namespace NotepadRs4.Helpers 5 | { 6 | public class RelayCommand : ICommand 7 | { 8 | private readonly Action _execute; 9 | 10 | private readonly Func _canExecute; 11 | 12 | public event EventHandler CanExecuteChanged; 13 | 14 | public RelayCommand(Action execute) 15 | : this(execute, null) 16 | { 17 | } 18 | 19 | public RelayCommand(Action execute, Func canExecute) 20 | { 21 | _execute = execute ?? throw new ArgumentNullException(nameof(execute)); 22 | _canExecute = canExecute; 23 | } 24 | 25 | public bool CanExecute(object parameter) => _canExecute == null || _canExecute(); 26 | 27 | public void Execute(object parameter) => _execute(); 28 | 29 | public void OnCanExecuteChanged() => CanExecuteChanged?.Invoke(this, EventArgs.Empty); 30 | } 31 | 32 | public class RelayCommand : ICommand 33 | { 34 | private readonly Action _execute; 35 | 36 | private readonly Func _canExecute; 37 | 38 | public event EventHandler CanExecuteChanged; 39 | 40 | public RelayCommand(Action execute) 41 | : this(execute, null) 42 | { 43 | } 44 | 45 | public RelayCommand(Action execute, Func canExecute) 46 | { 47 | _execute = execute ?? throw new ArgumentNullException(nameof(execute)); 48 | _canExecute = canExecute; 49 | } 50 | 51 | public bool CanExecute(object parameter) => _canExecute == null || _canExecute((T)parameter); 52 | 53 | public void Execute(object parameter) => _execute((T)parameter); 54 | 55 | public void OnCanExecuteChanged() => CanExecuteChanged?.Invoke(this, EventArgs.Empty); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Helpers/ResourceExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | using Windows.ApplicationModel.Resources; 5 | 6 | namespace NotepadRs4.Helpers 7 | { 8 | internal static class ResourceExtensions 9 | { 10 | private static ResourceLoader _resLoader = new ResourceLoader(); 11 | 12 | public static string GetLocalized(this string resourceKey) 13 | { 14 | return _resLoader.GetString(resourceKey); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Helpers/SettingsStorageExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Threading.Tasks; 4 | 5 | using Windows.Storage; 6 | using Windows.Storage.Streams; 7 | 8 | namespace NotepadRs4.Helpers 9 | { 10 | // Use these extension methods to store and retrieve local and roaming app data 11 | // More details regarding storing and retrieving app data at https://docs.microsoft.com/windows/uwp/app-settings/store-and-retrieve-app-data 12 | public static class SettingsStorageExtensions 13 | { 14 | private const string FileExtension = ".json"; 15 | 16 | public static bool IsRoamingStorageAvailable(this ApplicationData appData) 17 | { 18 | return appData.RoamingStorageQuota == 0; 19 | } 20 | 21 | public static async Task SaveAsync(this StorageFolder folder, string name, T content) 22 | { 23 | var file = await folder.CreateFileAsync(GetFileName(name), CreationCollisionOption.ReplaceExisting); 24 | var fileContent = await Json.StringifyAsync(content); 25 | 26 | await FileIO.WriteTextAsync(file, fileContent); 27 | } 28 | 29 | public static async Task ReadAsync(this StorageFolder folder, string name) 30 | { 31 | if (!File.Exists(Path.Combine(folder.Path, GetFileName(name)))) 32 | { 33 | return default(T); 34 | } 35 | 36 | var file = await folder.GetFileAsync($"{name}.json"); 37 | var fileContent = await FileIO.ReadTextAsync(file); 38 | 39 | return await Json.ToObjectAsync(fileContent); 40 | } 41 | 42 | public static async Task SaveAsync(this ApplicationDataContainer settings, string key, T value) 43 | { 44 | settings.SaveString(key, await Json.StringifyAsync(value)); 45 | } 46 | 47 | public static void SaveString(this ApplicationDataContainer settings, string key, string value) 48 | { 49 | settings.Values[key] = value; 50 | } 51 | 52 | public static async Task ReadAsync(this ApplicationDataContainer settings, string key) 53 | { 54 | object obj = null; 55 | 56 | if (settings.Values.TryGetValue(key, out obj)) 57 | { 58 | return await Json.ToObjectAsync((string)obj); 59 | } 60 | 61 | return default(T); 62 | } 63 | 64 | public static async Task SaveFileAsync(this StorageFolder folder, byte[] content, string fileName, CreationCollisionOption options = CreationCollisionOption.ReplaceExisting) 65 | { 66 | if (content == null) 67 | { 68 | throw new ArgumentNullException(nameof(content)); 69 | } 70 | 71 | if (string.IsNullOrEmpty(fileName)) 72 | { 73 | throw new ArgumentException("ExceptionSettingsStorageExtensionsFileNameIsNullOrEmpty".GetLocalized(), nameof(fileName)); 74 | } 75 | 76 | var storageFile = await folder.CreateFileAsync(fileName, options); 77 | await FileIO.WriteBytesAsync(storageFile, content); 78 | return storageFile; 79 | } 80 | 81 | public static async Task ReadFileAsync(this StorageFolder folder, string fileName) 82 | { 83 | var item = await folder.TryGetItemAsync(fileName).AsTask().ConfigureAwait(false); 84 | 85 | if ((item != null) && item.IsOfType(StorageItemTypes.File)) 86 | { 87 | var storageFile = await folder.GetFileAsync(fileName); 88 | byte[] content = await storageFile.ReadBytesAsync(); 89 | return content; 90 | } 91 | 92 | return null; 93 | } 94 | 95 | public static async Task ReadBytesAsync(this StorageFile file) 96 | { 97 | if (file != null) 98 | { 99 | using (IRandomAccessStream stream = await file.OpenReadAsync()) 100 | { 101 | using (var reader = new DataReader(stream.GetInputStreamAt(0))) 102 | { 103 | await reader.LoadAsync((uint)stream.Size); 104 | var bytes = new byte[stream.Size]; 105 | reader.ReadBytes(bytes); 106 | return bytes; 107 | } 108 | } 109 | } 110 | 111 | return null; 112 | } 113 | 114 | private static string GetFileName(string name) 115 | { 116 | return string.Concat(name, FileExtension); 117 | } 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Helpers/Singleton.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Concurrent; 3 | 4 | namespace NotepadRs4.Helpers 5 | { 6 | internal static class Singleton 7 | where T : new() 8 | { 9 | private static ConcurrentDictionary _instances = new ConcurrentDictionary(); 10 | 11 | public static T Instance 12 | { 13 | get 14 | { 15 | return _instances.GetOrAdd(typeof(T), (t) => new T()); 16 | } 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Models/DragDropCompletedData.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | using Windows.ApplicationModel.DataTransfer; 4 | 5 | namespace NotepadRs4.Models 6 | { 7 | public class DragDropCompletedData 8 | { 9 | public DataPackageOperation DropResult { get; set; } 10 | 11 | public IReadOnlyList Items { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Models/DragDropData.cs: -------------------------------------------------------------------------------- 1 | using Windows.ApplicationModel.DataTransfer; 2 | 3 | namespace NotepadRs4.Models 4 | { 5 | public class DragDropData 6 | { 7 | public DataPackageOperation AcceptedOperation { get; set; } 8 | 9 | public DataPackageView DataView { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Models/DragDropStartingData.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | using Windows.ApplicationModel.DataTransfer; 4 | 5 | namespace NotepadRs4.Models 6 | { 7 | public class DragDropStartingData 8 | { 9 | public DataPackage Data { get; set; } 10 | 11 | public IList Items { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Models/LoadDataModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Windows.Storage; 7 | 8 | namespace NotepadRs4.Models 9 | { 10 | public class LoadDataModel 11 | { 12 | public bool LoadSuccessful { get; set; } 13 | public TextDataModel TextModel { get; set; } 14 | public StorageFile File { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Models/TextDataModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace NotepadRs4.Models 8 | { 9 | public class TextDataModel 10 | { 11 | public string Text { get; set; } 12 | 13 | public string SelectedText { get; set; } 14 | 15 | public string DocumentTitle { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/NotepadRs4.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | C:\Users\pants\OneDrive\Documents\Ontwikkelen\Notepad\Logo\logo-black.png 5 | C:\Users\pants\OneDrive\Documents\Ontwikkelen\Notepad\Logo\logo-black.png 6 | C:\Users\pants\OneDrive\Documents\Ontwikkelen\Notepad\Logo\logo-black.png 7 | C:\Users\pants\OneDrive\Documents\Ontwikkelen\Notepad\Logo\logo-black.png 8 | C:\Users\pants\OneDrive\Documents\Ontwikkelen\Notepad\Logo\logo-black.png 9 | C:\Users\pants\OneDrive\Documents\Ontwikkelen\Notepad\Logo\logo-black.png 10 | C:\Users\pants\OneDrive\Documents\Ontwikkelen\Notepad\Logo\logo-black.png 11 | C:\Users\pants\OneDrive\Documents\Ontwikkelen\Notepad\Logo\logo-black.png 12 | True 13 | True 14 | arm64 15 | False 16 | StoreOnly 17 | 18 | 19 | 30F105C9-681E-420b-A277-7C086EAD8A4E 20 | false 21 | ZEN 22 | Windows 23 | true 24 | 25 | 26 | 30F105C9-681E-420b-A277-7C086EAD8A4E 27 | true 28 | 29 | 30 | AC47FD61-CB87-436C-9D4E-ACC30B549710 31 | false 32 | ZEN 33 | Windows 34 | true 35 | 36 | 37 | 30F105C9-681E-420b-A277-7C086EAD8A4E 38 | false 39 | ZEN 40 | Windows 41 | true 42 | 43 | 44 | 30F105C9-681E-420b-A277-7C086EAD8A4E 45 | false 46 | ZEN 47 | Windows 48 | true 49 | 50 | 51 | XBOXONE 52 | Universal 53 | false 54 | 55 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Package.appxmanifest: -------------------------------------------------------------------------------- 1 |  2 | 11 | 12 | 13 | 14 | Notepad 15 | Ikarago 16 | Assets\Logo\StoreLogo.png 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | Notepad 45 | 46 | .txt 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reflection; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | 6 | // General Information about an assembly is controlled through the following 7 | // set of attributes. Change these attribute values to modify the information 8 | // associated with an assembly. 9 | [assembly: AssemblyTitle("NotepadRs4")] 10 | [assembly: AssemblyDescription("")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("")] 13 | [assembly: AssemblyProduct("NotepadRs4")] 14 | [assembly: AssemblyCopyright("Copyright © 2018")] 15 | [assembly: AssemblyTrademark("")] 16 | [assembly: AssemblyCulture("")] 17 | 18 | // Version information for an assembly consists of the following four values: 19 | // 20 | // Major Version 21 | // Minor Version 22 | // Build Number 23 | // Revision 24 | // 25 | // You can specify all the values or you can default the Build and Revision Numbers 26 | // by using the '*' as shown below: 27 | // [assembly: AssemblyVersion("1.0.*")] 28 | [assembly: AssemblyVersion("1.0.0.0")] 29 | [assembly: AssemblyFileVersion("1.0.0.0")] 30 | [assembly: ComVisible(false)] 31 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Properties/Default.rd.xml: -------------------------------------------------------------------------------- 1 |  17 | 18 | 19 | 20 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Services/ActivationService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | using NotepadRs4.Activation; 7 | using NotepadRs4.Helpers; 8 | using NotepadRs4.ViewModels; 9 | using NotepadRs4.Views.Dialogs; 10 | using Windows.ApplicationModel.Activation; 11 | using Windows.ApplicationModel.Core; 12 | using Windows.UI; 13 | using Windows.UI.Core; 14 | using Windows.UI.Core.Preview; 15 | using Windows.UI.ViewManagement; 16 | using Windows.UI.Xaml; 17 | using Windows.UI.Xaml.Controls; 18 | using Windows.UI.Xaml.Media; 19 | using Windows.UI.Xaml.Navigation; 20 | 21 | namespace NotepadRs4.Services 22 | { 23 | // For more information on application activation see https://github.com/Microsoft/WindowsTemplateStudio/blob/master/docs/activation.md 24 | internal class ActivationService 25 | { 26 | private readonly App _app; 27 | private readonly Lazy _shell; 28 | private readonly Type _defaultNavItem; 29 | 30 | public ActivationService(App app, Type defaultNavItem, Lazy shell = null) 31 | { 32 | _app = app; 33 | _shell = shell; 34 | _defaultNavItem = defaultNavItem; 35 | } 36 | 37 | public async Task ActivateAsync(object activationArgs) 38 | { 39 | if (IsInteractive(activationArgs)) 40 | { 41 | // Initialize things like registering background task before the app is loaded 42 | await InitializeAsync(); 43 | 44 | // Do not repeat app initialization when the Window already has content, 45 | // just ensure that the window is active 46 | if (Window.Current.Content == null) 47 | { 48 | // Create a Frame to act as the navigation context and navigate to the first page 49 | Window.Current.Content = _shell?.Value ?? new Frame(); 50 | NavigationService.NavigationFailed += (sender, e) => 51 | { 52 | throw e.Exception; 53 | }; 54 | NavigationService.Navigated += Frame_Navigated; 55 | if (SystemNavigationManager.GetForCurrentView() != null) 56 | { 57 | SystemNavigationManager.GetForCurrentView().BackRequested += ActivationService_BackRequested; 58 | 59 | // Stuff for popping a confirmation dialog before closing 60 | SystemNavigationManagerPreview.GetForCurrentView().CloseRequested += App_CloseRequested; 61 | } 62 | } 63 | } 64 | 65 | var activationHandler = GetActivationHandlers() 66 | .FirstOrDefault(h => h.CanHandle(activationArgs)); 67 | 68 | if (activationHandler != null) 69 | { 70 | await activationHandler.HandleAsync(activationArgs); 71 | } 72 | 73 | if (IsInteractive(activationArgs)) 74 | { 75 | var defaultHandler = new DefaultLaunchActivationHandler(_defaultNavItem); 76 | if (defaultHandler.CanHandle(activationArgs)) 77 | { 78 | await defaultHandler.HandleAsync(activationArgs); 79 | } 80 | 81 | // Set custom stuff 82 | SetTitlebar(); 83 | SetMinimalWindowSize(); 84 | // Maximize UI on Xbox (Disabled, only here for testing) 85 | //Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().SetDesiredBoundsMode(Windows.UI.ViewManagement.ApplicationViewBoundsMode.UseCoreWindow); 86 | 87 | // Ensure the current window is active 88 | Window.Current.Activate(); 89 | 90 | // Tasks after activation 91 | await StartupAsync(); 92 | } 93 | } 94 | 95 | private async void App_CloseRequested(object sender, SystemNavigationCloseRequestedPreviewEventArgs e) 96 | { 97 | // CREDIT: Made possible by the really helpful blog post by Martin Zikmund, go check it out! https://blog.mzikmund.com/2018/09/app-close-confirmation-in-uwp/ 98 | 99 | // #TODO: Give the user the option to save from this dialog 100 | if (App.UnsavedChanges == true) 101 | { 102 | var deferral = e.GetDeferral(); 103 | var dialog = new ExitConfirmationDialog(); 104 | 105 | // #TODO Catch the rare case when another dialog is already open by cancelling that dialog and prioritizing this dialog over it instead 106 | await dialog.ShowAsync(); 107 | // Check the answer; if no then cancel closing the app 108 | if (dialog.Result == ExitConfirmationDialogResult.Cancel || dialog.Result == ExitConfirmationDialogResult.DialogClosed) 109 | { 110 | // Cancel the closure by setting the Handled-status to true 111 | e.Handled = true; 112 | } 113 | deferral.Complete(); 114 | } 115 | 116 | } 117 | 118 | private async Task InitializeAsync() 119 | { 120 | await ThemeSelectorService.InitializeAsync(); 121 | await Singleton.Instance.EnsureInstanceInitializedAsync(); 122 | await Task.CompletedTask; 123 | } 124 | 125 | private async Task StartupAsync() 126 | { 127 | ThemeSelectorService.SetRequestedTheme(); 128 | await WhatsNewDisplayService.ShowIfAppropriateAsync(); 129 | await Task.CompletedTask; 130 | } 131 | 132 | private IEnumerable GetActivationHandlers() 133 | { 134 | yield return Singleton.Instance; 135 | yield return Singleton.Instance; 136 | yield break; 137 | } 138 | 139 | private bool IsInteractive(object args) 140 | { 141 | return args is IActivatedEventArgs; 142 | } 143 | 144 | private void Frame_Navigated(object sender, NavigationEventArgs e) 145 | { 146 | //SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = NavigationService.CanGoBack ? 147 | // AppViewBackButtonVisibility.Visible : AppViewBackButtonVisibility.Collapsed; 148 | SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed; 149 | } 150 | 151 | private void ActivationService_BackRequested(object sender, BackRequestedEventArgs e) 152 | { 153 | if (NavigationService.CanGoBack) 154 | { 155 | NavigationService.GoBack(); 156 | e.Handled = true; 157 | } 158 | } 159 | 160 | private void SetTitlebar() 161 | { 162 | // Make the buttons transparent 163 | ApplicationViewTitleBar titlebar = ApplicationView.GetForCurrentView().TitleBar; 164 | titlebar.ButtonBackgroundColor = Colors.Transparent; 165 | titlebar.ButtonInactiveBackgroundColor = Colors.Transparent; 166 | 167 | if (App.Current.RequestedTheme == ApplicationTheme.Dark) 168 | { 169 | titlebar.ButtonForegroundColor = Colors.White; 170 | } 171 | else if (App.Current.RequestedTheme == ApplicationTheme.Light) 172 | { 173 | titlebar.ButtonForegroundColor = Colors.Black; 174 | } 175 | 176 | // Extend the normal window to the Titlebar for the blur to reach there too 177 | //CoreApplicationViewTitleBar coreTitlebar = CoreApplication.GetCurrentView().TitleBar; 178 | //coreTitlebar.ExtendViewIntoTitleBar = true; 179 | } 180 | 181 | private void SetMinimalWindowSize() 182 | { 183 | ApplicationView.GetForCurrentView().SetPreferredMinSize(new Windows.Foundation.Size(320, 300)); 184 | } 185 | } 186 | } 187 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Services/DragAndDrop/DragDropService.cs: -------------------------------------------------------------------------------- 1 | using NotepadRs4.Models; 2 | 3 | using Windows.ApplicationModel.DataTransfer; 4 | using Windows.UI.Xaml; 5 | using Windows.UI.Xaml.Controls; 6 | using Windows.UI.Xaml.Media.Imaging; 7 | 8 | namespace NotepadRs4.Services.DragAndDrop 9 | { 10 | // For instructions on testing this service see https://github.com/Microsoft/WindowsTemplateStudio/blob/master/docs/features/drag-and-drop.md 11 | public class DragDropService 12 | { 13 | private static DependencyProperty configurationProperty = DependencyProperty.RegisterAttached( 14 | "Configuration", 15 | typeof(DropConfiguration), 16 | typeof(DragDropService), 17 | new PropertyMetadata(null, OnConfigurationPropertyChanged)); 18 | 19 | private static DependencyProperty visualConfigurationProperty = DependencyProperty.RegisterAttached( 20 | "VisualConfiguration", 21 | typeof(VisualDropConfiguration), 22 | typeof(DragDropService), 23 | new PropertyMetadata(null, OnVisualConfigurationPropertyChanged)); 24 | 25 | public static void SetConfiguration(DependencyObject dependencyObject, DropConfiguration value) 26 | { 27 | if (dependencyObject != null) 28 | { 29 | dependencyObject.SetValue(configurationProperty, value); 30 | } 31 | } 32 | 33 | public static DropConfiguration GetConfiguration(DependencyObject dependencyObject) 34 | { 35 | return (DropConfiguration)dependencyObject.GetValue(configurationProperty); 36 | } 37 | 38 | public static void SetVisualConfiguration(DependencyObject dependencyObject, VisualDropConfiguration value) 39 | { 40 | if (dependencyObject != null) 41 | { 42 | dependencyObject.SetValue(visualConfigurationProperty, value); 43 | } 44 | } 45 | 46 | public static VisualDropConfiguration GetVisualConfiguration(DependencyObject dependencyObject) 47 | { 48 | return (VisualDropConfiguration)dependencyObject.GetValue(visualConfigurationProperty); 49 | } 50 | 51 | private static void OnConfigurationPropertyChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e) 52 | { 53 | var element = dependencyObject as UIElement; 54 | var configuration = GetConfiguration(element); 55 | ConfigureUIElement(element, configuration); 56 | 57 | var listview = element as ListViewBase; 58 | var listviewconfig = configuration as ListViewDropConfiguration; 59 | if (listview != null && listviewconfig != null) 60 | { 61 | ConfigureListView(listview, listviewconfig); 62 | } 63 | } 64 | 65 | private static void ConfigureUIElement(UIElement element, DropConfiguration configuration) 66 | { 67 | element.DragEnter += (sender, args) => 68 | { 69 | // Operation is copy by default 70 | args.AcceptedOperation = DataPackageOperation.Copy; 71 | 72 | var data = new DragDropData { AcceptedOperation = args.AcceptedOperation, DataView = args.DataView }; 73 | configuration.DragEnterCommand?.Execute(data); 74 | args.AcceptedOperation = data.AcceptedOperation; 75 | }; 76 | 77 | element.DragOver += (sender, args) => 78 | { 79 | var data = new DragDropData { AcceptedOperation = args.AcceptedOperation, DataView = args.DataView }; 80 | configuration.DragOverCommand?.Execute(data); 81 | args.AcceptedOperation = data.AcceptedOperation; 82 | }; 83 | 84 | element.DragLeave += (sender, args) => 85 | { 86 | var data = new DragDropData { AcceptedOperation = args.AcceptedOperation, DataView = args.DataView }; 87 | configuration.DragLeaveCommand?.Execute(data); 88 | }; 89 | 90 | element.Drop += async (sender, args) => 91 | { 92 | await configuration.ProcessComandsAsync(args.DataView); 93 | }; 94 | } 95 | 96 | private static void ConfigureListView(ListViewBase listview, ListViewDropConfiguration configuration) 97 | { 98 | listview.DragItemsStarting += (sender, args) => 99 | { 100 | var data = new DragDropStartingData { Data = args.Data, Items = args.Items }; 101 | configuration.DragItemsStartingCommand?.Execute(data); 102 | }; 103 | 104 | listview.DragItemsCompleted += (sender, args) => 105 | { 106 | var data = new DragDropCompletedData { DropResult = args.DropResult, Items = args.Items }; 107 | configuration.DragItemsCompletedCommand?.Execute(data); 108 | }; 109 | } 110 | 111 | private static void OnVisualConfigurationPropertyChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e) 112 | { 113 | var element = dependencyObject as UIElement; 114 | var configuration = GetVisualConfiguration(element); 115 | 116 | element.DragStarting += (sender, args) => 117 | { 118 | if (configuration.DropOverImage != null) 119 | { 120 | args.DragUI.SetContentFromBitmapImage(configuration.DragStartingImage as BitmapImage); 121 | } 122 | }; 123 | 124 | element.DragOver += (sender, args) => 125 | { 126 | args.DragUIOverride.Caption = configuration.Caption; 127 | args.DragUIOverride.IsCaptionVisible = configuration.IsCaptionVisible; 128 | args.DragUIOverride.IsContentVisible = configuration.IsContentVisible; 129 | args.DragUIOverride.IsGlyphVisible = configuration.IsGlyphVisible; 130 | 131 | if (configuration.DropOverImage != null) 132 | { 133 | args.DragUIOverride.SetContentFromBitmapImage(configuration.DropOverImage as BitmapImage); 134 | } 135 | }; 136 | } 137 | } 138 | } 139 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Services/DragAndDrop/DropConfiguration.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Threading.Tasks; 4 | using System.Windows.Input; 5 | 6 | using Windows.ApplicationModel.DataTransfer; 7 | using Windows.Storage; 8 | using Windows.Storage.Streams; 9 | using Windows.UI.Xaml; 10 | 11 | namespace NotepadRs4.Services.DragAndDrop 12 | { 13 | public class DropConfiguration : DependencyObject 14 | { 15 | public static readonly DependencyProperty DropBitmapCommandProperty = 16 | DependencyProperty.Register("DropBitmapCommand", typeof(ICommand), typeof(DropConfiguration), new PropertyMetadata(null)); 17 | 18 | public static readonly DependencyProperty DropHtmlCommandProperty = 19 | DependencyProperty.Register("DropHtmlCommand", typeof(ICommand), typeof(DropConfiguration), new PropertyMetadata(null)); 20 | 21 | public static readonly DependencyProperty DropRtfCommandProperty = 22 | DependencyProperty.Register("DropRtfCommand", typeof(ICommand), typeof(DropConfiguration), new PropertyMetadata(null)); 23 | 24 | public static readonly DependencyProperty DropStorageItemsCommandProperty = 25 | DependencyProperty.Register("DropStorageItemsCommand", typeof(ICommand), typeof(DropConfiguration), new PropertyMetadata(null)); 26 | 27 | public static readonly DependencyProperty DropTextCommandProperty = 28 | DependencyProperty.Register("DropTextCommand", typeof(ICommand), typeof(DropConfiguration), new PropertyMetadata(null)); 29 | 30 | public static readonly DependencyProperty DropApplicationLinkCommandProperty = 31 | DependencyProperty.Register("DropApplicationLinkCommand", typeof(ICommand), typeof(DropConfiguration), new PropertyMetadata(null)); 32 | 33 | public static readonly DependencyProperty DropWebLinkCommandProperty = 34 | DependencyProperty.Register("DropWebLinkCommand", typeof(ICommand), typeof(DropConfiguration), new PropertyMetadata(null)); 35 | 36 | public static readonly DependencyProperty DropDataViewCommandProperty = 37 | DependencyProperty.Register("DropDataViewCommand", typeof(ICommand), typeof(DropConfiguration), new PropertyMetadata(null)); 38 | 39 | public static readonly DependencyProperty DragEnterCommandProperty = 40 | DependencyProperty.Register("DragEnterCommand", typeof(ICommand), typeof(DropConfiguration), new PropertyMetadata(null)); 41 | 42 | public static readonly DependencyProperty DragOverCommandProperty = 43 | DependencyProperty.Register("DragOverCommand", typeof(ICommand), typeof(DropConfiguration), new PropertyMetadata(null)); 44 | 45 | public static readonly DependencyProperty DragLeaveCommandProperty = 46 | DependencyProperty.Register("DragLeaveCommand", typeof(ICommand), typeof(DropConfiguration), new PropertyMetadata(null)); 47 | 48 | public ICommand DropBitmapCommand 49 | { 50 | get { return (ICommand)GetValue(DropBitmapCommandProperty); } 51 | set { SetValue(DropBitmapCommandProperty, value); } 52 | } 53 | 54 | public ICommand DropHtmlCommand 55 | { 56 | get { return (ICommand)GetValue(DropHtmlCommandProperty); } 57 | set { SetValue(DropHtmlCommandProperty, value); } 58 | } 59 | 60 | public ICommand DropRtfCommand 61 | { 62 | get { return (ICommand)GetValue(DropRtfCommandProperty); } 63 | set { SetValue(DropRtfCommandProperty, value); } 64 | } 65 | 66 | public ICommand DropStorageItemsCommand 67 | { 68 | get { return (ICommand)GetValue(DropStorageItemsCommandProperty); } 69 | set { SetValue(DropStorageItemsCommandProperty, value); } 70 | } 71 | 72 | public ICommand DropTextCommand 73 | { 74 | get { return (ICommand)GetValue(DropTextCommandProperty); } 75 | set { SetValue(DropTextCommandProperty, value); } 76 | } 77 | 78 | public ICommand DropApplicationLinkCommand 79 | { 80 | get { return (ICommand)GetValue(DropApplicationLinkCommandProperty); } 81 | set { SetValue(DropApplicationLinkCommandProperty, value); } 82 | } 83 | 84 | public ICommand DropWebLinkCommand 85 | { 86 | get { return (ICommand)GetValue(DropWebLinkCommandProperty); } 87 | set { SetValue(DropWebLinkCommandProperty, value); } 88 | } 89 | 90 | public ICommand DropDataViewCommand 91 | { 92 | get { return (ICommand)GetValue(DropDataViewCommandProperty); } 93 | set { SetValue(DropDataViewCommandProperty, value); } 94 | } 95 | 96 | public ICommand DragEnterCommand 97 | { 98 | get { return (ICommand)GetValue(DragEnterCommandProperty); } 99 | set { SetValue(DragEnterCommandProperty, value); } 100 | } 101 | 102 | public ICommand DragOverCommand 103 | { 104 | get { return (ICommand)GetValue(DragOverCommandProperty); } 105 | set { SetValue(DragOverCommandProperty, value); } 106 | } 107 | 108 | public ICommand DragLeaveCommand 109 | { 110 | get { return (ICommand)GetValue(DragLeaveCommandProperty); } 111 | set { SetValue(DragLeaveCommandProperty, value); } 112 | } 113 | 114 | public async Task ProcessComandsAsync(DataPackageView dataview) 115 | { 116 | if (DropDataViewCommand != null) 117 | { 118 | DropDataViewCommand.Execute(dataview); 119 | } 120 | 121 | if (dataview.Contains(StandardDataFormats.ApplicationLink) && DropApplicationLinkCommand != null) 122 | { 123 | Uri uri = await dataview.GetApplicationLinkAsync(); 124 | DropApplicationLinkCommand.Execute(uri); 125 | } 126 | 127 | if (dataview.Contains(StandardDataFormats.Bitmap) && DropBitmapCommand != null) 128 | { 129 | RandomAccessStreamReference stream = await dataview.GetBitmapAsync(); 130 | DropBitmapCommand.Execute(stream); 131 | } 132 | 133 | if (dataview.Contains(StandardDataFormats.Html) && DropHtmlCommand != null) 134 | { 135 | string html = await dataview.GetHtmlFormatAsync(); 136 | DropHtmlCommand.Execute(html); 137 | } 138 | 139 | if (dataview.Contains(StandardDataFormats.Rtf) && DropRtfCommand != null) 140 | { 141 | string rtf = await dataview.GetRtfAsync(); 142 | DropRtfCommand.Execute(rtf); 143 | } 144 | 145 | if (dataview.Contains(StandardDataFormats.StorageItems) && DropStorageItemsCommand != null) 146 | { 147 | IReadOnlyList storageItems = await dataview.GetStorageItemsAsync(); 148 | DropStorageItemsCommand.Execute(storageItems); 149 | } 150 | 151 | if (dataview.Contains(StandardDataFormats.Text) && DropTextCommand != null) 152 | { 153 | string text = await dataview.GetTextAsync(); 154 | DropTextCommand.Execute(text); 155 | } 156 | 157 | if (dataview.Contains(StandardDataFormats.WebLink) && DropWebLinkCommand != null) 158 | { 159 | Uri uri = await dataview.GetWebLinkAsync(); 160 | DropWebLinkCommand.Execute(uri); 161 | } 162 | } 163 | } 164 | } 165 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Services/DragAndDrop/ListViewDropConfiguration.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Input; 2 | 3 | using Windows.UI.Xaml; 4 | 5 | namespace NotepadRs4.Services.DragAndDrop 6 | { 7 | public class ListViewDropConfiguration : DropConfiguration 8 | { 9 | public static readonly DependencyProperty DragItemsStartingCommandProperty = 10 | DependencyProperty.Register("DragItemsStartingCommand", typeof(ICommand), typeof(DropConfiguration), new PropertyMetadata(null)); 11 | 12 | public static readonly DependencyProperty DragItemsCompletedCommandProperty = 13 | DependencyProperty.Register("DragItemsCompletedCommand", typeof(ICommand), typeof(DropConfiguration), new PropertyMetadata(null)); 14 | 15 | public ICommand DragItemsStartingCommand 16 | { 17 | get { return (ICommand)GetValue(DragItemsStartingCommandProperty); } 18 | set { SetValue(DragItemsStartingCommandProperty, value); } 19 | } 20 | 21 | public ICommand DragItemsCompletedCommand 22 | { 23 | get { return (ICommand)GetValue(DragItemsCompletedCommandProperty); } 24 | set { SetValue(DragItemsCompletedCommandProperty, value); } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Services/DragAndDrop/VisualDropConfiguration.cs: -------------------------------------------------------------------------------- 1 | using Windows.UI.Xaml; 2 | using Windows.UI.Xaml.Media; 3 | 4 | namespace NotepadRs4.Services.DragAndDrop 5 | { 6 | public class VisualDropConfiguration : DependencyObject 7 | { 8 | public static readonly DependencyProperty CaptionProperty = 9 | DependencyProperty.Register("Caption", typeof(string), typeof(VisualDropConfiguration), new PropertyMetadata(string.Empty)); 10 | 11 | public static readonly DependencyProperty IsCaptionVisibleProperty = 12 | DependencyProperty.Register("IsCaptionVisible", typeof(bool), typeof(VisualDropConfiguration), new PropertyMetadata(true)); 13 | 14 | public static readonly DependencyProperty IsContentVisibleProperty = 15 | DependencyProperty.Register("IsContentVisible", typeof(bool), typeof(VisualDropConfiguration), new PropertyMetadata(true)); 16 | 17 | public static readonly DependencyProperty IsGlyphVisibleProperty = 18 | DependencyProperty.Register("IsGlyphVisible", typeof(bool), typeof(VisualDropConfiguration), new PropertyMetadata(true)); 19 | 20 | public static readonly DependencyProperty DragStartingImageProperty = 21 | DependencyProperty.Register("DragStartingImage", typeof(ImageSource), typeof(VisualDropConfiguration), new PropertyMetadata(null)); 22 | 23 | public static readonly DependencyProperty DropOverImageProperty = 24 | DependencyProperty.Register("DropOverImage", typeof(ImageSource), typeof(VisualDropConfiguration), new PropertyMetadata(null)); 25 | 26 | public string Caption 27 | { 28 | get { return (string)GetValue(CaptionProperty); } 29 | set { SetValue(CaptionProperty, value); } 30 | } 31 | 32 | public bool IsCaptionVisible 33 | { 34 | get { return (bool)GetValue(IsCaptionVisibleProperty); } 35 | set { SetValue(IsCaptionVisibleProperty, value); } 36 | } 37 | 38 | public bool IsContentVisible 39 | { 40 | get { return (bool)GetValue(IsContentVisibleProperty); } 41 | set { SetValue(IsContentVisibleProperty, value); } 42 | } 43 | 44 | public bool IsGlyphVisible 45 | { 46 | get { return (bool)GetValue(IsGlyphVisibleProperty); } 47 | set { SetValue(IsGlyphVisibleProperty, value); } 48 | } 49 | 50 | public ImageSource DragStartingImage 51 | { 52 | get { return (ImageSource)GetValue(DragStartingImageProperty); } 53 | set { SetValue(DragStartingImageProperty, value); } 54 | } 55 | 56 | public ImageSource DropOverImage 57 | { 58 | get { return (ImageSource)GetValue(DropOverImageProperty); } 59 | set { SetValue(DropOverImageProperty, value); } 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Services/FileAssociationService.cs: -------------------------------------------------------------------------------- 1 | using NotepadRs4.Activation; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using Windows.ApplicationModel.Activation; 8 | 9 | namespace NotepadRs4.Services 10 | { 11 | internal class FileAssociationService : ActivationHandler 12 | { 13 | protected override async Task HandleInternalAsync(FileActivatedEventArgs args) 14 | { 15 | var file = args.Files.FirstOrDefault(); 16 | // #TODO: Open the loaded file in a new window (if there is another file open) 17 | NavigationService.Navigate(typeof(Views.MainPage), file); 18 | await Task.CompletedTask; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Services/FileDataService.cs: -------------------------------------------------------------------------------- 1 | using NotepadRs4.Models; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Diagnostics; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | using Windows.Storage; 9 | using Windows.Storage.Pickers; 10 | using Windows.Storage.Provider; 11 | using Windows.Storage.Streams; 12 | 13 | namespace NotepadRs4.Services 14 | { 15 | public static class FileDataService 16 | { 17 | // Save 18 | public static async Task Save(TextDataModel data, StorageFile file) 19 | { 20 | // #TODO Build this method 21 | if (file != null) 22 | { 23 | try 24 | { 25 | // Prevent remote access to file until saving is done 26 | CachedFileManager.DeferUpdates(file); 27 | // Write the stuff to the file 28 | await FileIO.WriteTextAsync(file, data.Text); 29 | 30 | // Let Windows know stuff is done 31 | FileUpdateStatus status = await CachedFileManager.CompleteUpdatesAsync(file); 32 | return true; 33 | } 34 | catch { return false; } 35 | 36 | } 37 | return false; 38 | } 39 | 40 | // Save As 41 | public static async Task SaveAs(TextDataModel data) 42 | { 43 | FileSavePicker picker = new FileSavePicker(); 44 | picker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary; 45 | picker.FileTypeChoices.Add("Text Documents", new List() { ".txt" }); 46 | picker.FileTypeChoices.Add("All files", new List() { "." }); 47 | picker.DefaultFileExtension = ".txt"; 48 | if (data.DocumentTitle != "") 49 | { 50 | picker.SuggestedFileName = data.DocumentTitle; 51 | // TODO: Get original file here as well 52 | } 53 | else 54 | { 55 | picker.SuggestedFileName = "Untitled"; 56 | } 57 | 58 | 59 | StorageFile file = await picker.PickSaveFileAsync(); 60 | 61 | if (file != null) 62 | { 63 | // Prevent remote access to file until saving is done 64 | CachedFileManager.DeferUpdates(file); 65 | 66 | // Write the stuff to the file 67 | await FileIO.WriteTextAsync(file, data.Text); 68 | 69 | // Get Fast Access token 70 | GetFaToken(file); 71 | // #TODO: Store this token somewhere 72 | 73 | // Let Windows know stuff is done 74 | FileUpdateStatus status = await CachedFileManager.CompleteUpdatesAsync(file); 75 | 76 | // DEBUG: Let programmer know what has happened 77 | if (status == FileUpdateStatus.Complete) 78 | { 79 | Debug.WriteLine("File " + file.Name + " has been saved"); 80 | } 81 | else 82 | { 83 | Debug.WriteLine("File " + file.Name + " has NOT been saved"); 84 | } 85 | 86 | } 87 | 88 | 89 | return file; 90 | 91 | } 92 | 93 | // Load 94 | public static async Task Load() 95 | { 96 | LoadDataModel model = null; 97 | TextDataModel data = null; 98 | 99 | model = new LoadDataModel(); 100 | model.LoadSuccessful = false; 101 | 102 | FileOpenPicker picker = new FileOpenPicker(); 103 | picker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary; 104 | picker.ViewMode = PickerViewMode.List; 105 | picker.FileTypeFilter.Add("*"); 106 | 107 | StorageFile file = await picker.PickSingleFileAsync(); 108 | 109 | if (file != null) 110 | { 111 | try 112 | { 113 | data = new TextDataModel(); 114 | 115 | // Get the buffer of the file so we can also read it when encoded in different encoding from UTF8 116 | // Fix with the help of Fred Bao's answer on https://social.msdn.microsoft.com/Forums/sqlserver/en-US/0f3cd056-a2e3-411b-8e8a-d2109255359a/uwpc-reading-ansi-text-file 117 | IBuffer buffer = await FileIO.ReadBufferAsync(file); 118 | DataReader dataReader = DataReader.FromBuffer(buffer); 119 | byte[] fileContent = new byte[dataReader.UnconsumedBufferLength]; 120 | dataReader.ReadBytes(fileContent); 121 | string readText = Encoding.UTF8.GetString(fileContent, 0, fileContent.Length); 122 | // #TODO: Get the current encoding and display it in the TextDataModel 123 | 124 | 125 | // Textdata 126 | data.Text = readText; 127 | data.DocumentTitle = file.DisplayName + file.FileType; 128 | 129 | // Get Fast Access token 130 | GetFaToken(file); 131 | // #TODO: Store this token somewhere 132 | 133 | 134 | model.TextModel = data; 135 | model.File = file; 136 | model.LoadSuccessful = true; 137 | 138 | Debug.WriteLine("File " + file.Name + " has been loaded"); 139 | } 140 | catch (Exception ex) 141 | { 142 | Debug.WriteLine("Loading failed"); 143 | Debug.WriteLine(ex); 144 | throw; 145 | } 146 | } 147 | 148 | return model; 149 | } 150 | 151 | // Load without prompt (for when loading from Explorer) 152 | public static async Task LoadWithoutPrompt(StorageFile file) 153 | { 154 | LoadDataModel model = null; 155 | TextDataModel data = null; 156 | 157 | model = new LoadDataModel(); 158 | model.LoadSuccessful = false; 159 | 160 | if (file != null) 161 | { 162 | try 163 | { 164 | data = new TextDataModel(); 165 | 166 | // Get the buffer of the file so we can also read it when encoded in different encoding from UTF8 167 | // Fix with the help of Fred Bao's answer on https://social.msdn.microsoft.com/Forums/sqlserver/en-US/0f3cd056-a2e3-411b-8e8a-d2109255359a/uwpc-reading-ansi-text-file 168 | IBuffer buffer = await FileIO.ReadBufferAsync(file); 169 | DataReader dataReader = DataReader.FromBuffer(buffer); 170 | byte[] fileContent = new byte[dataReader.UnconsumedBufferLength]; 171 | dataReader.ReadBytes(fileContent); 172 | string readText = Encoding.UTF8.GetString(fileContent, 0, fileContent.Length); 173 | // #TODO: Get the current encoding and display it in the TextDataModel 174 | 175 | 176 | // Textdata 177 | data.Text = readText; 178 | data.DocumentTitle = file.DisplayName + file.FileType; 179 | 180 | // Get Fast Access token 181 | GetFaToken(file); 182 | // #TODO: Store this token somewhere 183 | 184 | 185 | model.File = file; 186 | model.TextModel = data; 187 | model.LoadSuccessful = true; 188 | 189 | Debug.WriteLine("File " + file.Name + " has been loaded"); 190 | } 191 | catch 192 | { 193 | Debug.WriteLine("Loading failed"); 194 | } 195 | } 196 | 197 | return model; 198 | } 199 | 200 | private static string GetFaToken(StorageFile file) 201 | { 202 | // Check if the maximum amount of Fast Access List items has been met 203 | if (Windows.Storage.AccessCache.StorageApplicationPermissions.FutureAccessList.Entries.Count >= Windows.Storage.AccessCache.StorageApplicationPermissions.FutureAccessList.MaximumItemsAllowed) 204 | { 205 | // If so, clear the whole list (should only happen rarely) 206 | Windows.Storage.AccessCache.StorageApplicationPermissions.FutureAccessList.Clear(); 207 | } 208 | 209 | // Get the Fast Access List Token 210 | string faToken = Windows.Storage.AccessCache.StorageApplicationPermissions.FutureAccessList.Add(file); 211 | 212 | return faToken; 213 | } 214 | } 215 | } 216 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Services/NavigationService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | using Windows.UI.Xaml; 4 | using Windows.UI.Xaml.Controls; 5 | using Windows.UI.Xaml.Media.Animation; 6 | using Windows.UI.Xaml.Navigation; 7 | 8 | namespace NotepadRs4.Services 9 | { 10 | public static class NavigationService 11 | { 12 | public static event NavigatedEventHandler Navigated; 13 | 14 | public static event NavigationFailedEventHandler NavigationFailed; 15 | 16 | private static Frame _frame; 17 | private static object _lastParamUsed; 18 | 19 | public static Frame Frame 20 | { 21 | get 22 | { 23 | if (_frame == null) 24 | { 25 | _frame = Window.Current.Content as Frame; 26 | RegisterFrameEvents(); 27 | } 28 | 29 | return _frame; 30 | } 31 | 32 | set 33 | { 34 | UnregisterFrameEvents(); 35 | _frame = value; 36 | RegisterFrameEvents(); 37 | } 38 | } 39 | 40 | public static bool CanGoBack => Frame.CanGoBack; 41 | 42 | public static bool CanGoForward => Frame.CanGoForward; 43 | 44 | public static void GoBack() => Frame.GoBack(); 45 | 46 | public static void GoForward() => Frame.GoForward(); 47 | 48 | public static bool Navigate(Type pageType, object parameter = null, NavigationTransitionInfo infoOverride = null) 49 | { 50 | // Don't open the same page multiple times 51 | if (Frame.Content?.GetType() != pageType || (parameter != null && !parameter.Equals(_lastParamUsed))) 52 | { 53 | var navigationResult = Frame.Navigate(pageType, parameter, infoOverride); 54 | if (navigationResult) 55 | { 56 | _lastParamUsed = parameter; 57 | } 58 | 59 | return navigationResult; 60 | } 61 | else 62 | { 63 | return false; 64 | } 65 | } 66 | 67 | public static bool Navigate(object parameter = null, NavigationTransitionInfo infoOverride = null) 68 | where T : Page 69 | => Navigate(typeof(T), parameter, infoOverride); 70 | 71 | private static void RegisterFrameEvents() 72 | { 73 | if (_frame != null) 74 | { 75 | _frame.Navigated += Frame_Navigated; 76 | _frame.NavigationFailed += Frame_NavigationFailed; 77 | } 78 | } 79 | 80 | private static void UnregisterFrameEvents() 81 | { 82 | if (_frame != null) 83 | { 84 | _frame.Navigated -= Frame_Navigated; 85 | _frame.NavigationFailed -= Frame_NavigationFailed; 86 | } 87 | } 88 | 89 | private static void Frame_NavigationFailed(object sender, NavigationFailedEventArgs e) => NavigationFailed?.Invoke(sender, e); 90 | 91 | private static void Frame_Navigated(object sender, NavigationEventArgs e) => Navigated?.Invoke(sender, e); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Services/NotificationService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | using Windows.UI.Notifications; 8 | 9 | using Microsoft.Toolkit.Uwp.Notifications; 10 | 11 | namespace NotepadRs4.Services 12 | { 13 | // #LEGACY CODE: It's still here so you might learn something from it, but it's not used in the app anymore 14 | // Reason to remove this code is that it has been superseded by the in-app Notifications which keep the experience inside the app and doesn't destract from it with outside influences. 15 | 16 | /*public static class NotificationService 17 | { 18 | // Show Notifications (TEMP) 19 | // Save Successful 20 | public static void ShowNotificationSaveSuccessful() 21 | { 22 | // #TODO: Get strings from Resource 23 | string title = "Save successful!"; 24 | string content = ("File saved to your device"); 25 | 26 | if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar")) 27 | { 28 | // Phone stuff 29 | ShowStatusBarNotification(title); 30 | } 31 | else 32 | { 33 | // Toast Stuff 34 | var toast = CreateToastNotification(title, content); 35 | 36 | // Disable Notification Mirroring so it won't show up on other devices 37 | // (which would be kinda weird, as the notification is only intended for this device) 38 | toast.NotificationMirroring = NotificationMirroring.Disabled; 39 | 40 | // Show the Notification 41 | ToastNotificationManager.CreateToastNotifier().Show(toast); 42 | } 43 | 44 | } 45 | 46 | // Save failed 47 | public static void ShowNotificationSaveFailed() 48 | { 49 | // #TODO: Get strings from Resource 50 | string title = "Save failed"; 51 | string content = ("Please try again"); 52 | 53 | if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar")) 54 | { 55 | // Phone stuff 56 | ShowStatusBarNotification(title); 57 | } 58 | else 59 | { 60 | // Toast Stuff 61 | var toast = CreateToastNotification(title, content); 62 | 63 | // Disable Notification Mirroring so it won't show up on other devices 64 | // (which would be kinda weird, as the notification is only intended for this device) 65 | toast.NotificationMirroring = NotificationMirroring.Disabled; 66 | 67 | // Show the Notification 68 | ToastNotificationManager.CreateToastNotifier().Show(toast); 69 | } 70 | } 71 | 72 | 73 | // Methods 74 | /// 75 | /// Create a basic Toast Notification 76 | /// 77 | /// Title of the toast 78 | /// Subtitle of the toast 79 | /// Returns ToastNotification-variable to be used by the ToastNotificationManager 80 | private static ToastNotification CreateToastNotification(string title, string content = "") 81 | { 82 | 83 | // First; create the toast itself 84 | var toastContent = new ToastContent() 85 | { 86 | Visual = new ToastVisual() 87 | { 88 | BindingGeneric = new ToastBindingGeneric() 89 | { 90 | Children = 91 | { 92 | new AdaptiveText() 93 | { 94 | Text = title 95 | }, 96 | 97 | new AdaptiveText() 98 | { 99 | Text = content 100 | } 101 | } 102 | } 103 | } 104 | }; 105 | // Now convert it to XML 106 | ToastNotification toast = new ToastNotification(toastContent.GetXml()); 107 | 108 | return toast; 109 | } 110 | 111 | /// 112 | /// Show Notification in the StatusBar of a phone 113 | /// 114 | /// Message that needs to be displayed 115 | private static async void ShowStatusBarNotification(string title) 116 | { 117 | if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar")) 118 | { 119 | var statusbar = Windows.UI.ViewManagement.StatusBar.GetForCurrentView(); 120 | statusbar.ProgressIndicator.Text = title; 121 | 122 | // Show the Statusbar message 123 | await statusbar.ProgressIndicator.ShowAsync(); 124 | 125 | // Hide the message after 3 seconds 126 | await Task.Delay(TimeSpan.FromSeconds(3)); 127 | await statusbar.ProgressIndicator.HideAsync(); 128 | } 129 | } 130 | }*/ 131 | } 132 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Services/OnBackgroundEnteringEventArgs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace NotepadRs4.Services 4 | { 5 | public class OnBackgroundEnteringEventArgs : EventArgs 6 | { 7 | public SuspensionState SuspensionState { get; set; } 8 | 9 | public Type Target { get; private set; } 10 | 11 | public OnBackgroundEnteringEventArgs(SuspensionState suspensionState, Type target) 12 | { 13 | SuspensionState = suspensionState; 14 | Target = target; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Services/SuspendAndResumeService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reflection; 3 | using System.Threading.Tasks; 4 | 5 | using NotepadRs4.Activation; 6 | using NotepadRs4.Helpers; 7 | 8 | using Windows.ApplicationModel.Activation; 9 | using Windows.Storage; 10 | using Windows.UI.Xaml.Controls; 11 | 12 | namespace NotepadRs4.Services 13 | { 14 | // More details regarding the application lifecycle and how to handle suspend and resume at https://docs.microsoft.com/windows/uwp/launch-resume/app-lifecycle 15 | internal class SuspendAndResumeService : ActivationHandler 16 | { 17 | private const string StateFilename = "SuspendAndResumeState"; 18 | 19 | // TODO WTS: Subscribe to this event if you want to save the current state. It is fired just before the app enters the background. 20 | public event EventHandler OnBackgroundEntering; 21 | 22 | public async Task SaveStateAsync() 23 | { 24 | // #TODO Update to make sure states get saved properly with multiple instances 25 | var suspensionState = new SuspensionState() 26 | { 27 | SuspensionDate = DateTime.Now 28 | }; 29 | 30 | var target = OnBackgroundEntering?.Target.GetType(); 31 | var onBackgroundEnteringArgs = new OnBackgroundEnteringEventArgs(suspensionState, target); 32 | 33 | OnBackgroundEntering?.Invoke(this, onBackgroundEnteringArgs); 34 | 35 | await ApplicationData.Current.LocalFolder.SaveAsync(StateFilename, onBackgroundEnteringArgs); 36 | } 37 | 38 | protected override async Task HandleInternalAsync(LaunchActivatedEventArgs args) 39 | { 40 | await RestoreStateAsync(); 41 | } 42 | 43 | protected override bool CanHandleInternal(LaunchActivatedEventArgs args) 44 | { 45 | return args.PreviousExecutionState == ApplicationExecutionState.Terminated; 46 | } 47 | 48 | private async Task RestoreStateAsync() 49 | { 50 | var saveState = await ApplicationData.Current.LocalFolder.ReadAsync(StateFilename); 51 | if (saveState?.Target != null && typeof(Page).IsAssignableFrom(saveState.Target)) 52 | { 53 | NavigationService.Navigate(saveState.Target, saveState.SuspensionState); 54 | } 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Services/SuspensionState.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace NotepadRs4.Services 4 | { 5 | public class SuspensionState 6 | { 7 | public object Data { get; set; } 8 | 9 | public DateTime SuspensionDate { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Services/ThemeSelectorService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | 4 | using NotepadRs4.Helpers; 5 | 6 | using Windows.Storage; 7 | using Windows.UI; 8 | using Windows.UI.ViewManagement; 9 | using Windows.UI.Xaml; 10 | 11 | namespace NotepadRs4.Services 12 | { 13 | public static class ThemeSelectorService 14 | { 15 | private const string SettingsKey = "AppBackgroundRequestedTheme"; 16 | 17 | public static ElementTheme Theme { get; set; } = ElementTheme.Default; 18 | 19 | public static async Task InitializeAsync() 20 | { 21 | Theme = await LoadThemeFromSettingsAsync(); 22 | } 23 | 24 | public static async Task SetThemeAsync(ElementTheme theme) 25 | { 26 | Theme = theme; 27 | 28 | SetRequestedTheme(); 29 | await SaveThemeInSettingsAsync(Theme); 30 | } 31 | 32 | public static void SetRequestedTheme() 33 | { 34 | if (Window.Current.Content is FrameworkElement frameworkElement) 35 | { 36 | frameworkElement.RequestedTheme = Theme; 37 | SetTitlebarButtonColour(); 38 | } 39 | } 40 | 41 | private static void SetTitlebarButtonColour() 42 | { 43 | // Make the buttons transparent 44 | ApplicationViewTitleBar titlebar = ApplicationView.GetForCurrentView().TitleBar; 45 | titlebar.ButtonBackgroundColor = Colors.Transparent; 46 | titlebar.ButtonInactiveBackgroundColor = Colors.Transparent; 47 | 48 | // Set the foreground colour depending on the current theme 49 | // #TODO: Simplify this 50 | if (Theme == ElementTheme.Dark) 51 | { 52 | titlebar.ButtonForegroundColor = Colors.White; 53 | } 54 | else if (Theme == ElementTheme.Light) 55 | { 56 | titlebar.ButtonForegroundColor = Colors.Black; 57 | } 58 | else if (Theme == ElementTheme.Default) 59 | { 60 | if (App.Current.RequestedTheme == ApplicationTheme.Dark) 61 | { 62 | titlebar.ButtonForegroundColor = Colors.White; 63 | } 64 | else if (App.Current.RequestedTheme == ApplicationTheme.Light) 65 | { 66 | titlebar.ButtonForegroundColor = Colors.Black; 67 | } 68 | } 69 | } 70 | 71 | private static async Task LoadThemeFromSettingsAsync() 72 | { 73 | ElementTheme cacheTheme = ElementTheme.Default; 74 | string themeName = await ApplicationData.Current.LocalSettings.ReadAsync(SettingsKey); 75 | 76 | if (!string.IsNullOrEmpty(themeName)) 77 | { 78 | Enum.TryParse(themeName, out cacheTheme); 79 | } 80 | 81 | return cacheTheme; 82 | } 83 | 84 | private static async Task SaveThemeInSettingsAsync(ElementTheme theme) 85 | { 86 | await ApplicationData.Current.LocalSettings.SaveAsync(SettingsKey, theme.ToString()); 87 | } 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Services/ViewLifetimeControl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | using NotepadRs4.Helpers; 4 | 5 | using Windows.UI.Core; 6 | using Windows.UI.ViewManagement; 7 | 8 | namespace NotepadRs4.Services 9 | { 10 | // A custom event that fires whenever the secondary view is ready to be closed. You should 11 | // clean up any state (including deregistering for events) then close the window in this handler 12 | public delegate void ViewReleasedHandler(object sender, EventArgs e); 13 | 14 | // Whenever the main view is about to interact with the secondary view, it should call 15 | // StartViewInUse on this object. When finished interacting, it should call StopViewInUse. 16 | public sealed class ViewLifetimeControl 17 | { 18 | // Window for this particular view. Used to register and unregister for events 19 | private CoreWindow _window; 20 | private int _refCount = 0; 21 | private bool _released = false; 22 | 23 | private event ViewReleasedHandler InternalReleased; 24 | 25 | // Necessary to communicate with the window 26 | public CoreDispatcher Dispatcher { get; private set; } 27 | 28 | // This id is used in all of the ApplicationViewSwitcher and ProjectionManager APIs 29 | public int Id { get; private set; } 30 | 31 | public string Title { get; set; } 32 | 33 | public event ViewReleasedHandler Released 34 | { 35 | add 36 | { 37 | bool releasedCopy = false; 38 | lock (this) 39 | { 40 | releasedCopy = _released; 41 | if (!_released) 42 | { 43 | InternalReleased += value; 44 | } 45 | } 46 | 47 | if (releasedCopy) 48 | { 49 | throw new InvalidOperationException("ExceptionViewLifeTimeControlViewDisposal".GetLocalized()); 50 | } 51 | } 52 | 53 | remove 54 | { 55 | lock (this) 56 | { 57 | InternalReleased -= value; 58 | } 59 | } 60 | } 61 | 62 | private ViewLifetimeControl(CoreWindow newWindow) 63 | { 64 | Dispatcher = newWindow.Dispatcher; 65 | _window = newWindow; 66 | Id = ApplicationView.GetApplicationViewIdForWindow(_window); 67 | RegisterForEvents(); 68 | } 69 | 70 | public static ViewLifetimeControl CreateForCurrentView() 71 | { 72 | return new ViewLifetimeControl(CoreWindow.GetForCurrentThread()); 73 | } 74 | 75 | // Signals that the view is being interacted with by another view, 76 | // so it shouldn't be closed even if it becomes "consolidated" 77 | public int StartViewInUse() 78 | { 79 | bool releasedCopy = false; 80 | int refCountCopy = 0; 81 | 82 | lock (this) 83 | { 84 | releasedCopy = _released; 85 | if (!_released) 86 | { 87 | refCountCopy = ++_refCount; 88 | } 89 | } 90 | 91 | if (releasedCopy) 92 | { 93 | throw new InvalidOperationException("ExceptionViewLifeTimeControlViewDisposal".GetLocalized()); 94 | } 95 | 96 | return refCountCopy; 97 | } 98 | 99 | // Should come after any call to StartViewInUse 100 | // Signals that the another view has finished interacting with the view tracked by this object 101 | public int StopViewInUse() 102 | { 103 | int refCountCopy = 0; 104 | bool releasedCopy = false; 105 | 106 | lock (this) 107 | { 108 | releasedCopy = _released; 109 | if (!_released) 110 | { 111 | refCountCopy = --_refCount; 112 | if (refCountCopy == 0) 113 | { 114 | var task = Dispatcher.RunAsync(CoreDispatcherPriority.Low, FinalizeRelease); 115 | } 116 | } 117 | } 118 | 119 | if (releasedCopy) 120 | { 121 | throw new InvalidOperationException("ExceptionViewLifeTimeControlViewDisposal".GetLocalized()); 122 | } 123 | 124 | return refCountCopy; 125 | } 126 | 127 | private void RegisterForEvents() 128 | { 129 | ApplicationView.GetForCurrentView().Consolidated += ViewConsolidated; 130 | } 131 | 132 | private void UnregisterForEvents() 133 | { 134 | ApplicationView.GetForCurrentView().Consolidated -= ViewConsolidated; 135 | } 136 | 137 | private void ViewConsolidated(ApplicationView sender, ApplicationViewConsolidatedEventArgs e) 138 | { 139 | StopViewInUse(); 140 | } 141 | 142 | private void FinalizeRelease() 143 | { 144 | bool justReleased = false; 145 | lock (this) 146 | { 147 | if (_refCount == 0) 148 | { 149 | justReleased = true; 150 | _released = true; 151 | } 152 | } 153 | 154 | if (justReleased) 155 | { 156 | UnregisterForEvents(); 157 | InternalReleased(this, null); 158 | } 159 | } 160 | } 161 | } 162 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Services/WhatsNewDisplayService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | 4 | using Microsoft.Toolkit.Uwp.Helpers; 5 | 6 | using NotepadRs4.Views.Dialogs; 7 | 8 | namespace NotepadRs4.Services 9 | { 10 | // For instructions on testing this service see https://github.com/Microsoft/WindowsTemplateStudio/tree/master/docs/features/whats-new-prompt.md 11 | public static class WhatsNewDisplayService 12 | { 13 | private static bool shown = false; 14 | 15 | internal static async Task ShowIfAppropriateAsync() 16 | { 17 | if (SystemInformation.IsAppUpdated && !shown) 18 | { 19 | shown = true; 20 | var dialog = new WhatsNewDialog(); 21 | await dialog.ShowAsync(); 22 | } 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Services/WindowManagerService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.ObjectModel; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | using Windows.ApplicationModel.Core; 7 | using Windows.UI.Core; 8 | using Windows.UI.ViewManagement; 9 | using Windows.UI.Xaml; 10 | using Windows.UI.Xaml.Controls; 11 | 12 | namespace NotepadRs4.Services 13 | { 14 | public delegate void ViewClosedHandler(ViewLifetimeControl viewControl, EventArgs e); 15 | 16 | // For instructions on testing this service see https://github.com/Microsoft/WindowsTemplateStudio/blob/master/docs/features/multiple-views.md 17 | // More details about showing multiple views at https://docs.microsoft.com/windows/uwp/design/layout/show-multiple-views 18 | public class WindowManagerService 19 | { 20 | private static WindowManagerService _current; 21 | 22 | public static WindowManagerService Current => _current ?? (_current = new WindowManagerService()); 23 | 24 | // Contains all the opened secondary views. 25 | public ObservableCollection SecondaryViews { get; } = new ObservableCollection(); 26 | 27 | public int MainViewId { get; private set; } 28 | 29 | public CoreDispatcher MainDispatcher { get; private set; } 30 | 31 | public void Initialize() 32 | { 33 | MainViewId = ApplicationView.GetForCurrentView().Id; 34 | MainDispatcher = Window.Current.Dispatcher; 35 | } 36 | 37 | // Displays a view as a standalone 38 | // You can use the resulting ViewLifeTileControl to interact with the new window. 39 | public async Task TryShowAsStandaloneAsync(string windowTitle, Type pageType) 40 | { 41 | ViewLifetimeControl viewControl = await CreateViewLifetimeControlAsync(windowTitle, pageType); 42 | SecondaryViews.Add(viewControl); 43 | viewControl.StartViewInUse(); 44 | var viewShown = await ApplicationViewSwitcher.TryShowAsStandaloneAsync(viewControl.Id, ViewSizePreference.Default, ApplicationView.GetForCurrentView().Id, ViewSizePreference.Default); 45 | viewControl.StopViewInUse(); 46 | return viewControl; 47 | } 48 | 49 | // Displays a view in the specified view mode 50 | public async Task TryShowAsViewModeAsync(string windowTitle, Type pageType, ApplicationViewMode viewMode = ApplicationViewMode.Default) 51 | { 52 | ViewLifetimeControl viewControl = await CreateViewLifetimeControlAsync(windowTitle, pageType); 53 | SecondaryViews.Add(viewControl); 54 | viewControl.StartViewInUse(); 55 | var viewShown = await ApplicationViewSwitcher.TryShowAsViewModeAsync(viewControl.Id, viewMode); 56 | viewControl.StopViewInUse(); 57 | return viewControl; 58 | } 59 | 60 | private async Task CreateViewLifetimeControlAsync(string windowTitle, Type pageType) 61 | { 62 | ViewLifetimeControl viewControl = null; 63 | 64 | await CoreApplication.CreateNewView().Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => 65 | { 66 | viewControl = ViewLifetimeControl.CreateForCurrentView(); 67 | viewControl.Title = windowTitle; 68 | viewControl.StartViewInUse(); 69 | var frame = new Frame(); 70 | frame.Navigate(pageType, viewControl); 71 | Window.Current.Content = frame; 72 | Window.Current.Activate(); 73 | ApplicationView.GetForCurrentView().Title = viewControl.Title; 74 | }); 75 | 76 | return viewControl; 77 | } 78 | 79 | public bool IsWindowOpen(string windowTitle) => SecondaryViews.Any(v => v.Title == windowTitle); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Styles/Page.xaml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Styles/StackPanel.xaml: -------------------------------------------------------------------------------- 1 |  7 | 8 | 9 | 24 | 25 | 26 | 41 | 42 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Styles/TextBlock.xaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 14 | 15 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Styles/_Colors.xaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Styles/_Corners.xaml: -------------------------------------------------------------------------------- 1 |  6 | 7 | 8 | 2 9 | 10 | 11 | 2 12 | 13 | 14 | 2 15 | 16 | 17 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Styles/_FontSizes.xaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 28 6 | 16 7 | 8 | 9 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Styles/_Thickness.xaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 8 | 9 | 10 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 24,0,0,0 23 | 0,24,0,0 24 | 24,0,24,0 25 | 0,24,0,24 26 | 24,24,24,24 27 | 0,0,0,24 28 | 29 | 30 | 12, 0, 0, 0 31 | 0, 12, 0, 0 32 | 0, 12, 0, 12 33 | 12, 0, 12, 0 34 | 35 | 36 | 0, 8, 0, 0 37 | 8, 8, 8, 8 38 | 39 | 40 | 0, 4, 0, 0 41 | 42 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/ViewModels/AboutViewModel.cs: -------------------------------------------------------------------------------- 1 | using NotepadRs4.Helpers; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using Windows.ApplicationModel; 8 | 9 | namespace NotepadRs4.ViewModels 10 | { 11 | public class AboutViewModel : Observable 12 | { 13 | // Properties 14 | private string _appName; 15 | public string AppName 16 | { 17 | get { return _appName; } 18 | set { Set(ref _appName, value); } 19 | } 20 | 21 | private string _versionNumber; 22 | public string VersionNumber 23 | { 24 | get { return _versionNumber; } 25 | set { Set(ref _versionNumber, value); } 26 | } 27 | 28 | 29 | // Constructor 30 | public AboutViewModel() 31 | { 32 | Initialize(); 33 | } 34 | 35 | // Initialize Stuff 36 | public void Initialize() 37 | { 38 | AppName = GetAppName(); 39 | VersionNumber = GetVersionNumber(); 40 | } 41 | 42 | 43 | // Methods 44 | private string GetAppName() 45 | { 46 | var package = Package.Current; 47 | string appName = package.DisplayName; 48 | 49 | return appName; 50 | } 51 | 52 | private string GetVersionNumber() 53 | { 54 | var package = Package.Current; 55 | var packageId = package.Id; 56 | var version = packageId.Version; 57 | 58 | return $"{version.Major}.{version.Minor}.{version.Build}.{version.Revision}"; 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/ViewModels/NotificationBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Linq; 5 | using System.Runtime.CompilerServices; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace NotepadRs4.ViewModels 10 | { 11 | public class NotificationBase : INotifyPropertyChanged 12 | { 13 | public event PropertyChangedEventHandler PropertyChanged; 14 | 15 | // SetField (Name, value); // where there is a data member 16 | protected bool SetProperty(ref T field, T value, [CallerMemberName] string property = null) 17 | { 18 | if (EqualityComparer.Default.Equals(field, value)) return false; 19 | field = value; 20 | RaisePropertyChanged(property); 21 | return true; 22 | } 23 | 24 | // SetField(()=> somewhere.Name = value; somewhere.Name, value) // Advanced case where you rely on another property 25 | protected void SetProperty(T currentValue, T newValue, Action doSet, [CallerMemberName] string property = null) 26 | { 27 | if (EqualityComparer.Default.Equals(currentValue, newValue)) return; 28 | doSet.Invoke(); 29 | RaisePropertyChanged(property); 30 | } 31 | 32 | // Update the content of the property by giving a signal to the property that it has changed 33 | protected void RaisePropertyChanged(string property) 34 | { 35 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(property)); 36 | } 37 | } 38 | 39 | public class NotificationBase : NotificationBase where T : class, new() 40 | { 41 | protected readonly T This; 42 | public static implicit operator T(NotificationBase thing) { return thing.This; } 43 | protected NotificationBase(T thing = null) 44 | { 45 | This = thing ?? new T(); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/ViewModels/SettingsViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Collections.ObjectModel; 4 | using System.Threading.Tasks; 5 | using System.Windows.Input; 6 | using Microsoft.Toolkit.Uwp.Helpers; 7 | using NotepadRs4.Helpers; 8 | using NotepadRs4.Services; 9 | 10 | using Windows.ApplicationModel; 11 | using Windows.UI.Xaml; 12 | using Windows.UI.Xaml.Controls; 13 | using Windows.UI.Xaml.Media; 14 | 15 | namespace NotepadRs4.ViewModels 16 | { 17 | // TODO WTS: Add other settings as necessary. For help see https://github.com/Microsoft/WindowsTemplateStudio/blob/master/docs/pages/settings.md 18 | public class SettingsViewModel : Observable 19 | { 20 | // Properties 21 | private bool _hasInstanceBeenInitialized = false; 22 | private bool _haveSettingDefaultsBeenSet = false; 23 | 24 | private ElementTheme _elementTheme = ThemeSelectorService.Theme; 25 | public ElementTheme ElementTheme 26 | { 27 | get { return _elementTheme; } 28 | 29 | set { Set(ref _elementTheme, value); } 30 | } 31 | 32 | private string _versionDescription; 33 | public string VersionDescription 34 | { 35 | get { return _versionDescription; } 36 | set { Set(ref _versionDescription, value); } 37 | } 38 | 39 | // Textbox properties 40 | /// 41 | /// Text Wrapping 42 | /// 43 | private TextWrapping _textWrapping; 44 | public TextWrapping TextWrapping 45 | { 46 | get { return _textWrapping; } 47 | set 48 | { 49 | if (value != _textWrapping) 50 | { 51 | Task.Run(async () => await Windows.Storage.ApplicationData.Current.LocalSettings.SaveAsync(nameof(TextWrapping), value)); 52 | } 53 | 54 | Set(ref _textWrapping, value); 55 | } 56 | } 57 | 58 | /// 59 | /// Spell Checker 60 | /// 61 | private bool _isSpellCheckerEnabled; 62 | public bool IsSpellCheckerEnabled 63 | { 64 | get { return _isSpellCheckerEnabled; } 65 | set 66 | { 67 | if (value != _isSpellCheckerEnabled) 68 | { 69 | Task.Run(async () => await Windows.Storage.ApplicationData.Current.LocalSettings.SaveAsync(nameof(IsSpellCheckerEnabled), value)); 70 | } 71 | 72 | Set(ref _isSpellCheckerEnabled, value); 73 | } 74 | } 75 | 76 | /// 77 | /// Status Bar 78 | /// 79 | private bool _isStatusBarEnabled; 80 | public bool IsStatusBarEnabled 81 | { 82 | get { return _isStatusBarEnabled; } 83 | set 84 | { 85 | if (value != _isStatusBarEnabled) 86 | { 87 | Task.Run(async () => await Windows.Storage.ApplicationData.Current.LocalSettings.SaveAsync(nameof(IsStatusBarEnabled), value)); 88 | } 89 | 90 | Set(ref _isStatusBarEnabled, value); 91 | } 92 | } 93 | 94 | /// 95 | /// List of Fonts available on the system 96 | /// 97 | public ObservableCollection Fonts 98 | { 99 | get 100 | { 101 | ObservableCollection list = new ObservableCollection(); 102 | 103 | // Get the array of fonts 104 | var fonts = Microsoft.Graphics.Canvas.Text.CanvasTextFormat.GetSystemFontFamilies(); 105 | 106 | // Put the individual fonts in the list 107 | foreach (string font in fonts) 108 | { 109 | list.Add(font); 110 | } 111 | 112 | return list; 113 | } 114 | } 115 | 116 | private string _selectedFontFamily; 117 | public string SelectedFontFamily 118 | { 119 | get { return _selectedFontFamily; } 120 | set 121 | { 122 | if (value != _selectedFontFamily) 123 | { 124 | // #TODO Save the new value to Settings 125 | } 126 | 127 | Set(ref _selectedFontFamily, value); 128 | } 129 | } 130 | 131 | private ObservableCollection _fontSizes; 132 | public ObservableCollection FontSizes 133 | { 134 | get { return _fontSizes; } 135 | set { Set(ref _fontSizes, value); } 136 | } 137 | 138 | private int _selectedFontSize; 139 | public int SelectedFontSize 140 | { 141 | get { return _selectedFontSize; } 142 | set 143 | { 144 | if (value != _selectedFontSize) 145 | { 146 | // #TODO Save the new value to Settings 147 | /*if (!FontSizes.Contains(value)) 148 | { 149 | FontSizes.Add(value); 150 | }*/ 151 | } 152 | 153 | Set(ref _selectedFontSize, value); 154 | } 155 | } 156 | 157 | // #TODO: Bold property 158 | // #TODO: Italic property 159 | 160 | 161 | // Constructor 162 | public SettingsViewModel() 163 | { 164 | } 165 | 166 | // Initialize 167 | public void Initialize() 168 | { 169 | GetSettingValues(); 170 | VersionDescription = GetVersionDescription(); 171 | 172 | FontSizes = new ObservableCollection 173 | { 174 | 8, 175 | 9, 176 | 10, 177 | 11, 178 | 12, 179 | 14, 180 | 16, 181 | 18, 182 | 20, 183 | 22, 184 | 24, 185 | 26, 186 | 28, 187 | 36, 188 | 48, 189 | 72 190 | }; 191 | 192 | // #TODO - TEMP Set the default fontsize and family for the session 193 | SelectedFontFamily = FontFamily.XamlAutoFontFamily.Source; 194 | SelectedFontSize = 14; 195 | } 196 | 197 | 198 | // Commands 199 | private ICommand _switchThemeCommand; 200 | public ICommand SwitchThemeCommand 201 | { 202 | get 203 | { 204 | if (_switchThemeCommand == null) 205 | { 206 | _switchThemeCommand = new RelayCommand( 207 | async (param) => 208 | { 209 | if (_hasInstanceBeenInitialized) 210 | { 211 | ElementTheme = param; 212 | await ThemeSelectorService.SetThemeAsync(param); 213 | } 214 | }); 215 | } 216 | 217 | return _switchThemeCommand; 218 | } 219 | } 220 | 221 | 222 | // Methods 223 | public async Task EnsureInstanceInitializedAsync() 224 | { 225 | if (!_hasInstanceBeenInitialized) 226 | { 227 | Initialize(); 228 | 229 | _hasInstanceBeenInitialized = true; 230 | } 231 | } 232 | 233 | private string GetVersionDescription() 234 | { 235 | var appName = "AppDisplayName".GetLocalized(); 236 | var package = Package.Current; 237 | var packageId = package.Id; 238 | var version = packageId.Version; 239 | 240 | return $"{appName} - {version.Major}.{version.Minor}.{version.Build}.{version.Revision}"; 241 | } 242 | 243 | private async void GetSettingValues() 244 | { 245 | // Reworked this with try/catches so it's not dependent on the first run bool anymore and checks stuff dynamically 246 | // The purpose of this is; try to read the data; if it fails set a default value on the public property so it'll be saved back to the backend settings automatically 247 | 248 | /// Text Wrapping 249 | try { TextWrapping = await Windows.Storage.ApplicationData.Current.LocalSettings.ReadAsync(nameof(TextWrapping)); } 250 | catch { TextWrapping = TextWrapping.Wrap; } 251 | 252 | /// Spell Checkers 253 | try { IsSpellCheckerEnabled = await Windows.Storage.ApplicationData.Current.LocalSettings.ReadAsync(nameof(IsSpellCheckerEnabled)); } 254 | catch { IsSpellCheckerEnabled = false; } 255 | 256 | /// Status bar 257 | try { IsStatusBarEnabled = await Windows.Storage.ApplicationData.Current.LocalSettings.ReadAsync(nameof(IsStatusBarEnabled)); } 258 | catch { IsStatusBarEnabled = true; } 259 | } 260 | 261 | private void AddCustomFontSize(int value) 262 | { 263 | FontSizes.Add(value); 264 | // Automatically set as selected font size 265 | SelectedFontSize = value; 266 | } 267 | } 268 | } 269 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Views/Dialogs/AboutDialog.xaml.cs: -------------------------------------------------------------------------------- 1 | using NotepadRs4.Helpers; 2 | using NotepadRs4.ViewModels; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.IO; 6 | using System.Linq; 7 | using System.Runtime.InteropServices.WindowsRuntime; 8 | using System.Windows.Input; 9 | using Windows.Foundation; 10 | using Windows.Foundation.Collections; 11 | using Windows.UI.Xaml; 12 | using Windows.UI.Xaml.Controls; 13 | using Windows.UI.Xaml.Controls.Primitives; 14 | using Windows.UI.Xaml.Data; 15 | using Windows.UI.Xaml.Input; 16 | using Windows.UI.Xaml.Media; 17 | using Windows.UI.Xaml.Media.Imaging; 18 | using Windows.UI.Xaml.Navigation; 19 | 20 | namespace NotepadRs4.Views.Dialogs 21 | { 22 | public sealed partial class AboutDialog : ContentDialog 23 | { 24 | public AboutViewModel ViewModel { get; } = new AboutViewModel(); 25 | 26 | public AboutDialog() 27 | { 28 | RequestedTheme = (Window.Current.Content as FrameworkElement).RequestedTheme; 29 | this.InitializeComponent(); 30 | 31 | // Theme trigger for the logo 32 | this.ActualThemeChanged += AboutDialog_ActualThemeChanged; 33 | CheckThemeForLogo(); 34 | } 35 | 36 | private ICommand _closeDialogCommand; 37 | public ICommand CloseDialogCommand 38 | { 39 | get 40 | { 41 | if (_closeDialogCommand == null) 42 | { 43 | _closeDialogCommand = new RelayCommand( 44 | () => 45 | { 46 | Hide(); 47 | }); 48 | } 49 | return _closeDialogCommand; 50 | } 51 | } 52 | 53 | 54 | // Methods 55 | private void AboutDialog_ActualThemeChanged(FrameworkElement sender, object args) 56 | { 57 | CheckThemeForLogo(); 58 | } 59 | 60 | private void CheckThemeForLogo() 61 | { 62 | // Change the displayed logo 63 | if (ActualTheme == ElementTheme.Dark) 64 | { 65 | BitmapImage image = new BitmapImage(new Uri("ms-appx:///Assets/Logo/in-app/logo-white.png")); 66 | imgLogo.Source = image; 67 | } 68 | else if (ActualTheme == ElementTheme.Light) 69 | { 70 | BitmapImage image = new BitmapImage(new Uri("ms-appx:///Assets/Logo/in-app/logo-black.png")); 71 | imgLogo.Source = image; 72 | } 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Views/Dialogs/ExitConfirmationDialog.xaml.cs: -------------------------------------------------------------------------------- 1 | using NotepadRs4.Helpers; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.IO; 5 | using System.Linq; 6 | using System.Runtime.InteropServices.WindowsRuntime; 7 | using System.Windows.Input; 8 | using Windows.Foundation; 9 | using Windows.Foundation.Collections; 10 | using Windows.UI.Xaml; 11 | using Windows.UI.Xaml.Controls; 12 | using Windows.UI.Xaml.Controls.Primitives; 13 | using Windows.UI.Xaml.Data; 14 | using Windows.UI.Xaml.Input; 15 | using Windows.UI.Xaml.Media; 16 | using Windows.UI.Xaml.Navigation; 17 | 18 | // The Content Dialog item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238 19 | 20 | namespace NotepadRs4.Views.Dialogs 21 | { 22 | /// 23 | /// Results returned from a ExitConfirmationDialog: 24 | /// Nothing - No action has been taken (yet) by the user. 25 | /// Save - User wants to save the current item. 26 | /// Discard - User wants to discard the current item. 27 | /// Cancel - User wants to cancel the action they've clicked on. 28 | /// DialogClosed - User closed the dialog and gave no answer. Handle as 'Cancel' to the user, this option is there for debugging 29 | /// 30 | public enum ExitConfirmationDialogResult 31 | { 32 | Nothing, 33 | Save, 34 | Discard, 35 | Cancel, 36 | DialogClosed 37 | } 38 | 39 | public sealed partial class ExitConfirmationDialog : ContentDialog 40 | { 41 | // Properties 42 | public ExitConfirmationDialogResult Result { get; set; } 43 | 44 | 45 | // Constructor 46 | public ExitConfirmationDialog() 47 | { 48 | RequestedTheme = (Window.Current.Content as FrameworkElement).RequestedTheme; 49 | this.InitializeComponent(); 50 | Result = ExitConfirmationDialogResult.Nothing; 51 | } 52 | 53 | 54 | // Commands 55 | private ICommand _saveCommand; 56 | public ICommand SaveCommand 57 | { 58 | get 59 | { 60 | if (_saveCommand == null) 61 | { 62 | _saveCommand = new RelayCommand( 63 | () => 64 | { 65 | Save(); 66 | }); 67 | } 68 | return _saveCommand; 69 | } 70 | } 71 | 72 | private ICommand _discardCommand; 73 | public ICommand DiscardCommand 74 | { 75 | get 76 | { 77 | if (_discardCommand == null) 78 | { 79 | _discardCommand = new RelayCommand( 80 | () => 81 | { 82 | Discard(); 83 | }); 84 | } 85 | return _discardCommand; 86 | } 87 | } 88 | 89 | private ICommand _cancelCommand; 90 | public ICommand CancelCommand 91 | { 92 | get 93 | { 94 | if (_cancelCommand == null) 95 | { 96 | _cancelCommand = new RelayCommand( 97 | () => 98 | { 99 | Cancel(); 100 | }); 101 | } 102 | return _cancelCommand; 103 | } 104 | } 105 | 106 | private ICommand _closeCommand; 107 | public ICommand CloseCommand 108 | { 109 | get 110 | { 111 | if (_closeCommand == null) 112 | { 113 | _closeCommand = new RelayCommand( 114 | () => 115 | { 116 | Close(); 117 | }); 118 | } 119 | return _closeCommand; 120 | } 121 | } 122 | 123 | 124 | 125 | 126 | // Methods 127 | private void Save() 128 | { 129 | Result = ExitConfirmationDialogResult.Save; 130 | Hide(); 131 | } 132 | 133 | private void Discard() 134 | { 135 | Result = ExitConfirmationDialogResult.Discard; 136 | Hide(); 137 | } 138 | 139 | private void Cancel() 140 | { 141 | Result = ExitConfirmationDialogResult.Cancel; 142 | Hide(); 143 | } 144 | 145 | private void Close() 146 | { 147 | Result = ExitConfirmationDialogResult.DialogClosed; 148 | Hide(); 149 | } 150 | } 151 | } 152 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Views/Dialogs/SettingsDialog.xaml.cs: -------------------------------------------------------------------------------- 1 | using NotepadRs4.Helpers; 2 | using NotepadRs4.ViewModels; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.IO; 6 | using System.Linq; 7 | using System.Runtime.InteropServices.WindowsRuntime; 8 | using System.Windows.Input; 9 | using Windows.Foundation; 10 | using Windows.Foundation.Collections; 11 | using Windows.UI.Xaml; 12 | using Windows.UI.Xaml.Controls; 13 | using Windows.UI.Xaml.Controls.Primitives; 14 | using Windows.UI.Xaml.Data; 15 | using Windows.UI.Xaml.Input; 16 | using Windows.UI.Xaml.Media; 17 | using Windows.UI.Xaml.Navigation; 18 | 19 | namespace NotepadRs4.Views.Dialogs 20 | { 21 | public sealed partial class SettingsDialog : ContentDialog 22 | { 23 | // Properties 24 | public SettingsViewModel ViewModel { get; } = Singleton.Instance; 25 | 26 | 27 | // Constructor 28 | public SettingsDialog() 29 | { 30 | RequestedTheme = (Window.Current.Content as FrameworkElement).RequestedTheme; 31 | this.InitializeComponent(); 32 | } 33 | 34 | 35 | // Commands 36 | private ICommand _closeDialogCommand; 37 | public ICommand CloseDialogCommand 38 | { 39 | get 40 | { 41 | if (_closeDialogCommand == null) 42 | { 43 | _closeDialogCommand = new RelayCommand( 44 | () => 45 | { 46 | CloseDialog(); 47 | }); 48 | } 49 | return _closeDialogCommand; 50 | } 51 | } 52 | 53 | 54 | // Methods 55 | private void CloseDialog() 56 | { 57 | this.Hide(); 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Views/Dialogs/UnsavedDialog.xaml.cs: -------------------------------------------------------------------------------- 1 | using NotepadRs4.Helpers; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Diagnostics; 5 | using System.IO; 6 | using System.Linq; 7 | using System.Runtime.InteropServices.WindowsRuntime; 8 | using System.Windows.Input; 9 | using Windows.Foundation; 10 | using Windows.Foundation.Collections; 11 | using Windows.UI.Xaml; 12 | using Windows.UI.Xaml.Controls; 13 | using Windows.UI.Xaml.Controls.Primitives; 14 | using Windows.UI.Xaml.Data; 15 | using Windows.UI.Xaml.Input; 16 | using Windows.UI.Xaml.Media; 17 | using Windows.UI.Xaml.Navigation; 18 | 19 | 20 | namespace NotepadRs4.Views.Dialogs 21 | { 22 | /// 23 | /// Results returned from a UnsavedDialog: 24 | /// Nothing - No action has been taken (yet) by the user. 25 | /// Save - User wants to save the current item. 26 | /// Discard - User wants to discard the current item. 27 | /// Cancel - User wants to cancel the action they've clicked on. 28 | /// DialogClosed - User closed the dialog and gave no answer. Handle as 'Cancel' to the user, this option is there for debugging 29 | /// 30 | public enum UnsavedDialogResult 31 | { 32 | Nothing, 33 | Save, 34 | Discard, 35 | Cancel, 36 | DialogClosed 37 | } 38 | 39 | public sealed partial class UnsavedDialog : ContentDialog 40 | { 41 | // Properties 42 | public UnsavedDialogResult Result { get; set; } 43 | 44 | 45 | // Constructor 46 | public UnsavedDialog() 47 | { 48 | RequestedTheme = (Window.Current.Content as FrameworkElement).RequestedTheme; 49 | this.InitializeComponent(); 50 | Result = UnsavedDialogResult.Nothing; 51 | } 52 | 53 | 54 | // Commands 55 | private ICommand _saveCommand; 56 | public ICommand SaveCommand 57 | { 58 | get 59 | { 60 | if (_saveCommand == null) 61 | { 62 | _saveCommand = new RelayCommand( 63 | () => 64 | { 65 | Save(); 66 | }); 67 | } 68 | return _saveCommand; 69 | } 70 | } 71 | 72 | private ICommand _discardCommand; 73 | public ICommand DiscardCommand 74 | { 75 | get 76 | { 77 | if (_discardCommand == null) 78 | { 79 | _discardCommand = new RelayCommand( 80 | () => 81 | { 82 | Discard(); 83 | }); 84 | } 85 | return _discardCommand; 86 | } 87 | } 88 | 89 | private ICommand _cancelCommand; 90 | public ICommand CancelCommand 91 | { 92 | get 93 | { 94 | if (_cancelCommand == null) 95 | { 96 | _cancelCommand = new RelayCommand( 97 | () => 98 | { 99 | Cancel(); 100 | }); 101 | } 102 | return _cancelCommand; 103 | } 104 | } 105 | 106 | private ICommand _closeCommand; 107 | public ICommand CloseCommand 108 | { 109 | get 110 | { 111 | if (_closeCommand == null) 112 | { 113 | _closeCommand = new RelayCommand( 114 | () => 115 | { 116 | Close(); 117 | }); 118 | } 119 | return _closeCommand; 120 | } 121 | } 122 | 123 | 124 | 125 | 126 | // Methods 127 | private void Save() 128 | { 129 | Result = UnsavedDialogResult.Save; 130 | Hide(); 131 | } 132 | 133 | private void Discard() 134 | { 135 | Result = UnsavedDialogResult.Discard; 136 | Hide(); 137 | } 138 | 139 | private void Cancel() 140 | { 141 | Result = UnsavedDialogResult.Cancel; 142 | Hide(); 143 | } 144 | 145 | private void Close() 146 | { 147 | Result = UnsavedDialogResult.DialogClosed; 148 | Hide(); 149 | } 150 | } 151 | } 152 | -------------------------------------------------------------------------------- /NotepadRs4/NotepadRs4/Views/Dialogs/WhatsNewDialog.xaml: -------------------------------------------------------------------------------- 1 |  17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 34 | 35 | 40 | 41 | 48 | 53 | 54 | 55 | 56 | 62 | 66 |