windows-runtime

Parsing JSONObject

此生再无相见时 提交于 2019-12-08 07:13:28
I am trying to GET JSON From a webservice , which i was able to figure out . BTW This was my JSON Data - { "X-YZ-111/AB.CD": { "P1": "F", "P2": "43.46" }, "X-YZ-112/AB.CD": { "P1": "F", "P2": "8.02" }, "X-YZ-113/AB.CD": { "P1": "F", "P2": "9066.58" }, "X-YZ-114/AB.CD": { "P1": "F", "P2": "6.00" }, "X-YZ-115/AB.CD": { "P1": "F", "P2": "6.00" }, "X-YZ-116/AB.CD": { "P1": "F", "P2": "10.00" }} Using Windows.Data.Json; private async void getJSON_click(object sender,RoutedEventArgs e) { var client=new HttpClient(); client.MaxResponseBufferSize=1024*1024; var response= await Client.GetAsync(new Uri

Why does HttpClient appear to deadlock here?

时光总嘲笑我的痴心妄想 提交于 2019-12-08 07:06:58
问题 I have an API made in a portable class library which needs to reach out to platform specific APIs for sending HTTP requests. Here is the method I wrote to do an HTTP POST on WinRT: public bool Post(IEnumerable<KeyValuePair<string, string>> headers, string data) { bool success = false; HttpClient client = new HttpClient(new HttpClientHandler {AllowAutoRedirect = false}); foreach (var header in headers) { client.DefaultRequestHeaders.Add(header.Key, header.Value); } try { var task=client

Multiple HTTP Requests in WinRT / Win8

与世无争的帅哥 提交于 2019-12-08 06:52:46
问题 Is it possible to send more than two HTTP requests concurrently in WinRT? I'm trying to load multiple JSON documents from a server and HttpWebRequest fails to respond after the second call. Here is a sample snippet that illustrates this: protected async override void OnNavigatedTo(NavigationEventArgs e) { const string url = "http://www.bom.gov.au/fwo/IDV60901/IDV60901.94868.json"; const int iterations = 3; var tasks = new List<Task>(); var ticks = DateTime.Now.Ticks; for (var i = 0; i <

How to finish current page in Windows Universal

拥有回忆 提交于 2019-12-08 06:46:29
问题 How can I close the current active Page in UWP development? I want to start a new Page and close the current one, so the user cannot go back to that page. Is there any method in UWP similar to Android's method "finish()"? 回答1: I think you should be able to do this by removing last page from back stack after navigating to a new one. Sample code in OnNavigatedTo of a new page: protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); this.Frame.BackStack.RemoveAt

Optimal Database to be used for metro apps?

∥☆過路亽.° 提交于 2019-12-08 06:31:43
问题 I am new to windows 8 metro apps development and i need your help in figuring out my doubt about the database support to metro applications ? i am developing a application which requires reasonably huge amount of data to be stored in its database , it would require many tables and relation between them , with help of this i can fetch the data from database and show it to user , and perform the required operations on it and sync the data when internet connection is there. Please let me know

Sending files via bluetooth from winRT to android / WP devices

天涯浪子 提交于 2019-12-08 06:19:55
问题 I am developing a windows store app and trying to send files via bluetooth to android (and windows phone) devices. Based on an example from MSDN I wrote the following code: public async static void SendAsync(StorageFile file) { var id = RfcommDeviceService.GetDeviceSelector(RfcommServiceId.ObexObjectPush); var devices = await DeviceInformation.FindAllAsync(id); // -> Returns one windows phone and two android devices if (devices.Count > 0) { // Use the 3th device (android tablet) var service =

How to cancel asynchronous callback function in C++/WRL?

旧时模样 提交于 2019-12-08 06:08:59
问题 I'm writing Windows 10 Store / WinRT code using C++/WRL which I'm new to. And I'm curious to know how do I cancel long-pending asynchronous operation? The best way to illustrate it is with this example: #include <Windows.Services.Store.h> #include <wrl.h> auto onAppLicCompletedCallback = Callback<Implements<RuntimeClassFlags<ClassicCom>, IAsyncOperationCompletedHandler<StoreAppLicense*>, FtmBase>>( [](IAsyncOperation<StoreAppLicense*>* operation, AsyncStatus status) { //Asynchronous operation

Parsing JSONObject

删除回忆录丶 提交于 2019-12-08 05:35:49
问题 I am trying to GET JSON From a webservice , which i was able to figure out . BTW This was my JSON Data - { "X-YZ-111/AB.CD": { "P1": "F", "P2": "43.46" }, "X-YZ-112/AB.CD": { "P1": "F", "P2": "8.02" }, "X-YZ-113/AB.CD": { "P1": "F", "P2": "9066.58" }, "X-YZ-114/AB.CD": { "P1": "F", "P2": "6.00" }, "X-YZ-115/AB.CD": { "P1": "F", "P2": "6.00" }, "X-YZ-116/AB.CD": { "P1": "F", "P2": "10.00" }} Using Windows.Data.Json; private async void getJSON_click(object sender,RoutedEventArgs e) { var client

How to cancel asynchronous callback function in C++/WRL?

坚强是说给别人听的谎言 提交于 2019-12-08 05:22:28
I'm writing Windows 10 Store / WinRT code using C++/WRL which I'm new to. And I'm curious to know how do I cancel long-pending asynchronous operation? The best way to illustrate it is with this example: #include <Windows.Services.Store.h> #include <wrl.h> auto onAppLicCompletedCallback = Callback<Implements<RuntimeClassFlags<ClassicCom>, IAsyncOperationCompletedHandler<StoreAppLicense*>, FtmBase>>( [](IAsyncOperation<StoreAppLicense*>* operation, AsyncStatus status) { //Asynchronous operation is done return S_OK; }); //'opAppLic' is defined as: // ComPtr<IAsyncOperation<StoreAppLicense*>>

On screen keyboard is hiding content

浪尽此生 提交于 2019-12-08 05:11:19
问题 I have an autocomplete text box that when typed in will show results in a popup directly below itself. But when the user is using a virtual keyboard as soon as the keyboard shows it will scroll the the bottom of the textbox, This hides the results from showing when they appear. Is there a way for me to get around this? The only way i can think of is to set the vertical offset of the popup on each keypress that will position it above the textbox instead of below. But this is not how i would