uwp-xaml

Change VisualState through Dependency Property (UWP)

∥☆過路亽.° 提交于 2020-05-17 07:09:05
问题 I have a textbox inside a UserControl, I want to have two extra states for that textbox, Valid and Invalid. My code looks like this <UserControl.Resources> <Style TargetType="TextBox" x:Key="ExtendeTextBoxStyle"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="TextBox"> <Grid> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="ValidationState"> <VisualState x:Name="InvalidState"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetName=

StrokeDashArray not working with VisualStateManager (UWP)

流过昼夜 提交于 2020-05-17 06:12:14
问题 I want to have a dotted margin for Textbox if it is in Disabled state, My code looks like this <Page.Resources> <SolidColorBrush x:Key="TextBoxBackgroundThemeBrush" Color="#FFFFFFFF" /> <SolidColorBrush x:Key="TextBoxBorderThemeBrush" Color="#FFFFFFFF" /> <SolidColorBrush x:Key="TextBoxForegroundThemeBrush" Color="#FF000000" /> <SolidColorBrush x:Key="TextBoxForegroundHeaderThemeBrush" Color="#FFFFFFFF" /> <SolidColorBrush x:Key="TextBoxPlaceholderTextThemeBrush" Color="#AB000000" />

StrokeDashArray not working with VisualStateManager (UWP)

拈花ヽ惹草 提交于 2020-05-17 06:12:05
问题 I want to have a dotted margin for Textbox if it is in Disabled state, My code looks like this <Page.Resources> <SolidColorBrush x:Key="TextBoxBackgroundThemeBrush" Color="#FFFFFFFF" /> <SolidColorBrush x:Key="TextBoxBorderThemeBrush" Color="#FFFFFFFF" /> <SolidColorBrush x:Key="TextBoxForegroundThemeBrush" Color="#FF000000" /> <SolidColorBrush x:Key="TextBoxForegroundHeaderThemeBrush" Color="#FFFFFFFF" /> <SolidColorBrush x:Key="TextBoxPlaceholderTextThemeBrush" Color="#AB000000" />

UWP TreeView - Update of data behind a binding makes the Expandable icon to disappear

北慕城南 提交于 2020-04-30 15:59:31
问题 With a TreeView I have a Patient structure: private ObservableCollection<MTreeViewPaz> _Patients; public ObservableCollection<MTreeViewPaz> Patients { get { return _Patients; } private set { Set(ref _Patients, value); } } and a treeView bound to it: <winui:TreeView x:Name="treeView" Grid.Row="1" Expanding="treeView_Expanding" ItemInvoked="OnItemInvoked" ItemTemplate="{StaticResource ItemTemplate}" ItemsSource="{x:Bind Patients, Mode=OneWay}" SelectionMode="Single" /> with Item Template:

Pivot XAML Control - Changing the Style (Border)

旧街凉风 提交于 2020-04-30 10:19:27
问题 Pivot Control Black Box The goal is to change the color of the black border around my Pivot control. I created a copy of the template for the pivot control so I can modify the style. It isn't obvious how to modify the style to change the color of the this black brush. Added Border Brush - I looked at BorderBrush but it doesn't really feel like change? Where and how - to best achieve the changing of a border color? The red dotted boxes are not changing the color. 回答1: The black border in your

How to have Glyps overlapped in different size

ぐ巨炮叔叔 提交于 2020-04-30 08:46:22
问题 Thanks to the help I was able to have 2 glyps in an AppBar Button. I would like to make the second one smaller (half of the first one) and be overlapping in the bottom left corner... but I do not want to use absolute numbers to keep the UI responsive <AppBarToggleButton Label="" > <AppBarToggleButton.Content> <Grid> <FontIcon FontFamily="Segoe MDL2 Assets" Glyph="" /> <FontIcon FontFamily="Segoe MDL2 Assets" Glyph="" /> </Grid> </AppBarToggleButton.Content> </AppBarToggleButton> How can I

UWP TreeView UI Deadlock - loading time from less than 1 sec to more than 10 sec - first run against new run

有些话、适合烂在心里 提交于 2020-04-30 07:14:52
问题 I have a major performance issue on a TreeView both in terms of loading time as well as a deadlock of the UI. private async Task LoadTreeAsync() { List<VPazVisit> aList = new List<VPazVisit>(); if (_sorting == "") { _sorting = await ApplicationData.Current.LocalSettings.ReadAsync<string>("TreeViewSort"); } treeView.Visibility = Visibility.Collapsed; Patients.Clear(); switch (_sorting) { default: case "DescDate": aList = await Task.Run(() => App.gDataContext.Cache.VPazVisit .OrderByDescending

uwp xaml declaratively defining control that has focus by default

独自空忆成欢 提交于 2020-04-30 06:37:09
问题 I've been able to set focus on my view's Close button using the following code in the MainPage.xaml.cs OnNavigatedTo() event handler. this.close.Focus(FocusState.Programmatic);` // or Windows.UI.Xaml.Input.FocusManager.TryFocusAsync(this.Close, FocusState.Programmatic);` I'd prefer a way to declaratively set this in the xaml markup. Is there a way to do that? I've tried following samples provided in SO post hits on this subject showing approaches llike the following using FocussedElement,

C++ WinRT UWP XAML Data binding ItemsSource and SelectedIndex to IObservableVector<hstring> does not work

放肆的年华 提交于 2020-02-24 20:28:13
问题 I am using Visual Studio 2019 16.4.3, Microsoft.Windows.CppWinRT 2.0.200117.5, Windows 10 1809 Pro and targeting 10.0.17763.0. I am trying to port a C++/CX app to C++ WinRT. I am using data binding of the ItemsSource , SelectedIndex and SelectedItem properties of a combo box but I am running into issues. For the ItemsSource I am binding to a IObservableVector<String> . The property is implemented using IObservableVector<hstring> and initialized with single_threaded_observable_vector(std:

C++ WinRT UWP XAML Data binding ItemsSource and SelectedIndex to IObservableVector<hstring> does not work

别来无恙 提交于 2020-02-24 20:26:03
问题 I am using Visual Studio 2019 16.4.3, Microsoft.Windows.CppWinRT 2.0.200117.5, Windows 10 1809 Pro and targeting 10.0.17763.0. I am trying to port a C++/CX app to C++ WinRT. I am using data binding of the ItemsSource , SelectedIndex and SelectedItem properties of a combo box but I am running into issues. For the ItemsSource I am binding to a IObservableVector<String> . The property is implemented using IObservableVector<hstring> and initialized with single_threaded_observable_vector(std: