xaml

How to remove top bar from Xamarin.Forms (iOS)?

岁酱吖の 提交于 2020-05-14 03:54:10
问题 How can I remove the top bar from iOS project of Xamarin.Forms? Where the time and "Carrier" word are .. or at least measure its height? Just to be sure.. I don't want to see battery, time... I want to hide the bar in the red rectangle: 回答1: You can add this code on your AppDelegate.cs inside FinishedLaunching method after LoadApplication (new App ()); on iOS Project: UIApplication.SharedApplication.StatusBarHidden = true; also add this on your info.plist : <key

Gray main window when open modal dialog in WPF

落花浮王杯 提交于 2020-05-13 08:54:45
问题 When a modal dialog is opened from the main window, I want overlay the main window with gray color. Is there a standard solution in WPF to simulate this effect? Here one example: 回答1: There is no built in functionality for this but it should be easy to implement. In your main window you need a Grid at the top level that has no defined columns or rows, so it is just a single cell that takes up all the client area. The first child of the Grid is a UserControl that implements all the normal

How to specify XAML value (e.g. converter parameter) culture

雨燕双飞 提交于 2020-05-13 06:16:06
问题 When we use static double values in XAML, how can we specify in which format they are provided? Example: <Rectangle> <Rectangle.Opacity> <Binding Path="IsDimmed" Converter="{StaticResource boolToDoubleConverter}" ConverterParameter="0.8"/> </Rectangle.Opacity> </Rectangle> with the converter method public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { return double.Parse((string)parameter, culture); } The problem is that on a

How can I make a specific TabItem gain focus on a TabControl without click event?

允我心安 提交于 2020-05-12 11:23:48
问题 How can I tell my TabControl to set the focus to its first TabItem, something like this: PSEUDO-CODE: ((TabItem)(MainTabControl.Children[0])).SetFocus(); 回答1: How about this? MainTabControl.SelectedIndex = 0; 回答2: this.tabControl1.SelectedTab = this.tabControl1.TabPages["tSummary"]; I've found it's usually a best practice to name your tabs and access it via the name so that if/when other people (or you) add to or subtact tabs as part of updating, you don't have to go through your code and

How can I make a specific TabItem gain focus on a TabControl without click event?

给你一囗甜甜゛ 提交于 2020-05-12 11:23:07
问题 How can I tell my TabControl to set the focus to its first TabItem, something like this: PSEUDO-CODE: ((TabItem)(MainTabControl.Children[0])).SetFocus(); 回答1: How about this? MainTabControl.SelectedIndex = 0; 回答2: this.tabControl1.SelectedTab = this.tabControl1.TabPages["tSummary"]; I've found it's usually a best practice to name your tabs and access it via the name so that if/when other people (or you) add to or subtact tabs as part of updating, you don't have to go through your code and

Constants in xaml

血红的双手。 提交于 2020-05-11 04:03:27
问题 Let's say I have a class defined something like the below: namespace MyProject.MyConstants { public class Constants { public class Group1Constants { public const string DoIt= "DoIt"; } } } I am trying to use this const, from a separate project, in my xaml. I included the namespace: xmlns:constants="clr-namespace:MyProject.MyConstants;assembly=MyProject.MyConstants" and am trying to use the constant as follows: <MenuItem Header="{x:Static controls:Constants.Group1Constants.DoIt}"> The above

How can I get the Text from a Label inside a ListView?

允我心安 提交于 2020-05-09 09:59:21
问题 I'm using Xamarin.forms in visual studio. The problem that I have is that I don't know how to get the Text that is shown on a Label inside a List view in the xaml file, because I want to use that text to make some changes to another list in the xaml.cs file. <?xml version="1.0" encoding="UTF-8"?> <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="Saansa.Views.CarritoDeVentas"> <ContentPage.Content> <StackLayout

WindowChrome - Can't click buttons in titlebar

女生的网名这么多〃 提交于 2020-05-08 16:02:08
问题 I have a custom WindowChrome style for my WPF app (ripped from here: http://www.bdevuyst.com/wpf-custom-title-bar-and-taskbar/). Code here: <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"> <!-- Simple style without anything to remove the title bar --> <Style x:Key="Style.Window.WindowStyleNoneWithTaskbar.Base" TargetType="{x:Type

Textbox binding update in WPF [duplicate]

左心房为你撑大大i 提交于 2020-05-07 09:55:19
问题 This question already has answers here : TextBox and default Button binding does update too late (3 answers) Closed 2 years ago . MessageText property gets updated only when I hit another control. What is more if I press any button it's Click handler isn't executed and the MessageText set is executed instead. I've broken my head. <TextBox x:Name="messageText" Grid.Row="1" Grid.Column="0" TextWrapping="Wrap" Text="{Binding Path=MessageText, Mode=TwoWay}"/> private void ChatView_Loaded(object

Where is the IsEmpty reference/member in this XAML code?

孤街浪徒 提交于 2020-05-06 19:54:13
问题 I cannot understand where the IsEmpty comes from in this snippet of code ( Path=Text.IsEmpty ) (about a watermark TextBox): <Grid Grid.Row="0" Background="{StaticResource brushWatermarkBackground}" Style="{StaticResource EntryFieldStyle}" > <TextBlock Margin="5,2" Text="Type to search ..." Foreground="Gray" Visibility="{Binding ElementName=entry, Path=Text.IsEmpty, Converter={StaticResource BooleanToVisibilityConverter}}"/> <TextBox Name="entry" Background="Transparent"/> </Grid> You can see