binding

Switch templates in xamarin based of bound property (NOT ItemTemplate)

試著忘記壹切 提交于 2020-12-14 06:46:47
问题 I have a Model that contains some data, and a field that can have one of three (enum) values. Socket, Tcp, Udp And a View that shows some details. The details that I want shown in the view differ according to the value of this property in the model. I have read all about ItemTemplates for Lists and Pickers, and I want to do something similar but just with a single view bound to a single property. If Socket => Show this view else => Show this other view. Both views have the same viewmodel.

Switch templates in xamarin based of bound property (NOT ItemTemplate)

我们两清 提交于 2020-12-14 06:39:14
问题 I have a Model that contains some data, and a field that can have one of three (enum) values. Socket, Tcp, Udp And a View that shows some details. The details that I want shown in the view differ according to the value of this property in the model. I have read all about ItemTemplates for Lists and Pickers, and I want to do something similar but just with a single view bound to a single property. If Socket => Show this view else => Show this other view. Both views have the same viewmodel.

Binding a nullable datetime within WPF application

旧时模样 提交于 2020-12-06 04:19:30
问题 I have a wpf application in which I had this property to bind to a datepicker public Nullable<System.DateTime> dpc_date_engagement { get; set; } So I add a converter : public class DateConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value != null) return ((DateTime)value).ToShortDateString(); return String.Empty; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {

Binding a nullable datetime within WPF application

孤街醉人 提交于 2020-12-06 04:17:33
问题 I have a wpf application in which I had this property to bind to a datepicker public Nullable<System.DateTime> dpc_date_engagement { get; set; } So I add a converter : public class DateConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value != null) return ((DateTime)value).ToShortDateString(); return String.Empty; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {

Binding a nullable datetime within WPF application

南楼画角 提交于 2020-12-06 04:17:21
问题 I have a wpf application in which I had this property to bind to a datepicker public Nullable<System.DateTime> dpc_date_engagement { get; set; } So I add a converter : public class DateConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value != null) return ((DateTime)value).ToShortDateString(); return String.Empty; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {

Binding a nullable datetime within WPF application

て烟熏妆下的殇ゞ 提交于 2020-12-06 04:17:11
问题 I have a wpf application in which I had this property to bind to a datepicker public Nullable<System.DateTime> dpc_date_engagement { get; set; } So I add a converter : public class DateConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value != null) return ((DateTime)value).ToShortDateString(); return String.Empty; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {