windows-8

Binding data from WCF into a MVVM client always empty

被刻印的时光 ゝ 提交于 2019-12-08 21:32:29
I'm making my first Windows 8 client. This is also the first time I've used async methods to load a property so please forgive me if this is a noobie question. I have a WCF service and started from the Split Page template in visual studio for the client (but I'm going to pretty much replace everything). When I get the data into my Views directly inside of the "SplitPage" code behind everything is loaded properly and shows up. However, when I try to use MVVM the property doesn't have any items in it when it gets bound. Because of WCF it is an async call to get the data is that the cause of the

If NETFX_CORE is for Windows 8, what is for Windows Phone 8?

♀尐吖头ヾ 提交于 2019-12-08 19:47:38
问题 I understand using the NETFX_CORE directive, like this: #if NETFX_CORE // Windows 8 #else // Windows Phone 8 #endif More info: http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj714084(v=vs.105).aspx But is there a directive specific to Windows Phone 8? 回答1: Yes, the Windows Phone directive is: #if WINDOWS_PHONE This is documented here, but I'm surprised that it isn't mentioned here. I also tested this in some code, and it works. 回答2: WP8 should use custom conditional compilation

bank-switch usb devices in Windows8

回眸只為那壹抹淺笑 提交于 2019-12-08 19:43:55
问题 The USB 2.0 standard supports the disabling of individual hub ports. I am looking for an API to call from user code under Windows 8, specifically to disable hub ports, either in C# or in C++, using existing Windows user-mode drivers. It looks like the IOCTL to disable a hub port has been deprecated in the WDF. I've built and used DevCon - it will disable devices through the DDK, but will not disable hub ports. WinUSB is a powerful interface, which requires specifying WinUSB.sys as your driver

Custom User Agent for a WebView

喜欢而已 提交于 2019-12-08 19:34:31
问题 can I set a custom User Agent for a WebView ? I need to show mobile style of websites. 回答1: It's easy to do: string ua = "Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X)" + "AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25"; var httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, new Uri(url)); httpRequestMessage.Headers.Add("User-Agent",ua); webView1.NavigateWithHttpRequestMessage(hrm); 回答2: Per this MSDN Forum posting you cannot. Could you host

Can I have a composite shape as a resource in WinRT XAML?

扶醉桌前 提交于 2019-12-08 18:52:35
I'm developing a Windows 8 Metro-style application and I want to use vector images. As there seems to be no direct support for svg images, I am trying to use a xaml fragment consisting of multiple shapes (a path and some lines) as an image. I would like to have a resource dictionary entry with the composite shape and be able to include it in different pages. Ideally, I would also like to be able to resolve a specific composite shape from a data bound property. From what I've read, the WPF approach was to have a VisualBrush or DrawingBrush consisting of the shapes, but there are no such classes

defining event handler for Tick event of DispatcherTimer in windows 8 app

ⅰ亾dé卋堺 提交于 2019-12-08 18:48:33
问题 I am developing an application in windows 8 Visual studio 11, and I want to define an event handler for a DispatcherTimer instance as below: public sealed partial class BlankPage : Page { int timecounter = 10; DispatcherTimer timer = new DispatcherTimer(); public BlankPage() { this.InitializeComponent(); timer.Tick += new EventHandler(HandleTick); } private void HandleTick(object s,EventArgs e) { timecounter--; if (timecounter ==0) { //disable all buttons here } } ..... } But I get the

Is it true that deferral should be added for any async operation?

廉价感情. 提交于 2019-12-08 18:43:32
问题 According to Likness (p. 164, "Building Windows 8 Apps with C# and XAML"), "When performing asynchronous tasks, you must ask for a deferral." So if I'm not taking him out of context, this code: private async Task<System.Collections.Generic.KeyValuePair<string, string>> SelectAContactForASlot() { KeyValuePair<string, string> kvp; var contactPicker = new Windows.ApplicationModel.Contacts.ContactPicker(); contactPicker.CommitButtonText = "Select"; var contact = await contactPicker

Metro (XAML/C#): detect installation and/or first run

不问归期 提交于 2019-12-08 18:30:32
问题 When creating Metro applications in XAML/C#, how do I detect when the application is first installed or run for the first time since installation (or potentially upgrade)? I need to use this opportunity to ensure that my database schema is correct and potentially synchronise some base data. I had hoped that I could pick this up from the LaunchActivatedEventArgs within the OnLaunched method, but there does not seem to be a valid value for the Kind or PreviousExecutionState that I can use.

msbuild ASPNETCOMPILER ASPNETRUNTIME startIndex error

ぃ、小莉子 提交于 2019-12-08 17:41:52
问题 I have a web project that builds fine on Windows 7 with no error. When I upgraded to Windows 8, compiling the project into a compiled website throws an error. Compiling from the csproj file (not creating a website) works fine. This is the actual error that is thrown by msbuild ASPNETCOMPILER : error ASPRUNTIME: startIndex cannot be larger than length of string. [mycsproj.file.here] The line that msbuild is running that is throwing the error is C:\Windows\Microsoft.NET\Framework\v4.0.30319

Why is [Windows::Foundation::Metadata::WebHostHidden] added by default in custom WinRT C++/CX controls?

江枫思渺然 提交于 2019-12-08 17:35:52
问题 When I create a new control in a WinRT C++/CX project, the class attribute [Windows::Foundation::Metadata::WebHostHidden] is added by default by Visual Studio 2012. Example: namespace WindowsRuntimeComponent1 { [Windows::Foundation::Metadata::WebHostHidden] public ref class MyUserControl sealed { public: MyUserControl(); }; } Is there any documented reason for this? (I did my homework but I failed to find this piece of information) As far as I know, using the attribute [WebHostHidden] makes