urge
continuous-integration/drone/push Build is passing Details

pull/48/head
Roxane ROSSETTO 2 years ago
parent 9a03d8c117
commit 47ef6838a4

@ -1,44 +1,44 @@
#if WINDOWS
using Microsoft.UI;
using Microsoft.UI.Windowing;
using Windows.Graphics;
#endif
using DataPersistence;
#if WINDOWS
using Microsoft.UI;
using Microsoft.UI.Windowing;
using Windows.Graphics;
#endif
using DataPersistence;
using Model;
namespace Views
{
public partial class App : Application
{
public DataManager DataMgr { get; private set; } = new DataManager(new Stubs());
public User user { get; set; }
const int WindowWidth = 1200;
const int WindowHeight = 800;
public App()
namespace Views
{
public partial class App : Application
{
public DataManager DataMgr { get; private set; } = new DataManager(new Stubs());
public User user { get; set; }
const int WindowWidth = 1200;
const int WindowHeight = 800;
public App()
{
user = DataMgr.Data[nameof(User)].Cast<User>().Last();
InitializeComponent();
Microsoft.Maui.Handlers.WindowHandler.Mapper.AppendToMapping(nameof(IWindow), (handler, view) =>
{
#if WINDOWS
var mauiWindow = handler.VirtualView;
var nativeWindow = handler.PlatformView;
nativeWindow.Activate();
IntPtr windowHandle = WinRT.Interop.WindowNative.GetWindowHandle(nativeWindow);
WindowId windowId = Microsoft.UI.Win32Interop.GetWindowIdFromWindow(windowHandle);
AppWindow appWindow = Microsoft.UI.Windowing.AppWindow.GetFromWindowId(windowId);
appWindow.Resize(new SizeInt32(WindowWidth, WindowHeight));
#endif
});
/* - Comment(ctrl-k + ctrl-c)/Uncomment(ctrl-k + ctrl-u) to change page - */
UserAppTheme = AppTheme.Light;
MainPage = new MyProfil();
//MainPage = new MyPosts();
}
}
}
user = DataMgr.Data[nameof(User)].Cast<User>().Last();
InitializeComponent();
Microsoft.Maui.Handlers.WindowHandler.Mapper.AppendToMapping(nameof(IWindow), (handler, view) =>
{
#if WINDOWS
var mauiWindow = handler.VirtualView;
var nativeWindow = handler.PlatformView;
nativeWindow.Activate();
IntPtr windowHandle = WinRT.Interop.WindowNative.GetWindowHandle(nativeWindow);
WindowId windowId = Microsoft.UI.Win32Interop.GetWindowIdFromWindow(windowHandle);
AppWindow appWindow = Microsoft.UI.Windowing.AppWindow.GetFromWindowId(windowId);
appWindow.Resize(new SizeInt32(WindowWidth, WindowHeight));
#endif
});
/* - Comment(ctrl-k + ctrl-c)/Uncomment(ctrl-k + ctrl-u) to change page - */
UserAppTheme = AppTheme.Light;
MainPage = new AddRecipe();
//MainPage = new MyPosts();
}
}
}

@ -1,49 +1,49 @@
using DataPersistence;
using Model;
namespace Views;
public partial class ContainerFlyout : ContentView
{
using DataPersistence;
using Model;
namespace Views;
public partial class ContainerFlyout : ContentView
{
public DataManager DataMgr => (App.Current as App).DataMgr;
public User user => (App.Current as App).user;
public ContainerFlyout()
public User user => (App.Current as App).user;
public ContainerFlyout()
{
InitializeComponent();
BindingContext = this;
}
// Bind MyFlyoutContent
public static readonly BindableProperty MyFlyoutContentProperty =
BindableProperty.Create("MyFlyoutContent", typeof(View), typeof(ContainerFlyout), new Grid());
public View MyFlyoutContent
{
get => (View)GetValue(MyFlyoutContentProperty);
set => SetValue(MyFlyoutContentProperty, value);
}
// Bind IsNotConnected
public static readonly BindableProperty IsNotConnectedProperty =
BindableProperty.Create("IsNotConnected", typeof(bool), typeof(Button), true);
public bool IsNotConnected
{
get => (bool)GetValue(IsNotConnectedProperty);
set => SetValue(IsNotConnectedProperty, value);
}
// bind NeedReturn
public static readonly BindableProperty NeedReturnProperty =
BindableProperty.Create("NeedReturn", typeof(bool), typeof(Border), false);
public bool NeedReturn
{
get => (bool)GetValue(NeedReturnProperty);
set => SetValue(NeedReturnProperty, value);
}
}
}
// Bind MyFlyoutContent
public static readonly BindableProperty MyFlyoutContentProperty =
BindableProperty.Create("MyFlyoutContent", typeof(View), typeof(ContainerFlyout), new Grid());
public View MyFlyoutContent
{
get => (View)GetValue(MyFlyoutContentProperty);
set => SetValue(MyFlyoutContentProperty, value);
}
// Bind IsNotConnected
public static readonly BindableProperty IsNotConnectedProperty =
BindableProperty.Create("IsNotConnected", typeof(bool), typeof(Button), true);
public bool IsNotConnected
{
get => (bool)GetValue(IsNotConnectedProperty);
set => SetValue(IsNotConnectedProperty, value);
}
// bind NeedReturn
public static readonly BindableProperty NeedReturnProperty =
BindableProperty.Create("NeedReturn", typeof(bool), typeof(Border), false);
public bool NeedReturn
{
get => (bool)GetValue(NeedReturnProperty);
set => SetValue(NeedReturnProperty, value);
}
}

@ -14,8 +14,8 @@
<Grid RowDefinitions="250, *, *" VerticalOptions="Fill">
<VerticalStackLayout Grid.Row="1">
<Button Text="Mes informations" ImageSource="person_default.png" Style="{StaticResource button1}" Grid.Row="1"/>
<Button Text="Modifier" ImageSource="settings_icon.png" Style="{StaticResource button1}" Grid.Row="2"/>
<Button Text="Mes Recettes" ImageSource="person_default.png" Style="{StaticResource button1}" Grid.Row="1"/>
<Button Text="Ajouter Recette" ImageSource="settings_icon.png" Style="{StaticResource button1}" Grid.Row="2"/>
</VerticalStackLayout>
</Grid>
@ -25,6 +25,7 @@
<ScrollView>
<StackLayout >
<!--user's informations-->
<Label Text="Mon profil" TextColor="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource Gray100}}"
FontAttributes="Bold"
FontSize="24" Padding="15, 15, 20, 5"/>
@ -52,14 +53,12 @@
IsEnabled="False"
Text="{Binding user.Mail}"/>
<Button BackgroundColor="#bdf5bd"
Text="Valider"
Text="Modifier"
Margin="40,0,0,0"
TextColor="Black"
MaximumWidthRequest="100"
Clicked="Validation_Click"/>
<!--liste drag and drop-->
</VerticalStackLayout>
<VerticalStackLayout Padding="100,0,0,0">
<Label Text="Priorités du compte : " TextColor="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource Gray100}}"
@ -67,44 +66,34 @@
<Grid BackgroundColor="#D1E8E2"
MinimumHeightRequest="300"
Padding="20">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Label Text="Recettes économiques" Grid.Row="0" Padding="5,0,0,0"/>
<BoxView Color="Black" HeightRequest="1" Margin="10,10,10,10" Grid.Row="1" />
<Label Text="Recettes rapides" Grid.Row="2"/>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Label Text="Recettes économiques" Grid.Row="0" Padding="5,0,0,0"/>
<BoxView Color="Black" HeightRequest="1" Margin="10,10,10,10" Grid.Row="1" />
<Label Text="Recettes rapides" Grid.Row="2"/>
<BoxView Color="Black" HeightRequest="1" Margin="10,10,10,10" Grid.Row="3" />
<Label Text="Recettes simples" Grid.Row="4"/>
<Label Text="Recettes simples" Grid.Row="4"/>
<BoxView Color="Black" HeightRequest="1" Margin="10,10,10,10" Grid.Row="5" />
<Label Text="Recettes légères" Grid.Row="6"/>
<Label Text="Recettes légères" Grid.Row="6"/>
<BoxView Color="Black" HeightRequest="1" Margin="10,10,10,10" Grid.Row="7" />
<Label Text="Recettes gourmandes" Grid.Row="8"/>
<Label Text="Recettes gourmandes" Grid.Row="8"/>
</Grid>
</VerticalStackLayout>
</HorizontalStackLayout>
</StackLayout>
</ScrollView>
</local:ContainerBase.MyContent>
</local:ContainerBase>
</ContentPage>

@ -1,21 +1,21 @@
using CommunityToolkit.Maui.Behaviors;
using DataPersistence;
using Model;
using DataPersistence;
using Model;
using System.Diagnostics;
namespace Views;
public partial class MyProfil : ContentPage
{
namespace Views;
public partial class MyProfil : ContentPage
{
public DataManager DataMgr => (App.Current as App).DataMgr;
public User user => (App.Current as App).user;
public User userBis {get; set; }
public MyProfil()
{
userBis = new User(user);
InitializeComponent();
public User user => (App.Current as App).user;
public User userBis {get; set; }
public MyProfil()
{
userBis = new User(user);
InitializeComponent();
BindingContext = this;
}
@ -27,5 +27,5 @@ public partial class MyProfil : ContentPage
}
user.Name = userBis.Name;
user.Surname = userBis.Surname;
}
}
}

@ -62,6 +62,9 @@
</ItemGroup>
<ItemGroup>
<MauiXaml Update="AddRecipe.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="ContainerBase.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>

Loading…
Cancel
Save