windows-runtime

Windows 8 theme color - accessing it programmatically

无人久伴 提交于 2019-12-18 03:33:18
问题 In windows 8 consumer preview you can personalize your experience, including setting a 'background color' which is then also used as the background for selected tiles, app bar etc. So selecting orange will mean that orange accents are visible in the Windows 8 Metro UI. I am currently authoring some custom controls, and I would like to have access to this color in my styling, so as the user changes color so my applications accents are re-colored accordingly. I cannot find a way of getting at

WPF/Silverlight VS WinRT

℡╲_俬逩灬. 提交于 2019-12-17 22:16:10
问题 I never actually built an application (nor a HelloWorld) in WinRT, and I'm very suspicious. My question is if there are features in WPF/Silverlight that don't exist in WinRT (excluding features that are implemented differently by design)? And these aspects are most important to me and are the core of my question , and in result, decision to whether start using WinRT or wait for these to be implemented for it: Entity Framework? WCF RIA? MVVM support (Prism)??? Various toolkits (Silverlight/WPF

How to clear TimeZoneInfo cache in WinRT?

泄露秘密 提交于 2019-12-17 21:20:27
问题 In .NET some values used by TimeZoneInfo are cached, such as the current time zone in use by TimeZoneInfo.Local , DateTime.ToLocalTime , etc. In traditional .NET framework apps, this cache can be cleared by calling TimeZoneInfo.ClearCachedData() , as explained in the docs. However, in WinRT applications, such as Windows Store apps, and Windows Universal Apps, the ClearCachedData API is not available. How do you clear the time zone cache in a WinRT environment? 回答1: There's an undocumented way

WinRT Replacement for System.ComponentModel.TypeConverter

≡放荡痞女 提交于 2019-12-17 19:51:00
问题 It doesn't look like TypeConverter is available to use. What is recommended to replace this? I was going to go and create my own TypeConverter class to use to replace it, but if there is a new or better way in WinRT to do it, I'd go that route. There are also many other classes that I would need to recreate; like all the default type converters. 回答1: There is no TypeConverter class in the WinRT and the team has not announced any plans to include it in a future release. You have a number of

Load more items on grid view scroll end

我与影子孤独终老i 提交于 2019-12-17 19:31:03
问题 I am developing a Windows Store Application in XAML/C# and I have a GridView displaying 12 items at a time (3 x 4). What I need to do is once the user scrolls to the end, more items are added to the GridView. How do I catch the event for scrolling at end?? I tried many approaches, but nothing worked... UPDATE: It took me a LOOOONG time and lots of examples to figure what I was doing wrong. ListView worked, but GridView didn't... Finally I noticed that the GridView items must have a width

Make MediaElement support more video codecs

妖精的绣舞 提交于 2019-12-17 18:57:37
问题 Is there a way to make MediaElement support more video codecs like mkv , flv , mov etc.? If not, is there any other control that supports more video codecs? 回答1: Have you seen the Player Framework? It's an open source component supporting Windows 8, part of the Microsoft Media Platform, and developed by Microsoft. It's an alternative to the standard MediaElement control, and provides a plug-in mechanism. I'm not sure whether you can support extra codecs through this mechanism though. Other

WebClient class doesn't exist in Windows 8

这一生的挚爱 提交于 2019-12-17 18:37:44
问题 I want to use a HTTP webservice, and I've already developed an app for wp7. I use the WebClient class, but I can not use it for windows 8 ("error: type or namespace can not be found"). What else can I use? Can you provide me a sample of code? Does Microsoft have a site to help when a namespace don't exist? 回答1: Option 1 : HttpClient if you don't need deterministic progress notification this is what you want use. Example. public async Task<string> MakeWebRequest() { HttpClient http = new

What is an equivalent method to `GetCustomAttributes` for .NETCore (Windows 8 Framework)?

女生的网名这么多〃 提交于 2019-12-17 18:25:33
问题 I'm putting together an app that interfaces with Stack API and have been following this tutorial (although old API version it still works). My problem is that when using this within the Windows 8 Store App I'm contrained by the .NETCore Framework which doesn't support the GetCustomAttributes method found below: private static IEnumerable<T> ParseJson<T>(string json) where T : class, new() { var type = typeof (T); var attribute = type.GetCustomAttributes(typeof (WrapperObjectAttribute), false)

WinRT and build-in Windows 8 Apps

孤者浪人 提交于 2019-12-17 18:22:10
问题 Can non-Metro Windows apps (ex: Explorer) be built with the new WinRT, or must they still be Win32 based? 回答1: I asked this during the 'Ask the Experts' session at //Build/. The answer was "Yes, within reason. Not all of the WinRT api's will function when called from desktop apps - for example any metro specific ones will fail. No explicit list of which ones work from desktop (non-metro) apps is available." Edit: It appears that the documentation has been updated to provide a list of WinRT

RunAsync - How do I await the completion of work on the UI thread?

≯℡__Kan透↙ 提交于 2019-12-17 18:19:54
问题 When awaiting Dispatcher.RunAsync the continuation occurs when the work is scheduled, not when the work has completed. How can I await the work completing? Edit My original question assumed the premature continuation was caused by the design of the API, so here's the real question. When awaiting Dispatcher.RunAsync using an asynchronous delegate, using await within the delegate's code, the continuation occurs when the await is encountered, not when the work has completed. How can I await the