windows-runtime

WinRT preload images

别等时光非礼了梦想. 提交于 2019-12-10 10:53:14
问题 I have a Windows 8.1 XAML app where I'd like to preload images before navigating between pages. The naive code I have now is: // Page1.xaml.cs private void Button_Click(object sender, RoutedEventArgs e) { Frame.Navigate(typeof(Page2)); } And on the second page: // Page2.xaml.cs this.image1.Source = new BitmapImage(new Uri("ms-appx:///Assets/image1.jpg")); this.image2.Source = new BitmapImage(new Uri("ms-appx:///Assets/image2.jpg")); Now, when I click the button to navigate, I can see the

Is it possible to share data between users in a Windows Store App?

僤鯓⒐⒋嵵緔 提交于 2019-12-10 10:18:14
问题 I'm pretty sure that I know the answer to this question (A big fat NO), but is it possible to share downloaded data between the same application but multiple users (Windows login, not Microsoft Store users) in a Windows Runtime environment? The local data folder is relative to each login user, so this seems impossible at first glance. It would be a huge waste for each user to have to download all of the content for the application since it is between 700MB - 1GB of content per app. 回答1: This

Saving data during the OnSuspending method

纵然是瞬间 提交于 2019-12-10 10:16:44
问题 For a Windows 8 Application in C/XAML I have to store some data to the LocalState folder. I have some trouble using async/await operator I think. When I am saving datas while the application is running, everything works fine, but when I try to save the data during the OnSuspending method, it seems that my application doesn't wait for my saving method to be finished to suspend the application. The stranger thing is that when I'm debugging and doing all the operation step by step slowly

No installed components were detected. Element is already the child of another element

ⅰ亾dé卋堺 提交于 2019-12-10 10:07:30
问题 In App.xaml I have added Application Resources with a button as: <Application.Resources> <Button x:Key="MyButton"/> </Application.Resources> In MainPage.xaml.cs , I tried to add this button programatically in my grid. Button btn = (Button)Application.Current.Resources["MyButton"]; myGrid.Children.Add(btn); But it gives error like this: No installed components were detected. Element is already the child of another element. In MainPage.xaml: <Grid x:Name="myGrid" Background="{ThemeResource

How to debug a Windows Store app that crashes on a customer's machine?

雨燕双飞 提交于 2019-12-10 10:06:08
问题 I got a support email from a customer saying his app crashes when it starts and all he gets is a message like: (App Name) ran into a problem You can send info to Microsoft about what went wrong to help improve this app. Files that will be sent to Microsoft C:\Users\User_Name\AppData\Local\Temp\WER####.tmp.appcompat.txt C:\Users\User_Name\AppData\Local\Temp\WER####.tmp.hdmp I thought - Microsoft isn't going to help them really with my silly app. They should send the dump file to me for

Disable On-Screen-Keyboard

好久不见. 提交于 2019-12-10 09:47:20
问题 I'm developing a Windows Store app for an embedded application where the only input device is a small touchscreen. For this reason I'm developing my own number and text entry controls that match the visual look of the application and work better on the small screen. Is it possible to prevent the Windows 8 on-screen keyboard from appearing when a textbox gets focus? 回答1: You can't, it's a user preference as of now. Similar question is found here From Hanselman Unfortunately there is no

Using CallerMemberName attribute in a portable library

扶醉桌前 提交于 2019-12-10 06:47:59
问题 I have a portable library that targets Windows Phone 7.1+ and Windows Store apps (for WinRT), which uses the .net 4.5 framework. I would like to use the new [CallerMemberName] attribute in it. However, VS2012 told me that this attribute is not available in my portable library (that seems normal because it's not available in a WP7.1 project). Yet, I have found out that I can create my own attribute and the compiler will understand it like the real one, by using this snippet: namespace System

How to show basic HTML Windows8 Metro style TextBlock?

北战南征 提交于 2019-12-10 05:48:04
问题 I have an html page that only contains <p> , <strong> , <br /> and <a> tags. I want to show this content in a XAML TextBlock in Windows 8. Is there any way to show that content in a TextBlock without losing the structure (e.g. paragraphs)? I don't want to use WebView because WebView can not be transparent. 回答1: I am developing a open source Windows 8 Metro RSS Reader app and I used HtmlUtilities.ConvertToText You can see the source code implementation here http://metrorssreader.codeplex.com

Does Windows 8 Compile JavaScript?

拥有回忆 提交于 2019-12-10 04:24:44
问题 It is exciting that Windows 8 is supporting so many languages for Metro App development. One that especially interested me was the HTML5/CSS/JavaScript. What I don't understand, is this code going to get compiled in a sort of executable (like the C#, VB, and C++ option), or would my app basically be running in IE as an actual web page? 回答1: Yes. Javascript is executed on Windows 8 by the Chakra engine. Similar to the .NET just-in-time compiler, it translates javascript to optimized machine

Problems adding Blend behavior to DatePicker

穿精又带淫゛_ 提交于 2019-12-10 04:22:56
问题 I'm trying to add a Blend behavior to a DatePicker control to bind an MVVM-Light RelayCommand to the DateChanged event like so: <DatePicker Date="{Binding SelectedDate, Mode=TwoWay}"> <Interactivity:Interaction.Behaviors> <Core:EventTriggerBehavior EventName="DateChanged"> <Core:InvokeCommandAction Command="{Binding DateChangedCommand, Mode=OneWay}"/> </Core:EventTriggerBehavior> </Interactivity:Interaction.Behaviors> </DatePicker> I'm using the following definitions: xmlns:Interactivity=