uwp

ToggleButton Has No Unchecked State in UWP

孤者浪人 提交于 2020-01-11 07:51:17
问题 I am working with Visual States in a ToggleButton template within a Windows 10 UWP app. I have added an animation for the 'Checked' state so when checked, an icon within the template rotates 90 degrees over 250 milliseconds. Now I want to animate the icon rotating back to normal over the same 250 millisecond timespan when the ToggleButton is no longer checked. Problem is, there is no 'Unchecked' state to animate anymore for ToggleButton - so it seems like this is impossible. Surely I have

UWP create VPN connection

旧街凉风 提交于 2020-01-11 06:18:10
问题 Currently I'm trying to figure out, how to add a VPN profile and connect to it from my universal app. I can connect to existing VPN connections with the Windows.Networking.Vpn namespace. I can also add a profile, but can not find a way to set all the required information (PSK for example). There is no documentation about this namespace in the MS docs. I also saw that there are two different profile namespaces available: VpnNativeProfile and VpnPlugInProfile . What is the difference between

UWP: AES encryption and decryption

天涯浪子 提交于 2020-01-10 05:29:21
问题 I had a simple class to do some basic local encryption for Windows Phone 8. I wanted to use the class again in a new UWP Windows 10 app for the Windows Store. Unfortunately I cannot use the AesManaged class anymore. I tried to use Windows.Security.Cryptography.Core , but I'm completely stuck. This is the original class I used for Windows Phone 8. I must have found it somewhere on the internet back then. using System.Security.Cryptography; namespace TestGame { public class AesEnDecryption {

UWP app: FileOpenPicker PickSingleFileAsync() can't await

淺唱寂寞╮ 提交于 2020-01-10 04:58:07
问题 I'm trying to let the user browse for a file with the FileOpenPicker class, but when I use the PickSingleFileAsync function with await, I get following error: 'IAsyncOperation' does not contain a definition for 'GetAwaiter' and no extension method 'GetAwaiter' accepting a first argument of type 'IAsyncOperation' could be found (are you missing a using directive for 'System'?) This is the function that gives the error on it's last line: private async void browseFileButton_Click(object sender,

【UWP】在 UWP 中使用 Exceptionless 进行遥测

风格不统一 提交于 2020-01-07 18:12:22
前几个星期在公司的测试服务器上搭建了 Exceptionless 对公司的 Asp.net core 项目进行遥测。在之前都是远程桌面登录上去,然后去翻日志文件看有没有异常,效率极其的低。用了 Exceptionless 之后,效率高了不少,而且能收集到更多信息了。 最近准备要过年了,项目也上线了一段时间趋于稳定,算是比较闲了一点。想着要不把手上的 UWP 项目也加上 Exceptionless 进行遥测吧,毕竟微软商店的 Dashboard 那异常也几乎是看不出啥的,而且这测试服务器性能又是过剩的,不用白不用。 但我一操作起来,就发现了个大问题,Exceptionless 官方并没有提供 UWP 的库(Winform、WPF、asp.net core 的都有)。翻查了 github 上相关的 issue,官方建议是用 .net standard 版本的。然而实际操作之后,我发现还需要额外的代码来处理 UWP 中的 UnhandledException,本文就记录一下。 首先当然是在 Exceptionless 平台上创建项目获取 ApiKey 了,这个就不多说了。然后 UWP 项目引用 Exceptionless 的 nuget 包 。 在 App.xaml.cs 的构造函数中添加 SetUpExceptionless 代码: public App() { this

How to create dynamic row and columns

╄→гoц情女王★ 提交于 2020-01-07 08:13:07
问题 I need to create dynamic row and columns base on the parameter, like in my json I will have x and y which will be no. of rows and columns respectively, and there will be content with x and y which I have to put them in their respective row and column, I tried to use below code but found that uniform grid is not available in UWP App. Also thought about DataTemplateSelector, but am not sure if that is a good idea to use it. Xaml: <ItemsControl ItemsSource="{Binding MyCollection}"> <!-- This

UWP Gridview Binding to ObservableCollection and clearing values

不羁岁月 提交于 2020-01-07 06:47:16
问题 so I am creating a GridView in a UWP app which is bound to an ObservableCollection. XAML: <Page.Resources> <CollectionViewSource x:Name="ListSource" Source="{x:Bind model.ShowList}" IsSourceGrouped="false" /> </Page.Resources> ... <Page> <GridView x:Name="lvListSource" ItemsSource="{Binding Source={StaticResource ListSource}}" SelectedIndex="-1" Grid.Row="2" HorizontalContentAlignment="Center" SelectionChanged="lvEpisodeListSource_SelectionChanged"> <GridView.ItemTemplate> <DataTemplate x

Missing System.Media.Capture.Frames namespace

孤者浪人 提交于 2020-01-07 05:53:05
问题 I'm trying to develop a barcode reader app for the Microsoft HoloLens (using this tutorial) but I'm encountering a problem. In the code of this tutorial, there's being referenced to the System.Media.Capture.Frames namespace and it seems like I'm missing this namespace. Looking at the Windows universal samples from Microsoft, there's also being referenced to this namespace. However, I cannot import this namespace. I'm running on Windows 10 Version 1607 Build 14393.693 I have .NET Framework 4.6

UWP get data usage

你说的曾经没有我的故事 提交于 2020-01-07 05:44:09
问题 I love programming for UWP and I start new program with C# and UWP. I want to get network usage for each connection in the target system. I read document in MSDN and I write this code for my app: public async static Task<List<ConnectionReport>> GetNetworkUsageAsync(string ConnectionName, DateTimeOffset StartTime, DateTimeOffset EndTime, DataUsageGranularity Granularity) { var granularityTimeSpan = GranularityToTimeSpan(Granularity); try { var connectionProfile = GetConnectionProfile

UWP - nas network access denied

狂风中的少年 提交于 2020-01-07 04:29:38
问题 I want to read some text files with extensions of .txt, .rtf and .log from a nas in my uwp app. I have followed the instructions on this link, but there is still a "network access denied" error. This is my Package.appxmanifest file. EDIT I use a FolderPicker to let the user choose the folder containing the log files, then I add that folder to FutureAccessList with a token. I use the token in 1. to retrieve the folder, then read all the files in it. Here is the relevant code. public async