win-universal-app

Send chat message

给你一囗甜甜゛ 提交于 2019-12-23 13:14:05
问题 I have this code: var msg = new ChatMessage(); msg.Body = "Test"; msg.Recipients.Add("number"); var cms = await ChatMessageManager.RequestStoreAsync(); await cms.SendMessageAsync(msg); and I have a problem with the await part of code above. I get exception: Access is denied. In capabilities within appxmanifest I have selected: Chat Message Access (I tried select all, but It didn't work). I cannot find any sample and requirements that must be met. Thanks for your help. 回答1: If you take a look

AccessViolationException when setting the Text in a RichEditBox

只谈情不闲聊 提交于 2019-12-23 12:19:26
问题 I've spent hours trying to understand what is happening here. I have a RichEditBox that the user can interact with by tapping on it and using the keyboard or by tapping on a couple of buttons that add some characters inside the RichEditBox. This is a method I use: private void ptrPlus_click(object sender, RoutedEventArgs e) { try { myRichEditBox.Document.Selection.Text = ">"; myRichEditBox.Document.Selection.SetRange(this.Document.Selection.StartPosition + 1, this.Document.Selection

UWP change ComboBox position when opening

邮差的信 提交于 2019-12-23 12:15:57
问题 I have a ComboBox in c# XAML and when nothing is selected and the PlaceHolderText is shown and I click on it to open, the normal behavior is to open it in the middle. I want the dropdown to open on top instead. Let's say I have a ComboBox and fill it with the number 1-100 , then I want it to display beginning from 1 . If there are seven items shown in the dropdown, then the numbers 1-7 should be visible. Normal behavior would be showing the numbers 47-53 . An old workaround would be using a

How to set fixed window size for Universal Windows Application

亡梦爱人 提交于 2019-12-23 11:53:40
问题 I just started to develop an Universal Windows Application in VS2015 Community Edition. I have used the sample called PieCharts for Windows UWP. My problem is that I whould like to fix the window size to 400x650 as I did in my old desktop applications. I have set Width and Height manually It does not work. My MainPage.xaml is something like the following code. <Page x:Class="MyFistUWP.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft

Drag and Drop in UWP in list of bank accounts

二次信任 提交于 2019-12-23 10:13:11
问题 I have a Universal Windows Application for a local bank, I'm working on a money transfer view, and they need to transfer money from account to account using the Drag and Drop feature in UWP applications. I've made the animation part, but I need help after I drop the list item to the "Account To" list. I'll attach a screenshot to make it clear. As you see in the picture, I need to drag one item from the "From Account" list and drop it on only one item on "To Account" list. How can I achieve

Windows Universal App Serial Ports won't open, SerialDevice.FromIdAsync always null

六月ゝ 毕业季﹏ 提交于 2019-12-23 08:49:44
问题 I am trying to use serial ports in a Windows Universal Application. I have been using Microsoft's Serial Sample application as a template however I have hit a rather strange issue. var dis = await DeviceInformation.FindAllAsync(SerialDevice.GetDeviceSelectorFromUsbVidPid(0x04D8, 0x000A)); var sp = await SerialDevice.FromIdAsync(dis[0].Id); This is a the snippet that is failing. It is slightly altered from the original sample as it connects to the first device with a specific vendor. Now if I

WebView - Define User-Agent on every request

不打扰是莪最后的温柔 提交于 2019-12-23 08:06:16
问题 Currently, I am setting the User-Agent of a request message as follows: var rm = new HttpRequestMessage(HttpMethod.Post, new Uri("http://example.com")); rm.Headers.Add("User-Agent", "UserAgentString"); webView.NavigateWithHttpRequestMessage(rm); Everything works as expected. But, when I am navigating to an another page, by clicking a link on the site for example, the User-Agent resets to the default of the WebView . Is there any way of setting the User-Agent permanently or changing it on

WebView - Define User-Agent on every request

自闭症网瘾萝莉.ら 提交于 2019-12-23 08:05:07
问题 Currently, I am setting the User-Agent of a request message as follows: var rm = new HttpRequestMessage(HttpMethod.Post, new Uri("http://example.com")); rm.Headers.Add("User-Agent", "UserAgentString"); webView.NavigateWithHttpRequestMessage(rm); Everything works as expected. But, when I am navigating to an another page, by clicking a link on the site for example, the User-Agent resets to the default of the WebView . Is there any way of setting the User-Agent permanently or changing it on

.net WP8.1/Win10 UWP: Namespace for MapControl not found in Visual Studio Designer

北城余情 提交于 2019-12-23 06:57:26
问题 Edit: the described issue below occurs also in a Win 10 UWP application (VS2015, Win10) when using the MapControl. I have a weird problem using the MapControl in a Windows Phone 8.1 (universal app) application. After adding the control to a page, Visual Studio says The name "MapControl" does not exist in the namespace "using:Windows.UI.Xaml.Controls.Maps". Building the app works, I can deploy it to the phone and the map is shown and everything is fine - but I cannot use the Designer for this

Add a sidebar in Windows Phone 8.1 application

╄→гoц情女王★ 提交于 2019-12-23 05:30:48
问题 I'm building Windows Phone 8.1 application and I want a sidebar like in android apps. How can I do it? I tried this example, but doesn't compile and manipulation event's do not fire. 回答1: Here is very simple example with velocity handling. Make sure to set grid's Manipulation property to All . Change grid's background from DarkSalmon to Transparent . XAML <Canvas Name="RootCanvas"> <Canvas.Resources> <Storyboard x:Name="MoveAnimation"> <DoubleAnimation Duration="0:0:0.2" To="0" Storyboard