windows-runtime

How to wait for an IAsyncAction?

只谈情不闲聊 提交于 2019-12-30 06:02:06
问题 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

How do we set Timers in WinRT app?

天涯浪子 提交于 2019-12-30 06:01:30
问题 I am trying to set Timer in my Windows Store App. public void Start_timer() { Windows.UI.Xaml.DispatcherTimer timer = new DispatcherTimer(); timer.Tick += new Windows.UI.Xaml.EventHandler(timer_Tick); timer.Interval = new TimeSpan(00, 1, 1); bool enabled = timer.IsEnabled; // Enable the timer timer.Start(); // Start the timer } On button click I call above method to set this Timer. But when Eventhandler for Tick is set, I get error "Attempted to read or write protected memory. This is often

How do we set Timers in WinRT app?

落爺英雄遲暮 提交于 2019-12-30 06:01:04
问题 I am trying to set Timer in my Windows Store App. public void Start_timer() { Windows.UI.Xaml.DispatcherTimer timer = new DispatcherTimer(); timer.Tick += new Windows.UI.Xaml.EventHandler(timer_Tick); timer.Interval = new TimeSpan(00, 1, 1); bool enabled = timer.IsEnabled; // Enable the timer timer.Start(); // Start the timer } On button click I call above method to set this Timer. But when Eventhandler for Tick is set, I get error "Attempted to read or write protected memory. This is often

How to draw an arc in winRT with animation?

人盡茶涼 提交于 2019-12-30 05:01:28
问题 I am a newbie to WinRT and Blend and I need to draw digits 1, 2 etc with drawing effect in my WinRT application. The requirement is like the application will be drawing the digit. Any help will be really appreciated. Thanks in advance. 回答1: I think you would need to piece together a couple of storyboards to achieve that, and I would really recommend that you use Blend for that! Open a blank project, under objects and timeline there is a plus, click on it and add a new story board. Move the

Save canvas with background image on WinRT

女生的网名这么多〃 提交于 2019-12-30 04:59:28
问题 I want to make a simple drawing app for children with C# for WinRT. The user can choose a picture and draw a little bit. But how can I save the image (together with the background)? There is no functionality to save the image with background. 回答1: I tried to use your library to render a Canvas into an image file but I got this error runtime: "Can't find component. (Exception from HRESULT: 0x88982F50)". Code looks like this: //SAVE private async void saveButton_Click(object sender,

Handling Two, Three, Four Fingers Swipe Gestures in WinRT App

末鹿安然 提交于 2019-12-30 02:17:05
问题 I have the following code: private Point initialpoint; private void ManipulationStarted(object sender, ManipulationStartedRoutedEventArgs e) { initialpoint = e.Position; } private void ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e) { Point currentpoint = e.Position; if (currentpoint.X - initialpoint.X >= 100) { System.Diagnostics.Debug.WriteLine("Swipe Right"); e.Complete(); } } I can handle 1 finger swipe gesture very easily, but I want to handle 2, 3, 4 fingers swipe

Communication between Windows Store app and native desktop application

核能气质少年 提交于 2019-12-29 17:37:10
问题 ! For the sake of simplifying things I will refer to Windows Store applications (also known as Metro or Modern UI) as "app" and to common desktop applications as "application" ! I believe this is still one of the most unclear yet important questions concerning app-development for developers who already have established applications on the market: How to manage communication between apps and applications on a Windows 8 system? (please let's not start a debate on principles - there're so many

Is it possible to write a Ping class in C# that will run within Windows 8 Metro environment?

≡放荡痞女 提交于 2019-12-29 08:40:10
问题 Since the Metro environment on Windows 8 lacks most of the .NET framework class libraries or contains a substancially pared down version, is it possible to execute a "ping" from a Metro style application? There is support for Sockets, so I guess there is hope, but I don't know where to start, since every "C# Ping" example uses System.Net.NetworkInformation.Ping and that is not available in WinRT. I also looked into the source code for Mono, and their ping implementation fires up ping.exe and

Change App language at RunTime on-the-fly

前提是你 提交于 2019-12-29 07:32:10
问题 I'm currently developing a metro app in which the user can change current language at runtime and all the custom controls that are loaded must update their text regarding to the new language. Problem is that when I change the language using the following code, the app language changes but it will only update text when I restart my app because the pages and controls that are already rendered are cached. LocalizationManager.UICulture = new System.Globalization.CultureInfo((string)((ComboBoxItem

Getting an UTF-8 response with httpclient in Windows Store apps

余生颓废 提交于 2019-12-29 06:46:29
问题 I'm building a Windows Store app, but I'm stuck at getting a UTF-8 response from an API. This is the code: using (HttpClient client = new HttpClient()) { Uri url = new Uri(BaseUrl + "/me/lists"); HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, url); request.Headers.Add("Accept", "application/json"); HttpResponseMessage response = await client.SendRequestAsync(request); response.EnsureSuccessStatusCode(); string responseString = await response.Content.ReadAsStringAsync();