Code Monkey home page Code Monkey logo

winui-3-demos's Introduction

page_type languages products description urlFragment
sample
csharp
cpp
dotnet
WinUI
These are some samples to demonstrate the usage of WinUI 3
update-this-to-unique-url-stub

Official Microsoft Sample

Prerequisites

Configure your development environment following up the instructions at Windows App SDK v1.0

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

winui-3-demos's People

Contributors

microsoftopensource avatar realtommyklein avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

winui-3-demos's Issues

nuget references

where are the nuget packages coming from ? they don't get pulled in my solution.

MakePri error

Hello,

i'm having an error during debug x64 compilation with Visual Studio 2022 and WindowsAppSDK 1.0.
This is the error from the output:
1>------ Build started: Project: ContosoAirlinePOSCpp (Package), Configuration: Debug x64 ------
1>DUMPPRIFILETODETAILEDXML : error : PRI175: 0x80070003 - Dump
1>DUMPPRIFILETODETAILEDXML : error : PRI175: 0x80070003 - MakePri failed with error: impossible to find path specified.
1>DUMPPRIFILETODETAILEDXML : error : PRI222: 0x80070003 - Unspecified error occurred.
1>Done building project "ContosoAirlinePOSCpp (Package).wapproj" -- FAILED.

Can you help me?

ContosoAirlinePOSCpp Application does not start

I have few issues with the ContosoAirlinePOSCpp sample:

  • I was not able to compile because I could not found SDL2_image.lib to link. SDL2 libs are missing from this repo in the ContosoAirlinePOS\ContosoAirlinePOSCpp\ContosoSeatBooking\SDL2-devel-2.0.12-VC\SDL2-2.0.12 folder. I downloaded SDL2 libs from SDL2 website, but SDL2_image.lib does not exist.
  • I commented out the IMG_Init calls and I was able to compile
  • when starting, the application crashes at line 260 of winrt\Microsoft.UI.Xaml.h.
    This is the call stack and this is the log output log.txt
>	ContosoAirlinePOSCpp_x64d.exe!winrt::impl::consume_Microsoft_UI_Xaml_IApplicationStatics<winrt::Microsoft::UI::Xaml::IApplicationStatics>::Start(const winrt::Microsoft::UI::Xaml::ApplicationInitializationCallback & callback) Line 260	C++
 	ContosoAirlinePOSCpp_x64d.exe!winrt::Microsoft::UI::Xaml::Application::Start::__l2::<lambda>(const winrt::Microsoft::UI::Xaml::IApplicationStatics & f) Line 12900	C++
 	ContosoAirlinePOSCpp_x64d.exe!winrt::impl::factory_cache_entry<winrt::Microsoft::UI::Xaml::Application,winrt::Microsoft::UI::Xaml::IApplicationStatics>::call<void <lambda>(const winrt::Microsoft::UI::Xaml::IApplicationStatics &) &>(winrt::Microsoft::UI::Xaml::Application::Start::__l2::void <lambda>(const winrt::Microsoft::UI::Xaml::IApplicationStatics &) & callback) Line 6084	C++
 	ContosoAirlinePOSCpp_x64d.exe!winrt::impl::call_factory<winrt::Microsoft::UI::Xaml::Application,winrt::Microsoft::UI::Xaml::IApplicationStatics,void <lambda>(const winrt::Microsoft::UI::Xaml::IApplicationStatics &)>(winrt::Microsoft::UI::Xaml::Application::Start::__l2::void <lambda>(const winrt::Microsoft::UI::Xaml::IApplicationStatics &) && callback) Line 6107	C++
 	ContosoAirlinePOSCpp_x64d.exe!winrt::Microsoft::UI::Xaml::Application::Start(const winrt::Microsoft::UI::Xaml::ApplicationInitializationCallback & callback) Line 12901	C++

The DemoBuildCpp project has the same error.
I am able to run an app created with the Blank App, Packaged (WinUI in Desktop) C++ template, installed with the WinUI.ProjectTemplates.vsix
I am using VS2019 16.9.0 Preview 4.0 and Windows10 Pro 21H1 Build 19043.844

Changing PC to a VS2019 16.10.0 Preview 1.0 and Windows10 LTSC 1809 Build 17763.1817 now I get the error:
WinRT originate error - 0x80004005 : 'Cannot locate resource from 'ms-appx:///Microsoft.UI.Xaml/Themes/themeresources.xaml'.'.
with this call stack

>	ContosoAirlinePOSCpp.exe!winrt::Windows::Foundation::IActivationFactory::ActivateInstance<winrt::Microsoft::UI::Xaml::Controls::XamlControlsResources>() Line 6236	C++
 	ContosoAirlinePOSCpp.exe!winrt::Microsoft::UI::Xaml::Controls::XamlControlsResources::<lambda>(const winrt::Windows::Foundation::IActivationFactory & f) Line 69080	C++
 	ContosoAirlinePOSCpp.exe!winrt::Microsoft::UI::Xaml::Controls::XamlControlsResources <lambda>(const winrt::Windows::Foundation::IActivationFactory &)::<lambda_invoker_cdecl>(const winrt::Windows::Foundation::IActivationFactory & f) Line 69080	C++
 	ContosoAirlinePOSCpp.exe!winrt::impl::factory_cache_entry<winrt::Microsoft::UI::Xaml::Controls::XamlControlsResources,winrt::Windows::Foundation::IActivationFactory>::call<winrt::Microsoft::UI::Xaml::Controls::XamlControlsResources (__cdecl*)(winrt::Windows::Foundation::IActivationFactory const &)>(winrt::Microsoft::UI::Xaml::Controls::XamlControlsResources(*)(const winrt::Windows::Foundation::IActivationFactory &) && callback) Line 6084	C++
 	ContosoAirlinePOSCpp.exe!winrt::impl::call_factory_cast<winrt::Microsoft::UI::Xaml::Controls::XamlControlsResources (__cdecl*)(winrt::Windows::Foundation::IActivationFactory const &),winrt::Microsoft::UI::Xaml::Controls::XamlControlsResources,winrt::Windows::Foundation::IActivationFactory,winrt::Microsoft::UI::Xaml::Controls::XamlControlsResources <lambda>(const winrt::Windows::Foundation::IActivationFactory &)>(winrt::Microsoft::UI::Xaml::Controls::XamlControlsResources::winrt::Microsoft::UI::Xaml::Controls::XamlControlsResources <lambda>(const winrt::Windows::Foundation::IActivationFactory &) && callback) Line 6123	C++
 	ContosoAirlinePOSCpp.exe!winrt::Microsoft::UI::Xaml::Controls::XamlControlsResources::XamlControlsResources() Line 69082	C++
 	[External Code]	
 	ContosoAirlinePOSCpp.exe!winrt::impl::produce<winrt::ContosoAirlinePOSCpp::implementation::XamlUserType,winrt::Microsoft::UI::Xaml::Markup::IXamlType>::ActivateInstance(void * * result) Line 1003	C++
 	[External Code]	
 	ContosoAirlinePOSCpp.exe!winrt::impl::consume_Microsoft_UI_Xaml_IApplicationStatics<winrt::Microsoft::UI::Xaml::IApplicationStatics>::Start(const winrt::Microsoft::UI::Xaml::ApplicationInitializationCallback & callback) Line 260	C++

Instead the DemoBuildCpp project starts.

SortingItemsWinUI3Demo Exception and Strange Windowing Behavior

Describe the bug

When running on Version 1809 / Debug x64, SortingItemsWinUI3Demo throws an exception - see screenshot below. In addition to the exception, I will get strange windowing behavior afterwards when I try to view/maximize any windows I currently have open, they will not appear or maximize. To alleviate this, I have been forced to lock/log out/restart my computer.

Steps to reproduce the bug

  1. Open the SortingItemsWinUI3Demo in Visual Studio 2019.
  2. Update the Targeting versions appropriately to match system's.
    In my case, I updated them to:
    Target version: Windows 10, version 1809 (10.0; Build 17763)
    Min version: Windows 10, version 1803 (10.0; Build 17134)
  3. Build and run with Debug x64.

Screenshots

image

image

Version Info

NuGet package version:

[PInvoke.User32 0.7.78]
[Microsoft.WinUI 3.0.0-preview4.210210.4]

Targeting:
Target: Universal Windows
Target version: Windows 10, version 1809 (10.0; Build 17763)
Min version: Windows 10, version 1803 (10.0; Build 17134)

Windows 10 version Saw the problem?
Insider Build (xxxxx)
May 2020 Update (19041)
November 2019 Update (18363)
May 2019 Update (18362)
October 2018 Update (17763) Yes
April 2018 Update (17134)
Fall Creators Update (16299)
Creators Update (15063)
Device form factor Saw the problem?
Desktop Yes
Xbox
Surface Hub
IoT

Additional context

Proposal: use Win2D instead of SDL in ContosoAirlinePOS

Using Win2D instead of the current SDL-based approach for the seat selection functionality would be a nice improvement to have.

Pros:

  • Shows further integration of WinUI with other modern Windows APIs.
  • Makes the seat selection flow available in the C# version of the app.

Cons:

  • The current approach shows the integration of WinUI with native libraries, which is a useful use case too.

Related issue: microsoft/Win2D#707

Application failure after login

Gets "System.InvalidCastException: 'Specified cast is not valid.'" after pressing the login button.

it seems like the problem is in the BookFlightPage.xaml in the CalendarDatePicker contorl.
Binding to DateTimeOffset pops up this error.

Provide SDL binaries for the C++ example or add further instructions

The folder
https://github.com/microsoft/WinUI-3-Demos/tree/master/src/ContosoAirlinePOS/ContosoAirlinePOSCpp/ContosoSeatBooking/SDL2-devel-2.0.12-VC/SDL2-2.0.12
only contains the header files, but not the (x64) binaries (for SDL + SDL image) to be able to build the C++ example.
So I would propose to either add the binaries/ use the SDL nuget package for them or add build instructions that those binaries have to be downloaded and put there.

DemoBuildCs Crashes After “Select Folder” Clicked

Bug

I have followed the README instructions, built the code, and ran the application (Debug x64). However, once I click “Select Folder” in the file picker, the application crashes.

Note: I have tried to select on different folders locally with the same result. Also, I was able to get the DemoBuildCpp to run and work!

Error Message

AsyncCausalityTracer : System.InvalidCastException: Unable to cast object of type 'WinRT.IInspectable' to type 'Windows.Foundation.Diagnostics.IAsyncCausalityTracerStatics'.
at System.Threading.Tasks.AsyncCausalityTracer..cctor()
The thread 0x17494 has exited with code 0 (0x0).
Exception thrown at 0x00007FFC8017C330 (coreclr.dll) in DemoBuildCs.exe: 0xC0000005: Access violation reading location 0x0000000000000010.
The Common Language Runtime cannot stop at this exception. Common causes include: incorrect COM interop marshalling and memory corruption. To investigate further use native-only debugging.

Version Info

NuGet package version:
My installed packages are
[Microsoft.VCRTForwarders.140 v1.0.6]
[Microsoft.WinUI 3.0.0-preview1.200515.3]

Windows version: Version 1809 (OS Build 17763.1158)
Device: Desktop

Not working with AppSDK 1.0

According to the Prerequisites in the ReadMe Version 1.0 of the AppSDK is required (and properly installed on my machine). However, the current master (including Demo for Build 2020) requires AppSDK 1.1.0-preview3. When I accept the "install dialog" of this version only a browser opens where I can download several different versions.

Although this is probably only a small problem, it is unfortunately something I experience with nearly all stuff around WinUI3. So far I wasn't able to use one example or tutorial from Microsoft without some kind of "small fix" (which usually costs me between 1 hour and some days).

It would be really great to have something that is just working. Sorry if this Issue sounds "a little" frustrated.

Button text in "Dark theme" not visible

Thank you for your excellent code, it is very helpful for learning how to using winui sdk.
Now i found a issue: in solution Build2020Demo\DemoBuildCs\DemoBuildCs.sln, the Close Button in ContentDialog under dark theme is not visible. The button border and button text are all black. It makes the button invisible. can you fix that? thank you.

Application crashes with System.MissingMethodException

I have tried .NET 5 Preview 5 and Preview 7) I am using Visual Studio 16.7 Preview 5 and having the following problem with the DemobuildCs application.
I keep getting the exception:-
System.MissingMethodException: 'Method not found: 'Void System.Runtime.InteropServices.ComWrappers.RegisterAsGlobalInstance()'.'

I saw that there might be a problem with Preview 7 which is why I downgraded to Preview 5 but still have the same problem.

StackOverflowException with SelectedFlyingClass and SelectedStopPreference

I'm getting a StackOverflowException when I try to toggle the SelectedItem of the ItemSource for Class and Stops. Is that a WinUI3 Preview3 known issue?

image

System.StackOverflowException
HResult=0x800703E9

Exception thrown at 0x00007FFE9EB93908 (coreclr.dll) in ContosoAirlinePOSCs.exe: 0xC00000FD: Stack overflow (parameters: 0x0000000000000001, 0x00000022F4C05000).
The Common Language Runtime cannot stop at this exception. Common causes include: incorrect COM interop marshalling and memory corruption. To investigate further use native-only debugging.
An unhandled exception of type 'System.StackOverflowException' occurred in WinRT.Runtime.dll

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.