microsoft-metro

XamlParseException when consuming a Page from a library

我们两清 提交于 2019-12-12 16:33:16
问题 I've recently started work on a project that is supposed to target Windows RT (C#) Having some background in Silverlight & WPF I've created an assembly (library) that is supposed to hold some of my UserControls, Pages etc. for later re-use. I've added an empty Page to that assemly. Whenever I navigate to that page (using navigation mechanisms), the contructor is called correctly, however there's a non-descriptive XamlParseException during the InitializeComponent() call. Message: XAML parsing

How to get Device Id in Windows 8 Metro app

烈酒焚心 提交于 2019-12-12 16:31:40
问题 How to get the unique Device in Windows Store App (Metro App)? Can we use: Windows.System.Profile.HardwareIdentification.GetPackageSpecificToken(null); Windows.System.Profile.HardwareToken hToke = Windows.System.Profile.HardwareIdentification.GetPackageSpecificToken(null); IBuffer hardwareId = hToke.Id; IBuffer signature = hToke.Signature; IBuffer certificate = hToke.Certificate; DataReader reader = Windows.Storage.Streams.DataReader.FromBuffer(hardwareId); byte[] ar = new Byte[hardwareId

Toast Notification Fails, Simulator

人走茶凉 提交于 2019-12-12 16:19:34
问题 I am using the toast notification sample here: http://code.msdn.microsoft.com/windowsapps/Toast-notifications-sample-52eeba29 The toast notifications appear when I select local machine for testing. When I select simulator, all I see is XML. My manifest has toast enabled. Am I missing any steps? 回答1: Toast notifications (and other APIs, including those related to tile updates and push notifications) do not work in the simulator. For testing and debugging, use "Local Machine" as the deployment

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

Get Clicked ListView item attributes

為{幸葍}努か 提交于 2019-12-12 15:05:06
问题 I have a Windows 8 application with a ListView: <ListView x:Name="EventListView" ItemClick="EventListView_ItemClick_1" IsItemClickEnabled="True"/> There is some Event objects (a separate class with string attributes like EventType, Description, Time, etc..) that is the source of the ListView: List<Event> eventlist = new List<Event>{ new Event(CONNECTION, "Disconnected", DateTime.Now.ToString(), MONITOR, "SAMSUNG M5", CONNECTION_IMG, RED), new Event(SYNC, "Synchronised", DateTime.Now.ToString(

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:

Detecting WebView Height via Scrolling in XAML

安稳与你 提交于 2019-12-12 14:52:35
问题 I really need to be able to work out how tall a piece of HTML is inside a given WebView . It's pretty much crucial to the project I'm trying to build. I know it's not immediately possible but I could determine whether a scrollbar existed on a WebView I might be able to increase the height of the view until it disappeared. Any thoughts on this? Or any alternative solutions / suggestions? I looked into converting it for a TextBlock using the HTMLAgilityPack (now ported to Metro) but the HTML is

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

How do you access a Metro app's local storage in a desktop application in Windows 8?

牧云@^-^@ 提交于 2019-12-12 10:56:42
问题 Is there an API available for this in .Net? What about in the Windows API? If not, has anyone come up with some hackish-way to do this yet? 回答1: Finding the local storage folder of a Windows 8 Style application http://blog.falafel.com/Blogs/paul-tidwell/2012/08/27/finding-the-local-storage-folder-of-a-windows-8-style-application The path to Windows 8 Style apps is as follows: C:\Users\{username}\AppData\Local\Packages\Microsoft.BingSports_8wekyb3d8bbwe There is a new Windows API which uses an

Does the managed WinRT API include a way to compute an MD5 hash? [closed]

笑着哭i 提交于 2019-12-12 10:43:44
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 8 years ago . How can I compute MD5 in a Metro Style app that is written in C#? 回答1: There is lots of information on the locations of various namespaces for Metro at the Metro style app reference. I'm not sure about MD5, but