windows-8

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

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,

How to animate a Popup when it hides?

三世轮回 提交于 2019-12-30 04:59:05
问题 i created a Popup Style for using in my windows 8.1 application. And i applied PopupThemeTransition to it's ChildTransitions Property. <Style x:Key="AnimatedPopupStyle" TargetType="Popup"> <Setter Property="IsLightDismissEnabled" Value="False"/> <Setter Property="ChildTransitions"> <Setter.Value> <TransitionCollection> <PopupThemeTransition/> </TransitionCollection> </Setter.Value> </Setter> </Style> My problem is that it animates when it Opens & not animating when closing. What to do with

BlankPage constructor cannot initialize components

我是研究僧i 提交于 2019-12-30 04:03:14
问题 I'm starting learning XAML and I add some code to my BlankPage application. And suddenly a constructor which is initializing a component: public BlankPage() { this.InitializeComponent(); } Stop working. I've got now that error: 'BlankApplication.BlankPage' does not contain a definition for 'InitializeComponent' and no extension method 'InitializeComponent' accepting a first argument of type 'BlankApplication.BlankPage' could be found (are you missing a using directive or an assembly reference

Showing Windows 8 toast from Windows Forms App

安稳与你 提交于 2019-12-30 03:20:09
问题 We've got a Windows Forms Application (vs. WPF) that was originally created for Windows 7. We're carrying the product forward to be used in Windows 8. Is it possible to show Windows 8 Toast Notifications (Windows.UI.Notifications namespace) from this WinForm app, for users running Windows 8? I can't seem to find any examples. Everything I find is a WPF or Windows Store apps—no examples are WinForm apps. 回答1: It is possible to use toast notification in winform poject under win 8. I create a

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

Testacular install fails, no vcbuild.exe

十年热恋 提交于 2019-12-30 01:46:11
问题 I'm trying to install Testacular (using nmp) on a Windows 8 Professional (64 bit) laptop, but it fails when it tries to install socket.io as part of this process. The error I get is Could not load the Visual C++ component "VCBuild.exe". To fix this, 1) install the .NET Framework 2.0 SDK, 2) install Microsoft Visual Studio 2005 or 3) add the location of the component to the system path if it is installed elsewhere. I apparently have .NET framework 3.5 installed (it's checked under the add

Deserializing a JSON object hierarchy into a hierarchy of Dictionary<string, object>

孤街醉人 提交于 2019-12-29 08:52:35
问题 I'm in .NET for WinRT (C#) and I'd like to deserialize a JSON string to a Dictionary<string, object> , where the dictionary value can later be converted to the actual type. The JSON string can contain an object hierarchy and I'd like to have child objects in Dictionary<string, object> as well. Here's a sample JSON it should be able to handle: { "Name":"John Smith", "Age":42, "Parent": { "Name":"Brian Smith", "Age":65, "Parent": { "Name":"James Smith", "Age":87, } } } I tried with the

Deserializing a JSON object hierarchy into a hierarchy of Dictionary<string, object>

不羁岁月 提交于 2019-12-29 08:52:08
问题 I'm in .NET for WinRT (C#) and I'd like to deserialize a JSON string to a Dictionary<string, object> , where the dictionary value can later be converted to the actual type. The JSON string can contain an object hierarchy and I'd like to have child objects in Dictionary<string, object> as well. Here's a sample JSON it should be able to handle: { "Name":"John Smith", "Age":42, "Parent": { "Name":"Brian Smith", "Age":65, "Parent": { "Name":"James Smith", "Age":87, } } } I tried with the

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