microsoft-metro

Running a metro app headlessly

三世轮回 提交于 2020-01-01 12:44:33
问题 I've hit a bit of a roadblock, and I'm hoping someone can help! I've written a metro application that serves as a unit test runner, and I now need to be able to call this application headlessly so that it can be used for validation in the build process. The way the metro app works is it runs a bunch of unit tests, generates an XML file that contains the test results, and displays the results to the user. Ideally, I would have a simple script that would run the metro app, execute the tests,

Is possible to use a 'DeviceWatcher' in a WinForms?

妖精的绣舞 提交于 2020-01-01 12:01:30
问题 I was trying to found the most efficient and maybe implemented way in .NET Framework Classes to monitorice drives, actually I know how to do this P/invoking, using structures, etc... but it's a lot of code and I wanted to improve it. So I've found this interesting Class, DeviceWatcher, which seems to be able only for Metro apps? I can't find much info about that class and I would like to know if from a Winforms maybe referencing the needed dll I could instance this class to use it in a

Metro App CollectionViewSource ObservableCollection Filter

吃可爱长大的小学妹 提交于 2020-01-01 06:41:47
问题 It appears that filtering an ObservableCollection with CollectionViewSource is not possible in WinRT : See here! I can filter using LINQ , but how do I get the UI to update if changes that affect the filtered data are made? 回答1: I ended up writing my own class to achieve the desired effect: public class ObservableCollectionView<T> : ObservableCollection<T> { private ObservableCollection<T> _view; private Predicate<T> _filter; public ObservableCollectionView(IComparer<T> comparer) : base

Retrieve Json data with HttpClient

◇◆丶佛笑我妖孽 提交于 2020-01-01 05:21:04
问题 I am programming for Visual Studio 2011 so I am forced to use HttpClient . I need to retrieve some JSON data from the web, but I guess I need to set the content to "json data" or something because I always get strange characters when using only this code: HttpClient client = new HttpClient(); var response = client.Get("http://api.stackoverflow.com/1.1/users"); var content = response.Content.ReadAsString(); So how can I set the content or what should I do to get the correct data ? edit: Output

Windows Phone Panorama with AngularJS

不问归期 提交于 2020-01-01 04:50:07
问题 I am trying to replicate the Windows Phone Ui in an AngularJS app. Here is an example of what a Windows Phone Ui looks like. Infinite Swipe One interesting thing about it is the panels are infinitely swipe-able. You can keep swiping and end up back at the first panel. To achieve the infinite swipe, I duplicate the first and last panels and add them before and after the original panels like this: If you swipe to a copied panel (like "3" or "1"): you are redirected to the real panel immediately

Missing .NET features in Metro style application?

≯℡__Kan透↙ 提交于 2020-01-01 02:00:21
问题 Mostly out of curiosity, I started programming a small "Metro Style" project in Visual Studio 2011, the one that was released in Windows Developer Preview. It combines XAML for the design and C# (in my project) for the code-behind. The C# experience is mostly identical to the one you get on Visual Studio 2008 with .NET framework 4.0, save for these features that I wasn't able to find : System.Console , which make debugging a bit more difficult, And System.Threading.Thread.Sleep(TimeSpan) ,

String encrypt / decrypt with password c# Metro Style

痴心易碎 提交于 2020-01-01 00:43:26
问题 I would like to encrypt and decrypt strings with a password. I use C# and WinRT (MetroStyle). Have somebody a class for encryption/decryption? 回答1: The normal .Net System.Security.Cryptography namespace does not exist in Metro. You use the CryptographicEngine class in Windows.Security.Cryptography.Core namespace instead. If the password is only being verified/authenticated, do not encrypt it. Instead, use the following: using Windows.Security.Cryptography.Core; using Windows.Security

UnauthorizedAccessException during storageFolder.CreateFileAsync

瘦欲@ 提交于 2019-12-31 05:14:09
问题 I have the following piece of code // Point to c:\users\yancheng\documents\visual studio 2012\Projects\App5\App5\bin\x86\Debug\AppX StorageFolder storageFolder = Windows.ApplicationModel.Package.Current.InstalledLocation; StorageFile file = await storageFolder.CreateFileAsync("1000.txt"); if (file != null) { using (IRandomAccessStream writeStream = await file.OpenAsync(FileAccessMode.ReadWrite)) { using (DataWriter dataWriter = new DataWriter(writeStream)) { dataWriter.WriteInt32(1000); } } }

Unable to get free disk space from Metro-style app

拜拜、爱过 提交于 2019-12-31 05:12:33
问题 I am writting a Metro-style app and want to determine the available storage capacity of the drive that hosts the user's music library. I want to disable some app functions while there's no or little space left on the disk. I am Using P/Invoke to call GetDiskFreeSpaceExW and get errors and no valid byte counts. [DllImport("kernel32.dll", SetLastError = true)] static extern bool GetDiskFreeSpaceExW( string lpDirectoryName, out ulong lpFreeBytesAvailable, out ulong lpTotalNumberOfBytes, out

Why does a single line app with System.Console.WriteLine give me a syntax error?

≡放荡痞女 提交于 2019-12-31 05:07:05
问题 I decided to have a go at building Windows Metro style apps with the Windows Developer Preview again, after multiple frustrating experiences. So I fire up Visual Studio and BAM! Right as I try to type in this code System.Console.WriteLine(""); it gives me the red squiggly under "Console". So I try something else: string text = System.IO.File.ReadAllText(@"C:\Users\Public\TestFolder\WriteText.txt"); and THAT fails as well! Red squiggly under File. Why is this error popping up? All this code