Questions tagged [uwp]

The Universal Windows Platform is a common software platform for all devices running Windows 10, including Desktop. This tag should be used for questions regarding developing UWP applications on any of the supported device families. Other tags such as the languages being used (C#, C++, etc.) and the style of API (Win32, WinRT, etc.) can be added. Packaged Win32 Applications should use the Desktop-Bridge tag (possibly in addition to UWP).

Universal Windows Platform

Windows 10 introduced the Universal Windows Platform which was an evolution of the "modern" platform first introduced with Windows 8. UWP replaces the disparate legacy platforms and unifies all Windows devices (Desktop, Xbox, IoT, Surface Hub, HoloLens, etc.). UWP is the focus of all future Windows platform innovation at Microsoft - including on Desktop Windows - with many of the original differences between "UWP apps" and "Desktop Win32 apps" having been removed. UWP consists of Win32, COM, WinRT, and .NET APIs.

UWP introduced or refined several new technologies, many of which are now available to Win32 apps:

  • MSIX (nee AppX) packaging.
  • Declarative extensibility and integration points.
  • AppContainer-based security and privacy.
  • MRT resource packaging and resolution.
  • XAML-based UI, including modern input (touch, pen, and game controller).
  • WinRT platform APIs.
  • The Microsoft Store

MSIX enables the clean install, servicing, and uninstall of applications, including packaged Win32 applications. It enables apps to integrate with the Windows shell and cooperate with other apps via a declarative extension mechanism.

AppContainers run apps with a minimal set of permissions by default, ensuring they are isolated from each other and the system. AppContainers use an explicit permissions-based security model (known as "capabilities") to request additional access to resources like the network, the user's location, or a camera. Packaged Win32 apps do not typically run inside an AppContainer.

MRT is a unified resource management technology, allowing apps to specify resources across a diverse set of axis (language, scale-factor, accessibility, home region, etc.) with the most-applicable candidate being loaded automatically at runtime. MRT is available to Win32 applications.

XAML, the UI framework for UWP, uses a declarative XML dialect to define UI layout. It will be familiar to anyone who has used WPF or Silverlight, but XAML has been updated to better integrate with DirectX rendering and use modern inputs such as touch, pen, and game controller. It is also no longer limited to .NET languages (it is usable from C++) and it can be used from Win32 applications.

The runtime platform consists of a set of Windows Runtime (WinRT) APIs, a growing subset of COM & Win32 APIs, and a cross-platform set of .NET APIs. Most UWP APIs are available on all Windows devices, and most UWP APIs are available to Win32 or Packaged Win32 apps as well. Using the Desktop Extension SDK, Packaged Win32 apps can access virtually any existing Windows API or feature, but only work on Desktop Windows devices. Even if an application uses device-specific functionality, it can still run on other UWP devices if it avoids calling the specialized APIs when they are not available.

UWP apps (including Packaged Win32 apps) can be distributed via the Microsoft Store, but they can also be side-loaded onto most devices with traditional deployment mechanisms (enterprise deployment, web download, MSI-based installers, etc.). By default, all applications created with Visual Studio are able to run on all Windows 10 devices, but developers can restrict distribution in the Microsoft Store to one or more specific devices if they have a technical or business need to do so.

Resources

22264 questions
3
votes
0 answers

C# - UWP - HttpStatusCode enum NotFound turns into 0 after exiting a method

I have an HTTP call that returns 404 - NotFound from the server. In my code, when I get a status code that is not (200 - OK), I throw a custom exception like this: public class MyException : Exception { public HttpStatusCode HttpCode { get; set;…
Cristiano Ghersi
  • 1,944
  • 1
  • 20
  • 46
3
votes
2 answers

UWP: how to install side-loaded app when AppX Installer is not installed on the machine

I need to install a UWP app, side-loaded, onto a machine that does not have access to the Microsoft Store. This machine doesn't even have the AppX installer app, therefore I cannot install any of those files (that come in the installation package of…
Cristiano Ghersi
  • 1,944
  • 1
  • 20
  • 46
3
votes
1 answer

How to register a UWP app as share recipient for camera snapshot

In Windows 10, when I hit e.g. SHIFT + WIN + S I can take a screenshot of my screen. In other cases I have my webcam that can take a picture, and so on. All those scenarios have the feature to "Share" the captured image to another app, e.g. Mail,…
Cristiano Ghersi
  • 1,944
  • 1
  • 20
  • 46
3
votes
1 answer

UWP ListView selected item highlight disappears if ItemContainerStyle is set

I am using a ListView to display a list of items. But when I set the font of the items using ItemContainerStyle and now an item is selected, the ListView highlight (blue line on the left) is no longer visible. On this screenshot here is a…
Adrian
  • 35
  • 5
3
votes
0 answers

How can I upgrade Xamarin Forms UWP (older format: shared code in .shproj not .csproj) to C# version 8.0 or higher?

I have a Xamarin forms project with Uwp, and I'd like to know how to upgrade the C# version from 7.3 to 8.0+. I followed these links: How to use the latest C# version in Xamarin Forms projects https://montemagno.com/use-csharp-8-everywehre/ which…
jho
  • 199
  • 1
  • 8
3
votes
1 answer

Unable to validate UWP application for microsoft store

I have developed a UWP application via Xamarin Forms. I am able to sideload the release bundle. But when I am trying to publish or associate the app to the Microsoft Store. Getting the below error. Any suggestions or input would be really…
3
votes
1 answer

How can I add "related" tag/keyword to search from start menu for an UWP app

To search a windows app from start menu search or windows search we type the display name of an app. However, I wanted to add customized keyword/tags to search my UWP app from that search. For some searches we see windows app suggestions or related…
3
votes
2 answers

How to dynamically define Headers and Settings for UWP NavigationView's menu, using C++/winRT?

I'm working on a cross-platform project in C++ generating the UI dynamically, and I am struggling with C++/winRT UWP NavigationView on two problems: When defining a NavigationViewItemHeader, the resulting header title doesn't show in the navigation…
alphafox75
  • 71
  • 7
3
votes
1 answer

Using mongodb driver version 2.14.1 in UWP C# application

I am tring to upgrade mongodb driver used in an UWP C# application (completly writen in C#, build for x86, x64, arm and arm64). The last driver version that worked was 2.10.4. Any driver version above that compiled and was running just fine, but…
ventura8
  • 554
  • 6
  • 18
3
votes
0 answers

Add push notifications to an MFC project packaged with the desktop-bridge

I have a traditional Win32 desktop app written in C++/MFC that I have packaged as a UWP app for the Microsoft store using the desktop-bridge facility in Visual Studio 2019. The VS solution thus contains 2 relevant projects - the main program, which…
Bill Heitler
  • 187
  • 3
  • 13
3
votes
1 answer

WinUI 3 UWP - Dialog

I am develop a new app for Windows 11 in WinUI3 UWP, and I want show a dialog to provide a safe action like in this example of Microsoft Docs: https://learn.microsoft.com/en-us/windows/apps/design/controls/dialogs-and-flyouts/dialogs private async…
Luís
  • 157
  • 2
  • 10
3
votes
1 answer

How to determine if my library is running from WinUI3 Win32 app?

My library should have different behaviour depending on app platform. As I know, I can determine that app is UWP-application using this code. But it returns true even for WinUI3 Win32 app. As there any way to determine that app is WinUI3 Win32 app…
okolobaxa
  • 338
  • 1
  • 4
  • 16
3
votes
0 answers

UWP and azure-pipelines: Error CS1617: Invalid option '10' for /langversion

I have an UWP app and changed 10 inside .csproj to value 10. Everything works just fine (to my surprise). But when I tried to build the app inside azure-pipelines it throws this error: ##[error]CSC(0,0): Error CS1617:…
Alamakanambra
  • 5,845
  • 3
  • 36
  • 43
3
votes
0 answers

.NET MAUI Essentials Authenticator error in UWP missing AppManifest.xml

i'm trying to implement authentication with Essentials API in a .NET MAUI project async Task OnAuthenticate(string scheme) { try { WebAuthenticatorResult r = null; if (scheme.Equals("Apple") …
3
votes
1 answer

UWP Cannot open an external window after changing visibility of an inner element

I have a UWP app written in C#, where I need to open a second window. Inside this second window, there is an element that I need to toggle the visibility of (in some cases). Please find an MVCE here:…
Cristiano Ghersi
  • 1,944
  • 1
  • 20
  • 46
1 2 3
99
100