This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async Task InstallWithAppInstaller() | |
{ | |
var pm = new PackageManager(); | |
var volume = pm.GetDefaultPackageVolume(); | |
var operationWithProgress = pm.AddPackageByAppInstallerFileAsync(new Uri("https://<the app installer location>"), | |
AddPackageByAppInstallerOptions.None, volume); | |
operationWithProgress.Progress = ReportProgress; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public IEnumerable<ArraySegment<T>> Chunk<T>(T[] source, int chunkSize) | |
{ | |
for (int i = 0; i < source.Length; i += chunkSize) | |
{ | |
var remaining = source.Length - i; | |
var segmentSize = Math.Min(chunkSize, remaining); | |
yield return new ArraySegment<T>(source, i, segmentSize); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
public partial class App : Application | |
{ | |
private readonly SingleInstanceDesktopApp _singleInstanceApp; | |
public App() | |
{ | |
InitializeComponent(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<UserControl | |
x:Class="LayoutCycleTest.TestControl" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:layoutcycletest="using:LayoutCycleTest" | |
mc:Ignorable="d" | |
> | |
<UserControl.Resources> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<UserControl | |
x:Class="LayoutCycleTest.TestControl" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:layoutcycletest="using:LayoutCycleTest" | |
mc:Ignorable="d" | |
> | |
<UserControl.Resources> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FileOpenPicker open = new(); | |
open.SuggestedStartLocation = PickerLocationId.DocumentsLibrary; | |
open.FileTypeFilter.Add("*"); | |
WinUIConversionUtil.InitFileOpenPicker(open); | |
var file = await open.PickSingleFileAsync(); | |
if (file != null) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
s/--- | |
// Control the system volume from UWP, using the IAudioEndpointVolume interface | |
// | |
// Wim Bokkers | |
// | |
// Credits: | |
// * Reddit user sunius (https://www.reddit.com/user/sunius) | |
// See this thread: https://www.reddit.com/r/WPDev/comments/4kqzkb/launch_exe_with_parameter_in_uwp/d3jepi7/ | |
// And this code: https://pastebin.com/cPhVCyWj | |
// |