windows-runtime

Why does the People app show no contacts / doesn't allow me to pick contacts?

耗尽温柔 提交于 2019-12-14 03:13:47
问题 I'm trying to allow the user to select a contact from the People app this way: private async Task<System.Collections.Generic.KeyValuePair<string, string>> SelectAContactForASlot() { KeyValuePair<string, string> kvp; // = new KeyValuePair<string, string>(); var contactPicker = new Windows.ApplicationModel.Contacts.ContactPicker(); contactPicker.CommitButtonText = "Select"; var contact = await contactPicker.PickSingleContactAsync(); if (contact != null) { kvp = new KeyValuePair<string, string>

How to convert a VirtualKey to a char for non-US keyboard layouts in WinRT?

﹥>﹥吖頭↗ 提交于 2019-12-14 01:07:00
问题 In standard .NET there existed the ToAscii/ToUnicode and MapVirtualKey functions to take care of this functionality, though it seems an equivalent function or library has not been brought into Metro/WinRT. If there is actually no equivalent function or library exposed in Metro/WinRT then that would make a custom text input box VERY difficult to bring to market in non-US countries. Specific example: in my custom control, if a french keyboard user presses the è,ù,é, or à keys, they are unable

How to convert Base64 string to image, then bind it to GridView in a Metro Style App?

試著忘記壹切 提交于 2019-12-14 00:32:36
问题 I have collection of products from web service, I preview this product in Grid View, but I get the images of the products as Base64 strings. How can I convert it to images and bind it to the images in the Grid View? Any piece of code that will help me in this issue. 回答1: In WPF/Metro/Silverlight, Image is a UI control. Its source is set to BitmapSource. BitmapSource is a data structure to hold image data. Following is the code to retrieve BitmapImage from byte array. public BitmapImage

How does LocalSettings work?

风流意气都作罢 提交于 2019-12-13 21:30:29
问题 i'm struggling myself with a question - how does in fact LocalSettings work. It's an ApplicationDataContainer class, but is this some kind of a file? Probably yes, but when it's saved? For example we can save some data like this: localSettings.Values["exampleSetting"] = "Hello Windows"; but is it saved to file just after we add/change the Value or it's held somewhere in the memory and saved when App is being Suspended/Terminated? And the main purpose of the question: Do I've to guard the

Toast notifications only pop up if the app is being activated

落爺英雄遲暮 提交于 2019-12-13 21:21:30
问题 I have this problem with toast notifications, my app shows toast notifications only when it is activated (I.e: when I am using it). Here is my code for the toast notifications: private void ShowToastNotification(string text) { var xml = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastText01); xml.GetElementsByTagName("text")[0].AppendChild(xml.CreateTextNode(text)); ToastNotificationManager.CreateToastNotifier().Show(new ToastNotification(xml)); } My application is simply a

What library should I link to get proper definition of WinRT's “EXTERN_C const IID IID___x_ABI_*”

坚强是说给别人听的谎言 提交于 2019-12-13 20:27:50
问题 Here is some raw C code using windows.gaming.input.h API: HSTRING gamepadClassName; if (FAILED(WindowsCreateString(RuntimeClass_Windows_Gaming_Input_Gamepad, HbArrayLength(RuntimeClass_Windows_Gaming_Input_Gamepad) - 1, &gamepadClassName))) { Error("Failed to create a WinRT string reference for Windows.Gaming.Input.Gamepad class name."); } static IID const gamepadStaticsInterfaceID = { 0x8BBCE529, 0xD49C, 0x39E9, { 0x95, 0x60, 0xE4, 0x7D, 0xDE, 0x96, 0xB7, 0xC8 } }; if (FAILED

Activate a textbox automatically when user starts typing

*爱你&永不变心* 提交于 2019-12-13 19:45:36
问题 I want to activate a textbox when users starts typing in my Windows 8.1 Store app. I tried handling KeyDown event of Page , something like this code: private void pageRoot_KeyDown(object sender, KeyRoutedEventArgs e) { if (SearchBox.FocusState == Windows.UI.Xaml.FocusState.Unfocused) { string pressedKey = e.Key.ToString(); SearchBox.Text = pressedKey; SearchBox.Focus(Windows.UI.Xaml.FocusState.Keyboard); } } But the problem is e.Key.ToString() always returns capital english character of the

How to adjust ZXing on windows phone store app 8.1 camera (MediaCapture) preview size (full screen)?

允我心安 提交于 2019-12-13 19:44:31
问题 My project here:(https://github.com/79144876/ZXingStoreApp) I have add zxing on my windows phone 8.1 project.The Zxing library here:(https://zxingnet.codeplex.com/SourceControl/latest#trunk/Clients/WindowsRTDemo/MainPage.xaml.cs) But the preview size does not full screen.So,Anybody who knows how to change the preview size ? And i have SetResolution,but still not full screen. Thanks. 回答1: In my code I do this _capture.SetPreviewRotation(VideoRotation.Clockwise90Degrees); _capture

Deliver data in local storage on Windows 8

故事扮演 提交于 2019-12-13 18:07:23
问题 Is it possible to send some data already in the local storage in an Windows 8 app? I'm using a file based database in my project and want to deliever the whole database to the user so that I don't have to create all entries (more than 350). You can find the data of the local storage in C:\Users\ username \AppData\Local\Packages, but there I cannot save information out of my app. Perhaps you have an idea. Thanks. 回答1: The way I did it in the past, to allow writing data to the file was... Add

Does .NET 4.0 business API's work with Win 8 Metro Apps?

纵饮孤独 提交于 2019-12-13 17:27:06
问题 We have a huge sets of business APIs/assemblies developed in .NET 4.0 (most of those were upgraded from .NET 2.0). They are not currently exposed as web services. We would like to start Win 8 metro app development (using C#/XAML) based on those API's. Is it possible? 回答1: Another option is to target the Portable Class Library (PLC) http://msdn.microsoft.com/en-us/library/gg597391.aspx This way you can compile a single assembly to multi target both normal .net and Metro/WinRT .net. You will of