Implementing of viewModel handling for UI
This commit is contained in:
@ -1,5 +1,4 @@
|
||||
using AdventureWorks.EntityLayer.EntityClasses;
|
||||
|
||||
using AdventureWorks.ViewModelLayer;
|
||||
namespace AdventureWorks.MAUI.Views;
|
||||
|
||||
public partial class UserDetailView : ContentPage
|
||||
@ -7,20 +6,20 @@ public partial class UserDetailView : ContentPage
|
||||
public UserDetailView()
|
||||
{
|
||||
InitializeComponent();
|
||||
UserObject = (User)this.Resources["viewModel"];
|
||||
UserObject.LoginId = "jkzxck0q94375";
|
||||
|
||||
}
|
||||
|
||||
public User UserObject { get; set; }
|
||||
public UserViewModel ViewModel { get; set; }
|
||||
|
||||
protected override void OnAppearing()
|
||||
{
|
||||
base.OnAppearing();
|
||||
|
||||
UserObject.LoginId = "PeterPiper384";
|
||||
UserObject.FirstName = "Peter";
|
||||
UserObject.LastName = "Piper";
|
||||
UserObject.Email = "peter@piper.com";
|
||||
ViewModel = new();
|
||||
|
||||
BindingContext = ViewModel;
|
||||
|
||||
ViewModel.Get(1); // Assuming you want to get the user with ID 1
|
||||
}
|
||||
private void SaveButton_Clicked(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user