win-universal-app

my roaming data dosen't sync between devices

心已入冬 提交于 2019-12-10 19:45:17
问题 I made a UWP application. I use the roamingdata.I save the setting by this: public static void WriteCode(string pwd) { ApplicationDataContainer RoamingSettings = ApplicationData.Current.RoamingSettings; RoamingSettings.Values["Code"] = EncryptHelper.PwdEncrypt(pwd); } I read the setting by this: public static string GetCode() { ApplicationDataContainer RoamingSettings = ApplicationData.Current.RoamingSettings; string str = (String)RoamingSettings.Values["Code"]; if (!String.IsNullOrEmpty(str)

How to make Window.Current visible after it was closed?

吃可爱长大的小学妹 提交于 2019-12-10 19:01:51
问题 I have an application that opens new windows. If the original window is closed and then the user starts the app (e.g. from the start menu) - TryShowAsStandaloneAsync fails in opening a new window (Why?). So I want to "revive" the original one. But though I use Window.Current.Activate(); and frame.Navigate(...); - Window.Current.Visible is always false (and the window is not shown again). So how can I "revive" a closed window? (Or use TryShowAsStandaloneAsync from a closed window.) 回答1: I

Get any value from Cortana voice command result

筅森魡賤 提交于 2019-12-10 18:48:12
问题 Is it posible to read any value from Cortana voice command? For example, when I say: "Search {something} in my library" I want to get the result from {something} in my app. I found how to work with PhraseList and PhraseTopic , but in my case could be any word instead of some declared items or one topic. 回答1: In your VoiceCommands.xml you need: <PhraseTopic Label="something" Scenario="Natural Language"> <Subject> Natural Language </Subject> </PhraseTopic> In your App.xaml.cs you need: private

How to build Windows 10 appxupload(ready to submit to store) package by command line

柔情痞子 提交于 2019-12-10 18:38:23
问题 Tried with msbuild command line as msbuild App1.sln /t:Publish /p:Configuration=Release and also tried as described in http://blogs.msdn.com/b/wsdevsol/archive/2014/02/12/create-a-windows-store-appx-package-and-sign-it.aspx, only appx packages are built which cannot be used to submit to store. 回答1: Try to add the /p:AppxPackageIsForStore=true parameter. 回答2: We're using option: /p:UapAppxPackageBuildMode=StoreUpload There's a good related blog post here: https://blogs.msdn.microsoft.com

win10 app - animating in a new item at top of list

廉价感情. 提交于 2019-12-10 18:37:36
问题 I'm making a news feed app, which periodically adds new content to the top of the list. When I check for new items, there might be dozens or just one. What I'd like is for the oldest of the new items to peek into view so they can continue scrolling up for newer stories. Sadly this doesn't come for free with the platform. However whats interesting is that it does come for free at the bottom of the list. If you add items to the bottom of the list they peek in properly with a nice animation. If

List of all physical drives

末鹿安然 提交于 2019-12-10 18:28:50
问题 How to get list of all physical drives in UWP (Windows 10) App? I'm try to use Windows.Storage.KnownFolders , but this way I can get only folders from Library. 回答1: I know you asked this question a long time ago, but I created a question (Get Internal Drives Using Windows.Storage Namespace in UWP) to provide my method for getting internal drives and encourage feedback/discussion on a better alternative. I had exactly the same problem to solve and everything else I can find online doesn't fit

What dll is needed for Windows.Devices.Geolocation?

懵懂的女人 提交于 2019-12-10 18:27:00
问题 I am trying to write a WCF application which will store current tablet's location to a local database. I can see that Microsoft has an API for querying current location. But I couldn't find any MSDN article specifying which dll's to add to my project in order to use the Windows.Devices.Geolocation namespace. Here's the GitHub example provided from Microsoft, but I can't run it because it requires Visual Studio 2015. My company does not allow migration to VS 2015, so I am still stuck with VS

How to try/catch all exceptions

回眸只為那壹抹淺笑 提交于 2019-12-10 18:26:09
问题 I'm completing a UWP app started by someone else. The app crashes frequently and I always end up in App.g.i.cs at if (global::System.Diagnostics.Debugger.IsAttached) global::System.Diagnostics.Debugger.Break(); where I then have to say "no, don't start the debugger" and close 2 windows. Is there somewhere I could put a big try/catch so that I don't have to restart the app each time this happen? I can't find anything in AppShell or App . Or do I have to put a try/catch in every single event

Can you call an external application from a Windows 10 Universal application? c#

▼魔方 西西 提交于 2019-12-10 18:09:27
问题 I have been working on a Minecraft server wrapper for the past week. I was looking forward to making a windows 10 universal app, but in my learning and testing I discovered that System.Diagnostics.Process is not supported in windows 8 store apps. When trying to add the code to my Win 10 dev machine in a 10 project I am being told that it cant be resolved. Is there going to be a way to launch an external process and capture the output into a textbox with Win10 Universal apps or am I out of

How can I overwrite a file in UWP?

我怕爱的太早我们不能终老 提交于 2019-12-10 18:02:24
问题 I tried to overwrite a current file in UWP using FileSavePicker. I refered to this: https://msdn.microsoft.com/zh-cn/windows/uwp/files/quickstart-reading-and-writing-files But when I use a shorter file to overwrite a longer file, there comes a problem: the extra part of the old file(longer) isn't deleted, like this: The old file: abcdefg And the file I want to save: hij But after saving operations, I get this: hijdefg My code is here: private async void Save_Click(object sender,