uwp-xaml

Zoom content to fit in a UWP WebView

陌路散爱 提交于 2019-12-05 07:22:40
I am trying to implement a zoom to content fit function in a XAML-WebView control inside a UWP app. As the semi-official solution for zooming seems to be using JavaScript, my approach was to dynamically set the zoom CSS-property of the body element. Now the question is to find the right zoom factor. According to the documentation, the WebView uses the Edge browser in document mode. However, in Edge, I found that the document.body.clientWidth -property always returns the document width, regardless of the window size and even the zoom factor. Thus, I set the zoom factor using document.body.style

How to add icons to SecondaryCommands in Command Bar

徘徊边缘 提交于 2019-12-04 21:47:21
I am trying to build a CommandBar that looks like this: Desired CommandBar with SecondaryCommands that have icons But I can't find a way to edit the default style of CommandOverflowPresenter in order to show SecondaryCommands like they are shown in Mail Windows 10 universal app, with icons on the left and text labels on the right. The CommandOverflowPresenter doesn't have a Content property to build a control template around it and bind content elements to AppBarButton Icon and Label properties. I found this article , but it doesn't show the Style for the AppBarButton. There was another

C# user interface updates are not deterministic

冷暖自知 提交于 2019-12-04 20:24:38
UWP application, C#, Visual Studio 2017, Windows 10 Creators Update (10.0; Build 15063). Let's call TextBlock1 as T1, TextBlock2 as T2... Desired output is: T1 shows "Work started." T2 shows "Step 1" T2 shows "Step 2" T2 shows "" T1 shows "Work Finished." private async void Btn_Click(object sender, RoutedEventArgs e) { TextBlock1.Text = "Work started."; await DoWork(); TextBlock1.Text = "Work done."; } private async Task DoWork() { TextBlock2.Text = "Step 1"; await Task.Delay(1); //Pretend to do something TextBlock2.Text = "Step 2"; await Task.Delay(1); //Pretend to do something TextBlock2

Why does this ScrollViewer's ScrollBars appear twice?

僤鯓⒐⒋嵵緔 提交于 2019-12-04 19:03:09
I edited a ScrollViewer 's template to wait only 0.5 seconds before hiding the scrollbars, and this succeeds in hiding them at that time, but they reappear for another 0.5 seconds. Why? To reproduce, create a page resource for a ScrollViewer's Style with the default Template ( find it here on MSDN ) and change the 3 occurances of "3" to "0.5". Then use the following XAML: <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> <ScrollViewer Height="500" Width="500" Style="{StaticResource ScrollViewerControlTemplate1}"> <Grid Background="Blue" Height="1000" Width="1000"> </Grid>

Xamarin Form - How To checked the checkbox on another check box checked in UWP

若如初见. 提交于 2019-12-04 18:30:17
My application displays the fetures permissions on DataGrid from database. For realizing this I am using the MyToolkit.Controls.DataGrid . Now i want output for if user checked the admin or update/delete/create check box then View and list check box checked vice versa same for the and also i want to set checkbox checked value from database. thanks in advance. Image if user checked the create/update/delete then same row list and view should be checkbox checked if user checked the view check box then selected row column list should be checked Datagrid xaml <Toolkit:DataGrid.Columns > <!--Feature

UWP: How to catch the click of a listview part from another listview in the viewmodel instead of code-behind?

时光毁灭记忆、已成空白 提交于 2019-12-04 18:10:01
I have this listview: <Page x:Class="DataBase.ControlsPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" DataContext="{Binding CustomersViewModel, Source={StaticResource ViewModelLocator}}"> <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> <ListView Name="HeaderList" ItemsSource="{Binding Customers}"> <ListView.ItemTemplate> <DataTemplate> <Grid> <Border Background="Bisque"> <TextBlock Text="{Binding Name"/> </Border> <ListView Name="SubItemsList" ItemsSource="{Binding Project}" ItemClick=

Keep ListView.HeaderTemplate visible/static/sticky in UWP

℡╲_俬逩灬. 提交于 2019-12-04 12:19:01
问题 I need to keep the HeaderTemplate of a ListView visible at all times, but I don't know what to set, or what part of the ListView 's template to change to do that. What I currently have causes the header of the ListView to scroll off the top when scrolling down through items. How can I keep the header "row" of the ListView visible even when scrolling through the ListView 's items?? Here's my XAML: <ListView x:Name="permitResults" Grid.Row="1" AutomationProperties.AutomationId="PermitResults"

Universal Windows (UWP) Range Slider

此生再无相见时 提交于 2019-12-04 11:38:09
I want to create range slider in UWP . I didn't find any example. There are only single sliders but I want it like . Does anybody know how can i do it? Please help me. To create a range slider in UWP, we can create a custom control or use UserControl . Here I use UserControl for example: Firstly, I add a UserControl named "MyRangeSlider" in my project. In the XAML: <UserControl x:Class="UWP.MyRangeSlider" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns

Can't bind CalendarDatePicker to a model in Xaml UWP

只愿长相守 提交于 2019-12-04 06:46:19
问题 I have model class in shared PCL (for android and uwp app) that contain datetime property: public class Meter { public int meter_value {get; set; } public DateTime meter_start { get; set; } public DateTime meter_end { get; set; } ... other int and string properties } In MainPage.cs i have public Meter _meter; public MainPage() { this.InitializeComponent(); _meter = new Meter(); } I'm trying to bind this to a xaml controls with following code: <TextBox Text="{x:Bind _meter.meter_value, Mode

UWP Button Changes Colors when Mouse hovers over

三世轮回 提交于 2019-12-04 02:51:20
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 SolidColorBrush(Windows.UI.Color.FromArgb(255, 0, 0, 255)); } private void button_PointerExited_1(object