uwp

How can I debug XAML designer issues?

百般思念 提交于 2019-12-05 16:20:44
I'm developing a UWP app with Visual Studio 2015, and one of the things I want to do use some sample data at design time. Now, I've added a XAML file, set the build action as DesignDataWithDesignTimeCrateableTypes My XAML is really straight forward here: <local:Freead xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:MyNamespace.Uwp.Windows.ViewModels" xmlns:ad="clr-namespace:MyNamespace.Classifieds;assembly=LocalAngle.Uwp" ItemName="Java books" Description="Free to anyone that wants them. A

Single Row Horizontally Scrolling/Swipeable GridView

眉间皱痕 提交于 2019-12-05 15:33:16
I wanted a single-row GridView that can be scrolled horizontally both with mouse and touch swipe. The GridView is to present images through binding so that a single image will be selected from an array of images. Everything works fine (binding, image selection, etc.) except that the horizontal scroll doesn't work. The XAML code is shown below. What am I missing? <GridView x:Name="IconGridView" Grid.Row="0" Margin="8,12" DataContext="{x:Bind IconManagerObj}" DoubleTapped="{x:Bind IconGridView_DoubleTapped}" IsItemClickEnabled="True" IsSwipeEnabled="True" ItemsSource="{Binding Path=IconImageInfo

Detect if share UI is supported in current device (UWP)

余生长醉 提交于 2019-12-05 15:17:45
I have created a UWP app for windows 10 devices using c#/xaml. In the app, i have a share functionality that calls DataTransferManager.ShowShareUI() This works as expected on desktop, tablet and mobile devices. But on my xbox, the above method does not launch the share UI. Nor does it throw any exceptions. After searching online a bit, I found this article that says share contract is not supported on xbox. And no share UI is displayed. But this gives a bad user experience. So I have 2 options now Hide the share button, if the device is an xbox Or when user clicks on share, show a popup that

UWP - Get path to user download folder

房东的猫 提交于 2019-12-05 14:18:52
I have been looking for a little while now and am not finding much help via MSDN resources and others. My predicament is simple: my app needs a base directory to the Downloads folder. I am aware of the DownloadsFolder class however that is not suiting my needs currently. How do I get the current user's Download folder path in a Windows Universal App? Is that what you need? string localfolder = ApplicationData.Current.LocalFolder.Path; var array = localfolder.Split('\\'); var username = array[2]; string downloads = @"C:\Users\" + username + @"\Downloads"; This will result C:\Users\username

[UWP]用Win2D实现镂空文字

假如想象 提交于 2019-12-05 14:17:17
原文: [UWP]用Win2D实现镂空文字 1. 前言 之前用PointLight做了一个番茄钟,效果还不错,具体可见这篇文章: [UWP]使用PointLight并实现动画效果 后来试玩了Win2D,这次就用Win2D实现文字的镂空效果,配合PointLight做一个内敛不张扬的番茄钟。 实现镂空文字的核心思想是使用CanvasGeometry.CreateText从TextLayout获取一个Geometry,然后使用DrawGeometry将它画到DrawingSurface。这篇文章介绍了具体的实现步骤。 2. 参考例子 Win2D Gallery提供了大量Win2D的Sample,这次就参考了其中的文字镂空效果例子,地址和运行效果如下: https://github.com/microsoft/Win2D-Samples/blob/master/ExampleGallery/TextOutlines.xaml.cs 3. 实现步骤 Sample的代码量虽多,其实核心并不复杂,下面讲讲需要用到的API: 3.1 CanvasDevice.GetSharedDevice 因为要用到Win2D,所以首先要引用 Win2D.uwp nuget包。因为我的目标不是输出到CanvasControl上,而是想要输出到一个SpriteVisual上,所以使用 CanvasDevice :

UWP use skype to call number

柔情痞子 提交于 2019-12-05 12:51:27
I want my c# UWP App to support calling numbers. When I'm on W10 mobile I want it to use W10 PhoneCall API normal (this is working) Windows.ApplicationModel.Calls.PhoneCallManager.ShowPhoneCallUI(number, name); but on W10 Desktop/PC I won't have a GSM provider, so I thought, maybe use skype to call the number, the user pressed. Is that possible via UWP? Maybe similar like opening websites: await Windows.System.Launcher.LaunchUriAsync(new Uri(website)); Yes, it's possible and you're right about using Launch the default app for a URI to open Skype from your app. For the question what Uri can we

In-App purchase trouble on Windows 10 UWP

给你一囗甜甜゛ 提交于 2019-12-05 12:49:12
问题 I'm trying to enable an in-app purchase item on my app (already on Windows 10 store), but I always receive the same error message when trying to buy this item: This in-App Purchase item is no longer available in MyAppName The code is fairly simple and just what the docs recommend: var itemName = "app.advanced_items.full"; if (CurrentApp.LicenseInformation.ProductLicenses[itemName].IsActive) { return true; } var results = await CurrentApp.RequestProductPurchaseAsync(itemName); if (results

(Windows Phone 10) Is possible to edit, add new contact programmatically in windows phone 10?

▼魔方 西西 提交于 2019-12-05 12:40:35
I want to implement function edit and add contact programatically in windows phone 10. Is it possible? Has any sample about it ? gregkalapos Here is a code snippet for creating the contact: public async Task AddContact(String FirstName, String LastName) { var contact = new Windows.ApplicationModel.Contacts.Contact(); contact.FirstName = FirstName; contact.LastName = LastName; //Here you can set other properties... //Get he contact store for the app (so no lists from outlook and other stuff will be in the returned lists..) var contactstore = await Windows.ApplicationModel.Contacts

UWP - Load image in class library

末鹿安然 提交于 2019-12-05 12:37:37
I have a Universal Windows application that hosts a main menu. I want a plugin architecture, where the menu items are added from class libraries. But I can't seem to load images correctly. I can't get the ms-appx:/// working, and when I try to add the images as an embedded resource, it hangs: var assembly = typeof(CookModule).GetTypeInfo().Assembly; using (var imageStream = assembly.GetManifestResourceStream("My.Namespace.Folder.ImageName-100.png")) using (var raStream = imageStream.AsRandomAccessStream()) { var bitmap = new BitmapImage(); bitmap.SetSource(raStream); //<- Hangs here I get no

Universal Windows Platform app registration fails - blocked by AppLocker

牧云@^-^@ 提交于 2019-12-05 12:36:07
问题 Deploying a UWP app locally from Visual Studio 2015 (Update 3) fails with the error message: DEP0700 : Registration of the app failed. error 0xC000003A: Deployment of package 6dd81a71-9c3a-4204-abaf-886a9b0c29bb_1.0.0.0_x86__kcdnnw7pbsh48 was blocked by AppLocker. (0x80073cf9) The full output doesn't add further insight: Restoring NuGet packages... To prevent NuGet from restoring packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow