Настраиваемый элемент управления имеет свойство Bindable "IdEmpleado", определенное как:
Код: Выделить всё
using MovilApp.Controls.ViewModel;
namespace MovilApp.Controls.Views;
public partial class InfoPanelView : ContentView {
public InfoPanelViewModel LcViewModel { get; set; }
#region Exposed Properties
///
/// Id del Empleado para desplegar sus valores
///
public int IdEmpleado {
get => (int)GetValue(IdEmpleadoProperty); //I have a break point here...
set => SetValue(IdEmpleadoProperty, value); //I have a break point here...
}
#endregion
#region Bindable Property Fields
public static readonly BindableProperty IdEmpleadoProperty = BindableProperty.Create(
propertyName: nameof(IdEmpleado), returnType: typeof(int), declaringType: typeof(InfoPanelView),
defaultValue: default, defaultBindingMode: BindingMode.TwoWay, propertyChanged: IdEmpleadoPropertyChanged);
#endregion
#region Callback Methods
private static void IdEmpleadoPropertyChanged(BindableObject pBindable, object pOldValue, object pNewValue) {
if (pOldValue == null || !pOldValue.Equals(pNewValue)) { //I have a break point here...
((InfoPanelView)pBindable).LcViewModel.LcModel.IdEmpleado = (int)pNewValue;
}
}
#endregion
public InfoPanelView() {
InitializeComponent();
LcViewModel = new InfoPanelViewModel();
BindingContext = LcViewModel;
}
}
Код: Выделить всё
BindingContext="{Binding Source={x:Reference InfoPanelView}, Path=BindingContext}"
IdEmpleado="{Binding LcModel.IdEmpleado}"/>

Можете ли вы помочь мне найти, в чем моя проблема??
Буду вам очень благодарен
С уважением!
Подробнее здесь: https://stackoverflow.com/questions/790 ... d-property
Мобильная версия