xaml

Binding to attributes

狂风中的少年 提交于 2021-02-16 04:46:27
问题 I have class public class Car { [Description("name of the car")] public string Name { get; set; } [Description("age of the car")] public int Age { get; set; } } is there any possibility to bind Description attribute to Label content. The solution what I'm looking for shouldn't require to instantiate Class object. 回答1: It won't be a proper binding (which is not necessary for static data anyway) but you can easily create a MarkupExtension to retrieve it, just pass the type and the property name

When to use Xamarin bindings as opposed to passing objects to page constructors?

旧城冷巷雨未停 提交于 2021-02-15 07:51:24
问题 So I have a problem where I want to pass data around my application in what I thought would have been a very standard way, but I'm unable to find any samples or examples that are similar to what I want to do. For example, I have an application with the type person. public class Person { public string Name; public int Age; public Person(string name, int age) { Name = name; Age = age; } } I want to create a list of person cards, each displaying the person's information. Then, when the card is

Set CursorPosition in Editor Xamarin Forms

眉间皱痕 提交于 2021-02-11 18:21:48
问题 How can we set CursorPosition in Editor . We can set CursorPostion in Entry , but how to set it in Editor ? I know we can do it using Custom Renderer in Xamarin Forms, but how to implement it? 回答1: We cannot set CursorPosition in Editor as we set it in Entry . We need to use Custom Renderer . Using Custom Renderer makes most of the native functions and implementations possible in Xamarin Forms. To set Cursor Position in Editor in Xamarin Forms. This answer may be a bit lenghthier for

Set CursorPosition in Editor Xamarin Forms

余生长醉 提交于 2021-02-11 18:19:34
问题 How can we set CursorPosition in Editor . We can set CursorPostion in Entry , but how to set it in Editor ? I know we can do it using Custom Renderer in Xamarin Forms, but how to implement it? 回答1: We cannot set CursorPosition in Editor as we set it in Entry . We need to use Custom Renderer . Using Custom Renderer makes most of the native functions and implementations possible in Xamarin Forms. To set Cursor Position in Editor in Xamarin Forms. This answer may be a bit lenghthier for

Change element inside Template

£可爱£侵袭症+ 提交于 2021-02-11 16:11:40
问题 I want to reuse the the ItemsControl from my ListView and its not really hard to put the ItemsControle into an Template. The problem is, I want to change the DataTemplate when I use my ItemsControlTemplate. <ListView DataContext="{Binding Input}"> <ItemsControl ItemsSource="{Binding Columns}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <StackPanel Orientation="Horizontal"/> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> <ItemsControl.ItemTemplate> <DataTemplate> <Grid> <Grid

Xamarin Tabbed Page Content Other than Tab

我是研究僧i 提交于 2021-02-11 15:52:32
问题 Quick question, In Xamarin Forms, when using a Tabbed Page, is there any way for there to be content that remains static between the tabs (other than the tabbar itself)? For example, if I have a TabbedPage with 3 children (say Page1 , Page2 and Page3 ), can I add other children to TabbedPage that are not a part of the tab itself, but elsewhere, and stay there between tabs? My use for this is I have 3 tabs in my TabbedPage , which is are at the bottom of the page. I would like a settings

Xamarin Tabbed Page Content Other than Tab

岁酱吖の 提交于 2021-02-11 15:50:59
问题 Quick question, In Xamarin Forms, when using a Tabbed Page, is there any way for there to be content that remains static between the tabs (other than the tabbar itself)? For example, if I have a TabbedPage with 3 children (say Page1 , Page2 and Page3 ), can I add other children to TabbedPage that are not a part of the tab itself, but elsewhere, and stay there between tabs? My use for this is I have 3 tabs in my TabbedPage , which is are at the bottom of the page. I would like a settings

WPF MaterialDesignInXamlToolkit Dialog expand to full width

妖精的绣舞 提交于 2021-02-11 15:14:44
问题 I'm trying to get the dialog in DialogHost to be horizontally stretched as much as possible, without hardcoding the size of the control that I'm displaying. Tried the following: setting the UserControl.HorizontalAligment to Stretch setting HorizontalContentAligment to Stretch on DialogHost I noticed that if set the Width to something like 6000, the dialog fills the DialogHost with some nice padding, but the content overflows and things on the right side are not visible. Is there some standard

How to keep an area a constant/relative size while user expands/collapses treeview?

左心房为你撑大大i 提交于 2021-02-11 15:01:38
问题 I have a window that will be a variable size , currently it is 300 x 400 as shown below. In the top part I have an expandable tree view In the bottom part I have a long horizontal panel with a button in it. I want the top area (treeview) to be about 95% of the height, with the button tool area a constant 50 high. I want these proportions to stay constant as the user expands and collapses the tree view (and as it expands below the button toolbar, I want the viewscroller to pop in with a

How to keep an area a constant/relative size while user expands/collapses treeview?

微笑、不失礼 提交于 2021-02-11 14:58:42
问题 I have a window that will be a variable size , currently it is 300 x 400 as shown below. In the top part I have an expandable tree view In the bottom part I have a long horizontal panel with a button in it. I want the top area (treeview) to be about 95% of the height, with the button tool area a constant 50 high. I want these proportions to stay constant as the user expands and collapses the tree view (and as it expands below the button toolbar, I want the viewscroller to pop in with a