uwp

(UWP) How to add Content-Type header without Content-Length in GET request

試著忘記壹切 提交于 2020-05-15 21:51:25
问题 I'm dealing with a third-party API who's calls require the Content-Type header on GET method requests, but return an error response when the header collection includes "Content-Length". The only way to add the Content-Type header is to add a class that inherits/implements the IHttpContent interface (I was using HttpStringContent with string.empty as the string content). The problem, is that adding a blank HttpStringContent adds ContentLength. Even though the value of that header is '0', their

IAsyncOperation<IReadOnlyList<UserNotification>>' does not contain a definition for 'GetAwaiter' [duplicate]

不想你离开。 提交于 2020-05-15 05:19:04
问题 This question already has answers here : FromBluetoothAddressAsync IAsyncOperation does not contain a definition for 'GetAwaiter' error (2 answers) Closed last year . I am using Visual Studio 2017 Professional. I have been following this guide: https://docs.microsoft.com/en-us/windows/uwp/design/shell/tiles-and-notifications/notification-listener My problem code is as follows: using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System

UWP TreeView - Update of data behind a binding makes the Expandable icon to disappear

北慕城南 提交于 2020-04-30 15:59:31
问题 With a TreeView I have a Patient structure: private ObservableCollection<MTreeViewPaz> _Patients; public ObservableCollection<MTreeViewPaz> Patients { get { return _Patients; } private set { Set(ref _Patients, value); } } and a treeView bound to it: <winui:TreeView x:Name="treeView" Grid.Row="1" Expanding="treeView_Expanding" ItemInvoked="OnItemInvoked" ItemTemplate="{StaticResource ItemTemplate}" ItemsSource="{x:Bind Patients, Mode=OneWay}" SelectionMode="Single" /> with Item Template:

Logging via TraceSource in Xamarin (UWP)

廉价感情. 提交于 2020-04-30 11:03:19
问题 I just want to log to console and to a log file, using a standard TraceSource, in my Xamarin app that will run on UWP, Mac OS X, iOS and Android. I'm developing/debugging on UWP. TraceSource, TraceListener, and TextWriterTraceListener are indeed all available in .Net Standard library, so perhaps I'm setting it up incorrectly? Most places on the Internet insist on setting up trace listeners in an app.config file, but this is not applicable nor possible for Xamarin apps. So here is my logging

Pivot XAML Control - Changing the Style (Border)

旧街凉风 提交于 2020-04-30 10:19:27
问题 Pivot Control Black Box The goal is to change the color of the black border around my Pivot control. I created a copy of the template for the pivot control so I can modify the style. It isn't obvious how to modify the style to change the color of the this black brush. Added Border Brush - I looked at BorderBrush but it doesn't really feel like change? Where and how - to best achieve the changing of a border color? The red dotted boxes are not changing the color. 回答1: The black border in your

How to have Glyps overlapped in different size

ぐ巨炮叔叔 提交于 2020-04-30 08:46:22
问题 Thanks to the help I was able to have 2 glyps in an AppBar Button. I would like to make the second one smaller (half of the first one) and be overlapping in the bottom left corner... but I do not want to use absolute numbers to keep the UI responsive <AppBarToggleButton Label="" > <AppBarToggleButton.Content> <Grid> <FontIcon FontFamily="Segoe MDL2 Assets" Glyph="" /> <FontIcon FontFamily="Segoe MDL2 Assets" Glyph="" /> </Grid> </AppBarToggleButton.Content> </AppBarToggleButton> How can I

UWP TreeView UI Deadlock - loading time from less than 1 sec to more than 10 sec - first run against new run

有些话、适合烂在心里 提交于 2020-04-30 07:14:52
问题 I have a major performance issue on a TreeView both in terms of loading time as well as a deadlock of the UI. private async Task LoadTreeAsync() { List<VPazVisit> aList = new List<VPazVisit>(); if (_sorting == "") { _sorting = await ApplicationData.Current.LocalSettings.ReadAsync<string>("TreeViewSort"); } treeView.Visibility = Visibility.Collapsed; Patients.Clear(); switch (_sorting) { default: case "DescDate": aList = await Task.Run(() => App.gDataContext.Cache.VPazVisit .OrderByDescending

uwp xaml declaratively defining control that has focus by default

独自空忆成欢 提交于 2020-04-30 06:37:09
问题 I've been able to set focus on my view's Close button using the following code in the MainPage.xaml.cs OnNavigatedTo() event handler. this.close.Focus(FocusState.Programmatic);` // or Windows.UI.Xaml.Input.FocusManager.TryFocusAsync(this.Close, FocusState.Programmatic);` I'd prefer a way to declaratively set this in the xaml markup. Is there a way to do that? I've tried following samples provided in SO post hits on this subject showing approaches llike the following using FocussedElement,

Master-Details view in UWP Community Toolkit

▼魔方 西西 提交于 2020-04-21 05:15:46
问题 I tried to implement Master-Details view from UWP Community Toolkit 2.0. I copied the example code from the uwp community toolkit sample app. But It seems the data is not binding properly. Now the Master details View is empty. Can anyone help me where I went wrong? XAMl CODE:` <Page x:Class="FaceIdentification.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:FaceIdentification" xmlns:d="http:/

Master-Details view in UWP Community Toolkit

半城伤御伤魂 提交于 2020-04-21 05:15:16
问题 I tried to implement Master-Details view from UWP Community Toolkit 2.0. I copied the example code from the uwp community toolkit sample app. But It seems the data is not binding properly. Now the Master details View is empty. Can anyone help me where I went wrong? XAMl CODE:` <Page x:Class="FaceIdentification.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:FaceIdentification" xmlns:d="http:/