windows-runtime

PointerDownThemeAnimation application stops WP8

白昼怎懂夜的黑 提交于 2019-12-12 15:52:16
问题 I'm confused why my app is closing, I have added the PointerDownThemeAnimation and it works fine but only one time, when I try to click it again the aplication stops. Why? Here is my code: private void staryrynek1(object sender, PointerRoutedEventArgs e) { pointerDownStoryboard.Begin(); } private void staryrynek(object sender, PointerRoutedEventArgs e) { pointerUpStoryboard.Begin(); this.Frame.Navigate(typeof(StaryRynek)); } and <Grid x:Name="staryrynek_grid" Margin="10,92,10,0"

WinRT timed logout

泪湿孤枕 提交于 2019-12-12 15:41:45
问题 I am developing a WinRT app. One of the requirements is that the app should have a "timed logout" feature. What this means is that on any screen, if the app has been idle for 10 mins, the app should logout and navigate back to the home screen. The brute force way of doing this obviously would be to hook up pointer pressed events on every grid of every page and resetting the timer if any of these events is fired but I was wondering if there was a more elegant and more reliable way of doing

FileOpenPicker PickSingleFileAsync throws UnauthorizedAccessException

末鹿安然 提交于 2019-12-12 15:38:03
问题 The following code is almost verbatim from the MSDN example for the FileOpenPicker class. FileOpenPicker picker = new FileOpenPicker(); picker.ViewMode = PickerViewMode.Thumbnail; picker.SuggestedStartLocation = PickerLocationId.PicturesLibrary; picker.FileTypeFilter.Add(".png"); picker.FileTypeFilter.Add(".jpg"); picker.FileTypeFilter.Add(".jpeg"); StorageFile file = await picker.PickSingleFileAsync(); When I trigger it from a button I get the following exception from the last line: System

Using SQLite with WinRT

限于喜欢 提交于 2019-12-12 15:03:37
问题 I am developing a metro ui application and I would like to use SQLite for some internal data instead of JET in order to take advantage of some already-written code. Howerver when I try to use sqlite3_open for opening a data base, it does not work. I get an error saying a cannot open the data base. I believe some APIs used by the SQLite cannot be used on metro style application. Can someone help me on this? At least say me how to identify what apis should be ported? 回答1: This code should work:

Can I “add” static methods to existing class in the .NET API?

会有一股神秘感。 提交于 2019-12-12 13:21:09
问题 I want to build a Windows Store class library using source code from a regular .NET Framework class library . Ideally, I do not want to modify the original source code files. In some of the source code files from the .NET Framework library , static members are used from a class that is defined in both the regular .NET Framework API and the .NET for Windows Store apps API, but where only a subset of the .NET Framework members are available for Windows Store . One specific example is System.IO

How to free memory of c++ WinRT value structs

我怕爱的太早我们不能终老 提交于 2019-12-12 13:17:19
问题 Do I have to, and how do I, free memory from a value struct created in a Windows Runtime Component that has been returned to a managed C# project? I declared the struct // Custom struct public value struct PlayerData { Platform::String^ Name; int Number; double ScoringAverage; }; like auto playerdata = PlayerData(); playerdata.Name = ref new String("Bla"); return playerdata; I'm new with freeing memory and haven't got a clue how and when to free this. Anyone? 回答1: When a value struct is

Speech on WinRT

佐手、 提交于 2019-12-12 12:54:38
问题 Is Speech api available in WinRT (like Windows Phone 8). Can I use some third party speech api instead? I want to implement TTS in my Windows 8/WinRT application, does anyone have some suggestions? 回答1: Speech is now available for WinRT Voice Commands and Speech Recognition are available on phone only. TTS is available for all winRT devices. 回答2: There is no Speech API available in WinRT. There may be 3rd party WinRT components, you would have to look for those. I am not aware of any, but I

Saving an image from the web to the Saved Pictures folder in Windows Phone 8.1 RT C#

自古美人都是妖i 提交于 2019-12-12 12:27:20
问题 How can I save an image to the Saved Pictures folder in Windows Phone 8.1 RT? I downloaded the image from the web using HttpClient. 回答1: You just need this var url = "Some URL"; var fileName = Path.GetFileName(url.LocalPath); var thumbnail = RandomAccessStreamReference.CreateFromUri(url); var remoteFile = await StorageFile.CreateStreamedFileFromUriAsync(fileName, url, thumbnail); await remoteFile.CopyAsync(KnownFolders.SavedPictures, fileName, NameCollisionOption.GenerateUniqueName); You need

Windows 8 metro javascript app binding to a table

徘徊边缘 提交于 2019-12-12 12:21:32
问题 I am having trouble binding a table in my javascript metro app instead of binding with the html provided in the template it puts in a load of divs and renders the json as a string. This is what I have: <tr id="tableRow" data-win-control="WinJS.Binding.Template"> <td data-win-bind="innerText: label"></td> <td data-win-bind="innerText: value"></td> <td></td> </tr> <table> <thead> <tr> <th>col1</th> <th>col2</th> <th>col3</th> </tr> </thead> <tbody class="topContent" data-win-control="WinJS.UI

Buttons styled to look like app bar buttons

这一生的挚爱 提交于 2019-12-12 12:03:33
问题 Is it possible to style a xaml button tag to look like an application bar button by changing the style? and how can it be done. 回答1: Hope this Helps. <Page.Resources> <Style x:Key="RoundedButton" TargetType="Button"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Button"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto"></RowDefinition> <RowDefinition Height="30"></RowDefinition> </Grid.RowDefinitions> <Ellipse Name="Ellipse" Grid.Row="0" StrokeThickness="1"