fixed problem after merge
continuous-integration/drone/push Build is passing Details

pull/65/head
Roxane ROSSETTO 2 years ago
parent 907eb84ba0
commit f2de173e59

@ -55,7 +55,7 @@ namespace Views
InitializeComponent(); InitializeComponent();
UserAppTheme = AppTheme.Light; UserAppTheme = AppTheme.Light;
MainPage = new Home(); MainPage = new MyProfil();
//MainPage = new MyPosts(); //MainPage = new MyPosts();
} }

@ -1,5 +1,4 @@
using Model; using Model;
using Model.Managers;
using System.Diagnostics; using System.Diagnostics;
using Microsoft.Maui.Media; using Microsoft.Maui.Media;

@ -1,16 +1,51 @@
using CommunityToolkit.Maui.Behaviors;
using DataPersistence;
using Model; using Model;
using System.Collections.ObjectModel;
using System.Diagnostics;
namespace Views; namespace Views;
public partial class MyProfil : ContentPage public partial class MyProfil : ContentPage
{ {
public MasterManager Master => (Application.Current as App).Master; public MasterManager Master => (App.Current as App).Master;
public User user => Master.User.CurrentConnected; public User CurrentUser => Master.User.CurrentConnected;
public MyProfil()
{
InitializeComponent();
BindingContext = this;
}
public ObservableCollection<Priority> PriorityList { get; private set; } = new ObservableCollection<Priority>()
{ Priority.Economic, Priority.Fast, Priority.Easy, Priority.Light, Priority.Gourmet };
void DragGestureRecognizer_DragStarting2(System.Object sender, Microsoft.Maui.Controls.DragStartingEventArgs e)
{
e.Data.Properties["value"] = (sender as Element).Parent.BindingContext;
}
void DropGestureRecognizer_Drop2(System.Object sender, Microsoft.Maui.Controls.DropEventArgs e)
{
var receivingElement = (Priority)((sender as Element).Parent.BindingContext);
var draggedElement = (Priority)e.Data.Properties["value"];
int draggedIndex = PriorityList.IndexOf(draggedElement);
PriorityList.RemoveAt(draggedIndex);
public MyProfil() int receivingIndex = PriorityList.IndexOf(receivingElement);
{ PriorityList.Insert(receivingIndex + 1, draggedElement);
InitializeComponent(); }
private void OnMyRecipeClicked(object sender, EventArgs e)
{
Navigation.PushModalAsync(new MyPosts());
}
BindingContext = this; private void OnAddRecipeClicked(object sender, EventArgs e)
{
Navigation.PushModalAsync(new AddRecipe());
} }
} }
Loading…
Cancel
Save