Quantcast
Channel: Building Apps for Windows
Viewing all 623 articles
Browse latest View live

Announcing Microsoft Build Tour 2017

$
0
0

Figure 1 Sign-up at http://buildtour.microsoft.com

On the heels of the Build conferences these last few years, we have had the pleasure of meeting thousands of developers around the world. Their feedback and technical insight has helped us to continue the tradition and explore more technical depth.

Today, I’m excited to announce the Microsoft Build Tour 2017, coming to cities around the globe this June! The Microsoft Build Tour is an excellent way to experience Microsoft Build news first-hand, and also work directly with Microsoft teams from Redmond and your local area.

This year, we’re bringing the Microsoft Build Tour to these locations:

Dates

City

June 5-6 Shanghai, China
June 8-9 Beijing, China
June 12 Munich, Germany *
June 13-14 Seoul, Republic of Korea
June 14-15 Helsinki, Finland
June 19-20 Warsaw, Poland
June 21-22 Hyderabad, India
June 29-30 Sydney, Australia

The Microsoft Build Tour is for all developers using Microsoft platform and tools. We will cover a breadth of topics across Windows, Cloud, AI, and cross-platform development. We will look at the latest news around .NET, web apps, the Universal Windows Platform, Win32 apps, Mixed Reality, Visual Studio, Xamarin, Microsoft Azure, Cognitive services, and much more.

We also want to go deeper into code, so this year we’re bringing the tour as a two-day* event. You can decide to attend just the sessions on the first day, or sign-up for a deep (and fun!) hands-on experience on the second day.

  • Day 1: Full day of fast-paced, demo-driven sessions, focusing primarily on new technology that you can start using immediately in your projects, with a bit of forward-looking awesomeness for inspiration.
  • Day 2: Full day hackathon where you’ll use the latest technologies to build a fun client, cloud and mobile solution that meet the requirements of a business case given at the beginning of the day. Seating is limited for Day 2, so be sure to register soon!

In most locations, on both days, we’ll also have a Mixed Reality experience booth where you’ll be able to sign up for scheduled hands-on time with Microsoft HoloLens and our latest Windows Mixed Reality devices.

To learn more and register, visit http://buildtour.microsoft.com. Can’t make it in person? Select cities will be live-streamed regionally to give you a chance to view the sessions and participate in the Q&A.

We can’t wait to see you on the tour!

*Munich is a single day, session-focused event.

The post Announcing Microsoft Build Tour 2017 appeared first on Building Apps for Windows.


Introducing XAML Standard and .NET Standard 2.0

$
0
0

XAML Standard

We are pleased to announce XAML Standard, which is a standards-based effort to unify XAML dialects across XAML based technologies such as UWP and Xamarin.Forms.

XAML Standard is a specification that defines a standard XAML vocabulary. With that vocabulary, frameworks that support XAML Standard can share common XAML-based UI definitions. The goal is for the first version, XAML Standard 1.0, to be available later this year.

Post-specification plans include support of XAML standard in Xamarin.Forms and UWP. You can continue developing your UWP and Xamarin.Forms apps as you do today. When XAML Standard support is enabled, you will be able to reuse and share between the frameworks and expand into more platforms.

To visualize what this support would look like, here’s a side-by-side comparison between today’s XAML in Xamarin.Forms and in UWP:

In the above example – once XAML Standard is supported by Xamarin.Forms, you can use <TextBlock /> and have it supported in a Xamarin.Forms app targeting iOS and Android instead of needing to know and use <Label /> as shown above. In addition to a TextBlock, here are some of the currently proposed items for standardization.

We are at the beginning of a journey that makes it easy for you to reuse your XAML source files between some simple Xamarin.Forms and UWP views. For example – a Settings.xaml page, where you typically have some text, toggle switches and some buttons. You’d only need to design and create one XAML file to describe this UI and that can be used everywhere.

Nothing changes for existing developers – you can continue to use the same APIs you have always used in both frameworks. XAML Standard will help you reuse/share any common UI code that you wish to share between end points.

The XAML Standard v1 draft spec is being defined in the open, we encourage you to start a discussion or give us direct feedback in the GitHub repo here.

.NET Standard 2.0

We are also happy to announce .NET Standard 2.0! .NET Standard is the set of APIs which work in all .NET implementations. A good way to think about it is how HTML5 is today. There are many different browsers which implement HTML parsing and rendering, but the HTML standard is the common glue that holds the web together and allows for interoperability.

.NET Standard was introduced in June of 2016 to bring consistency to the .NET ecosystem. With the .NET Framework, Xamarin & Mono, .NET Core and then UWP, there were many different implementations of .NET and it was very difficult to write code or a library that could work across all of them. Using .NET Standard, and the tooling in Visual Studio, makes it possible to build libraries and NuGet packages that work literally everywhere .NET runs.

The feedback we received on after .NET Standard’s introduction last year was generally phrased as “We like the direction you’re going in, but the set of APIs isn’t large enough to be useful.” The goal with .NET Standard 2.0 is to respond to that feedback and add a large set of .NET’s “greatest hits” into .NET Standard. To do this, we looked at the intersection of APIs between the .NET Framework and Mono. This lead to the 2.0 definition including over 20,000 new APIs and those APIs enable the top 70% of existing NuGet packages to work.

With the addition of .NET Standard 2.0 support for UWP with the Fall Creators Update, .NET developers will be able to share code across all Windows 10 devices, in the cloud and through the rest of the .NET ecosystem. This will also make it easier to reuse existing WinForms and WPF code as many of the most frequently used APIs like DataSet/DataTable, and popularly requested APIs like SqlClient, are now part of .NET Standard 2.0.

You can learn more about .NET Standard here.

Forming the shape of the future

We invite you, the .NET community, to join the discussion and help shape the future of XAML Standard and .NET Standard. You can provide your feedback, both suggestions and issues, at the following locations; .NET Standard on Github and XAML Standard on Github.

Resources:

The post Introducing XAML Standard and .NET Standard 2.0 appeared first on Building Apps for Windows.

Improving the high-DPI experience in GDI based Desktop Apps

$
0
0

In recent years, High-DPI displays have become common. Having a lot more pixels to display your application on seems like a simple recipe for crisper graphics but, counterintuitively, the opposite is often the case. Many applications were written without taking the DPI of displays into account and are not able to natively render their contents on High-DPI displays.  The visual elements (e.g., text, images, icons) of these applications will appear blurry.

GDI was for many years the de facto win32 2D API and is behind many of these older pre-high-DPI applications. GDI is used by applications to render graphics and formatted text on displays and printers. Beginning with the Creators Update for Windows, we have added a new feature, called GDI Scaling, that allows GDI to natively scale visual content on behalf of DPI unaware applications. Visual elements, especially text, can appear much sharper for these applications when this feature is enabled. This will give Desktop users and IT Pros a way to improve existing applications that are difficult or unpleasant to use because of blurry text and graphics.

In this article, we will describe the challenge presented by high DPI displays, show you several ways to configure GDI Scaling, discuss how GDI Scaling works and give instructions to developers on updating their apps to run with GDI Scaling. While consumers and IT professionals may find this discussion informative, the primary target for this article are developers wanting to understand how best to make legacy GDI apps look right on high DPI monitors.

Higher DPI, yet Lower Quality

There is a jarring difference between the physical and logical scale of computer displays.  As an example, this is the layout of my displays and high DPI Laptop on my desk.

The displays I use for my desktop work use larger physical screens and are oriented to facilitate the tasks I regularly do. Of the three displays, my laptop has the highest quality display but it’s physically smaller than the other displays. This is in stark contrast to how Windows and the software on my PC see my displays.

You can see here that Windows thinks my laptop display is enormous. And it is. It’s configured to run at a recommended 200% scaling so that my apps don’t appear tiny displaying on all those pixels. This is a common scenario for mixing different DPI displays using a “docked high DPI Laptop.”

The reverse of this scenario occurs as well. Users could be docking laptops that look good at 100% Scaling with a high DPI display on their desk or, using Windows display settings, establish one of their normal DPI displays on their desk as their main display while using the high DPI display on their laptop as a secondary display.

The changes made to Windows to handle evolving DPI have been gradual and were based on the availability of hardware and the needs of software developers starting in Windows XP. Applications built prior to high DPI support from Windows assume that the density of pixels will be fixed at a specific scale. This scale is referred to as “100%” and is around 96 Dots per Inch (DPI). Applications written at 100% DPI simply don’t have enough graphical detail to look good on high DPI displays. Windows assures that each application takes up the right amount of space on the screen regardless of the DPI scale. This ensures that text and controls are roughly the right size regardless of the displays DPI. Because of this, apps that cannot handle different DPI scales will look “pixilated” as Windows stretches the application to take up the right amount of space on the screen.

It would be great if everything could just be updated, but many popular applications were written before there was graphics API support for high DPI screens, and they do not have any native support for handling changes to scale. GDI Scaling is an effort to address this problem by transparently scaling graphics for the app.

How will a GDI Scaled applications look?

GDI Scaling overwrites an application’s awareness of DPI. This can be good, bad or difficult to notice based on the applications original DPI capabilities. To understand the impact of using GDI Scaling, we need to take some time and discuss the different ways that applications can be built to handle display scaling.
Applications use one of the following modes for handling DPI:

  • DPI Unaware – These are apps that are always rendered assuming 100% Scaling (96 DPI). There is no effort made to compensate for the scale by the app itself.
  • System DPI Aware – These are apps that know the DPI of the main display at the time the user logged in to their computer (called the “System DPI”). These apps scale well on the main display but look blurry on a secondary display at a different DPI.
  • Per Monitor DPI Aware – These are apps that are rendering content at different DPIs and can change the DPI scaling on the fly as the applications are moved between monitors with different DPIs. If well made, these apps look good regardless of the monitor DPI.
  • Mixed Mode DPI Aware – These are apps where there may be multiple top level windows, each with its own DPI awareness, that can be shown on different displays. This is just a mix of the 3 DPI awareness listed above, each window will be impacted by GDI scaling as a single window app of the same DPI Awareness. We do not cover this anywhere else in the blog.

You can find out more about DPI Awareness on MSDN.

With GDI Scaling enabled, Text and Graphics are drawn using the GDI API at a much larger scale to take advantage of the High DPI screen. Not everything is improved though: some of the graphics and icons are bitmaps that can’t be rendered by GDI with more detail. Also, some text may be rendered by another Graphics API. That text will not be improved by GDI Scaling.

System DPI Awareness

Apps that are aware of the system DPI will render at the correct scale for a computer’s main display, though these apps will still have issues if they are displayed on a second display that is a different DPI. This is a very common scenario given the increasing availability of high-DPI laptops (like Microsoft’s Surface Book), and their use in business environments docked with larger displays or projectors with lower DPI.

When apps are shown on a display with a higher DPI than the system DPI, they will appear blurry like the DPI unaware apps:

With GDI Scaling enabled, that same app will have graphics and text rendered to the correct scale regardless of which display it is displayed on.

Additionally, there is an interesting limitation with System DPI aware apps. System DPI is set when the user logs into the computer. If a user should change their main display (to one with a different DPI) or change the DPI of their main display, the display will be updated but the system DPI value won’t. These apps will appear blurry or off until the user logs out and back on. GDI Scaling, on the other hand, re-renders the app with each display change and will not have this issue.

In the image above there is a ‘)’ that is “clipped.”  This and other kerning errors can occur with GDI Scaling. GDI Scaling scales up the objects (like text boxes) and fonts displayed in the app by the same ratio. For instance, if GDI Scaling is doubling the DPI of an app and the app was originally rendered with a 10pt font, it will display the scaled app with a 20pt font. In some cases, text doesn’t scale linearly and can be a few pixels off. The actual characters maybe too large to fit in an object that is proportionally scaled.

Per Monitor DPI Awareness

Apps that have been developed to be per monitor DPI aware should have graphics correctly scaled to all your computer’s displays. These should not only look good but they are likely to look better than GDI Scaled apps because static content like bitmaps will be loaded and rendered at the right DPI. This is a close-up detail of the Character Map app (which is per monitor DPI aware) with GDI Scaling turned off. It looks good.

This is a close-up view of the same app run with GDI Scaling turned on:

There are some innocuous differences such as the scale of the key map letters (both images look good though a little different.) You can also see that the check in the checkbox and the carat in the pull down boxes look much worse. That is because these are both static images that are a part of the control and must be scaled.

You can also see an issue with the kerning on a few of the labels. In this case the larger sized font version is not precisely an integer multiple of the smaller sized font. For example, a 20pt font is not exactly twice the size of a 10pt font.

As this example shows, users and IT pros should try to run the app both with and without GDI Scaling to determine which looks best before making a permanent change.

Configuration of GDI Scaling

Each application can be independently configured to run with GDI Scaling. This completely replaces the default scaling of the application. You should test to make sure the app looks improved before deploying these changes.

Configuring a local app to run with enhanced system scaling

The simplest way to enable GDI Scaling for an application is use the application compatibility tab UI.

To do this, you can:

  • Right click on the application icon and click “Properties.”
  • Go over to the Compatibility tab, enable “Override High DPI scaling behavior” and set the Scaling Behavior to “System (Enhanced).”
  • Restart the app and move it between your different displays to see if there is an improvement.

Note: all the examples in this document are created using system applications (like Task Manager and Character Map). System applications do not have a compatibility tab so this setting cannot be adjusted.

Using Group Policy and MDM for configuring apps to run with GDI Scaling

For IT pros with access to policy management tools–such as Microsoft’s System Center Configuration Manager (SCCM) or Intune– applications can be configured to run with GDI Scaling with the “Turn on GdiDPIScaling” and “Turn off GdiDPIScaling” policies.

Enabling GDI Scaling

IT pros can enable GDI Scaling for a list of applications using the “Turn on GdiDPIScaling” policy. Here is a view of the SCCM GP definition of this policy:

You can find documentation for the MDM policy on MSDN at Display/TurnOnGdiDPIScalingForApps.

Disabling GDI Scaling

Because users and app developers can configure apps to run with GDI Scaling on their own (and this may not be the desired configuration) there is also a similar “Turn off GdiDPIScaling” policy. Setting this policy on users or devices will ensure an application will not run with GDI Scaling enabled, regardless of the user or application settings. In all cases, “Turn off GdiDPIScaling” has a higher priority than “Turn on GdiDPIScaling.”

Here is a view of the SCCM GP definition of this policy:

You can find documentation for the MDM policy on MSDN at Display/TurnOffGdiDPIScalingForApps.

Using Application Compatibility Toolkit to configure apps for GDI Scaling

We have also added support for using the Application Compatibility Toolkit (ACT), which manages your apps’ compatibility settings.  The behavior of ACT configuration policies is like the GP solution above:

GdiDPIScaling (same as “Turn on GdiDPIScaling”)

GdiDPIScalingForceDisable (Same as “Turn off GdiDPIScaling”)

You can find out more about using ACT to manage your devices here: https://technet.microsoft.com/en-us/library/dd837648(WS.10).aspx.

GDI Scaling for Developers

GDI apps that are not DPI aware can look bad for users and Enterprises that use high-DPI displays and docked laptops. Beginning with the Creators Update for Windows, GDI apps that were never implemented to be DPI aware can be updated or configured to be per monitor DPI aware, dramatically improving their usability and appearance. Here, we will provide a deep dive to developers wanting to update their apps to take advantage of GDI Scaling and provide some background on how it works.

How does GDI Scaling work?

Historically, GDI does not support scenarios where the apps are shown at anything other than 100% scaling (96 DPI). App developers have had the ability to get System or Display DPI information and update their apps to handle scaling on their own.

When an application is configured to be GDI scaled, a new DPI Scaling step is performed using built-in GDI scaling. Scaling will be done transparently to the application and will result in vector graphics and text content being rendered at higher resolution.

In many cases the DPI Scaling is performed in two steps:

  • Rendering of vector graphics and text at an integral scaling factor (x2, x3, x4, etc.) using GDI.
  • Scaling down of all graphics during Desktop Window Manager (DWM) composition.

When the application is running on a high-DPI display that happens to be multiple of 100% scaling (96 DPI), then no DWM scaling is used. Vector graphics and text will look crisp. Bitmaps and other static resources (icons, toolbars) will be stretched to match the display DPI.

When the application is running on a display that is not a multiple of 100% (96 DPI) then vector graphics and text will be rendered to the first integral multiple of 100% above the display scale factor. For instance, if the application is on a display that is at 225% scale, then vector graphics and bitmaps will be rendered at 300%. DWM will then scale down the rendered content to 225% scale. In this case, the application will have noticeable fuzziness because of the scaling down, but it will look better than just scaling up the 100% rendered content.

Limitations with our GDI Scaling Solution

There is some functionality where we know GDI Scaling is incomplete or non-functional: Device Independent Bitmap (DIB) and Compatible bitmaps.

Device independent Bitmap (DIB)

DIBs are bitmaps that are updated by the application and must be stored at 96 DPI. For the Creators update for Windows, DIBs are not supported by GDI Scaling. When the DIB is copied to the screen, it will be stretched based on the monitor’s DPI.

Compatible bitmaps

Compatible bitmaps are supported by GDI Scaling with a known limitation. When used in multi-monitor configuration, off-screen content will not be updated when the application window is moved between displays with different DPIs. The off-screen content will have the DPI that was most recently used and will stretch to meet the new display DPI. The image’s resolution will not be updated until the window is resized or the window is moved between displays.

Kerning and clipping with imprecisely scaled fonts

As we mentioned above, many fonts are not precisely scaled. For example, 20pt font is not exactly twice the height and width of 10pt fonts. The GDI Scaling is done using the size of the 100% scaled applications. Any difference in scale will impact how the characters look next to each other (too close or too far apart) or how they fit into the objects within the app.

GDI/D3D Interop

Some applications are rendered using both GDI and D3D/D2D (DirectX) APIs. GDI Scaling does not render the D3D/D2D content correctly. Portions of the screen rendered by GDI will look correct while the bits generated by D3D will be drawn at the original unscaled location and size.

Here is an example of an app rendered with D2D/D3D while GDI Scaling is enabled:

Updating your GDI app to use GDI Scaling

If you have a GDI-based app then you can update its manifest to run with GDI Scaling.

In the Creators Update for Windows release, we have added a “gdiScaling” element that, when set to “true,” enables GDI Scaling.

Here’s how the manifest for MMC enables GDI Scaling:


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- Copyright (c) Microsoft Corporation -->
<assembly xmlns="urn:schemas-microsoft-com:asm.v1"  xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" manifestVersion="1.0">
  <assemblyIdentity
    processorArchitecture="x86"
    version="5.1.0.0"
    name="Microsoft.Windows.MMC"
    type="win32"
/>
  <description>Microsoft Management Console</description>
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
      <requestedPrivileges>
        <requestedExecutionLevel
          level="highestAvailable"
          uiAccess="false"
			/>
      </requestedPrivileges>
    </security>
  </trustInfo>
  <asmv3:application>
    <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2017/WindowsSettings">
      <gdiScaling>true</gdiScaling>
    </asmv3:windowsSettings>
  </asmv3:application>
</assembly>

Taking advantage of GDI Scaling

Use these recommendations if you want to update a GDI app to ensure the best scaling for high-DPI displays.

  • Use compatible bitmaps instead of DIBs. If your application doesn’t need access bitmap bits directly then compatible bitmaps will produce more scalable results.
  • Do not cache off-screen bitmaps between WM_PAINT calls. Instead recreate those bitmaps each time the app is rendering. Although not optimal, it will ensure that those bitmaps will be properly scaled to match the current hWnd display DPI. Vector graphics and text will be rendered at the proper DPI by the GDI transparently to the application.

Code Sample:


LRESULT WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    switch (uMsg)
    {

    ...

    case WM_PAINT:
        {
            PAINTSTRUCT ps;

            // Get a paint DC for current window.
            // Paint DC contains the right scaling to match
            // the monitor DPI where the window is located.
            HDC hdc = BeginPaint(hWnd, &ps);

            RECT rect;
            GetClientRect(hDlg, &rect);

            UINT cx = (rect.right - rect.left);
            UITN cy = (rect.bottom - rect.top);

            // Create a compatible bitmap using paint DC.
            // Compatible bitmap will be properly scaled in size internally and
            // transparently to the app to match current monitor DPI where
            // the window is located.
            HBITMAP memBitmap = CreateCompatibleBitmap(hdc, cx, cy);

            // Create a compatible DC, even without a bitmap selected,
            // compatible DC will inherit the paint DC GDI scaling
            // matching the window monitor DPI.
            HDC memDC = CreateCompatibleDC(hdc);

            // Selecting GDI scaled compatible bitmap in the
            // GDI scaled compatible DC.
            HBTIMAP oldBitmap = (HBITMAP)SelectObject(memDC, memBitmap);

            // Setting some properties in the compatible GDI scaled DC.
            SetTextColor(memDC, GetSysColor(COLOR_INFOTEXT));
            SetBkMode(memDC, TRANSPARENT);
            SelectObject(memDC, g_hFont);

            // Drawing content on the compatible GDI scaled DC.
            // If the monitor DPI was 150% or 200%, text internally will
            // be draw at next integral scaling value, in current example
            // 200%.
            DrawText(memDC, ctx.balloonText, -1, &rect,
                DT_NOCLIP | DT_LEFT | DT_NOPREFIX | DT_WORDBREAK);

            // Copying the content back from compatible DC to paint DC.
            // Since both compatible DC and paint DC are GDI scaled,
            // content is copied without any stretching thus preserving
            // the quality of the rendering.
            BitBlt(hdc, 0, 0, cx, cy, memDC, 0, 0);

            // Cleanup.
            SelectObject(memDC, oldBitmap);
            DeleteObject(memBitmap);
            DeleteDC(memDC);

            // At this time the content is presented to the screen.
            // DWM (Desktop Window Manager) will scale down if required the
            // content to actual monitor DPI.
            // If the monitor DPI is already an integral one, for example 200%,
            // there would be no DWM down scaling.
            // If the monitor DPI is 150%, DWM will scale down rendered content
            // from 200% to 150%.
            // While not a perfect solution, it's better to scale-down content
            // instead of scaling-up since a lot of the details will be preserved
            // during scale-down.
            // The end result is that with GDI Scaling enabled, the content will
            // look less blurry on screen and in case of monitors with DPI setting
            // set to an integral value (200%, 300%) the vector based and text
            // content will be rendered natively at the monitor DPI looking crisp
            // on screen.

            EndPaint(hWnd, &ps);
        }
        break;
        ...
    }
}

To sum up

High DPI displays are a hit but computer users are being blocked from getting the value out of all that extra pixels for older apps. It turns that changing the scale of the display is a pretty big breaking change for older applications. To help, the GDI team at Microsoft has come up with a feature that lets some of these apps compensate for this change with minimum changes–GDI Scaling.

Whether you are configuring apps for your own computer or you are making changes on behalf of your organization, we have provided you with tools to enable and disable this new feature.

For App developers, you will be able to update GDI apps that were never designed for modern high-DPI displays to look better by knowing GDI Scaling’s limitations and following our tips on updating your apps.

The post Improving the high-DPI experience in GDI based Desktop Apps appeared first on Building Apps for Windows.

Earn more money by moving to the latest advertising libraries

$
0
0

Make sure your apps are updated to use the latest versions of the Microsoft Advertising SDK.

The latest advertising SDK versions, which are MRAID 1.0 compliant, support richer creatives experiences. These SDK versions can also send user signals such as advertiser ID, age, gender, geo and other behavioral signals to advertisers (subject to user’s privacy preferences). This enables advertisers to identify the same user across different apps and websites, and as a result can target them better.

Advertisers today seek these capabilities and are willing to spend more money on ad inventory that supports them, so this will translate into higher revenue for you.

The latest Advertising SDK versions for UWP apps also support new ad formats like Interstitial Banner, Native Ads and Playable Ads, which deliver higher eCPMs and can drive up your revenue even further!

Also, Microsoft recently removed support for older advertising SDK releases that do not support a minimum set of capabilities, including the ability to serve HTML5 rich media via the Mobile Rich-media Ad Interface Definitions (MRAID) 1.0 specification from the Interactive Advertising Bureau (IAB).

For more information on how to upgrade your apps to the latest advertising libraries, please refer to this article.

The post Earn more money by moving to the latest advertising libraries appeared first on Building Apps for Windows.

See What’s New with Windows Ink in the Windows 10 Creators Update

$
0
0

Windows Ink is about transforming the way we think about computers, from a tool that is great at getting things done, to one that harnesses your personality and your emotions into the things you create. It’s about bringing back the human aspects that a mouse and keyboard (and even touch) cannot express fully, it’s about making personal computers more personal, and an extension of yourself, not just a tool. We want you to feel empowered to create from the moment you pick up the pen, and have the confidence that Windows understands you, knows what you want to do – by understanding your handwriting, your words and your expression. This is the journey we’re on.

With the Creators Update, Windows Ink is now better than ever! When used with the Surface Dial, it allows you to discover new ways to work and interact with Windows. With Windows Ink, we continue to make it possible for you to do more than with pen and paper. Applications like Photos and Maps have added incredible inking functionality in the last year, and continue to evolve and expand. With Paint 3D in the Creators Update, Windows Ink can now create 3D objects! As we evolve what Ink means to users, we’re also introducing new Smart Ink capabilities to Windows Ink. These capabilities allows developers to understand the ink that is being laid down by the user, using AI to help create, connect and complete user actions on ink. We’ve also improved and added features to the building blocks for Windows Ink, introducing new stencils and adding tilt support to create a richer drawing experience.

Devices that support the Pen on Windows have also doubled in the last year, and is on track to double again in the next year! We’re seeing high demand not just for devices, but also for applications that support ink. To make it easier to find compatible pens, Wacom has partnered with us to develop the Bamboo Ink Pen. This pen will be in market in summer and supports almost all Windows PCs that are pen-capable. It features the Microsoft Pen Protocol (MPP), which is based on Surface Pen technology. In addition, we are also excited that the Surface Dial is now available in more countries, like Australia, Canada and New Zealand, giving more people an opportunity to try this incredible new input device. In addition, new hardware from our OEM partners, like the Dell Canvas 27, are shipping soon and takes advantage of the same RadialController APIs that are used for the dial. As a developer building for the Surface Dial today, it means that you are ready for all the new hardware that our OEM partners will bring to the ecosystem.

The progress we’ve made with Windows Ink would not have been possible without the feedback and passion you developers bring to us. With over a thousand inking applications in the store and growing everyday, with well over half of the top 10 paid store apps being ink apps, there is incredible enthusiasm and interest in this space. This is an incredible opportunity that you have embraced with us, and it inspires us to do more in each Windows release.

What’s new with Windows Ink platform?

Ink is the ultimate way humans can express themselves, it opens up new opportunities for application developers to differentiate, and helps make their applications stand out. From the latest fads like adult coloring books to simple games like tic-tac-toe, to applications that help you organize your life, there is just so much opportunity to build the next big thing in the inking space. We also know that people who use Windows Ink are more satisfied with their experience, what they look for, and buy more inking applications. From the platform perspective, we have 2 ways that we help developers:

  • Make it as easy and quick for a developer to add inking into their application by providing controls that can be dropped in quickly into any application and get Windows Ink support.
  • Provide the most flexible platform building blocks for developers to innovate upon. This gives you the flexibility to choose where to start developing for Windows Ink.

Introducing Smart Ink

Let’s start with a new building block that developers have access to in the Creators Update. Introducing Ink Analysis, this is the first of our family of Smart Ink capabilities that we are bringing to the platform. Smart Ink brings AI technology to not just understand what you write, but also helps connect the dots to what you may want to do. With Ink Analysis, it starts simple, with recognizing shapes and making that square you drew more perfect, but it can also do much more, like understanding you wrote words in squares and making it into an org chart using understanding about your organization. Our goal is to understand user intent and empower developers to turn it into rich digital constructs, as well as to leverage understanding from all parts of the system. Ink Analysis allows any developer to understand the ink they capture, whether it is handwriting, shapes, phone numbers, stock symbols, lists, document structure and more.  This is the same technology we debuted in Sticky Notes in the Window 10 Anniversary Update, and now it’s available for you to use! We can’t wait to see what you can do with this technology.

Here is an example of how to use Ink Analysis to recognize shapes.  For this snippet, we’ll use DirectInk to handle rendering the ink strokes.  Start by initializing an InkAnalyzer and connecting it with InkPresenter:


private void Initialize()
{
    inkAnalyzer = new InkAnalyzer();
    inkCanvas.InkPresenter.StrokesCollected += InkPresenter_StrokesCollected;
    inkCanvas.InkPresenter.StrokesErased += InkPresenter_StrokesErased;
}

// Whenever the user draws a new stroke, you copy the stroke into Ink Analyzer’s stroke collection
private void InkPresenter_StrokesCollected(InkPresenter sender, InkStrokesCollectedEventArgs args)
{
    inkAnalyzer.AddDataForStrokes(args.Strokes);
}

// When a stroke is erased in InkCanvas, remove the same stroke from Ink Analyzer's collection.
private void InkPresenter_StrokesErased(InkPresenter sender, InkStrokesErasedEventArgs args)
{
    foreach (var stroke in args.Strokes)
    {
        inkAnalyzer.RemoveDataForStroke(stroke.Id);
    }
}

Next you want to feed strokes to the analyzer. Commonly this is done via explicit user action (e.g. the user clicks a button) or after the user has been idle for a while.


inkAnalyzer.AnalyzeAsync();

The result is a tree representation of the whole document with different kinds of nodes, such as paragraph, line, list, word, and drawing. If for instance you want to find all the shapes in the ink, you can with the code below:


IReadOnlyList<IInkAnalysisNode> drawings = inkAnalyzer.AnalysisRoot.FindNodes(InkAnalysisNodeKind.InkDrawing);
foreach (IInkAnalysisNode drawing in drawings)
{
    var shape = (InkAnalysisInkDrawing)drawing;
    switch (shape.DrawingKind)
    {
        case InkAnalysisDrawingKind.Circle:
            // The user drew a circle. You can replace it with a perfect circle that goes through shape.Points.
            break;
        case InkAnalysisDrawingKind.Rectangle:
            // The user drew a rectangle.
            // You can find the full list of supported shapes here.
            break;
    }
}

If you want to learn more about Ink Analysis, you can watch the BUILD 2017 recorded video Enable Natural Pen Interaction by Using Ink Analysis to Better Understand Users’ Ink, download the Ink Analysis sample on GitHub or check out the Ink Analysis API Reference.

An improved Ink Toolbar

In the Anniversary Update we created a customizable set of inking tools, Ink Toolbar and Ink Canvas, that any developer can add to their own application with only two lines of markup.


<InkCanvas x:Name=“myInkCanvas”/>
<InkToolbar TargetInkCanvas=“{x:Bind myInkCanvas}”/>

Many of Microsoft’s first party applications have incorporated the inking tools to create engaging user experiences. For example, Photos added a calligraphy pen and the ability to draw on any photo in the gallery. Maps added a feature that lets you measure the distance of a route drawn on the map. Edge browser added inking on webpages. It has never been easier to add Windows Ink to your applications.

In the Creators Update, we continue our commitment to improving these controls! If you already use them in your applications, these improvements will benefit you with no additional work!

In response to users, the Creators Update introduces a new stencil, the protractor. This new stencil makes it easy for you to draw circles and arcs of any size. When drawing an arc, the protractor displays a readout that tells you the precise angle of the arc. You can also resize the stencil with just a pinch/zoom gesture with your fingers.

We’ve also made the ruler stencil better! Like the protractor, it now provides an angle readout that shows the ruler’s angle with the horizontal line. The ruler also snaps to 0, 45 and 90 degrees for easy access to the most common angles being used by our users.

You asked for an improve stroke preview in the Ink Toolbar, and in the Creators Update, we have it! We’re also make changes in the Ink Toolbar to work better with High Contrast themes, by automatically showing only colors that meet visibility requirements for the current user profile.

New Exciting Inking Capabilities


Today we announced the new Surface Pro and the new Surface Pen. Together they enable the next generation of inking capabilities that truly make writing digitally as natural as pen on paper. Here are some of the highlights:

  • Low latency Ink that virtually eliminates lag when you write
  • Tilt support to capture an additional dimension in digital inking
  • Ink that captures the entire spectrum of your expression with 4,096 levels of pressure sensitivity
  • Effortless inking with half the activation force required to being inking

Our customers have asked us for these capabilities, and they are finally here! From a developer perspective, if you already use the Windows Ink platform, all these capabilities show up in your application automatically! There are no changes required, and you are ready for the new Surface Pro, with the new Surface Pen.

Low latency Inking is a unique addition to Windows Ink. It is the result of a close partnership between hardware and software. The Pixelsense Accelerator chip in the new Surface Pro, is the first device to run Windows Ink acceleration code natively on hardware. This is how we achieve a new milestone in inking, virtually eliminating lag between the pen tip and the ink that flows out of it, creating the most natural writing experience with Windows Ink.

Tilt is another great addition to the Inking experience. The great news is, in addition to the new Surface Pro/Pen supporting this new capability, Wacom Pens that feature tilt will also “just work”! Tilt allows Windows Ink to model natural pencil sketching that response to the tilt of the pen. This support is now built into the pencil brush on the Ink Toolbar. In the above diagrams, we demonstrate how the pencil brush can be used to shade lines (on the left) and to draw arcs of varying thickness depending on the degree of tilt (on the right).

As mentioned above, tilt integration happens automatically if you use the Ink Toolbar. However, if you are not using the Windows Ink platform to render ink, and want to build your own brush that responds to tilt, you still can! There are two properties, TiltX and TiltY (respective angle of tilt against each axis of the screen plane) which are included with pointer input messages. You can access the tilt values from the PointerPointProperties included with Pointer input events, or the POINTER_PEN_INFO struct from WM_POINTER input.

These improvements automatically show up on any application that uses the Windows Ink controls, and you can be confident that we’ll continue to evolve and improve them in each release of Windows.

What’s new with Surface Dial and RadialController?

The Surface Dial introduces a new input paradigm to computing. It was designed alongside the Windows Ink experience, allowing it to truly shine when used together with a Pen. We’ve seen many experiences built to harness the new capabilities the Surface Dial brings, and are also seeing new hardware emerging, and adopting the RadialController standard. In response to your feedback, we’ve added more capabilities to the RadialController experience in the Creators Update.

First off, are some new button events for RadialControllers. These new events, Pressed and Released, combined with existing events for rotation and screen contact, will allow you to track complex interactions such as press-and-rotate or press-and-move. The example below illustrates a simple way to capture a press-and-rotate action.


_radialController.ButtonPressed += OnButtonPressed;
_radialController.ButtonReleased += OnButtonReleased;

private void OnRotationChanged(RadialController sender,
                               RadialControllerRotationChangedEventArgs args)
{
    if (args.IsButtonPressed)
    {
        /* When button is pressed, you can do modal interactions, fine-grained changes */
    }
    else
    {
        /* Otherwise, do the normal rotation behavior */
    }
}
private void SendHaptics(SimpleHapticsController hapticController)
{
    var feedbacks = hapticController.SupportedFeedback;
    foreach (SimpleHapticsControllerFeedback feedback in feedbacks)
    {
        if (feedback.Waveform ==
                    KnownSimpleHapticsControllerWaveforms.Click)
        {
            hapticController.SendHapticFeedback(feedback);
            return;
        }
    }
}

You also now have access to the Haptics engine in the Surface Dial hardware. Using SimpleHapticsController—a new object that uses the HID Simple Haptics specification—you have the power to directly send feedback to the user. You can use this to customize the feel of your menu, adding a new dimension to the experience. This object is available in the arguments of all radial controller input events.

In cases where you may want to suppress the radial menu to prevent it from blocking UI, we now have new properties ActiveControllerWhenMenuIsSuppressed and IsMenuSuppressed to let you configure when the menu is available or suppressed. When a menu is suppressed, it will not appear on press-and-hold interactions for the foreground app. Your app can listen to a new event during menu suppression to give the user an indication the menu is blocked, or build an alternate experience. Here is a code sample for this functionality:


RadialControllerConfiguration config = RadialControllerConfiguration.GetForCurrentView();
config.ActiveControllerWhenMenuIsSuppressed = myController;
config.IsMenuSuppressed = true;

myController.ButtonHolding += MyController_ButtonHolding;

User input running on a UI thread can sometimes lead to performance bottlenecks. With the Creator’s Update, radial controller interactions can now be handled on an off-UI thread using RadialControllerIndependentInputSource. Below is an example on how to get additional performance using this method.


RadialController controller;
Windows.UI.Input.Core.RadialControllerIndependentInputSource independentInput;
CoreApplicationView view;

view = CoreApplication.GetCurrentView();

var workItemHandler = new WorkItemHandler((IAsyncAction) =>
{
    independentInput = Windows.UI.Input.Core.RadialControllerIndependentInputSource.CreateForView(view);

    controller = independentInput.Controller;

    controller.RotationResolutionInDegrees = 5;

    controller.RotationChanged += Controller_RotationChanged;
    controller.ScreenContactStarted += Controller_ScreenContactStarted;
    controller.ScreenContactContinued += Controller_ScreenContactContinued;
    controller.ScreenContactEnded += Controller_ScreenContactEnded;
    controller.ControlLost += Controller_ControlLost;
    controller.ButtonClicked += Controller_ButtonClicked;
    controller.ButtonPressed += Controller_ButtonPressed;
    controller.ButtonReleased += Controller_ButtonReleased;
    controller.ButtonHolding += Controller_ButtonHolding;
    controller.ControlAcquired += Controller_ControlAcquired;

    // Begin processing input messages as they're delivered.
    independentInput.Dispatcher.ProcessEvents(CoreProcessEventsOption.ProcessUntilQuit);
});
action = ThreadPool.RunAsync(workItemHandler, WorkItemPriority.High, WorkItemOptions.TimeSliced);

In addition to all the API additions above, you can now customize and easily add new menu items on the Radial Menu. Under “Wheel Settings” in the settings app, you can add application specific menu items that trigger keyboard combinations. Imagine customizing the controller to send your favorite shortcuts in Visual Studio, Photoshop or even when browsing the web!

The Surface Dial continues to excite users and developers alike, with these new enhancements, both developers and users have more control and flexibility in their experience. We invite you to join the numerous applications that have already delivered a great Surface Dial experience, like CorelDRAW, Autodesk’s SketchBook, Silicon Bender’s Sketchable and Algoriddim’s djay Pro. We can’t wait to see what you can do with this unique new form of input on Windows.

Join us in making Windows Ink better!

With Windows Ink and the Surface Dial additions in the Creators Update, we believe we’re just scratching the surface of what Windows Ink can do in people’s lives. Our commitment is to invest in areas that can help you innovate and remove all the barriers to our users using, loving and needing Windows Ink. This involves a spectrum of efforts, from the hardware we build by ourselves and with our partners, to the next SDK additions we make to power you app. As we continue this journey, we invite you to lend us your voice, your ideas and your feedback. Help us help you make the next great application and help us help you change the world. Tweet your ideas using #WindowsInk, email us at WindowsInk@Microsoft.com or tweet us at @WindowsInk. We would love to hear from all of you.

Thank you!

The post See What’s New with Windows Ink in the Windows 10 Creators Update appeared first on Building Apps for Windows.

UWP and the evolution of touch development

$
0
0

How is programming for touch development on the Universal Windows Platform (UWP) different from mouse and keyboard development in Windows Forms? This post will cover some of the subtle differences between the two and how to use the most advanced tools for building smooth touch experiences.

Fig 1. Command prompt

The ways we communicate with our computers have gone through many changes over the years. For a long time, interactions were governed by the keyboard. Then, the Graphical User Interface (GUI) came along, which not only introduced the mouse, but drastically altered how home screens and apps looked. The success of Windows 95 and Mac OS cemented that user experience, popularized personal computing and changed our computing landscape.

Fig 2. Graphical user interface in Windows Form

While Natural User Interfaces (NUI) have been around for a long time, the transition to touch interfaces has happened both more gradually and more quietly. In part, this is because it occurred hand-in-hand with the growth of smartphone-based mobile computing – and we have a tendency not to see our phones as centers of computing power, but rather as accessories or appliances. In part, though, the smooth transition occurred because the creators of development tools such as Visual Studio made a conscious effort to protect developers from these changes by making touch and mouse (or tap and click) appear to be the same thing. As a consequence, we moved from a mouse-centric development world to touch-friendly development world without really noticing the tectonic shift that occurred beneath our feet.

What does touch-friendly mean?

When touch-enabled tablets first arrived for Windows, you pretty much just used your finger as if it was a mouse to manipulate applications designed for the mouse. It was difficult because buttons tended to be too small and you couldn’t see visual affordances, designed for mouse interactions, hidden beneath your fingers. Even if your device supported touch, the apps running on it continued to be mouse-centric. Similarly, early mobile devices came with a stylus because a stylus could manipulate those tiny buttons.

Fig 3. Natural user interface in Windows Phone

Phone apps mark the transition from mouse-centric to touch-friendly development. Phone apps weren’t just touch-first, of course. They were touch-only. They forced changes in the design, layout and controls used in apps to make interaction easier for smartphone users. These in turn were eventually incorporated into the UWP platform. While the UWP platform supports both touch and mouse interactions, as well as a variety of other inputs, when you develop apps and controls for it, you should think of it first as a touch interface. Mouse interactions should be added on secondarily.

There are many overlaps between touch gestures and mouse interactions that make this easier. For instance, when you tap on a UWP button or click on it, both the Tapped event and the Click event are triggered. Similarly, events such as ManipulationStarted and ManipulationCompleted do not differentiate between touch and mouse. Given the amount of effort that has gone into blurring the difference between touch and mouse in UWP, it is worth asking ourselves, when is a click not a click?

The age-old question: click or tapped

The Button control is an interesting island of GUI behavior in a touch-first world. If you double-click on a button in the Visual Studio designer, Visual Studio will wire up a Click event handler for you in XAML and in code-behind. This is there for backwards compatibility since, as pointed out above, touch and mouse interactions will both throw Click as well as Tapped events.

In order to develop in a touch-first way, however, you should handle the Tapped event rather than the Click. This becomes important when you need to distinguish Tapped from other touch events like DoubleTapped and Holding (the latter cannot even be emulated with a mouse).


<Button Content="My Button"
        Click="Button_Click"
        Tapped="Button_Tapped"
        RightTapped="Button_RightTapped"
        DoubleTapped="Button_DoubleTapped"
        Holding="Button_Holding"
        ManipulationMode="All"
        ManipulationStarted="Button_ManipulationStarted"
        ManipulationCompleted="Button_ManipulationCompleted"
/>

Once you have confirmed that your app works well for touch, you should add interactions for the mouse and other input vectors. For instance, you can capture clicks of the right mouse button by handling the oddly named RightTapped event.


    <VisualStateManager.VisualStateGroups>
        <VisualStateGroup x:Name="CommonStates">
            <VisualState x:Name="Normal" />
            <VisualState x:Name="PointerOver"/>
            <VisualState x:Name="Pressed"/>
        </VisualStateGroup>
    </VisualStateManager.VisualStateGroups>

More importantly, you should also have visual states for hover (PointerOver) and Pressed states. In the touch world, these are not particularly useful since your fingers will typically occlude these state animations. Visual affordances and visual feedback can be extremely useful, however, for mouse, pen and touchpad interactions that do not block the user’s view.

Swiping right: online and offline gestures

Touch gestures come in two varieties. There are direct manipulations of objects, which happen automatically when you move one or more fingers across your screen. These are sometimes also known as online gestures. The other kind of gesture is only successful once the user completes a series of steps such as moving an object on the screen from one position to an offset from that position, such as a swipe. These kinds of gestures are easy to identify because they involve thresholds. If the user doesn’t move the object far enough, it fails a distance threshold. If it doesn’t complete the movement in a set amount of time, it fails a time threshold. These are also known as offline gestures.


<Canvas ManipulationMode="None" Margin="0,12,0,0" MinHeight="400">
    <Border x:Name="manipulateMe"
            ManipulationMode="All"
            ManipulationDelta="ManipulateMe_ManipulationDelta"
            Background="LightGray" Height="200" Width="200"
            HorizontalAlignment="Left"
            VerticalAlignment="Top"/>
</Canvas>

Direct manipulations can be implemented in XAML by taking advantage of the various UIElement manipulation events. While the ManipulationStarting event can be useful, the only event you really need to handle is ManipulationDelta. You will also want to set the ManipulationMode property, which determines what sorts of manipulation are allowed, e.g. Scale, Rotate, TranslateY, TranslateX. All allow any kind of direct manipulation on the target element.


private TransformGroup transforms;
    private MatrixTransform previousTransform;
    private CompositeTransform deltaTransform;

    private void InitManipulationTransforms()
    {
        transforms = new TransformGroup();
        previousTransform = new MatrixTransform() { Matrix = Matrix.Identity };
        deltaTransform = new CompositeTransform();

        transforms.Children.Add(previousTransform);
        transforms.Children.Add(deltaTransform);

        // Set the render transform on the rect
        manipulateMe.RenderTransform = transforms;
    }

To move and rotate the target UIElement you need to keep track of the transforms being applied to it.


void ManipulateMe_ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
    {
        previousTransform.Matrix = transforms.Value;

        // Get center point for rotation
        Point center = previousTransform.TransformPoint(new Point(e.Position.X, e.Position.Y));
        deltaTransform.CenterX = center.X;
        deltaTransform.CenterY = center.Y;

        // Look at the Delta property of the ManipulationDeltaRoutedEventArgs to retrieve
        // the rotation, scale, X, and Y changes
        deltaTransform.Rotation = e.Delta.Rotation;
        deltaTransform.TranslateX = e.Delta.Translation.X;
        deltaTransform.TranslateY = e.Delta.Translation.Y;
    }

Then, every time the ManipulationDelta event indicates that the user is trying to move the element, you update the element with the new information.

Making touch manipulations smooth as butter

Today’s users expect touch-driven content to be smooth and immediate. Using ManipulationDelta events can’t completely ensure this because it runs on the UI thread. When there is heavy processing occurring on the UI thread, users may end up experiencing some lag in response to their touch gestures.

To get the best touch experience, it is important to move touch processing off of the UI thread by using the InteractionTracker class. InteractionTracker was introduced with the Composition APIs, and allows interactions and visual feedback at a much lower level than previous UI programming models in UWP. In order to drive composition animations with the InteractionTracker, you need to associate it with a VisualInteractionSource. In the sample code below, the source is a backing visual for the root element of the page.


_tracker = InteractionTracker.Create(_compositor);

var interactionSource = VisualInteractionSource.Create(viewportVisual);

interactionSource.PositionXSourceMode = InteractionSourceMode.EnabledWithInertia;
interactionSource.PositionYSourceMode = InteractionSourceMode.EnabledWithInertia;

_tracker.InteractionSources.Add(interactionSource);

// bind the InteractionTracker outputs to the contentVisual.
var positionExpression = _compositor.CreateExpressionAnimation("-tracker.Position");
positionExpression.SetReferenceParameter("tracker", _tracker);
contentVisual.StartAnimation("Offset", positionExpression);

For an even more sophisticated implementation of low-latency touch input, you can use the CoreIndependentInputSource class as demonstrated in this sample on GitHub.

Closing the circle

It’s taken a long time to move from DOS prompts to the natural user interface. One of the peculiarities of all these user experience changes is that rather than supplanting each other, these variations just supplement. The keyboard has never gone away, and like a hipster vinyl revival, the popularity of PowerShell and the Linux Bash Shell on Windows suggest that command prompts won’t either. For more information on touch interactions, please follow these links:

The post UWP and the evolution of touch development appeared first on Building Apps for Windows.

Toolkits, Toolkits, Toolkits!

$
0
0

As a UWP developer, you have many options to help build your application quickly and reliably. In fact, there are so many options that you may feel like you can choose only one. Luckily, that’s not the case, and many toolkits complement each other in various ways.

Today, we’ll talk about two open source toolkits:

Both are open source, but each has different strengths. These two particular toolkits can bring tools and controls for a variety of application scenarios. Let’s start by introducing the toolkits and how they can help.

UWP Community Toolkit

The UWP Community Toolkit is the ultimate collaboration between Microsoft and the UWP developer community. With dozens of features such as helper functions, custom UI components, animations and app services, the UWP Community toolkit is a great time saver and can bring your application to the next level.

The toolkit has had 12 releases so far and is currently on v 1.4 (released on April 3, 2017). It has more than 80 contributors, with thousands of commits, and the community is constantly working on improvements. Conveniently, it’s broken up into several nuget packages so you can pick and choose exactly what you need.

Examples of this toolkit’s power can be found in the Services namespace, where you can easily interact with social media services with as little as two lines of code.

Here’s an example of getting a Twitter user’s timeline:


TwitterService.Instance.Initialize("consumer-key", "consumer-secret", "callback-uri");
ListView.ItemsSource = await TwitterService.Instance.GetUserTimeLineAsync("user-screenname", 50);

You can find a full demo application here in the source code or here in the Windows Store. Go here to see a full list of the available features (controls, helpers, etc.) and go here to find the documentation.

Telerik UI for UWP

Telerik UI for UWP, from Progress Software, is a recently open sourced toolkit that contains an amazing set of Line of Business (LOB) controls with which you can create native, business-focused, UWP applications. With controls such as DataGrid and RadListView, the Telerik UI provides the powerful sorting, grouping and editing experiences you might expect from a desktop application, as well as rich data visualization experiences with controls such as Charts, Gauges and BulletGraphs.

We recommend you check out the Customer Database Example application here on GitHub to see the DataGrid in action, as well as the SDK Examples app here. You can see a full list of available controls here and find the documentation here (if you’re looking for a little extra help, Progress Software also offers professional support in the premium package).

An example of this toolkit’s power is the RadDataGrid. With one line of code you get a bunch of out-of-the-box features like grouping, sorting and filtering.

You can install UI for UWP in your application using the nuget package or build from the source directly. If you would like to read more about why Progress Software open sourced Telerik UI for UWP, we recommend you check out this great article.

Contributing

If you’re a developer who likes contributing to GitHub repos and giving back to the community, or if you have ideas to make things better for other developers, both toolkits accept pull requests and each has its own contribution guidelines (here for UWP community toolkit and here for Telerik UI for UWP).

Wrapping up

Both toolkits complement each other. You can use them side by side in your application to bring the user a delightful, yet powerful, experience in your UWP application. With dozens of UI controls, helpers, services and more, you can get your UWP app to market faster and with more confidence than ever. We look forward to seeing your UWP Community Toolkit and UI for UWP powered applications in the Windows Store!

Resources

The post Toolkits, Toolkits, Toolkits! appeared first on Building Apps for Windows.

Native Ads in Microsoft Advertising SDK

$
0
0

Overview

Native Ads is a component-based ad format that gives publishers the flexibility of placing the individual components of a creative – title, image, logo, description, call to action text – so as to provide the best possible fitment to the look and feel of the rest of the app. This enables the developers to use fonts, colors and animations of their own to stitch unobtrusive user experience in their app while earning high yield from advertising. For advertisers as well, this provides high performing placements since the ads experience is tightly built into the app and users tend to interact a lot more with such sponsored content. According to a report by Mobile Marketing, native in-app ads typically see five times greater engagement than traditional banner ads and, hence, get greater spend from advertisers as well (as per eMarketer and other reports).

Starting now, developers can create Native Ad slots in their apps or games using the latest version of Microsoft Advertising SDK (10.0.4 or later). Microsoft Monetization platform provides developers with the maximum amount of freedom to create their own presentations and is available to a limited set of publishers in a closed pilot. Please contact aiacare@microsoft.com to express your interest to be part of this pilot.

Where Do I Start?

As always, start with downloading the Microsoft Advertising SDK. This provides you the libraries to include Native Ads into your app or game.

Create a “Native” ad unit for your app in ‘Monetize with ads’ section on DevCenter (dev.windows.com). This is the ad unit that you will use in your app when you request for an ad in the code.

How Do I Get Native Ads Integrated into my App?

This section assumes that you are familiar with the Microsoft Advertising SDK for your UWP app or game. If you haven’t played around with this, consider going through the Get Started guide.

To show Native Ads in your app, follow the instructions for project type:

XAML/.NET

HTML/JavaScript

XAML/.NET

This section provides C# examples for your XAML/.NET project. You will need to go through these simple steps to get Native Ads in your code.

Step 1: Setup References

Open your project in Visual Studio. In Reference Manager, expand Universal Windows, click Extensions and then select the check box next to Microsoft Advertising SDK for XAML.

In appropriate code file in your app (for example, in MainPage.xaml.cs), add the following namespace reference.


using Microsoft.Advertising.WinRT.UI;

Step 2: Setting up Native Ads Manager

In an appropriate location in your app (for example in MainPage or some other page), declare a NativeAdsManager object and string fields that represent the application ID and ad unit ID for your Native Ad. The following code example assigns the myAppId and myAdUnitId fields to the test values for Native Ads provided in Test Mode values. These values are only used for testing; you must replace them with live values from Windows DevCenter before you publish your app.


NativeAdsManager nativeAdsManager = null;
string appId = "d25517cb-12d4-4699-8bdc-52040c712cab";
string adUnitId = "test";

In code that runs on startup, instantiate the NativeAdsManager.


// Ad Events

nativeAdsManager = new NativeAdsManager(appId, adUnitId);

Step 3: Request for an Ad

When you want to show an ad, request for one using the NativeAdsManager and wire up the events.


nativeAdsManager.RequestAd();

nativeAdsManager.AdReady += NativeAd_OnAdReady;

nativeAdsManager.ErrorOccurred += NativeAd_ErrorOccurred;

Step 4: Using components of the Ad to stitch up the experience

Assume you have a XAML page which has various placeholders for Title, Description, Sponsored By, Call To Action of an Ad and a container which contains all these elements. Sample StackPanel containing all the elements.


<StackPanel x:Name="NativeAdContainer" BorderThickness="2" BorderBrush="Azure">
   <StackPanel x:Name="IconImageContainer" BorderThickness="2" BorderBrush="Azure" Visibility="Collapsed" >
       <Image x:Name="IconImage" />
   </StackPanel>
   <TextBox x:Name="TitleBox" Text="The title will go here" Margin="78,0,-78,0"/>
   <TextBox x:Name="DescriptionBox" Text="The Description will go here" Visibility="Collapsed" />
   <TextBox x:Name="SponsoredBy" Text="The SponsoredBy will go here" Visibility="Collapsed" />
   <StackPanel x:Name="MainImageContainer" BorderThickness="2" BorderBrush="Azure" Visibility="Collapsed">
        <Image x:Name="MainImage" Margin="0,8,0,4" />
   </StackPanel>
   <Button x:Name="CallToAction" Margin="0,8,0,4" Visibility="Collapsed" />
</StackPanel>

Based on components of the creative that you want to stitch up in your app, your code may differ. Here is a sample OnAdReady event listener where Title, Description, CallToAction and Image is being used.


void NativeAd_OnAdReady(object sender, object e)
        {
           NativeAd nativeAd = (NativeAd)e;
           TitleBox.Text = nativeAd.Title;

		//if description is not null show description textbox
           var description = nativeAd.Description;
           if (!string.IsNullOrEmpty(description))
           {
               DescriptionBox.Text = nativeAd.Description;
               DescriptionBox.Visibility = Visibility.Visible;
           }

           //if sponsoredBy is not null show sponsoredBy textbox
           var sponsoredBy = nativeAd.SponsoredBy;
           if (!string.IsNullOrEmpty(sponsoredBy))
           {
               SponsoredBy.Text = sponsoredBy;
               SponsoredBy.Visibility = Visibility.Visible;
           }

           //if CallToAction is not null update Button
           var callToAction = nativeAd.CallToAction;
           if (!string.IsNullOrEmpty(callToAction))
           {
               CallToAction.Content = callToAction;
               CallToAction.Visibility = Visibility.Visible;
           }

           // Assets consists further information about Ad
           var assets = nativeAd.AdditionalAssets;

           // Loading images
           var icon = nativeAd.IconImage;
           if (icon != null)
           {
               var bitmapImage = new BitmapImage();
               bitmapImage.UriSource = new Uri(nativeAd.IconImage.Url);
               IconImage.Source = bitmapImage;
               // Best view when using the Height and Width of the image given
               IconImage.Height = nativeAd.IconImage.Height;
               IconImage.Width = nativeAd.IconImage.Width;

               IconImageContainer.Visibility = Visibility.Visible;
            }

            // There might be multiple main images sent by the server
            var mainImages = nativeAd.MainImages;
            if (mainImages.Count > 0)
            {
                var mainImage = mainImages[0];
                var bitmapImage = new BitmapImage();
                bitmapImage.UriSource = new Uri(mainImage.Url);
                MainImage.Source = bitmapImage;
                // Best view when using the Height and Width of the image given
                MainImage.Height = mainImage.Height;
                MainImage.Width = mainImage.Width;

                MainImageContainer.Visibility = Visibility.Visible;
            }

            // It is required to show the AdIcon in your container
            NativeAdContainer.Children.Add(nativeAd.AdIcon);

            // Register any xaml framework element for clicks/impressions
            nativeAd.RegisterAdContainer(NativeAdContainer);

P.S: The developer is required to “Register” the XAML ad container (any framework Element) with the Native Ads object. This is required for handling impressions and click tracking and is critical for ad earnings. Failure to do so may result in ad-units and advertising payouts being blocked by Microsoft.

HTML/JavaScript

More details on the HTML feature will be coming soon! Please reach out to us (aiacare@microsoft.com) if your apps are in HTML/JS and you need this feature.

Guidelines

Even though the developer has complete control over how to create the ad experience and which components of the creative is displayed to the user, the advertiser’s creative should get its due message out to the user. There is a fine balance that needs to be achieved to reap maximum value from the Native Ad.

Here are some guidelines to ensure the balance.

Required to Show

There are two advertiser assets that must always be shown to the user in your Native Ad design. Failing to include any of these could result in low performance of your ad unit and eventual low (or no) yield. These assets are:

  • Ad Title
  • Either Distinguishable ad icon (This Ad Icon is sent as part of NativeAd object – property named AdIcon) or Sponsored By or texts such as ‘Sponsored’, ‘Promoted’, ‘Recommended’

Not following these guidelines may result in the removal of the adUnits from the advertising system.

Ad Experience

Your Native Ad should be clearly delineated from the rest of your content and have space around it to prevent accidental clicks. Use border, background or some other treatment to separate the ad content. Always remember, getting user to accidentally click on the ad is not beneficial in the longer term for your ads based revenue and for end user experience.

You should always show the distinguishable “Ad” icon in the ad view. Whenever possible, show the “Sponsored By” field to clearly call out that the content is an ad and provided by an advertiser.

Text Display Requirements

Native Ads should always have the Title displayed. Provide enough space to display at least 25 characters of the title. If the title is longer, ensure to replace the additional text with an ellipsis.

Ensure that the Call-to-Action (CTA) is separated out from the rest of the promotional text from the advertiser.

If you choose the rest of the promotional text (Description) from the ad response, provide space to display at least 75 characters of the same. It’s best to use animations to show the full content of the ad description.

Call-to-Action

Native Ads should always have the CTA displayed to the user as something clickable like a button or hyperlink.

CTA string should always be displayed in its entirety as it is a critical component of the advertiser’s creative.

Learn and Optimize

It is recommended that different ad units are created and used for each different placement of Native Ads in the app. This enables reporting and learning for each placement which then can be used for optimizing each placement separately till optimal performance is achieved.

In case of any further queries, please reach out to aiacare@microsoft.com and we’ll be glad to help you out.

The post Native Ads in Microsoft Advertising SDK appeared first on Building Apps for Windows.


Using color fonts for beautiful text and icons

$
0
0

In this post, we’ll introduce you to a text technology called color fonts. We’ll discuss what color fonts are, when they can be useful and how to use them in your Windows 10 apps.

What are color fonts?

Color fonts, also referred to as “multicolor fonts” or “chromatic fonts,” are a relatively new font technology that allows font designers to use multiple colors within each glyph of the font. Color fonts allow apps and websites to draw multicolored text with less code and more robust operating system support than ad-hoc techniques implemented above the text stack.

Most fonts for reading and writing—the fonts you are probably most familiar with—are not color fonts. These fonts define only the shape of the glyphs they contain, either with vector outlines or monochromatic bitmaps. At draw time, a text renderer fills the glyph shape using a single color (the “font color”) specified by the app or document being rendered.

Color fonts, on the other hand, contain color information in addition to shape information. Some approaches even allow fonts to include multiple color palettes, giving the font artistic flexibility. Color fonts typically include fallback information for platforms that do not support color fonts or for scenarios in which color functionality has been disabled. In those situations, color fonts are rendered as normal monochromatic fonts.

One color font you may be familiar with is Segoe UI Emoji—the default font used in Windows to display emoji. Below, you can see an example of a glyph from Segoe UI Emoji rendered in monochrome (left) and in color (right).

Why use color fonts?

Now that you know what color fonts are, let’s talk about how they can be useful.

Color fonts were originally designed to enable multicolored emoji in text communication scenarios. They excel at that task, but they are useful for other scenarios as well. Color fonts offer a way to implement rich text effects with the simplicity and functionality of regular fonts. To apps and the operating system, text rendered in a color font is the same as any other text: It can be copied and pasted, parsed by accessibility tools and so on.

Color fonts are a better alternative to raster graphics for rich text scenarios like website headers or document section titles. Although raster graphics are commonly used in these scenarios, they do not scale well to all display sizes, nor do they provide the same accessibility features as real text. If you find yourself frequently generating raster images of text from multicolored artwork, consider using a color font instead.

Color fonts can also be used for your app’s iconography. Some app developers prefer using icon fonts to standalone image files, due to the convenience and layout functionality offered by fonts. With color fonts, you can pack rich, scalable, full-color icons into a single icon font.

(Note: Starting in Windows 10 Creators Update, you can also achieve scalable vector iconography by using standalone SVG images directly in your XAML app. For more information, see Vector iconography: Using SVG images in your app.)

What kinds of color fonts does Windows support?

The OpenType specification defines several ways to embed color information in a font. Starting in Windows 10 Anniversary Update, Windows supports all of these approaches. The different approaches are summarized below.

Vector-based color fonts define glyph shapes using mathematical curves and lines. They may use the traditional font outline syntax coupled with color palettes (via OpenType’s ‘COLR’ and ‘CPAL’ tables), or they may use embedded SVG assets (via OpenType’s ‘SVG ’ table). These formats excel at representing most iconography compactly, and as vectors, they offer infinite scalability.

Bitmap-based color fonts define glyph shapes using embedded raster graphics, such as PNG images. They may use OpenType’s ‘CBDT’ and ‘CBLC’ tables, or they may use OpenType’s ‘sbix’ table. This approach makes it straightforward to control every pixel of a glyph’s shape and provide photorealistic content, but designers must provide multiple image sizes to ensure high-quality visual scaling.

Using color fonts

From both the developer’s perspective and the user’s perspective, color fonts are “just fonts.” They can be installed and uninstalled from the system in the same way as monochromatic fonts, they can be included in your app package as a local asset, or they can be used as a web font by your website.

In the XAML and Microsoft Edge frameworks, you can style just about any text with a color font in the same way as a regular font, and by default, your text will be rendered in color. However, if your app operates at a lower level and calls Direct2D APIs (or Win2D APIs) to render its text, then it must explicitly request color font rendering.

Using color fonts in XAML

The XAML platform’s text elements (like TextBlock, TextBox, RichEditBox, and FontIcon) support color fonts by default. Simply style your text with a color font, and the styled text will be rendered in color. The following code example shows how to style a TextBlock with a color font that has been packaged with your app assets. (The same technique applies to regular fonts.)


<TextBlock FontFamily="Assets/MyColorFont.otf#MyFontFamilyName">Here is some text.</TextBlock>

Applying a color font to a XAML TextBlock

The FontFamily property points to the relative location of a font file that has been added to the app package. Since a single font file may include multiple font families, you also need to specify the desired font family using the hash syntax illustrated above.

If you never want your XAML text element to render multicolor text, set its IsColorFontEnabled property to false. For example, you may choose to have your app render monochromatic text when accessibility features are enabled.

Using color fonts in Microsoft Edge

As with XAML, Edge supports rendering color fonts by default in websites and web apps, including the XAML WebView control. Simply use HTML and CSS to style your text with a color font, and the styled text will be rendered in color.

Using color fonts in Direct2D

In contrast to the UI frameworks, the lower-level graphics APIs, such as Direct2D and DirectWrite, do not render color glyphs by default. This is to avoid unexpected behavior changes in text-rendering apps that were designed prior to color font support.

If your app renders text with Direct2D’s DrawText and DrawTextLayout APIs, you must “opt in” to color glyph rendering. To do so, pass the D2D1_DRAW_TEXT_OPTIONS_ENABLE_COLOR_FONT flag to the relevant drawing method. The following code example shows how to call Direct2D’s DrawText method to render a string in a color font:


// If m_textFormat points to a font with color glyphs, then the following
// call will render m_string using the color glyphs available in that font.
// Any monochromatic glyphs will be filled with m_defaultFillBrush.
m_deviceContext->DrawText(
    m_string->Data(),
    m_string->Length(),
    m_textFormat.Get(),
    m_layoutRect,
    m_defaultFillBrush.Get(),
    D2D1_DRAW_TEXT_OPTIONS_ENABLE_COLOR_FONT
    );

Drawing multicolored text with Direct2D’s DrawText method

Using color fonts in Win2D

Like Direct2D, Win2D’s text drawing APIs do not render color glyphs by default.

To opt in to color glyph rendering with Win2D, set the EnableColorFont options flag in the text format object your app passes to the text drawing method. The following code example shows how to render a string in a color font using Win2D:


// The text format that will be used to draw the text. (Declared elsewhere
// and initialized elsewhere by the app to point to a color font.)
CanvasTextFormat m_textFormat;

// Set the EnableColorFont option.
m_textFormat.Options = CanvasDrawTextOptions.EnableColorFont;

// If m_textFormat points to a font with color glyphs, then the following
// call will render m_string using the color glyphs available in that font.
// Any monochromatic glyphs will be filled with m_color.
drawingSession.DrawText(
    m_string,
    m_point,
    m_color,
    m_textFormat
    );

Drawing multicolored text with Win2D’s DrawText method

Building OpenType SVG color fonts

Color fonts are a relatively recent development in font technology, so support among font-building tools is still in its early stages. Not all types of color font are supported by all font tools, but support continues to improve as color fonts gain popularity.

Building a font from scratch is a complex process, and it’s more than we can cover in this blog post. But color fonts aren’t just for professional type designers—if you’re an app or web designer with a monochromatic icon font, and you’d like to upgrade it to a color font, we’ve developed a small tool to help make the process easier: the OpenType SVG Font Editor.

This app lets you take an existing font and add color by embedding your own SVG artwork for each glyph using a simple drag-and-drop interface. SVG is a popular vector art format supported by tools like Adobe Illustrator and Inkscape. On platforms that support OpenType SVG fonts (like Windows apps, Edge and Firefox), the color glyphs are rendered. Other platforms will automatically fall back to the monochromatic glyphs. For more information, please see the OpenType SVG Font Editor’s GitHub page.

The tool was developed by a group of Microsoft interns on the Windows graphics team. We found the tool useful, so we’ve made it available as an open-source project for others to use and improve.

Conclusion

Color fonts are an exciting new technology that unlocks richer text scenarios than were previously possible without sacrificing platform support for accessibility, fallback, scalability, printing and complex font capabilities. For more information, please see the following resources:

The post Using color fonts for beautiful text and icons appeared first on Building Apps for Windows.

How to distribute your existing Desktop Applications via Windows Store to Windows 10 PCs – including the new Windows 10 S configuration

$
0
0

Overview

Windows 10 S is a specific configuration of Windows 10 Pro that offers a familiar, productive Windows experience that’s streamlined for security and performance. By exclusively using apps in the Windows Store and ensuring that you browse safely with Microsoft Edge, Windows 10 S keeps you running fast and secure day in and day out. Windows 10 S was inspired by students and teachers and it’s the best Windows ever for schools. It’s also a great choice for any Windows customer looking for consistent performance and advanced security. By limiting apps to those in the Windows Store, Windows 10 S is ideal for people who have everything they need in the Windows Store and prefer the peace of mind that comes with removing the risk of downloading apps from other places.

What do I do with my existing non-Store app? Desktop Bridge is the answer

With the Desktop Bridge you can easily package your current desktop application or game as an .appx, distribute through the Windows Store and target all Windows Desktop devices including Windows 10 S to increase your user reach and easier monetization.

You can package any desktop application such as: WPF, WinForms, MFC, VB6, etc.

Once completed, your users will enjoy from smooth installation and update experiences: Clean, simple and fast install/uninstall updates via differential packages, streaming and many more.

Now you can also modernize your app with the Universal Windows Platform (UWP) to increase user engagement and reach all Windows devices.

We have a lot of customers that already went through the process such as: Kodi, Slack, Evernote, Adobe Photoshop Elements 15 and many others.

Here are few customers that shared their stories:

  1. MusiXmatch is the world’s largest lyrics platform with millions of lyrics available online and more than 50 million users on various platforms
  2. Tale of Wuxia (侠客风云传) is a traditional desktop Win32 role-playing game (RPG) that was created by Heluo Studio
  3. CLIP STUDIO PAINT is the leading paint tool software that supports creation of animation and manga

A quote from Evernote:

“The Desktop Bridge vastly simplifies our [Evernote] installer and uninstaller. It also opens up UWP APIs including Live Tiles and notifications. And having the full-featured Evernote app in the Windows Store means future improvements will reach users faster.”

—Seth Hitchings, VP Engineering, Evernote

What should I do next?

  1. Register as an app developer in the Windows Dev Center
  2. Prepare to package your application
  3. Sign up and get started using the Desktop Bridge
  4. Package your current desktop application as an .appx
  5. Test your Windows app for Windows 10 S, you can also check out this blog post for more details
  6. Submit your app to the Windows Store

Resources

Did you find this post helpful? Please let us know in the comments below—and also let us know if there’s anything else you’d like us to dig into for you about this topic.

Enjoy!

The post How to distribute your existing Desktop Applications via Windows Store to Windows 10 PCs – including the new Windows 10 S configuration appeared first on Building Apps for Windows.

Monetizing your app: Set your COPPA settings for your app

$
0
0

The Children’s Online Privacy Protection Act (COPPA) prohibits operators of commercial websites and online services (including mobile apps) from targeting children below the age of 13 using targeted ads. The Dev Center provides an option for an app developer to specify whether an app or ad unit is targeted to children.

We reminded our developer community back in 2015 to set their application COPPA settings, but several developers have not set their COPPA settings correctly. Doing so greatly affects the revenue that a developer can earn on apps that are not targeted to children under the age of 13.

If a developer selects the COPPA compliance option that his app is directed at children under 13, Microsoft will disable its behavioral advertising services when delivering advertising to the app. If a developer’s app is directed at children under the age of 13, he or she must select this option in “Monetize with ads” under the Monetization section in Dev Center for that specific application.

However, if your app does not target children under 13, then targeted ads are a great way to monetize, so make sure you select the right COPPA setting depending on your app’s content and target audience.

Note that developers may have other legal obligations under COPPA. You should review the FTC’s guidance and consult with your legal counsel regarding COPPA obligations.

Stay tuned for additional tips to increase ad monetization!

The post Monetizing your app: Set your COPPA settings for your app appeared first on Building Apps for Windows.

Sweet UI made possible and easy with Windows.UI and the Windows 10 Creators Update

$
0
0

Since its original debut with the Windows 10 November 2015 update, Windows.UI.Composition has been empowering developers to build fast, beautiful, sweet user interfaces in UWP and has been providing enhancements with every subsequent Windows release. At Build 2017, we revealed what all of this continuous work has been leading up to: The Fluent Design System (aka ‘Project Neon’).

Moving from classic ‘Flat Design’ to Fluent Design requires the visual and performance capabilities that the Composition APIs offers along with the interop features that let you draw on this power from your XAML layer. In case you are not yet familiar with the concepts behind the Composition APIs, here’s a quick refresher on what the Composition APIs are all about.

The Windows.UI.Composition namespace allows Universal Windows Platform (UWP) developers to use a new Visual Layer that will get them closer to the metal, graphically speaking, while still using familiar technologies like XAML and C#. By getting closer to the metal, actually down to the system compositor level, developers are able to get great visual performance and custom UI experiences. By working through the XAML layer, developers get the ease of use they have come to expect out of UWP. This is basically a best of both worlds scenario that puts great responsibility in the developer’s hands. And with great responsibility, as we all know, comes great power.

So why do you need all these graphical and UX superpowers? In addition to giving pizazz to your UWP apps, access to the system compositor level also helps your users to accomplish their tasks faster and more fluidly. For instance, when you use Composition effects to blur a background in response to a click, you are focusing the user’s attention on her current task and removing distractions. This is the sort of subtle UI implementation that actually makes your user’s life easier – and it works best when your user doesn’t even know that you did anything for them. They are just left with the impression that your app is easy to use and feels fast, even if they can’t exactly put their finger on the reason.

The Visual family

To better understand the basic principles of Windows.UI.Composition, it’s important that we also introduce you to the visual family. In order to get fast and fluid effects, you need direct access to something called the system compositor (sometimes also referred to as the DWM). The system compositor is agnostic to the UI thread and doesn’t really care about being on the UI thread or blocking threads. Things happen very quickly at the system compositor level, where everything that is about to be sent to the display screen gets put together. This is also where you get to add additional effects if you want to just before shipping all your visuals to the display.

The visual family lives down at that compositor level where things happen rapidly. The visual family is made up of Visuals, ContainerVisuals and SpriteVisuals. The SpriteVisual class inherits from container visual, and the ContainerVisual class inherits from the base Visual class. There is also a Compositor class which acts as the senior member of the visual family. It quite literally creates visual objects if you need them and also manages the relationship between an application and the system compositor process.

The visual family is a lot of fun. Let’s say your XAML, many levels above, has a Grid object. That Grid will have a member of the visual family assigned to it. In technical parlance, we say that the Grid is backed by a visual. Once you grab hold of this backing visual, you can start to animate it using the composition animation system. If it is a ContainerVisual, then you can add additional visuals to it. Finally, you can also create sprite visuals, using the compositor factory class, in order to add brush effects to your visual using the Windows.UI.Composition effects system.

What’s new for sweet UI in the Windows 10 Creators Update

Several highly requested UI.Composition features have been added in the Creators Update to support fast and fluid UI as well as the Fluent Design System, for instance:

  • SVG support
  • Normal and Virtual Surfaces
  • Hover Interactions
  • Implicit Show and Hide
  • Expression Helpers
  • Offset stomping fix

At first these can seem like small disconnected improvements. Brought together, however, they will make creating beautiful UI both faster and easier.

XAML support for static SVG files

Vector images are often better for icons and logos because they can be resized without losing image quality. Before the Windows 10 Creators Update, however, vector graphics were not supported in XAML and working with iconography in UWP typically involved multiple versions of every image to adapt for multiple DPIs.  Now that that problem is solved, not only does XAML support static SVG files, but they also work with the Composition APIs.

Normal and virtual surfaces

The CompositionDrawingSurface has been a core component of the Composition APIs since the beginning, facilitating interop between XAML and Direct2D or Direct3D. The Creators Update is introducing the CompositionVirtualDrawingSurface for situations where only a portion of the content needs to be shown to the user at any given time. It basically bridges the concepts of graphics culling in video games and the development of infinite lists in desktop enterprise apps.

Independent hover interactions off the UI thread

One of the most powerful things about the Composition APIs is that they allow effects and animations to run independently of your main UI thread at 60 frames per second. With the Creators Update, this feature will also apply to hover animations in order to light up the many pointer activated effects that are a major part of fluent design.

There is also a subtle computer etiquette benefit to this new feature. Have you ever watched a busy animation play while your app’s UI was hanging and tried to move your mouse around in circles to try to make the animation go faster, but it has no effect? That is now a thing of the past.

Implicit show and hide

If you look at the code behind any UWP app, you will likely find that a large portion of UI code is devoted to setting visibility properties on UIElements in order to alternatively hide and show content. With this understanding, the Composition APIs now allow you to associate animations with your visual elements that are implicitly triggered when you hide or show them.


    ElementCompositionPreview.SetImplicitShowAnimation(MainContent, mainContentShowAnimations);
    ElementCompositionPreview.SetImplicitHideAnimation(MainContent, mainContentExitAnimation);

Implicit hide and show animations allow you to continue using this basic UI metaphor while also making it easier to create elegant visuals around them.

Expression helpers

Expression animations provide a way to create mathematical relationships between composition objects that can then be used to drive animations. The results of applying expression animations can often be breathtaking.

One piece of feedback we received about how we implemented expression animations is that it depends heavily on long strings of text like the following:


  rotationAnimation.Expression = "ACos( ( (A.Offset.X * B.Offset.X) + (A.Offset.Y*B.Offset.Y) + (A.Offset.Z * B.Offset.Z) ) / ( Length(A.Offset) *  Length(B.Offset) ) )";
  lineVisual.StartAnimation("RotationAngle", rotationAnimation);

The phrase “magic number” may even have been raised with respect to this. Just in time for the Creators Update, the Expression Builder Library is being introduced to provide you with type safety, IntelliSense and autocompletion as you create your own amazing expression animations.

Translation property

In earlier versions of the Composition APIs, there was a complication in the way UIElement properties were shared between the XAML layer and the Visual Layer that could cause the actual position of the visual to be overwritten or “stomped” in response to layout changes. While there was a workaround previously, there is now an actual fix with the new translation property. To prevent offset stomping, you now just need to enable the new Translation property through the ElementCompositionPreview class.


ElementCompositionPreview.SetIsTranslationEnabled(Rectangle1, true);

This is one of those issues that, if you’ve run into it before, you will feel a slight sense of relief. Just add a mental bookmark for yourself about the Translation property until you need to use it.

The sample gallery

The best way to deep dive into Windows.UI.Composition is by pulling down the sample code that the Composition team created and published to Github. The Windows UI Dev Labs samples, as they’re called, are extensive and visually rich. The samples extend from simple photo effects to complex parallax animations on XAML controls.

Don’t hesitate. It’s hard to really grasp the magnitude of the visual capabilities you are getting with Windows.UI.Composition until you see for yourself all that it empowers you to do.

Wrapping up

In addition to diving into the sample gallery on Github, which is highly recommended, you can also learn more about Windows Composition through the following articles, videos and blog posts.

The post Sweet UI made possible and easy with Windows.UI and the Windows 10 Creators Update appeared first on Building Apps for Windows.

Windows Template Studio 1.1 released!

$
0
0

We’re extremely excited to announce the Windows Template Studio 1.1. In partnership with the community, we’ve been cranking out and iterating new features and functionality. We’re always looking for additional people to help out and if you’re interested, please head to our GitHub at https://aka.ms/wts.

How to get the update:

There are two paths to update to the newest build.

  • Already installed: Visual Studio should auto update the extension. To force an update, Go to Tools->Extensions and Updates.  Then go to Update expander on the left and you should see Windows Template Studio in there and click “Update.”
  • Not installed: Head to https://aka.ms/wtsinstall, click “download” and double click the VSIX installer.

Improvements to the Wizard:

  • Page Reordering
  • The first page doesn’t have to be the Blank page
  • Renaming of pages and background tasks
  • Offline improvements
  • Initial work for supporting localization
  • Code analysis was added

Page updates:

  • Grid page added
  • Chart page added
  • Media/Video page added
  • Web View page has been enhanced

Feature updates:

  • Store SDK Notifications added
  • SettingStorage now has a binary save option (not just string based)

Template improvements:

  • Navigation panel moved to UWP Community Toolkit
  • Styling adjustments
  • ResourceLoader performance improvement

For a full list of issues fixed in the 1.1 release, head over to Github.

 What else is cooking for next versions?

We love all the community support and participation. We’re partnering with additional framework Caliburn.Micro and have a branch currently under development with Nigel Sampson. We’re talking with Prism and Template 10 to see how those frameworks can also be added in. In addition, here are just a few of the things we are currently building out:

  • Fluent design in the templates
  • Project Rome features as options for your project
  • Right-click->add support for existing projects
  • Localization in the wizard
  • Accessibility supported in both wizard and in the templates

If you want to help out, please head over to https://aka.ms/wts.

The post Windows Template Studio 1.1 released! appeared first on Building Apps for Windows.

Smooth as Butter Animations in the Visual Layer with the Windows 10 Creators Update

$
0
0

The Windows 10 Creators Update marks the third major release of the Windows UI platform APIs. With each release, an attempt is frequently made to simplify features introduced in prior releases. This encourages Universal Windows Platform (UWP) developers to standardize on these features. The new hide and show implicit animations are an example of this.

At the same time, too much standardization can potentially lead to conformity, so with each new release more powerful visual features like the new custom animations are also added, which allow developers who are willing and able to dive into them to customize their user interfaces and stand out from the crowd. This inherent tension between ease of use and the power to customize rewards developers for their efforts while also making sure that no one gets left behind.

Hide and show animations for page transitions

Page transitions, often accompanied by state transitions as visual elements, are added to the visual tree of the new page. In fact, a lot of interactivity in UWP simply involves deciding which content to show and which content to hide as the state of the app changes. More often than not, this is tied to changing the value of the Visibility properties of the elements on the screen.

In the Creators Update, two new implicit animation techniques have been added to help you make these transitions more fluid: ElementCompositionPreview.SetImplicitShowAnimation and ElementCompositionPreview.SetImplicitHideAnimation. Whenever a UIElement is loaded or when that element’s Visibility property is set to Visible, the implicit animation associated with it using SetImplicitShowAnimation will play. Similarly, whenever the user navigates away from a page or when a UIElement is hidden, an animation associated with it using the SetImplicitHideAnimation method will be invoked. These two mechanisms make it easier for you to include motion as an inherent aspect of all your visual elements, while providing a seamless experience for your users.

Connected animations

Implicit animations are great for animating controls inside a page. For navigation transitions between pages, however, the Visual Layer provides a different mechanism known as connected animations to help you make your UI even sweeter. Connected animations help the user stay oriented when she is performing common tasks such as context switching from a list of items to a details page.

The Windows UI platform APIs provide a class named the ConnectedAnimationService to coordinate animations between the source page and the destination page during navigation. You access the service by calling the static GetForCurrentView method. Then in the source page, you invoke PrepareToAnimate, passing in a unique key and the image that should be used for the transition animation.


ConnectedAnimationService.GetForCurrentView().PrepareToAnimate("MyUniqueId", image);

In the destination page, you retrieve the image from your ConnectedAnimationService service and invoke TryStart on the ConnectedAnimation while passing in the destination UIElement.


var animation = ConnectedAnimationService.GetForCurrentView().GetAnimation("MyUniqueId");
if (animation != null)
{
    animation.TryStart(DestinationImage);
};

In the Anniversary Update you did not have much control over this animation technique. Everyone got pretty much the same standard one. With the Creators Update, on the other hand, you have lots of new superpowers to personalize your transitions with:

  • Coordinated animations
  • Custom animations
  • Better image animations

Just to reiterate the point made in the introduction, the goal in designing the Windows UI platform APIs is to provide an awesome experience out of the box so you can copy the standard samples and get beautiful, fast and visually appealing visuals. At the same time, this shouldn’t ever take away from your ability to personalize the user experience to create something truly unique and wonderful with powerful new tools, like coordinated animations and custom animations.

Coordinated animations

A coordinated animation is a type of animation that appears alongside your connected animation and which works in coordination with your connected animation target. A coordinated animation gives extra visual flair to your page transition.

In the coordinated animation sample above, caption text that is not present in the source page is added to the destination page. The caption text is animated in tandem with the connected animation. We are doing two things here (in designer terms): providing context between the source and the destination using our connected animation while also adding visual interest with a coordinated animation at the destination. In user experience terms, though, all we’re doing is making the app’s transition animations look really cool.

Coordinated animations are fortunately also easy to implement. The TryStart method of the ConnectedAnimation class provides an override that allows you to pop in an array of visual elements you want to animate in a coordinated fashion. Let’s say that your caption text is in a visual element that you’ve named “DescriptionRoot.” You can add this as a coordinated animation by tweaking the previous code like so:


var animation = ConnectedAnimationService.GetForCurrentView().GetAnimation("MyUniqueId");
if (animation != null)
{
    animation.TryStart(DestinationImage, new UIElement[] { DescriptionRoot });
};

That’s a lot of power packed into a little argument.

Custom animations

By default, the connected animations in the navigation sample move in a straight line from the origin position in the source page to the target position in the destination page. If you select a box in the far-left column, it will move more or less straight up, while if you select a box in the top row, it will more or less move directly left to get to that target position. But what if you could put some English on this?

You can with custom animations, introduced in the Creators Update. The custom animations feature lets you modulate your transitions in four ways:

  • Crossfade – Lets you customize how elements crossfade as source element reaches destination
  • OffsetX – Lets you customize the X channel of Offset
  • OffsetY – Lets you customize the Y channel of Offset
  • Scale – Lets you customize scale of the element as it animates

In order to customize a particular part of a connected animation, you will need to create a keyframe animation and add it to your page transition using the SetAnimationComponent call like so:


var animation = ConnectedAnimationService.GetForCurrentView().GetAnimation("MyUniqueId");

var customXAnimation = Window.Compositor.CreateScalarKeyFrameAnimation();
customXAnimation.Duration = ConnectedAnimationService.GetForCurrentView().DefaultDuration;
customXAnimation.InsertExpressionKeyFrame(0.0f, "StartingValue");
customXAnimation.InsertExpressionKeyFrame(0.5f, "FinalValue + 25");
customXAnimation.InsertExpressionKeyFrame(1.0f, "FinalValue");

animation.SetAnimationComponent(ConnectedAnimationComponent.OffsetX, customXAnimation);

Note that you use expressions to get the starting and ending values of the connected animation.

Awesome image animations

The Creators Update also introduces improved image interpolation for connected animations where the image size and even the relative dimensions are changing between the source and the destination—for instance transitioning from a square to a rectangular image.

This interpolation happens automagically so you have less to worry about.

Implicit animation support for property sets and shadows

Finally, animation capabilities are also extended in the Creators Update by allowing you to apply implicit animations to property sets and shadows.

This change provides developers with even more creative flexibility and the ability to modify shadows in interesting new ways, as shown in the code sample below.


var shadowBlurAnimation = compositor.CreateScalarKeyFrameAnimation();
shadowBlurAnimation.InsertExpressionKeyFrame(1.0f, "this.FinalValue");
shadowBlurAnimation.Duration = TimeSpan.FromSeconds(1);
shadowBlurAnimation.Target = "BlurRadius";

//Associating animations with triggers 
implicitAnimationShadow["BlurRadius"] = shadowBlurAnimation;
implicitAnimationShadow["Opacity"] = shadowOpacityAnimation;
implicitAnimationShadow["Scale"] = shadowScaleAnimation;

implicitAnimationVisual["Translation"] = translationAnimation;
            

//Applying Implicit Animations to objects 
content.Properties.ImplicitAnimations = implicitAnimationVisual;
shadow.DropShadow.ImplicitAnimations = implicitAnimationShadow;

Wrapping up

The visual power being made available to developers through the Windows UI platform APIs have basically always been a part of the UI Framework. They just haven’t always been accessible until now. Think of this as a UI nuclear reactor being handed over to you to play with. With this awesome power, however, also comes the responsibility to create sweet UI and beautiful interactions. Go forth and be amazing.

To learn more about the topics covered in this post, you are encouraged to voraciously consume the following articles and videos:

The post Smooth as Butter Animations in the Visual Layer with the Windows 10 Creators Update appeared first on Building Apps for Windows.

Smooth Interaction and Motion with the Visual Layer in Windows 10 Creators Update

$
0
0

The Composition APIs come with a robust animation engine that provides quick and fluid motion running in a separate process from your Universal Windows Platform (UWP) app. This ensures a consistent 60 frames per second when running your app on an IoT device as well as on a screaming gaming machine. It is, quite simply, fast. This is an essential capability for implementing the Fluent Design System which calls on us to create a sense of cinematic motion in our UWP apps.

The Composition APIs also provide something you probably have never had access to before: the ability to create high-performing, low-level manipulation-driven custom animations like the one shown above.  In the same way that we that want our visuals to be fast and smooth, we want our touch interactions to be sticky and responsive. Moving a visual with a finger or a digital pen should result in the visual element clinging to us no matter how fast we push and pull it across the display.

Even if a motion looks good, it also needs to feel good under the finger. It needs to maintain the illusion that we are interacting with a real object. It ought to possess the proper physics so that when we drag a visual across the screen and let go, it continues with the proper inertial movement. Similarly, user controls should provide the right amount of resistance when we pull and release them.

A fast and fluid animation system

The Visual Layer supports both keyframe animations as well as expression animations. If you have worked with XAML animations before, then you are probably already familiar with how keyframes work. In a keyframe animation, you set values for some property you want to change over time and also assign the duration for the change: in the example below, a start value, a middle value and then an ending value. The animation system will take care of tweening your animation – in other words, generating all the values between the ones you have explicitly specified based on the easing function you select. Whether Linear, or a Cubic Bezier, the animation system will use that to determine the values when interpolating.


CubicBezierEasingFunction cubicBezier = _compositor.CreateCubicBezierEasingFunction(new Vector2(.17f, .67f), new Vector2(1f, 1f));
ScalarKeyFrameAnimation blurAnimation = _compositor.CreateScalarKeyFrameAnimation();
blurAnimation.InsertKeyFrame(0.0f, 0.0f);
blurAnimation.InsertKeyFrame(0.5f, 100.0f);
blurAnimation.InsertKeyFrame(1.0f, 0.0f);
blurAnimation.Duration = TimeSpan.FromSeconds(4);
blurAnimation.IterationBehavior = AnimationIterationBehavior.Forever;
_brush.StartAnimation("Blur.BlurAmount", blurAnimation);

A keyframe animation is a fire-and-forget mechanism that is time based. There are situations, however, when you need your animations to be coordinated and driving each other instead of simply moving in synchronized fashion.

In the animation above (source code), each gray gear is animated based on the animation of the gear preceding it. If the preceding gear suddenly goes faster or reverses direction, it forces the following gear to do the same. Keyframe animations can’t create motion effects that work in this way, but expression animations can. They are able to do so because, while keyframe animations are time based, expression animations are reference based.

The critical code that hooks up the gears for animation is found in the following code sample, which uses the new Expression Builder Library—an open source component released alongside of the Creators Update to construct expression animations. The expression below says that the animation should reference and be driven by the RotationAngleInDegrees property of the Visual that is indicated by the parameter “previousGear”. In the next line, the current Visual’s RotationAngleInDegrees property is finally animated based on the value referred to in an expression.


private void ConfigureGearAnimation(Visual currentGear, Visual previousGear)
{
    // If rotation expression is null then create an expression of a gear rotating the opposite direction

    var _rotateExpression = previousGear.GetReference().RotationAngleInDegrees;

    // Start the animation based on the Rotation Angle in Degrees.
    currentGear.StartAnimation("RotationAngleInDegrees", _rotateExpression);
}

But if an animation can be driven by another animation, you may be wondering, couldn’t we also drive an animation with something more concrete like user input? Why, yes. Yes, we can.

The beauty of the ScrollViewer ManipulationPropertySet

Driving an animation from a ScrollViewer using XAML-Composition interop is fairly easy. With just a few lines of code, you can enhance the visuals of a pre-existing ScrollViewer control with a CompositionAnimation by taking advantage of the GetScrollViewerManipulationPropertySet method on the ElementCompositionPreview class. Using an animation expression, you can tie your animation to the Position of your ScrollViewer component.

You would use this technique if you wanted to add a parallax effect to your XAML or to create a sticky header that stays in place as content scrolls beneath it. In the demo illustrated below (source code), a ScrollViewer is even used to drive a parallax effect on a ListView.

Adding parallax behavior to a XAML page can be accomplished in just a few lines.


// Note: We're not using the ScrollViewer's offset values directly. Instead, we use this PropertySet which holds the position values of the ScrollViewer in real-time.
var scrollPropSet = _scrollProperties.GetSpecializedReference<ManipulationPropertySetReferenceNode>();
var startOffset = ExpressionValues.Constant.CreateConstantScalar("startOffset", 0.0f);
var parallaxValue = 0.5f;
var itemHeight = 0.0f;
var parallax = (scrollPropSet.Translation.Y + startOffset - (0.5f * itemHeight));
_parallaxExpression = parallax * parallaxValue - parallax;
_parallaxExpression.SetScalarParameter("StartOffset", (float)args.ItemIndex * visual.Size.Y / 4.0f);
visual.StartAnimation("Offset.Y", _parallaxExpression);

The even more beautiful InteractionTracker

Driving expression animations with a ScrollViewer is extremely powerful, but what if you want to drive animations using touch gestures that aren’t limited to a pan/zoom gesture? Additionally, when using the ScrollViewer’s manipulations, your animations are linked to the UI thread responsiveness and can lose that buttery-smooth feel when the UI thread gets bogged down.

What if you want to pull items toward you with your finger, as in the demo below (source code), or animate multiple flying images across and into the screen as happens in the demo at the top of this post (source code)?

In order to achieve these effects, you would use the new InteractionTracker and VisualInteractionSource classes. InteractionTracker is a state machine that can be driven by active input. InteractionTracker also maintains a series of properties like Position and ScalePosition as part of maintaining the state. This is what you hook up to your animations. The VisualInteractionSource class, on the other hand, determines what kind of input you will use to drive your InteractionTracker and also when to start handling input (touch in particular).

The following sample code demonstrates a basic implementation of an InteractionTracker. The viewportVisual is simply the backing Visual for the root element on the page. You use this as the VisualInteractionSource for the tracker. In doing so, you specify that you are tracking X and Y manipulations. You also indicate that you want to track inertial movement.


_tracker = InteractionTracker.Create(_compositor);

var interactionSource = VisualInteractionSource.Create(viewportVisual);

interactionSource.PositionXSourceMode = InteractionSourceMode.EnabledWithInertia;
interactionSource.PositionYSourceMode = InteractionSourceMode.EnabledWithInertia;

_tracker.InteractionSources.Add(interactionSource);

Hooking the tracker up to an expression animation works basically the same way as hooking up a gear Visual to another gear Visual, as you did earlier. You call the CreateExpressionAnimation factory method on the current Compositor and reference the Position property of the tracker.


ar positionExpression = _compositor.CreateExpressionAnimation("-tracker.Position");
positionExpression.SetReferenceParameter("tracker", _tracker);

contentVisual.StartAnimation("Offset", positionExpression);

This code uses the InteractionTracker’s position to produce a smooth animation for the Offset of the Visual. You can also power your Blur and Opacity animations for your other Visuals as well. This will have a result where all three animations work together, with values based on how far the user dragged their finger, to result in an amazingly fluid visual experience. Run the demo and try it for yourself (source code).

Those are the basics of driving any animation from any input. What you do with this amazing new power is entirely up to you.

Wrapping up

Expression animations and Visual Layer Interactions are both topics that can become very deep very fast. To help you through these deeper waters, we highly recommend the following videos and articles:

The post Smooth Interaction and Motion with the Visual Layer in Windows 10 Creators Update appeared first on Building Apps for Windows.


Windows 10 SDK Preview Build 16225 Released

$
0
0

Today, we released a new Windows 10 Preview Build of the SDK to be used in conjunction with Windows 10 Insider Preview (Build 16225 or greater). The Preview SDK Build 16225 contains bug fixes and under development changes to the API surface area.

The Preview SDK can be downloaded from developer section on Windows Insider.

For feedback and updates to the known issues, please see the developer forum. For new feature requests, head over to our Windows Platform UserVoice.

Things to note:

  • This build works in conjunction with previously released SDKs and Visual Studio 2017. You can install this SDK and still also continue to submit your apps that target Windows 10 Creators build or earlier to the store.
  • The Windows SDK will now formally only be supported by Visual Studio 2017 and greater. You can download the Visual Studio 2017 here.

Known Issues

  • Designer fails to render: When viewing the XAML in the Designer Window in Visual Studio, the controls fail to render. This can be resolved by using Visual Studio 2017.3 Preview.
  • Compilation fails on non-Windows 10 platforms: When building apps on previous platforms, you may get a build error:

C:\program files (x860\Windows Kits\10\bin\10.0.16225.0\x86\genxbf.dll:C:\program files (x860\Windows Kits\10\bin\10.0.16225.0\x86\genxbf.dll(0,0): Error WMC0621: Cannot resolve ‘GenXbf.dll’ under path ‘C:\program files (x860\Windows Kits\10\bin\10.0.16225.0\x86\genxbf.dll’. Please install the latest version of the Windows 10 Software Development Kit.
Process ‘msbuild.exe’ exited with code ‘1’.

This will occur if the minimum target platform version is set to 10.0.16225.0. To work around this, right click on your project file and choose properties or open your project file in your favorite editor, and change the version to a previous released SDK. For example:


<WindowsTargetPlatformMinVersion>10.0.10586.0</WindowsTargetPlatformMinVersion>

Breaking Changes

API Updates and Additions

When targeting new APIs, consider writing your app to be adaptive in order to run correctly on the widest number of Windows 10 devices. Please see Dynamically detecting features with API contracts (10 by 10) for more information.

 
namespace Windows.ApplicationModel.Calls {
  public sealed class VoipCallCoordinator {
    VoipPhoneCall SetupNewAcceptedCall(string context, string contactName, string contactNumber, string serviceName, VoipPhoneCallMedia media);
  }
  public sealed class VoipPhoneCall {
    void TryShowAppUI();
  }
}
namespace Windows.ApplicationModel {
  public enum StartupTaskState {
    DisabledByPolicy = 3,
  }
}
namespace Windows.Devices.SmartCards {
  public sealed class SmartCardCryptogramGenerator {
    public static bool IsSupported();
  }
  public enum SmartCardCryptogramGeneratorOperationStatus {
    NotSupported = 13,
  }
  public sealed class SmartCardEmulator {
    public static bool IsSupported();
  }
}
namespace Windows.ApplicationModel {
  public static class DesignMode {
    public static bool DesignMode2Enabled { get; }
  }
  public sealed class PackageCatalog {
    IAsyncOperation<PackageCatalogRemoveOptionalPackagesResult> RemoveOptionalPackagesAsync(IIterable<string> optionalPackageFamilyNames);
  }
  public sealed class PackageCatalogRemoveOptionalPackagesResult
}
namespace Windows.ApplicationModel.Activation {
  public enum ActivationKind {
    CommandLineLaunch = 1021,
    GameUIProvider = 1019,
    PrintWorkflowForegroundTask = 1018,
    StartupTask = 1020,
  }
  public sealed class CommandLineActivatedEventArgs : IActivatedEventArgs, IActivatedEventArgsWithUser, ICommandLineActivatedEventArgs
  public sealed class CommandLineActivationOperation
  public interface ICommandLineActivatedEventArgs : IActivatedEventArgs
  public interface IStartupTaskActivatedEventArgs : IActivatedEventArgs
  public sealed class StartupTaskActivatedEventArgs : IActivatedEventArgs, IActivatedEventArgsWithUser, IStartupTaskActivatedEventArgs
}
namespace Windows.ApplicationModel.Appointments {
  public sealed class AppointmentStore {
    AppointmentStoreChangeTracker GetChangeTracker(string identity);
  }
  public sealed class AppointmentStoreChangeTracker {
    bool IsTracking { get; }
  }
}
namespace Windows.ApplicationModel.AppService {
  public sealed class AppServiceTriggerDetails {
    IAsyncOperation<bool> CheckCallerForCapabilityAsync(string capabilityName);
  }
}
namespace Windows.ApplicationModel.Background {
  public sealed class GeovisitTrigger : IBackgroundTrigger
  public sealed class PaymentAppCanMakePaymentTrigger : IBackgroundTrigger
}
namespace Windows.ApplicationModel.Contacts {
  public sealed class ContactChangeTracker {
    bool IsTracking { get; }
  }
  public sealed class ContactList {
    ContactListLimitedWriteOperations LimitedWriteOperations { get; }
    ContactChangeTracker GetChangeTracker(string identity);
  }
  public sealed class ContactListLimitedWriteOperations
  public enum ContactListOtherAppWriteAccess {
    Limited = 2,
  }
  public sealed class ContactStore {
    ContactChangeTracker GetChangeTracker(string identity);
  }
}
namespace Windows.ApplicationModel.Contacts.DataProvider {
  public sealed class ContactDataProviderConnection {
    event TypedEventHandler<ContactDataProviderConnection, ContactListCreateOrUpdateContactRequestEventArgs> CreateOrUpdateContactRequested;
    event TypedEventHandler<ContactDataProviderConnection, ContactListDeleteContactRequestEventArgs> DeleteContactRequested;
  }
  public sealed class ContactListCreateOrUpdateContactRequest
  public sealed class ContactListCreateOrUpdateContactRequestEventArgs
  public sealed class ContactListDeleteContactRequest
  public sealed class ContactListDeleteContactRequestEventArgs
}
namespace Windows.ApplicationModel.Core {
  public sealed class AppListEntry {
    string AppUserModelId { get; }
  }
  public enum AppRestartFailureReason
  public static class CoreApplication {
    public static IAsyncOperation<AppRestartFailureReason> RequestRestartAsync(string launchArguments);
    public static IAsyncOperation<AppRestartFailureReason> RequestRestartForUserAsync(User user, string launchArguments);
  }
  public sealed class CoreApplicationView {
    DispatcherQueue DispatcherQueue { get; }
  }
}
namespace Windows.ApplicationModel.DataTransfer {
  public sealed class DataTransferManager {
    public static void ShowShareUI(ShareUIOptions options);
  }
  public sealed class ShareUIOptions
  public enum ShareUITheme
}
namespace Windows.ApplicationModel.DataTransfer.ShareTarget {
  public sealed class ShareOperation {
    IVectorView<Contact> Contacts { get; }
  }
}
namespace Windows.ApplicationModel.Email {
  public sealed class EmailMailbox {
    EmailMailboxChangeTracker GetChangeTracker(string identity);
  }
}
namespace Windows.ApplicationModel.Payments {
  public sealed class PaymentCanMakePaymentResult
  public enum PaymentCanMakePaymentResultStatus
  public sealed class PaymentMediator {
    IAsyncOperation<PaymentCanMakePaymentResult> CanMakePaymentAsync(PaymentRequest paymentRequest);
  }
  public sealed class PaymentRequest {
    public PaymentRequest(PaymentDetails details, IIterable<PaymentMethodData> methodData, PaymentMerchantInfo merchantInfo, PaymentOptions options, string id);
    string Id { get; }
  }
}
namespace Windows.ApplicationModel.Payments.Provider {
  public sealed class PaymentAppCanMakePaymentTriggerDetails
}
namespace Windows.ApplicationModel.UserActivities {
  public interface IUserActivityContentInfo
  public sealed class UserActivity
  public sealed class UserActivityAttribution
  public sealed class UserActivityChannel
  public sealed class UserActivityContentInfo : IUserActivityContentInfo
  public sealed class UserActivitySession : IClosable
  public enum UserActivityState
  public sealed class UserActivityVisualElements
}
namespace Windows.ApplicationModel.UserActivities.Core {
  public static class CoreUserActivityManager
}
namespace Windows.Devices.Bluetooth {
  public sealed class BluetoothDevice : IClosable {
    BluetoothDeviceId BluetoothDeviceId { get; }
  }
  public sealed class BluetoothDeviceId {
    public static BluetoothDeviceId FromId(string deviceId);
  }
  public sealed class BluetoothLEDevice : IClosable {
    BluetoothDeviceId BluetoothDeviceId { get; }
  }
}
namespace Windows.Devices.Bluetooth.GenericAttributeProfile {
  public sealed class GattClientNotificationResult {
    ushort BytesSent { get; }
  }
}
namespace Windows.Devices.Geolocation {
  public sealed class Geovisit
  public sealed class GeovisitMonitor
  public sealed class GeovisitStateChangedEventArgs
  public sealed class GeovisitTriggerDetails
  public enum VisitMonitoringScope
  public enum VisitStateChange
}
namespace Windows.Devices.PointOfService {
  public sealed class ClaimedLineDisplay : IClosable {
    LineDisplayCustomGlyphs CustomGlyphs { get; }
    Size MaxBitmapSizeInPixels { get; }
    IVectorView<int> SupportedCharacterSets { get; }
    IVectorView<Size> SupportedScreenSizesInCharacters { get; }
    event TypedEventHandler<ClaimedLineDisplay, LineDisplayStatusUpdatedEventArgs> StatusUpdated;
    IAsyncOperation<string> CheckHealthAsync(UnifiedPosHealthCheckLevel level);
    IAsyncOperation<LineDisplayPowerStatus> CheckPowerStatusAsync();
    LineDisplayAttributes GetAttributes();
    IAsyncOperation<string> GetStatisticsAsync(IIterable<string> statisticsCategories);
    IAsyncOperation<bool> TryClearDescriptorsAsync();
    IAsyncOperation<LineDisplayWindow> TryCreateWindowAsync(Rect viewport, Size windowSize);
    IAsyncOperation<bool> TrySetDescriptorAsync(uint descriptor, LineDisplayDescriptorState descriptorState);
    IAsyncOperation<LineDisplayStoredBitmap> TryStoreStorageFileBitmapAsync(StorageFile bitmap);
    IAsyncOperation<LineDisplayStoredBitmap> TryStoreStorageFileBitmapAsync(StorageFile bitmap, LineDisplayHorizontalAlignment horizontalAlignment, LineDisplayVerticalAlignment verticalAlignment);
    IAsyncOperation<LineDisplayStoredBitmap> TryStoreStorageFileBitmapAsync(StorageFile bitmap, LineDisplayHorizontalAlignment horizontalAlignment, LineDisplayVerticalAlignment verticalAlignment, int widthInPixels);
    IAsyncOperation<bool> TryUpdateAttributesAsync(LineDisplayAttributes attributes);
  }
  public sealed class LineDisplay : IClosable {
    public static LineDisplayStatisticsCategorySelector StatisticsCategorySelector { get; }
    IAsyncOperation<LineDisplayPowerStatus> CheckPowerStatusAsync();
  }
  public sealed class LineDisplayAttributes
  public sealed class LineDisplayCursor
  public sealed class LineDisplayCursorAttributes
  public enum LineDisplayCursorType
  public sealed class LineDisplayCustomGlyphs
  public enum LineDisplayDescriptorState
  public enum LineDisplayHorizontalAlignment
  public sealed class LineDisplayMarquee
  public enum LineDisplayMarqueeFormat
  public enum LineDisplayPowerStatus
  public sealed class LineDisplayStatisticsCategorySelector
  public sealed class LineDisplayStatusUpdatedEventArgs
  public sealed class LineDisplayStoredBitmap
  public enum LineDisplayVerticalAlignment
  public sealed class LineDisplayWindow : IClosable {
    LineDisplayCursor Cursor { get; }
    LineDisplayMarquee Marquee { get; }
    IAsyncOperation<uint> ReadCharacterAtCursorAsync();
    IAsyncOperation<bool> TryDisplayStorageFileBitmapAtCursorAsync(StorageFile bitmap);
    IAsyncOperation<bool> TryDisplayStorageFileBitmapAtCursorAsync(StorageFile bitmap, LineDisplayHorizontalAlignment horizontalAlignment, LineDisplayVerticalAlignment verticalAlignment);
    IAsyncOperation<bool> TryDisplayStorageFileBitmapAtCursorAsync(StorageFile bitmap, LineDisplayHorizontalAlignment horizontalAlignment, LineDisplayVerticalAlignment verticalAlignment, int widthInPixels);
    IAsyncOperation<bool> TryDisplayStorageFileBitmapAtPointAsync(StorageFile bitmap, Point offsetInPixels);
    IAsyncOperation<bool> TryDisplayStorageFileBitmapAtPointAsync(StorageFile bitmap, Point offsetInPixels, int widthInPixels);
    IAsyncOperation<bool> TryDisplayStoredBitmapAtCursorAsync(LineDisplayStoredBitmap bitmap);
  }
}
namespace Windows.Devices.Sensors {
  public sealed class Accelerometer {
    public static IAsyncOperation<Accelerometer> FromIdAsync(string deviceId);
    public static string GetDeviceSelector(AccelerometerReadingType readingType);
  }
  public sealed class AccelerometerReading {
    IReference<TimeSpan> PerformanceCount { get; }
    IMapView<string, object> Properties { get; }
  }
  public sealed class Altimeter {
    uint MaxBatchSize { get; }
    uint ReportLatency { get; set; }
  }
  public sealed class AltimeterReading {
    IReference<TimeSpan> PerformanceCount { get; }
    IMapView<string, object> Properties { get; }
  }
  public sealed class Barometer {
    uint MaxBatchSize { get; }
    uint ReportLatency { get; set; }
    public static IAsyncOperation<Barometer> FromIdAsync(string deviceId);
    public static string GetDeviceSelector();
  }
  public sealed class BarometerReading {
    IReference<TimeSpan> PerformanceCount { get; }
    IMapView<string, object> Properties { get; }
  }
  public sealed class Compass {
    uint MaxBatchSize { get; }
    uint ReportLatency { get; set; }
    public static IAsyncOperation<Compass> FromIdAsync(string deviceId);
    public static string GetDeviceSelector();
  }
  public sealed class CompassReading {
    IReference<TimeSpan> PerformanceCount { get; }
    IMapView<string, object> Properties { get; }
  }
  public sealed class Gyrometer {
    uint MaxBatchSize { get; }
    uint ReportLatency { get; set; }
    public static IAsyncOperation<Gyrometer> FromIdAsync(string deviceId);
    public static string GetDeviceSelector();
  }
  public sealed class GyrometerReading {
    IReference<TimeSpan> PerformanceCount { get; }
    IMapView<string, object> Properties { get; }
  }
  public sealed class Inclinometer {
    uint MaxBatchSize { get; }
    uint ReportLatency { get; set; }
    public static IAsyncOperation<Inclinometer> FromIdAsync(string deviceId);
    public static string GetDeviceSelector(SensorReadingType readingType);
  }
  public sealed class InclinometerReading {
    IReference<TimeSpan> PerformanceCount { get; }
    IMapView<string, object> Properties { get; }
  }
  public sealed class LightSensor {
    uint MaxBatchSize { get; }
    uint ReportLatency { get; set; }
    public static IAsyncOperation<LightSensor> FromIdAsync(string deviceId);
    public static string GetDeviceSelector();
  }
  public sealed class LightSensorReading {
    IReference<TimeSpan> PerformanceCount { get; }
    IMapView<string, object> Properties { get; }
  }
  public sealed class Magnetometer {
    uint MaxBatchSize { get; }
    uint ReportLatency { get; set; }
    public static IAsyncOperation<Magnetometer> FromIdAsync(string deviceId);
    public static string GetDeviceSelector();
  }
  public sealed class MagnetometerReading {
    IReference<TimeSpan> PerformanceCount { get; }
    IMapView<string, object> Properties { get; }
  }
  public sealed class OrientationSensor {
    uint MaxBatchSize { get; }
    uint ReportLatency { get; set; }
    public static IAsyncOperation<OrientationSensor> FromIdAsync(string deviceId);
    public static string GetDeviceSelector(SensorReadingType readingType);
    public static string GetDeviceSelector(SensorReadingType readingType, SensorOptimizationGoal optimizationGoal);
  }
  public sealed class OrientationSensorReading {
    IReference<TimeSpan> PerformanceCount { get; }
    IMapView<string, object> Properties { get; }
  }
}
namespace Windows.Devices.Sensors.Custom {
  public sealed class CustomSensor {
    uint MaxBatchSize { get; }
    uint ReportLatency { get; set; }
  }
  public sealed class CustomSensorReading {
    IReference<TimeSpan> PerformanceCount { get; }
  }
}
namespace Windows.Devices.WiFi {
  public sealed class WiFiAdapter {
    IAsyncOperation<WiFiConnectionResult> ConnectAsync(WiFiAvailableNetwork availableNetwork, WiFiReconnectionKind reconnectionKind, PasswordCredential passwordCredential, string ssid, WiFiConnectionMethod connectionMethod);
    IAsyncOperation<WiFiWpsConfigurationResult> GetWpsConfigurationAsync(WiFiAvailableNetwork availableNetwork);
  }
  public enum WiFiConnectionMethod
  public sealed class WiFiWpsConfigurationResult
  public enum WiFiWpsConfigurationStatus
  public enum WiFiWpsKind
}
namespace Windows.Gaming.Input {
  public sealed class RawGameController : IGameController, IGameControllerBatteryInfo {
    string DisplayName { get; }
    string NonRoamableId { get; }
    IVectorView<SimpleHapticsController> SimpleHapticsControllers { get; }
  }
}
namespace Windows.Gaming.UI {
  public sealed class GameMonitor
  public enum GameMonitoringPermission
}
namespace Windows.Graphics.Holographic {
  public sealed class HolographicCamera {
    PresentationLayerDrmMode DrmMode { get; set; }
    PresentationLayerConfig CreateLayerConfig();
    PresentationLayers GetPresentationLayers();
    void SetLayerConfig(PresentationLayerConfig layerConfig);
  }
  public sealed class HolographicCameraRenderingParameters {
    PresentationLayerRenderingParametersQuad GetPresentationLayerRenderingParameters(PresentationLayerQuad layer);
  }
  public sealed class HolographicDisplay {
    double RefreshRate { get; }
  }
  public sealed class HolographicSpace {
    public static bool IsConfigured { get; }
  }
  public sealed class PresentationLayerConfig
  public enum PresentationLayerDrmMode
  public sealed class PresentationLayerQuad
  public sealed class PresentationLayerReference
  public sealed class PresentationLayerRenderingParametersQuad
  public sealed class PresentationLayers
  public sealed class PresentationLayerSettings
  public enum PresentationLayerType
}
namespace Windows.Graphics.Printing.PrintTicket {
  public sealed class PrintTicketCapabilities
  public sealed class PrintTicketFeature
  public enum PrintTicketFeatureSelectionType
  public sealed class PrintTicketOption
  public enum PrintTicketParameterDataType
  public sealed class PrintTicketParameterDefinition
  public sealed class PrintTicketParameterInitializer
  public sealed class PrintTicketValue
  public enum PrintTicketValueType
  public sealed class WorkflowPrintTicket
  public sealed class WorkflowPrintTicketValidationResult
}
namespace Windows.Graphics.Printing.Workflow {
  public sealed class PrintWorkflowBackgroundSession
  public sealed class PrintWorkflowBackgroundSetupRequestedEventArgs
  public sealed class PrintWorkflowConfiguration
  public sealed class PrintWorkflowForegroundSession
  public sealed class PrintWorkflowForegroundSetupRequestedEventArgs
  public sealed class PrintWorkflowObjectModelSourceFileContent
  public sealed class PrintWorkflowObjectModelTargetPackage
  public enum PrintWorkflowSessionStatus
  public sealed class PrintWorkflowSourceContent
  public sealed class PrintWorkflowSpoolStreamContent
  public sealed class PrintWorkflowStreamTarget
  public sealed class PrintWorkflowSubmittedEventArgs
  public sealed class PrintWorkflowSubmittedOperation
  public enum PrintWorkflowSubmittedStatus
  public sealed class PrintWorkflowTarget
  public sealed class PrintWorkflowTriggerDetails
  public sealed class PrintWorkflowUIActivatedEventArgs : IActivatedEventArgs, IActivatedEventArgsWithUser
  public sealed class PrintWorkflowXpsDataAvailableEventArgs
}
namespace Windows.Management.Deployment {
  public enum AddPackageByAppInstallerOptions : uint
  public sealed class PackageManager {
    IAsyncOperationWithProgress<DeploymentResult, DeploymentProgress> AddPackageAsync(Uri packageUri, IIterable<Uri> dependencyPackageUris, DeploymentOptions options, PackageVolume targetVolume, IIterable<string> optionalPackageFamilyNames, IIterable<Uri> packageUrisToInstall, IIterable<Uri> relatedPackageUris);
    IAsyncOperationWithProgress<DeploymentResult, DeploymentProgress> AddPackageByAppInstallerFileAsync(Uri appInstallerFileUri, AddPackageByAppInstallerOptions options, PackageVolume targetVolume);
    IAsyncOperationWithProgress<DeploymentResult, DeploymentProgress> ProvisionPackageForAllUsersAsync(string packageFamilyName);
    IAsyncOperationWithProgress<DeploymentResult, DeploymentProgress> RequestAddPackageAsync(Uri packageUri, IIterable<Uri> dependencyPackageUris, DeploymentOptions deploymentOptions, PackageVolume targetVolume, IIterable<string> optionalPackageFamilyNames, IIterable<Uri> relatedPackageUris);
    IAsyncOperationWithProgress<DeploymentResult, DeploymentProgress> RequestAddPackageByAppInstallerFileAsync(Uri appInstallerFileUri, AddPackageByAppInstallerOptions options, PackageVolume targetVolume);
    IAsyncOperationWithProgress<DeploymentResult, DeploymentProgress> StagePackageAsync(Uri packageUri, IIterable<Uri> dependencyPackageUris, DeploymentOptions options, PackageVolume targetVolume, IIterable<string> optionalPackageFamilyNames, IIterable<Uri> packageUrisToInstall, IIterable<Uri> relatedPackageUris);
  }
}
namespace Windows.Media.Capture {
  public sealed class AppCapture {
    public static IAsyncAction SetAllowedAsync(bool allowed);
  }
}
namespace Windows.Media.Capture.Frames {
  public sealed class MediaFrameReader : IClosable {
    MediaFrameReaderAcquisitionMode AcquisitionMode { get; set; }
  }
  public enum MediaFrameReaderAcquisitionMode
  public sealed class MultiSourceMediaFrameReader : IClosable {
    MediaFrameReaderAcquisitionMode AcquisitionMode { get; set; }
  }
}
namespace Windows.Media.Core {
  public sealed class AudioStreamDescriptor : IMediaStreamDescriptor, IMediaStreamDescriptor2 {
    string Label { get; set; }
  }
  public interface IMediaStreamDescriptor2 : IMediaStreamDescriptor
  public sealed class InitializeMediaStreamSourceRequestedEventArgs
  public static class LowLightFusion
  public sealed class LowLightFusionResult : IClosable
  public sealed class MediaSource : IClosable, IMediaPlaybackSource {
    public static MediaSource CreateFromMediaFrameSource(MediaFrameSource frameSource);
  }
  public sealed class MediaSourceAppServiceConnection
  public sealed class MediaStreamSource : IMediaSource {
    bool IsLive { get; set; }
  }
  public sealed class MseStreamSource : IMediaSource {
    IReference<MseTimeRange> LiveSeekableRange { get; set; }
  }
  public sealed class SceneAnalysisEffectFrame : IClosable, IMediaFrame {
    SceneAnalysisRecommendation AnalysisRecommendation { get; }
  }
  public enum SceneAnalysisRecommendation
  public sealed class VideoStreamDescriptor : IMediaStreamDescriptor, IMediaStreamDescriptor2 {
    string Label { get; set; }
  }
}
namespace Windows.Media.DialProtocol {
  public sealed class DialReceiverApp
}
namespace Windows.Media.MediaProperties {
  public sealed class MediaEncodingProfile {
    IVector<AudioStreamDescriptor> GetAudioTracks();
    IVector<VideoStreamDescriptor> GetVideoTracks();
    void SetAudioTracks(IIterable<AudioStreamDescriptor> value);
    void SetVideoTracks(IIterable<VideoStreamDescriptor> value);
  }
}
namespace Windows.Media.Playback {
  public sealed class MediaPlaybackSessionBufferingStartedEventArgs
  public sealed class MediaPlayer : IClosable {
    event TypedEventHandler<MediaPlayer, object> SubtitleFrameChanged;
    bool RenderSubtitlesToSurface(IDirect3DSurface destination);
    bool RenderSubtitlesToSurface(IDirect3DSurface destination, Rect targetRectangle);
  }
}
namespace Windows.Media.Protection.PlayReady {
  public enum PlayReadyEncryptionAlgorithm {
    Aes128Cbc = 5,
    Unspecified = 65535,
  }
  public enum PlayReadyHardwareDRMFeatures {
    Aes128Cbc = 3,
  }
}
namespace Windows.Media.SpeechRecognition {
  public sealed class SpeechRecognizer : IClosable {
    public static IAsyncOperation<bool> TrySetSystemSpeechLanguageAsync(Language speechLanguage);
  }
}
namespace Windows.Media.SpeechSynthesis {
  public sealed class SpeechSynthesizer : IClosable {
    public static IAsyncOperation<bool> TrySetDefaultVoiceAsync(VoiceInformation voice);
  }
  public sealed class SpeechSynthesizerOptions {
    double AudioPitch { get; set; }
    double AudioVolume { get; set; }
    double SpeakingRate { get; set; }
  }
}
namespace Windows.Media.Streaming.Adaptive {
  public sealed class AdaptiveMediaSourceDiagnosticAvailableEventArgs {
    HResult ExtendedError { get; }
  }
  public enum AdaptiveMediaSourceDiagnosticType {
    FatalMediaSourceError = 8,
  }
}
namespace Windows.Networking.BackgroundTransfer {
  public struct BackgroundTransferFileRange
  public sealed class BackgroundTransferRangesDownloadedEventArgs
  public enum BackgroundTransferStatus {
    PausedRecoverableWebErrorStatus = 8,
  }
  public sealed class DownloadOperation : IBackgroundTransferOperation, IBackgroundTransferOperationPriority {
    IReference<WebErrorStatus> CurrentWebErrorStatus { get; }
    bool IsRandomAccessRequired { get; set; }
    IVector<WebErrorStatus> RecoverableWebErrorStatuses { get; }
    Uri RequestedUri { get; set; }
    event TypedEventHandler<DownloadOperation, BackgroundTransferRangesDownloadedEventArgs> RangesDownloaded;
    IVector<BackgroundTransferFileRange> GetDownloadedRanges();
    IRandomAccessStreamReference GetResultRandomAccessStreamReference();
  }
}
namespace Windows.Networking.Connectivity {
  public sealed class ConnectionProfile {
    IAsyncOperation<IVectorView<ProviderNetworkUsage>> GetProviderNetworkUsageAsync(DateTime startTime, DateTime endTime, NetworkUsageStates states);
  }
  public sealed class ProviderNetworkUsage
}
namespace Windows.Networking.NetworkOperators {
  public sealed class MobileBroadbandAntennaSar
  public sealed class MobileBroadbandCellCdma
  public sealed class MobileBroadbandCellGsm
  public sealed class MobileBroadbandCellLte
  public sealed class MobileBroadbandCellsInfo
  public sealed class MobileBroadbandCellTdscdma
  public sealed class MobileBroadbandCellUmts
  public sealed class MobileBroadbandModem {
    IAsyncOperation<bool> GetIsPassthroughEnabledAsync();
    IAsyncOperation<MobileBroadbandModemStatus> SetIsPassthroughEnabledAsync(bool value);
  }
  public sealed class MobileBroadbandModemConfiguration {
    MobileBroadbandSarManager SarManager { get; }
  }
  public enum MobileBroadbandModemStatus
  public sealed class MobileBroadbandNetwork {
    IAsyncOperation<MobileBroadbandCellsInfo> GetCellsInfoAsync();
  }
  public sealed class MobileBroadbandSarManager
  public sealed class MobileBroadbandTransmissionStateChangedEventArgs
}
namespace Windows.Networking.Sockets {
  public sealed class MessageWebSocketControl : IWebSocketControl, IWebSocketControl2 {
    TimeSpan ActualUnsolicitedPongInterval { get; }
    Certificate ClientCertificate { get; set; }
    TimeSpan DesiredUnsolicitedPongInterval { get; set; }
    MessageWebSocketReceiveMode ReceiveMode { get; set; }
  }
  public sealed class MessageWebSocketMessageReceivedEventArgs {
    bool IsMessageComplete { get; }
  }
  public enum MessageWebSocketReceiveMode
  public enum SocketProtectionLevel {
    Unspecified = 9,
  }
  public sealed class StreamSocketControl {
    SocketProtectionLevel MinProtectionLevel { get; set; }
  }
  public sealed class StreamWebSocketControl : IWebSocketControl, IWebSocketControl2 {
    TimeSpan ActualUnsolicitedPongInterval { get; }
    Certificate ClientCertificate { get; set; }
    TimeSpan DesiredUnsolicitedPongInterval { get; set; }
  }
}
namespace Windows.Security.Authentication.Web.Provider {
  public static class WebAccountManager {
    public static IAsyncAction InvalidateAppCacheForAccountAsync(WebAccount webAccount);
    public static IAsyncAction InvalidateAppCacheForAllAccountsAsync();
  }
}
namespace Windows.Services.Maps {
  public sealed class MapRoute {
    bool IsScenic { get; }
  }
  public enum MapRouteOptimization {
    Scenic = 3,
  }
  public sealed class PlaceInfo
  public sealed class PlaceInfoCreateOptions
}
namespace Windows.Storage {
  public sealed class StorageLibrary {
    IAsyncOperation<bool> AreFolderSuggestionsAvailableAsync();
  }
  public sealed class StorageProvider {
    IAsyncOperation<bool> IsPropertySupportedForPartialFileAsync(string propertyCanonicalName);
  }
}
namespace Windows.Storage.Search {
  public enum IndexerOption {
    OnlyUseIndexerAndOptimizeForIndexedProperties = 3,
  }
}
namespace Windows.Storage.Streams {
  public enum FileOpenDisposition
  public sealed class FileRandomAccessStream : IClosable, IInputStream, IOutputStream, IRandomAccessStream {
    public static IAsyncOperation<IRandomAccessStream> OpenAsync(string filePath, FileAccessMode accessMode);
    public static IAsyncOperation<IRandomAccessStream> OpenAsync(string filePath, FileAccessMode accessMode, StorageOpenOptions sharingOptions, FileOpenDisposition openDisposition);
    public static IAsyncOperation<IRandomAccessStream> OpenForUserAsync(User user, string filePath, FileAccessMode accessMode);
    public static IAsyncOperation<IRandomAccessStream> OpenForUserAsync(User user, string filePath, FileAccessMode accessMode, StorageOpenOptions sharingOptions, FileOpenDisposition openDisposition);
    public static IAsyncOperation<StorageStreamTransaction> OpenTransactedWriteAsync(string filePath);
    public static IAsyncOperation<StorageStreamTransaction> OpenTransactedWriteAsync(string filePath, StorageOpenOptions openOptions, FileOpenDisposition openDisposition);
    public static IAsyncOperation<StorageStreamTransaction> OpenTransactedWriteForUserAsync(User user, string filePath);
    public static IAsyncOperation<StorageStreamTransaction> OpenTransactedWriteForUserAsync(User user, string filePath, StorageOpenOptions openOptions, FileOpenDisposition openDisposition);
  }
}
namespace Windows.System {
  public sealed class AppDiagnosticInfo {
    AppResourceGroupInfoWatcher CreateResourceGroupWatcher();
    public static AppDiagnosticInfoWatcher CreateWatcher();
    IVector<AppResourceGroupInfo> GetResourceGroups();
    public static IAsyncOperation<DiagnosticAccessStatus> RequestAccessAsync();
    public static IAsyncOperation<IVector<AppDiagnosticInfo>> RequestInfoForAppAsync();
    public static IAsyncOperation<IVector<AppDiagnosticInfo>> RequestInfoForAppAsync(string appUserModelId);
    public static IAsyncOperation<IVector<AppDiagnosticInfo>> RequestInfoForPackageAsync(string packageFamilyName);
  }
  public sealed class AppDiagnosticInfoWatcher
  public sealed class AppDiagnosticInfoWatcherEventArgs
  public enum AppDiagnosticInfoWatcherStatus
  public sealed class AppMemoryReport {
    ulong ExpectedTotalCommitLimit { get; }
  }
  public sealed class AppResourceGroupBackgroundTaskReport
  public enum AppResourceGroupEnergyQuotaState
  public enum AppResourceGroupExecutionState
  public sealed class AppResourceGroupInfo
  public sealed class AppResourceGroupInfoWatcher
  public sealed class AppResourceGroupInfoWatcherEventArgs
  public sealed class AppResourceGroupInfoWatcherExecutionStateChangedEventArgs
  public enum AppResourceGroupInfoWatcherStatus
  public sealed class AppResourceGroupMemoryReport
  public sealed class AppResourceGroupStateReport
  public enum DiagnosticAccessStatus
  public sealed class DispatcherQueue
  public sealed class DispatcherQueueController
  public delegate void DispatcherQueueHandler();
  public enum DispatcherQueuePriority
  public sealed class DispatcherQueueShutdownStartingEventArgs
  public sealed class DispatcherQueueTimer
  public static class MemoryManager {
    public static ulong ExpectedAppMemoryUsageLimit { get; }
  }
}
namespace Windows.System.Diagnostics {
  public sealed class DiagnosticActionResult
  public enum DiagnosticActionState
  public sealed class DiagnosticInvoker
  public sealed class ProcessDiagnosticInfo {
    bool IsPackaged { get; }
    IVector<AppDiagnosticInfo> GetAppDiagnosticInfos();
    public static ProcessDiagnosticInfo TryGetForProcessId(uint processId);
  }
}
namespace Windows.System.Profile {
  public enum SystemIdentificationSource {
    Registry = 3,
  }
}
namespace Windows.System.RemoteSystems {
  public sealed class RemoteSystem {
    string ManufacturerDisplayName { get; }
    string ModelDisplayName { get; }
  }
  public static class RemoteSystemKinds {
    public static string Iot { get; }
    public static string Laptop { get; }
    public static string Tablet { get; }
  }
}
namespace Windows.System.UserProfile {
  public static class GlobalizationPreferences {
    public static bool TrySetHomeGeographicRegion(string region);
    public static bool TrySetLanguages(IIterable<string> languageTags);
  }
}
namespace Windows.UI.Composition {
  public sealed class AmbientLight : CompositionLight {
    float Intensity { get; set; }
  }
  public class CompositionAnimation : CompositionObject, ICompositionAnimationBase {
    InitialValueExpressionCollection InitialValueExpressions { get; }
  }
  public sealed class CompositionColorGradientStop : CompositionObject
  public sealed class CompositionColorGradientStopCollection : IIterable<CompositionColorGradientStop>, IVector<CompositionColorGradientStop>
  public enum CompositionColorSpace {
    HslLinear = 3,
    RgbLinear = 4,
  }
  public enum CompositionDropShadowSourcePolicy
  public class CompositionGradientBrush : CompositionBrush
  public enum CompositionGradientExtendMode
  public class CompositionLight : CompositionObject {
    VisualUnorderedCollection ExclusionsFromTargets { get; }
  }
  public sealed class CompositionLinearGradientBrush : CompositionGradientBrush
  public class CompositionObject : IClosable {
    DispatcherQueue DispatcherQueue { get; }
  }
  public sealed class CompositionTarget : CompositionObject {
  }
  public sealed class Compositor : IClosable {
    CompositionColorGradientStop CreateColorGradientStop();
    CompositionColorGradientStop CreateColorGradientStop(float offset, Color color);
    CompositionLinearGradientBrush CreateLinearGradientBrush();
    SpringScalarNaturalMotionAnimation CreateSpringScalarAnimation();
    SpringVector2NaturalMotionAnimation CreateSpringVector2Animation();
    SpringVector3NaturalMotionAnimation CreateSpringVector3Animation();
  }
  public sealed class DistantLight : CompositionLight {
    float Intensity { get; set; }
  }
  public sealed class DropShadow : CompositionShadow {
    CompositionDropShadowSourcePolicy SourcePolicy { get; set; }
  }
  public sealed class InitialValueExpressionCollection : CompositionObject, IIterable<IKeyValuePair<string, string>>, IMap<string, string>
  public sealed class LayerVisual : ContainerVisual {
    CompositionShadow Shadow { get; set; }
  }
  public class NaturalMotionAnimation : CompositionAnimation
  public sealed class PointLight : CompositionLight {
    float Intensity { get; set; }
  }
  public class ScalarNaturalMotionAnimation : NaturalMotionAnimation
  public sealed class SpotLight : CompositionLight {
    float InnerConeIntensity { get; set; }
    float OuterConeIntensity { get; set; }
  }
  public sealed class SpringScalarNaturalMotionAnimation : ScalarNaturalMotionAnimation
  public sealed class SpringVector2NaturalMotionAnimation : Vector2NaturalMotionAnimation
  public sealed class SpringVector3NaturalMotionAnimation : Vector3NaturalMotionAnimation
  public class Vector2NaturalMotionAnimation : NaturalMotionAnimation
  public class Vector3NaturalMotionAnimation : NaturalMotionAnimation
}
namespace Windows.UI.Composition.Effects {
  public sealed class SceneLightingEffect : IGraphicsEffect, IGraphicsEffectSource {
    SceneLightingEffectReflectanceModel ReflectanceModel { get; set; }
  }
  public enum SceneLightingEffectReflectanceModel
}
namespace Windows.UI.Composition.Interactions {
  public sealed class InteractionTracker : CompositionObject {
    void ConfigureVector2PositionInertiaModifiers(IIterable<InteractionTrackerVector2InertiaModifier> modifiers);
  }
  public sealed class InteractionTrackerInertiaNaturalMotion : InteractionTrackerInertiaModifier
  public class InteractionTrackerVector2InertiaModifier : CompositionObject
  public sealed class InteractionTrackerVector2InertiaNaturalMotion : InteractionTrackerVector2InertiaModifier
}
namespace Windows.UI.Core {
  public enum CoreCursorType {
    Person = 15,
    Pin = 14,
  }
  public sealed class CoreWindow : ICorePointerRedirector, ICoreWindow {
    CoreWindowActivationMode ActivationMode { get; }
    DispatcherQueue DispatcherQueue { get; }
  }
  public enum CoreWindowActivationMode
}
namespace Windows.UI.Input {
  public sealed class RadialControllerConfiguration {
    public static RadialController AppController { get; set; }
    public static bool IsAppControllerEnabled { get; set; }
  }
}
namespace Windows.UI.Input.Inking.Core {
  public sealed class CoreIncrementalInkStroke
  public sealed class CoreInkPresenterHost
}
namespace Windows.UI.Input.Preview.Injection {
  public sealed class InjectedInputGamepadInfo
  public sealed class InputInjector {
    void InitializeGamepadInjection();
    void InjectGamepadInput(InjectedInputGamepadInfo input);
    public static InputInjector TryCreateForAppBroadcastOnly();
    void UninitializeGamepadInjection();
  }
}
namespace Windows.UI.Input.Spatial {
  public sealed class SpatialInteractionController {
    IAsyncOperation<IRandomAccessStreamWithContentType> TryGetRenderableModelAsync();
  }
  public sealed class SpatialInteractionSource {
    SpatialInteractionSourceHandedness Handedness { get; }
  }
  public enum SpatialInteractionSourceHandedness
  public sealed class SpatialInteractionSourceLocation {
    IReference<Vector3> AngularVelocity { get; }
    SpatialInteractionSourcePositionQuality PositionQuality { get; }
    SpatialPointerInteractionSourcePose SourcePointerPose { get; }
  }
  public enum SpatialInteractionSourcePositionQuality
  public sealed class SpatialPointerInteractionSourcePose {
    Quaternion Orientation { get; }
    SpatialInteractionSourcePositionQuality PositionQuality { get; }
  }
}
namespace Windows.UI.Shell {
  public static class AdaptiveCardBuilder
  public interface IAdaptiveCard
  public interface IAdaptiveCardBuilderStatics
  public sealed class TaskbarManager
}
namespace Windows.UI.StartScreen {
  public sealed class SecondaryTileVisualElements {
    TileMixedRealityModel MixedRealityModel { get; }
  }
  public sealed class TileMixedRealityModel
}
namespace Windows.UI.Text.Core {
  public enum CoreTextInputScope {
    Digits = 28,
    PinAlphanumeric = 65,
    PinNumeric = 64,
  }
}
namespace Windows.UI.ViewManagement {
  public enum UIElementType {
    AccentColor = 1000,
    NonTextHigh = 1005,
    NonTextLow = 1009,
    NonTextMedium = 1007,
    NonTextMediumHigh = 1006,
    NonTextMediumLow = 1008,
    OverlayOutsidePopup = 1012,
    PageBackground = 1010,
    PopupBackground = 1011,
    TextContrastWithHigh = 1004,
    TextHigh = 1001,
    TextLow = 1003,
    TextMedium = 1002,
  }
}
namespace Windows.UI.ViewManagement.Core {
  public sealed class CoreInputView
  public sealed class CoreInputViewOcclusion
  public enum CoreInputViewOcclusionKind
  public sealed class CoreInputViewOcclusionsChangedEventArgs
}
namespace Windows.UI.WebUI {
  public static class WebUIApplication {
    public static IAsyncOperation<AppRestartFailureReason> RequestRestartAsync(string launchArguments);
    public static IAsyncOperation<AppRestartFailureReason> RequestRestartForUserAsync(User user, string launchArguments);
  }
  public sealed class WebUICommandLineActivatedEventArgs : IActivatedEventArgs, IActivatedEventArgsDeferral, IActivatedEventArgsWithUser, ICommandLineActivatedEventArgs
  public sealed class WebUIStartupTaskActivatedEventArgs : IActivatedEventArgs, IActivatedEventArgsWithUser, IStartupTaskActivatedEventArgs
}
namespace Windows.UI.Xaml {
  public class FrameworkElement : UIElement {
    ElementTheme ActualTheme { get; }
    public static DependencyProperty ActualThemeProperty { get; }
    event TypedEventHandler<FrameworkElement, object> ActualThemeChanged;
  }
  public enum TextAlignment {
    End = 2,
    Start = 1,
  }
  public class UIElement : DependencyObject {
    public static RoutedEvent CharacterReceivedEvent { get; }
    IVector<KeyboardAccelerator> KeyboardAccelerators { get; }
    public static RoutedEvent PreviewKeyDownEvent { get; }
    public static RoutedEvent PreviewKeyUpEvent { get; }
    event TypedEventHandler<UIElement, CharacterReceivedRoutedEventArgs> CharacterReceived;
    event KeyEventHandler PreviewKeyDown;
    event KeyEventHandler PreviewKeyUp;
    event TypedEventHandler<UIElement, ProcessKeyboardAcceleratorEventArgs> ProcessKeyboardAccelerators;
    virtual IIterable<DependencyObject> GetChildrenInTabFocusOrder();
    virtual void OnProcessKeyboardAccelerators(ProcessKeyboardAcceleratorEventArgs args);
    void TryInvokeKeyboardAccelerator(ProcessKeyboardAcceleratorEventArgs args);
  }
}
namespace Windows.UI.Xaml.Automation.Peers {
  public enum AutomationNotificationKind
  public enum AutomationNotificationProcessing
  public class AutomationPeer : DependencyObject {
    void RaiseNotificationEvent(AutomationNotificationKind notificationKind, AutomationNotificationProcessing notificationProcessing, string displayString, string activityId);
  }
  public class ColorPickerSliderAutomationPeer : SliderAutomationPeer
  public class ColorSpectrumAutomationPeer : FrameworkElementAutomationPeer
  public class AutomationPeer : ListViewItemAutomationPeer
  public class PersonPictureAutomationPeer : FrameworkElementAutomationPeer
  public class RatingControlAutomationPeer : FrameworkElementAutomationPeer
  public class TreeViewItemAutomationPeer : ListViewItemAutomationPeer
  public class TreeViewListAutomationPeer : SelectorAutomationPeer
}
namespace Windows.UI.Xaml.Controls {
  public class BitmapIconSource : IconSource
  public enum CharacterCasing
  public sealed class ColorChangedEventArgs
  public class ColorPicker : Control
  public enum ColorPickerHsvChannel
  public enum ColorSpectrumComponents
  public enum ColorSpectrumShape
  public class ComboBox : Selector {
    Brush PlaceholderForeground { get; set; }
    public static DependencyProperty PlaceholderForegroundProperty { get; }
  }
  public class ContentDialog : ContentControl {
    IAsyncOperation<ContentDialogResult> ShowAsync(ContentDialogPlacement placement);
  }
  public enum ContentDialogPlacement
  public class Control : FrameworkElement {
    virtual void OnCharacterReceived(CharacterReceivedRoutedEventArgs e);
    virtual void OnPreviewKeyDown(KeyRoutedEventArgs e);
    virtual void OnPreviewKeyUp(KeyRoutedEventArgs e);
  }
  public enum DisabledFormattingAccelerators : uint
  public class FontIconSource : IconSource
  public class Grid : Panel {
    double ColumnSpacing { get; set; }
    public static DependencyProperty ColumnSpacingProperty { get; }
    double RowSpacing { get; set; }
    public static DependencyProperty RowSpacingProperty { get; }
  }
  public class IconSource : DependencyObject
  public sealed class IsTextTrimmedChangedEventArgs
  public class MediaTransportControls : Control {
    bool IsRepeatButtonVisible { get; set; }
    public static DependencyProperty IsRepeatButtonVisibleProperty { get; }
    bool IsRepeatEnabled { get; set; }
    public static DependencyProperty IsRepeatEnabledProperty { get; }
    bool ShowAndHideAutomatically { get; set; }
    public static DependencyProperty ShowAndHideAutomaticallyProperty { get; }
    void Hide();
    void Show();
  }
  public class NavigationView : ContentControl
  public enum NavigationViewDisplayMode
  public sealed class NavigationViewDisplayModeChangedEventArgs
  public class NavigationViewItem : NavigationViewItemBase
  public class NavigationViewItemBase : ListViewItem
  public class NavigationViewItemHeader : NavigationViewItemBase
  public sealed class NavigationViewItemInvokedEventArgs
  public class NavigationViewItemSeparator : NavigationViewItemBase
  public class NavigationViewList : ListView
  public sealed class NavigationViewSelectionChangedEventArgs
  public enum ParallaxSourceOffsetKind
  public class ParallaxView : FrameworkElement
  public sealed class PasswordBox : Control {
    event TypedEventHandler<PasswordBox, PasswordBoxPasswordChangingEventArgs> PasswordChanging;
  }
  public sealed class PasswordBoxPasswordChangingEventArgs
  public class PathIconSource : IconSource
  public class PersonPicture : Control
  public class RatingControl : Control
  public class RatingItemFontInfo : RatingItemInfo
  public class RatingItemImageInfo : RatingItemInfo
  public class RatingItemInfo : DependencyObject
  public class RichEditBox : Control {
    CharacterCasing CharacterCasing { get; set; }
    public static DependencyProperty CharacterCasingProperty { get; }
    DisabledFormattingAccelerators DisabledFormattingAccelerators { get; set; }
    public static DependencyProperty DisabledFormattingAcceleratorsProperty { get; }
    TextAlignment HorizontalTextAlignment { get; set; }
    public static DependencyProperty HorizontalTextAlignmentProperty { get; }
    event TypedEventHandler<RichEditBox, TextControlCopyingToClipboardEventArgs> CopyingToClipboard;
    event TypedEventHandler<RichEditBox, TextControlCuttingToClipboardEventArgs> CuttingToClipboard;
  }
  public sealed class RichTextBlock : FrameworkElement {
    TextAlignment HorizontalTextAlignment { get; set; }
    public static DependencyProperty HorizontalTextAlignmentProperty { get; }
    bool IsTextTrimmed { get; }
    public static DependencyProperty IsTextTrimmedProperty { get; }
    IVector<TextHighlighter> TextHighlighters { get; }
    event TypedEventHandler<RichTextBlock, IsTextTrimmedChangedEventArgs> IsTextTrimmedChanged;
  }
  public sealed class RichTextBlockOverflow : FrameworkElement {
    bool IsTextTrimmed { get; }
    public static DependencyProperty IsTextTrimmedProperty { get; }
    event TypedEventHandler<RichTextBlockOverflow, IsTextTrimmedChangedEventArgs> IsTextTrimmedChanged;
  }
  public class SplitView : Control {
    event TypedEventHandler<SplitView, object> PaneOpened;
    event TypedEventHandler<SplitView, object> PaneOpening;
  }
  public class StackPanel : Panel, IInsertionPanel, IScrollSnapPointsInfo {
    double Spacing { get; set; }
    public static DependencyProperty SpacingProperty { get; }
  }
  public enum SwipeBehaviorOnInvoked
  public class SwipeControl : ContentControl
  public class SwipeItem : DependencyObject
  public sealed class SwipeItemInvokedEventArgs
  public class SwipeItems : DependencyObject, IIterable<SwipeItem>, IVector<SwipeItem>
  public enum SwipeMode
  public enum Symbol {
    GlobalNavigationButton = 59136,
    Print = 59209,
    Share = 59181,
    XboxOneConsole = 59792,
  }
  public class SymbolIconSource : IconSource
  public sealed class TextBlock : FrameworkElement {
    TextAlignment HorizontalTextAlignment { get; set; }
    public static DependencyProperty HorizontalTextAlignmentProperty { get; }
    bool IsTextTrimmed { get; }
    public static DependencyProperty IsTextTrimmedProperty { get; }
    IVector<TextHighlighter> TextHighlighters { get; }
    event TypedEventHandler<TextBlock, IsTextTrimmedChangedEventArgs> IsTextTrimmedChanged;
  }
  public class TextBox : Control {
    CharacterCasing CharacterCasing { get; set; }
    public static DependencyProperty CharacterCasingProperty { get; }
    TextAlignment HorizontalTextAlignment { get; set; }
    public static DependencyProperty HorizontalTextAlignmentProperty { get; }
    Brush PlaceholderForeground { get; set; }
    public static DependencyProperty PlaceholderForegroundProperty { get; }
    event TypedEventHandler<TextBox, TextBoxBeforeTextChangingEventArgs> BeforeTextChanging;
    event TypedEventHandler<TextBox, TextControlCopyingToClipboardEventArgs> CopyingToClipboard;
    event TypedEventHandler<TextBox, TextControlCuttingToClipboardEventArgs> CuttingToClipboard;
  }
  public sealed class TextBoxBeforeTextChangingEventArgs
  public sealed class TextControlCopyingToClipboardEventArgs
  public sealed class TextControlCuttingToClipboardEventArgs
  public class TreeView : Control
  public sealed class TreeViewExpandingEventArgs
  public class TreeViewItem : ListViewItem
  public sealed class TreeViewItemClickEventArgs
  public class TreeViewList : ListView
  public class TreeViewNode : DependencyObject, IBindableIterable, IBindableObservableVector, IBindableVector
  public enum TreeViewSelectionMode
  public sealed class XamlBooleanToVisibilityConverter : IValueConverter
  public sealed class XamlIntegerToIndentationConverter : IValueConverter
}
namespace Windows.UI.Xaml.Controls.Maps {
  public sealed class MapControl : Control {
    IVector<MapLayer> Layers { get; set; }
    public static DependencyProperty LayersProperty { get; }
    bool TryGetLocationFromOffset(Point offset, AltitudeReferenceSystem desiredReferenceSystem, out Geopoint location);
    bool TryGetLocationFromOffset(Point offset, out Geopoint location);
  }
  public class MapElement : DependencyObject {
    string MapStyleSheetEntry { get; set; }
    public static DependencyProperty MapStyleSheetEntryProperty { get; }
    string MapStyleSheetEntryState { get; set; }
    public static DependencyProperty MapStyleSheetEntryStateProperty { get; }
    object Tag { get; set; }
    public static DependencyProperty TagProperty { get; }
  }
  public sealed class MapElement3D : MapElement
  public sealed class MapElementsLayer : MapLayer
  public sealed class MapElementsLayerClickEventArgs
  public sealed class MapElementsLayerContextRequestedEventArgs
  public sealed class MapElementsLayerPointerEnteredEventArgs
  public sealed class MapElementsLayerPointerExitedEventArgs
  public class MapLayer : DependencyObject
  public class MapModel3D : DependencyObject
  public enum MapModel3DShadingOption
  public static class MapStyleSheetEntries
  public static class MapStyleSheetEntryStates
}
namespace Windows.UI.Xaml.Controls.Primitives {
  public class ColorPickerSlider : Slider
  public class ColorSpectrum : Control
  public class FlyoutBase : DependencyObject {
    virtual void OnProcessKeyboardAccelerators(ProcessKeyboardAcceleratorEventArgs args);
    void TryInvokeKeyboardAccelerator(ProcessKeyboardAcceleratorEventArgs args);
  }
  public sealed class LayoutInformation {
    public static Size GetAvailableSize(UIElement element);
  }
  public class ListViewItemPresenter : ContentPresenter {
    Brush RevealBackground { get; set; }
    public static DependencyProperty RevealBackgroundProperty { get; }
    bool RevealBackgroundShowsAboveContent { get; set; }
    public static DependencyProperty RevealBackgroundShowsAboveContentProperty { get; }
    Brush RevealBorderBrush { get; set; }
    public static DependencyProperty RevealBorderBrushProperty { get; }
    Thickness RevealBorderThickness { get; set; }
    public static DependencyProperty RevealBorderThicknessProperty { get; }
  }
}
namespace Windows.UI.Xaml.Data {
  public enum UpdateSourceTrigger {
    LostFocus = 3,
  }
}
namespace Windows.UI.Xaml.Documents {
  public class Block : TextElement {
    TextAlignment HorizontalTextAlignment { get; set; }
    public static DependencyProperty HorizontalTextAlignmentProperty { get; }
  }
  public sealed class Hyperlink : Span {
    bool IsTabStop { get; set; }
    public static DependencyProperty IsTabStopProperty { get; }
    int TabIndex { get; set; }
    public static DependencyProperty TabIndexProperty { get; }
  }
  public class TextHighlighter
  public class TextHighlighterBase : DependencyObject
  public struct TextRange
}
namespace Windows.UI.Xaml.Input {
  public sealed class CharacterReceivedRoutedEventArgs : RoutedEventArgs
  public class KeyboardAccelerator : DependencyObject
  public sealed class KeyboardAcceleratorInvokedEventArgs
  public sealed class PointerRoutedEventArgs : RoutedEventArgs {
    bool IsGenerated { get; }
  }
  public sealed class ProcessKeyboardAcceleratorEventArgs
}
namespace Windows.UI.Xaml.Markup {
  public class MarkupExtension
  public sealed class MarkupExtensionReturnTypeAttribute : Attribute
}
namespace Windows.UI.Xaml.Media {
  public enum AcrylicBackgroundSource
  public class AcrylicBrush : XamlCompositionBrushBase
  public class RevealBackgroundBrush : RevealBrush
  public class RevealBorderBrush : RevealBrush
  public class RevealBrush : XamlCompositionBrushBase
  public enum RevealBrushState
}
namespace Windows.Web {
  public enum WebErrorStatus {
    InsufficientRangeSupport = 22,
    MissingContentLengthSupport = 23,
  }
}
 
namespace Windows.Gaming.Preview.GamesEnumeration {
  public static class GameList {
    public static IAsyncOperation<GameListEntry> MergeEntriesAsync(GameListEntry left, GameListEntry right);
    public static IAsyncOperation<IVectorView<GameListEntry>> UnmergeEntryAsync(GameListEntry mergedEntry);
  }
  public sealed class GameListEntry : IGameListEntry {
    GameModeConfiguration GameModeConfiguration { get; }
    GameListEntryLaunchableState LaunchableState { get; }
    IStorageFile LauncherExecutable { get; }
    string LaunchParameters { get; }
    string TitleId { get; }
    IAsyncAction SetLauncherExecutableFileAsync(IStorageFile executableFile);
    IAsyncAction SetLauncherExecutableFileAsync(IStorageFile executableFile, string launchParams);
    IAsyncAction SetTitleIdAsync(string id);
  }
  public enum GameListEntryLaunchableState
  public sealed class GameModeConfiguration
  public sealed class GameModeUserConfiguration
}
 
namespace Windows.Graphics.Printing3D {
  public sealed class Printing3D3MFPackage {
    Printing3DPackageCompression Compression { get; set; }
  }
  public enum Printing3DPackageCompression
}
 
namespace Windows.Media.Capture {
  public sealed class AppBroadcastBackgroundService {
    string BroadcastChannel { get; set; }
    string BroadcastLanguage { get; set; }
    string BroadcastTitle { get; set; }
    event TypedEventHandler<AppBroadcastBackgroundService, object> BroadcastChannelChanged;
    event TypedEventHandler<AppBroadcastBackgroundService, object> BroadcastLanguageChanged;
    event TypedEventHandler<AppBroadcastBackgroundService, object> BroadcastTitleChanged;
  }
  public sealed class AppBroadcastBackgroundServiceSignInInfo {
    event TypedEventHandler<AppBroadcastBackgroundServiceSignInInfo, object> UserNameChanged;
  }
  public sealed class AppBroadcastBackgroundServiceStreamInfo {
    void ReportProblemWithStream();
  }
}
 
namespace Windows.Security.EnterpriseData {
  public sealed class FileProtectionInfo {
    bool IsProtectWhileOpenSupported { get; }
  }
}
 
namespace Windows.Services.Maps.Guidance {
  public sealed class GuidanceRoadSegment {
    bool IsScenic { get; }
  }
}
 
namespace Windows.Services.Maps.LocalSearch {
  public static class PlaceInfoHelper
}
namespace Windows.UI.Xaml.Controls.Maps {
  public sealed class MapControlDataHelper : DependencyObject {
    public static MapControl CreateMapControl(bool rasterRenderMode);
  }
}
 
namespace Windows.System.Profile.SystemManufacturers {
  public sealed class OemSupportInfo
  public static class SystemSupportInfo
}
 
namespace Windows.System {
  public static class DateTimeSettings
}
 
namespace Windows.UI.Xaml.Hosting {
  public sealed class DesignerAppManager : IClosable
  public sealed class DesignerAppView : IClosable
  public enum DesignerAppViewState
  public sealed class ProcessExitedEventArgs
}

The post Windows 10 SDK Preview Build 16225 Released appeared first on Building Apps for Windows.

UWP App Diagnostics

$
0
0

At Build this year, we gave a sneak preview of a set of new APIs designed to provide diagnostic information about running apps. You can see the videos here and here – but note that these were based on a pre-release implementation. So, while the Build videos are still correct on broad functionality, the final API names are almost all slightly different. Plus, we added a couple of extra features after Build.

The final versions for the upcoming release are available in the Insider builds from Build 16226, along with the corresponding SDK.

At a high level, these APIs allow an app to:

  • Enumerate a list of running apps, including UWP apps, Win32 apps, system services and so on.
  • For each app, get process-specific metrics on:
    • Memory usage (private commit and working set).
    • CPU usage.
    • Disk reads and writes.
  • For each UWP app, get additional metrics on:
    • Memory usage (including shared commit) equivalent to the Windows.System.MemoryManager report previously available to an app for its own usage.
    • State info: running, suspending, suspended, not running.
    • Energy quota info: under or over.
    • Enumerate a list of any background tasks that are active for the app, including name, trigger type and entry point.
    • Enumerate all the processes for the app (using an enhancement to the existing Windows.System.Diagnostics.ProcessDiagnosticInfo class that was previously restricted to an app for its own usage).

The API has a simple hierarchical structure:

  • The AppDiagnosticInfo type represents a single app. Callers would normally request either a single AppDiagnosticInfo for the app you’re interested in or a list of AppDiagnosticInfos if you’re interested in multiple apps.

  • Once you’ve gotten hold of an AppDiagnosticInfo for an app you’re interested in, you’d call GetResourceGroups to get a list of AppResourceGroupInfo objects. Each AppResourceGroupInfo corresponds to a resource group. An app can define resource groups in its manifest as a way to organize its components (foreground app, background tasks) into groups for resource management purposes. If you don’t define any explicit resource groups, the system will provide at least one (for the foreground app) plus potentially more (if you have out-of-proc background tasks, for example).

  • From there, you’d call any of the AppResourceGroupInfo methods to get snapshot reports of memory usage, execution and energy quota state, and the app’s running background tasks (if any) via the AppResourceGroupMemoryReport, AppResourceGroupStateReport and AppResourceGroupBackgroundTaskReport classes.

  • And finally, each group exposes a list of ProcessDiagnosticInfo objects.

As you can see from the class diagrams, the AppDiagnosticInfo and ProcessDiagnosticInfo each have a link to the other. This means you can get all the rich process-specific info for any running process and get the UWP-specific info for any process related to a UWP app (including Desktop Bridge apps).

These APIs are intended to support app developers who either need more diagnostic support during their own app development and testing, or who want to build a general-purpose diagnostic app and publish it in the Windows Store. Exposing information about other apps raises potential privacy concerns, so if your app uses these APIs, you’ll need to declare the appDiagnostics capability in your manifest, along with the corresponding namespace declaration:


<Package
  xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/ windows10/restrictedcapabilities"
  IgnorableNamespaces="uap mp rescap">
  ...

  <Capabilities>
    <rescap:Capability Name="appDiagnostics" />
  </Capabilities>
</Package>

This is a restricted capability: If you submit an app with this capability to the Windows Store, this will trigger closer scrutiny. The app must be in the Developer Tools category, and we will examine your app to make sure that it is indeed a developer tool before approving the submission.

At run time, the capability also triggers a user-consent prompt the first time any of the diagnostic APIs are called:

The user is always in control: If permission is denied, then the APIs will only return information about the current app. The prompt is only shown on first use, but the user can change his or her mind any time via the privacy pages in Settings. All apps that use the APIs will be listed here, and the user can toggle permission either globally or on a per-app basis:

Given the richness of the APIs, it’s not too much of a stretch to envisage creating a UWP version of Task Manager. There are a few features that we can’t implement just yet (terminating apps and controlling system services, for example), but certainly most of the data reporting is perfectly possible with the new APIs:

The first thing to do is to request permission to access diagnostics for other apps using AppDiagnosticInfo.RequestAccessAsync. The result could be Denied, Limited (which means you can only get information for the current app package) or Allowed.


DiagnosticAccessStatus diagnosticAccessStatus =
    await AppDiagnosticInfo.RequestAccessAsync();
switch (diagnosticAccessStatus)
{
    case DiagnosticAccessStatus.Allowed:
        Debug.WriteLine("We can get diagnostics for all apps.");
        break;
    case DiagnosticAccessStatus.Limited:
        Debug.WriteLine("We can only get diagnostics for this app package.");
        break;
}

Then, to emulate Task Manager, you’d start with a list of the ProcessDiagnosticInfo objects for all running processes.


IReadOnlyList<ProcessDiagnosticInfo> processes = ProcessDiagnosticInfo.GetForProcesses();

For each running process, you can extract the top-level process-specific information such as the ExecutableFileName and the ProcessId. You can also get the more detailed process information from each of the three reports for CpuUsage, MemoryUsage and DiskUsage.


if (processes != null)
{
    foreach (ProcessDiagnosticInfo process in processes)
    {
        string exeName = process.ExecutableFileName;
        string pid = process.ProcessId.ToString();

        ProcessCpuUsageReport cpuReport = process.CpuUsage.GetReport();
        TimeSpan userCpu = cpuReport.UserTime;
        TimeSpan kernelCpu = cpuReport.KernelTime;

        ProcessMemoryUsageReport memReport = process.MemoryUsage.GetReport();
        ulong npp = memReport.NonPagedPoolSizeInBytes;
        ulong pp = memReport.PagedPoolSizeInBytes;
        ulong peakNpp = memReport.PeakNonPagedPoolSizeInBytes;
        //...etc

        ProcessDiskUsageReport diskReport = process.DiskUsage.GetReport();
        long bytesRead = diskReport.BytesReadCount;
        long bytesWritten = diskReport.BytesWrittenCount;
        //...etc
    }
}

For any process associated with a UWP app, the IsPackaged property is true. So, for each of these, you can get from the ProcessDiagnosticInfo to the AppDiagnosticInfo. It might seem strange that we can get AppDiagnosticInfos (plural) from a process – but this is to allow for the possibility that a single process is associated with more than one app. That’s an extremely uncommon scenario, but it is possible in the case of VoIP apps where two or more apps in the same package can share a component running in a separate process at run time. In almost all cases, though, there will only be one AppDiagnosticInfo per process.


if (process.IsPackaged)
{
    IList<AppDiagnosticInfo> diagnosticInfos = process.GetAppDiagnosticInfos();
    if (diagnosticInfos != null && diagnosticInfos.Count > 0)
    {
        AppDiagnosticInfo diagnosticInfo = diagnosticInfos.FirstOrDefault();
        if (diagnosticInfo != null)
        {
            IList<AppResourceGroupInfo> groups = diagnosticInfo.GetResourceGroups();
            if (groups != null && groups.Count > 0)
            {

From the AppDiagnosticInfo, you can walk down the hierarchy and get a collection of AppResourceGroupInfos. Then, for each AppResourceGroupInfo, you can get the UWP-specific state and memory information:


AppResourceGroupInfo group = groups.FirstOrDefault();
if (group != null)
{
    string name = diagnosticInfo.AppInfo.DisplayInfo.DisplayName;
    string description = diagnosticInfo.AppInfo.DisplayInfo.Description;
    BitmapImage bitmapImage = await GetLogoAsync(diagnosticInfo);

    AppResourceGroupStateReport stateReport= group.GetStateReport();
    if (stateReport != null)
    {
        string executionStatus = stateReport.ExecutionState.ToString();
        string energyStatus = stateReport.EnergyQuotaState.ToString();
    }

    AppResourceGroupMemoryReport memoryReport = group.GetMemoryReport();
    if (memoryReport != null)
    {
        AppMemoryUsageLevel level = memoryReport.CommitUsageLevel;
        ulong limit = memoryReport.CommitUsageLimit;
        ulong totalCommit = memoryReport.TotalCommitUsage;
        ulong privateCommit = memoryReport.PrivateCommitUsage;
        ulong sharedCommit = totalCommit - privateCommit;
    }
}

Note: to get the packaged logo from the app, there’s a little extra work. You call GetLogo from the AppDisplayInfo to return the data as a stream; if there are multiple logos available, this will return the largest one that is within the specified size.


private async Task<BitmapImage> GetLogoAsync(AppDiagnosticInfo app)
{
    RandomAccessStreamReference stream =
        app.AppInfo.DisplayInfo.GetLogo(new Size(64, 64));
    IRandomAccessStreamWithContentType content = await stream.OpenReadAsync();
    BitmapImage bitmapImage = new BitmapImage();
    await bitmapImage.SetSourceAsync(content);
    return bitmapImage;
}

Once you’ve collected all the various detailed metrics you’re interested in, it’s a simple matter to populate your viewmodel for data-binding purposes, to perform data analytics or to do whatever other processing you might want.

In a later post, we’ll look at how you can integrate the diagnostic APIs with existing developer tools such as Visual Studio and Appium.

The post UWP App Diagnostics appeared first on Building Apps for Windows.

Windows App Studio being sunset

$
0
0

We want to directly thank each of the users of Windows App Studio and we want to be sure you have a smooth transition off when Windows App Studio service ends on December 1, 2017. What will happen to App Studio afterwards? Windows Template Studio is the evolution of Windows App Studio. We took our learnings from the code generation engine and the existing wizard to provide a strong foundation for our code generation and developer experience in Windows Template Studio. Best of all, it is open source over at http://aka.ms/wts.

Details on the transition

Windows App Studio has been a free, online app creation tool that allowed enthusiasts and developers to quickly build complete Windows Universal Apps. Applications using Windows App Studio then could also be downloaded, extended and compiled with Visual Studio and submitted to the Windows Dev Center.

Any user of Windows App Studio will need to download your projects and data prior to December 1, 2017.

We’ll provide multiple email communications with users between now and December 1, 2017, but we want to be upfront and clear that you have a path forward to continue building great apps for Windows 10. We’re doing a phased approach with the sun setting process. Here are the three critical dates:

  • July 15, 2017
    • Only existing users can sign in
    • Finished application projects can be downloaded
    • No new dynamic collections data sources allowed to be created
    • Dynamic data will be allowed to be downloaded with a migration path provided
  • September 15, 2017
    • Application editor will stop working
    • Dynamic collections API will stop providing data to your existing applications
  • December 1, 2017
    • Windows App Studio will be shut down

Once again, we want to thank each of the users of Windows App Studio, and we view the smooth transition for users critical.

The post Windows App Studio being sunset appeared first on Building Apps for Windows.

Announcing UWP Community Toolkit 1.5

$
0
0

Today marks the sixth release of the UWP Community Toolkit – all packages are updated to version 1.5. Thanks to the UWP developer community, the UWP Community Toolkit has seen great improvements and stability to the existing controls and services. The community partnership has led to several new additions to this release.

To highlight a few of the new additions, the UWP Community Toolkit now includes:

  1. Menu: A classic control used by traditional desktop applications, adapted for the Universal Windows Platform. As requested by the community on UserVoice, the Menu allows the developer to provide a hierarchical list of menus and submenus that support any input modality and can adapt to the screen size to provide a natural and fluid interaction.
  2. OrbitView: A new ItemsControl that arranges elements around a center element and provides flexibility for size and distance for each element, as well as the ability to show orbits or anchors for each item.
  3. RadialProgressBar: A XAML Control that displays a value within a range using a circular sector that grows clockwise until it becomes a full ring. A fantastic variation of the ProgressBar.
  4. RoundImageEx: Similar to the ImageEx control, the RoundImageEx control downloads and locally caches images asynchronously while showing loading indicators. In addition, the RoundImageEx allows images to be clipped as circles.
  5. ExpressionBuilder: A type-safe way to build powerful composition ExpressionAnimation.
  6. BluetoothLEHelper: The BluetoothLEHelper class provides functionality to easily enumerate, connect to and interact with Bluetooth LE Peripherals.

For a complete overview of what’s new in version 1.5, please read our release notes on GitHub.

The release of Windows 10 Creators Update (build 10.0.15063) has enabled several new APIs that make it possible to improve several controls used in apps targeting the latest update. Therefore, several packages are now targeting the Windows 10 Creators Update and can take advantage of these new APIs. We encourage all developers using the toolkit to update their apps to the latest version of the UWP Community Toolkit.

As a reminder, the UWP Community Toolkit can be used in any UWP app across PC, Xbox One, mobile, HoloLens and Surface Hub devices. You can get started by following this tutorial, or preview the latest features by installing the UWP Community Toolkit Sample App from the Windows Store.

If you would like to contribute, please join us on GitHub!

The post Announcing UWP Community Toolkit 1.5 appeared first on Building Apps for Windows.

Command-Line Activation of Universal Windows Apps

$
0
0

As we continue to close the gap between Win32 and Universal Windows Apps, one of the features we’ve recently introduced is the ability to activate a UWA from a command line and pass the app arbitrary command-line arguments. This is available to Insiders from build 16226.

This feature builds on the App Execution Alias extension already available for Desktop Bridge apps. To use this feature in a UWA, there are two key additions to your app:

  • Add an appExecutionAlias extension to your app manifest.
  • Override OnActivated and handle the incoming arguments.

For the manifest entry, you first need to declare the XML namespace for the AppExecutionAlias element:


<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"
  xmlns:uap5="http://schemas.microsoft.com/appx/manifest/uap/windows10/5"
  IgnorableNamespaces="uap mp uap5">

The AppExecutionAlias is declared as an Extension within your Application. This is quite simple and almost the same as for a Desktop Bridge app:


<Application ...>

  <Extensions>
      <uap5:Extension
        Category="windows.appExecutionAlias"
        Executable="MyCompany.Something.Another.exe"
        EntryPoint=" MyCompany.Something.Another.App">
        <uap5:AppExecutionAlias>
          <uap5:ExecutionAlias Alias="MyApp.exe" />
        </uap5:AppExecutionAlias>
      </uap5:Extension>
  </Extensions>

</Application>

The Executable is the name of your UWA app EXE, and the EntryPoint is the fully qualified name of your App class. The ExecutionAlias is the name that users will type in at the command-line: This can be any arbitrary name, and it must end with “.exe.” You should choose a meaningful alias that you can reasonably expect the user to associate with your app. Note that if you choose an alias that conflicts with an app that is already installed, your alias won’t be used. Similarly, if your app is installed first, and then the user installs another app later that declares the same alias – then your app will take precedence. The rule here is that the first one wins.

The manifest entry is obviously the same for VB and C++ projects, but for a JavaScript web app, it’s slightly different. Instead of Executable, you specify a StartPage, and you don’t specify EntryPoint at all:


<Extensions>
    <uap5:Extension
      Category="windows.appExecutionAlias"
      StartPage="index.html">
      <uap5:AppExecutionAlias>
        <uap5:ExecutionAlias Alias="MyApp.exe" />
      </uap5:AppExecutionAlias>
    </uap5:Extension>
</Extensions>

For the OnActivated override, the first thing to do is to check the ActivationKind – this is standard practice if your app supports multiple activation kinds (file associations, custom protocols and so on). In this scenario, if the ActivationKind is CommandLineLaunch, the incoming IActivatedEventArgs will be an object of type CommandLineActivatedEventArgs. From this, you can get the CommandLineActivationOperation, and from this in turn, you can get the Arguments string. You also get the CurrentDirectoryPath, which is the directory current when the command-line activation request was made. This is typically not the install location of the app itself, but could be any arbitrary path.


async protected override void OnActivated(IActivatedEventArgs args)
{
    switch (args.Kind)
    {
        case ActivationKind.CommandLineLaunch:
            CommandLineActivatedEventArgs cmdLineArgs =
                args as CommandLineActivatedEventArgs;
            CommandLineActivationOperation operation = cmdLineArgs.Operation;
            string cmdLineString = operation.Arguments;
            string activationPath = operation.CurrentDirectoryPath;

It’s important to remember that the command-line arguments are supplied by the caller, which means that you have no control over them. You should treat these arguments as untrustworthy and parse them very carefully. They might not have any malicious intent, but they could easily be badly formed, so you need to allow for this.

After the initial checks, you can create a window as normal, and optionally pass in the (parsed and validated) command-line arguments – or some data extracted from the arguments – to that window.


            Frame rootFrame = Window.Current.Content as Frame;
            if (rootFrame == null)
            {
                rootFrame = new Frame();
                Window.Current.Content = rootFrame;
            }
            rootFrame.Navigate(typeof(MainPage),
                string.Format("CurrentDirectory={0}, Arguments={1}",
                activationPath, cmdLineString));
            Window.Current.Activate();

Finally, in your page’s OnNavigatedTo, you can retrieve the payload from the event args, and use the information in any way you like:


protected override void OnNavigatedTo(NavigationEventArgs e)
{
    string cmdLineString = e.Parameter as string;
}

When you build and run the app on your dev machine – or when the end user installs your app – the  alias is registered. From that point, the user can go to a command line and activate your app.

Note that by “command line,” we mean any common command line mechanism such as cmd.exe,  powershell.exe, Windows-R and so on. Here’s a slightly more sophisticated example in which the app implements a custom parser to construct command-payload tuples from the command-line arguments:


protected override void OnActivated(IActivatedEventArgs args)
{
    switch (args.Kind)
    {
        case ActivationKind.CommandLineLaunch:
            CommandLineActivatedEventArgs cmdLineArgs =
                args as CommandLineActivatedEventArgs;
            CommandLineActivationOperation operation = cmdLineArgs.Operation;
            string cmdLineString = operation.Arguments;
            string activationPath = operation.CurrentDirectoryPath;

            Frame rootFrame = Window.Current.Content as Frame;
            if (rootFrame == null)
            {
                rootFrame = new Frame();
                Window.Current.Content = rootFrame;
            }

            ParsedCommands parsedCommands =
                CommandLineParser.ParseUntrustedArgs(cmdLineString);
            if (parsedCommands != null && parsedCommands.Count > 0)
            {
                foreach (ParsedCommand command in parsedCommands)
                {
                    switch (command.Type)
                    {
                        case ParsedCommandType.SelectItem:
                            rootFrame.Navigate(typeof(SelectItemPage), command.Payload);
                            break;
                        case ParsedCommandType.LoadConfig:
                            rootFrame.Navigate(typeof(LoadConfigPage), command.Payload);
                            break;
                        case ParsedCommandType.Unknown:
                            rootFrame.Navigate(typeof(HelpPage), cmdLineString);
                            break;
                    }
                }
            }
            else
            {
                rootFrame.Navigate(typeof(MainPage));
            }

            Window.Current.Activate();
            break;
    }
}

The app’s logic uses these more structured commands to navigate to different pages and handle the payload in different ways. The point is that you can define whatever argument options and payload rules you like in your app.

A common scenario is testing: You can activate your app with a defined set of values for each test run – for example, to start on a particular page with boundary values set for key items – or to start a game at a particular level, with values set for player attributes, enemy count, damage levels, fuel and weaponry and so on.

If the data you provide is too long or too complex for command-line arguments, you can supply a filename on the command-line which the app can then load. One option is to include such files as content in your package (and most likely strip them out before building your release build). You can also create the files at any time later, so long as you put them in a location to which the app has access. If you want to avoid showing any filepicker UX in your app, the simplest option is to put the files in the install location for the app, which would be somewhere like %userprofile%\AppData\Local\Packages\<Package ID>\LocalState.

You should also allow for incoming arguments that are badly formed or otherwise unrecognized:

And a reasonable UX here would be to navigate to a page where you show the user the correct usage options:

Also, bear in mind that the UWP platform has a single-instance app model. This means that your app can be running, and you can then continue to execute command-line activation requests at any point thereafter. Each activation will result in a call into OnActivated. This is unlikely to be useful in end-user scenarios of course – but it can be a useful debugging/profiling strategy during development.

Command-line activation of UWAs is just one example of how we’re gradually closing the gaps between traditional Win32 development and UWA development. This feature brings you yet another missing piece from the old world that you can now leverage in your modern apps.

The post Command-Line Activation of Universal Windows Apps appeared first on Building Apps for Windows.

Viewing all 623 articles
Browse latest View live