windows-runtime

HttpClient HttpResponseMessage Address / URI

谁说我不能喝 提交于 2019-12-10 13:37:47
问题 I am developing a C# WinRT application that makes POST and GET requests to a webserver. Does anyone know if there is a way to get the Response URI / Address when using a HttpClient object?. If I use the HttpWebRequest / HttpWebResponse classes, then I can get this information (via the ResponseUri property in HttpWebResponse), but I don't see how to obtain it using the HttpClient / HttpResponseMessage classes. Thanks 回答1: This is two years old, but I just came across this question with the

How to disable zoom in Windows 8 webviews

独自空忆成欢 提交于 2019-12-10 13:13:25
问题 I'm using a webview in an app to display externally hosted content, but the web view lets the user zoom with a pinch gesture and I'd like to disable this. I can't find any such property on the webview itself, and I've not had any success with a viewport meta tag such as: <meta name="viewport" content="user-scalable=no"> Is there a way to do this? 回答1: Unfortunately this is not possible. http://social.msdn.microsoft.com/Forums/en-AU/winappswithcsharp/thread/8eecf85d-ebd3-4bc0-ad17-15f342efad25

Accuracy of Task.Delay

£可爱£侵袭症+ 提交于 2019-12-10 12:57:20
问题 I'm developing Windows 10 Universal App in C#/Xaml, I'm using await Task.Delay(delayInMilliseconds) to suspend a method for given time. My scenario is somewhat realtime, so it's very sensitive to time changes, and I need to make sure that when i suspend a method for let's say 8 millisecods it is suspended for 8 millisecods. I have noticed that the actual time span for which ** Task.Delay ** suspends the method differes from what is passed as delay parameter, for 1 up to 30 ms, the length of

How to Convert Hexdecimal code to color in windows 8

被刻印的时光 ゝ 提交于 2019-12-10 12:17:32
问题 I have code Hexadecimal code "FFB800" and I needed to convert to "Color" in WinRT. Thanks in Advance. 回答1: What is the purpose of the question? Is it an option to do this in plain XAML? XAML does take Hexadecimal codes. <Grid Background="#FFB800"> Otherwise in code-behind I've used more or less the following in a Windows 8 App: var hexCode = "#FFFFB800"; var color = new Color(); color.A = byte.Parse(hexCode.Substring(1, 2), NumberStyles.AllowHexSpecifier); color.R = byte.Parse(hexCode

Why can't I use CapturePhotoToStreamAsync from a System.Threading.Timer call back in WPF?

拜拜、爱过 提交于 2019-12-10 12:06:54
问题 I have code in a WinForms application where I'm using the WinRT MediaCapture object to take a picture from the device's camera. The code is executed in a System.Threading.Timer call back. I'm trying to move this code into WPF but I'm running into problems. When I try to execute the MediaCapture.CapturePhotoToStreamAsync from the timer's callback in WPF, I receive the following exception: A first chance exception of type 'System.Exception' occurred in MyAssembly.dll Additional information: The

RestSharp: UrlEncode in signature base generation returns invalid string

牧云@^-^@ 提交于 2019-12-10 11:42:15
问题 I'm working on twitter client for win8, using RestSharp ( http://restsharp.org/ ) and I have such problem: When I'm posting new tweet with RestClient var timeLine = new RestRequest("/1/statuses/update.json", Method.POST); var txt = "Hello world"; timeLine.AddParameter("status", txt); everything works excelent, but if I add more complex status like: var txt = "Hello, World! What a nice day! #1May"; timeLine.AddParameter("status", txt); I recieve 401 error. In debugger I saw, that status

windows store app trial period implementation

假如想象 提交于 2019-12-10 11:38:53
问题 On windows store app submission there is a place where it lets you specify a trial period (24 hours or 7 days...). In order to use this feature do i have to implement a code that kills the app after the specified time (The windows store option being just a declaration of the intention) or does the windows run-time handles the killing. 回答1: When you upload an app to the store you specify how long you would like a free trial to last for (a few days, all the way up to never expire). When the

How to return a build-in winrt component using WRL?

北慕城南 提交于 2019-12-10 11:29:30
问题 When I create a winrt component using WRL, the problem is that I can only use ABI::Windows::xxx namespace, and I cannot use Windows::UI::Xaml::Media::Imaging namespace in WRL. Then, how to create a build-in winrt component as a return value? // idl import "inspectable.idl"; import "Windows.Foundation.idl"; import "Windows.UI.Xaml.Media.Imaging.idl"; namespace Decoder { interface IPhotoDecoder; runtimeclass PhotoDecoder; interface IPhotoDecoder : IInspectable { HRESULT Decode([in] int width,

Styling Windows Phone 8.1/WinRT AppBarButton

你离开我真会死。 提交于 2019-12-10 11:07:04
问题 I'm currently looking to implement a CommandBar for a WinRT Windows Phone 8.1 app. Overall it is very straightforward but I am unable to style the control. I have themed my app so that the accent colour has been changed to green. This works well for pretty much everywhere in the app (buttons, textblocks etc.) but not for the AppBarButton. The brushes I'm overriding are SystemColorControlAccentBrush and PhoneAccentBrush but changing these does not make any difference to the colour of the

Countdown timer for metro App

冷暖自知 提交于 2019-12-10 11:05:53
问题 I'm beginner in Metro Style Developing, I tried to make a small game that's need a timer, countdown from 10 to 0. But at this Visual Studio there is no Timer Component, and DispatcherTimer Not mapped to an xmlns. I Tried to use TimeSpan, that have this field "TicksPerSecond" But this example dosen't help me to make my countdown timer : http://msdn.microsoft.com/en-us/library/system.timespan.tickspersecond.aspx TimeSpan also have this method "FromSeconds", and i Can't also use this one for my