uwp-xaml

how to change the font size of all text box within a grid, windows app uwp

允我心安 提交于 2019-12-06 07:34:15
I know how to develop webpages with HTML and CSS, but I am new to the windows app development and I am trying to develop an universal windows platform (UWP) application. Lets say I have grid, <Grid Name="Grid1"> <VisualStateManager.VisualStateGroups> <VisualStateGroup> <VisualState x:Name="Normal"> <VisualState.StateTriggers> <AdaptiveTrigger MinWindowWidth="600" /> </VisualState.StateTriggers> <VisualState.Setters> <Setter Target="text1.FontSize" Value="12" /> <Setter Target="text2.FontSize" Value="12" /> <Setter Target="text3.FontSize" Value="10" /> </VisualState.Setters> </VisualState> <

How to set the window's size in a Universal app?

倖福魔咒の 提交于 2019-12-06 06:43:13
I use C# and XAML, and my main page begins like this : <Page x:Class="MyApp.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:MyApp" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" Height="754" Width="1018" MaxHeight="754" MaxWidth="1018" MinHeight="754" MinWidth="1018" mc:Ignorable="d"> <Grid> (...) </Grid> But the windows is always maximized when I start the app. Only the grid respects the size mentionned in

NavigationView and additional settings button

十年热恋 提交于 2019-12-06 06:33:00
问题 I would like to add new item right before settings item (button) in NavigationView (https://docs.microsoft.com/en-us/windows/uwp/design/controls-and-patterns/navigationview). I have no idea how to add such functionality I've tried to modify style of control but after adding button is style i had no behavior as expected. There was no navigation for that element. What I want to achieve: 回答1: You can use PaneFooter to place additional content to above the Settings button: <NavigationView>

c# UWP autoscrolling text

萝らか妹 提交于 2019-12-06 04:47:32
问题 I'm currently building an application for raspberry Pi (windows IoT) which accepts UDP messages and shows them on the screen. I need a way to make the text horizontally scroll over the screen automatically. I can't let the user click a button because there are no input devices connected to the Pi. So far I've been toying around with a scrollviewer and adjusting it's HorizontalAlignment value manually, but with no avail (I'm kinda new to the whole UWP/XAML stuff). Can anyone show me some code

set focus to a textBox in uwp [duplicate]

笑着哭i 提交于 2019-12-06 04:16:10
This question already has answers here : Uwp navigation example and focusing on control (2 answers) Closed 2 years ago . I have a Universal Windows Platform project that has a textBox element. I'd like to set the focus to it when a Radio Button is clicked. In the Radio Button click event, I can say: txtBoxID.IsEnabled = true; txtBoxID.Text = ""; But how do I set the focus? I saw some answers saying to use: FocusManager.SetFocusedElement( but my FocusManager class doesn't have that method. edit: Solved, thanks. Just needed to know what argument to pass to SetFocus. The other fellow's question

No installed components were detected. Cannot resolve TargetName HighContrastBorder - UWP Windows 10

帅比萌擦擦* 提交于 2019-12-06 03:02:27
问题 My CommandBar has its IsOpen property set to true in XAML and therefore the is text for each button is visible as I want the descriptions to remain visible. When I click on ellipses button, it hides the text and the second time I click on it, I get the following error: No installed components were detected. Cannot resolve TargetName HighContrastBorder . There is something awkward going on with the UI and maybe it's related to this but I can't figure out what or why: As you can see my buttons'

How to change Color define in Xaml Resources in code (UWP)

故事扮演 提交于 2019-12-05 23:41:14
[UWP] I have many grids with color binding from App.xaml MainPage.xaml ... <Grid Height="45" Margin="0,0,0,10" Background="{ThemeResource MyColor}"> App.xaml <Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" RequestedTheme="Dark"> <Application.Resources> <ResourceDictionary> <SolidColorBrush x:Key="MyColor">#FFFFFF</SolidColorBrush> Then I want to change all of its, in code like this Application.Current.Resources["MyColor"] = new SolidColorBrush(Windows.UI.Color.FromArgb(255, 242, 101, 34)); But it not work.

Does ApiInformation not respect the app target version

三世轮回 提交于 2019-12-05 23:39:12
Imagine the following setup: UWP Library: MinVersion: 10240 TargetVersion: 16299 This library checks at runtime if the UniversalApiContract Version 5 is present. If yes, it will use the new NavigationView control that. UWP App: MinVersion: 10240 TargetVersion: 10240 This app references the UWP Library project. When I run this app on my Computer, which has Windows 10 Version 16299 installed, the following happens: The UWP Library checks at runtime for the api contract. As I have the newest version of Windows 10, yes it is present. Then it tries to create the NavigationView control, and I get a

UWP Button Changes Colors when Mouse hovers over

。_饼干妹妹 提交于 2019-12-05 19:19:05
问题 I am trying to create a UWP button which will change background color when the mouse pointer hovers over it. The trouble I am having is that by default, it seems to already do this, but not to the color I want. When I hover over my button, which is red, it turns to the default grey and then back when I mouse out. I wrote code in C# to attempt to make it turn blue when I hover over it private void button_PointerEntered_1(object sender, PointerRoutedEventArgs e) { button.Background = new

What is the 'right' way to resize a SymbolIcon?

时光总嘲笑我的痴心妄想 提交于 2019-12-05 10:41:23
I want to be able to define a style and set the style on the icon (or on the button that holds the icon). Setting the button h/w doesn't enlarge the symbol and adding a Viewbox works, but I can't figure out how to set that from a style. <Button x:Name="ZoomInButton" Style="{ThemeResource HeaderButtonStyle}" Grid.Column="1" Grid.Row="0" Click="ZoomInButton_Click"> <SymbolIcon Symbol="ZoomIn" /> </Button> Any help very much appreciated! Seems so easy, but I'm stumped! In UWP apps, the standard glyphs are provided by the Segoe MDL2 Assets font, you can directly use a TextBlock with FontFamily=