windows-runtime

backgroundTaskHost.exe exits with code 1 (0x1)

巧了我就是萌 提交于 2019-12-10 04:19:23
问题 I have a Windows Store application that I am creating that has a Windows Runtime Component for a background task. The solution builds with no problems in Visual Studio but when the background task is triggered, it always fails with the message "The program '[4204] backgroundTaskHost.exe' has exited with code 1 (0x1)." The reference to the project containing the background task is in the main project and I am setting the entry point, so I don't know what the problem is. How do I get more

Windows Store App UI update

孤者浪人 提交于 2019-12-10 03:59:59
问题 I am writing a Windows Store App toy application for Windows 8. It has just one xaml page with a TextBlock . The page has the class MyTimer as DataContext : this.DataContext = new MyTimer(); MyTimer implements INotifyPropertyChanged and the updating of the property Time is made with a timer: public MyTimer(){ TimerElapsedHandler f = new TimerElapsedHandler(NotifyTimeChanged); TimeSpan period = new TimeSpan(0, 0, 1); ThreadPoolTimer.CreatePeriodicTimer(f, period); } with private void

Handling 2, 3, 4, 5 Fingers Tapped, DoubleTap & Holding Gestures in WinRT App

荒凉一梦 提交于 2019-12-10 03:17:11
问题 I can easily handle 1 finger Tapped , DoubleTap and Holding gestures like this: public MainPage() { this.InitializeComponent(); this.Tapped += mc_Tapped; this.DoubleTapped += mc_DoubleTapped; this.Holding += mc_Holding; } public void mc_Tapped(object sender, TappedRoutedEventArgs e) { //Tap } public void mc_DoubleTapped(object sender, DoubleTappedRoutedEventArgs e) { //DoubleTap } public void mc_Holding(object sender, HoldingRoutedEventArgs e) { //Hold } But the events don't have a property

Windows 8 - BeginAnimation?

扶醉桌前 提交于 2019-12-10 03:16:53
问题 It seems I can't do myObject.BeginAnimation(dp , animation) . Is this a bug or has it been changed? 回答1: You need to use a storyboard. Add your animation to the storyboard and have the storyboard begin the animation. var storyboard = new Storyboard(); var opacityAnimation = new DoubleAnimation { From = 0, To = 1, Duration = DurationHelper.FromTimeSpan(TimeSpan.FromSeconds(1)), }; storyboard.Children.Add(opacityAnimation); Storyboard.SetTargetProperty(opacityAnimation, "Opacity"); Storyboard

How to remove an element from an IGrouping

蓝咒 提交于 2019-12-10 02:48:53
问题 How do I remove an object directly from an IGrouping IGrouping<DateTime, VMAppointment> ? The only way I know of currently is to generate a new IGrouping without the concering element, but I don't like this way because it causes some trouble within my application. Any ideas? 回答1: No, there's no way to mutate an IGrouping<,> , at least in general - and even if you knew the concrete type, I don't believe any of the implementations exposed by the .NET framework allow the group to be mutated.

WinRT Replacement of System.Environment.TickCount

戏子无情 提交于 2019-12-10 02:09:49
问题 What is the WinRT replacement for System.Environment.TickCount? 回答1: It should be available, because it isn't a problem. But it is not, a [TypeForwardedTo] hangup I guess because GetTickCount() isn't on the white list and .NET never adopted GetTickCount64. The standard fallback works fine, you can use pinvoke the call the native Windows function. I verified that a program that uses it passes the Windows App Certification Kit test. [System.Runtime.InteropServices.DllImport("kernel32.dll")]

Exception when reading text from the file using FileIO.ReadTextAsync

不羁岁月 提交于 2019-12-10 01:56:32
问题 I am getting the following exception when attempting to read a locl text file using var text = await FileIO.ReadTextAsync(file); The handle with which this oplock was associated has been closed. The oplock is now broken. (Exception from HRESULT: 0x80070323) This happens in one of the regression unit tests, it also happens from time to time in the app. App is XAML + C# Any ideas what might be causing it?! 回答1: I was having the same problem, that ocurred by concurrence threading. I was trying

Is there a 'IsInDesignMode' property in WinRT?

安稳与你 提交于 2019-12-10 01:36:44
问题 I'm trying to port my application from Phone 7 and can't find the way to detect when control is in Design mode. Got it - Windows.ApplicationModel.DesignMode.DesignModeEnabled 回答1: I am using this: if (Microsoft.Devices.Environment.DeviceType == DeviceType.Emulator) and this _isInDesignMode = Windows.ApplicationModel.DesignMode.DesignModeEnabled to check the current developing situation 来源: https://stackoverflow.com/questions/7624351/is-there-a-isindesignmode-property-in-winrt

HttpUtility.HtmlDecode in WinRT

廉价感情. 提交于 2019-12-10 01:21:16
问题 Is there an equivalent to HttpUtility.HtmlDecode in WinRT? I'm developing a MetroStyle app and want to decode strings that came from a XML doc. 回答1: According to this answer from a Microsoft employee, there's currently no replacement for HtmlDecode in the WinRT that's included in the Windows 8 Developer Preview. However, there will be a replacement in the next pre-release version of WinRT. 回答2: Use System.Net.WebUtility instead 来源: https://stackoverflow.com/questions/8341882/httputility

How do you bind a ViewModel to the Windows 8 Settings pane in MvvmCross?

醉酒当歌 提交于 2019-12-09 22:32:01
问题 I've been looking at MvvmCross for cross platform mobile development. Since navigation of views is done by calling ShowViewModel<>(), how would you create the settings pane (which is a user control) in Windows 8 using MvvmCross? 回答1: MvvmCross provides a general ShowViewModel<T> navigation mechanism which uses a Presenter to display and set the DataContext on View s. Views that are shown this way typically cover the 'whole screen' and benefit from automatically constructed ViewModels using