### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.layoutcontext.layoutstate Example of getting and setting the LayoutState property in C#. ```csharp var object = layoutContext.layoutState; layoutContext.layoutState = object; ``` -------------------------------- ### C# Get and Set Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.composition.scenes.scenesurfacematerialinput.wrappingumode?view=windows-app-sdk-2.0 Example of getting and setting the WrappingUMode property in C#. ```csharp var sceneWrappingMode = sceneSurfaceMaterialInput.wrappingUMode; sceneSurfaceMaterialInput.wrappingUMode = sceneWrappingMode; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.personpicturetemplatesettings.actualinitials Example of how to get the ActualInitials property value in C#. ```csharp var string = personPictureTemplateSettings.actualInitials; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.hosting.desktopwindowxamlsource.content?view=windows-app-sdk-2.0 Example of getting and setting the Content property in C#. ```csharp var uIElement = desktopWindowXamlSource.content; desktopWindowXamlSource.content = uIElement; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.media.revealbrush.color Example of getting and setting the Color property in C#. ```csharp var color = revealBrush.color; revealBrush.color = color; ``` -------------------------------- ### C# Get and Set Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.primitives.scrollbar.viewportsize Demonstrates how to get and set the ViewportSize property in C#. ```csharp var double = scrollBar.viewportSize; scrollBar.viewportSize = double; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.scrollingscrolloptions.animationmode Example of getting and setting the AnimationMode property. ```csharp var scrollingAnimationMode = scrollingScrollOptions.animationMode; scrollingScrollOptions.animationMode = scrollingAnimationMode; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.composition.experimental.expcompositioncontentautomationproviderrequestedeventargs.handled?view=windows-app-sdk-0.8 A C# example demonstrating how to get and set the Handled property. ```csharp var boolean = expCompositionContentAutomationProviderRequestedEventArgs.handled; expCompositionContentAutomationProviderRequestedEventArgs.handled = boolean; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.composition.compositionprojectedshadow.minopacity?view=windows-app-sdk-0.8 Example of getting and setting the MinOpacity property in C#. ```csharp var single = compositionProjectedShadow.minOpacity; compositionProjectedShadow.minOpacity = single; ``` -------------------------------- ### KeyTime Property Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.media.animation.doublekeyframe.keytime?view=windows-app-sdk-2.0 This C# example demonstrates how to get and set the KeyTime property. ```csharp var keyTime = doubleKeyFrame.keyTime; doubleKeyFrame.keyTime = keyTime; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.windows.media.capture.cameracaptureuiphotocapturesettings.format?view=windows-app-sdk-2.0 This example demonstrates how to get and set the Format property in C#. ```csharp var cameraCaptureUIPhotoFormat = cameraCaptureUIPhotoCaptureSettings.format; cameraCaptureUIPhotoCaptureSettings.format = cameraCaptureUIPhotoFormat; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.composition.bouncescalarnaturalmotionanimation.acceleration?view=windows-app-sdk-2.0 Example of getting and setting the Acceleration property in C#. ```csharp var single = bounceScalarNaturalMotionAnimation.acceleration; bounceScalarNaturalMotionAnimation.acceleration = single; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.composition.compositionroundedrectanglegeometry.size Example of how to get and set the Size property in C#. ```csharp var vector2 = compositionRoundedRectangleGeometry.size; compositionRoundedRectangleGeometry.size = vector2; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.composition.compositionlineargradientbrush.startpoint Demonstrates how to get and set the StartPoint property in C#. ```csharp var vector2 = compositionLinearGradientBrush.startPoint; compositionLinearGradientBrush.startPoint = vector2; ``` -------------------------------- ### C# Get and Set Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.calendarview.selectedpressedforeground Example of getting and setting the SelectedPressedForeground property in C#. ```csharp var brush = calendarView.selectedPressedForeground; calendarView.selectedPressedForeground = brush; ``` -------------------------------- ### Restart App Instance Example (C#) Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.windows.applifecycle.appinstance.restart?view=windows-app-sdk-2.0 Example demonstrating how to restart an app instance with arguments, handling potential restart failures. This is useful when an error occurs during initialization and the app needs to restart, potentially in a different mode. ```csharp using Windows.ApplicationModel.Core; using Microsoft.Windows.AppLifecycle; using System.Diagnostics; ... private void HandleInitializationError() { // Restart app in safe mode to avoid another initialization failure. // Note: Your app would need to handle the 'safemode' argument and // implement a safe mode experience in this scenario. AppRestartFailureReason reason = AppInstance.Restart("/safemode"); switch (reason) { case AppRestartFailureReason.RestartPending: Debug.WriteLine("Another restart is currently pending."); break; case AppRestartFailureReason.InvalidUser: Debug.WriteLine("Current user is not signed in or not a valid user."); break; case AppRestartFailureReason.Other: Debug.WriteLine("Failure restarting."); break; } } ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.primitives.tickbar.fill Example of getting and setting the Fill property in C#. ```csharp var brush = tickBar.fill; tickBar.fill = brush; ``` -------------------------------- ### PointLight.LinearAttenuation C# Get and Set Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.composition.pointlight.linearattenuation Example of getting and setting the LinearAttenuation property in C#. ```csharp var single = pointLight.linearAttenuation; pointLight.linearAttenuation = single; ``` -------------------------------- ### C# Example: Managing Package Sets with Dynamic Dependencies Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.windows.management.deployment.packageruntimemanager.removepackageset?view=windows-app-sdk-2.0 This C# example demonstrates how to add, use, and then remove package sets using PackageRuntimeManager and PackageDeploymentManager. It includes helper logic for creating PackageVersion objects. ```csharp void DoWorkWithExample1AndExample2() { var packageSet = new PackageSet() { Items = { new PackageSetItem() { PackageFamilyName = "contoso.example1_1234567890abc", MinVersion = ToVersion(1, 2, 3, 4), PackageUri = new Uri("c:\\contoso\\example1-1.2.3.4.msix") }, { new PackageSetItem() { PackageFamilyName = "contoso.example2_1234567890abc", MinVersion = ToVersion(2, 4, 6, 8), PackageUri = new Uri("https://contoso.com/example2-2.4.6.8.msix") } }; var packageDeploymentManager = PackageDeploymentManager.GetDefault(); var options = new EnsureReadyOptions(); var deploymentResult = await packageDeploymentManager.EnsurePackageSetReadyAsync(packageSet, options); if (deplymentResult.Status == PackageDeploymentStatus.CompletedSuccess) { Console.WriteLine("OK"); } else { Console.WriteLine("Error:{} ExtendedError:{} {}", deploymentResult.Error.HResult, deploymentResult.ExtendedError.HResult, deploymentResult.ErrorText); } var packageRuntimeManager = PackageRuntimeManager.GetDefault(); var packageSetRuntimeDisposition = packageRuntimeManager.AddPackageSet(packageSet); DoWork(); packageRuntimeManager.RemovePackageSet(packageSetRuntimeDisposition); } PackageVersion ToVersion(uint major, uint minor, uint build, uint revision) => new PackageVersion { Major = checked((ushort)major), Minor = checked((ushort)minor), Build = checked((ushort)build), Revision = checked((ushort)revision) }; ``` -------------------------------- ### Initialize AnimatedBackVisualSource (C++/CX) Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.animatedvisuals.animatedbackvisualsource.-ctor?view=windows-app-sdk-2.0 Initializes a new instance of the AnimatedBackVisualSource class using C++/CX. ```cpp AnimatedBackVisualSource(); ``` -------------------------------- ### Get EmbeddingVectors (C# Example) Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.windows.ai.text.languagemodelembeddingvectorresult.embeddingvectors?view=windows-app-sdk-2.0 Example of how to get the embedding vectors using the EmbeddingVectors property in C#. ```csharp var iVectorView = languageModelEmbeddingVectorResult.embeddingVectors; ``` -------------------------------- ### C# Usage Example for CompositionRectangleGeometry.Size Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.composition.compositionrectanglegeometry.size?view=windows-app-sdk-2.0 Example of how to get and set the Size property in C#. ```csharp var vector2 = compositionRectangleGeometry.size; compositionRectangleGeometry.size = vector2; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.textboxselectionchangingeventargs.selectionstart This snippet demonstrates how to access the SelectionStart property in C#. ```C# var int32 = textBoxSelectionChangingEventArgs.selectionStart; ``` -------------------------------- ### C# Get and Set Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.composition.interactions.interactiontrackerinertiarestingvalue.restingvalue?view=windows-app-sdk-2.0 Provides a C# example of getting and setting the RestingValue property with an ExpressionAnimation. ```csharp var expressionAnimation = interactionTrackerInertiaRestingValue.restingValue; interactionTrackerInertiaRestingValue.restingValue = expressionAnimation; ``` -------------------------------- ### ListenForHighContrastChange Example (C#) Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.system.themesettings This C# code sample demonstrates how to create a ThemeSettings object for a window and subscribe to its Changed event to detect changes in the system's High Contrast setting. ```APIDOC ## Example: Listening for High Contrast Changes (C#) ```csharp void MyApp.ListenForHighContrastChange(XamlRoot xamlRoot) { var myWindowId = xamlRoot.ContentIslandEnvironment().AppWindowId(); m_themeSettings = ThemeSettings.CreateForWindowId(myWindowId); m_themeSettings.Changed += (ts, _) => { if (ts.HighContrast()) { Debug.WriteLine("High contrast is ON, scheme is: "); Debug.WriteLine(ts.HighContrastScheme()); } else { Debug.WriteLine("High contrast is OFF."); } }; } ``` ``` -------------------------------- ### CreatePackageDependencyOptions.VerifyDependencyResolution Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.windows.applicationmodel.dynamicdependency.createpackagedependencyoptions.verifydependencyresolution?view=windows-app-sdk-2.0 Gets or sets a value that indicates whether to disable dependency resolution when pinning a package dependency. This is useful for installers running as user contexts other than the target user (for example, installers running as LocalSystem). Specify true to verify dependency resolution when pinning a package dependency; specify false to disable dependency resolution. ```APIDOC ## CreatePackageDependencyOptions.VerifyDependencyResolution Property ### Description Gets or sets a value that indicates whether to disable dependency resolution when pinning a package dependency. This is useful for installers running as user contexts other than the target user (for example, installers running as LocalSystem). ### Property Value Boolean ### Remarks Specify **true** to verify dependency resolution when pinning a package dependency; specify **false** to disable dependency resolution. ### Applies to * Windows App SDK: 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 2.0 Experimental, 2.0 ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.composition.compositionprojectedshadowreceiver.receivingvisual?view=windows-app-sdk-2.0 Example of how to get and set the ReceivingVisual property in C#. ```csharp var visual = compositionProjectedShadowReceiver.receivingVisual; compositionProjectedShadowReceiver.receivingVisual = visual; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.statetrigger.isactiveproperty?view=windows-app-sdk-2.0 Example of how to get the IsActiveProperty in C#. ```csharp var dependencyProperty = StateTrigger.isActiveProperty; ``` -------------------------------- ### EntranceNavigationTransitionInfo Constructor Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.media.animation.entrancenavigationtransitioninfo.-ctor?view=windows-app-sdk-2.0 Initializes a new instance of the EntranceNavigationTransitionInfo class. ```APIDOC ## EntranceNavigationTransitionInfo Constructor ### Description Initializes a new instance of the EntranceNavigationTransitionInfo class. ### Method Constructor ### Endpoint Microsoft.UI.Xaml.Media.Animation.EntranceNavigationTransitionInfo.EntranceNavigationTransitionInfo() ### Applies to - Windows App SDK: 0.8, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 2.0 Experimental, 2.0 ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.composition.scenes.scenesurfacematerialinput.wrappingvmode Demonstrates how to get and set the WrappingVMode property. ```csharp var sceneWrappingMode = sceneSurfaceMaterialInput.wrappingVMode; sceneSurfaceMaterialInput.wrappingVMode = sceneWrappingMode; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.media.animation.drillinthemeanimation.entrancetarget Demonstrates how to get and set the EntranceTarget property in C#. ```csharp var dependencyObject = drillInThemeAnimation.entranceTarget; drillInThemeAnimation.entranceTarget = dependencyObject; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.composition.distantlight.direction Example of getting and setting the Direction property in C#. ```csharp var vector3 = distantLight.direction; distantLight.direction = vector3; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.primitives.autosuggestboxhelper.keepinteriorcornerssquareproperty Example of how to get the DependencyProperty for KeepInteriorCornersSquare in C#. ```csharp var dependencyProperty = AutoSuggestBoxHelper.keepInteriorCornersSquareProperty; ``` -------------------------------- ### C# Example: Pick and Read File Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.windows.storage.pickers.fileopenpicker.picksinglefileasync Demonstrates using PickSingleFileAsync to open a file picker and read the content of the selected file. Ensure you have the necessary using directives. ```C# using Microsoft.Windows.Storage.Pickers; ... var openPicker = new FileOpenPicker(this.AppWindow.Id); var result = await openPicker.PickSingleFileAsync(); if (result is not null) { var content = System.IO.File.ReadAllText(result.Path); } else { // Add error handling logic here } ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.composition.spritevisual.shadow Example of how to get and set the shadow property in C#. ```csharp var compositionShadow = spriteVisual.shadow; spriteVisual.shadow = compositionShadow; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.calendarviewdayitem.dateproperty Example of how to get the DependencyProperty object in C#. ```csharp var dependencyProperty = CalendarViewDayItem.dateProperty; ``` -------------------------------- ### TeachingTipAutomationPeer Constructor Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.automation.peers.teachingtipautomationpeer.-ctor Initializes a new instance of the TeachingTipAutomationPeer class. ```APIDOC ## TeachingTipAutomationPeer Constructor ### Description Initializes a new instance of the TeachingTipAutomationPeer class. ### C++ (WinRT) ```cpp TeachingTipAutomationPeer(TeachingTip const& owner); ``` ### C# ```csharp public TeachingTipAutomationPeer(TeachingTip owner); ``` ### JavaScript ```javascript function TeachingTipAutomationPeer(owner) ``` ### VB ```vb Public Sub New (owner As TeachingTip) ``` ### Parameters #### owner - **owner** (TeachingTip) - Required - The TeachingTip control instance to create the peer for. ### Applies to - **Windows App SDK**: 0.8, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 2.0 Experimental, 2.0 ``` -------------------------------- ### C++/WinRT Get and Set Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.documents.hyperlink.xyfocusupnavigationstrategy Example of getting and setting the XYFocusUpNavigationStrategy property in C++/WinRT. ```cpp XYFocusNavigationStrategy XYFocusUpNavigationStrategy(); void XYFocusUpNavigationStrategy(XYFocusNavigationStrategy value); ``` -------------------------------- ### C# Usage Example for SuggestedStartLocation Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.windows.storage.pickers.folderpicker.suggestedstartlocation?view=windows-app-sdk-2.0 This C# code demonstrates how to get and set the SuggestedStartLocation property of a folder picker object. ```csharp var pickerLocationId = folderPicker.suggestedStartLocation; folderPicker.suggestedStartLocation = pickerLocationId; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.automation.peers.appbarbuttonautomationpeer.expandcollapsestate Example of how to get the ExpandCollapseState property in C#. ```csharp var expandCollapseState = appBarButtonAutomationPeer.expandCollapseState; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.composition.springvector3naturalmotionanimation.period?view=windows-app-sdk-2.0 Example of getting and setting the Period property. ```csharp var timeSpan = springVector3NaturalMotionAnimation.period; springVector3NaturalMotionAnimation.period = timeSpan; ``` -------------------------------- ### TeachingTipAutomationPeer Constructor (C#) Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.automation.peers.teachingtipautomationpeer.-ctor?view=windows-app-sdk-2.0 Initializes a new instance of the TeachingTipAutomationPeer class using C#. ```csharp public TeachingTipAutomationPeer(TeachingTip owner); ``` -------------------------------- ### C# Usage Example for DisplayStatus Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.windows.system.power.powermanager.displaystatus?view=windows-app-sdk-2.0 Example of how to get the display status in C#. ```csharp var displayStatus = PowerManager.displayStatus; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.input.processkeyboardacceleratoreventargs.key?view=windows-app-sdk-2.0 Example of how to retrieve the virtual-key in C#. ```csharp var virtualKey = processKeyboardAcceleratorEventArgs.key; ``` -------------------------------- ### C# Usage Example for Vector3Transition.Components Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.vector3transition.components?view=windows-app-sdk-2.0 Example of getting and setting the Components property in C#. ```csharp var vector3TransitionComponents = vector3Transition.components; vector3Transition.components = vector3TransitionComponents; ``` -------------------------------- ### Initialize AnimatedBackVisualSource (C#) Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.animatedvisuals.animatedbackvisualsource.-ctor?view=windows-app-sdk-2.0 Initializes a new instance of the AnimatedBackVisualSource class using C#. ```csharp public AnimatedBackVisualSource(); ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.windows.storage.pickers.fileopenpicker.settingsidentifier?view=windows-app-sdk-2.0 Example of how to get and set the SettingsIdentifier property in C#. ```csharp var string = fileOpenPicker.settingsIdentifier; fileOpenPicker.settingsIdentifier = string; ``` -------------------------------- ### C# Property Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.windows.widgets.providers.widgetresourcerequestedargs.response Example of getting and setting the Response property in C#. ```csharp var widgetResourceResponse = widgetResourceRequestedArgs.response; widgetResourceRequestedArgs.response = widgetResourceResponse; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.composition.interactions.interactiontrackervector2inertianaturalmotion.condition Provides a practical example of getting and setting the Condition property in C#. ```csharp var expressionAnimation = interactionTrackerVector2InertiaNaturalMotion.condition; interactionTrackerVector2InertiaNaturalMotion.condition = expressionAnimation; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.windows.applicationmodel.dynamicdependency.createpackagedependencyoptions.verifydependencyresolution?view=windows-app-sdk-2.0 Example of how to get and set the VerifyDependencyResolution property in C#. ```csharp var boolean = createPackageDependencyOptions.verifyDependencyResolution; createPackageDependencyOptions.verifyDependencyResolution = boolean; ``` -------------------------------- ### Initialize(DeploymentInitializeOptions) Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/Microsoft.Windows.ApplicationModel.WindowsAppRuntime.DeploymentManager.Initialize Checks the status of the Windows App SDK runtime and registers missing packages, applying specified options. This method should be called once at app startup. ```APIDOC ## Initialize(DeploymentInitializeOptions) ### Description Checks the status of the Windows App SDK runtime referenced by the current package, and attempts to register any missing Windows App SDK packages that can be registered, while applying the options supplied. Important To ensure that necessary Windows App SDK runtime packages are present, your app should call **DeploymentManager.Initialize** once (no more than once) at app startup. For more info, and to determine whether this explicit call is necessary, see Initialize the Windows App SDK. ### Method (Not specified, likely a static method call) ### Endpoint (Not applicable for SDK methods) ### Parameters #### Path Parameters - **DeploymentInitializeOptions** (type not specified) - Required - Options to apply during initialization. ### Request Example (Not applicable for SDK methods) ### Response (Not specified, likely void or status indication) ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.mediaplayerpresenter.isfullwindow?view=windows-app-sdk-2.0 Demonstrates how to get and set the IsFullWindow property in C#. ```csharp var boolean = mediaPlayerPresenter.isFullWindow; mediaPlayerPresenter.isFullWindow = boolean; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.resourcemanagerrequestedeventargs.customresourcemanager Example of how to get and set the CustomResourceManager property in C#. ```csharp var iResourceManager = resourceManagerRequestedEventArgs.customResourceManager; resourceManagerRequestedEventArgs.customResourceManager = iResourceManager; ``` -------------------------------- ### C++/WinRT Example: Pick and Read File Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.windows.storage.pickers.fileopenpicker.picksinglefileasync Demonstrates using PickSingleFileAsync to open a file picker and read the content of the selected file. Ensure you have the necessary includes and using directives. ```C++ #include #include #include using namespace winrt::Microsoft::Windows::Storage::Pickers; FileOpenPicker openPicker(AppWindow().Id()); auto& result{ co_await openPicker.PickSingleFileAsync() }; if (result) { std::ifstream fileReader(result.Path().c_str()); std::string text((std::istreambuf_iterator(fileReader)), std::istreambuf_iterator()); winrt::hstring hText = winrt::to_hstring(text); } else { // Add error handling logic here } ``` -------------------------------- ### C# Get and Set Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.documents.hyperlink.xyfocusupnavigationstrategy Example of getting and setting the XYFocusUpNavigationStrategy property in C#. ```csharp public XYFocusNavigationStrategy XYFocusUpNavigationStrategy { get; set; } ``` ```csharp var xYFocusNavigationStrategy = hyperlink.xYFocusUpNavigationStrategy; hyperlink.xYFocusUpNavigationStrategy = xYFocusNavigationStrategy; ``` -------------------------------- ### BeginStoryboard Constructor Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.media.animation.beginstoryboard.-ctor Initializes a new instance of the BeginStoryboard class. ```APIDOC ## BeginStoryboard Constructor ### Description Initializes a new instance of the BeginStoryboard class. ### Method Signature ``` public BeginStoryboard(); ``` ### Applies To - Windows App SDK: 0.8, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 2.0 Experimental, 2.0 ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.media.animation.connectedanimationservice.defaulteasingfunction Example of getting and setting the default EasingFunction in C#. ```csharp var compositionEasingFunction = connectedAnimationService.defaultEasingFunction; connectedAnimationService.defaultEasingFunction = compositionEasingFunction; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.input.keyboardaccelerator.modifiers Example of getting and setting the Modifiers property in C#. ```csharp var virtualKeyModifiers = keyboardAccelerator.modifiers; keyboardAccelerator.modifiers = virtualKeyModifiers; ``` -------------------------------- ### Initialize(DeploymentInitializeOptions) Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/Microsoft.Windows.ApplicationModel.WindowsAppRuntime.DeploymentManager.Initialize Initializes the Windows App SDK runtime by checking its status and registering any missing packages according to the provided options. This method should be called once at app startup. ```APIDOC ## Initialize(DeploymentInitializeOptions) ### Description Checks the status of the Windows App SDK runtime referenced by the current package, and attempts to register any missing Windows App SDK packages that can be registered, while applying the options supplied. ### Method Static method ### Parameters #### Parameters - **deploymentInitializeOptions** (DeploymentInitializeOptions) - Required - A DeploymentInitializeOptions object that specifies options for the registration operation. ### Returns - **DeploymentResult** - An object that provides deployment status and error information for the Windows App SDK runtime referenced by the current package. ### Remarks See Remarks for Initialize(). ### See also * Deployment guide for packaged apps ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.uniformgridlayout.minrowspacing Example of how to get and set the MinRowSpacing property in C#. ```csharp var double = uniformGridLayout.minRowSpacing; uniformGridLayout.minRowSpacing = double; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.tabviewtabtearoutwindowrequestedeventargs.newwindowid?view=windows-app-sdk-2.0 Example of how to get and set the NewWindowId property in C#. ```csharp var windowId = tabViewTabTearOutWindowRequestedEventArgs.newWindowId; tabViewTabTearOutWindowRequestedEventArgs.newWindowId = windowId; ``` -------------------------------- ### ListenForHighContrastChange Example (C++/WinRT) Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.system.themesettings This C++/WinRT code sample demonstrates how to create a ThemeSettings object for a window and subscribe to its Changed event to detect changes in the system's High Contrast setting. ```APIDOC ## Example: Listening for High Contrast Changes (C++/WinRT) ```cpp void MyApp::ListenForHighContrastChange(XamlRoot& xamlRoot) { const auto myWindowId = xamlRoot.ContentIslandEnvironment().AppWindowId(); m_themeSettings = ThemeSettings::CreateForWindowId(myWindowId); m_themeSettings.Changed([xamlRoot](const ThemeSettings& ts, const auto&) { if (ts.HighContrast()) { ::OutputDebugString(L"High contrast is ON, scheme is: "); ::OutputDebugString(ts.HighContrastScheme().c_str()); } else { ::OutputDebugString(L"High contrast is OFF.\n"); } }); } ``` ``` -------------------------------- ### C# Icon Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.selectorbaritem.icon Example of getting and setting the Icon property in C#. ```csharp var iconElement = selectorBarItem.icon; selectorBarItem.icon = iconElement; ``` -------------------------------- ### Get and Set FlyoutShowOptions.Placement (C#) Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.primitives.flyoutshowoptions.placement?view=windows-app-sdk-2.0 Example of getting and setting the Placement property of FlyoutShowOptions in C#. ```csharp var flyoutPlacementMode = flyoutShowOptions.placement; flyoutShowOptions.placement = flyoutPlacementMode; ``` -------------------------------- ### ProcessStarter.StartProcess Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.content.processstarter.startprocess Starts a process with the specified executable path and connection information. The method outputs the ID of the newly created process. ```APIDOC ## ProcessStarter.StartProcess(String, String, UInt32) ### Description Starts a process with the specified executable path and connection information. The method outputs the ID of the newly created process. ### Method static void ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **executablePath** (String) - The path to the executable file to start. * **connectionInfo** (String) - Information used to establish a connection with the started process. * **processId** (UInt32) - [Out] When this method returns, contains the ID of the process that was started. ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.splitmenuflyoutitem.submenupresenterstyle Example of how to get and set the SubMenuPresenterStyle property in C#. ```csharp var style = splitMenuFlyoutItem.subMenuPresenterStyle; splitMenuFlyoutItem.subMenuPresenterStyle = style; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.windows.management.deployment.packagesetitem.packageuri?view=windows-app-sdk-2.0 Example of getting and setting the PackageUri property in C#. This property is optional and represents the package's URI. ```csharp var uri = packageSetItem.packageUri; packageSetItem.packageUri = uri; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.scrollviewer.leftheader?view=windows-app-sdk-2.0 Example of getting and setting the LeftHeader property in C#. ```csharp var uIElement = scrollViewer.leftHeader; scrollViewer.leftHeader = uIElement; ``` -------------------------------- ### TeachingTipAutomationPeer Constructor (C++/WinRT) Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.automation.peers.teachingtipautomationpeer.-ctor?view=windows-app-sdk-2.0 Initializes a new instance of the TeachingTipAutomationPeer class using C++/WinRT. ```cpp TeachingTipAutomationPeer(TeachingTip const& owner); ``` -------------------------------- ### TeachingTipAutomationPeer Constructor (C++/WinRT) Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.automation.peers.teachingtipautomationpeer.-ctor Initializes a new instance of the TeachingTipAutomationPeer class using C++/WinRT. ```cpp TeachingTipAutomationPeer(TeachingTip const& owner); ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.ratingitemimageinfo.disabledimage Example of getting and setting the DisabledImage property in C#. ```csharp var imageSource = ratingItemImageInfo.disabledImage; ratingItemImageInfo.disabledImage = imageSource; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.composition.interactions.interactionsourceconfiguration.positionysourcemode?view=windows-app-sdk-2.0 A basic C# example demonstrating how to get and set the PositionYSourceMode property. ```csharp var interactionSourceRedirectionMode = interactionSourceConfiguration.positionYSourceMode; interactionSourceConfiguration.positionYSourceMode = interactionSourceRedirectionMode; ``` -------------------------------- ### Create SceneVisual (C++/CLI) Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.composition.scenes.scenevisual.create Use this C++/CLI signature to create a SceneVisual instance. It requires an initialized Compositor object. ```cpp public: static SceneVisual ^ Create(Compositor ^ compositor); ``` -------------------------------- ### Initialize AnimatedBackVisualSource (C++/WinRT) Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.animatedvisuals.animatedbackvisualsource.-ctor?view=windows-app-sdk-2.0 Initializes a new instance of the AnimatedBackVisualSource class using C++/WinRT. ```cpp public: AnimatedBackVisualSource(); ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.primitives.scrollpresenter.computedhorizontalscrollmodeproperty?view=windows-app-sdk-2.0 Example of how to get the ComputedHorizontalScrollMode dependency property in C#. ```csharp var dependencyProperty = ScrollPresenter.computedHorizontalScrollModeProperty; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.primitives.gridviewitempresenter.checkhintbrush?view=windows-app-sdk-2.0 Example of getting and setting the CheckHintBrush property in C#. ```csharp var brush = gridViewItemPresenter.checkHintBrush; gridViewItemPresenter.checkHintBrush = brush; ``` -------------------------------- ### TeachingTipAutomationPeer Constructor (VB) Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.automation.peers.teachingtipautomationpeer.-ctor?view=windows-app-sdk-2.0 Initializes a new instance of the TeachingTipAutomationPeer class using Visual Basic. ```vb Public Sub New (owner As TeachingTip) ``` -------------------------------- ### C++/WinRT Get and Set Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.calendarview.selectedpressedforeground A practical example of retrieving and assigning a Brush to the SelectedPressedForeground property in C++/WinRT. ```cppwinrt Brush SelectedPressedForeground(); void SelectedPressedForeground(Brush value); ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.primitives.cornerradiustothicknessconverter.multiplier?view=windows-app-sdk-2.0 Example of getting and setting the Multiplier property in C#. ```csharp var double = cornerRadiusToThicknessConverter.multiplier; cornerRadiusToThicknessConverter.multiplier = double; ``` -------------------------------- ### C# Example Usage Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.primitives.flyoutshowoptions.exclusionrect Example of how to get and set the ExclusionRect property in C#. ```csharp var iReference = flyoutShowOptions.exclusionRect; flyoutShowOptions.exclusionRect = iReference; ``` -------------------------------- ### TeachingTipAutomationPeer Constructor (JavaScript) Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.automation.peers.teachingtipautomationpeer.-ctor?view=windows-app-sdk-2.0 Initializes a new instance of the TeachingTipAutomationPeer class using JavaScript. ```javascript function TeachingTipAutomationPeer(owner) ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.composition.compositionprojectedshadowcaster.ancestorclip?view=windows-app-sdk-0.8 A simple C# example demonstrating how to get and set the AncestorClip property. ```csharp var visual = compositionProjectedShadowCaster.ancestorClip; compositionProjectedShadowCaster.ancestorClip = visual; ``` -------------------------------- ### Project File Configuration Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.windows.applicationmodel.windowsappruntime.runtimecompatibilityoptions.patchlevel1 Example of setting the WindowsAppSDKRuntimePatchLevel1 in a project file. ```xml 1.7.3 ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.navigationviewpaneclosingeventargs.cancel Example of how to get and set the Cancel property in C#. ```csharp var boolean = navigationViewPaneClosingEventArgs.cancel; navigationViewPaneClosingEventArgs.cancel = boolean; ``` -------------------------------- ### C# Constructor Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.media.animation.entrancenavigationtransitioninfo.-ctor?view=windows-app-sdk-2.0 Initializes a new instance of the EntranceNavigationTransitionInfo class using C#. ```csharp public EntranceNavigationTransitionInfo(); ``` -------------------------------- ### Access KeyStatus Property (C# Example) Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.input.keyroutedeventargs.keystatus This example shows how to get the value of the KeyStatus property in C#. ```C# var corePhysicalKeyStatus = keyRoutedEventArgs.keyStatus; ``` -------------------------------- ### TeachingTipAutomationPeer Constructor Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.automation.peers.teachingtipautomationpeer.-ctor?view=windows-app-sdk-2.0 Initializes a new instance of the TeachingTipAutomationPeer class. This constructor takes the TeachingTip control instance to create the peer for. ```APIDOC ## TeachingTipAutomationPeer(TeachingTip owner) ### Description Initializes a new instance of the TeachingTipAutomationPeer class. ### Parameters #### owner - **TeachingTip** - Required - The TeachingTip control instance to create the peer for. ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.isemanticzoominformation.isactiveview Example of how to get and set the IsActiveView property in C#. ```csharp var boolean = iSemanticZoomInformation.isActiveView; iSemanticZoomInformation.isActiveView = boolean; ``` -------------------------------- ### C# Get and Set Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.composition.compositiongeometricclip.viewbox?view=windows-app-sdk-2.0 This C# snippet demonstrates how to get and set the CompositionViewBox property. ```csharp var compositionViewBox = compositionGeometricClip.viewBox; compositionGeometricClip.viewBox = compositionViewBox; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.media.animation.navigationthemetransition.defaultnavigationtransitioninfo?view=windows-app-sdk-2.0 This C# example demonstrates how to get and set the DefaultNavigationTransitionInfo property on a NavigationThemeTransition object. ```csharp var navigationTransitionInfo = navigationThemeTransition.defaultNavigationTransitionInfo; navigationThemeTransition.defaultNavigationTransitionInfo = navigationTransitionInfo; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.icommandbarelement.dynamicoverfloworder Example of getting and setting the DynamicOverflowOrder property in C#. ```csharp var int32 = iCommandBarElement.dynamicOverflowOrder; iCommandBarElement.dynamicOverflowOrder = int32; ``` -------------------------------- ### AppInstance.Restart(String) Method Signature (C++/CLI) Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.windows.applifecycle.appinstance.restart?view=windows-app-sdk-2.0 Signature for the Restart method using C++/CLI. ```cpp public: static AppRestartFailureReason Restart(Platform::String ^ arguments); ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.colorchangedeventargs.oldcolor Example of how to get the old color value in C#. ```csharp var color = colorChangedEventArgs.oldColor; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.composition.compositionninegridbrush.rightinset?view=windows-app-sdk-2.0 Demonstrates how to get and set the RightInset property in C#. ```csharp var single = compositionNineGridBrush.rightInset; compositionNineGridBrush.rightInset = single; ``` -------------------------------- ### C# ItemContainer Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.choosingitemcontainereventargs.itemcontainer?view=windows-app-sdk-2.0 Example of how to get and set the ItemContainer property. ```csharp var selectorItem = choosingItemContainerEventArgs.itemContainer; choosingItemContainerEventArgs.itemContainer = selectorItem; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.automation.spreadsheetitempatternidentifiers.formulaproperty?view=windows-app-sdk-2.0 Example of how to get the Formula automation property in C#. ```csharp var automationProperty = SpreadsheetItemPatternIdentifiers.formulaProperty; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.application.focusvisualkind Example of getting and setting the FocusVisualKind property in C#. ```csharp var focusVisualKind = application.focusVisualKind; application.focusVisualKind = focusVisualKind; ``` -------------------------------- ### Initialize() Method Signature (C++/CLI) Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/Microsoft.Windows.ApplicationModel.WindowsAppRuntime.DeploymentManager.Initialize This snippet shows the C++/CLI signature for the Initialize method. ```cpp static DeploymentResult Initialize(); ``` -------------------------------- ### C++ (WinRT) - Usage Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.input.manipulationinertiastartingroutedeventargs.expansionbehavior Example of getting and setting the ExpansionBehavior property. ```cpp InertiaExpansionBehavior ExpansionBehavior(); void ExpansionBehavior(InertiaExpansionBehavior value); ``` -------------------------------- ### C# Usage Example for ExpMouseWheelParameters.DeltaScale Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.input.experimental.expmousewheelparameters.deltascale Demonstrates how to get and set the DeltaScale property in C#. ```csharp var single = expMouseWheelParameters.deltaScale; expMouseWheelParameters.deltaScale = single; ``` -------------------------------- ### C# Usage Example for FontWeights.ExtraBold Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.text.fontweights.extrabold Example of how to get the FontWeights.ExtraBold value in C#. ```csharp var fontWeight = FontWeights.extraBold; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.input.experimental.exppointereventargs.keymodifiers?view=windows-app-sdk-0.8 Example of how to get the virtual key modifiers in C#. ```csharp var virtualKeyModifiers = expPointerEventArgs.keyModifiers; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.security.authentication.oauth.authrequestparams.state Demonstrates how to get and set the state property in C#. ```csharp var string = authRequestParams.state; authRequestParams.state = string; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.input.enteringmovesizeeventargs.movesizewindowid Example of how to get and set the MoveSizeWindowId property in C#. ```csharp var windowId = enteringMoveSizeEventArgs.moveSizeWindowId; enteringMoveSizeEventArgs.moveSizeWindowId = windowId; ``` -------------------------------- ### Initialize LinearDoubleKeyFrame (C++/CX) Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.media.animation.lineardoublekeyframe.-ctor?view=windows-app-sdk-2.0 Initializes a new instance of the LinearDoubleKeyFrame class using C++/CX. ```cppcx LinearDoubleKeyFrame(); ``` -------------------------------- ### InfoBarTemplateSettings Constructor (C++ Alternative) Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.infobartemplatesettings.-ctor Initializes a new instance of the InfoBarTemplateSettings class. ```cpp InfoBarTemplateSettings(); ``` -------------------------------- ### SetToolTip Example (C#) Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.windows.appnotifications.builder.appnotificationbutton.settooltip Demonstrates setting the tool-tip for an app notification button using C#. ```csharp var button = new AppNotificationButton("Reply") .AddArgument("action", "reply"); if (AppNotificationButton.IsToolTipSupported()) { button.SetToolTip("Click to reply."); } var notification = new AppNotificationBuilder() .AddText("Notification text.") .AddButton(button) .BuildNotification(); AppNotificationManager.Default.Show(notification); ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.composition.experimental.expcompositioncontent.iscontentvisible?view=windows-app-sdk-0.8 Example of how to get and set the IsContentVisible property in C#. ```csharp var boolean = expCompositionContent.isContentVisible; expCompositionContent.isContentVisible = boolean; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.pathiconsource.data Demonstrates how to get and set the Data property in C#. ```csharp var geometry = pathIconSource.data; pathIconSource.data = geometry; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.composition.compositionradialgradientbrush.gradientoriginoffset Example of how to get and set the GradientOriginOffset property in C#. ```csharp var vector2 = compositionRadialGradientBrush.gradientOriginOffset; compositionRadialGradientBrush.gradientOriginOffset = vector2; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.windows.ai.machinelearning.executionprovider.packageid?view=windows-app-sdk-2.0 This C# code shows a practical example of retrieving the package ID. ```csharp var packageId = executionProvider.packageId; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.composition.compositionvisualsurface.sourcevisual This C# code demonstrates how to get and set the SourceVisual property. ```csharp var visual = compositionVisualSurface.sourceVisual; compositionVisualSurface.sourceVisual = visual; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.composition.compositionprojectedshadowreceiver.mask?view=windows-app-sdk-0.8 Example of how to get and set the Mask property in C#. ```csharp var compositionBrush = compositionProjectedShadowReceiver.mask; compositionProjectedShadowReceiver.mask = compositionBrush; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.composition.compositionprojectedshadowreceiver.draworder Example of how to get and set the DrawOrder property in C#. ```csharp var compositionProjectedShadowDrawOrder = compositionProjectedShadowReceiver.drawOrder; compositionProjectedShadowReceiver.drawOrder = compositionProjectedShadowDrawOrder; ``` -------------------------------- ### Create SceneVisual (C#) Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.composition.scenes.scenevisual.create Use this C# signature to create a SceneVisual instance. It requires an initialized Compositor object. ```csharp public static SceneVisual Create(Compositor compositor); ``` -------------------------------- ### Create ResourceContext (C++/CLI) Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.windows.applicationmodel.resources.iresourcemanager.createresourcecontext Creates a ResourceContext with default settings using C++/CLI. ```cpp ResourceContext CreateResourceContext(); ``` -------------------------------- ### Show() Method (C++/WinRT) Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.windowing.appwindow.show Shows the window and activates it. This is the C++/WinRT overload for the Show() method. ```cpp /// [Windows.Foundation.Metadata.Overload("Show")] void Show(); ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.composition.compositionprojectedshadowcaster.castingvisual?view=windows-app-sdk-2.0 Example of how to get and set the CastingVisual property in C#. ```csharp var visual = compositionProjectedShadowCaster.castingVisual; compositionProjectedShadowCaster.castingVisual = visual; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.composition.compositionpathgeometry.path Example of how to get and set the CompositionPathGeometry.Path property in C#. ```csharp var compositionPath = compositionPathGeometry.path; compositionPathGeometry.path = compositionPath; ``` -------------------------------- ### AppInstance.Restart(String) Method Signature (C++/WinRT) Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.windows.applifecycle.appinstance.restart?view=windows-app-sdk-2.0 Signature for the Restart method using C++/WinRT. ```cpp static AppRestartFailureReason Restart(winrt::hstring const& arguments); ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.composition.compositiongradientbrush.centerpoint Example of how to get and set the CenterPoint property in C#. ```csharp var vector2 = compositionGradientBrush.centerPoint; compositionGradientBrush.centerPoint = vector2; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.hosting.experimental.expsystemvisualbridge.backgroundcolor?view=windows-app-sdk-0.8 Demonstrates how to get and set the BackgroundColor property in C#. ```csharp var color = expSystemVisualBridge.backgroundColor; expSystemVisualBridge.backgroundColor = color; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.composition.compositionclip.anchorpoint?view=windows-app-sdk-2.0 Example of how to get and set the AnchorPoint property in C#. ```csharp var vector2 = compositionClip.anchorPoint; compositionClip.anchorPoint = vector2; ``` -------------------------------- ### C# Get/Set Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.pivot.headerfocusvisualplacement?view=windows-app-sdk-2.0 Demonstrates getting and setting the HeaderFocusVisualPlacement property in C#. ```csharp var pivotHeaderFocusVisualPlacement = pivot.headerFocusVisualPlacement; pivot.headerFocusVisualPlacement = pivotHeaderFocusVisualPlacement; ``` -------------------------------- ### Initialize AnimatedBackVisualSource (JavaScript) Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.animatedvisuals.animatedbackvisualsource.-ctor?view=windows-app-sdk-2.0 Initializes a new instance of the AnimatedBackVisualSource class using JavaScript. ```javascript function AnimatedBackVisualSource() ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.composition.animationpropertyinfo.accessmode?view=windows-app-sdk-2.0 Example of how to get and set the AccessMode property in C#. ```csharp var animationPropertyAccessMode = animationPropertyInfo.accessMode; animationPropertyInfo.accessMode = animationPropertyAccessMode; ``` -------------------------------- ### Python Example: Finding and iterating through execution providers Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.windows.ai.machinelearning.executionprovidercatalog.findallproviders This Python code retrieves the default execution provider catalog and iterates through all found providers, printing their names and device types. ```python catalog = winml.ExecutionProviderCatalog.get_default() providers = catalog.find_all_providers() for provider in providers: print(f"Found provider: {provider.name}, Type: {provider.device_type}") ``` -------------------------------- ### AnimatedBackVisualSource Constructor Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.animatedvisuals.animatedbackvisualsource.-ctor?view=windows-app-sdk-2.0 Initializes a new instance of the AnimatedBackVisualSource class. This is the default constructor. ```APIDOC ## AnimatedBackVisualSource Constructor ### Description Initializes a new instance of the AnimatedBackVisualSource class. ### Method Constructor ### Endpoint N/A (Class Constructor) ### Parameters None ### Request Example N/A (Constructor) ### Response N/A (Constructor) ``` -------------------------------- ### Get PanOrientation value (C#) Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.primitives.iscrollcontrollerpanninginfo.panorientation Example of how to get the PanOrientation value in C#. ```csharp var orientation = iScrollControllerPanningInfo.panOrientation; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.automation.rangevaluepatternidentifiers.minimumproperty?view=windows-app-sdk-2.0 Demonstrates how to access the MinimumProperty in C#. ```csharp var automationProperty = RangeValuePatternIdentifiers.minimumProperty; ``` -------------------------------- ### C++ Get and Set Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.composition.scenes.scenesurfacematerialinput.wrappingumode?view=windows-app-sdk-2.0 Example of getting and setting the WrappingUMode property in C++. ```cpp SceneWrappingMode WrappingUMode(); void WrappingUMode(SceneWrappingMode value); ``` -------------------------------- ### Show() Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.windowing.appwindow.show Shows the window and activates it. This is a direct call to display the window. ```APIDOC ## Show() ### Description Shows the window and activates it. ### Method void Show() ### Parameters None ### See also * AppWindow * IsVisible * Hide() ``` -------------------------------- ### Initialize SwapChainBackgroundPanel (C++) Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.swapchainbackgroundpanel.-ctor?view=windows-app-sdk-2.0 Initializes a new instance of the SwapChainBackgroundPanel class using C++. ```cpp public: SwapChainBackgroundPanel(); ``` -------------------------------- ### Create SceneVisual (VB.NET) Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.composition.scenes.scenevisual.create Use this VB.NET signature to create a SceneVisual instance. It requires an initialized Compositor object. ```vbnet Public Shared Function Create (compositor As Compositor) As SceneVisual ``` -------------------------------- ### C# Property Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.windows.appnotifications.appnotificationprogressdata.sequencenumber?view=windows-app-sdk-2.0 Example of how to get and set the SequenceNumber property in C#. ```csharp var uInt32 = appNotificationProgressData.sequenceNumber; appNotificationProgressData.sequenceNumber = uInt32; ``` -------------------------------- ### C# Property Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.windows.applicationmodel.windowsappruntime.runtimecompatibilityoptions.patchlevel1 Example of getting and setting the PatchLevel1 property in C#. ```csharp var windowsAppRuntimeVersion = runtimeCompatibilityOptions.patchLevel1; runtimeCompatibilityOptions.patchLevel1 = windowsAppRuntimeVersion; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.windows.widgets.providers.widgetmessagereceivedargs.widgetcontext This C# code demonstrates how to access the widget context. ```csharp var widgetContext = widgetMessageReceivedArgs.widgetContext; ``` -------------------------------- ### SoftwareBitmapSource() Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.media.imaging.softwarebitmapsource Initializes a new instance of the SoftwareBitmapSource class. ```APIDOC ## SoftwareBitmapSource() ### Description Initializes a new instance of the SoftwareBitmapSource class. ### Method Constructor ### Endpoint N/A ### Parameters None ### Request Example None ### Response None ``` -------------------------------- ### C# BackgroundTaskBuilder.TaskGroup Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.windows.applicationmodel.background.backgroundtaskbuilder.taskgroup?view=windows-app-sdk-2.0 Example of how to get and set the TaskGroup property in C#. ```csharp var backgroundTaskRegistrationGroup = backgroundTaskBuilder.taskGroup; backgroundTaskBuilder.taskGroup = backgroundTaskRegistrationGroup; ``` -------------------------------- ### Create FullScreenPresenter Instance (C++/CLI) Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.windowing.fullscreenpresenter.create?view=windows-app-sdk-2.0 Creates a new instance of FullScreenPresenter using C++/CLI. ```cpp public: static FullScreenPresenter ^ Create(); ``` -------------------------------- ### C# Property Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.windows.ai.text.conversationsummaryoptions.includeparticipantattribution?view=windows-app-sdk-2.0 Example of how to get and set the IncludeParticipantAttribution property in C#. ```csharp var boolean = conversationSummaryOptions.includeParticipantAttribution; conversationSummaryOptions.includeParticipantAttribution = boolean; ``` -------------------------------- ### Create FullScreenPresenter Instance (C++/CLI) Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.windowing.fullscreenpresenter.create Creates a new instance of FullScreenPresenter using C++/CLI. ```cpp static FullScreenPresenter Create(); ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.windows.ai.contentsafety.imagecontentfilterseverity.violentcontentlevel A C# example demonstrating how to get and set the ViolentContentLevel property. ```csharp var severityLevel = imageContentFilterSeverity.violentContentLevel; imageContentFilterSeverity.violentContentLevel = severityLevel; ``` -------------------------------- ### C# Property Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.windows.ai.contentsafety.contentfilteroptions.responsemaxallowedseveritylevel?view=windows-app-sdk-2.0 Example of how to get and set the ResponseMaxAllowedSeverityLevel property in C#. ```csharp var textContentFilterSeverity = contentFilterOptions.responseMaxAllowedSeverityLevel; contentFilterOptions.responseMaxAllowedSeverityLevel = textContentFilterSeverity; ``` -------------------------------- ### Initialize AutoSuggestBoxAutomationPeer (C++/CX) Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.automation.peers.autosuggestboxautomationpeer.-ctor Initializes a new instance of the AutoSuggestBoxAutomationPeer class using C++/CX. ```cpp public: AutoSuggestBoxAutomationPeer(AutoSuggestBox ^ owner); ``` -------------------------------- ### C# TargetName Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.media.animation.dragitemthemeanimation.targetname?view=windows-app-sdk-2.0 Example of getting and setting the TargetName property in C#. ```csharp var string = dragItemThemeAnimation.targetName; dragItemThemeAnimation.targetName = string; ``` -------------------------------- ### C# Usage Example for Style Property Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.windows.ai.imaging.imagefromimagegenerationoptions.style Demonstrates how to get and set the Style property in C#. ```csharp var imageFromImageGenerationStyle = imageFromImageGenerationOptions.style; imageFromImageGenerationOptions.style = imageFromImageGenerationStyle; ``` -------------------------------- ### C# TargetName Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.media.animation.droptargetitemthemeanimation.targetname?view=windows-app-sdk-2.0 Example of getting and setting the TargetName property in C#. ```csharp var string = dropTargetItemThemeAnimation.targetName; dropTargetItemThemeAnimation.targetName = string; ``` -------------------------------- ### Access Recommended Navigation Transition Info (C#) Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.navigationviewselectionchangedeventargs.recommendednavigationtransitioninfo?view=windows-app-sdk-2.0 Example of accessing the RecommendedNavigationTransitionInfo property in C#. ```csharp var navigationTransitionInfo = navigationViewSelectionChangedEventArgs.recommendedNavigationTransitionInfo; ``` -------------------------------- ### C# Usage Example for CurrentChangingEventArgs.Cancel Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.data.currentchangingeventargs.cancel?view=windows-app-sdk-2.0 Example of how to get and set the Cancel property in C#. ```csharp var boolean = currentChangingEventArgs.cancel; currentChangingEventArgs.cancel = boolean; ``` -------------------------------- ### ColorSpectrumAutomationPeer Constructor Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.automation.peers.colorspectrumautomationpeer.-ctor?view=windows-app-sdk-2.0 Initializes a new instance of the ColorSpectrumAutomationPeer class. ```APIDOC ## ColorSpectrumAutomationPeer(ColorSpectrum) ### Description Initializes a new instance of the ColorSpectrumAutomationPeer class. ### Parameters #### Path Parameters * **owner** (ColorSpectrum) - Required - The ColorSpectrum control instance to create the peer for. ``` -------------------------------- ### C# Usage Example for RatingItemFontInfo.DisabledGlyph Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.ratingitemfontinfo.disabledglyph?view=windows-app-sdk-2.0 Example of how to get and set the DisabledGlyph property in C#. ```csharp var string = ratingItemFontInfo.disabledGlyph; ratingItemFontInfo.disabledGlyph = string; ``` -------------------------------- ### Initialize() Method Signature (C++/WinRT) Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/Microsoft.Windows.ApplicationModel.WindowsAppRuntime.DeploymentManager.Initialize This snippet shows the C++/WinRT signature for the Initialize method. ```cpp public: static DeploymentResult ^ Initialize(); ``` -------------------------------- ### JavaScript Usage Example for ItemContainer.IsSelected Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.itemcontainer.isselected?view=windows-app-sdk-2.0 Example of how to get and set the IsSelected property in JavaScript. ```javascript var boolean = itemContainer.isSelected; itemContainer.isSelected = boolean; ``` -------------------------------- ### C# - Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.windows.applicationmodel.resources.knownresourcequalifiername.contrast Demonstrates how to use the Contrast property in C# to get the qualifier name. ```csharp var string = KnownResourceQualifierName.contrast; ``` -------------------------------- ### Initialize RatingItemInfo (C++) Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.ratingiteminfo.-ctor Initializes a new instance of the RatingItemInfo class using C++. ```cpp public: RatingItemInfo(); ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.choosinggroupheadercontainereventargs.groupheadercontainer?view=windows-app-sdk-2.0 Example demonstrating how to get and set the GroupHeaderContainer property in C#. ```csharp var listViewBaseHeaderItem = choosingGroupHeaderContainerEventArgs.groupHeaderContainer; choosingGroupHeaderContainerEventArgs.groupHeaderContainer = listViewBaseHeaderItem; ``` -------------------------------- ### Initialize() Method Signature (C#) Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/Microsoft.Windows.ApplicationModel.WindowsAppRuntime.DeploymentManager.Initialize This is the standard C# signature for the Initialize method. ```csharp public static DeploymentResult Initialize(); ``` -------------------------------- ### C# ExpFocusNavigationResult.WasMoved Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.input.experimental.expfocusnavigationresult.wasmoved Example of how to get and set the WasMoved property in C#. ```csharp var boolean = expFocusNavigationResult.wasMoved; expFocusNavigationResult.wasMoved = boolean; ``` -------------------------------- ### C# Usage Example Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.composition.redirectvisual.source Example of how to get and set the Source property of a RedirectVisual in C#. ```csharp var visual = redirectVisual.source; redirectVisual.source = visual; ``` -------------------------------- ### Initialize TargetPropertyPath (C++/CLI) Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.targetpropertypath.-ctor?view=windows-app-sdk-2.0 Initializes a new instance of the TargetPropertyPath class using C++/CLI. ```cppcli TargetPropertyPath(); ``` -------------------------------- ### C# Usage Example for CompositionLineGeometry.End Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.composition.compositionlinegeometry.end?view=windows-app-sdk-2.0 Example of how to get and set the End property in C#. ```csharp var vector2 = compositionLineGeometry.end; compositionLineGeometry.end = vector2; ``` -------------------------------- ### C# Example: Repairing the Windows App SDK Runtime Source: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.windows.applicationmodel.windowsappruntime.deploymentmanager.repair This C# code demonstrates how to check the deployment status and initiate a repair of the Windows App SDK runtime if necessary. It also shows how to handle the repair task on a separate thread and check the result for errors. ```csharp if (DeploymentManager.GetStatus().Status == DeploymentStatus.PackageRepairRequired || DeploymentManager.GetStatus().Status == DeploymentStatus.Unknown) { // Repair will always attempt to repair the Windows App SDK runtime regardless of its state. // Repair can sometimes take several seconds to deploy the packages. // These should be run on a separate thread so as not to hang your app while the // packages deploy. var repairTask = Task.Run(() => DeploymentManager.Repair()); // ...do other work while the repair is running... repairTask.Wait(); // Check the result. if (repairTask.Result.Status != DeploymentStatus.Ok) { // The Repair has failed. // Do error reporting or gather information for submitting a bug. // Gracefully exit the program or carry on without using the Windows App SDK runtime. } } ```