win-universal-app

How to extract the argument from a Cortana command with a phrase topic, activated via text?

杀马特。学长 韩版系。学妹 提交于 2019-12-07 06:01:11
问题 High Level: I want to use my custom Cortana command "Notepad" in TEXT mode. For instance, by pressing WIN+S and typing "appname Notepad Example sentence!". (This will open Notepad and input "Example sentence!".) The Notepad command already works in VOICE mode: when I press WIN+C and say "appname Notepad Example sentence!", my notepad script is run with the payload "Example sentence!". The Problem: When I press WIN+S and input "appname Notepad Example sentence!", the text property of

Unable to access TCP Server inside a Windows Universal Application

喜欢而已 提交于 2019-12-07 05:30:19
问题 I have a Windows Universal Application that is supposed to act as a TCP server. m_Listener = new StreamSocketListener(); m_Listener.ConnectionReceived += (s, e) => ProcessRequestAsync(e.Socket); var bind = m_Listener.BindServiceNameAsync("8080").Wait(); Before starting the application, the port is not bind to anything: C:\Users\jsant>netstat -a | grep 8080 ^C (Cancelled after some seconds because no reasults were found) Then, when I start the application: C:\Users\jsant>netstat -a | grep 8080

Vibrate Phone in UWP

…衆ロ難τιáo~ 提交于 2019-12-07 05:23:37
问题 I'm trying to use the vibration on the device (Windows Phone), however I can't seem to find the appropriate API to achieve this for Windows 10. In Windows 8.x, I can use this, however this is no longer available in Universal Windows Platform. Can anyone point me in the right direction? 回答1: As of Jan 2016, you: Right-click References in your Solution, Add Reference->Extensions->Windows Mobile Extensions for the UWP Then you can using Windows.Phone.Devices.Notification; and actually use it by:

CameraPreviewImageSource empty preview frame

£可爱£侵袭症+ 提交于 2019-12-07 04:56:29
I made cut and paste of the code below about how to use CameraPreviewImageSource and access to preview buffer frames, but do not work and it seems the frame buffer size is 0x0 reading the value of IImageSize parameter of OnPreviewFrameAvailable event. How to get preview buffer of MediaCapture - Universal app protected override void OnNavigatedTo(NavigationEventArgs e) { InitializeAsync(); } public async void InitializeAsync() { _cameraPreviewImageSource = new CameraPreviewImageSource(); await _cameraPreviewImageSource.InitializeAsync(string.Empty); var properties = await

How can I replace Marshal.SizeOf(Object) with Marshal.SizeOf<T>()?

泄露秘密 提交于 2019-12-07 04:40:50
问题 I am building a Universal class library from existing code, and I get some compiler warnings that I for the life of it cannot figure out what to do with. I have code like this: void SomeMethod(Object data) { var size = Marshal.SizeOf(data); ... } The code builds, but in the Universal project (and, I guess, .NET 4.5.1 and higher projects) I get the following compiler warning: warning CS0618: 'System.Runtime.InteropServices.Marshal.SizeOf(object)' is obsolete: 'SizeOf(Object) may be unavailable

Pass Parameter or Arguments to a Background task in Uwp

扶醉桌前 提交于 2019-12-07 04:14:02
问题 I am creating a uwp app in which I want to take some data from user say from a textbox and then pass it to a background task. But when I am trying to add project reference to the background task I am getting a circular reference error. So is there any way to pass arguments maybe a overload of run function or anything else. Thanks in advance. 回答1: Romasz has explained it perfectly but in your case you can get the user data from the textbox by doing these steps: 1.Declare this in MainPage.xaml

Visual Studio 2015, Nuget and “same key has already been added.”

泄露秘密 提交于 2019-12-07 04:03:56
问题 I have Visual Studio 2015 RC. When I open a console app or a Windows Phone 8 Silverlight project, everything works fine, I can use Nuget without problems. When I open a Universal App project (Windows 8.1 + Windows Phone 8.1), Nuget breaks. When I open the Nuget console, I see When I try to install a Nuget package using the Nuget GUI, I get the same error. One more strange thing. When I open VS2015 RC without any projects and open the Nuget console, I do not get the error. Then when I open my

Change default User-Agent in WebView UWP

血红的双手。 提交于 2019-12-07 01:54:25
问题 I need set custom UA and I use httpRequestMessage.Headers.Add("User-Agent", "blahblah"); theWebView.NavigateWithHttpRequestMessage(httpRequestMessage); But if I click any link on page this UA erased and set default UA. I found same question WebView - Define User-Agent on every request but maybe it fixed in 1607? 回答1: WebView is not a general-purpose browser, it does have some "limitations" that not supported now. There is no API can set the default User-Agent that used in every request. As a

Can't deploy to HoloLens emulator

天大地大妈咪最大 提交于 2019-12-07 01:24:46
问题 Just created default project Holographic DirectX11 App (Universal Windows) in VS2015 Update 2 with HoloLens emulator installed and hit F5. HoloLens emulator starts loading, but at some point The emulator is unable to connect to the device operating system: The emulator is unable to determine the host IP address, which is used to communicate with the guest virtual machine. Some functionality might be disabled. I can start emulator from Hyper-V Manager and connect to it, but the screen is not

Change a Windows Store App's title text

旧巷老猫 提交于 2019-12-06 21:30:33
问题 How can I change the shown title of the app? (Like Photos does) In Winforms that would be form1.Text = "new title"; . How do we do that in UWP? 回答1: using Windows.UI.ViewManagement; ... ApplicationView appView = ApplicationView.GetForCurrentView(); appView.Title = "Title text goes here"; 回答2: When I use ApplicationView , it appends the Title to the assembly name. We could edit Application -> Display Name in the Package.appxmanifest file. 来源: https://stackoverflow.com/questions/33400597/change