microsoft-metro

Using FileSavePicker with MessageDialog's IUICommand event

我的未来我决定 提交于 2019-12-10 20:56:34
问题 Individually, all code works perfectly. The snippet for saving the file, the snippet for picking a directory to save it to and also the message dialog works great. But when I tie it all together, I get an access denied. I am not using the DocumentsLibrary capability since it is not required of me to do so in this case, however, enabling this capability after running into issues confirmed that it is not the issue. Scenario: User wants to create a new document after entering text in the text

Debugger does not recognize variable for return value of awaited method

我怕爱的太早我们不能终老 提交于 2019-12-10 20:41:39
问题 I have this very simple code in portable class library targeted to .NET 4.5 and Windows Store Apps: HttpResponseMessage response = await _httpClient.PostAsync(uri, content); response.EnsureSuccessStatusCode(); When I put breakpoint on the second line and run my application the breakpoint is correctly hit but I cannot investigate response in the debugger because it reports: The name 'response' does not exist in the current context I'm not sure how much is it related but I also had to disable

ListView in a metro app does not get its vertical scrollbar

坚强是说给别人听的谎言 提交于 2019-12-10 19:18:51
问题 I am not experienced in Windows Store (aka Metro) app XAML, so perhaps I am overlooking something simple, but according to books and samples, a vertical scrollbar is a natural part of a ListView control, and unless explicitly disabled will show up when there are invisible items in the ListView. But on in the case of my app. I have a typical List/Detail page with items in the left pane - they are displayed fine, with scrollbar, and selected item details in the right pane. Selected item

Get free disk space in WinRT using C#

放肆的年华 提交于 2019-12-10 19:06:19
问题 [DllImport("kernel32.dll", SetLastError = true)] static extern bool GetDiskFreeSpaceEx( string lpDirectoryName, out ulong lpFreeBytesAvaliable, out ulong lpTotalNumberOfBytes, out ulong lpTotalNumberOfFreeBytes); // Returns free disk space from directory. public static ulong GetFreeDiskSpace(string directory) { ulong a, b, c; if (GetDiskFreeSpaceEx(directory, out a, out b, out c)) { Debug.WriteLine(a); } return a; } I'm developing a Windows Store App. Why a variable contains 0 when I call:

“The buffer allocated is insufficient” exception while calling BitmapEncoder.SetPixelData

隐身守侯 提交于 2019-12-10 19:00:15
问题 I want to create a white image run time in my Windows 8 app. I thought I will create a byte array and then will write onto file. But I am getting exception The buffer allocated is insufficient. (Exception from HRESULT: 0x88982F8C) . What's wrong with my code? double dpi = 96; int width = 128; int height = 128; byte[] pixelData = new byte[width * height]; for (int y = 0; y < height; ++y) { int yIndex = y * width; for (int x = 0; x < width; ++x) { pixelData[x + yIndex] = (byte)(255); } } var

Porting C# reflection code to Metro-Ui

醉酒当歌 提交于 2019-12-10 18:58:25
问题 I'm trying to port an existing C# class (a generic factory) that uses reflection, but I can't get this piece of code to compile: Type[] types = Assembly.GetAssembly(typeof(TProduct)).GetTypes(); foreach (Type type in types) { if (!typeof(TProduct).IsAssignableFrom(type) || type == typeof(TProduct)) ... I tried looking at the Reflection in the .NET Framework for Windows Metro Style Apps and Assembly Class, where I found an example that didn't compile because of the "using System.Security

How to implement Error Logging in Windows 8 METRO application?

此生再无相见时 提交于 2019-12-10 18:53:15
问题 Hi i am developing an windows 8 c#/xaml Metro application. i want to implement error logging in my app. I want to handle error logs in better way. 1) How can log the error information(so that it will be helpful for the developer to rectify the error) 2)Are there any 3rd party tools / free library's for error logging in metro apps. 3)What are the various alternatives available for error logging ?? 4)What is the best followed practice for error logging ?? Please help me out. Your answer will be

Project is not support by this installation {BC8A1FFA-BEE3-4634-8014-F334798102B3}

此生再无相见时 提交于 2019-12-10 18:35:12
问题 I get Project is not support by this installation error when opening a project in VS 2010 Pro Looking at <ProjectTypeGuids> I see guid {BC8A1FFA-BEE3-4634-8014-F334798102B3} Which indicates a Windows Store Apps (Metro Apps) What should I install to run this project type? 回答1: Which indicates a Windows Store Apps (Metro Apps) Correct. Which requires at least VS2012, the first version that supports Store app development. And you need at least Windows 8, required so you can debug your app. 回答2:

The modifier async is not valid for this item

。_饼干妹妹 提交于 2019-12-10 18:22:56
问题 This does not appear to be a duplicate of the many hundreds of other questions with the same error. I have looked at them all and have found them to be unrelated. I am making a little note app and am trying to read files from a directory. Following the MSDN example, I have the following code, but it is giving me an Error of: Error 1 The modifier 'async' is not valid for this item C:\Users\Jase\documents\visual studio 2012\Projects\AppNameHere\AppNameHere\DataModel\AppNameHereDataSource.cs 192

how to disable caching HTTP GET in metro app, I am using IXMLHTTPRequest2

六眼飞鱼酱① 提交于 2019-12-10 18:10:18
问题 I am doing an http GET to fetch data, I am using IXMLHTTPRequest2. If I GET url "http://foo.com" (curl "http://foo.com"), the second time I get this url again, the content on server is actually changed, but what I am getting is the cached result. Caching seems only honor URL, so if different header with same URL, still same cached result. I have tried "Cache-Control: no-cache", "Cache Control: no-store", and "Pragma: no-cache". None of them are honored by the API. Is there a way to turn cache