windows-runtime

How to Start/Stop/Wait for a Thread

淺唱寂寞╮ 提交于 2019-12-11 17:38:43
问题 I am porting some C# .Net code to WinRT and I am having trouble figuring out how to replace the following: bool threadDone = false; Thread updateThread = null; void StartUpdateThread() { threadDone = false; updateThread = new Thread(new ThreadStart(SendUpdateThread)); updateThread.Start(); } void StopUpdateThread() { if (updateThread == null) return; threadDone = true; updateThread.Join(); updateThread = null; } void SendUpdateThread() { while(!threadDone) { ... Thread.Sleep(...); } } What is

WinRT bulk send email

寵の児 提交于 2019-12-11 17:34:21
问题 I'm attempting to send a set of emails in a App store app using var mail = new Uri("mailto:test@somedomain.com"); await Windows.System.Launcher.LaunchUriAsync(mail); the email client starts but only the last email is displayed. I really need to "queue" the emails to the client. Is this possible? It has been suggested to use a share contract, but I assume I may have to prompt the user to share each email? Note: I'm sending multiple emails to multiple recepients, not email to multiple

ERROR_ACCESS_DENIED while using BluetoothLEAdvertisementWatcher in C++/WinRT

旧街凉风 提交于 2019-12-11 17:14:28
问题 I'm trying to use BluetoothLEAdvertisementWatcher to detect BLE advertising packets. However upon calling Start() the watcher object always aborts with 'Access is denied' error. Code is pretty simple and is as below: auto filter = BluetoothLEAdvertisementFilter(); auto advert = BluetoothLEAdvertisement(); advert.LocalName(L"Greeny"); filter.Advertisement(advert); m_watcher.AdvertisementFilter(filter); // setup event handlers m_watcher.Received({ this, &MainPage::OnAdvertisementRecieved }); m

Value does not fall within the expected range GeoboundingBox WinRT

我是研究僧i 提交于 2019-12-11 17:12:52
问题 im trying to fit 2 pois on a bing map for WinRT Universal APP, commonly user position and any other point, so the user can see the map between two points, i have this code: private void centerMap(Geoposition pos, MapPoi pos2) { try { #if WINDOWS_APP //TODO PC Maps #elif WINDOWS_PHONE_APP GeoboundingBox geoboundingBox = new Windows.Devices.Geolocation.GeoboundingBox( new BasicGeoposition() { Latitude = pos.Coordinate.Latitude, Longitude = pos.Coordinate.Longitude }, new BasicGeoposition() {

Decompress ZIP archive in a native Windows Runtime component/application

佐手、 提交于 2019-12-11 16:54:39
问题 This seems to be a simple task, yet my research left me with nothing: How do you extract items from a ZIP archive in a native Windows Runtime component (or application)? Now if I were to target .NET, there's a ZipArchive and ZipFile class, that make the solution as simple as it should be. But what, if I cannot or do not want to take a dependency on the CLR? The only compression support I was able to find in the Windows Runtime is the Windows.Storage.Compression Namespace, and there's really

How to use Task.Delay to control time spans between calls to a web service

♀尐吖头ヾ 提交于 2019-12-11 15:08:41
问题 When a user takes a certain action a call (get) to a web service is made. The service doesn't allow for calls more frequent than once per second. I was thinking I could use Task.Delay to control this so that subsequent calls are made at least one second apart in time but it doesn't seem to work as expected. The pseudo-code looks like this: public async void OnUserAction() { var timeUntilPreviousCallWillBeOrWasMade = 1000ms - (Now - previousWaitStartTime); var

WinRT XamlToolkit Calendar Control

只谈情不闲聊 提交于 2019-12-11 14:48:55
问题 im trying to implement a calendar control for my WinRT universal app. So i looked to this for PC and this for Phone. So i installed both packages set it in xaml and im getting exactly this error In that post, the answer (that seems to be from the creator of the control) says that it has been fixed in 1.7.2.0, but it is not, im using 1.7.2.0 and getting the same error. I have the tried to create the control at code like this: calendar = new WinRTXamlToolkit.Controls.Calendar(); calendar

Windows Store App - Black Screen Transition for a while

▼魔方 西西 提交于 2019-12-11 14:45:39
问题 i have a problem while navigating between pages of my app. Going from page "a" to page "b", i see a black screen just a second before seeing the page "b". It also happens in the opposite navigation. I know this issue is quite common, also here, but i don't understand how to solve it...and it's very ugly to view... EDIT: just an important information: i've set a custom image as background of both the pages(a,b)...as you can see in the code "Assets/Page.jpg" Here is my basic page "a" XAML:

how to get list of all installed apps and run them in UWP WinRT 8.1

好久不见. 提交于 2019-12-11 14:29:12
问题 I'm actually creating an UWP 8.1 app for one of my client.And I've got some little issue with it.At some point of my app I've to get all the names of installed app in the device and view it as a list.When the user will click on any of them, I've to launch that certain app. I've already tried to add restricted capabilities in the app manifest but it shows a blue line when I add, Morever I can get access to the AppData/Packages by using folderpicker somehow but don't know what to do. The app is

C# “await” error when using WinRT from Desktop app

陌路散爱 提交于 2019-12-11 14:18:14
问题 I trying to get my GPS position from a Desktop app, using Windows Runtime, in C#. I followed this how-to to set up Visual Studio and this code sample to create the following trivial code as a C# console app : using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; using System.IO; using System.Runtime; using System.Windows; using Windows; using Windows.Devices.Geolocation; using Windows.Foundation; using