add the profile name & a binder to its visible property

pull/20/head
Alexandre Agostinho 2 years ago
parent 8d54133477
commit b6fce715b1

@ -16,7 +16,8 @@
<local:ContainerFlyout
Grid.RowSpan="2"
MinimumWidthRequest="300"
HorizontalOptions="StartAndExpand">
HorizontalOptions="StartAndExpand"
IsNotConnected="{Binding IsNotConnected, Source={x:Reference root}}">
<local:ContainerFlyout.MyFlyoutContent>
<ContentView
Content="{Binding MyFlyoutContent, Source={x:Reference root}}"/>

@ -7,7 +7,8 @@ public partial class ContainerBase : ContentView
InitializeComponent();
}
public static readonly BindableProperty MyContentProperty =
// Bind MyContent
public static readonly BindableProperty MyContentProperty =
BindableProperty.Create("MyContent", typeof(View), typeof(ContainerBase), new Grid());
public View MyContent
@ -16,6 +17,7 @@ public partial class ContainerBase : ContentView
set => SetValue(MyContentProperty, value);
}
// Bind MyFlyoutContent
public static readonly BindableProperty MyFlyoutContentProperty =
BindableProperty.Create("MyFlyoutContent", typeof(View), typeof(ContainerBase), new Grid());
@ -24,4 +26,14 @@ public partial class ContainerBase : ContentView
get => (View)GetValue(MyFlyoutContentProperty);
set => SetValue(MyFlyoutContentProperty, value);
}
// Bind IsNotConnected
public static readonly BindableProperty IsNotConnectedProperty =
BindableProperty.Create("IsNotConnected", typeof(bool), typeof(Button), false);
public bool IsNotConnected
{
get => (bool)GetValue(IsNotConnectedProperty);
set => SetValue(IsNotConnectedProperty, value);
}
}

@ -14,9 +14,16 @@
WidthRequest="100" HeightRequest="100"
CornerRadius="50" Margin="0, 30, 0, 10"
BorderWidth="5" BorderColor="Black"
IsEnabled="False"/>
IsEnabled="{Binding IsNotConnected, Source={x:Reference fl}}"/>
<Button Text="Connection" ImageSource="login_icon.png"
Style="{StaticResource button2}"/>
Style="{StaticResource button2}"
IsVisible="{Binding IsNotConnected, Source={x:Reference fl}}"
IsEnabled="{Binding IsNotConnected, Source={x:Reference fl}}"/>
<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}}"/>
</VerticalStackLayout>
<!-- Content -->

@ -7,6 +7,7 @@ public partial class ContainerFlyout : ContentView
InitializeComponent();
}
// Bind MyFlyoutContent
public static readonly BindableProperty MyFlyoutContentProperty =
BindableProperty.Create("MyFlyoutContent", typeof(View), typeof(ContainerFlyout), new Grid());
@ -15,4 +16,19 @@ public partial class ContainerFlyout : ContentView
get => (View)GetValue(MyFlyoutContentProperty);
set => SetValue(MyFlyoutContentProperty, value);
}
}
// Bind IsNotConnected
public static readonly BindableProperty IsNotConnectedProperty =
BindableProperty.Create("IsNotConnected", typeof(bool), typeof(Button), false);
public bool IsNotConnected
{
get => (bool)GetValue(IsNotConnectedProperty);
set => SetValue(IsNotConnectedProperty, value);
}
public bool IsConnected
{
get => !(bool)GetValue(IsNotConnectedProperty);
set => SetValue(IsNotConnectedProperty, !value);
}
}

@ -5,7 +5,8 @@
x:Class="Views.MyPosts"
Title="MyPosts">
<local:ContainerBase>
<local:ContainerBase
IsNotConnected="False">
<local:ContainerBase.MyFlyoutContent>
@ -47,4 +48,4 @@
</local:ContainerBase>
</ContentPage>
</ContentPage>

Loading…
Cancel
Save