Skip to content

Commit 72008e3

Browse files
drag behavior sample
1 parent bf74046 commit 72008e3

17 files changed

+317
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<Application
2+
x:Class="BehaviorSample.App"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:local="using:BehaviorSample">
6+
<Application.Resources>
7+
<ResourceDictionary>
8+
<ResourceDictionary.MergedDictionaries>
9+
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
10+
<!-- Other merged dictionaries here -->
11+
</ResourceDictionary.MergedDictionaries>
12+
<!-- Other app resources here -->
13+
</ResourceDictionary>
14+
</Application.Resources>
15+
</Application>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
using Microsoft.UI.Xaml;
2+
3+
// To learn more about WinUI, the WinUI project structure,
4+
// and more about our project templates, see: http://aka.ms/winui-project-info.
5+
6+
namespace BehaviorSample;
7+
8+
/// <summary>
9+
/// Provides application-specific behavior to supplement the default Application class.
10+
/// </summary>
11+
public partial class App : Application
12+
{
13+
/// <summary>
14+
/// Initializes the singleton application object. This is the first line of authored code
15+
/// executed, and as such is the logical equivalent of main() or WinMain().
16+
/// </summary>
17+
public App() => InitializeComponent();
18+
19+
/// <summary>
20+
/// Invoked when the application is launched normally by the end user. Other entry points
21+
/// will be used such as when the application is launched to open a specific file.
22+
/// </summary>
23+
/// <param name="args">Details about the launch request and process.</param>
24+
protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args)
25+
{
26+
m_window = new MainWindow();
27+
m_window.Activate();
28+
}
29+
30+
private Window? m_window;
31+
}
432 Bytes
Loading
5.25 KB
Loading
1.71 KB
Loading
637 Bytes
Loading
283 Bytes
Loading
456 Bytes
Loading
2.05 KB
Loading
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<OutputType>WinExe</OutputType>
4+
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
5+
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
6+
<RootNamespace>BehaviorSample</RootNamespace>
7+
<ApplicationManifest>app.manifest</ApplicationManifest>
8+
<Platforms>x86;x64;arm64</Platforms>
9+
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
10+
<PublishProfile>win10-$(Platform).pubxml</PublishProfile>
11+
<UseWinUI>true</UseWinUI>
12+
<ImplicitUsings>enable</ImplicitUsings>
13+
<Nullable>enable</Nullable>
14+
<EnableMsixTooling>true</EnableMsixTooling>
15+
</PropertyGroup>
16+
17+
<ItemGroup>
18+
<Content Include="Assets\SplashScreen.scale-200.png" />
19+
<Content Include="Assets\LockScreenLogo.scale-200.png" />
20+
<Content Include="Assets\Square150x150Logo.scale-200.png" />
21+
<Content Include="Assets\Square44x44Logo.scale-200.png" />
22+
<Content Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
23+
<Content Include="Assets\StoreLogo.png" />
24+
<Content Include="Assets\Wide310x150Logo.scale-200.png" />
25+
</ItemGroup>
26+
27+
<ItemGroup>
28+
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.1.0" />
29+
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22000.194" />
30+
<PackageReference Include="Microsoft.Xaml.Behaviors.WinUI.Managed" Version="2.0.8" />
31+
<Manifest Include="$(ApplicationManifest)" />
32+
</ItemGroup>
33+
34+
<!--
35+
Defining the "Msix" ProjectCapability here allows the Single-project MSIX Packaging
36+
Tools extension to be activated for this project even if the Windows App SDK Nuget
37+
package has not yet been restored.
38+
-->
39+
<ItemGroup Condition="'$(DisableMsixProjectCapabilityAddedByProject)'!='true' and '$(EnableMsixTooling)'=='true'">
40+
<ProjectCapability Include="Msix" />
41+
</ItemGroup>
42+
43+
<!--
44+
Defining the "HasPackageAndPublishMenuAddedByProject" property here allows the Solution
45+
Explorer "Package and Publish" context menu entry to be enabled for this project even if
46+
the Windows App SDK Nuget package has not yet been restored.
47+
-->
48+
<PropertyGroup Condition="'$(DisableHasPackageAndPublishMenuAddedByProject)'!='true' and '$(EnableMsixTooling)'=='true'">
49+
<HasPackageAndPublishMenu>true</HasPackageAndPublishMenu>
50+
</PropertyGroup>
51+
</Project>

0 commit comments

Comments
 (0)