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 DataPersistence;
|
||||||
using Model;
|
using Model;
|
||||||
|
using System.Diagnostics;
|
||||||
|
|
||||||
namespace Views;
|
namespace Views;
|
||||||
|
|
||||||
public partial class MyProfil : ContentPage
|
public partial class MyProfil : ContentPage
|
||||||
{
|
{
|
||||||
public DataManager DataMgr = (App.Current as App).DataMgr;
|
public DataManager DataMgr => (App.Current as App).DataMgr;
|
||||||
public User user { get; private set; }
|
public User user => (App.Current as App).user;
|
||||||
|
public User userBis {get; set; }
|
||||||
|
|
||||||
public MyProfil()
|
public MyProfil()
|
||||||
{
|
{
|
||||||
DataMgr = new DataManager(new Stubs());
|
userBis = new User(user);
|
||||||
|
|
||||||
user = DataMgr.Data[nameof(User)].Cast<User>().Last();
|
|
||||||
InitializeComponent();
|
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