uwp

UWP / WinRT: Detect when a popup is about to be closed

拜拜、爱过 提交于 2019-12-11 23:04:15
问题 How can I detect when a popup is about to be closed? The Popup class does not have a Closing event in UWP, unlike in WPF where such an event exists. I need this in order to persist the state of the Popup because the layout can be modified by the user. 回答1: As you already know, there is no Closing event. You might get lucky by registering to IsOpen property change (if IsLightDismissEnabled property is set to true...) this.popup.RegisterPropertyChangedCallback(Popup.IsOpenProperty, (d, e) => {

windows 10 pivot item text

主宰稳场 提交于 2019-12-11 22:08:32
问题 I want to change the default text style (foreground color, font weight, etc) for pivot item header text when the header is selected. E.g., if I have the following: <Pivot> <PivotItem Header="One"></PivotItem> <PivotItem Header="Two"></PivotItem> </Pivot> I want the selected pivot item to be bolded when selected and/or change the foreground color (or maybe put the text in a border, etc). I don't want to change the default style for the unselected items. Thanx, 回答1: The XAML framework offers

Win10 App - Holding & Releasing the map to manipulate an element on the interface

落花浮王杯 提交于 2019-12-11 20:28:29
问题 I working on an UWP (Win10) App with a simple location picker function. The user can drag the map on the wanted location. A basic Pushpin thats always in the center of the Map window acts as the location indicator. It works just like the free location pick in WhatsApp. To give the user feedback that he is moving the center pin, I want to raise the pin when the user is moving the map and lower it again on release. Here the simple code to raise the pin (and manipulate the shadow): private void

How do I access Assembly Attributes in a Universal Windows App?

流过昼夜 提交于 2019-12-11 20:11:41
问题 I'm trying to get the values from some of my assembly's attributes, for example the various version attributes plus some custom attributes. When I try to access Assembly.GetExecutingAssembly() it's gone! System.Reflection.Assembly seems to have only one method, Load() . So how do I access my attribute values? 回答1: The only way I know in WinRT to retrieve the assembly is through the GetTypeInfo extension method. It's defined in the namespace System.Reflection : using System.Reflection; ...

Xamarin.Forms UWP app crashes in release mode

南楼画角 提交于 2019-12-11 18:42:19
问题 My UWP Xamarin.Forms works fine in Debug mode, but crashes in release. This is MenuPage.xaml.g.cs: Added I was able to get deeper, please see FreshPageModelResolver.ResolvePageModel() throws an exception in UWP Release What could be the cause of this? 回答1: It could have something to do with your linker options - for Release "Link Framework SDK's only" is often selected, while "Don't link" is selected for Debug. Try setting "Don't link" for your Release config and see if that is the issue - if

UWP - SignTool Error: No certificates were found that met all the given criteria

落花浮王杯 提交于 2019-12-11 18:25:11
问题 I'm getting this error after our company changed its AD domain. UWP app development with VS 2019 and Windows 10 (1903) C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio\v16.0\AppxPackage\Microsoft.AppXPackage.Targets(4469,5): error APPX1204: Failed to sign 'D:\AzureDevOps-Workspace\UWP\Main\BoardPACWinApp\bin\x64\Release\BoardPACWinApp_3.51.11.0_x64.appx'. SignTool Error: No certificates were found that met all the given criteria. 5>C:\Program Files

Build Cordova Apps using Windows 10 SDK - No Valid MSBuilD

血红的双手。 提交于 2019-12-11 18:23:07
问题 I have installed the Windows 10 SDK on my Windows 10 PC, but unfortunately I'm unable to build the cordova apps. It give error "Error: No valid MSBuild was detected for the selected target." I have google it but some are saying need to install MS Visual Studio, it really frustrating me because this MS Visual Studio is 9GB that so big in size. Is there anything that I can do with Windows 10 SDK or should I download the MS Visual Studio instead? 回答1: Visual Studio has a number of necessary

ML.NET: strange runtime error on some machines

你离开我真会死。 提交于 2019-12-11 18:17:42
问题 I wrote a simple UWP app using the ML.NET framework, and it worked on one of my machines without installing any Nuget packages, without any additional setup etc. However, on my other machine, after running the application, I get this error: System.Runtime.InteropServices.COMException: 'Unspecified error No suitable kernel definition found for op Sub (node Minus675)' The error happens in this segment of code: public static async Task<modelModel> CreateFromStreamAsync

Is there any known reasons my GUIs controls change after changing to target version 17314, from 15063?

北城余情 提交于 2019-12-11 18:06:46
问题 My application uses a pivot menu. The pivot menu items contain a user control which is a page, so you click on a pivot item, and it brings you to the detail page of that pivot, sort of like master/detail style. I want to upgrade my target version to the version 17134, but when I do this I get some strange behavior with the controls. The border within the pivot in 15063 version adjusts its size depending on the content. In 17134, its not adjusting it's size to the content. I've tried setting

Raise event when property is changed

浪子不回头ぞ 提交于 2019-12-11 18:06:38
问题 I need to raise an event when the value of the property is changed. In my case this is when webView.Source is changed. I can't make a derived class because the class is marked as sealed. Is there any way to raise an event ? Thank you. 回答1: Raise event when property is changed For this scenario, you could create a DependencyPropertyWatcher to detect DependencyProperty changed event. The follow is tool class that you could use directly. public class DependencyPropertyWatcher<T> :