feature: refresh profile
This commit is contained in:
@ -30,6 +30,9 @@
|
|||||||
Text="{Binding UserProfileName}" TextColor="{DynamicResource TextColor}"/>
|
Text="{Binding UserProfileName}" TextColor="{DynamicResource TextColor}"/>
|
||||||
<Label Grid.Row="2" VerticalOptions="Center" FontSize="Small"
|
<Label Grid.Row="2" VerticalOptions="Center" FontSize="Small"
|
||||||
Text="{Binding UserProfileId}" TextColor="{DynamicResource SubTextColor}"/>
|
Text="{Binding UserProfileId}" TextColor="{DynamicResource SubTextColor}"/>
|
||||||
|
<ActivityIndicator Grid.RowSpan="3" BackgroundColor="#50000000" Color="White"
|
||||||
|
Margin="0, 20, 20, 0"
|
||||||
|
IsVisible="{Binding IsLoading}" IsRunning="{Binding IsLoading}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</Shell.FlyoutHeaderTemplate>
|
</Shell.FlyoutHeaderTemplate>
|
||||||
|
@ -23,6 +23,8 @@ namespace Pixiview
|
|||||||
nameof(UserProfileName), typeof(string), typeof(AppShell), ResourceHelper.Guest);
|
nameof(UserProfileName), typeof(string), typeof(AppShell), ResourceHelper.Guest);
|
||||||
public static readonly BindableProperty UserProfileIdProperty = BindableProperty.Create(
|
public static readonly BindableProperty UserProfileIdProperty = BindableProperty.Create(
|
||||||
nameof(UserProfileId), typeof(string), typeof(AppShell));
|
nameof(UserProfileId), typeof(string), typeof(AppShell));
|
||||||
|
public static readonly BindableProperty IsLoadingProperty = BindableProperty.Create(
|
||||||
|
nameof(IsLoading), typeof(bool), typeof(AppShell));
|
||||||
|
|
||||||
public ImageSource UserProfileImage
|
public ImageSource UserProfileImage
|
||||||
{
|
{
|
||||||
@ -39,6 +41,11 @@ namespace Pixiview
|
|||||||
get => (string)GetValue(UserProfileIdProperty);
|
get => (string)GetValue(UserProfileIdProperty);
|
||||||
set => SetValue(UserProfileIdProperty, value);
|
set => SetValue(UserProfileIdProperty, value);
|
||||||
}
|
}
|
||||||
|
public bool IsLoading
|
||||||
|
{
|
||||||
|
get => (bool)GetValue(IsLoadingProperty);
|
||||||
|
set => SetValue(IsLoadingProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
public event EventHandler<BarHeightEventArgs> NavigationBarHeightChanged;
|
public event EventHandler<BarHeightEventArgs> NavigationBarHeightChanged;
|
||||||
public event EventHandler<BarHeightEventArgs> StatusBarHeightChanged;
|
public event EventHandler<BarHeightEventArgs> StatusBarHeightChanged;
|
||||||
@ -75,14 +82,26 @@ namespace Pixiview
|
|||||||
private void TapGestureRecognizer_Tapped(object sender, EventArgs e)
|
private void TapGestureRecognizer_Tapped(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (UserProfileId != null)
|
if (UserProfileId != null)
|
||||||
|
{
|
||||||
|
if (IsLoading)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
IsLoading = true;
|
||||||
|
Task.Run(() =>
|
||||||
|
{
|
||||||
|
DoLoginInformation(true);
|
||||||
|
IsLoading = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
PushToLogin(() =>
|
PushToLogin(() =>
|
||||||
{
|
{
|
||||||
Task.Run(() => DoLoginInformation(true));
|
Task.Run(() => DoLoginInformation(true));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private bool isLoginOpened;
|
private bool isLoginOpened;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user