windows-runtime

WinRT Reflection (C++/CX)

拜拜、爱过 提交于 2019-12-06 04:36:40
问题 how can I introspect an object in C++/CX? I known how to get its class name (using IInspectable) but I wasn't able to figure out how to get a list of its properties or how to invoke methods if I have just a name of the method (string). I searched for an answer here and at Google but what I found is related to the .NET layer of WinRT (the System.Reflection namespace doesn't seem to be available in C++/CX). 回答1: C++ doesn't provide any specific APIs to reflect on WinRT types, these types are

UWP check the current page for name or instance

社会主义新天地 提交于 2019-12-06 04:29:16
问题 In my UWP app I am launching from protocol or toast. In the onactivated method I want to check whether the apps' mainview is open or which page it is showing. All from the App.xaml.cs I wanna do something like: If Mainpage is not showing --> Navigate(typeof(MainPage)); or If main window is not open since i am coming from protocol or toast launch open frame and navigate to mainpage. not sure how to go about it. 回答1: So I'm checking for var frame = Window.Current.Content as Frame; if (frame !=

UWP UnauthorizedException

喜夏-厌秋 提交于 2019-12-06 04:28:17
问题 I am currently writing my first UWP app just to learn the ropes. I am building a small application that pulls data from downloaded facebook-archive. But when I try to open the file (even though everybody has full access) I get an UnauthorizedException. I don't understand this and I haven't found anybody having this problem with just any old file (there are many people having problems with more specific scenarios but not just a simple file on their hard drive) System

ListView's item insert animations in WinRT

感情迁移 提交于 2019-12-06 04:26:46
问题 Recently I started building my own big Windows 8 Store App. Working on UI I started replicating some good UIs. One I met very interesting animation of inserting new elements in list view in standard Mail app. When you click on chain it expands and shows all messages in chain. Here is captured video. I have no idea what technique did they use to achieve this animation and behavior. Can anyone help me, explain or give example how can I achieve such behavior? Thanks. 回答1: The mail app is written

How to store save Thumbnail image in device in windows 8 metro apps c#

泄露秘密 提交于 2019-12-06 04:21:40
问题 I am creating Thumbnail and showing in frame by using this code Platform -> windows 8 metro apps using c# http://code.msdn.microsoft.com/windowsapps/File-and-folder-thumbnail-1d530e5d in windows 8 metro apps using c#. i need to save or Store ( in device )the thumbnail image which i am creating at run time. in DisplayResult() of constants.cs class file i need to save that image in device how to achieve this . please give me some idea or example i am very new in mobile and never worked on Image

GetFilesAsync stops working

与世无争的帅哥 提交于 2019-12-06 04:16:12
问题 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)

WinRt page navigation

我是研究僧i 提交于 2019-12-06 04:12:37
How do you navigate to a page from code that is inside of a custom class. For example, lets say I have this code in my MainPage.xaml.cs: private void DoSomething(object sender, RoutedEventArgs e) { var work = new Work(); work.doMore(); } and in this class here is where I would like the navigation to actually take place: public class Work { public void DoMore() { // this is what I've tried, but doesn't work var myFrame = new Frame(); myFrame.Navigate(typeof(HomePage)); } } The code you tried doesn't work because is not the main frame, you should publish the MainFrame reference to the rest of

How to use SearchBox in Windows 8.1 by loading the results using a async method

独自空忆成欢 提交于 2019-12-06 04:06:09
问题 I am using a SearchBox to list some items that are obtained from the server. The call to the server is happening in a async method. I am getting an exception An exception of type 'System.InvalidOperationException' occurred WinRT information: A method was called at an unexpected time. My XAML <SearchBox Name="SearchBox" Style="{StaticResource AccountSearchBoxStyle}" Grid.Row="1" Margin="120,0,0,0" HorizontalAlignment="Left" SuggestionsRequested="SearchBox_SuggestionsRequested"

Size GridViewItems to fill GridView?

大憨熊 提交于 2019-12-06 03:36:12
I have the opposite of this problem: How do I dynamically size a GridView Item? I have a GridView with two rows and four columns. The desired behavior is for the GridViewItems to fill the cell, and I can't figure out a way to do this. The GridViewItem is a Grid with some other content, which I have as a DataTemplate. I can provide a Width and Height for an item, but that only works for one resolution, and I need the items to be dynamic and proportional, so if they are displayed on a different device they will continue to be 2 rows of 4 items. On a different page, I have a static Grid with the

Center popup in XAML

倖福魔咒の 提交于 2019-12-06 02:55:54
问题 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>