windows-runtime

Windows Metro Style app occur error with Google Data API Library

允我心安 提交于 2019-12-31 01:55:11
问题 OS: Windows 8 Consumer Preview IDE: Visual Studio 11 Beta I create a Blank Application(Windows Metro style). And add Google Doc API sample code. (It is below) It occur compile Error.( Cannot find type System.ComponentModel.ExpandableObjectConverter in module System.dll ) But When I create a Console Application(Windows), don't occur compile Error and Google Doc API working good. Any ideas? using System; using Google.GData.Client; using Google.GData.Documents; namespace

Toast notification isn't working?

谁说我不能喝 提交于 2019-12-31 01:49:01
问题 I'm following several examples to do a toast notification when I click a button in my app. I stepped through the following example: http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh868254.aspx I'm not getting any errors but when I run the application I don't get the toast notification. I have created a snippet here: http://codepaste.net/btkzeg ToastTemplateType toastTemplate = ToastTemplateType.ToastImageAndText01; XmlDocument toastXml = ToastNotificationManager.GetTemplateContent

Can't use create_async() with WRL WinRT component

依然范特西╮ 提交于 2019-12-30 12:15:28
问题 I want to write a WinRT component with async support using WRL, but I found create_async() is undefined even I included the ppltask.h and using namespace concurrency How to create a background task with WRL pattern? My function is like: HRESULT GetStreamAsync([out, retval] IAsyncOperation<IRRandomAccessStream*>** operation); I also try to use IThreadPoolStatics->RunAsync() , but seems it only can be used in case of IAsyncAction and without return value. Does anyone can help? 回答1: concurrency:

how to hide on EditText soft keyboard windows 8 Metro Application?

狂风中的少年 提交于 2019-12-30 07:39:29
问题 I'm having an EditText and a Button in my Frame using C#. After writing inside the edit field and clicking on the Button, I want to hide the virtual soft keyboard. 回答1: You cannot. There is more information on the behavior of the Input Hosting Manager and Soft Keyboard and you can register to know when it shows or becomes hidden. But, you cannot programmatically control whether it's up or down. 回答2: Add a dummy button and set focus to it and the keyboard will be hidden. 回答3: Thanks for your

Copying the content from a WebView under WinRT

喜欢而已 提交于 2019-12-30 07:30:46
问题 I've got a WebView with some HTML content which I want to convert into RTF. I've looked at the RTF conversion functions out there and they all look a little flaky to be honest. So my idea is to copy content from the WebView into a RichEditBox , and save to RTF from there. I've seen this example numerous times. WebBrowser1.Document.ExecCommand("SelectAll", false, null); WebBrowser1.Document.ExecCommand("Copy", false, null); Unfortunately, WinRT's WebView control doesn't have a Document

Copying the content from a WebView under WinRT

无人久伴 提交于 2019-12-30 07:30:06
问题 I've got a WebView with some HTML content which I want to convert into RTF. I've looked at the RTF conversion functions out there and they all look a little flaky to be honest. So my idea is to copy content from the WebView into a RichEditBox , and save to RTF from there. I've seen this example numerous times. WebBrowser1.Document.ExecCommand("SelectAll", false, null); WebBrowser1.Document.ExecCommand("Copy", false, null); Unfortunately, WinRT's WebView control doesn't have a Document

What is the proper way to show a WinRT MessageDialog due to a caught exception?

 ̄綄美尐妖づ 提交于 2019-12-30 07:02:12
问题 What is the proper way to show a message dialog due to a caught exception? I originally tried try { await DoSomething(); } catch(InvalidOperation ex) { await MessageDialog(ex.Message).ShowAsync(); } catch(CommunicationException) { await MessageDialog(StringResourceLoader.LoginError).ShowAsync(); } This did not work because you cannot await inside of a try block. Taking the await commands out makes the compiler shows the following warning: Because this call is not awaited, execution of the

Capture screen of Windows store App

拟墨画扇 提交于 2019-12-30 06:32:12
问题 Is it possible to capture the contents of running Windows store app? I need to capture the entire screen or a user defined rectangular area. The application will provide share option When the application is running and share option is selected, I want to get the screen shot periodically say 4 times in a second This screen shot image will be posted to server, which will store the same 回答1: You can't capture screen programatically. See the below threads from MSDN. Programmatically take snap

How to detect if the scroll viewer reaches bottom in winrt

喜夏-厌秋 提交于 2019-12-30 06:12:07
问题 I'm wondering what's the best approach to detect if a ScrollViewer reaches the bottom, right etc. I think I can achieve that by using both PointerWheelChanged for mouse and ManipulationDelta for touch. In these event handlers, I can record the HorizontalOffset to find out when will the scroller reach the end. But I think there could be a better way to do it. I've found this article. But the compression visual states seem not working in winrt. The CurrentStateChanging event method is not

How to wait for an IAsyncAction?

我的梦境 提交于 2019-12-30 06:02:11
问题 In Windows Store Apps, C++(C# is similar though), doing something like IAsyncAction^ Action = CurrentAppSimulator::ReloadSimulatorAsync(proxyFile); create_task( Action ).then([this]() { }.wait(); results in an unhandled exception. Usually it's Microsoft C++ exception: Concurrency::invalid_operation at memory location 0x0531eb58 And I kind of need for that action to finish to get my In App Purchase information before trying to use it. The weird thing here is that anything else besides