Migrate demo app to WinUI/WindowsSDK

This commit is contained in:
Denis-Cosmin Nutiu 2022-02-04 21:21:27 +02:00
parent 2c40a1412b
commit ac37350940
29 changed files with 215 additions and 422 deletions

View file

@ -9,7 +9,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConsoleInterface", "Console
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ImageCore.Tests", "ImageCore.Tests\ImageCore.Tests.csproj", "{8EB81515-E62C-4408-84E0-6C27E0293902}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UwpApplication", "UwpApplication\UwpApplication.csproj", "{2E54D610-D16D-40BF-A7C7-2092BE262779}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsApplication", "WindowsApplication\WindowsApplication.csproj", "{122A284C-5944-4AAF-B2CC-56180C882483}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -85,36 +85,36 @@ Global
{8EB81515-E62C-4408-84E0-6C27E0293902}.Release|x64.Build.0 = Release|Any CPU
{8EB81515-E62C-4408-84E0-6C27E0293902}.Release|x86.ActiveCfg = Release|Any CPU
{8EB81515-E62C-4408-84E0-6C27E0293902}.Release|x86.Build.0 = Release|Any CPU
{2E54D610-D16D-40BF-A7C7-2092BE262779}.Debug|Any CPU.ActiveCfg = Debug|x64
{2E54D610-D16D-40BF-A7C7-2092BE262779}.Debug|Any CPU.Build.0 = Debug|x64
{2E54D610-D16D-40BF-A7C7-2092BE262779}.Debug|Any CPU.Deploy.0 = Debug|x64
{2E54D610-D16D-40BF-A7C7-2092BE262779}.Debug|ARM.ActiveCfg = Debug|ARM
{2E54D610-D16D-40BF-A7C7-2092BE262779}.Debug|ARM.Build.0 = Debug|ARM
{2E54D610-D16D-40BF-A7C7-2092BE262779}.Debug|ARM.Deploy.0 = Debug|ARM
{2E54D610-D16D-40BF-A7C7-2092BE262779}.Debug|ARM64.ActiveCfg = Debug|ARM64
{2E54D610-D16D-40BF-A7C7-2092BE262779}.Debug|ARM64.Build.0 = Debug|ARM64
{2E54D610-D16D-40BF-A7C7-2092BE262779}.Debug|ARM64.Deploy.0 = Debug|ARM64
{2E54D610-D16D-40BF-A7C7-2092BE262779}.Debug|x64.ActiveCfg = Debug|x64
{2E54D610-D16D-40BF-A7C7-2092BE262779}.Debug|x64.Build.0 = Debug|x64
{2E54D610-D16D-40BF-A7C7-2092BE262779}.Debug|x64.Deploy.0 = Debug|x64
{2E54D610-D16D-40BF-A7C7-2092BE262779}.Debug|x86.ActiveCfg = Debug|x86
{2E54D610-D16D-40BF-A7C7-2092BE262779}.Debug|x86.Build.0 = Debug|x86
{2E54D610-D16D-40BF-A7C7-2092BE262779}.Debug|x86.Deploy.0 = Debug|x86
{2E54D610-D16D-40BF-A7C7-2092BE262779}.Release|Any CPU.ActiveCfg = Release|x64
{2E54D610-D16D-40BF-A7C7-2092BE262779}.Release|Any CPU.Build.0 = Release|x64
{2E54D610-D16D-40BF-A7C7-2092BE262779}.Release|Any CPU.Deploy.0 = Release|x64
{2E54D610-D16D-40BF-A7C7-2092BE262779}.Release|ARM.ActiveCfg = Release|ARM
{2E54D610-D16D-40BF-A7C7-2092BE262779}.Release|ARM.Build.0 = Release|ARM
{2E54D610-D16D-40BF-A7C7-2092BE262779}.Release|ARM.Deploy.0 = Release|ARM
{2E54D610-D16D-40BF-A7C7-2092BE262779}.Release|ARM64.ActiveCfg = Release|ARM64
{2E54D610-D16D-40BF-A7C7-2092BE262779}.Release|ARM64.Build.0 = Release|ARM64
{2E54D610-D16D-40BF-A7C7-2092BE262779}.Release|ARM64.Deploy.0 = Release|ARM64
{2E54D610-D16D-40BF-A7C7-2092BE262779}.Release|x64.ActiveCfg = Release|x64
{2E54D610-D16D-40BF-A7C7-2092BE262779}.Release|x64.Build.0 = Release|x64
{2E54D610-D16D-40BF-A7C7-2092BE262779}.Release|x64.Deploy.0 = Release|x64
{2E54D610-D16D-40BF-A7C7-2092BE262779}.Release|x86.ActiveCfg = Release|x86
{2E54D610-D16D-40BF-A7C7-2092BE262779}.Release|x86.Build.0 = Release|x86
{2E54D610-D16D-40BF-A7C7-2092BE262779}.Release|x86.Deploy.0 = Release|x86
{122A284C-5944-4AAF-B2CC-56180C882483}.Debug|Any CPU.ActiveCfg = Debug|x64
{122A284C-5944-4AAF-B2CC-56180C882483}.Debug|Any CPU.Build.0 = Debug|x64
{122A284C-5944-4AAF-B2CC-56180C882483}.Debug|Any CPU.Deploy.0 = Debug|x64
{122A284C-5944-4AAF-B2CC-56180C882483}.Debug|ARM.ActiveCfg = Debug|x64
{122A284C-5944-4AAF-B2CC-56180C882483}.Debug|ARM.Build.0 = Debug|x64
{122A284C-5944-4AAF-B2CC-56180C882483}.Debug|ARM.Deploy.0 = Debug|x64
{122A284C-5944-4AAF-B2CC-56180C882483}.Debug|ARM64.ActiveCfg = Debug|arm64
{122A284C-5944-4AAF-B2CC-56180C882483}.Debug|ARM64.Build.0 = Debug|arm64
{122A284C-5944-4AAF-B2CC-56180C882483}.Debug|ARM64.Deploy.0 = Debug|arm64
{122A284C-5944-4AAF-B2CC-56180C882483}.Debug|x64.ActiveCfg = Debug|x64
{122A284C-5944-4AAF-B2CC-56180C882483}.Debug|x64.Build.0 = Debug|x64
{122A284C-5944-4AAF-B2CC-56180C882483}.Debug|x64.Deploy.0 = Debug|x64
{122A284C-5944-4AAF-B2CC-56180C882483}.Debug|x86.ActiveCfg = Debug|x86
{122A284C-5944-4AAF-B2CC-56180C882483}.Debug|x86.Build.0 = Debug|x86
{122A284C-5944-4AAF-B2CC-56180C882483}.Debug|x86.Deploy.0 = Debug|x86
{122A284C-5944-4AAF-B2CC-56180C882483}.Release|Any CPU.ActiveCfg = Release|x64
{122A284C-5944-4AAF-B2CC-56180C882483}.Release|Any CPU.Build.0 = Release|x64
{122A284C-5944-4AAF-B2CC-56180C882483}.Release|Any CPU.Deploy.0 = Release|x64
{122A284C-5944-4AAF-B2CC-56180C882483}.Release|ARM.ActiveCfg = Release|x64
{122A284C-5944-4AAF-B2CC-56180C882483}.Release|ARM.Build.0 = Release|x64
{122A284C-5944-4AAF-B2CC-56180C882483}.Release|ARM.Deploy.0 = Release|x64
{122A284C-5944-4AAF-B2CC-56180C882483}.Release|ARM64.ActiveCfg = Release|arm64
{122A284C-5944-4AAF-B2CC-56180C882483}.Release|ARM64.Build.0 = Release|arm64
{122A284C-5944-4AAF-B2CC-56180C882483}.Release|ARM64.Deploy.0 = Release|arm64
{122A284C-5944-4AAF-B2CC-56180C882483}.Release|x64.ActiveCfg = Release|x64
{122A284C-5944-4AAF-B2CC-56180C882483}.Release|x64.Build.0 = Release|x64
{122A284C-5944-4AAF-B2CC-56180C882483}.Release|x64.Deploy.0 = Release|x64
{122A284C-5944-4AAF-B2CC-56180C882483}.Release|x86.ActiveCfg = Release|x86
{122A284C-5944-4AAF-B2CC-56180C882483}.Release|x86.Build.0 = Release|x86
{122A284C-5944-4AAF-B2CC-56180C882483}.Release|x86.Deploy.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View file

@ -1,7 +0,0 @@
<Application
x:Class="UwpApplication.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:UwpApplication">
</Application>

View file

@ -1,100 +0,0 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
namespace UwpApplication
{
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
sealed partial class App : Application
{
/// <summary>
/// Initializes the singleton application object. This is the first line of authored code
/// executed, and as such is the logical equivalent of main() or WinMain().
/// </summary>
public App()
{
this.InitializeComponent();
this.Suspending += OnSuspending;
}
/// <summary>
/// Invoked when the application is launched normally by the end user. Other entry points
/// will be used such as when the application is launched to open a specific file.
/// </summary>
/// <param name="e">Details about the launch request and process.</param>
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
Frame rootFrame = Window.Current.Content as Frame;
// Do not repeat app initialization when the Window already has content,
// just ensure that the window is active
if (rootFrame == null)
{
// Create a Frame to act as the navigation context and navigate to the first page
rootFrame = new Frame();
rootFrame.NavigationFailed += OnNavigationFailed;
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
//TODO: Load state from previously suspended application
}
// Place the frame in the current Window
Window.Current.Content = rootFrame;
}
if (e.PrelaunchActivated == false)
{
if (rootFrame.Content == null)
{
// When the navigation stack isn't restored navigate to the first page,
// configuring the new page by passing required information as a navigation
// parameter
rootFrame.Navigate(typeof(MainPage), e.Arguments);
}
// Ensure the current window is active
Window.Current.Activate();
}
}
/// <summary>
/// Invoked when Navigation to a certain page fails
/// </summary>
/// <param name="sender">The Frame which failed navigation</param>
/// <param name="e">Details about the navigation failure</param>
void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
{
throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
}
/// <summary>
/// Invoked when application execution is being suspended. Application state is saved
/// without knowing whether the application will be terminated or resumed with the contents
/// of memory still intact.
/// </summary>
/// <param name="sender">The source of the suspend request.</param>
/// <param name="e">Details about the suspend request.</param>
private void OnSuspending(object sender, SuspendingEventArgs e)
{
var deferral = e.SuspendingOperation.GetDeferral();
//TODO: Save application state and stop any background activity
deferral.Complete();
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

View file

@ -1,21 +0,0 @@
<Page
x:Class="UwpApplication.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:UwpApplication"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid>
<StackPanel x:Name="MainStackPanel">
<ListView x:Name="FilesListView">
<TextBlock>test 1</TextBlock>
<TextBlock>test 2</TextBlock>
<TextBlock>test 3</TextBlock>
<TextBlock>test 4</TextBlock>
</ListView>
</StackPanel>
</Grid>
</Page>

View file

@ -1,29 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("UwpApplication")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("UwpApplication")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: ComVisible(false)]

View file

@ -1,31 +0,0 @@
<!--
This file contains Runtime Directives used by .NET Native. The defaults here are suitable for most
developers. However, you can modify these parameters to modify the behavior of the .NET Native
optimizer.
Runtime Directives are documented at https://go.microsoft.com/fwlink/?LinkID=391919
To fully enable reflection for App1.MyClass and all of its public/private members
<Type Name="App1.MyClass" Dynamic="Required All"/>
To enable dynamic creation of the specific instantiation of AppClass<T> over System.Int32
<TypeInstantiation Name="App1.AppClass" Arguments="System.Int32" Activate="Required Public" />
Using the Namespace directive to apply reflection policy to all the types in a particular namespace
<Namespace Name="DataClasses.ViewModels" Serialize="All" />
-->
<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
<Application>
<!--
An Assembly element with Name="*Application*" applies to all assemblies in
the application package. The asterisks are not wildcards.
-->
<Assembly Name="*Application*" Dynamic="Required All" />
<!-- Add your application specific runtime directives here. -->
</Application>
</Directives>

View file

@ -1,177 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProjectGuid>{2E54D610-D16D-40BF-A7C7-2092BE262779}</ProjectGuid>
<OutputType>AppContainerExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>UwpApplication</RootNamespace>
<AssemblyName>UwpApplication</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.22000.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.16299.0</TargetPlatformMinVersion>
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WindowsXamlEnableOverview>true</WindowsXamlEnableOverview>
<AppxPackageSigningEnabled>false</AppxPackageSigningEnabled>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\ARM\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
<OutputPath>bin\ARM\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\ARM64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>ARM64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM64'">
<OutputPath>bin\ARM64\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>ARM64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup>
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
</PropertyGroup>
<ItemGroup>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
</Compile>
<Compile Include="MainPage.xaml.cs">
<DependentUpon>MainPage.xaml</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
</ItemGroup>
<ItemGroup>
<Content Include="Properties\Default.rd.xml" />
<Content Include="Assets\LockScreenLogo.scale-200.png" />
<Content Include="Assets\SplashScreen.scale-200.png" />
<Content Include="Assets\Square150x150Logo.scale-200.png" />
<Content Include="Assets\Square44x44Logo.scale-200.png" />
<Content Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
<Content Include="Assets\StoreLogo.png" />
<Content Include="Assets\Wide310x150Logo.scale-200.png" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Page Include="MainPage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
<Version>6.2.12</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Connected Services\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ImageCore\ImageCore.csproj">
<Project>{10ad7910-c8aa-43ed-9231-ebe267ac270f}</Project>
<Name>ImageCore</Name>
</ProjectReference>
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
<VisualStudioVersion>14.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View file

@ -0,0 +1,15 @@
<Application
x:Class="WindowsApplication.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:WindowsApplication">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
<!-- Other merged dictionaries here -->
</ResourceDictionary.MergedDictionaries>
<!-- Other app resources here -->
</ResourceDictionary>
</Application.Resources>
</Application>

View file

@ -0,0 +1,51 @@
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Navigation;
using Microsoft.UI.Xaml.Shapes;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.Foundation;
using Windows.Foundation.Collections;
// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.
namespace WindowsApplication
{
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
public partial class App : Application
{
/// <summary>
/// Initializes the singleton application object. This is the first line of authored code
/// executed, and as such is the logical equivalent of main() or WinMain().
/// </summary>
public App()
{
this.InitializeComponent();
}
/// <summary>
/// Invoked when the application is launched normally by the end user. Other entry points
/// will be used such as when the application is launched to open a specific file.
/// </summary>
/// <param name="args">Details about the launch request and process.</param>
protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args)
{
m_window = new MainWindow();
m_window.Activate();
}
private Window m_window;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 637 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 456 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

View file

@ -0,0 +1,18 @@
<Window
x:Class="WindowsApplication.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:WindowsApplication"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<StackPanel x:Name="MainStackPanel">
<Button x:Name="PickFilesButton" Click="PickFilesButton_Click">Pick Files</Button>
<TextBlock x:Name="NumberOfFiles" />
<!-- Files Viewer -->
<ListView x:Name="FilesListView"/>
</StackPanel>
</Window>

View file

@ -1,27 +1,34 @@
using System;
using Microsoft.UI.Xaml;
using System;
using System.Collections.Generic;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using System.Runtime.InteropServices;
// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.
namespace UwpApplication
namespace WindowsApplication
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// An empty window that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class MainPage : Page
public sealed partial class MainWindow : Window
{
public MainPage()
public MainWindow()
{
this.InitializeComponent();
Console.WriteLine("Main Page");
this.Loaded += LoadedHandler;
UpdateNumberOfFilesText(0);
}
private async void LoadedHandler(object sender, RoutedEventArgs e)
private async void PickFilesButton_Click(object sender, RoutedEventArgs e)
{
var folderPicker = new Windows.Storage.Pickers.FolderPicker();
// Get the current window's HWND by passing in the Window object
var hwnd = WinRT.Interop.WindowNative.GetWindowHandle(this);
// Associate the HWND with the file picker
WinRT.Interop.InitializeWithWindow.Initialize(folderPicker, hwnd);
folderPicker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.Desktop;
folderPicker.FileTypeFilter.Add("*");
@ -42,7 +49,13 @@ namespace UwpApplication
}
}
FilesListView.ItemsSource = fileNames;
UpdateNumberOfFilesText(fileNames.Count);
}
}
private void UpdateNumberOfFilesText(int nrOfFiles)
{
NumberOfFiles.Text = $"Total files {nrOfFiles}.";
}
}
}

View file

@ -2,25 +2,24 @@
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
IgnorableNamespaces="uap mp">
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
IgnorableNamespaces="uap rescap">
<Identity
Name="f7e99291-fef4-4fc9-ba25-3671f7b73426"
Name="89402d70-c7a0-48b0-8828-1943ec43355e"
Publisher="CN=nutiu"
Version="1.0.0.0" />
<mp:PhoneIdentity PhoneProductId="f7e99291-fef4-4fc9-ba25-3671f7b73426" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
<Properties>
<DisplayName>UwpApplication</DisplayName>
<DisplayName>WindowsApplication</DisplayName>
<PublisherDisplayName>nutiu</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
</Dependencies>
<Resources>
@ -30,20 +29,20 @@
<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="UwpApplication.App">
EntryPoint="$targetentrypoint$">
<uap:VisualElements
DisplayName="UwpApplication"
DisplayName="WindowsApplication"
Description="WindowsApplication"
BackgroundColor="transparent"
Square150x150Logo="Assets\Square150x150Logo.png"
Square44x44Logo="Assets\Square44x44Logo.png"
Description="UwpApplication"
BackgroundColor="transparent">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png"/>
Square44x44Logo="Assets\Square44x44Logo.png">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" />
<uap:SplashScreen Image="Assets\SplashScreen.png" />
</uap:VisualElements>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClient" />
<rescap:Capability Name="runFullTrust" />
</Capabilities>
</Package>

View file

@ -0,0 +1,10 @@
{
"profiles": {
"WindowsApplication (Package)": {
"commandName": "MsixPackage"
},
"WindowsApplication (Unpackaged)": {
"commandName": "Project"
}
}
}

View file

@ -0,0 +1,37 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<RootNamespace>WindowsApplication</RootNamespace>
<ApplicationManifest>app.manifest</ApplicationManifest>
<Platforms>x86;x64;arm64</Platforms>
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
<PublishProfile>win10-$(Platform).pubxml</PublishProfile>
<UseWinUI>true</UseWinUI>
<EnablePreviewMsixTooling>true</EnablePreviewMsixTooling>
</PropertyGroup>
<ItemGroup>
<Content Include="Assets\SplashScreen.scale-200.png" />
<Content Include="Assets\LockScreenLogo.scale-200.png" />
<Content Include="Assets\Square150x150Logo.scale-200.png" />
<Content Include="Assets\Square44x44Logo.scale-200.png" />
<Content Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
<Content Include="Assets\StoreLogo.png" />
<Content Include="Assets\Wide310x150Logo.scale-200.png" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.0.0" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22000.194" />
<Manifest Include="$(ApplicationManifest)" />
</ItemGroup>
<!-- Defining the "Msix" ProjectCapability here allows the Single-project MSIX Packaging
Tools extension to be activated for this project even if the Windows App SDK Nuget
package has not yet been restored -->
<ItemGroup Condition="'$(DisableMsixProjectCapabilityAddedByProject)'!='true' and '$(EnablePreviewMsixTooling)'=='true'">
<ProjectCapability Include="Msix"/>
</ItemGroup>
</Project>

View file

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="WindowsApplication.app"/>
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<!-- The combination of below two tags have the following effect:
1) Per-Monitor for >= Windows 10 Anniversary Update
2) System < Windows 10 Anniversary Update
-->
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/PM</dpiAware>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2, PerMonitor</dpiAwareness>
</windowsSettings>
</application>
</assembly>