microsoft-metro

winrt: load local html and its resources in webview

不想你离开。 提交于 2019-12-14 03:44:23
问题 I'm currently developing a WinRT app where I load local HTML files from Windows.Storage.ApplicationData.Current.LocalFolder . I like to know what would be the best way to load assets like Images, Audio, Video, CSS, JavaScripts, etc, that are embedded in the HTML file. Currently, I'm writing these files in the Windows.ApplicationModel.Package.Current.InstalledLocation but this wont be accessible anymore once the application had been deployed from the store or by installing the AppPackage

How to convert a VirtualKey to a char for non-US keyboard layouts in WinRT?

﹥>﹥吖頭↗ 提交于 2019-12-14 01:07:00
问题 In standard .NET there existed the ToAscii/ToUnicode and MapVirtualKey functions to take care of this functionality, though it seems an equivalent function or library has not been brought into Metro/WinRT. If there is actually no equivalent function or library exposed in Metro/WinRT then that would make a custom text input box VERY difficult to bring to market in non-US countries. Specific example: in my custom control, if a french keyboard user presses the è,ù,é, or à keys, they are unable

Binding text file to a XAML ListBox control

拈花ヽ惹草 提交于 2019-12-13 20:04:36
问题 How do I bind a Text File name, to a ListBox control in a Windows Metro style application using C#? Or: How do I bind a Dictionary() to a XAML ListBox control? 回答1: After what seemed to be endless hours of reading through documentation, searching, and asking questions; I managed to figure this out for myself. Below is the code that works just as I need it to in my situation: XAML: <ListBox Name="NotesList"> <ListBox.ItemTemplate> <DataTemplate> <TextBlock Text="{Binding Filename}" /> <

Windows 8 metro application access arbitrary file path

倖福魔咒の 提交于 2019-12-13 16:18:35
问题 In metro, the codes like following will throw exception: String fileName = @"C:\Test\dd\ccc.jpg"; StorageFile file = await StorageFile.GetFileFromPathAsync(fileName); However even if I check everything in capabilities, also File Picker was added and all file types allowed. I still can't access this file, the same exception will be thrown. Does someone know how to read file in arbitrary file path? Is that possible in metro style application. 回答1: Not possible. You can get to the Libraries -

SimpleOrientationSensor returning Null

跟風遠走 提交于 2019-12-13 15:12:13
问题 I'm using SimpleOrientationSensor to get the screen orientation information in my application. I'm testing this application in Windows Simulator but I always get the sensor object's value as null. This is what I'm doing: SimpleOrientationSensor sensor; sensor = SimpleOrientationSensor.GetDefault(); if (sensor != null) { sensor.OrientationChanged += sensor_OrientationChanged; } I understand that SimpleOrientationSensor.GetDefault() will return null when there is no Sensor available. Should I

Equivelant of .NET GeoCoordinate.GetDistanceTo in Windows 8 Metro style Apps

て烟熏妆下的殇ゞ 提交于 2019-12-13 13:24:53
问题 What is the equivelant of the System.Device.Location.GeoCoordinate.GetDistanceTo method in Metro style Windows 8 Applications. Metro applications have the Geocoordinate class (With a lower case 'C') but no GetDistanceTo method. Secondly, the Metro Geocoordinate class has no constructor. How can I create an instance of it. 回答1: The Metro Geocoordinate has no public constructor for some reason. The best way to implement this in my opinion is to use Reflector and copy the implementation of

show progress bar/ring in windows 8 app while a webpage is loading in webview control

会有一股神秘感。 提交于 2019-12-13 12:31:47
问题 I have the experience of adding the progress bars and progress rings while calling async functions . That has been an easy job as it relies on only IsIndeterminate and IsActive properties of progress bar and progress ring respectively . Now my question is that , how to show a progress bar/ring in the app while some webpage is loading in the webview control of a windows 8 app . I am searching for a property or event , that tells the web page in web view is currently in loading state . If

Windows 8 Store App with Windows Phone App

断了今生、忘了曾经 提交于 2019-12-13 08:27:47
问题 May I know, can A Windows 8 Store App source project (Metro), link with binary reference initially created for Windows Phone 7? A Windows 8 Store App source project (Metro), link with binary reference initially created for Windows Phone 8? A binary Windows 8 Store App, run in Windows Phone 8? I had tested (1) so far, by compiling a Windows 8 Store App project using Microsoft Face SDK for WP7. I get a mystery compilation error. The "GenerateResource" task failed unexpectedly. System

Erasing the content from canvas where mouse is being dragged

痞子三分冷 提交于 2019-12-13 06:20:49
问题 I am developing a paint like application in metro style. I want to apply a eraser functionality. So how can I make such a tool for erasing the content from canvas like we do in MS paint ? I don't want to clear whole canvas, wherever I click or drag the pointer, the path traveled by the pointer should be erased. 回答1: The important thing to remember is that you're not "erasing." You're painting with small while pixels over the area that the mouse has traveled. There's 100 different ways to do

Save Image using FileSavePicker

自古美人都是妖i 提交于 2019-12-13 05:27:26
问题 I have an image displayed in an Image Control and I need to save that Image using FileSavePicker This is what I have done: Dim fileSavePicker As New FileSavePicker() fileSavePicker.FileTypeChoices.Add("PNG", New String() {".png"}) fileSavePicker.FileTypeChoices.Add("JPG", New String() {".jpg"}) fileSavePicker.FileTypeChoices.Add("BMP", New String() {".bmp"}) fileSavePicker.FileTypeChoices.Add("TIFF", New String() {".tiff"}) fileSavePicker.FileTypeChoices.Add("EXIF", New String() {".exif"})