implementation of a void constructor of user and a copy constructor. Binding between flyoutContainer and MyProfil views
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
parent
5a255642b5
commit
82255808a9
@ -1,21 +1,31 @@
|
||||
using CommunityToolkit.Maui.Behaviors;
|
||||
using DataPersistence;
|
||||
using Model;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Views;
|
||||
|
||||
public partial class MyProfil : ContentPage
|
||||
{
|
||||
public DataManager DataMgr = (App.Current as App).DataMgr;
|
||||
public User user { get; private set; }
|
||||
|
||||
public DataManager DataMgr => (App.Current as App).DataMgr;
|
||||
public User user => (App.Current as App).user;
|
||||
public User userBis {get; set; }
|
||||
|
||||
public MyProfil()
|
||||
{
|
||||
DataMgr = new DataManager(new Stubs());
|
||||
|
||||
user = DataMgr.Data[nameof(User)].Cast<User>().Last();
|
||||
userBis = new User(user);
|
||||
InitializeComponent();
|
||||
|
||||
BindingContext = user;
|
||||
BindingContext = this;
|
||||
}
|
||||
|
||||
|
||||
public void Validation_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (String.IsNullOrEmpty(userBis.Name) || String.IsNullOrEmpty(userBis.Surname)){
|
||||
return;
|
||||
}
|
||||
user.Name = userBis.Name;
|
||||
user.Surname = userBis.Surname;
|
||||
}
|
||||
}
|
Loading…
Reference in new issue