xaml

XAML: Can I refer to a Grid row or column by name?

…衆ロ難τιáo~ 提交于 2020-05-25 08:30:01
问题 If I name each row and column in a grid, can I set a control's grid.row="Row_Top"? I have defined StaticResources to refer to it but is there a converter or some other method to accomplish this without the resource? 回答1: As far as I know there's no built-in way to do it... however, you could use markup extensions to retrieve a row or column by its name : [MarkupExtensionReturnType(typeof(int))] public abstract class GridBandExtensionBase : MarkupExtension { public override object ProvideValue

XAML bind to static method with parameters

眉间皱痕 提交于 2020-05-24 21:18:10
问题 I got a static class like the following: public static class Lang { public static string GetString(string name) { //CODE } } Now i want to access this static function within xaml as a binding. Is there such a way for example: <Label Content="{Binding Path="{x:static lang:Lang.GetString, Parameters={parameter1}}"/> Or is it necessary to create a ObjectDataProvider for each possible parameter? Hope someone is able to help me. Thanks in advance! 回答1: I get this need too. I "solved" using a

get search bar results to appear ontop of other content

给你一囗甜甜゛ 提交于 2020-05-24 05:03:26
问题 looking something similar to what is asked in this Q.... How to display ListView on top of (over the) other items in Xamarin Forms? been playing about with grids and stacklayouts and cant seem to get the listView of the searchBar to appear on top of the other list views (the other list views contains the products searched for) so the search bar listview results should appear over the buttons, and other lists <content> <StackLayout> <StackLayout> <SearchBar Placeholder="Search..." TextChanged=

DataGrid in Avalonia UI for Linux does not show up when app is running

﹥>﹥吖頭↗ 提交于 2020-05-17 08:46:19
问题 I'm running Avalonia UI on .NET Core for Linux (Fedora). I've followed this tutorial for the DataGrid, but honestly I've added the package with the following command, instead of manually updating the .csproj . dotnet add package Avalonia.Controls.DataGrid After a dotnet restore and a dotnet run , I can't see any DataGrid. Anyway xaml <StackPanel> <DataGrid AutoGenerateColumns="True" Items="{Binding People}"/> </StackPanel> and ViewModel look fine. public ObservableCollection<Person> People {

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=

Setting my partial View, not working xamarin

試著忘記壹切 提交于 2020-05-17 06:21:25
问题 Now I got started with Prism Framework for xamarine, but I'm having a little problem achieving connections across views. I have this folder "Views" and inside it I have another folder called PartialViews. Now inside PartialViews I have a contentPage called "Header.xaml". Now I would like to atach this file to the Index.xaml view, which is located in the Views folder. I would like to atach the "Header.xaml" to other views also, like for example I would like to atach it to the "Orders.xaml"

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" />

How to flash error text using WPF animation

好久不见. 提交于 2020-05-14 09:05:32
问题 I have textbox displayed using the DataTemplate. In the below code TextBoxViewModel is derived from IDataErrorInfo . protected String m_ValidationErrorMessage; protected String ValidationErrorMessage { get { return m_ValidationErrorMessage; } } private bool m_ShowErrorMessage = false; public bool ShowErrorMessage { get { return m_ShowErrorMessage; } set { this.m_ShowErrorMessage = value; } } private String m_DisplayValue; public String DisplayValue { get { return this.m_DisplayValue; } set {

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

佐手、 提交于 2020-05-14 03:54:33
问题 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