microsoft-metro

Why does the file async API block

ぐ巨炮叔叔 提交于 2019-12-04 13:20:50
I am writing a simple metro app. However, the API blocks when accessing files. By blocking, I mean the programs waits forever. Creating/opening a file or folder should take at most a few seconds. In this case, it takes forever. When I run the program, it never comes back from OnTest. Is it what you get. I understand .Wait will wait for the creation of files and folders to finishe. Maybe that's not great design. However, that's not the point. My question is: Do you get the same behavior (blocks the program forever) Is it what's supposed to happen or is it a bug in WinRT? (I am using the

WinRT - Loading data while keeping the UI responsive

这一生的挚爱 提交于 2019-12-04 12:19:49
问题 I'm developing a Windows Metro app, and am getting an issue with the UI becoming unresponsive. As far as I can tell, the cause is as follows: <ListView ... SelectionChanged="ItemListView_SelectionChanged" ... This event is handled here: async void ItemListView_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (this.UsingLogicalPageNavigation()) this.InvalidateVisualState(); MyDataItem dataItem = e.AddedItems[0] as MyDataItem; await LoadMyPage(dataItem); } private async Task

Decompiled .winmd file contains nothing but external calls

六眼飞鱼酱① 提交于 2019-12-04 11:56:22
问题 I am trying to decompile the ComboBox control for my Windows Store app into C#, but there's no code. Instead, all the properties are calls to a separate assembly, it seems. How do I find where the real code exists, and how do I read the method bodies in C#? I cannot read assembly, so that would do me no good 回答1: Some notes on how to reverse-engineer the WinRT internals. Under the hood, WinRT is pure COM. First place you want to look on your machine is C:\Program Files (x86)\Windows Kits\8.0

GetFilesAsync stops working

我是研究僧i 提交于 2019-12-04 11:47:19
I've this piece of code public static class Storage { public async static Task<bool> Exists(string filename) { var folder = await Package.Current.InstalledLocation.GetFolderAsync("Assets"); var _files= await folder.GetFilesAsync(CommonFileQuery.OrderByName).AsTask().ConfigureAwait(false); var file = _files.FirstOrDefault(x => x.Name == filename); return file != null; } } and calling it from my Windows 8 Store application; this.IconExists = this.Game != null && Storage.Exists(this.IconName).Result; So if I put a break point on the above line and run it step by step, it works, but without

How to print Formatted Page which contain ListBox or GridView

纵饮孤独 提交于 2019-12-04 11:09:42
Printing Document using WinRT : 1) To Keep tracking if there are more data Or text data to print in a formatted page. This can be done using RichTextBlock and RichTextBlockOverflow like below: <RichTextBlock Foreground="Black" x:Name="textContent" FontSize="18" Grid.Row="1" Grid.ColumnSpan="2" OverflowContentTarget="{Binding ElementName=firstLinkedContainer}" IsTextSelectionEnabled="True" TextAlignment="Left" FontFamily="Segoe UI" VerticalAlignment="Top" HorizontalAlignment="Left"> </RichTextBlok> <RichTextBlockOverflow x:Name="firstLinkedContainer" OverflowContentTarget="{Binding ElementName

Is possible to use a 'DeviceWatcher' in a WinForms?

筅森魡賤 提交于 2019-12-04 10:30:23
I was trying to found the most efficient and maybe implemented way in .NET Framework Classes to monitorice drives, actually I know how to do this P/invoking, using structures, etc... but it's a lot of code and I wanted to improve it. So I've found this interesting Class, DeviceWatcher , which seems to be able only for Metro apps? I can't find much info about that class and I would like to know if from a Winforms maybe referencing the needed dll I could instance this class to use it in a Winforms? John Koerner Yes, it is possible, provided you are running on Win 8 / Win Server 2012. Scott

No XAML binding debugging with breakpoints in Visual Studio 2012 (RTM, on Windows 8 RTM)?

你。 提交于 2019-12-04 09:35:27
After upgrading my Silverlight 5 solution to Visual Studio 2012 (RTM), and then updating to Windows 8 (RTM), I noticed that when you set a breakpoint in XAML, you get the following tooltip in debug mode: The breakpoint will not currently be hit. Symbol not found: System.Xml.Xsl.Runtime.XmlQueryRuntime.OnCurrentNodeChanged2. I then tried to set a breakpoint in the XAML of a Windows Store App test project, and then of a WPF application, but I got the exact same tooltip. I tried to repair Visual Studio 2012, but that did not change anything. In Visual Studio 2010 such breakpoints worked fine. Is

LayoutAwarePage does not exist in namespace VS2012 bug?

青春壹個敷衍的年華 提交于 2019-12-04 08:31:20
问题 I'm trying to get a search contract working on my Win 8 app but after adding a search contract to my project I get the following namespace error: LayoutAwarePage does not exist in namespace App1.Common. I do have the correct namespace declarations in the xaml: xmlns:common="using:App1.Common" and the LayoutAwarePage is in the correct namespace App1.Common Restarting VS2012 or doing a delete and rebuild doesn't help. To replicate this problem try the following: 1) create new blank metro app 2)

Center popup in XAML

旧时模样 提交于 2019-12-04 08:15:44
I have created a Popup by using the following code, but I can not figure out how to center it I tried to automatically change the margin on runtime, but I could not figure out how to do it, but do anybody has an idea of how to center the popup? It does not has a standard-dimension cause I need to globalize my program <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}" Name="MainGrid"> <Popup x:Uid="LoginPopup" IsOpen="True" Name="LoginPopup"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto"/>

jQuery and Windows 8 JavaScript Metro Style Apps

☆樱花仙子☆ 提交于 2019-12-04 08:03:33
问题 Can jQuery be used in Windows 8 Metro-style apps developed using the JavaScript API? I'm looking at the samples, and there's a lot of standard DOM manipulation like document.getElementById , addEventListener , etc. I'd like to use jQuery for productivity. 回答1: The $ is not magic. jQuery is just a javascript library. It should run fine. The only thing that might not work are cssHooks which won't take into account any 'quirks' of their environment. So yes, it will work, if you trust Microsoft