data-binding

Best practices for Xamarin.Mac MVVM pattern

六月ゝ 毕业季﹏ 提交于 2021-01-27 12:52:11
问题 I'm developing a WPF desktop application that I'd also like to run on Mac via Xamarin.Mac. I've taken great care to separate as much core code as possible into a PCL, and keep the WPF-specific code as thin as possible. The UI architecture is MVVM. All of my viewmodels, implementing INotifyPropertyChanged , in are in my core PCL. The WPF UI components can then directly bind to those viewmodel properties. My question is: how can I use my "portable" PCL viewmodels from the Xamarin.Mac side so

JavaFX - Bind stage size to the root node's preferred size

本小妞迷上赌 提交于 2021-01-24 11:39:49
问题 I would like to automatically adjust the width/height of a javafx.stage.Stage whenever the preferred width/height of the Scene 's root node changes. It's a small utility window (not resizable by the user) that contains multiple javafx.scene.control.TitledPane s and the window's height should increase when one of these TitledPanes is expanded (otherwise the TitlePane's content may be out of bounds). Unfortunately I could only find javafx.stage.Window.sizeToScene() , which initially sets the

JavaFX - Bind stage size to the root node's preferred size

隐身守侯 提交于 2021-01-24 11:39:47
问题 I would like to automatically adjust the width/height of a javafx.stage.Stage whenever the preferred width/height of the Scene 's root node changes. It's a small utility window (not resizable by the user) that contains multiple javafx.scene.control.TitledPane s and the window's height should increase when one of these TitledPanes is expanded (otherwise the TitlePane's content may be out of bounds). Unfortunately I could only find javafx.stage.Window.sizeToScene() , which initially sets the

How to filter combobox items based on the input text?

╄→尐↘猪︶ㄣ 提交于 2021-01-07 06:34:43
问题 I would like to display a combo box whose items are supplied by the view model. The combo box should be editable. Based on the text currently input by the user, the combo box items should be filtered. I am trying to apply the following solution pointed out in various resources on the topic (such as that question, that question, that article, that question, that blogpost, that tutorial, etc.): My view model provides a collection view around the items. I have two-way bound the Text property of

How to avoid repeating blocks of XAML in a menu

我的未来我决定 提交于 2021-01-07 03:24:16
问题 I have to create a menu. It has 10 entries and they differ by one parameter. Entry 1: <MenuItem Visibility="{Binding MenuSelected.Type, Converter={StaticResource TypeToVisibilityConverter}, ConverterParameter='PAZ', Mode=OneWay}"> <i:Interaction.Triggers> <i:EventTrigger EventName="Click"> <i:InvokeCommandAction Command="{Binding CmdContextMenu}" CommandParameter="PAZ" /> </i:EventTrigger> </i:Interaction.Triggers> <MenuItem.Header> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width=

How to avoid repeating blocks of XAML in a menu

烈酒焚心 提交于 2021-01-07 03:23:16
问题 I have to create a menu. It has 10 entries and they differ by one parameter. Entry 1: <MenuItem Visibility="{Binding MenuSelected.Type, Converter={StaticResource TypeToVisibilityConverter}, ConverterParameter='PAZ', Mode=OneWay}"> <i:Interaction.Triggers> <i:EventTrigger EventName="Click"> <i:InvokeCommandAction Command="{Binding CmdContextMenu}" CommandParameter="PAZ" /> </i:EventTrigger> </i:Interaction.Triggers> <MenuItem.Header> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width=

How a user select to display 1 out of two (or more) fields on a single Label in Xamarin

孤街醉人 提交于 2021-01-07 03:10:59
问题 I'm trying to use a single Label to display one of the two data fields alternately in Xamarin Forms. Only Label 1 Displaying the binding field (Contact_Name), while second Label which I am trying to use a variable "DisplayField" is not displaying either 'Contact_Address' or 'Contact_eMail' . Question posted before and Another user tried to help but it didn't work! Model Class public class Contacts { [PrimaryKey][Autoincrement] public int Contact_ID { get; set; } public string Contact_Name {

Access ASPxComboBox from DataItemTemplate in current context

人走茶凉 提交于 2021-01-07 02:46:29
问题 I am trying to access my combobox in my codebehind file C# but I keep getting an error that says 'cmbYearOfStudy' does not exist in the current context This is the C# code that is giving the error name of file => BulkScheduleAllocation.aspx.cs private void PopulateScheduleAcademicYearCombo() { for (var iYear = DateTime.Now.Year + 5; iYear >= 1999; iYear--) { var oItem = new ListEditItem(iYear.ToString(), iYear.ToString()); cmbYearoOfStudy.Items.Add(oItem); } cmbYearOfStudy.DataBind(); Utils

Access ASPxComboBox from DataItemTemplate in current context

强颜欢笑 提交于 2021-01-07 02:41:14
问题 I am trying to access my combobox in my codebehind file C# but I keep getting an error that says 'cmbYearOfStudy' does not exist in the current context This is the C# code that is giving the error name of file => BulkScheduleAllocation.aspx.cs private void PopulateScheduleAcademicYearCombo() { for (var iYear = DateTime.Now.Year + 5; iYear >= 1999; iYear--) { var oItem = new ListEditItem(iYear.ToString(), iYear.ToString()); cmbYearoOfStudy.Items.Add(oItem); } cmbYearOfStudy.DataBind(); Utils

RecyclerView Item Click Listener with DataBinding

让人想犯罪 __ 提交于 2021-01-03 10:51:05
问题 I have implemented recycler view with data binding using a baseadapter which handles all the binding of any layout item. I have tried to implement per item click listener using method reference and Listener bindings, but I couldn't do that. Here is my code. Can you give me a sample which is the simple way to detect every single item of the recycler view and I want to add click listener for every single item for different purposes. Thanks. MyBaseAdapter public abstract class MyBaseAdapter