uwp

How to get the currency symbol for current user in UWP

柔情痞子 提交于 2019-12-12 03:55:27
问题 Microsoft recommends using Windows.Globalization rather than System.Globalization for UWP apps (Use global-ready formats). Under Windows.Globalization.NumberFormatting Namespace there is a CurrencyFormatter Class but I do not want to format a number as currency. I want to find how to get the currency symbol only. What is current best practice for returning the currency symbol for the current user in UWP? 回答1: You can use the NumberFormatInfo.CurrencySymbol property for that: string

c# uwp current finger holding coordinates on mobile

坚强是说给别人听的谎言 提交于 2019-12-12 03:53:59
问题 In C# UWP, how to get current finger holding coordinates on mobile? I have been using this: private void mainGridHolding(object sender, HoldingRoutedEventArgs e) { var coordinateY = e.GetPosition(mainGrid).Y; } But, I don't want to execute it all the time whenever user holding the screen. And also, this event fire after the popup is shown, so I get the wrong informations. Like there is a property for Pointer location: var pointerPosition = Windows.UI.Core.CoreWindow.GetForCurrentThread()

ItemControl background color

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-12 03:53:09
问题 In a fresh Universal Windows Platform app, I am trying to set the Background of an ItemsControl. But it doesn't seem to do anything. The only changes I've made to the VS template are in MainPage.xaml, which now looks like this: <Page x:Class="UWPPlayground.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:UWPPlayground" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http

Data Binding list to listbox C# XAML (Azure mobile services) UWP

允我心安 提交于 2019-12-12 03:49:02
问题 So I have an online database. And I want the query results to be displayed in a listbox. I tried to use data binding but I think I'm doing it totally wrong. Files [![enter image description here][1]][1] Table class ProductTable { public string id { get; set; } public string Name { get; set; } public string Title { get; set; } public string Description { get; set; } public double Price { get; set; } public string Type { get; set; } public string Seller { get; set; } public int Expiration { get

Where linked UWP tile?

拜拜、爱过 提交于 2019-12-12 03:48:05
问题 I know that Windows start menu's item is link file ever. In ProgramData\Microsoft\Windows\Start Menu linked file exist. But UWP tile app is not. Where is linked that app's executable file? Almost tile is Program Files\WindowsApps but not all. And I can't access this folder normally. Can I get this file info linked in program code like C++? Additionally Windows 8's Metro App also... 回答1: You may have desktop app dev experience, but link to the app using Shortcut pointed to a file is not the

UWP - Dynamically load different Styles.xaml

倖福魔咒の 提交于 2019-12-12 03:46:18
问题 Is it possible to dynamically load a different style ResourceDictionary at run time depending on a certain condition? I want to have a single build of my app but have different colours/branding depending on a specific setting. Assuming the above isn't possible would I best achieve this? 回答1: ResourceDictionary cannot be set dynamically at runtime as far as I remember - not on UWP. IMHO the only way is to change ColorBrushes or the whole styles. First option: If you need to change colors

Accessing a button created in a sub xaml page from it's parent Shell xaml

若如初见. 提交于 2019-12-12 03:46:05
问题 I'm working with a SplitView application, and I've created a Shell that hosts the subpages. What I'd like to do is have a button on a subpage that when clicked, can manipulate the visibility of objects originally initiated or created on the Shell xaml. But, I'm not sure how to call the class or frame necessary to change attributes on the SplitView. My hierarchy is as follows: Shell > Pages Folder > Sub Pages Here's the snippet from my Shell.xaml Mind you this is only a portion contained

Cannot convert string to DateTime in uwp

谁都会走 提交于 2019-12-12 03:45:23
问题 private string GetSystem() { StringBuilder results = new StringBuilder(); DateTimeFormatter[] basicFormatters = new[] { // Default date formatters new DateTimeFormatter("shortdate"), // Default time formatters new DateTimeFormatter("longtime"), }; DateTime dateandTime = DateTime.Now; foreach (DateTimeFormatter formatter in basicFormatters) { // Format and display date/time. results.Append(formatter.Format(dateandTime)); results.Append(" "); } return results.ToString(); } dateString =

How to change style depending on screen size?

◇◆丶佛笑我妖孽 提交于 2019-12-12 03:44:52
问题 I would like to change the orientation of a StackPanel depending on the screen size. I've been following this answer but haven't got things working yet. Here's what I've got so far: <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="SharedVisualStates"> <VisualState x:Name="DefaultLayout"> <VisualState.StateTriggers> <AdaptiveTrigger MinWindowWidth="720" /> </VisualState.StateTriggers> <VisualState.Setters> <Setter Target="GuidesList.Style" Value="{StaticResource

MapControl get tapped location UWP

最后都变了- 提交于 2019-12-12 03:44:27
问题 I have a MapControl in my app and I want to retrieve the coordinate of the point taped by the user. <Maps:MapControl Grid.Row="0" ColorScheme="Light" Margin="10" x:Name="mainMap" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Tapped="mainMap_Tapped" MapElementClick="mainMap_MapElementClick" /> But I don't know how to get this from the event private void mainMap_Tapped(object sender, TappedRoutedEventArgs e) 回答1: To get the tapped location in MapControl, we can use MapControl