├── .editorconfig ├── .gitattributes ├── .github └── workflows │ └── ci.yml ├── .gitignore ├── HN.Controls.ImageEx.sln ├── LICENSE ├── README.md ├── appveyor.yml ├── build.cake ├── build.ps1 ├── demo ├── UwpDemo │ ├── App.xaml │ ├── App.xaml.cs │ ├── Assets │ │ ├── LockScreenLogo.scale-200.png │ │ ├── SplashScreen.scale-200.png │ │ ├── Square150x150Logo.scale-200.png │ │ ├── Square44x44Logo.scale-200.png │ │ ├── Square44x44Logo.targetsize-24_altform-unplated.png │ │ ├── StoreLogo.png │ │ ├── Wide310x150Logo.scale-200.png │ │ ├── bliss.png │ │ ├── newtons_cradle.gif │ │ └── unicorn.png │ ├── Package.appxmanifest │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ └── Default.rd.xml │ ├── UwpDemo.csproj │ └── Views │ │ ├── AnimationView.xaml │ │ ├── AnimationView.xaml.cs │ │ ├── CornerRadiusView.xaml │ │ ├── CornerRadiusView.xaml.cs │ │ ├── LazyLoadingView.xaml │ │ ├── LazyLoadingView.xaml.cs │ │ ├── MainView.xaml │ │ ├── MainView.xaml.cs │ │ ├── MemoryUsageView.xaml │ │ ├── MemoryUsageView.xaml.cs │ │ ├── ProgressView.xaml │ │ ├── ProgressView.xaml.cs │ │ ├── RootView.xaml │ │ ├── RootView.xaml.cs │ │ ├── ShadowView.xaml │ │ └── ShadowView.xaml.cs └── WpfDemo │ ├── App.config │ ├── App.xaml │ ├── App.xaml.cs │ ├── Images │ ├── bliss.png │ ├── newtons_cradle.gif │ └── unicorn.png │ ├── Views │ ├── AnimationView.xaml │ ├── AnimationView.xaml.cs │ ├── CornerRadiusView.xaml │ ├── CornerRadiusView.xaml.cs │ ├── LazyLoadingView.xaml │ ├── LazyLoadingView.xaml.cs │ ├── MainView.xaml │ ├── MainView.xaml.cs │ ├── MemoryUsageView.xaml │ ├── MemoryUsageView.xaml.cs │ ├── ProgressView.xaml │ ├── ProgressView.xaml.cs │ ├── ShadowView.xaml │ ├── ShadowView.xaml.cs │ ├── StretchView.xaml │ └── StretchView.xaml.cs │ └── WpfDemo.csproj ├── src ├── HN.Controls.ImageEx.Core │ ├── Cache │ │ ├── DiskCacheBase.cs │ │ └── IDiskCache.cs │ ├── Constants.cs │ ├── Controls │ │ ├── ImageExFailedEventArgs.cs │ │ └── ImageExFailedEventHandler.cs │ ├── Extensions │ │ └── UriExtensions.cs │ ├── HN.Controls.ImageEx.Core.csproj │ ├── HN.Controls.ImageEx.Core.nuspec │ ├── Http │ │ ├── HttpDownloadProgress.cs │ │ └── ThrottlingDelegatingHandler.cs │ ├── Media │ │ ├── ImageBrushExFailedEventArgs.cs │ │ └── ImageBrushExFailedEventHandler.cs │ ├── Pipes │ │ ├── ByteArrayPipe.cs │ │ ├── DiskCachePipe.cs │ │ ├── ILoadingContext.cs │ │ ├── ILoadingPipe.cs │ │ ├── LoadingContext.cs │ │ ├── LoadingPipeBase.cs │ │ ├── LoadingPipeBuilder.cs │ │ ├── LoadingPipeDelegate.cs │ │ ├── MemoryCachePipe.cs │ │ ├── StringPipeBase.cs │ │ └── UriPipeBase.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── Services │ │ ├── IDesignModeService.cs │ │ ├── IImageExOptions.cs │ │ ├── IImageLoader.cs │ │ ├── ImageExOptions.cs │ │ └── ImageExOptionsExtensions.cs ├── HN.Controls.ImageEx.Uwp │ ├── Animation │ │ └── AnimationBridge.cs │ ├── Cache │ │ ├── DiskCache.cs │ │ ├── FINDEX_INFO_LEVELS.cs │ │ ├── FINDEX_SEARCH_OPS.cs │ │ ├── UwpIONative.cs │ │ └── WIN32_FIND_DATA.cs │ ├── Controls │ │ ├── ImageEx.Animation.cs │ │ ├── ImageEx.CornerRadius.cs │ │ ├── ImageEx.Design.cs │ │ ├── ImageEx.Design.xaml │ │ ├── ImageEx.Layout.cs │ │ ├── ImageEx.LazyLoading.cs │ │ ├── ImageEx.NineGrid.cs │ │ ├── ImageEx.Retry.cs │ │ ├── ImageEx.Shadow.cs │ │ ├── ImageEx.Stretch.cs │ │ ├── ImageEx.cs │ │ ├── ImageEx.xaml │ │ ├── ImageExAssist.cs │ │ ├── ImageExAssist.xaml │ │ ├── ImageExShadow.cs │ │ └── StretchHelper.cs │ ├── HN.Controls.ImageEx.Uwp.csproj │ ├── HN.Controls.ImageEx.Uwp.nuspec │ ├── Media │ │ ├── ImageBrushEx.Retry.cs │ │ ├── ImageBrushEx.cs │ │ ├── ImageSurfaceFailedStatusException.cs │ │ └── SvgImageFailedStatusException.cs │ ├── Models │ │ ├── IImageExDisplaySource.cs │ │ ├── IMultiplyFrameImageExDisplaySource.cs │ │ ├── ISingleFrameImageExDisplaySource.cs │ │ ├── ImageExFrame.cs │ │ ├── ImageExSource.cs │ │ ├── MultiplyFrameImageExDisplaySource.cs │ │ └── SingleFrameImageExDisplaySource.cs │ ├── Pipes │ │ ├── StreamToCompositionSurfacePipe.cs │ │ ├── StreamToImageExSourcePipe.cs │ │ ├── StreamToImageSourcePipe.cs │ │ ├── StringPipe.cs │ │ └── UriPipe.cs │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ └── HN.Controls.ImageEx.Uwp.rd.xml │ ├── Services │ │ ├── DesignModeService.cs │ │ ├── ImageExOptionsExtensions.cs │ │ ├── ImageExService.cs │ │ └── ImageLoader.cs │ ├── Themes │ │ └── Generic.xaml │ └── VisualStudioToolsManifest.xml ├── HN.Controls.ImageEx.Wpf │ ├── Animation │ │ └── AnimationBridge.cs │ ├── Cache │ │ └── DiskCache.cs │ ├── Controls │ │ ├── ImageEx.Animation.cs │ │ ├── ImageEx.CornerRadius.cs │ │ ├── ImageEx.Design.cs │ │ ├── ImageEx.Design.xaml │ │ ├── ImageEx.Layout.cs │ │ ├── ImageEx.LazyLoading.cs │ │ ├── ImageEx.NineGrid.cs │ │ ├── ImageEx.Retry.cs │ │ ├── ImageEx.Shadow.cs │ │ ├── ImageEx.Stretch.cs │ │ ├── ImageEx.cs │ │ ├── ImageEx.xaml │ │ ├── ImageExAssist.cs │ │ ├── ImageExAssist.xaml │ │ ├── ImageExShadow.cs │ │ └── StretchHelper.cs │ ├── HN.Controls.ImageEx.Wpf.csproj │ ├── HN.Controls.ImageEx.Wpf.nuspec │ ├── Media │ │ ├── ImageBrushExExtension.Retry.cs │ │ └── ImageBrushExExtension.cs │ ├── Models │ │ ├── IImageExDisplaySource.cs │ │ ├── IMultiplyFrameImageExDisplaySource.cs │ │ ├── ISingleFrameImageExDisplaySource.cs │ │ ├── ImageExFrame.cs │ │ ├── ImageExSource.cs │ │ ├── MultiplyFrameImageExDisplaySource.cs │ │ └── SingleFrameImageExDisplaySource.cs │ ├── Pipes │ │ ├── StreamToImageExSourcePipe.cs │ │ ├── StreamToImageSourcePipe.cs │ │ ├── StringPipe.cs │ │ └── UriPipe.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Services │ │ ├── DesignModeService.cs │ │ ├── ImageExOptionsExtensions.cs │ │ ├── ImageExService.cs │ │ └── ImageLoader.cs │ ├── Themes │ │ └── Generic.xaml │ └── app.config └── SolutionInfo.cs ├── test └── HN.Controls.ImageEx.Core.Tests │ ├── HN.Controls.ImageEx.Core.Tests.csproj │ ├── Pipes │ └── ByteArrayPipeTests.cs │ └── Services │ └── TestDesignModeService.cs └── tools └── packages.config /.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/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | on: 3 | push: 4 | branches: 5 | - master 6 | pull_request: 7 | jobs: 8 | build: 9 | name: Build 10 | runs-on: windows-latest 11 | 12 | steps: 13 | - name: Checkout 14 | uses: actions/checkout@master 15 | 16 | - name: Run build script 17 | run: .\build.ps1 18 | shell: pwsh 19 | env: 20 | NUGET_APIKEY: ${{ secrets.NUGET_APIKEY }} 21 | 22 | - name: Upload nupkg 23 | uses: actions/upload-artifact@master 24 | with: 25 | name: Nuget Packages 26 | path: ./artifacts -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 h82258652 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # HN.Controls.ImageEx 2 | [![Build status](https://github.com/h82258652/HN.Controls.ImageEx/workflows/CI/badge.svg)](https://github.com/h82258652/HN.Controls.ImageEx/workflows/CI/badge.svg) 3 | 4 | | Package | Nuget | 5 | | - | - | 6 | | HN.Controls.ImageEx.Core | [![Nuget](https://img.shields.io/nuget/v/HN.Controls.ImageEx.Core.svg)](https://www.nuget.org/packages/HN.Controls.ImageEx.Core) | 7 | | HN.Controls.ImageEx.Wpf | [![Nuget](https://img.shields.io/nuget/v/HN.Controls.ImageEx.Wpf.svg)](https://www.nuget.org/packages/HN.Controls.ImageEx.Wpf) | 8 | | HN.Controls.ImageEx.Uwp | [![Nuget](https://img.shields.io/nuget/v/HN.Controls.ImageEx.Uwp.svg)](https://www.nuget.org/packages/HN.Controls.ImageEx.Uwp) | 9 | 10 | An enhanced image for WPF and UWP. 11 | WPF version for .net framework 4.6.2 and .net core 3.1 12 | UWP version for 17763 13 | The usage please see the demo project. 14 | 15 | ## Notice! 16 | Due to there are some performance problems in SkiaSharp, the 2.x.x version will stop developing. You can use the 1.x.x version if you meet the performance problems. 3.x.x version is on the plan. 17 | 18 | ### WPF Support 19 | | | ImageEx | ImageBrushEx | 20 | | - | - | - | 21 | | Disk Cache | :heavy_check_mark: | :heavy_check_mark: | 22 | | Placeholder | :heavy_check_mark: | | 23 | | Loading Template | :heavy_check_mark: | | 24 | | Failed Template | :heavy_check_mark: | | 25 | | Retry | :heavy_check_mark: | :heavy_check_mark: | 26 | | Lazy Loading | :heavy_check_mark: | | 27 | | CornerRadius | :heavy_check_mark: | | 28 | | Shadow | :heavy_check_mark: | | 29 | | Gif | :heavy_check_mark: | | 30 | | Webp | :heavy_check_mark: | | 31 | | Fade in animation | :heavy_check_mark: | | 32 | 33 | ### UWP Support 34 | | | ImageEx | ImageBrushEx | 35 | | - | - | - | 36 | | Disk Cache | :heavy_check_mark: | :heavy_check_mark: | 37 | | Placeholder | :heavy_check_mark: | | 38 | | Loading Template | :heavy_check_mark: | | 39 | | Failed Template | :heavy_check_mark: | | 40 | | Retry | :heavy_check_mark: | :heavy_check_mark: | 41 | | Lazy Loading | :heavy_check_mark: | | 42 | | CornerRadius | :heavy_check_mark: | | 43 | | Shadow | :heavy_check_mark: | | 44 | | Gif | :heavy_check_mark: | | 45 | | Webp | :heavy_check_mark: | :heavy_check_mark: | 46 | | Fade in animation | :heavy_check_mark: | | 47 | 48 | ### Next plan: 49 | - [x] Update the lazy loading, support set the thresholds and give a default value. (Now is 300px) 50 | - [x] Built-in fade in animation while loaded image success. (Default duration is 0 second) 51 | - [x] Use ```SkiaSharp``` to resolve the image. 52 | - [x] ```CornerRadius``` support. 53 | - [x] Built-in shadow, same API for WPF and UWP. 54 | - [x] Gif animation controller, including ```Play```, ```Pause```, ```GotoFrame```, ```RepeatBehavior```(use metadata or custom), ```SpeedRatio```. 55 | - [x] Same API for WPF and UWP, such as ```StretchDirection```(exist in WPF but not UWP), ```NineGrid```(exist in UWP but not WPF). 56 | - [ ] Add ```IImageEx``` interface for ```ImageEx```. 57 | - [ ] Improve performance. 58 | - [ ] Target .net 5. 59 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | version: 1.0.{build} 2 | pull_requests: 3 | do_not_increment_build_number: true 4 | image: Visual Studio 2017 5 | configuration: Release 6 | assembly_info: 7 | patch: true 8 | file: '**\AssemblyInfo.*' 9 | assembly_version: '{version}' 10 | assembly_file_version: '{version}' 11 | assembly_informational_version: '{version}' 12 | dotnet_csproj: 13 | patch: true 14 | file: '**\*.csproj' 15 | version: '{version}' 16 | package_version: '{version}' 17 | assembly_version: '{version}' 18 | file_version: '{version}' 19 | informational_version: '{version}' 20 | before_build: 21 | - cmd: pushd . && nuget restore && popd 22 | build: 23 | publish_nuget: true 24 | verbosity: minimal -------------------------------------------------------------------------------- /build.cake: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TOOLS / ADDINS 3 | /////////////////////////////////////////////////////////////////////////////// 4 | 5 | #tool vswhere 6 | 7 | ////////////////////////////////////////////////////////////////////// 8 | // ARGUMENTS 9 | ////////////////////////////////////////////////////////////////////// 10 | 11 | var msBuildPath = GetFiles(VSWhereLatest() + "/**/MSBuild.exe").FirstOrDefault(); 12 | 13 | var target = Argument("target", "Default"); 14 | var configuration = Argument("configuration", "Release"); 15 | var verbosity = Argument("verbosity", Verbosity.Minimal); 16 | var version = Argument("version", "2.0.3"); 17 | 18 | ////////////////////////////////////////////////////////////////////// 19 | // PREPARATION 20 | ////////////////////////////////////////////////////////////////////// 21 | 22 | var solution = "./HN.Controls.ImageEx.sln"; 23 | 24 | ////////////////////////////////////////////////////////////////////// 25 | // TASKS 26 | ////////////////////////////////////////////////////////////////////// 27 | 28 | Task("Clean") 29 | .ContinueOnError() 30 | .Does(() => 31 | { 32 | CleanDirectories("./src/*/bin"); 33 | }); 34 | 35 | Task("Restore-NuGet-Packages") 36 | .IsDependentOn("Clean") 37 | .Does(() => 38 | { 39 | NuGetRestore(solution, new NuGetRestoreSettings { NoCache = true }); 40 | }); 41 | 42 | Task("Version") 43 | .IsDependentOn("Restore-NuGet-Packages") 44 | .Does(() => 45 | { 46 | var file = "./src/SolutionInfo.cs"; 47 | CreateAssemblyInfo(file, new AssemblyInfoSettings 48 | { 49 | Version = version, 50 | FileVersion = version, 51 | InformationalVersion = version, 52 | Copyright = string.Format("Copyright © h82258652 2018 - {0}", DateTime.Now.Year) 53 | }); 54 | }); 55 | 56 | Task("Build") 57 | .IsDependentOn("Version") 58 | .Does(() => 59 | { 60 | if(IsRunningOnWindows()) 61 | { 62 | // Use MSBuild 63 | var settings = new MSBuildSettings 64 | { 65 | ToolPath = msBuildPath 66 | } 67 | .SetConfiguration(configuration) 68 | .SetVerbosity(verbosity); 69 | MSBuild(solution, settings); 70 | } 71 | else 72 | { 73 | // Use XBuild 74 | XBuild(solution, configurator => 75 | configurator.SetConfiguration(configuration) 76 | .SetVerbosity(verbosity)); 77 | } 78 | }); 79 | 80 | Task("Test") 81 | .IsDependentOn("Build") 82 | .Does(() => 83 | { 84 | var settings = new DotNetCoreTestSettings 85 | { 86 | Configuration = "Release" 87 | }; 88 | 89 | var testProjects = GetFiles("./test/**/*.csproj"); 90 | foreach(var testProject in testProjects) 91 | { 92 | DotNetCoreTest(testProject.FullPath, settings); 93 | } 94 | }); 95 | 96 | Task("Package") 97 | .IsDependentOn("Test") 98 | .Does(() => 99 | { 100 | var nugetPackSettings = new NuGetPackSettings 101 | { 102 | Version = version, 103 | OutputDirectory = "./artifacts", 104 | Repository = new NuGetRepository 105 | { 106 | Type = "git", 107 | Url = "https://github.com/h82258652/HN.Controls.ImageEx" 108 | } 109 | }; 110 | 111 | var nuspecFiles = GetFiles("./src/*/*.nuspec"); 112 | NuGetPack(nuspecFiles, nugetPackSettings); 113 | }); 114 | 115 | Task("Publish") 116 | .IsDependentOn("Package") 117 | .Does(() => 118 | { 119 | if(BuildSystem.IsRunningOnGitHubActions) 120 | { 121 | var packages = GetFiles("./artifacts/*.nupkg"); 122 | var nugetApiKey = EnvironmentVariable("NUGET_APIKEY"); 123 | NuGetPush(packages, new NuGetPushSettings 124 | { 125 | Source = "https://www.nuget.org", 126 | ApiKey = nugetApiKey, 127 | SkipDuplicate = true 128 | }); 129 | } 130 | }); 131 | 132 | ////////////////////////////////////////////////////////////////////// 133 | // TASK TARGETS 134 | ////////////////////////////////////////////////////////////////////// 135 | 136 | Task("Default") 137 | .IsDependentOn("Publish"); 138 | 139 | ////////////////////////////////////////////////////////////////////// 140 | // EXECUTION 141 | ////////////////////////////////////////////////////////////////////// 142 | 143 | RunTarget(target); -------------------------------------------------------------------------------- /demo/UwpDemo/App.xaml: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /demo/UwpDemo/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Windows.ApplicationModel; 3 | using Windows.ApplicationModel.Activation; 4 | using Windows.UI.Xaml; 5 | using Windows.UI.Xaml.Navigation; 6 | using UwpDemo.Views; 7 | 8 | namespace UwpDemo 9 | { 10 | /// 11 | /// 提供特定于应用程序的行为,以补充默认的应用程序类。 12 | /// 13 | sealed partial class App : Application 14 | { 15 | /// 16 | /// 初始化单一实例应用程序对象。这是执行的创作代码的第一行, 17 | /// 已执行,逻辑上等同于 main() 或 WinMain()。 18 | /// 19 | public App() 20 | { 21 | this.InitializeComponent(); 22 | this.Suspending += OnSuspending; 23 | } 24 | 25 | /// 26 | /// 在应用程序由最终用户正常启动时进行调用。 27 | /// 将在启动应用程序以打开特定文件等情况下使用。 28 | /// 29 | /// 有关启动请求和过程的详细信息。 30 | protected override void OnLaunched(LaunchActivatedEventArgs e) 31 | { 32 | var rootView = Window.Current.Content as RootView; 33 | 34 | // 不要在窗口已包含内容时重复应用程序初始化, 35 | // 只需确保窗口处于活动状态 36 | if (rootView == null) 37 | { 38 | // 创建要充当导航上下文的框架,并导航到第一页 39 | rootView = new RootView(); 40 | 41 | if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) 42 | { 43 | //TODO: 从之前挂起的应用程序加载状态 44 | } 45 | 46 | // 将框架放在当前窗口中 47 | Window.Current.Content = rootView; 48 | } 49 | 50 | if (e.PrelaunchActivated == false) 51 | { 52 | // 确保当前窗口处于活动状态 53 | Window.Current.Activate(); 54 | } 55 | } 56 | 57 | /// 58 | /// 导航到特定页失败时调用 59 | /// 60 | ///导航失败的框架 61 | ///有关导航失败的详细信息 62 | private void OnNavigationFailed(object sender, NavigationFailedEventArgs e) 63 | { 64 | throw new Exception("Failed to load Page " + e.SourcePageType.FullName); 65 | } 66 | 67 | /// 68 | /// 在将要挂起应用程序执行时调用。 在不知道应用程序 69 | /// 无需知道应用程序会被终止还是会恢复, 70 | /// 并让内存内容保持不变。 71 | /// 72 | /// 挂起的请求的源。 73 | /// 有关挂起请求的详细信息。 74 | private void OnSuspending(object sender, SuspendingEventArgs e) 75 | { 76 | var deferral = e.SuspendingOperation.GetDeferral(); 77 | //TODO: 保存应用程序状态并停止任何后台活动 78 | deferral.Complete(); 79 | } 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /demo/UwpDemo/Assets/LockScreenLogo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/h82258652/HN.Controls.ImageEx/7358bb8d0039648694e7f4589a75c96895e63d15/demo/UwpDemo/Assets/LockScreenLogo.scale-200.png -------------------------------------------------------------------------------- /demo/UwpDemo/Assets/SplashScreen.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/h82258652/HN.Controls.ImageEx/7358bb8d0039648694e7f4589a75c96895e63d15/demo/UwpDemo/Assets/SplashScreen.scale-200.png -------------------------------------------------------------------------------- /demo/UwpDemo/Assets/Square150x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/h82258652/HN.Controls.ImageEx/7358bb8d0039648694e7f4589a75c96895e63d15/demo/UwpDemo/Assets/Square150x150Logo.scale-200.png -------------------------------------------------------------------------------- /demo/UwpDemo/Assets/Square44x44Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/h82258652/HN.Controls.ImageEx/7358bb8d0039648694e7f4589a75c96895e63d15/demo/UwpDemo/Assets/Square44x44Logo.scale-200.png -------------------------------------------------------------------------------- /demo/UwpDemo/Assets/Square44x44Logo.targetsize-24_altform-unplated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/h82258652/HN.Controls.ImageEx/7358bb8d0039648694e7f4589a75c96895e63d15/demo/UwpDemo/Assets/Square44x44Logo.targetsize-24_altform-unplated.png -------------------------------------------------------------------------------- /demo/UwpDemo/Assets/StoreLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/h82258652/HN.Controls.ImageEx/7358bb8d0039648694e7f4589a75c96895e63d15/demo/UwpDemo/Assets/StoreLogo.png -------------------------------------------------------------------------------- /demo/UwpDemo/Assets/Wide310x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/h82258652/HN.Controls.ImageEx/7358bb8d0039648694e7f4589a75c96895e63d15/demo/UwpDemo/Assets/Wide310x150Logo.scale-200.png -------------------------------------------------------------------------------- /demo/UwpDemo/Assets/bliss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/h82258652/HN.Controls.ImageEx/7358bb8d0039648694e7f4589a75c96895e63d15/demo/UwpDemo/Assets/bliss.png -------------------------------------------------------------------------------- /demo/UwpDemo/Assets/newtons_cradle.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/h82258652/HN.Controls.ImageEx/7358bb8d0039648694e7f4589a75c96895e63d15/demo/UwpDemo/Assets/newtons_cradle.gif -------------------------------------------------------------------------------- /demo/UwpDemo/Assets/unicorn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/h82258652/HN.Controls.ImageEx/7358bb8d0039648694e7f4589a75c96895e63d15/demo/UwpDemo/Assets/unicorn.png -------------------------------------------------------------------------------- /demo/UwpDemo/Package.appxmanifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 8 | 9 | 13 | 14 | 15 | 16 | 17 | UwpDemo 18 | h8225 19 | Assets\StoreLogo.png 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 34 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /demo/UwpDemo/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("UwpDemo")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("UwpDemo")] 12 | [assembly: AssemblyCopyright("Copyright © 2018")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Version information for an assembly consists of the following four values: 17 | // 18 | // Major Version 19 | // Minor Version 20 | // Build Number 21 | // Revision 22 | // 23 | // You can specify all the values or you can default the Build and Revision Numbers 24 | // by using the '*' as shown below: 25 | // [assembly: AssemblyVersion("1.0.*")] 26 | [assembly: AssemblyVersion("1.0.0.0")] 27 | [assembly: AssemblyFileVersion("1.0.0.0")] 28 | [assembly: ComVisible(false)] -------------------------------------------------------------------------------- /demo/UwpDemo/Properties/Default.rd.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /demo/UwpDemo/Views/AnimationView.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 11 | 12 | 13 | 14 | 20 | 22 |