🐛 fix the is-user-connected binder + end review code. close #12

pull/20/head
Alexandre Agostinho 2 years ago
parent 0e8b12077d
commit 63c749fcfc

@ -28,11 +28,10 @@ namespace Views
#endif
});
MainPage = new Home();
Application.Current.UserAppTheme = AppTheme.Dark;
/* - Comment(ctrl-k + ctrl-c)/Uncomment(ctrl-k + ctrl-u) to change page - */
MainPage = new Home();
//MainPage = new MyPosts();
}
}
}

@ -29,7 +29,7 @@ public partial class ContainerBase : ContentView
// Bind IsNotConnected
public static readonly BindableProperty IsNotConnectedProperty =
BindableProperty.Create("IsNotConnected", typeof(bool), typeof(Button), false);
BindableProperty.Create("IsNotConnected", typeof(bool), typeof(Button), true);
public bool IsNotConnected
{

@ -2,6 +2,7 @@
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Views"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
x:Class="Views.ContainerFlyout"
x:Name="fl"
BackgroundColor="{AppThemeBinding Light={StaticResource Secondary}, Dark={StaticResource Gray600}}">
@ -30,8 +31,8 @@
<Label Text="Jean-Baptiste De La Fontaine"
HorizontalOptions="Center" Margin="15"
FontSize="20" FontAttributes="Bold" HorizontalTextAlignment="Center"
IsVisible="{Binding IsConnected, Source={x:Reference fl}}"
IsEnabled="{Binding IsConnected, Source={x:Reference fl}}"/>
TextColor="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource White}}"
IsVisible="{Binding IsNotConnected, Converter={toolkit:InvertedBoolConverter} ,Source={x:Reference fl}}"/>
</VerticalStackLayout>
@ -46,7 +47,7 @@
<!-- Footer -->
<Button Text="Déconnection" ImageSource="logout_icon.png"
Style="{StaticResource button2}"
IsVisible="{Binding IsConnected, Source={x:Reference fl}}"/>
IsVisible="{Binding IsNotConnected, Converter={toolkit:InvertedBoolConverter}, Source={x:Reference fl}}"/>
</VerticalStackLayout>
</Grid>

@ -19,18 +19,13 @@ public partial class ContainerFlyout : ContentView
// Bind IsNotConnected
public static readonly BindableProperty IsNotConnectedProperty =
BindableProperty.Create("IsNotConnected", typeof(bool), typeof(Button), false);
BindableProperty.Create("IsNotConnected", typeof(bool), typeof(Button), true);
public bool IsNotConnected
{
get => (bool)GetValue(IsNotConnectedProperty);
set => SetValue(IsNotConnectedProperty, value);
}
public bool IsConnected
{
get => !(bool)GetValue(IsNotConnectedProperty);
set => SetValue(IsNotConnectedProperty, !value);
}
// bind NeedReturn
public static readonly BindableProperty NeedReturnProperty =

@ -5,7 +5,8 @@
xmlns:local="clr-namespace:Views"
x:Class="Views.Home">
<local:ContainerBase>
<local:ContainerBase
IsNotConnected="True">
<!-- Flyout -->
<local:ContainerBase.MyFlyoutContent>
@ -14,7 +15,7 @@
<Button Text="Recherche" ImageSource="search_icon.png"
MaximumHeightRequest="20"
Style="{StaticResource button1}"/>
<SearchBar Placeholder="Mots-clés (ex.: rapide, fromage)" FontAttributes="Italic"
<SearchBar Placeholder="Mots-clés (ex.: rapide, fromage)" FontAttributes="Italic" TextColor="Black"
BackgroundColor="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource Gray300}}"
Margin="15, 10, 15, 40"/>

@ -3,8 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Views"
x:Class="Views.MyPosts"
Title="MyPosts"
BackgroundColor="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource Gray500}}">
Title="MyPosts">
<local:ContainerBase
IsNotConnected="False"

Loading…
Cancel
Save