Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ publish/
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
#*.pubxml
*.publishproj

# Microsoft Azure Web App publish settings. Comment the next line if you want to
Expand Down
14 changes: 8 additions & 6 deletions DesktopWindowDemo/DesktopWindowDemo.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<WindowsSdkPackageVersion>10.0.19041.38</WindowsSdkPackageVersion>
<RootNamespace>DesktopWindowDemo</RootNamespace>
<ApplicationManifest>app.manifest</ApplicationManifest>
<Platforms>x86;x64;arm64</Platforms>
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
<PublishProfile>win10-$(Platform).pubxml</PublishProfile>
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
<PublishProfile>Properties\PublishProfiles\win-$(Platform).pubxml</PublishProfile>
<UseWinUI>true</UseWinUI>
<EnablePreviewMsixTooling>true</EnablePreviewMsixTooling>
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
<!--Set <WindowsPackageType>None</WindowsPackageType> in your project file. In advanced scenarios, if you want control over the initialization, you can call the bootstrapper API directly in your app's startup code-->
<!--<WindowsPackageType>None</WindowsPackageType>-->
</PropertyGroup>
<ItemGroup>
<None Remove="Assets\WinUI3.ico" />
Expand All @@ -26,8 +30,6 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.0.3" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22000.197" />
<Manifest Include="$(ApplicationManifest)" />
</ItemGroup>

Expand Down
78 changes: 39 additions & 39 deletions DesktopWindowDemo/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,46 +5,46 @@
xmlns:local="using:DesktopWindowDemo"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:WinUI="using:WinUIExtensions.Desktop"
xmlns:WinUI="using:WinUIExtensions.Desktop"
mc:Ignorable="d">


<StackPanel x:Name="MainGrid">

<!-- Uncomment it for using Custom Title Bar APIs-->
<!--<StackPanel Height="35" Orientation="Horizontal"
<Window.SystemBackdrop>
<MicaBackdrop/>
</Window.SystemBackdrop>
<Grid x:Name="MainGrid">
<ScrollViewer>
<!-- Uncomment it for using Custom Title Bar APIs-->
<!--<StackPanel Height="35" Orientation="Horizontal"
Spacing="15" x:Name="myTitleBar" HorizontalAlignment="Stretch" VerticalAlignment="Top" >
<Image Source="Assets/windowIcon.gif" />
<TextBlock VerticalAlignment="Center" Text="{x:Bind Title, Mode=OneTime}" />
</StackPanel>-->

<StackPanel Margin="20" VerticalAlignment="Center" HorizontalAlignment="Left" Spacing="20"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<TextBlock Text="Window Placement" />
<StackPanel Orientation="Horizontal" Spacing="20" Margin="20,0">
<Button Content="Center" Click="OnCenterClick" HorizontalAlignment="Center" />
<Button Content="TopLeft" Click="OnTopLeft" HorizontalAlignment="Center" />
<Button Content="BottomLeft" Click="OnBottomLeft" HorizontalAlignment="Center" />
</StackPanel>

<TextBlock Text="Window State" />
<StackPanel Orientation="Horizontal" Spacing="20" Margin="20,0">
<Button Content="Maximize" Click="OnMaximize" HorizontalAlignment="Center" />
<Button Content="Minimize" Click="OnMinimize" HorizontalAlignment="Center" />
<Button Content="Restore" Click="OnRestore" HorizontalAlignment="Center" />
<Button Content="BringToTop" Click="OnBringToTop" HorizontalAlignment="Center" />
</StackPanel>

<TextBlock Text="Closing Application" />
<StackPanel Orientation="Horizontal" Spacing="20" Margin="20,0">
<Button Content="Close Application" Click="OnClosingApplication" HorizontalAlignment="Center" />
<Image Source="Assets/windowIcon.gif" />
<TextBlock VerticalAlignment="Center" Text="{x:Bind Title, Mode=OneTime}" />
</StackPanel>-->
<StackPanel Margin="20" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Spacing="20"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<TextBlock Text="Window Placement" />
<StackPanel Orientation="Horizontal" Spacing="20" Margin="20,0">
<Button Content="Center" Click="OnCenterClick" HorizontalAlignment="Center" />
<Button Content="TopLeft" Click="OnTopLeft" HorizontalAlignment="Center" />
<Button Content="BottomLeft" Click="OnBottomLeft" HorizontalAlignment="Center" />
</StackPanel>

<TextBlock Text="Window State" />
<StackPanel Orientation="Horizontal" Spacing="20" Margin="20,0">
<Button Content="Maximize" Click="OnMaximize" HorizontalAlignment="Center" />
<Button Content="Minimize" Click="OnMinimize" HorizontalAlignment="Center" />
<Button Content="Restore" Click="OnRestore" HorizontalAlignment="Center" />
<Button Content="BringToTop" Click="OnBringToTop" HorizontalAlignment="Center" />
</StackPanel>

<TextBlock Text="Closing Application" />
<StackPanel Orientation="Horizontal" Spacing="20" Margin="20,0">
<Button Content="Close Application" Click="OnClosingApplication" HorizontalAlignment="Center" />
</StackPanel>

<TextBlock Text="" x:Name="debugTBox" TextWrapping="WrapWholeWords"/>
<TextBlock Text="" x:Name="systemTBox" TextWrapping="WrapWholeWords"/>
<TextBlock Text="" x:Name="dpiChangedTBox" TextWrapping="WrapWholeWords"/>
<TextBlock Text="" x:Name="preferredLanguageTBox" TextWrapping="WrapWholeWords"/>
</StackPanel>

<TextBlock Text="" x:Name="debugTBox" TextWrapping="WrapWholeWords"/>
<TextBlock Text="" x:Name="systemTBox" TextWrapping="WrapWholeWords"/>
<TextBlock Text="" x:Name="dpiChangedTBox" TextWrapping="WrapWholeWords"/>
<TextBlock Text="" x:Name="preferredLanguageTBox" TextWrapping="WrapWholeWords"/>
</StackPanel>
</StackPanel>
</ScrollViewer>
</Grid>
</WinUI:DesktopWindow>

2 changes: 1 addition & 1 deletion DesktopWindowDemo/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public MainWindow()
this.InitializeComponent();
// MUX.Window features
this.Title = "Showcase DesktopWindow API";
//this.ExtendsContentIntoTitleBar = true;
this.ExtendsContentIntoTitleBar = true;
//SetTitleBar(myTitleBar);

//DesktopWindow Features
Expand Down
13 changes: 13 additions & 0 deletions DesktopWindowDemo/Properties/PublishProfiles/win-arm64.pubxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishProtocol>FileSystem</PublishProtocol>
<Platform>arm64</Platform>
<RuntimeIdentifier>win-arm64</RuntimeIdentifier>
<PublishDir>bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\</PublishDir>
<SelfContained>True</SelfContained>
<PublishSingleFile>False</PublishSingleFile>
<PublishReadyToRun Condition="'$(Configuration)' == 'Debug'">False</PublishReadyToRun>
<PublishReadyToRun Condition="'$(Configuration)' != 'Debug'">True</PublishReadyToRun>
</PropertyGroup>
</Project>
13 changes: 13 additions & 0 deletions DesktopWindowDemo/Properties/PublishProfiles/win-x64.pubxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishProtocol>FileSystem</PublishProtocol>
<Platform>x64</Platform>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<PublishDir>bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\</PublishDir>
<SelfContained>True</SelfContained>
<PublishSingleFile>False</PublishSingleFile>
<PublishReadyToRun Condition="'$(Configuration)' == 'Debug'">False</PublishReadyToRun>
<PublishReadyToRun Condition="'$(Configuration)' != 'Debug'">True</PublishReadyToRun>
</PropertyGroup>
</Project>
13 changes: 13 additions & 0 deletions DesktopWindowDemo/Properties/PublishProfiles/win-x86.pubxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishProtocol>FileSystem</PublishProtocol>
<Platform>x86</Platform>
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
<PublishDir>bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\</PublishDir>
<SelfContained>True</SelfContained>
<PublishSingleFile>False</PublishSingleFile>
<PublishReadyToRun Condition="'$(Configuration)' == 'Debug'">False</PublishReadyToRun>
<PublishReadyToRun Condition="'$(Configuration)' != 'Debug'">True</PublishReadyToRun>
</PropertyGroup>
</Project>
4 changes: 2 additions & 2 deletions DesktopWindowSample.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.2.32414.248
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WindowExtensions", "WindowExtensions\WindowExtensions.csproj", "{6FB3A02C-2E51-446D-A1D6-82BA9DCC7C53}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DesktopWindowDemo", "DesktopWindowDemo\DesktopWindowDemo.csproj", "{06336E8A-1942-4F75-A8B0-6720786EA45E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WindowExtensions", "WindowExtensions\WindowExtensions.csproj", "{6FB3A02C-2E51-446D-A1D6-82BA9DCC7C53}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Desktop Window
This is just a sample of a .NET 5 APIs that extend the Microsoft.UI.Xaml.Window of WinUI 3 in Reunion 0.5
This is just a sample of a .NET 8 APIs that extend the Microsoft.UI.Xaml.Window of WinUI 3 in Microsoft.WindowsAppSDK 1.x

> This code is AS IS. It's just for demo proposals

## Screenshot
![DesktopWindowDemo](https://github.com/mcka-dev/DesktopWindow.WinUI/blob/master/Screenshots/DesktopWindowDemo.png?raw=true)

XAML code snippet:
```XML
Expand Down
Binary file added Screenshots/DesktopWindowDemo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 9 additions & 9 deletions WindowExtensions/WindowExtensions.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<WindowsSdkPackageVersion>10.0.19041.38</WindowsSdkPackageVersion>
<RootNamespace>WindowExtensions</RootNamespace>
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
<UseWinUI>true</UseWinUI>
</PropertyGroup>

Expand All @@ -12,16 +13,15 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.0.3" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22000.197" />
<PackageReference Include="PInvoke.SHCore" Version="0.7.104" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.240923002" />
<PackageReference Include="PInvoke.SHCore" Version="0.7.124" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="PInvoke.User32" Version="0.7.104" />
<PackageReference Include="PInvoke.Kernel32" Version="0.7.104" />
<PackageReference Include="PInvoke.Win32" Version="0.7.104" />
<PackageReference Include="Vanara.PInvoke.User32" Version="3.4.0" />
<PackageReference Include="PInvoke.User32" Version="0.7.124" />
<PackageReference Include="PInvoke.Kernel32" Version="0.7.124" />
<PackageReference Include="PInvoke.Win32" Version="0.7.124" />
<PackageReference Include="Vanara.PInvoke.User32" Version="4.0.4" />
</ItemGroup>

</Project>