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

Calling WinRT Components from a Win32 process via the Desktop Bridge

$
0
0

In today’s post, we are covering another step you can take on your journey across the Desktop Bridge: specifically migrating business logic to Windows Runtime Components, aka WinRT Components. Previously, Windows only supported calling OS provided WinRT components from Win32 applications. Any attempt to call user-defined (aka 3rd party) WinRT components would fail because the Win32 application did not have package identity, and thus there was no way to register the component with the system at installation time, nor any way for the system to find the component at runtime.

This limitation is solved because Win32 applications on the Desktop Bridge now have identity and are registered with the OS, including any Windows Runtime Components that are part of the package. In the Windows 10 Fall Creators Update, the Desktop Bridge supports this functionality, including support for both In-Process Servers and Out-Of-Process Servers.

Code sharing – Why WinRT Components vs other options

There are many different ways to share code in your application, so what you choose depends upon your scenarios. At a high level, here are a few ways as they relate to UWP and the Desktop Bridge:

  • DLLs – for scenarios that require in-proc code performance and do not need cross-language interoperability
  • WinRT Components – for cross-language interoperability, or support out-of-process activation for reliability
  • .Net library – for scenarios that work in-proc and all clients are managed developers, including PCLs or .Net Standard libraries

Authoring new code or moving code into a Windows Runtime Component allows code reuse between the AppContainer and Win32 processes in the same package. While you can reuse existing DLLs in your AppContainer process by calling LoadPackageLibrary by moving to a Windows Runtime Component, you gain greater reusability because of better language interoperability (Native C/C++, managed code with C# & VB and Javascript) and Visual Studio integration across all your projects. Additionally, WinRT components support an out-of-process activation model that enables greater robustness for your app.

How does it work?

Because applications on the Desktop Bridge have a manifest, the registration entries for the WinRT Component are the same as you would use for a UWP application – by using the InProcessServer and OutOfProcessServer extensions. These extensions register the ActivatableClassId and its implementation binary with your package, so when your application attempts to activate the class, the system can find it.

In-Process Servers

This feature now allows developers to easily share code between Win32 apps and UWP apps running in AppContainer that can be loaded In-Proc. The component is built the same, e.g. Create a new WinRT Component project in VS, and the registration in the manifest is exactly the same as for UWP in-process servers. Because there is no manifest schema change required, developers can use existing toolsets in VS2015 or VS2017 to build In-Proc servers, but these solutions can only deploy to a machine running the latest flights of the Fall Creators Update.

Below is an example of an in-proc registration for a C++ WinRT Component, where CPPSimpleMathWinRT.dll is a native implementation of the SimpleMath class.


    <Extension Category="windows.activatableClass.inProcessServer">
      <InProcessServer>
        <Path>CPPSimpleMathWinRT.dll</Path>
        <ActivatableClass ActivatableClassId="SimpleMathWinRT.SimpleMath" ThreadingModel="both" />
      </InProcessServer>
    </Extension>

Below, you’ll see a simple Winforms Calculator sample that leverages a C++ WinRT Component for its math engine.

And this is what it looks like at runtime:

Sample with a C++/CX WinRT Component: https://github.com/Microsoft/DesktopBridgeToUWP-Samples/tree/master/Samples/WinFormsWinRTComponent

Sample with a C# WinRT Component: https://github.com/Microsoft/DesktopBridgeToUWP-Samples/tree/master/Samples/WinformsManagedWinRTComponent

Out-Of-Process servers

The registration of an OOP server for an application using the Desktop Bridge extensions is very familiar to developers who have registered servers before in UWP. However, there are details to clarify and limitations to be aware of. While OOP servers allow you to share code between your Win32 and AppContainer processes, there are limitations on sharing data between clients — that is reflected in the instancing model of the server. It all depends on your application’s needs as to which instancing model you should leverage.

The instancing behavior of a server is determined by the claims on the process token, specifically whether or not a call to NTCompareToken() for the calling process and a running instance of the server returns true. If they match, then existing instance of the server is used. If they are different, then a new instance of the server is started.

One of the key claims is the app identity. Apps in UWP are defined in the manifest and in most UWP applications submitted to the Store, there is only one App. But on the Desktop Bridge you can have more than one. Another key claim is the trust level of the calling process. On the Desktop Bridge, the package itself is declared with the runFullTrust capability, <rescap:Capability Name=”runFullTrust” />, which allows one or apps to be declared with the FullTrust entrypoint, EntryPoint=”Windows.FullTrustApplication”. Apps using the FullTrust entrypoint can call any API they want. Usually this is your main Win32/.Net executable. I’ll refer to these applications as FullTrust apps.

If you do not have this entrypoint, then the application is running in a lower trust level, called Base Trust, and has additional restrictions in a sandboxed environment called AppContainer, which is typical for an app when you create a UWP app in Visual Studio. These different trust levels result in different claims on the process tokens, and the result is a different instance of the server.  This model is called ActivateAsActivator, or AAA. An example of this registration is provided below, and you’ll note that it is the exactly same as what you’d provide for a UWP application; there is nothing new here for using this instancing model to access the server from your Win32 code:


    <Extension Category="windows.activatableClass.outOfProcessServer">
      <OutOfProcessServer ServerName="Microsoft.SDKSamples.Kitchen.OvenServer" >
        <Path>Microsoft.SDKSamples.Kitchen.exe</Path>
        <Instancing>singleInstance</Instancing>
        <ActivatableClass ActivatableClassId="Microsoft.SDKSamples.Kitchen.Oven" />
      </OutOfProcessServer>
    </Extension>

While the ActivateAsActivator model allows you to share code, creating a separate instance of the server per client can be heavy weight. To mitigate this, UWP introduced a concept called ActivateAsPackage (AAP), which provides a single instancing behavior for servers in the package. This is reflected in the new attribute IdentityType=”activateAsPackage” on the <OutOfProcessServer> element.

There is a limitation in the AAP model however, as you must specify which trust boundary you want the server to run in. The server must be registered for use by the AppContainer processes, or for use by the FullTrust processes. If you want to use the server in both the FullTrust and AppContainer processes, you’ll need to build and register two servers with separate server names and class names, as those names need to be unique per package. To register the server for use by your FullTrust process, a new attribute RunFullTrust=”true” has been added. If you want the server to be used by your AppContainer processes, leave the attribute out.

Both new attributes are under the xmlns:uap5=”http://schemas.microsoft.com/appx/manifest/uap/windows10/5” namespace. An example registration is provided below showing both Win32 and UWP server registrations:

AAP Registration of server for use by Win32, aka FullTrust, processes:


    <Extension Category="windows.activatableClass.outOfProcessServer">
      <OutOfProcessServer ServerName="Microsoft.SDKSamples.Kitchen.OvenServer" uap5:IdentityType="activateAsPackage" uap5:RunFullTrust="true">
        <Path>Microsoft.SDKSamples.Kitchen.exe</Path>
        <Instancing>singleInstance</Instancing>
        <ActivatableClass ActivatableClassId="Microsoft.SDKSamples.Kitchen.Oven" />
      </OutOfProcessServer>
    </Extension>

AAP registration of server for use by UWP processes:


    <Extension Category="windows.activatableClass.outOfProcessServer">
      <OutOfProcessServer ServerName="Microsoft.SDKSamples.Kitchen.OvenServerUWP" uap5:IdentityType="activateAsPackage">
        <Path>Microsoft.SDKSamples.KitchenUWP.exe</Path>
        <Instancing>singleInstance</Instancing>
        <ActivatableClass ActivatableClassId="Microsoft.SDKSamples.Kitchen.OvenUWP" />
      </OutOfProcessServer>
    </Extension>

The sample uses the AAP scenario and shows two C# Winforms apps using a OOP WinRT Component, resulting in only one instance of the server executable. The WinRT Component is a modified version of the WRLOutOfProcessWinRTComponent sample from the Universal Windows Samples on github. In this example, both client call the server and call the BakeBread() method. You’ll see from the TaskManager that there is only one instance of the Server.

GitHub link: https://github.com/Microsoft/DesktopBridgeToUWP-Samples/tree/master/Samples/WinformsOutOfProcessWinRTComponent

Visual Studio Support

It’s worth calling out a couple details and workarounds in projects created for this solution. First of all, Visual Studio currently does not allow you to add project references from a WinRT Component project to a Win32/.Net project.  You can work around this by unloading the Win32/.Net project and adding the project reference to the project file directly, e.g.:


  <ItemGroup>
    <ProjectReference Include="..\Server\WRLOutOfProcessWinRTComponent_server.vcxproj" />
  </ItemGroup>

While this adds the reference, you will see a warning in Visual Studio, as this was not previously supported by the OS. We are working with Visual Studio to improve this in a future release, but for now you can ignore the warning.

Second, the samples are using a UWP JavaScript project to handle the app packaging. This technique is noted in the Desktop Bridge Packaging with Visual Studio documentation, and works as a reasonable solution until Visual Studio adds future support. The benefit of this approach is that you can add a reference from your WinRT component to the JavaScript project, and then the Visual Studio build system adds appropriate registrations for package dependencies, including VCLibs and .NetNative, as well as the <InProcessServer> extensions. Visual Studio does not support adding registrations for <OutOfProcessServer> registrations, so you’ll need to add those manually to the manifest

Metadata Based Marshaling – No more Proxy/Stub DLLs!

Finally, in the <OutOfProcessServer> example, we take advantage of the Metadata Based Marshalling feature (MBM) that was introduced in the Windows 10 Anniversary Update (Windows 10 version 1607). This feature has not gotten much attention, but it means that WinRT Component developers do not need to author a proxy/stub class, saving them time and tedious work. This is possible because the WinMD is deployed with the application, and thus the system can identify and marshal the types cross-process for the developer. You will notice that the server code in this example does not include the proxy project nor binaries.

Conclusion

With Windows Runtime Components and the Desktop Bridge, developers can take another step on their journey to migrate business logic to UWP. Windows Runtime Components provide code re-use that can work with either FullTrust processes or UWP processes, and they allow greater interop cross language.

For more information on the Desktop Bridge, please visit the Windows Dev Center.

Ready to submit your app to the Windows Store? Let us know!

The post Calling WinRT Components from a Win32 process via the Desktop Bridge appeared first on Building Apps for Windows.


Calling all game devs: The Dream.Build.Play 2017 Challenge is Here!

$
0
0

Dream.Build.Play is back! The long-running indie game development contest was on hiatus for a few years, so it’s high time for it to make a resounding return.

The Dream.Build.Play 2017 Challenge is the new contest: It just launched on June 27, and it challenges you to build a game and submit it by December 31 in one of four categories. We’re not super-picky — you can choose the technology to use just so long as it falls into one of the challenges and that you publish it as a Universal Windows Platform (UWP) game. It’s up to you to build a quality game that people will line up to play.

The four categories are:

Cloud-powered game – Grand Prize: $100,000 USD

Azure Cloud Services hands you a huge amount of back-end power and flexibility, and we think it’s cool (yes, we’re biased). So, here’s your shot of trying Azure out and maybe even win big. Build a game that uses Azure Cloud Services on the backend, like Service Fabric, CosmosDB, containers, VMs, storage and Analytics. Judges will give higher scores to games that use multiple services in creative ways — and will award bonus points for Mixer integration.

PC game – Grand Prize: $50,000 USD

Building on Windows 10, for Windows 10? This is the category for you. Create your best UWP game that lives and breathes on Windows 10 and is available to the more than 450 million users through the Windows Store. It’s simple: Create a game with whatever technology you want and publish it in the Windows Store. We’ll look favorably on games that add Windows 10 features such as Cortana or Inking because we really want to challenge you.

Mixed Reality game – Grand Prize: $50,000

Oh, so you want to enhance this world you live in with something a little…augmented? Virtual? Join us in the Mixed Reality challenge and build a volumetric experience that takes advantage of 3D content in a virtual space. You’ll need to create your game for Windows Mixed Reality, but you can use technology like Unity to get you kickstarted. Oh, and don’t forget the audio to really immerse us in your world.

Console game – Grand Prize: $25,000

Console gamers unite! Want to try your hand at building a game for Xbox? This category is your jam. Your UWP game will be built for the Xbox One console family and must incorporate Xbox Live Creators Program with at least Xbox Live presence. Consideration will be given for games that incorporate more Xbox Live services such as leaderboards and statistics.

There are some important dates to be aware of:

  • June 27: Competition opens for registration
  • August 2: Team formation and game submission period opens
  • December 31: Game submission period closes
  • January 2018: Finalists announced
  • March 2018: Winners awarded

We have big things planned for you. Maybe some additional contests and challenges, maybe some extra-cool prizes for the finalists, maybe some extra-cool interviews and educational materials. Once you register, we’ll keep you updated via email, but also keep an eye on our Windows Developer social media accounts.

As I mentioned earlier, you can pretty much use whatever technology you want. Create something from the ground up in JavaScript or XAML or C++ and DirectX. Leverage one of our great middleware partners like Unity, GameMaker, Cocos2D or Monogame. Or do a bit of both – do your own thing and incorporate Mixer APIs into it, Vungle or any one (or more) of our other partners. The biggest thing we want from you is a fun game that’s so enjoyable for us to play that we forget we’re judging it!

Speaking of that, you might be wondering how we judge the games. We have four “big bucket” criteria for you to aim for:

  • Fun Factor – 40%: Bottom line – your game needs to be fun. That doesn’t mean it has to be cutesy or simple. Fun comes in many forms, but we can’t forget what we’re aiming for here – a great game. Take us for a ride!
  • Innovation – 30%: And while you’re taking us on that ride, surprise us! We’re not looking for a clone of an existing game or a tired theme that has been done a bazillion times before. Mash-up two genres. Take a theme and turn it on its head. Don’t restrict your innovation to the game, but also the technology you’re using and how you’re using it. Think outside the box when you incorporate Windows features, or how you can creatively use a service like Mixer.
  • Production Quality – 20%: Games have to be fun and we want them to be innovative, but if they don’t run, then they’re just not ready to be called a game. This scoring criterion is all about making sure your framerate is right, you have audio where you should, you’ve catered for network instability and more. Give us every opportunity to get to your game and enjoy it the way you intended.
  • Business Viability/Feasibility – 10%: And of course, what’s your plan to engage your gaming customers? Do you have a good revenue-generating plan (e.g., in-app purchases, premium charges, marketing, rollouts, etc.)? That’s stuff you might not normally think about, but we’re gonna make you. Because we care.

If you want to get started with UWP game development, you can try our Game Development Guide.

Want more? Check out the introductory .GAME episode here:

So, what are you waiting for? Get in there and register!

The post Calling all game devs: The Dream.Build.Play 2017 Challenge is Here! appeared first on Building Apps for Windows.

Announcing Babylon.js 3.0

$
0
0

Babylon.js is an open source framework that allows you to create stunning 3D experiences in your browser. Built with simplicity and performance in mind, it is the engine that fuels the Remix3D site or the Xbox Design Lab.

Today, I’m thrilled to announce the availability of Babylon.js’s biggest version ever: Babylon.js v3.0. This version is packed with incredible features, but before listing some of them, I want to thank the awesome community behind this release. I’m humbled by the number of external contributors (120+) who dedicated their time to help build this great framework. They have made possible this 46th release of Babylon.js.

Here is a quick overview of a few features included in this release of the framework.

Support for WebGL 2

WebGL 2 is a great step forward for 3D developers as it allows more control over the GPU. The support for WebGL 2 is completely transparent with Babylon.js 3.0. This means that the engine will automatically use WebGL 2 if available, and it will fall back to WebGL 1 if not. Mode details can be found here.

Support for WebVR 1.1

With a single line of code, you can now unleash the power of virtual reality directly in your browser. Babylon.js 3.0 supports all VR devices, including the new Windows Mixed Reality headsets. Babylon.js can also transparently use WebVR 1.0 if your device does not support the latest version of the specification (Gear VR for instance). It also supports using device orientation events to provide virtual reality on mobile.

You can visit the Build 2017 website to watch a complete session about Babylon.js and WebVR.

You can find the Sponza demo here.

Support for glTF 2.0

glTF is a file format for GL APIs. With Babylon.js 3.0, we added complete support for loading glTF 2.0 files (including physically based rendering materials).

This version was ratified recently by Khronos group. glTF will help the 3D ecosystem to enable all new ways to create, share and consume 3D.

Improved physically based rendering (PBR)

The PBRMaterial used to render physically based objects was completely rewritten. It is now more accurate and better aligned with GLTF2.0 specifications. This material can be used to simulate real life lighting and provide photorealistic scenes.

You can find a live demo here.

Introducing Babylon.GUI

The Babylon.js GUI library is an extension you can use to generate interactive user interface. It relies on hardware acceleration to produce a fast and light way to deal with user interaction.

The Babylon.GUI extension can be helpful with VR scenarios when you cannot display HTML elements. It can also be used to project your UI in 3D. In this case, the UI will be textured on a 3D object but will remain functional.

Support for morph targets

Morph targets are a great way to animate objects by using morphing between different targets. This technique is widely used to animate character heads, for instance.

You can find a technical demo here.

Support for live textures using WebCam

You can now create project webcam content to any textures in your world. This could be used to simulate mixed reality experience or apply some fun effects like in this ASCII art demo.

Developer story

Version 3.0 is not only about features. It is also about enabling developers to achieve more with less code.

To fulfill this goal, we introduced a new version of our documentation where you can search for tutorials and classes documentation as well as playground samples.

The playground is a central tool for Babylon.js where you can learn by experimenting with live coding editor. Using the code panel on the left, you can discover at your pace the features of Babylon.js, thanks to our integrated code completion helper:

With more than 150,000 samples in the playground, we were sitting on top of an immense knowledge base for developers.

Therefore, we added the playground search section to our documentation to let you search for live code samples (either using sample title, description, tags or code):

We also thought about advanced WebGL developers with Spector.js, which is a fully functional WebGL (1 and 2) debugger. This tool is a must-have if you must deal with WebGL in depth, as it will expose in an easy-to-read way all the inner details of the rendering of every frame:

We really hope you will find this new version useful and exciting. If you want to know more or just want to experiment with our latest demo, please visit www.babylonjs.com.

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

The post Announcing Babylon.js 3.0 appeared first on Building Apps for Windows.

Windows 10 SDK Preview Build 16232 Released

$
0
0

Update: Thanks everyone for reporting the SDK issue, it is now fixed.

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

The Preview SDK can be downloaded from the 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 (x86)\Windows Kits\10\bin\10.0.16232.0\x86\genxbf.dll:C:\program files (x860\Windows
Kits\10\bin\10.0.16232.0\x86\genxbf.dll(0,0): Error WMC0621: Cannot resolve ‘GenXbf.dll’ under path ‘C:\program files (x860\Windows
Kits\10\bin\10.0.16232.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>

  • WRL projects fail to compile with MIDLRT error: When building my WRL project that contains a WinRT Component, the project no longer compiles. I get the following errors:

midlrt : command line error MIDL1012: [msg]argument illegal for switch / [context]ns_prefix
midlrt : command line error MIDL1000: [msg]missing source-file name

To work around this temporarily, you will need to use the previous version of the MidlRT.exe tool. You can do this by changing your Target Platform Version to a currently installed previous SDK.


<WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion>

Breaking Changes

  • ecmangen.exe removal from the SDK: Ecmangen.exe will no longer ship with the Windows SDK. Developers who rely on ecmangen for event manifest creation are advised to install the Windows Creators Edition of the SDK to obtain the file. Developers may also use notepad or other XML editor of choice for manifest creation. A schema file is available on MSDN to aid in manifest creation, for tools that support it.

API Differences from Windows 10 Creators Update

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.

API Additions


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 {
    bool IsPrimaryLayerEnabled { get; set; }
    uint MaxQuadLayerCount { get; }
    IVector<HolographicQuadLayer> QuadLayers { get; }
  }
  public sealed class HolographicCameraRenderingParameters {
    bool IsContentProtectionEnabled { get; set; }
  }
  public sealed class HolographicDisplay {
    double RefreshRate { get; }
  }
  public sealed class HolographicFrame {
    HolographicQuadLayerUpdateParameters GetQuadLayerUpdateParameters(HolographicQuadLayer layer);
  }
  public sealed class HolographicQuadLayer : IClosable
  public sealed class HolographicQuadLayerUpdateParameters
  public sealed class HolographicSpace {
    public static bool IsConfigured { get; }
  }
}
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 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; }
    SpatialInteractionSourcePositionAccuracy PositionAccuracy { get; }
    SpatialPointerInteractionSourcePose SourcePointerPose { get; }
  }
  public enum SpatialInteractionSourcePositionAccuracy
  public sealed class SpatialPointerInteractionSourcePose {
    Quaternion Orientation { get; }
    SpatialInteractionSourcePositionAccuracy PositionAccuracy { 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 NavigationViewItemAutomationPeer : 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 DesignerAppExitedEventArgs
  public sealed class DesignerAppManager : IClosable
  public sealed class DesignerAppView : IClosable
  public enum DesignerAppViewState
}
namespace Windows.Graphics.Holographic {
  public sealed class HolographicCamera {
    bool IsPrimaryLayerEnabled { get; set; }
    uint MaxQuadLayerCount { get; }
    IVector<HolographicQuadLayer> QuadLayers { get; }
  }
  public sealed class HolographicCameraRenderingParameters {
    bool IsContentProtectionEnabled { get; set; }
  }
  public sealed class HolographicFrame {
    HolographicQuadLayerUpdateParameters GetQuadLayerUpdateParameters(HolographicQuadLayer layer);
  }
  public sealed class HolographicQuadLayer : IClosable
  public sealed class HolographicQuadLayerUpdateParameters
}
namespace Windows.UI.Input.Spatial {
  public enum SpatialInteractionSourceHandedness {
    Unspecified = 0,
  }
  public sealed class SpatialInteractionSourceLocation {
    SpatialInteractionSourcePositionAccuracy PositionAccuracy { get; }
  }
  public enum SpatialInteractionSourcePositionAccuracy
  public sealed class SpatialPointerInteractionSourcePose {
    SpatialInteractionSourcePositionAccuracy PositionAccuracy { get; }
  }
}
namespace Windows.UI.Xaml.Hosting {
  public sealed class DesignerAppExitedEventArgs
  public sealed class DesignerAppManager : IClosable
  public sealed class DesignerAppView : IClosable
  public enum DesignerAppViewState
  public struct HostingContract
  public interface IXamlUIPresenterHost
  public interface IXamlUIPresenterHost2
  public interface IXamlUIPresenterHost3
  public sealed class XamlUIPresenter
}
 

API Removals


namespace Windows.UI.Composition {
  public sealed class CompositionTarget : CompositionObject {
  }
}

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 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.UI.Input.Spatial {
  public enum SpatialInteractionSourceHandedness {
    Both = 3,
    Unknown = 0,
  }
 
  public sealed class SpatialInteractionSourceLocation {
    SpatialInteractionSourcePositionQuality PositionQuality { get; }
  }
 
  public enum SpatialInteractionSourcePositionQuality
  public sealed class SpatialPointerInteractionSourcePose {
    SpatialInteractionSourcePositionQuality PositionQuality { get; }
  }
}

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

Working with Brushes and Content – XAML and Visual Layer Interop, Part One

$
0
0

The Composition APIs empower Universal Windows Platform (UWP) developers to do beautiful and powerful things when they access the Visual Layer. In the Windows 10 Creators Update, we made working with the Visual Layer much easier with new, powerful APIs.

In this blog series, we’ll cover some of these improvements in the Creators Update and take a look at the following APIs:

  • In Part 1, today’s post:
    • XamlCompositionBrushBase – easily paint a XAML UIElement with a CompositionBrush
    • LoadedImageSurface – load an image easily and use with Composition APIs
  • In Part 2, we’ll look at:
    • XamlLights – apply lights to your XAML UI with a single line of XAML
    • PointerPositionPropertySet – create 60 FPS animations using pointer position, off the UI thread!
    • Enabling the Translation property – animate a XAML UI Element using Composition animation

If you’d like to review the previously available ElementCompositionPreview APIs, for example working with “hand-in” and “hand-out” Visuals, you can quickly catch up here.

Using XamlCompositionBrushBase

One of the benefits of the new Composition and XAML interop APIs is the ability to use a CompositionBrush to directly paint a XAML UIElement rather than being limited to XAML brushes only. For example, you can create a CompositionEffectBrush that applies a tinted blur to the content beneath and use the brush to paint a XAML rectangle that can be included in the XAML markup

This is accomplished by using the new abstract class XamlCompositionBrushBase available in the Creators Update. To use it, you subclass XamlCompositionBrushBase to create your own XAML Brush that can be used in your markup. As seen the example code below, the XamlCompositionBrushBase exposes a CompositionBrush property that you set with your effect (or any CompositionBrush) and it will be applied to the XAML element.

This effectively replaces the need to manually create SpriteVisuals with SetElementChild for most effect scenarios. In addition to needing less code to create and add an effect to the UI, using a Brush means you get the following added benefits for free:

  • Theming and Styling
  • Binding
  • Resource and Lifetime management
  • Layout aware
  • PointerEvents
  • HitTesting and other XAML-based advantages

Microsoft, as part of the Fluent Design System, has included a few Brushes in the Creators Update that leverage the features of XamlCompositionBrushBase:

Building a Custom Composition Brush

Let’s create a XamlCompositionBrush of our own to see how simple this can be.  Here’s what we’ll create:

To start, let’s create a very simple Brush that applies an InvertEffect to content under it. First, we’ll need to make a public sealed class that inherits from XamlCompositionBrushBase and override two methods:

  • OnConnected
  • OnDisconnected

Let’s dive into the code. First, create your Brush class, which inherits from XamlCompositionBrushBase:


public class InvertBrush : XamlCompositionBrushBase
{
    protected override void OnConnected()
    {
        if (CompositionBrush == null)
        {
            // 1 - Get the BackdropBrush, this gets what is behind the UI element
            var backdrop = Window.Current.Compositor.CreateBackdropBrush();

            // CompositionCapabilities: Are effects supported? If not, return.
            if (!CompositionCapabilities.GetForCurrentView().AreEffectsSupported())
            {
               return;
            }

            // 2 - Create your Effect
            // New-up a Win2D InvertEffect and use the BackdropBrush as its Source
            // Note – To use InvertEffect, you'll need to add the Win2D NuGet package to your project (search NuGet for &quot;Win2D.uwp&quot;)
            var invertEffect = new InvertEffect
            {
                Source = new CompositionEffectSourceParameter(&quot;backdrop&quot;)
            };

            // 3 - Set up the EffectFactory
            var effectFactory = Window.Current.Compositor.CreateEffectFactory(invertEffect);

            // 4 - Finally, instantiate the CompositionEffectBrush
            var effectBrush = effectFactory.CreateBrush();

            // and set the backdrop as the original source
            effectBrush.SetSourceParameter(&quot;backdrop&quot;, backdrop);

            // 5 - Finally, assign your CompositionEffectBrush to the XCBB's CompositionBrush property
            CompositionBrush = effectBrush;
         }
    }

    protected override void OnDisconnected()
    {
        // Clean up
        CompositionBrush?.Dispose();
        CompositionBrush = null;
    }
}

There are a few things to call out in the code above.

  • In the OnConnected method, we get a CompositionBackdropBrush. This allows you to easily get the pixels behind the UIElement.
  • We use fallback protection. If the user’s device doesn’t have support for the effect(s), then just return.
  • Next, we create the InvertEffect and use the backdropBrush for the Effect’s Source.
  • Then, we pass the finished InvertEffect to the CompositionEffectFactory.
  • Finally, we get an EffectBrush from the factory and set the XamlCompositionBrushBase.CompositionBrush property with our newly created effectBrush.

Now you can use it in your XAML. For example, let’s apply it to a Grid on top of another Grid with a background image:


&lt;Grid&gt;
    &lt;Grid.Background&gt;
        &lt;ImageBrush ImageSource=&quot;ms-appx:///Images/Background.png&quot;/&gt;
    &lt;/Grid.Background&gt;
    &lt;Grid Width=&quot;300&quot; Height=&quot;300&quot;
               HorizontalAlignment=&quot;Center&quot;
               VerticalAlignment=&quot;Center&quot;&gt;
        &lt;Grid.Background&gt;
            &lt;brushes:InvertBrush /&gt;
        &lt;/Grid.Background&gt;
    &lt;/Grid&gt;
&lt;/Grid&gt;

Now that you know the basics of creating a brush, let’s build an animated effect brush next.

Creating a Brush with Animating Effects

Now that you see how simple it is to create a CompositionBrush, let’s create a brush that applies a TemeratureAndTint effect to an image and animate the Temperature value:

We start the same way we did with the simple InvertBrush, but this time we’ll add a DependencyProperty,  ImageUriString, so that we can load an image using LoadedImageSurface in the OnConnected method.


public sealed class ImageEffectBrush : XamlCompositionBrushBase
    {
        private LoadedImageSurface _surface;
        private CompositionSurfaceBrush _surfaceBrush;

        public static readonly DependencyProperty ImageUriStringProperty = DependencyProperty.Register(
            &quot;ImageUri&quot;,
            typeof(string),
            typeof(ImageEffectBrush),
            new PropertyMetadata(string.Empty, OnImageUriStringChanged)
        );

        public string ImageUriString
        {
            get =&gt; (String)GetValue(ImageUriStringProperty);
            set =&gt; SetValue(ImageUriStringProperty, value);
        }

        private static void OnImageUriStringChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            var brush = (ImageEffectBrush)d;
            // Unbox and update surface if CompositionBrush exists
            if (brush._surfaceBrush != null)
            {
                var newSurface = LoadedImageSurface.StartLoadFromUri(new Uri((String)e.NewValue));
                brush._surface = newSurface;
                brush._surfaceBrush.Surface = newSurface;
            }
        }

        protected override void OnConnected()
        {
            // return if Uri String is null or empty
            if (string.IsNullOrEmpty(ImageUriString))
                return;

            // Get a reference to the Compositor
            Compositor compositor = Window.Current.Compositor;

            // Use LoadedImageSurface API to get ICompositionSurface from image uri provided
            _surface = LoadedImageSurface.StartLoadFromUri(new Uri(ImageUriString));

            // Load Surface onto SurfaceBrush
            _surfaceBrush = compositor.CreateSurfaceBrush(_surface);
            _surfaceBrush.Stretch = CompositionStretch.UniformToFill;

            // CompositionCapabilities: Are Tint+Temperature and Saturation supported?
            bool usingFallback = !CompositionCapabilities.GetForCurrentView().AreEffectsSupported();
            if (usingFallback)
            {
                // If Effects are not supported, Fallback to image without effects
                CompositionBrush = _surfaceBrush;
                return;
            }

            // Define Effect graph (add the Win2D.uwp NuGet package to get this effect)
            IGraphicsEffect graphicsEffect = new SaturationEffect
            {
                Name = &quot;Saturation&quot;,
                Saturation = 0.3f,
                Source = new TemperatureAndTintEffect
                {
                    Name = &quot;TempAndTint&quot;,
                    Temperature = 0,
                    Source = new CompositionEffectSourceParameter(&quot;Surface&quot;),
                }
            };

            // Create EffectFactory and EffectBrush
            CompositionEffectFactory effectFactory = compositor.CreateEffectFactory(graphicsEffect, new[] { &quot;TempAndTint.Temperature&quot; });
            CompositionEffectBrush effectBrush = effectFactory.CreateBrush();
            effectBrush.SetSourceParameter(&quot;Surface&quot;, _surfaceBrush);

            // Set EffectBrush to paint Xaml UIElement
            CompositionBrush = effectBrush;

            // Trivial looping animation to demonstrate animated effect
            ScalarKeyFrameAnimation tempAnim = compositor.CreateScalarKeyFrameAnimation();
            tempAnim.InsertKeyFrame(0, 0);
            tempAnim.InsertKeyFrame(0.5f, 1f);
            tempAnim.InsertKeyFrame(1, 0);
            tempAnim.Duration = TimeSpan.FromSeconds(5);
            tempAnim.IterationBehavior = AnimationIterationBehavior.Count;
      tempAnim.IterationCount = 10;
             effectBrush.Properties.StartAnimation(&quot;TempAndTint.Temperature&quot;, tempAnim);
        }

        protected override void OnDisconnected()
        {
            // Dispose Surface and CompositionBrushes if XamlCompBrushBase is removed from tree
            _surface?.Dispose();
            _surface = null;

            CompositionBrush?.Dispose();
            CompositionBrush = null;
        }
    }

There are some new things here to call out that are different from the InvertBrush:

  • We use the new LoadedImageSurface API to easily load an image in the OnConnected method, but also when the ImageUriString value changes. Prior to Creators Update, this required a hand-in Visual (a SpriteVisual, painted with an EffectBrush, which was handed back into the XAML Visual Tree). See the LoadedImageSurface section later in this article for more details.
  • Notice that we gave the effects a Name value. In particular, TemperatureAndTintEffect, uses the name “TempAndTint.” This is required to animate properties as it is used for the reference to the effect in the AnimatableProperties array that is passed to the effect factory. Otherwise, you’ll encounter a “Malformed animated property name” error.
  • After we assign the CompositionBrush property, we created a simple looping animation to oscillate the value of the TempAndTint from 0 to 1 and back every 5 seconds.

Let’s take a look at an instance of this Brush in markup:


&lt;Grid&gt;
            &lt;Grid.Background&gt;
                &lt;brushes:ImageEffectBrush ImageUriString=&quot;ms-appx:///Images/Background.png&quot;/&gt;
            &lt;/Grid.Background&gt;
&lt;/Grid&gt;

For more information on using XamlCompositionBrushBase, see here. Now, let’s take a closer look at how easy it is now to bring in images to the Visual layer using LoadedImageSurface

Loading images with LoadedImageSurface

With the new LoadedImageSurface class, it’s never been easier to load an image and work with it in the visual layer. The class has the same codec support that Windows 10 has via the Windows Imaging Component (see full list here), thus it supports the following image file types:

  • Joint Photographic Experts Group (JPEG)
  • Portable Network Graphics (PNG)
  • Bitmap (BMP)
  • Graphics Interchange Format (GIF)
  • Tagged Image File Format (TIFF)
  • JPEG XR
  • Icons (ICO)

NOTE: When using an animated GIF, only the first frame will be used for the Visual, as animation is not supported in this scenario.

To load in an image, you can use one of the four factory methods:

As you can see there are two ways to load an image: with a Uri or a Stream. Additionally, you have an option to use an overload to set the size of the image (if you don’t pass in a Size, it will decode to the natural size).


CompositionSurfaceBrush imageBrush = compositor.CreateSurfaceBrush();
LoadedImageSurface loadedSurface = LoadedImageSurface.StartLoadFromUri(new Uri(&quot;ms-appx:///Images/Photo.jpg&quot;), new Size(200.0, 200.0));
imageBrush.Surface = loadedSurface;

This is very helpful when you need to load an image that will be used for your CompositionBrush (e.g. CompositionEffectBrush) or SceneLightingEffect (e.g. NormalMap for textures) as you no longer need to manually create a hand-in Visual (a SpriteVisual painted with an EffectBrush). In an upcoming post in this series, we will explore this further using NormalMap images with to create advanced lighting to create unique and compelling materials.

Using LoadedImageSurface with a Composition Island

LoadedImageSurface is also useful when loading an image onto a SpriteVisual inserted in XAML UI using ElementCompositionPreview. For this scenario, you can use the Loaded event to adjust the visual’s properties after the image has finished loading.

Here is an example of using LoadedImageSurface for a CompositionSurfaceBrush, then updating the SpriteVisual’s size with the image’s DecodedSize when the image is loaded:


private SpriteVisual spriteVisual;
private void LoadImage(Uri imageUri)
{
    CompositionSurfaceBrush surfaceBrush = Window.Current.Compositor.CreateSurfaceBrush();

    // You can load an image directly and set a SurfaceBrush's Surface property with it
    var loadedImageSurface = LoadedImageSurface.StartLoadFromUri(imageUri);
    loadedImageSurface.LoadCompleted += Load_Completed;
    surfaceBrush.Surface = loadedImageSurface;

    // We'll use a SpriteVisual for the hand-in visual
    spriteVisual = Window.Current.Compositor.CreateSpriteVisual();
    spriteVisual.Brush = surfaceBrush;

    ElementCompositionPreview.SetElementChildVisual(MyCanvas, spriteVisual);
}

private void Load_Completed(LoadedImageSurface sender, LoadedImageSourceLoadCompletedEventArgs args)
{
    if (args.Status == LoadedImageSourceLoadStatus.Success)
    {
        Size decodedSize = sender.DecodedSize;
        spriteVisual.Size = new Vector2((float)decodedSize.Width, (float)decodedSize.Height);
    }
}

There are some things you should be aware before getting started with LoadedImageSurface. This class makes working with images a lot easier, however you should understand the lifecycle and when images get decoded/sized. We recommend that you take a couple minutes and read the documentation before getting started.

Wrapping up

Using Composition features in your XAML markup is easier than ever. From painting your UIElements with CompositionBrushes and applying lighting, to smooth off-UIThread animations, the power of the Composition API is more accessible than ever.

In the next post, we’ll explore more new APIs like the new Translation property, using XamlLights in your XAML markup and how to create a custom light using the new PointerPositionPropertySet.

Resources

The post Working with Brushes and Content – XAML and Visual Layer Interop, Part One appeared first on Building Apps for Windows.

New Lights and PropertySet Interop – XAML and Visual Layer Interop, Part Two

$
0
0

In the last post, we explored using XamlCompositionBrushBase and LoadedImageSurface to create custom CompositionBrushes that can be used to paint XAML elements directly in your markup. In today’s post, we’ll continue our look into the new improvements made to the XAML and Visual Layer Interop APIs available in the Windows 10 Creators Update.

In this blog series, we’ll cover some of these improvements in the Creators Update and look at the following APIs:

  • In Part 1:
    • XamlCompositionBrushBase – easily paint a XAML UIElement with a CompositionBrush
    • LoadedImageSurface – load an image easily and use with Composition APIs
  • In Part 2, today’s post:
    • XamlLights – apply lights to your XAML UI with a single line of XAML
    • PointerPositionPropertySet – create 60 FPS animations using pointer position, off the UI thread!
    • Enabling the Translation property – animate a XAML UI Element using Composition animation

If you’d like to review the previously available ElementCompositionPreview APIs, for example working with “hand-in” and “hand-out” Visuals, you can quickly catch up here.

Lighting UI with XamlLights

A powerful new feature in the Creators Update is the ability to set and use a Lighting effect directly in XAML by leveraging the abstract XamlLight class.

Creating a XamlLight starts just like a XamlCompositionBrushBase does, with an OnConnected and OnDisconnected method (see Part One here), but this time you inherit from the XamlLight subclass to create your own unique lighting that can be used directly in XAML. Microsoft uses this with the Reveal effect that comes with the Creators Update.

To see this in action, let’s build a demo that creates the animated GIF you see at the top of this post. It combines everything you learned about XamlCompositionBrushBase and LoadedImageSurface in the last post, but this example has two XamlLights: a HoverLight and an AmbientLight.

Let’s begin with creating the AmbientLight first. To get started, we begin similarly to the XamlCompositionBrushBase with an OnConnected and OnDisconnected method. However, for a XamlLight we set the CompositionLight property of the XamlLight subclass.


public class AmbLight : XamlLight
{
    protected override void OnConnected(UIElement newElement)
    {
        Compositor compositor = Window.Current.Compositor;

        // Create AmbientLight and set its properties
        AmbientLight ambientLight = compositor.CreateAmbientLight();
        ambientLight.Color = Colors.White;

        // Associate CompositionLight with XamlLight
        CompositionLight = ambientLight;

        // Add UIElement to the Light's Targets
        AmbLight.AddTargetElement(GetId(), newElement);
    }

    protected override void OnDisconnected(UIElement oldElement)
    {
        // Dispose Light when it is removed from the tree
        AmbLight.RemoveTargetElement(GetId(), oldElement);
        CompositionLight.Dispose();
    }

    protected override string GetId() => typeof(AmbLight).FullName;
}

With ambient lighting done, let’s build the SpotLight XamlLight. One of the main things we want the SpotLight to do is follow the user’s pointer. To do this, we can now use GetPointerPositionPropertySet method of ElementCompositionPreview to get a CompositionPropertySet we can use with a Composition ExpressionAnimation (PointerPositionPropertySet is explained in more detail in the PropertySets section below).

Here is the finished XamlLight implementation that creates that animated spotlight. Read the code comments to see the main parts of the effects, particularly how the resting position and animated offset position are used to create the lighting.


public class HoverLight : XamlLight
{
    private ExpressionAnimation _lightPositionExpression;
    private Vector3KeyFrameAnimation _offsetAnimation;

    protected override void OnConnected(UIElement targetElement)
    {
        Compositor compositor = Window.Current.Compositor;

        // Create SpotLight and set its properties
        SpotLight spotLight = compositor.CreateSpotLight();
        spotLight.InnerConeAngleInDegrees = 50f;
        spotLight.InnerConeColor = Colors.FloralWhite;
        spotLight.OuterConeAngleInDegrees = 0f;
        spotLight.ConstantAttenuation = 1f;
        spotLight.LinearAttenuation = 0.253f;
        spotLight.QuadraticAttenuation = 0.58f;

        // Associate CompositionLight with XamlLight
        this.CompositionLight = spotLight;

        // Define resting position Animation
        Vector3 restingPosition = new Vector3(200, 200, 400);
        CubicBezierEasingFunction cbEasing = compositor.CreateCubicBezierEasingFunction( new Vector2(0.3f, 0.7f), new Vector2(0.9f, 0.5f));
        _offsetAnimation = compositor.CreateVector3KeyFrameAnimation();
        _offsetAnimation.InsertKeyFrame(1, restingPosition, cbEasing);
        _offsetAnimation.Duration = TimeSpan.FromSeconds(0.5f);

        spotLight.Offset = restingPosition;

        // Define expression animation that relates light's offset to pointer position
        CompositionPropertySet hoverPosition = ElementCompositionPreview.GetPointerPositionPropertySet(targetElement);
        _lightPositionExpression = compositor.CreateExpressionAnimation("Vector3(hover.Position.X, hover.Position.Y, height)");
        _lightPositionExpression.SetReferenceParameter("hover", hoverPosition);
        _lightPositionExpression.SetScalarParameter("height", 15.0f);

        // Configure pointer entered/ exited events
        targetElement.PointerMoved += TargetElement_PointerMoved;
        targetElement.PointerExited += TargetElement_PointerExited;

        // Add UIElement to the Light's Targets
        HoverLight.AddTargetElement(GetId(), targetElement);
    }

    private void MoveToRestingPosition()
    {
        // Start animation on SpotLight's Offset
        CompositionLight?.StartAnimation("Offset", _offsetAnimation);
    }

    private void TargetElement_PointerMoved(object sender, PointerRoutedEventArgs e)
    {
        if (CompositionLight == null) return;

        // touch input is still UI thread-bound as of the Creators Update
        if (e.Pointer.PointerDeviceType == Windows.Devices.Input.PointerDeviceType.Touch)
        {
            Vector2 offset = e.GetCurrentPoint((UIElement)sender).Position.ToVector2();
            (CompositionLight as SpotLight).Offset = new Vector3(offset.X, offset.Y, 15);
        }
        else
        {
            // Get the pointer's current position from the property and bind the SpotLight's X-Y Offset
            CompositionLight.StartAnimation("Offset", _lightPositionExpression);
        }
    }

    private void TargetElement_PointerExited(object sender, PointerRoutedEventArgs e)
    {
        // Move to resting state when pointer leaves targeted UIElement
        MoveToRestingPosition();
    }

    protected override void OnDisconnected(UIElement oldElement)
    {
        // Dispose Light and Composition resources when it is removed from the tree
        HoverLight.RemoveTargetElement(GetId(), oldElement);
        CompositionLight.Dispose();
        _lightPositionExpression.Dispose();
        _offsetAnimation.Dispose();
    }

    protected override string GetId() => typeof(HoverLight).FullName;
}

Now, with the HoverLight class done, we can add both the AmbLight and the HoverLight to previous ImageEffectBrush (find ImageEffectBrush in the last post):


<Grid>
            <Grid.Background>
                <brushes:ImageEffectBrush ImageUriString="ms-appx:///Images/Background.png" />
            </Grid.Background>

            <Grid.Lights>
                <lights:HoverLight/>
                <lights:AmbLight/>
            </Grid.Lights>
</Grid>

Note: To add a XamlLight in markup, your Min SDK version must be set to Creators Update, otherwise you can set it in the code behind.

For more information, go here to read more about using XamlLight and here to see the Lighting documentation.

Using CompositionPropertySets

When you want to use the values of the ScrollViewer’s Offset or the Pointer’s X and Y position (e.g. mouse cursor) to do things like animate effects, you can use ElementCompositionPreview to retrieve their PropertySets. This allows you to create amazingly smooth, 60 FPS animations that are not tied to the UI thread. These methods let you get the values from user interaction for things like animations and lighting.

Using ScrollViewerManipulationPropertySet

This PropertySet is useful for animating things like Parallax, Translation and Opacity.


// Gets the manipulation <ScrollViewer x:Name="MyScrollViewer"/>
CompositionPropertySet scrollViewerManipulationPropertySet =
    ElementCompositionPreview.GetScrollViewerManipulationPropertySet(MyScrollViewer);

To see an example, go to the Smooth Interaction and Motion blog post in this series. There is a section devoted to using the ScrollViewerManipulationPropertySet to drive the animation.

Using PointerPositionPropertySet (new!)

New in the Creators Update, is the PointerPositionPropertySet. This PropertySet is useful for creating animations for lighting and tilt. Like ScrollViewerManipulationPropertySet, PointerPositionPropertySet enables fast, smooth and UI thread independent animations.

A great example of this is the animation mechanism behind Fluent Design’s RevealBrush, where you see lighting effects on the edges on the UIElements. This effect is created by a CompositionLight, which has an Offset property animated by an ExpressionAnimation using the values obtained from the PointerPositionPropertySet.


// Useful for creating an ExpressionAnimation
CompositionPropertySet pointerPositionPropertySet = ElementCompositionPreview.GetPointerPositionPropertySet(targetElement);
ExpressionAnimation expressionAnimation = compositor.CreateExpressionAnimation("Vector3(param.Position.X, param.Position.Y, height)");
expressionAnimation.SetReferenceParameter("param", pointerPositionPropertySet);

To get a better understanding of how you can use this to power animations in your app, let’s explore XamlLights and create a demo that uses the PointerPositionPropertySet to animate a SpotLight.

Enabling Translation Property – Animating a XAML Element’s Offset using Composition Animations

As discussed in our previous blog post, property sharing between the Framework Layer and the Visual Layer used to be tricky prior to the Creators Update. The following Visual properties are shared between UIElements and their backing Visuals:

  • Offset
  • Scale
  • Opacity
  • TransformMatrix
  • InsetClip
  • CompositeMode

Prior to the Creators update, Scale and Offset were especially tricky because, as mentioned before, a UIElement isn’t aware of changes to the property values on the hand-out Visual, even though the hand-out Visual is aware of changes to the UIElement. Consequently, if you change the value of the hand-out Visual’s Offset or Size property and the UIElement’s position changes due to a page resize, the UIElement’s previous position values will stomp all over your hand-out Visual’s values.

Now with the Creators Update, this has become much easier to deal with as you can prevent Scale and Offset stomping by enabling the new Translation property on your element, by way of the ElementCompositionPreview object.


ElementCompositionPreview.SetIsTranslationEnabled(Rectangle1, true);

//Now initialize the value of Translation in the PropertySet to zero for first use to avoid timing issues. This ensures that the property is ready for use immediately.

var rect1VisualPropertySet = ElementCompositionPreview.GetElementVisual(Rectangle1).Properties;
rect1VisualPropertySet.InsertVector3("Translation", Vector3.Zero);

Then, animate the visual’s Translation property where previously you would have animated its Offset property.


// Old way, subject to property stomping:
visual.StartAnimation("Offset.Y", animation);
// New way, available in the Creators Update
visual.StartAnimation("Translation.Y", animation);

By animating a different property from the one affected during layout passes, you avoid any unwanted offset stomping coming from the XAML layer.

Wrapping up

In the past couple posts, we explored some of the new features of XAML and Composition Interop and how using Composition features in your XAML markup is easier than ever. From painting your UIElements with CompositionBrushes and applying lighting, to smooth off-UIThread animations, the power of the Composition API is more accessible than ever.

In the next post, we’ll dive deeper into how you can chain Composition effects to create amazing materials and help drive the evolution of Fluent Design.

Resources

The post New Lights and PropertySet Interop – XAML and Visual Layer Interop, Part Two appeared first on Building Apps for Windows.

Windows Template Studio 1.2 released!

$
0
0

We’re extremely excited to announce the Windows Template Studio 1.2. What makes this release even more special is we’ve been accepted into the .NET Foundation! We are thrilled to be accepted in.

In this release, our major new feature is adding content into an existing application with Right-click add. We’ve grown up past only File->New 🙂

What’s new:

Full list of adjustments in the 1.2 release, head over to WTS’s Github.

Improvements to the Wizard:

  • Add new content to existing WTS generated projects in your solution window via right-click
    • We will be working toward seeing how we can enable this for non-WTS generated projects
  • Adjusted ordering of templates based on popularity and logical groupings
  • Under the hood, we’ve done a lot of work toward localization and started some accessibility improvements
  • Simplified descriptions
  • Logo adjustment to help at smaller icon sizes

Feature updates:

  • First-time load prompt
  • What’s New prompt

Template improvements:

Process improvements:

  • Added in pull request template
  • Added in Issue template

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.

What else is cooking for next versions?

We love all the community support and participation. In addition, here are just a few of the things we are currently building out that will in future builds:

  • Fluent design in the templates
  • Project Rome features as options for your project
  • Ink templates
  • Improved Right-click->add support for existing projects
  • Localization in the wizard
  • Full accessibility supported in both wizard and in the templates
  • Visual Basic support

With partnership with the community, we’ve will continue 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. If you have an idea or feature request, please make the request!

.NET Foundation:

We are happy to say that we’ve been accepted into the .NET Foundation. Such great open source projects like .NET Core, Roslyn and UWP Community Toolkit are just a few of the projects there, and now Windows Template Studio will be there as well!

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

Windows community standup with Kevin Gallo

$
0
0

Kevin Gallo will be live on Channel 9 with Seth Juarez on July 26th, 2017 at 9:30am PST. Kevin will be providing updates to the state of the Windows SDK inside Windows 10 Falls Creators Update since everyone last chatted with him at Microsoft Build 2017. As always, we’ll be answering live questions afterwards.

A few of the topics Kevin and Seth will be discussing are the Windows 10 Fall Creators Update SDK, .NET Standard 2.0, Fluent Design, Microsoft Graph with the Activity API and more.

Over time, we’ll hold more frequent Windows community standups to provide additional transparency on what we are building out, and clarity on why we are building them. The community standups will not only be with just Kevin, but the entire Windows development team as well. We’ll be testing different streaming technologies and interaction models to see what works best. We would love feedback on this as well.

Once again, we can’t wait to see you at 9:30am PST on July 26th, 2017 over at https://channel9.msdn.com.

The post Windows community standup with Kevin Gallo appeared first on Building Apps for Windows.


Windows Store: video trailers, improved Store listings, advanced sales, and other new capabilities

$
0
0

At Build 2017, the Windows Store announced the initial availability of several features. Today, I want to share with you that all accounts have access to these features:

  • More ways to promote your apps and drive user acquisition
  • More ways to manage schedules, prices and sales
  • Debug your apps more effectively by using CAB files
  • Use Dev Center through a modern and efficient dashboard experience

Important: If you have a submission in progress, publish it (or delete it) and your next submission will show these new pricing, sales and store listing options. Also, if you use the Windows Store submission API, be sure to read the info at the bottom of this post.

More ways to promote your apps and drive user acquisition

Many of you told us that video trailers are one of the best ways to attract customers. You can now upload up to 15 trailers to use in your Store listing. When using trailers, make sure to also include the 1920 x 1080 pixel image (16:9) in the promotional images section, which shows up after the video stops playing. Feedback from other developers using videos has been very positive, try them out!

Video trailer as shown in the Store – see it in action here on a Windows 10 PC

Creating and updating Store listings used to take many steps per language and could take hours for a submission with listings in many languages. You can now update all Store listing content (description, images, keywords, etc.), by importing and exporting your listings, reducing the update time to just a few minutes.

Export and import of store listings – Submission overview page

More ways to manage prices and sales

 When a customer makes their first purchase, we’ve found that they typically continue to purchase more add-ons in that initial app or game, as well as in other products in the Store. The new pricing and availability page gives you additional options to drive users to that first purchase:

Schedule when your app or game will be visible (as long as the submission happens with enough time to process—we recommend at least three days in advance). You have the option to specify the schedule when your app should become available and discoverable in the Store, as well as a date when it should no longer be available for new acquisitions.

 Schedule availability – pricing and availability page

Schedule price changes in advance. For example, change the base price a month after the app has been published.

Schedule price changes – pricing and availability page

There are many more options to configure sales, including using percentage values (such as “30% off”), viewing sales options in the currency that makes sense to you, configuring sales globally or for specific markets, offering discounts to customers that own one of your other apps (for example “50% off if you own this other game”) and the ability to target a discount to a segment of customers (such as those that have not made any Store purchases so far).

Sales drive purchases, so try them out!

Configure sales – Pricing and availability page

How sales show up in the Store

We also heard that you wanted a more efficient way to understand all prices, for all markets. You can now view all possible price tiers in Excel. Go to the Pricing and availability page, select view table, and you can view and export the table to CSV.

Viewing all price tiers – Pricing and availability page

Use Dev Center through a modern and efficient dashboard experience

The Dev Center dashboard has been redesigned based on your feedback to help you be more productive. It has a clean new interface, beautiful analytics, new account-level pages, integrated app picker and streamlined program switching. These are a few of the things that make the new dashboard more useful, particularly for accounts with multiple apps, games or programs.

Dev Center redesign

Debug your apps more effectively by using CAB files

 We heard a lot of feedback on having access to CAB files to help debugging apps, and improve the quality and performance of your apps and games. The Health report lets you pinpoint which OS and app version configurations generate the most crashes, and provides links to failure details with individual CAB files. These CAB files are only available for customers running any of the Windows Insider flights of Windows 10 (slow or fast), so not all failures will include the CAB download option. 

Access to failure downloads – health analytics page

Implications of these changes if you are using the Windows Store submission API

If you use the Windows Store submission API to manage your apps and games, please be aware of the following:

  • If you manage prices using the Submission API, you’ll have to use new price tiers. To do that, manually update your app or game once, so you can view the new price tiers, accept them, and then update your Submission API code to use these new price tier values, which can be found in the price table on the pricing and availability page in Dev Center, as described above.
  • The Windows Store submission API does not support all the new Store listing capabilities You can add the new assets using the Dev Center dashboard, and the submission API will be updated later in July to let you manage these new assets through the API. More details about the upcoming API capabilities, including trailers and game options, can be found.
  • If you use the StoreBroker PowerShell module to simplify using the Windows Store submission API, you can keep using it to manage the same listing asset types you are managing today. However, you won’t be able to upload the new asset types using StoreBroker until the StoreBroker team publishes an update in a few more weeks, and you pick up that update.

Read this previous blog post to learn about all the recently added Store features, and try all the features that are live today. If you have any issues finding or using these features, please let us know using the feedback link in Dev Center (upper right of the dashboard).

The post Windows Store: video trailers, improved Store listings, advanced sales, and other new capabilities appeared first on Building Apps for Windows.

How to Restart your App Programmatically

$
0
0

For some apps (especially games) it is not uncommon for the app to get into a state where it needs to restart – perhaps after a license update, after installing downloadable content, its caches have become corrupt or unwieldy, or for any other reason where the app needs to refresh state from scratch. In earlier releases, your only option would have been to prompt the user to close and relaunch, or to call CoreApplication.Exit – and both options provide sub-optimal user experience.

We have therefore introduced a new API that enables an app to request immediate termination and restart, and to pass arbitrary arguments into the fresh instance. In this post, we’ll look at how this works and how you can build it into your app. This is available now in Insider builds from Build 16226 onwards, along with the corresponding SDK.

Here’s a sample app, called TestRestart. 

The app provides a ListView of cities on the left, the currently-selected city on the right and a TextBox for providing arguments to the app when it is restarted. When the user taps the Request Restart button, the app will terminate and restart itself, passing in the supplied arguments. The new API, RequestRestartAsync, is exposed as a static method on the CoreApplication object. It takes a string parameter, which can be any string value you like – including input from the user or another external entity. If you do choose to accept input in this way, it is your responsibility to validate it correctly to make sure it conforms to whatever constraints you choose to impose. You should do this validation on input, before passing it to RequestRestartAsync. In this sample app, we’re expecting the user to type in the name of a city.


async private void DoRestartRequest()
{
    bool isValidPayload = false;
    string payload = restartArgs.Text;
    if (!string.IsNullOrEmpty(payload))
    {
        foreach (ImageViewModel imageItem in imageListView.Items)
        {
            if (imageItem.Name == payload)
            {
                isValidPayload = true;
                break;
            }
        }
    }

    if (isValidPayload)
    {
        AppRestartFailureReason result =
            await CoreApplication.RequestRestartAsync(payload);
        if (result == AppRestartFailureReason.NotInForeground ||
            result == AppRestartFailureReason.RestartPending ||
            result == AppRestartFailureReason.Other)
        {
            Debug.WriteLine("RequestRestartAsync failed: {0}", result);
        }
    }
}

To mitigate privacy concerns, an app is only permitted to restart itself if it is in the foreground at the time it makes the request. When the app restarts, it restarts with normal UI – that is, as a normal foreground window. If we were to permit a background task or minimized app to restart, the result would be unexpected to the user. This is why the API is framed as a request. If the request is denied, the app would need to handle the failure – perhaps by waiting until it is in the foreground and trying again. If you were to request a restart and then through some twist of logic managed to request it again before the system started the operation, then you’d get the RestartPending result, although this is an edge case. You’re unlikely to ever get the other result – unless something goes wrong in the platform.

Note that this is the only significant constraint, but you should use this API carefully. For example, you probably should not use it if your app was not originally launched by the user – for example, if it was launched as the result of a share or picker operation. Restarting in the middle of one of those contract operations would certainly confuse the user.

If the request is granted, the app is terminated and then restarted. There are many different ways to activate an app: in addition to a regular launch activation, apps can choose to support file activation, protocol activation, share or picker activation and so on. The list is documented here. For the restart case, the app will be activated as a regular launch – just as if the user had closed the app manually and tapped its tile to launch it again – but including the arbitrary arguments supplied earlier (if any).

In your App class, you should handle this by overriding the OnActivated method. Test the ActivationKind, and if it’s ActivationKind.Launch, then the incoming IActivatedEventArgs will be a LaunchActivatedEventArgs. From this, you can get hold of the incoming activation arguments. For a regular user-initiated launch, the Arguments will be empty, so if it’s not empty you could simply infer that this is a restart activation. You can also check the PreviousExecutionState, which for a restart operation will be set to Terminated.

Although the arguments might have originated from an untrusted source (eg, the user), you should have done the validation before requesting restart. If so, you can consider them trustworthy when you receive them in OnActivated.


protected override void OnActivated(IActivatedEventArgs args)
{
    switch (args.Kind)
    {
        case ActivationKind.Launch:
            LaunchActivatedEventArgs launchArgs = args as LaunchActivatedEventArgs;
            string argString = launchArgs.Arguments;

            Frame rootFrame = Window.Current.Content as Frame;
            if (rootFrame == null)
            {
                rootFrame = new Frame();
                Window.Current.Content = rootFrame;
            }
            rootFrame.Navigate(typeof(MainPage), argString);
            Window.Current.Activate();
            break;
    }
}

What you do with the incoming arguments is entirely up to you. In this app, we’re simply passing them on to the MainPage. In the MainPage in turn, we have an override of OnNavigatedTo which uses the string to select an item in the ListView:


protected override void OnNavigatedTo(NavigationEventArgs e)

{
    string payload = e.Parameter as string;
    if (!string.IsNullOrEmpty(payload))
    {
        foreach (ImageViewModel imageItem in imageListView.Items)
        {
            if (imageItem.Name == payload)
            {
                imageListView.SelectedItem = imageItem;
                break;
            }
        }
    }
}

As you can see, the CoreApplication.RequestRestartAsync method is a simple API. You can use it to terminate your app immediately, and have it restart as if by user action, with the additional option of passing in arbitrary arguments on activation.

Sample Code here.

The post How to Restart your App Programmatically appeared first on Building Apps for Windows.

Configure your app to start at log-in

$
0
0

For a long time, desktop PC users have been able to configure Win32 apps to start at startup or user log-in. This has also been possible for Desktop Bridge apps since the Windows 10 Anniversary Update (v10.0.14393.0). We’ve now extended this feature to allow regular Universal Windows Apps to take part in this also. This is available in Insider builds from Build 16226 onwards, along with the corresponding SDK. In this post, we’ll look at the code changes you need to make in your manifest and in your App class to handle the startup scenario, and how your app can work with the user to respect their choices.

Here’s a sample app, called TestStartup – the app offers a button to request enabling the startup behavior, and reports current status. Typically, you’d put this kind of option into a settings page of some kind in your app.

The first thing to note is that you must use the windows.startupTask Extension in your app manifest under the Extensions node, which is a child of the Application node. This is documented here. The same Extension declaration is used for both Desktop Bridge and regular UWP apps – but there are some differences.

  • Desktop Bridge is only available on Desktop, so it uses a Desktop-specific XML namespace. The new UWP implementation is designed for use generally on UWP, so it uses a general UAP namespace (contract version 5) – although to be clear, it is currently still only actually available on Desktop.
  • The Desktop Bridge EntryPoint must be “Windows.FullTrustApplication,” whereas for regular UWP it is the fully-qualified namespace name of your App class.
  • Desktop Bridge apps can set the Enabled attribute to true, which means that the app will start at startup without the user having to manually enable it. Conversely, for regular UWP apps this attribute is ignored, and the feature is implicitly set to “disabled.” Instead, the user must first launch the app, and the app must request to be enabled for startup activation.
  • For Desktop Bridge apps, multiple startupTask Extensions are permitted, each one can use a different Executable. Conversely, for regular UWP apps, you would have only one Executable and one startupTask Extension.
Desktop Bridge App UWP App

xmlns:desktop="http://schemas.microsoft.com/
appx/manifest/desktop/windows10"


xmlns:uap5="http://schemas.microsoft.com/
appx/manifest/uap/windows10/5"


<desktop:Extension
  Category="windows.startupTask"
  Executable="MyDesktopBridgeApp.exe"
  EntryPoint="Windows.FullTrustApplication">
  <desktop:StartupTask
    TaskId="MyStartupId"
    Enabled="false"
    DisplayName="Lorem Ipsum" />
</desktop:Extension>


<uap5:Extension
  Category="windows.startupTask"
  Executable="TestStartup.exe"
  EntryPoint="TestStartup.App">
  <uap5:StartupTask
    TaskId="MyStartupId"
    Enabled="false"
    DisplayName="Lorem Ipsum" />
</uap5:Extension>

For both Desktop Bridge apps and regular UWP apps, the user is always in control, and can change the Enabled state of your startup app at any time via the Startup tab in Task Manager:

Also for both app types, the app must be launched at least once before the user can change the Disabled/Enabled state. This is potentially slightly confusing: if the user doesn’t launch the app and then tries to change the state to Enabled in Task Manager, this will seem to be set. However, if they then close Task Manager and re-open it, they will see that the state is still Disabled. What’s happening here is that Task Manager is correctly persisting the user’s choice of the Enabled state – but this won’t actually allow the app to be activated at startup unless and until the app is launched at least once first – hence the reason it is reported as Disabled.

In your UWP code, you can request to be enabled for startup. To do this, use the StartupTask.GetAsync method to initialize a StartupTask object (documented here) – passing in the TaskId you specified in the manifest – and then call the RequestEnableAsync method. In the test app, we’re doing this in the Click handler for the button. The return value from the request is the new (possibly unchanged) StartupTaskState.


async private void requestButton_Click(object sender, RoutedEventArgs e)
{
    StartupTask startupTask = await StartupTask.GetAsync("MyStartupId");
    switch (startupTask.State)
    {
        case StartupTaskState.Disabled:
            // Task is disabled but can be enabled.
            StartupTaskState newState = await startupTask.RequestEnableAsync();
            Debug.WriteLine("Request to enable startup, result = {0}", newState);
            break;
        case StartupTaskState.DisabledByUser:
            // Task is disabled and user must enable it manually.
            MessageDialog dialog = new MessageDialog(
                "I know you don't want this app to run " +
                "as soon as you sign in, but if you change your mind, " +
                "you can enable this in the Startup tab in Task Manager.",
                "TestStartup");
            await dialog.ShowAsync();
            break;
        case StartupTaskState.DisabledByPolicy:
            Debug.WriteLine(
                "Startup disabled by group policy, or not supported on this device");
            break;
        case StartupTaskState.Enabled:
            Debug.WriteLine("Startup is enabled.");
            break;
    }
}

Because Desktop Bridge apps have a Win32 component, they run with a lot more power than regular UWP apps generally. They can set their StartupTask(s) to be Enabled in the manifest and do not need to call the API. For regular UWP apps, the behavior is more constrained, specifically:

  • The default is Disabled, so in the normal case, the user must run the app at least once explicitly – this gives the app the opportunity to request to be enabled.
  • When the app calls RequestEnableAsync, this will show a user-prompt dialog for UWP apps (or if called from a UWP component in a Desktop Bridge app from the Windows 10 Fall Creators Update onwards).
  • StartupTask includes a Disable method. If the state is Enabled, the app can use the API to set it to Disabled. If the app then subsequently requests to enable again, this will also trigger the user prompt.
  • If the user disables (either via the user prompt, or via the Task Manager Startup tab), then the prompt is not shown again, regardless of any requests from the app. The app can of course devise its own user prompts, asking the user to make manual changes in Task Manager – but if the user has explicitly disabled your startup, you should probably respect their decision and stop pestering them. In the sample code above, the app is responding to DisabledByUser by popping its own message dialog – you can obviously do this if you want, but it should be emphasized that there’s a risk you’ll just annoy the user.
  • If the feature is disabled by local admin or group policy, then the user prompt is not shown, and startup cannot be enabled. The existing StartupTaskState enum has been extended with a new value, DisabledByPolicy. When the app sees DisabledByPolicy, it should avoid re-requesting that their task be enabled, because the request will never be approved until the policy changes.
  • Platforms other than Desktop that don’t support startup tasks also report DisabledByPolicy.

Where a request triggers a user-consent prompt (UWP apps only), the message includes the DisplayName you specified in your manifest. This prompt is not shown if the state is DisabledByUser or DisabledByPolicy.

If your app is enabled for startup activation, you should handle this case in your App class by overriding the OnActivated method. Check the IActivatedEventArgs.Kind to see if it is ActivationKind.StartupTask, and if so, case the IActivatedEventArgs to a StartupTaskActivatedEventArgs. From this, you can retrieve the TaskId, should you need it. In this test app, we’re simply passing on the ActivationKind as a string to MainPage.


protected override void OnActivated(IActivatedEventArgs args)
{
    Frame rootFrame = Window.Current.Content as Frame;
    if (rootFrame == null)
    {
        rootFrame = new Frame();
        Window.Current.Content = rootFrame;
    }

    string payload = string.Empty;
    if (args.Kind == ActivationKind.StartupTask)
    {
        var startupArgs = args as StartupTaskActivatedEventArgs;
        payload = ActivationKind.StartupTask.ToString();
    }

    rootFrame.Navigate(typeof(MainPage), payload);
    Window.Current.Activate();
}

Then, the MainPage OnNavigatedTo override tests this incoming string and uses it to report status in the UI.


protected override void OnNavigatedTo(NavigationEventArgs e)
{
    string payload = e.Parameter as string;
    if (!string.IsNullOrEmpty(payload))
    {
        activationText.Text = payload;

        if (payload == "StartupTask")
        {
            requestButton.IsEnabled = false;
            requestResult.Text = "Enabled";
            SolidColorBrush brush = new SolidColorBrush(Colors.Gray);
            requestResult.Foreground = brush;
            requestPrompt.Foreground = brush;
        }
    }
}

Note that when your app starts at startup, it will start minimized in the taskbar. In this test app, when brought to normal window mode, the app reports the ActivationKind and StartupTaskState:

Using the windows.startupTask manifest Extension and the StartupTask.RequestEnableAsync API, your app can be configured to start at user log-in. This can be useful for apps which the user expects to use heavily, and the user has control over this – but it is still a feature that you should use carefully. You should not use the feature if you don’t reasonably expect the user to want it for your app – and you should avoid repeatedly prompting them once they’ve made their choice. The inclusion of a user-prompt puts the user firmly in control, which is an improvement over the older Win32 model.

Sample Code here.

The post Configure your app to start at log-in appeared first on Building Apps for Windows.

Creating Materials and Lights in the Visual Layer

$
0
0

In today’s post, we’re going wrap up this series by combining everything we’ve learned so far and take you through the steps in creating a custom material. We also have an amazing new tool to show you that empowers anyone to design a custom material. To see how you can use these custom materials in your XAML app, be sure to check out the last two posts in this series; XAML and Visual Layer Interop, part one and part two.

The Fluent Design Language is an evolving concept, rather than a one-time design language release like MDL and MDL2. It was designed to expand and grow as Microsoft and the community of creators (developers and designers), adds to what it could be. We’ll show you that anything is possible, as designers, developers and the Windows community have common ground to share their creations and create amazing materials.

Let’s get started by first showing you how a material is created by chaining effects, then we’ll explore using the new Material Creator to easily and quickly create materials.

Creating Material with the Visual Layer

CompositionEffectBrush

Whether we’ll be using the effect in a XamlCompositionBrushBase or painting a SpriteVisual, the construction of the effect graph is the core of the approach. In order to create the material we want, we’ll need the following components:

  • Effect sources: A SurfaceBrush for the NormalMap and a BackdropBrush for access to the pixels underneath the material
  • The effect graph: A composite of different effects to control the Material’s reflectance properties and filter effects (such as blur and tint) to customize for UI usage
  • Lighting: The Visual is in a scene that has a CompositionLight applied

Let’s start with the first source, a SurfaceBrush. This will be provided by using LoadedImageSurface to load a NormalMap.

NormalMap and LoadedImageSurface

If you’ve had any experience with 3D computer graphics, maybe as a game developer, you may already know what a normal map is and the image above looks familiar. If you’ve never worked with one before, Normal mapping is a technique that determines the reflectance of light at every pixel (read more about Normal mapping here). The Visual Layer in Windows 10 gives you a choice of industry standard reflectance models; Blinn-Phong and Physically Based Blinn-Phong. Go here to read more about the math behind how this is done.

For today’s demo, we used a 2D picture of a textured surface and transformed it into a Normal map image using an image editor. There are many image editing tools that let you do this. You can use any one you prefer to create your image.

To get started, we can load the image using the new LoadedImageSurface API. Let’s add a private field for the LoadedImageSurface, load the image and create a CompositionSurfaceBrush with it.


// Load NormalMap onto an ICompositionSurface using LoadedImageSurface
LoadedImageSurface _surface = LoadedImageSurface.StartLoadFromUri(new Uri("ms-appx:///Images/NormalMap.jpg"), new Size(512,384));

// Load Surface onto SurfaceBrush
CompositionSurfaceBrush normalMap = compositor.CreateSurfaceBrush(_surface);
normalMap.Stretch = CompositionStretch.Uniform;

Now we’re ready to move on to creating and chaining effects.

Chaining Effects to create the effect graph

For our material, we are going to create a chain of effects that leverages the Win2D’s ArithmeticCompositeEffect (note: be sure to add the Win2D NuGet package to your project). All effects can be used as input sources for other effects, thus enabling you to allow a chain of effects to one or more inputs.

ArithmeticCompositeEffect lets you assign two sources for the composite, giving each one a weight toward the final effect. For example, Source1 at 0.75 (75%) and Source2 at 0.25 (25%). You can also use an additional ArithmeticCompositeEffect as one of the sources to add more effects in the composite chain.

Let’s step back for a minute and think about how we want create the composite:

  • Parent ArithmeticCompositeEffect to be used for Brush
    • Source 1: Child ArithmeticCompositeEffect
      • Source 1: ColorSourceEffect for tint coloring
      • Source 2: GaussianBlurEffect using the BackDropBrush for its source
    • Source2: SceneLightingEffect using the Normal map for its source

For source 1, we’ll combine a ColorSourceEffect and GaussianBlurEffect (from Win2D) with a nested ArithmeticSourceEffect. For Source 2, we’ll use a SceneLightingEffect (from Windows.UI.Composition.Effects). This will manipulate the reflective properties of the effect’s source when a CompositionLight, from a XamlLight for example, is applied.

Note that the SceneLightingEffect is used to modify the default lighting applied to the contents of a SpriteVisual targeted by a CompositionLight. In today’s example, we are going to create SurfaceBrush using a NormalMap (loaded by LoadedImageSurface) to define dents and bumps that the light reflects off of.

Furthermore, in order to use the SceneLightingEffect, the content being modified must be defined as one of the sources into a multi-input effect graph, with the other input being the SceneLightingEffect. For example, above, the content whose lighting properties are being modified is defined by Source1 of the parent ArithmeticCompositeEffect.

Here’s what the code looks like for the effect graph:


// Define Effect graph
const float glassLightAmount = 0.5f;
const float glassBlurAmount = 0.95f;
Color tintColor = Color.FromArgb(255, 128, 128, 128);

var graphicsEffect = new ArithmeticCompositeEffect
{
    Name = "LightComposite",
    Source1Amount = 1,
    Source2Amount = glassLightAmount,
    MultiplyAmount = 0,
    // Nested Composite to combine the Blur and Color tint effects
    Source1 = new ArithmeticCompositeEffect
    {
        Name = "BlurComposite",
        Source1Amount = 1 - glassBlurAmount,
        Source2Amount = glassBlurAmount,
        MultiplyAmount = 0,
        Source1 = new ColorSourceEffect
        {
            Name = "Tint",
            Color = tintColor,
        },
        Source2 = new GaussianBlurEffect
         {
            BlurAmount = 20,
             Source = new CompositionEffectSourceParameter("Backdrop"),
            Optimization = EffectOptimization.Balanced,
            BorderMode = EffectBorderMode.Hard,
        },
    },
    // The SceneLighting effect, which will use a NormalMap
    Source2 = new SceneLightingEffect
    {
        AmbientAmount = 0.15f,
        DiffuseAmount = 1,
        SpecularAmount = 0.1f,
        NormalMapSource = new CompositionEffectSourceParameter("NormalMap")
    }
};

Notice the SceneLightingEffect’s NormalMapSource property and the GaussianBlurEffect’s Source; these are parameter provided sources. We will set what these parameters are as we pull everything together to create the CompositionEffectBrush:


// Create EffectFactory and the CompositionEffectBrush
CompositionEffectFactory effectFactory = Window.Current.Compositor.CreateEffectFactory(graphicsEffect);
CompositionEffectBrush effectBrush = effectFactory.CreateBrush();

// Create BackdropBrush, this is used by the GaussianBlurEffect
CompositionBackdropBrush backdrop = Window.Current.Compositor.CreateBackdropBrush();

// Set Sources to Effect
effectBrush.SetSourceParameter("NormalMap", _normalMap);
effectBrush.SetSourceParameter("Backdrop", backdrop);

With the CompositionEffect completed, we can now use it to paint a SpriteVisual, like this:


SpriteVisual spriteVisual = Window.Current.Compositor.CreateSpriteVisual();
spriteVisual.Brush = effectBrush;

If you’re primarily a XAML dev, you can use this effect in a XamlCompositionBrushBase. Let’s take a look.

Using the CompositionEffectBrush in a XamlCompositionBrushBase

As I mentioned earlier, we can also create this effect graph in XamlCompositionBrushBase and set the XamlCompositionBrushBase’s CompsositionBrush property. If you haven’t read the post in this series on how to create a XamlCompositionBrushBase, go here to catch up.

As with the other XamlCompositionBrushBase implementations, we build the effect graph in the OnConnected method and make sure that the user’s device supports effects. This can be done using the AreEffectsSupported method of the CompositionCapabilities API.

Here’s the full class:


public sealed class MaterialBrush : XamlCompositionBrushBase
{
    private LoadedImageSurface _surface;

    protected override void OnConnected()
    {
        if (DesignMode.DesignModeEnabled) return;

        Compositor compositor = Window.Current.Compositor;

        // CompositionCapabilities: Are Effects supported?
        bool usingFallback = !CompositionCapabilities.GetForCurrentView().AreEffectsSupported();
        FallbackColor = Color.FromArgb(100, 60, 60, 60);

        if (usingFallback)
        {
            // If Effects are not supported, use Fallback Solid Color
            CompositionBrush = compositor.CreateColorBrush(FallbackColor);
            return;
        }

        // Load NormalMap onto an ICompositionSurface using LoadedImageSurface
        _surface = LoadedImageSurface.StartLoadFromUri(new Uri("ms-appx:///Images/NormalMap.jpg"), new Size(512, 384));

        // Load Surface onto SurfaceBrush
        CompositionSurfaceBrush normalMap = compositor.CreateSurfaceBrush(_surface);
        normalMap.Stretch = CompositionStretch.Uniform;

        // Define Effect graph
        const float glassLightAmount = 0.5f;
        const float glassBlurAmount = 0.95f;
        Color tintColor = Color.FromArgb(255, 128, 128, 128);

        var graphicsEffect = new ArithmeticCompositeEffect()
        {
            Name = "LightComposite",
            Source1Amount = 1,
            Source2Amount = glassLightAmount,
            MultiplyAmount = 0,
            Source1 = new ArithmeticCompositeEffect()
            {
                Name = "BlurComposite",
                Source1Amount = 1 - glassBlurAmount,
                Source2Amount = glassBlurAmount,
                MultiplyAmount = 0,
                Source1 = new ColorSourceEffect()
                {
                    Name = "Tint",
                    Color = tintColor,
                },
                Source2 = new GaussianBlurEffect()
                {
                    BlurAmount = 20,
                    Source = new CompositionEffectSourceParameter("Backdrop"),
                    Optimization = EffectOptimization.Balanced,
                    BorderMode = EffectBorderMode.Hard,
                },
            },
            Source2 = new SceneLightingEffect()
            {
                AmbientAmount = 0.15f,
                DiffuseAmount = 1,
                SpecularAmount = 0.1f,
                NormalMapSource = new CompositionEffectSourceParameter("NormalMap")
            },
        };

        // Create EffectFactory and EffectBrush
        CompositionEffectFactory effectFactory = compositor.CreateEffectFactory(graphicsEffect);
        CompositionEffectBrush effectBrush = effectFactory.CreateBrush();

        // Create BackdropBrush
        CompositionBackdropBrush backdrop = compositor.CreateBackdropBrush();

        // Set Sources to Effect
        effectBrush.SetSourceParameter("NormalMap", normalMap);
        effectBrush.SetSourceParameter("Backdrop", backdrop);

        // Set EffectBrush as the brush that XamlCompBrushBase paints onto Xaml UIElement
        CompositionBrush = effectBrush;
    }

    protected override void OnDisconnected()
    {
        // Clean up resources
        _surface?.Dispose();
        _surface = null;

        CompositionBrush?.Dispose();
        CompositionBrush = null;
    }
}

To see this in action, let’s create a Grid to put in the middle of our page’s root Grid and set an instance of our MaterialBrush to that Grid’s Background brush:


<Grid Background="Gray">
    <Grid Width="580"
          Height="387"
          HorizontalAlignment="Center"
          VerticalAlignment="Center">

        <!-- Our new MaterialBrush -->
        <Grid.Background>
            <brushes:MaterialBrush />
        </Grid.Background>
    </Grid>
</Grid>

Here’s what it would look like if you ran the app now:

This is because you’re missing the second part of the approach, the lighting!

Illuminating the Material with Lights

In the last post, we created two lights (an AmbientLight “AmbLight” and the SpotLight “HoverLight”). We’ll use them today to apply lighting to the UIElement that is using our custom material.

Since our MaterialBrush uses the new SceneLightingEffect with a Normal map, any lights applied will enhance the material per the SceneLightingEffect’s configuration. Note that this isn’t necessary, but can greatly enhance your material. For example, if you’re using an Acrylic material in your app, adding Reveal will enhance the Acrylic.

Let’s now add the two XamlLights to the Grid:


<Grid Background="Gray">
    <Grid Width="580"
          Height="387"
          HorizontalAlignment="Center"
          VerticalAlignment="Center">
        <Grid.Background>
            <brushes:MaterialBrush />
        </Grid.Background>

        <!-- Added lights -->
        <Grid.Lights>
            <lights:HoverLight />
            <lights:AmbLight />
        </Grid.Lights>
    </Grid>
</Grid>

Now, this is what you’ll see at runtime:

What if it were easier to create and experiment with new materials? What if there were a tool that anyone can use? Let’s take a look at what’s coming to the WindowsUIDevLabs GitHub repo, the Material Creator tool.

Using the new Material Creator

Introducing availability of the new Material Creator tool!

Creating custom materials may sometimes requires a bit of experimentation and tweaking to get the effect’s property configuration just right. This would take time if you had to constantly tweak and redeploy your app. What if there were a way that you could change effect properties and material layers in real time?

The Material Creator can be found on the WindowsUIDevLabs GitHub repo in the demos folder here. (Note: you need to be running Windows 10, build 16225 or higher to use the Material Creator).

Generating the SceneLightingEffect code

One of the great features of the tool is being able to see the effect graph after you’re done creating the material. Click the ellipsis and select “view effect graph” to see the C# code for the SceneLightingEffect. You can then copy and use this code directly in your custom material class.

If you go back up to the part of this article where we created the ArithemticCompositeEffect that contains a SceneLightingEffect, that’s where you can use this code!

The key takeaway is that you don’t need to be a developer to create materials. A designer can create a material, then share the effect graph code with a developer for implementation in a XamlCompositionBrushBase. Even Windows enthusiasts, like the Windows Insiders, can start building out a universe of materials to drive the evolution of Fluent Design.

Blog Series Wrap up: The future of Fluent Design materials

Acrylic and Reveal are stunning examples of how using Material with Lights can alter the Windows experience, but they’re just the beginning of what is possible. The vision for the Fluent Design Language going forward is that developers and designers can easily build custom materials, innovate and share as well.

The message we want you to walk away with is that you can build new Materials, for a couple primary reasons:

  • Because you’re a Creator
  • Because it embodies your brand

We look forward to seeing what kinds of materials you create for your Windows apps! If you’ve already built your own material, feel free to share in the comments below.

Resources

The post Creating Materials and Lights in the Visual Layer appeared first on Building Apps for Windows.

Windows Subsystem for Linux on Windows Server

$
0
0

The Windows Subsystem for Linux (WSL) is available in Windows Insider builds of Windows Server. Now developers and application administrators can run tools they use in Linux environments alongside Cmd and PowerShell.

If you want to jump straight in, the installation guide is available here.

Why include WSL on Windows Server?

We want Windows, including Windows Server, to be a great place for developers. We know developers, system administrators, people managing services and people building services all occasionally need tools available on Linux.  Many more would like to run Linux tools as part of their workflow as a matter of convenience.

Previously, there were a few options:

  1. Run something like Cygwin and rely on Win32 ports of common GNU tools.
    Cygwin is a great toolset but it runs into issues when using tools that haven’t been ported to Windows. Many tools simply aren’t available. This is especially common when trying to build and run Ruby & Java solutions, which utilize some Linux-only Gems, libraries and components.
    The tools available through Cigwin and other Win32 ports are also notorious for being out of date – which is understandable since updating them requires recompiling them for Windows. For Windows users, however, this is both inconvenient and often leads to troublesome compatibility issues when running, building or deploying software.
  2. Use Linux in a virtual machine.
    Virtual machines are designed for production workloads on Windows Server. They aren’t ideal for things closely tied to the Windows Server host. If you need basic Linux command-line tools integrated with their Windows system, a virtual machine will be cumbersome.

This is where running Linux on WSL provides value: WSL runs unmodified Linux (ELF64) binaries natively. It can install and run almost any Linux command-line tool integrated in Windows.

With the additions of WSL and Linux containers with Hyper-V isolation, Windows Server offers a wide variety of Linux options that make it a great place and platform for modern developers.

If you’re a server engineer that needs to run node.js, Ruby, Python, Perl, Bash scripts or other tools that expect Linux behaviors, environment or filesystem-layout, the ability to install and run Linux with WSL expands the tools at your disposal on Windows Server.

What this isn’t — WSL is not a Linux server

Just as with WSL on Windows Client, you can run daemons and jobs like MySQL, PostgreSQL, sshd, etc., via an interactive shell, but you cannot currently use WSL to run persistent Linux services, daemons, jobs, etc. as background tasks.

For these sorts or tools, read more about Linux containers with Hyper-V isolation from the Build 2017 announcement.

How do I get started using WSL on Server?

Windows Subsystem for Linux arrived in Windows Server Insider Build 16237. Follow our new Windows Server WSL Installation Instructions to get started running Linux alongside Cmd and PowerShell on your Servers.

Feel free to comment below or reach out to Sarah and Rich via Twitter.

The post Windows Subsystem for Linux on Windows Server appeared first on Building Apps for Windows.

Windows 10 SDK Preview Build 16257 and Mobile Emulator Build 15235 Released

$
0
0

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

The Preview SDK and Mobile Emulator 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  (need to see if fixed)
    When building apps on previous platforms, you may get a build error:

C:\program files (x86)\Windows Kits\10\bin\10.0.16232.0\x86\genxbf.dll:C:\program files (x860\Windows Kits\10\bin\10.0.16232.0\x86\genxbf.dll(0,0): Error WMC0621: Cannot resolve ‘GenXbf.dll’ under path ‘C:\program files (x860\Windows Kits\10\bin\10.0.16232.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:


<WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion>

  • WRL projects fail to compile with MIDLRT error: When building my WRL project that contains a WinRT Component, the project no longer compiles.  I get the following errors:

midlrt : command line error MIDL1012: [msg]argument illegal for switch / [context]ns_prefix
midlrt : command line error MIDL1000: [msg]missing source-file name

To work around this temporarily you will need to use the previous version of the MidlRT.exe tool.  You can do this by changing your changing your Target Platform Version to a currently installed previous SDK.


<WindowsTargetPlatformVersion>10.0.15063</WindowsTargetPlatofrmVersion>

Breaking Changes

ecmangen.exe removal from the SDK: ecmangen.exe will no longer ship with the Windows SDK. Developers who rely on ecmangen for event manifest creation are advised to install the Windows Creator Edition of the SDK to obtain the file. Developers may also use notepad or other XML editor of choice for manifest creation. A schema file is available on MSDN to aid in manifest creation, for tools that support it.

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.

The following are the API changes since the 16232 Preview SDK, please reference that list. The TreeView control has been removed, but will be back soon in the next release of Windows and the Preview SDK.

Addition from Preview SDK 16232


namespace Windows.Storage {
  public sealed class AppDataPaths
  public sealed class SystemDataPaths
  public sealed class UserDataPaths
}

Removals from Preview SDK 16232


namespace Windows.UI.Xaml.Automation.Peers {
  public class TreeViewItemAutomationPeer : ListViewItemAutomationPeer
  public class TreeViewListAutomationPeer : SelectorAutomationPeer
}
namespace Windows.UI.Xaml.Controls {
  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
}
 

The post Windows 10 SDK Preview Build 16257 and Mobile Emulator Build 15235 Released appeared first on Building Apps for Windows.

Xbox Live Creators Program Is Now Live!

$
0
0

Back in March, we revealed the Xbox Live Creators Program. Today, we’re excited to announce that any developer can now directly publish their games to Xbox One and Windows 10. We’ve already had some great games published during the preview program (check out the list below!), but there’s always space for more, and it’s time for your game to shine. Microsoft is committed to ensuring that any developer who wants to publish their game on Windows 10 PCs and the Xbox One console family can do so, and the Creators Program enables creators big and small, from around the world, to do just that.

What’s the Creators Program, you ask? Xbox Live Creators Program allows any developer to directly publish their games – any of their games – to Xbox One consoles and Windows 10 PCs with a standard certification process already in place for any other app or game in the Universal Windows Platform ecosystem. In other words, if you have a Dev Center account, then you’re ready to publish your game to Xbox One and Windows 10 PCs.

But it gets better! Using the Creators Program also allows you to implement a number of Xbox Live services directly in your game. Stuff like Gamertag Presence, Xbox Live leaderboards and Connected Storage. Things that make your life as a game creator easier, but also enhance your gamers’ experiences. And you also get to take advantage of killer features like Game Hubs and Clubs, Mixer streaming (and integration for more interactive experiences) and some really awesome accessibility features to make sure your game is available for an even wider audience.

And because you get to use the standard Windows Store certification process, you can have the freedom to publish when you’re ready, set pricing the way you like and establish sales and updates that fit your schedule.

Any Creators Program game published on the Windows 10 Store will be listed in the Games category, it’s that simple. On the Xbox One console, we’ve created a special section of the Store called Creators Collection, so that your game can be easily discovered by people looking for something new. We also did this because we know from feedback from players, parents and developers, that the current curated experience on the Xbox One Store is something they love. So, having the Creators collection gives all of us the best of both worlds: A curated store and a fully open marketplace in the Creators Collection.

Does the Creators Program sound good to you? It does to us! And it’s so easy to do. First step is to build your game utilizing UWP and Xbox Live SDK, and for that you can use the tools you’re already using – Visual Studio, game engines like Unity, Construct 2, MonoGame and Xenko – and combine them with a retail Xbox One console and your Dev Center account. You’ll need to grab the free Dev Mode Activation app from the Xbox Store, but then you’re just a few button presses away from converting that retail machine into something ready for your development efforts.

The Dev Center account is the standard one for anyone building apps or games in the Microsoft ecosystem. If you don’t have one yet, it costs as little as $20 as a one-time fee. Then get started on your Xbox Live integration by checking out the Creators Program page and the Xbox Live Creators Program step by step guide.

Creators Program games have access to a large set of Xbox Live services, but not all of them. You’ll be able to implement features such as sign-in and presence, use of your Gamertag, leaderboards, access to your Activity Feed, Game Hubs, Clubs, Party Chat, Game DVR and broadcasting on Mixer.

However, since Creators Program is an open program as opposed to a managed one, some services are not available to you: Achievements, Gamerscore or internet multiplayer. The good news is that if you want access to these features, we encourage you to apply to the  ID@Xbox program where you’ll get the ability to incorporate these. And of course, there’s a path for games to move from the Creators Program to ID@Xbox during development (or even after they reach the Store) if a developer decides they want to add Gamerscore, Achievements or internet multiplayer later on.

While ID@Xbox was designed for professional game developers who wish to use the full set of Xbox Live features through a full certification process, the Creators Program gives all the other developers a “right-sized” set of Xbox Live services. So whether they’re small studios, hobbyists, makers, teachers and students, or if they’re just learning the ropes – the Creators Program is a simplified way to create and ship games to the Xbox community.

We know that the below set of titles is just the beginning. We’re going to highlight more of the diverse array of Creators Program games that catch our eyes on the Xbox Wire. I hope to see your game listed there one day soon.

Here’s a quick look at the first titles that will be available via the program:

  • Animal Rivals, Blue Sunset Games: Animal Rivals is an action-packed couch party game for one to four players. Drop into the game and fight for the Animalonia’s throne as one of the furry contenders in different mini-games and locations. The game itself presents a unique art style mixing the cartoonish looks and satire approach. (Xbox One, Windows 10)
  • Block Dropper, Tresiris Games: Block Dropper is a fast paced, arcade style, 3D platformer. Try not to fall as you guide your character through the challenging single player mode or grab a friend to battle head to head in a local multiplayer Block Battle Arena. Tresiris is a small game studio based in Olathe, Kansas, who create fun and simple games with quality as their top priority. (Xbox One, Windows 10)
  • Crystal Brawl, Studio Mercato: Gauntlet meets NBA Jam in Crystal Brawl, a 2v2 capture-the-flag local multiplayer game that melds fast action with MOBA-like strategy. Choose from a variety of characters with different abilities, with a notable twist: each character has a unique ability that alters the terrain. Experiment with different character combinations to uncover hidden strategies! Studio Mercato is an independent game studio based in New York City. (Xbox One, Windows 10)
  • Derelict Fleet, Bionic Pony: Derelict Fleet is a fast-paced space combat game. You are tasked with defending a refugee fleet as you travel the stars searching for a new colony to call home. Bionic Pony is a small indie studio based in Tampa, FL that started making Xbox Live indie games in 2010. (Xbox One)
  • ERMO, Nonostante: ERMO is a relaxing puzzle game featured with a calming and peaceful graphics. Immerse yourself in the landscapes and colors of ERMO and let you be carried away. You will learn the rules in a few seconds, but ERMO will catch you for hours. (Xbox One)
  • GalactiMAX!, ONLYUSEmeFEET: In the vast darkness of space, GalactiMAX has the player shooting aliens for points to pierce the heavens in classic arcade shooter action! As more aliens are defeated, the player’s ship will increase in size and power. How big can this ship get?! (Xbox One, Windows 10)
  • kubic, Pixel Envision Ltd: kubic is a relaxing optical illusion puzzle game based on M.C. Escher’s art, impossible objects and other geometric designs. The object is to construct the goal configuration from a number of pieces. (Xbox One, Windows 10)
  • Space Cat!, GershGamesLLC: Shoot your way past an onslaught of enemies and bosses. Collect weapon upgrades like missiles, bombs, laser beams and much more. GershGamesLLC is a group of young hobbyists that makes for fun on the weekends. (Xbox One, Windows 10)
  • Stereo Aereo, The Stonebot Studio: Stereo Aereo is an action rhythm game that is inspired by the pop-culture influences of the 80’s. You, the player, have to make sure that the mediocre space rockband Stereo Aereo, gets to their life changing concert, on time, in this comic styled sci-fi game. (Xbox One, Windows 10)

Finally, to celebrate the availability of Creators Program becoming open for any developer, we’re also highlighting the Dream.Build.Play contest, which has an Xbox One category for any game developer who incorporates Creators Program features into their game. So not only can you get your game on the console for the first time, you have a shot at winning some cash money while you do it. Sounds good to us!

The post Xbox Live Creators Program Is Now Live! appeared first on Building Apps for Windows.


Using your ad units correctly when you have multiple store apps

$
0
0

As we had blogged earlier, ad unit performance has a direct correlation with the application category and the users targeted by the application. Having an ad unit associated with multiple store applications leads to ambiguity, which can result in improper ad delivery. This will have an adverse impact on your revenue and user experience. The Children’s Online Privacy Protection Act (COPPA) and other compliance requirements mandate that there is a 1:1 correlation between a store application and an ad unit.

Each ad unit must be only be used in a single store application. This requirement includes applications that target Universal Windows Platform applications, along with Windows 8.x (WinRT) applications.

We’ve reached out to developers through various means, including multiple notifications inside Dev Center. The ad delivery will soon stop on ad units used across multiple applications, so if you have any such ad units, please update! Setting up new ad units is extremely easy.

Don’t forget these following tips that can help maximize your in-app-ad revenue:

The post Using your ad units correctly when you have multiple store apps appeared first on Building Apps for Windows.

New Tools in Windows Device Portal for the Windows 10 Fall Creators Update

$
0
0

In the Windows 10 Fall Creators Update, Device Portal now offers several new tools from across Windows to help you location test your UWP, explore Mixed Reality, build new hardware peripherals and test your app’s new installation pipeline. It’s a little bit of goodness for everyone, and we’re excited to share these with you.

If you’re not familiar with Device Portal, you can check out the blog posts below to see what other tools you can find in Device Portal, or look at the new docs.microsoft.com to learn how to enable it.

And as always, all of these tools are backed by a REST API, so that you can use it from a scripting or client application environment using the Device Portal Wrapper.

Location Based Testing

Most of us don’t have the travel budgets to test our apps across the world – but pretending to travel is almost as good! The Location tool in Device Portal lets you easily change the location that Windows reports to apps. By tapping the “Override” check box, you can swap out the device location for whatever you set using the map or lat/long text boxes. Be sure to uncheck the box when you’re done so that your location (and timezone) come back to reality – every vacation must end…

Figure 1: The News app keeping me up to date with local headlines!

This also works for web pages in Microsoft Edge, letting you test your webpages in different parts of the world.

Some notes on what this tool can and cannot do:

  • This doesn’t change the locale of your PC! So the News app above still saw an EN-US user in the middle of Italy.
  • You may not see all apps using this location. Some programs don’t use the Windows API to determine location or have special logic (e.g. using your IP address) to determine your location.
  • This tool marks the PositionSource of the location data as “Default.” Some apps may check for the source and alter their behavior based on it.

Happy travels!

USB Diagnostics

This one goes out to all the hardware folks – if “HLK” or “WDK” sound familiar, you might find this handy. The USB team has updated the USBView tool to work inside Device Portal, so developers working on new hardware can have more tooling at their fingertips.

The USB Devices tool can be a bit tricky to find – head to the hamburger menu in the top right, and go to “Add tools to workspace.”  Scroll to the bottom and check the “USB Devices” box, then hit “Add.” And voila – a full view of your systems USB hubs, controllers and peripherals. The hubs and controllers expand to show individual devices using the + (plus) sign, and clicking the gear will expand to show the items properties.

Streaming App Install Debugging

The Windows 10 Creators Update added ““streaming installation” for UWP, which allows a user to launch the app before it finished downloading. In order to make this easy to test, the App Model team has added a Streaming Install Debugger tool to Device Portal. To use it, deploy an app with content groups to the device, then open the Streaming Install Debugger. In it you’ll be able to edit the states of the content groups so you can test your apps behavior as streaming install is being simulated and ensure it behaves correctly when content groups are missing.

For more details, check out Andy Liu’s blog posts about the new App Installer and Streaming Install Debugger tools.

Mixed Reality Tooling

One of the bigger splashes in the Fall Creators Update is the addition of Mixed Reality to Windows Desktop. As part of that release, we’re including a suite of tools to help developers build great Mixed Reality apps. Two of these tools may look familiar to HoloLens developers – 3D View and a Framerate counter. There’s also a new app launch option that appears when you have an immersive headset attached to your PC, which lets you launch your app in Mixed Reality.

Frame rate is an important factor in making mixed reality apps comfortable, and it’s important for developers to optimize performance to hit full frame rate on the systems they support. The Frame Rate tool in the Device Portal helps by showing developers both the frame rate of their app and of the system’s compositor.

The 3D View helps when testing your immersive headset’s interactions with the real world, displaying its position as it moves through space.

Finally, what good is tooling if you can’t actually run your app in your immersive headset? Now, when you have an immersive headset attached, the Installed Apps tool will add a button letting you launch the app in the HMD. While fully immersive apps will always run in Mixed Reality, this new button is particularly useful for 2D UWP apps (or apps that switch between 2D and immersive) when you want to test them in Mixed Reality.

As always, if you have ideas for Device Portal that would help you write or debug apps, please leave us a note on our UserVoice or upvote an existing request. If you run into bugs, please file it with us via the Feedback Hub.

Related Posts:

Using Device Portal to view debug logs for UWP

Using the App File Explorer to see your app data

The post New Tools in Windows Device Portal for the Windows 10 Fall Creators Update appeared first on Building Apps for Windows.

Windows 10 SDK Preview Build 16267 and Mobile Emulator Build 15240 Released

$
0
0

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

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

For feedback and updates to the known issues, please see the developer forum. For new developer 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 continue to submit your apps that target Windows 10 Creators build or earlier to the Windows 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

  • Compilation fails on non-Windows 10 platforms
    When building apps on previous platforms, you may get a build error:

C:\program files (x86)\Windows Kits\10\bin\10.0.16232.0\x86\genxbf.dll:C:\program files (x860\Windows Kits\10\bin\10.0.16232.0\x86\genxbf.dll(0,0): Error WMC0621: Cannot resolve ‘GenXbf.dll’ under path ‘C:\program files (x860\Windows Kits\10\bin\10.0.16232.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

  • ecmangen.exe removal from the SDK: Ecmangen.exe will no longer ship with the Windows SDK. Developers who rely on ecmangen for event manifest creation are advised to install the Windows Creators Edition of the SDK to obtain the file. Developers may also use notepad or other XML editor of choice for manifest creation. A schema file is available on MSDN to aid in manifest creation, for tools that support it.

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.

The following are the API changes since the 16257 Preview SDK, please reference that list.

Additions to Preview SDK 16257

 
namespace Windows.Storage.Provider {
  public enum HardlinkPolicy : uint
  public enum HydrationPolicy {
    AlwaysFull = 3,
    Partial = 0,
  }
  public enum InSyncPolicy : uint {
    DirectoryLastWriteTime = (uint)512,
    FileLastWriteTime = (uint)256,
  }
  public enum PopulationPolicy {
    AlwaysFull = 2,
  }
  public sealed class StorageProviderSyncRootInfo {
    HardlinkPolicy HardlinkPolicy { get; set; }
  }
}
namespace Windows.UI.WebUI {
  public sealed class WebUIStartupTaskActivatedEventArgs : IActivatedEventArgs, IActivatedEventArgsDeferral, IActivatedEventArgsWithUser, IStartupTaskActivatedEventArgs {
    ActivatedOperation ActivatedOperation { get; }
  }
}

Removals from Preview SDK 16257

 
namespace Windows.Storage.Provider {
  public enum HydrationPolicy {
    NoPartial = 3,
    OnDemand = 0,
  }
  public enum PopulationPolicy {
    NoPartial = 2,
  }
}

The post Windows 10 SDK Preview Build 16267 and Mobile Emulator Build 15240 Released appeared first on Building Apps for Windows.

Understanding the ad mediation configuration in the Microsoft ad mediation service

$
0
0

We announced the general availability of the Microsoft ad mediation service in May 2017. The federated cloud based ad mediation service is designed to help app developers maximize their ad revenue. In this blog post, we will go deeper into the mechanics of how a developer can configure their ad network choices to achieve the best possible yield.

Configuring mediation for your application

Developers can setup ad mediation in the Windows Dev center for their ad enabled applications. The ad mediation service mediates ad requests between a plethora of ad networks. The mediation configuration UX in the Monetize with Ads page for an application provides the developer control over managing the mediation configuration for that application.

Microsoft optimized configuration

The default option that is selected is for Microsoft to choose the best mediation settings for the app. This allows the machine learning algorithms that we employ to make ad requests to the best possible available ad networks to ensure highest yield for the developers.

The yield management algorithms use a mixture of User Profile (Age/Gender, Behavioral​ Segmentation, Location​, Time of the day, Day of the week​, Ad Engagement Rate​), Publisher quality score (Ad Size, Ad Format, Ad Placement​, Similar Apps, Category, CTR​, Viewability Signals, Quality Score) and Historical data score (Historical CPM, Historical Sell-through Rate​) parameters for their computation.

The machine learning algorithm looks at various parameters to compute the waterfall order of the ad partners that would get the maximum yield for the application developer.

It is strongly recommended that developers choose this default option for maximizing yield for their ad enabled apps.

Manual configuration

A developer can also manually configure the rank order of the ad networks to serve ads on a given ad unit. These selections can be done across all markets or can be customized for specific markets. When the option for letting Microsoft choose the best mediation settings is unselected, the list of available ad networks and their order is shown. The developer can play around with these settings and set it up to their desired values, including setting specific order for different markets. They can also remove ad networks from the waterfall by toggling the ‘Active’ checkbox in the configuration UX, as shown below.

If you notice the choice of networks here, you can see the presence of both paid and other (non-paid) ad networks. The percentages indicate the percentage of times the ad request will be sent to the ‘type’ of ad networks first. The percentages allow for the developer to allocate between paid and non-paid ad networks. This gives them flexibility to play with the type of ads being shown based on their requirements. For example, if a developer wants to use a given week to just promote their app, they can mark the paid ads to 0% and non-paid House and Community ads to 100%.

In the above screenshot, the ad request would be sent first to the other ad networks 30% first before it would be sent to the paid networks. If the developer does not have any House or Community ad campaigns setup, no ads would be returned for them.

Although it is recommended that developers use the Microsoft optimized configuration option, there are a few advanced scenarios in which a developer would choose to go with a manual configuration:

  1. The developer wants to exclude a few ad networks from serving
  2. The developer wants to tweak the ratio of paid and free ads
  3. The developer wants specific configuration for different markets

The configuration can be changed once per day and takes a couple of hours to take effect. Developers can learn more about configuring their ad unit for optimal yield here.

Examining the performance of the various ad networks in the Analytics page can help the developer choose the method of configuration for their ad networks.

We hope this gives you insight into how you can use the ad mediation service to increase your yield. Please let us know if you have any questions or comments!

The post Understanding the ad mediation configuration in the Microsoft ad mediation service appeared first on Building Apps for Windows.

New WinDbg available in preview!

$
0
0

We are excited to announce a preview version of a brand new WinDbg. We’ve updated WinDbg to have more modern visuals, faster windows, a full-fledged scripting experience, built with the easily extensible debugger data model front and center. I’ll start this by saying that WinDbg Preview is using the same underlying engine as WinDbg today, so all the commands extensions and workflows you’re used to will still work just as they did before.

Getting started

I know a lot of you are going to want to dive right in and try it out, so here are the things you should know before doing so.

  • Installation – You can install the WinDbg Preview from the Store if you have Windows 10 Anniversary Update or newer at https://www.microsoft.com/en-us/store/p/windbg/9pgjgd53tn86 – WinDbg Preview uses some features from the Windows 10 Anniversary Update, so that’s required for now. The Windows Store lets us release bug fixes and updates to you faster than we’ve ever been able to before, so make sure to stayed tuned to our blog and MSDN to learn the latest about the preview.
  • Feedback – Familiarize yourself a bit with the Feedback Hub! We’ve still got a long way to go before we cover all WinDbg features, and we’ll be using the Feedback Hub to help us prioritize what you want us to work on. The Windows Insider website has a great overview on how to give good feedback – https://insider.windows.com/en-us/how-to-feedback. Once you’ve read that, just hit the ‘Feedback Hub’ button on the home ribbon.
  • Questions – You’re bound to have a lot of questions, so feel free to post them on this blog post, send feedback in the Feedback Hub or tweet @aluhrs13 and I’ll do my best to answer. We’ll be posting an FAQ on our blog sometime in the upcoming weeks.
  • Documentation – We’ve got some early documentation up on MSDN that’s preliminary and subject to change at https://go.microsoft.com/fwlink/p/?linkid=854349. You can give us feedback or propose edits to that documentation by hitting “Comments” or “Edit” on any page. Also keep your eyes on our MSDN blog for more updates and tips.
  • Videos – We went to the Channel 9 studio and recorded a couple episodes of Defrag Tools to help explain some of the basics of WinDbg Preview.
    • Defrag Tools #182 – Tim, Chad and I go over the basics of WinDbg Preview and some of the features
    • Defrag Tools #183 – Nick, Tim and Chad use WinDbg Preview and go over a quick demo
    • Coming Soon – Bill and Andrew walk through the scripting features in WinDbg Preview

What’s New

There are a lot of major changes, some of them under the hood and some of them really obvious. Here are my favorites or the things that people have told me they like the best.

Less intimidating

One of the words people often use to describe WinDbg is “intimidating.” When you first open it, you get a dull gray screen and very little indication of what to do next. Once you’re going outside of the stepping icons, it’s difficult to tell what toolbar button or menu is what you want. With WinDbg Preview, we’ve taken a few steps to make it a bit easier for beginners.

  • Ribbon – Ribbons are great when icons don’t do a great job of describing an action and when there are a lot of different contextual actions that are only sometimes relevant. Right now our ribbon is pretty barebones with the basics, but over time we’ll be adding more ribbons for specific contexts while you’re debugging.
  • Re-worked file menu – The new file menu makes it much more clear which options you have for starting and configuring your debugging session. The attach dialog is much cleaner and more organized now and, there’s even a new option to launch your Store App or background tasks without needing to set it up with PLMDebug.exe.
  • Familiar source windows – Source windows now are better in pretty much every way and should look more like the source windows you’re used to seeing in every other modern editor.

Quality of life improvements

WinDbg has gone a long time without any major quality of life improvements or modernizations. This has led a lot of people to doing registry hacks to get a prettier theme, or having a dozen icons pinned to their taskbar for each thing they debug often. We’ve taken some of these work-arounds and made them easy to access.

  • Dark theme – This one is pretty self-explanatory. A lot of people use dark themes in their editors and then flip over to the glaring brightness of WinDbg. Now it can match!
  • Recent targets – Instead of having to have your KDNET key and IP on a sticky-note on your monitor, WinDbg Preview will now remember all your recent sessions and some of the settings that you had during that session. You can quickly access them again from the recent targets list in the file menu.
  • Various window improvements – Many windows have gone a while without updates or just have glaring bugs. Some of the notable things we’ve done differently are that the disassembly window keeps its highlighting in the right spot when scrolled, and the memory window has better highlighting and scrolling. Many windows are also asynchronous now and loading can be cancelled by running another command.

Data model front and center

Hopefully you’ve heard about the debugger data model by now. If you haven’t check out some of my older blog posts and our MSDN docs linked above. Up until now, the data model was only accessible through JavaScript and the dx command. With WinDbg Preview, we’re putting the data model under the vast majority of what you see, making it much more extensible.

  • Extensible locals and watch – The data model is now powering the locals and watch windows. NatVis and JavaScript extensions that extend the data model will be reflected in those windows. You can even put LINQ queries into the watch window!
  • Model windows – There’s a new type of window called a model window. Model windows will show the results of any model query in a normal hierarchy view or a table. You’ll see in the FAQ that WinDbg Preview doesn’t have a modules window, but you can use a model window to make your own with @$cursession.Modules! This also has the benefit that if you make a JavaScript extension that extends modules, it’ll automatically update your window.
  • Built-in scripting environment – One of the biggest complaints with scripting and extending the debugger is having to go into an IDE to write and iterate on it. With WinDbg Preview you can write and execute your JavaScript and NatVis directly from the debugger. The script window has error highlighting, IntelliSense and easier execution of scripts.

Restrictions and other things worth noting

While we’ve got that big list of what’s new and awesome, this is still a preview, so there’s some things that you should be aware of:

  • At this point in the preview, we’re only offering WinDbg Preview through the Windows Store. That means only devices running Windows 10 Anniversary Update can install it.
  • You might hit errors when trying to do something that requires elevation. You’ll have to manually launch WinDbg Preview elevated.
  • The concept of a workspace is going to be changing a lot. A workspace in WinDbg Preview is vastly different from one in WinDbg. The MSDN documentation linked above has more information.

That’s where we are today. The core experiences are there and we’ll be releasing improvements faster than our normal pace now that we’re shipping from the Windows Store. Please don’t hesitate to send us feedback and feature requests in the Feedback Hub or in the comments below. We want your input as we move forward!

The post New WinDbg available in preview! appeared first on Building Apps for Windows.

Viewing all 623 articles
Browse latest View live