windows-runtime

ListView Item Selection Windows Store

寵の児 提交于 2019-12-11 11:36:23
问题 I want a ListView to behave like this: With mouse Input: Left Click -> Item click event handler gets executed, but should not display it as "selected" Right Click -> Item gets selected With touch Input: Single Tap -> equivalent to left click Swipe Down -> equivalent to right click I have played around with various of the events and settings but cant seem to get it to work right. 回答1: In other words, you want your listview to behave like the Windows Start screen? This one was brutal for me to

COM Interface as a param of WinRT ref class, how it possible?

爱⌒轻易说出口 提交于 2019-12-11 11:26:09
问题 How I can define this class correctly: public ref class WICBMP sealed { void Load(IWICBitmapSource ^wicBitmapSource); }; 回答1: This is not possible. Only Windows Runtime types may be used when declaring members of a Windows Runtime interface (in this specific case, the compiler will need to generate an interface that declares your Load member function). You can't even do this if you try to define the interface in IDL. A runtime class can implement COM interfaces that are not Windows Runtime

Why am I getting an argument exception when attempting to delete a file?

夙愿已清 提交于 2019-12-11 11:26:02
问题 I'm running the following code to delete a file that does exist: try { var folder = ApplicationData.Current.LocalFolder; var path = rendition.OfflineLocation.Replace(folder.Path, ""); var file = await folder.GetFileAsync(path); await file.DeleteAsync(); } catch (FileNotFoundException) { } When this runs the file.DeleteAsync(); gives an ArgumentException , with the message Value does not fall within the expected range. I can't find any information anywhere why I would be getting this. Any

how to create motion of text along Path animation in winrt application?

安稳与你 提交于 2019-12-11 11:08:08
问题 how to create motion of text along Path animation in winrt application? After a bit of searching in silverlight and wpf i found PathListBox to do this kind of animation! But I could not able to find PathListBox for Winrt applications 回答1: found the control here http://pathtextblock.codeplex.com/. may be it should work 来源: https://stackoverflow.com/questions/13156368/how-to-create-motion-of-text-along-path-animation-in-winrt-application

System.TypeLoadException Could not find Windows Runtime type 'Windows.Foundation' exception

拥有回忆 提交于 2019-12-11 11:03:09
问题 In my Windows Phone 8.1 app I'm creating a CustomPage and then navigating to it, all in code behind. My CustomPage class is: using Windows.UI.Xaml.Controls; namespace TestApp { public class CustomPage : Page { public CustomPage() { this.BuildPage(); } private void BuildPage() { var panel = new StackPanel(); panel.Children.Add(new TextBlock { Text = "Hello World" }); this.Content = panel; } } } And then in my MainPage.xaml.cs I'm doing this: CustomPage myNewPage = new CustomPage(); Frame

Can't run Unit Tests In VS2012RC

妖精的绣舞 提交于 2019-12-11 11:01:57
问题 I'm trying to run my unit tests for a Windows 8 Metro Class library i get the following 2 errors in the output window: Output: ------ Run test started ------ Error : DEP3000 : Attempts to stop the application failed. This may cause the deployment to fail. App Packages may only be shutdown as part of a Visual Studio build operation. Failed to activate Metro style unit test executor. Error: The application cannot be started. Try reinstalling the application to fix the problem. ========== Run

How to create a file when the file is not exist in WinRT?

拥有回忆 提交于 2019-12-11 11:00:44
问题 What I want open a file if it exists, create it if it not exists What I code try { return await folder.GetFileAsync(fileName); } catch (FileNotFoundException ) { StorageFile file = await ApplicationData.Current.LocalFolder.CreateFileAsync(fileName); return file; } What the error Cannot await in the body of a catch clause How to make it? 回答1: Why not just call CreateFileAsync and specify OpenIfExists? Create the new file or folder with the desired name, or returns an existing item if a file or

Find SQLite Database On WinRT

前提是你 提交于 2019-12-11 10:40:39
问题 When my application starts I can copy a pre-populated SQLite database to the application LocalFolder as suggested here (http://timheuer.com/blog/archive/2012/06/28/seeding-your-metro-style-app-with-sqlite-database.aspx). Now I would like to be able to get a copy of the database back at times when debugging so I can inspect its contents and check that it is as expected. Is there anyway to do this when using the simulator, or even when running local if not ? Thannk you 回答1: It will be located

How to remove a specific page from Navigation cache in Windows Phone 8.1 RT?

亡梦爱人 提交于 2019-12-11 10:26:52
问题 I have set NavigationCacheMode to Required in some pages of my WP 8.1 XAML app. How can I remove a specific page from that? This is not Navigation stack. 回答1: If a page has NavigationCacheMode set to Required , there is currently no way to remove it explicitly. If you use Enabled , you can reset the cache using the cache mode: private void ResetPageCache() { var cacheSize = ((Frame) Parent).CacheSize; ((Frame) Parent).CacheSize = 0; ((Frame) Parent).CacheSize = cacheSize; } 回答2: I couldn't

How to “navigate” to Specifically hub position Windows Phone 8.1

房东的猫 提交于 2019-12-11 10:12:26
问题 I have a hub with 5 positions, and i just want to put a button and when i click,go to Specifically position... In Pivot control i can use SelectedItems with Index Position but here... I don't know <Grid x:Name="MainFragment" > <Hub x:Name="hubMain" Header="Você no mundo, o mundo em você!" Margin="1,0,0,0"> <HubSection x:Name="HubOne" Header="A Faculdade dos Guararapes"> <DataTemplate> <Grid> <Border CornerRadius="50" Background="White" Opacity="0.5" > </Border> <Image Source="/Assets/Fg.png"