uwp

UWP image scaling with Xamarin Forms

只愿长相守 提交于 2019-12-13 03:04:37
问题 I am creating a iOS, Android, UWP app with Xamarin Forms. I am well versed in how the iOS and Android platforms handle image scaling (1x, 2x, 3x, etc). However, I am not so familiar with UWP. In UWP you can have different image sizes to handle different scaled screen sizes. Here are 3 different sized versions of the same image. So my questions Is the 100 scale size is the image used when the Windows user has chosen no scaling of the screen (100%)? Are the 200 and 400 scale sizes for when the

“The debugger was unable to find the registration for the target application.”

强颜欢笑 提交于 2019-12-13 03:01:20
问题 I have a UWP app (from a Xamarin.Forms app) which debugs fine on the computer. But when I try to debug on a phone, I get the following error: Unable to debug Windows Store app '....exe'. The debugger was unable to find the registration for the target application. If the problem persists, try uninstalling and then reinstalling this application. The app does get installed on the phone and can be executed there. But I can't debug it with Visual Studio. Meanwhile, the error I see in the error

c# UWP store-app how to save file that will not be deleted after app uninstall

与世无争的帅哥 提交于 2019-12-13 02:57:39
问题 I noticed that file saved into ApplicationData.Current.LocalFolder.CreateFileAsync folder is removed after application uninstall. Is that possible to save file that will remain in user profiler after application uninstall , so when user re-install application I can read settings from file for this user ? 回答1: Only these two ways are possible: Ask your user to pick a file or a folder using FilePicker or FolderPicker and then track them in your MostRecentlyUsedList . Then you'll get the

Add polygon/ellipse to inkcanvas in uwp

邮差的信 提交于 2019-12-13 02:57:38
问题 I'm using Windows-universal-samples-master\Samples\InkAnalysis\InkAnalysis.sln of Microsoft's open source project. It can analysis the shape you draw, and convert to polygon or ellipse. <Grid <Canvas x:Name="canvas"/> <InkCanvas x:Name="inkCanvas"/> </Grid> All the converted shapes are drawn to "canvas", not "inkCanvas", so they can not be saved as ink. How to add the shapes to "inkCanvas"? 回答1: We can use InkStrokeContainer.AddStroke to add to an InkStroke object to the collection managed by

Accessing UI thread from Windows Runtime Component throws exception only on Mobile

[亡魂溺海] 提交于 2019-12-13 02:56:43
问题 I have the following problem. I am using a simple Windows Runtime Component to communicate between the application and a WebView . I am doing this according to documentation This is the code for the Windows Runtime Component public delegate void NotifyAppHandler( string str ); [AllowForWeb] public sealed class WebViewInjectionObject { public event NotifyAppHandler OnNotifyApp; public void NotifyApp( string str ) { OnNotifyApp?.Invoke( str ); } } In the OnNavigatedTo method I initialize the

Convert unix timestamp to normal date (UWP)

戏子无情 提交于 2019-12-13 02:55:50
问题 I have UWP app where I get my json , write list and Binf to View Here is code of View Model: public class TopPostsViewModel : INotifyPropertyChanged { private List<Child> postsList; public List<Child> PostsList { get { return postsList; } set { postsList = value; OnPropertyChanged(); } } public TopPostsViewModel() { Posts_download(); } public async void Posts_download() { string url = "https://www.reddit.com/top/.json?count=50"; var json = await FetchAsync(url); RootObject rootObjectData =

How to get current AppInfo in UWP environment

▼魔方 西西 提交于 2019-12-13 02:55:39
问题 How can I get the current AppInfo of the running UWP application? I could not find any accessible constructor or static function to get this information. 回答1: Make sure that your device is updated to Windows10 Creators Update version. Firstly, you should add Capability appDiagnostics to Package.appxmanifest. Directly to modify the code of the file. <Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"

How to set MediaElement.Source from MediaStreamSource

▼魔方 西西 提交于 2019-12-13 02:55:31
问题 I am using MediaElement tool because MediaPlayerElement tool is unavailable in my vs17 community. I tying to build to this app but facing some error. How can I solve this? I just copied the code from the link given above and replaced mediaplayer with mediaelement. 回答1: The Source of MediaElement is Uri type, it Cannot implicitly convert type 'Windows.Media.Core.MediaSource' to 'System.Uri'. That's why you would get this error. To solve it, you could change your code like the following:

Error while accessing AvailableFreeSpace/TotalSize in DriveInfo in UWP

旧城冷巷雨未停 提交于 2019-12-13 02:51:25
问题 I am able to list the local disks using DriveInfo.GetDrives() method. also, I access/get the Drive name using Name property. But I get error as "System. UnauthorizedAccess Exception: 'Access to the path 'X:\' is denied." while accessing any properties like AvailableFreeSpace. Code below. DriveInfo[] allDrives = DriveInfo.GetDrives(); foreach (DriveInfo d in allDrives) { Debug.WriteLine("Drive: " + d.Name); //This line executes w/o error! Debug.WriteLine("Drive: " + d.AvailableFreeSpace);

ZipFile.CreateFromDirectory does not include directory entries

为君一笑 提交于 2019-12-13 02:48:17
问题 I have a basic Windows 10 UWP app and use the following code to create a .zip file from a directory structure: ZipFile.CreateFromDirectory("/inputpath", "/output.zip"); I noticed that the resulting .zip file does not have any entries for nested directories, thus unzipping on a Mac does not work. Here is the directory structure that I want to include in the zip file: ./ziproot ./Data Version.txt What I get using the API ZipFile.CreateFromDirectory(...) : $ zipinfo output.zip Archive: output