windows-store-apps

Returning a value from Dispatcher.RunAsync() to background thread

北慕城南 提交于 2020-01-13 13:32:17
问题 I'm using Dispatcher.RunAsync() to show a MessageDialog from a background thread. But I'm having trouble figuring out how to get a result returned. My code: bool response = false; await dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async () => { DebugWriteln("Showing confirmation dialog: '" + s + "'."); MessageDialog dialog = new MessageDialog(s); dialog.Commands.Add(new UICommand(GetLanguageString("Util_DialogButtonYes"), new UICommandInvokedHandler((command) => {

How to copy a folder in a Windows Store App

好久不见. 提交于 2020-01-13 13:06:52
问题 How do you copy a folder and its contents in Windows Store Apps? I'm writing tests for a Windows Store App. The app does things with files, so a set of known files is needed. Ideally, any developer could run these tests without requiring that they do some manual setup. I assume that means test files would be checked into source control and then copied to the LocalState folder where tests could consume them (copy during ClassInitialize test phase). StorageFile has copy functions. It would be

How to print Formatted Page which contain ListBox or GridView

别等时光非礼了梦想. 提交于 2020-01-13 03:44:25
问题 Printing Document using WinRT : 1) To Keep tracking if there are more data Or text data to print in a formatted page. This can be done using RichTextBlock and RichTextBlockOverflow like below: <RichTextBlock Foreground="Black" x:Name="textContent" FontSize="18" Grid.Row="1" Grid.ColumnSpan="2" OverflowContentTarget="{Binding ElementName=firstLinkedContainer}" IsTextSelectionEnabled="True" TextAlignment="Left" FontFamily="Segoe UI" VerticalAlignment="Top" HorizontalAlignment="Left"> <

“Permission Denied” trying to run Python on Windows 10

泪湿孤枕 提交于 2020-01-12 11:22:18
问题 Seems as though an update on Windows 10 overnight broke Python. Just trying to run python --version returned a "Permission Denied" error. None of the three updates; KB4507453, KB4506991, or KB4509096 look like they'd be the culprit but the timing of the issue is suspicious. Rather than messing with rolling back, I'm hoping there's a simpler fix that I'm missing. The permissions on python are "-rwxr-xr-x" and I haven't changed anything besides letting the Windows update reboot machine after

UWP Manifest issue / restricted capability / inputForegroundObservation

人走茶凉 提交于 2020-01-11 13:19:27
问题 I'm trying to follow this StackOverflow article, referring to this similar article on StackOverflow, and this from the UWP Windows Dev Center. In my manifest XML, the <Package> tag was updated to include xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" and also IgnorableNamespaces="uap mp wincap rescap" . My <Capabilities> section looks like this: <Capabilities> <Capability Name="internetClient" /> <rescap:Capability Name=

How do I read a binary file in a Windows Store app?

允我心安 提交于 2020-01-11 09:08:09
问题 How can I read a binary file in a Windows Store app, or more specifically how can I create my Stream, when the System.IO namespace contains no File class? The documentation examples for BinaryReader unhelpfully use File! 回答1: You always access files in Windows Store apps using StorageFile class: StorageFile file = await ApplicationData.Current.LocalFolder.GetFileAsync(filename); You can then get the binary contents of the file using the WinRT APIs: IBuffer buffer = await FileIO

Error: Registration of the app failed

点点圈 提交于 2020-01-11 08:15:11
问题 While trying to deploy an app from Visual Studio, I'm getting an error. I have already set developer mode and also deleted the app package from the packages folder, but it still won't work. Here's the error message: Error : DEP0700 : Registration of the app failed. Deployment Register operation with target volume C: on Package App_1.0.0.2_x64__m0fsgersa29a0 from: (AppxManifest.xml) failed with error 0x80070002. See http://go.microsoft.com/fwlink/?LinkId=235160 for help diagnosing app

Creating Windows Store App Pages Without XAML

戏子无情 提交于 2020-01-11 05:09:04
问题 I am writing a C#/XAML Windows Store app and would like to create and navigate to and display a Page entirely from C#. Is this possible? Obviously I can inherit from Page, but, when attempting to Navigate to a derived Page that has no XAML, I get a System.TypeLoadException... "Could not find Windows Runtime type 'Windows.Foundation'". My thought was this should be possible since XAML translates into a CLR partial class definition, so there's no reason one couldn't do everything in C#. But

Creating Windows Store App Pages Without XAML

a 夏天 提交于 2020-01-11 05:09:03
问题 I am writing a C#/XAML Windows Store app and would like to create and navigate to and display a Page entirely from C#. Is this possible? Obviously I can inherit from Page, but, when attempting to Navigate to a derived Page that has no XAML, I get a System.TypeLoadException... "Could not find Windows Runtime type 'Windows.Foundation'". My thought was this should be possible since XAML translates into a CLR partial class definition, so there's no reason one couldn't do everything in C#. But

Programmatically check Windows Store App update

☆樱花仙子☆ 提交于 2020-01-11 02:08:12
问题 I'm actually trying to find a way to check if an update is available for a Windows Store App. Is there a way to do this with an API ? thanks ! Essam 回答1: Windows store doesn't have any API specifically to check for an update. There is a fairly easy work around. var package = Windows.ApplicationModel.Package.Current; PackageVersion t = package.Id.Version; This will get you the package version the user is running. You can use this to check one of your servers for the current version. You don't