Skip to content

Commit

Permalink
Merge pull request #483 from AndreasReitberger/482-add-issyncing-to-a…
Browse files Browse the repository at this point in the history
…ccountview

Added `IsSyncing` to `AccountView`
  • Loading branch information
AndreasReitberger authored Mar 26, 2024
2 parents a33284f + 008a335 commit 4190bdf
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,34 @@
IsEnabled="{TemplateBinding IsEnabled}"
Background="{TemplateBinding Background}"
HeightRequest="{TemplateBinding HeightRequest}"
ColumnDefinitions="Auto,*"
ColumnDefinitions="Auto,*,Auto"
>
<core:SfAvatarView
AvatarName="{TemplateBinding UsernameText}"
ImageSource="{TemplateBinding UserImage}"
Style="{StaticResource Style.Syncfusion.SfAvatarView.Initials}"
/>
<ContentPresenter
IsVisible="{TemplateBinding IsSyncing, Converter={StaticResource BooleanReverseVisibilityConverter}}"
Grid.Column="1"
/>
<HorizontalStackLayout
Grid.Column="2"
IsVisible="{TemplateBinding IsSyncing}"
>
<ActivityIndicator
Margin="2"
IsRunning="{TemplateBinding IsSyncing}"
Style="{StaticResource Style.Core.ActivityIndicator.Default}"
/>
<Label
Margin="4,2"
Text="{TemplateBinding IsSyncingText}"
Style="{StaticResource Style.Core.Label.Small}"
VerticalTextAlignment="Center"
HorizontalTextAlignment="Start"
/>
</HorizontalStackLayout>
</Grid>
</ControlTemplate>
</ContentView.ControlTemplate>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ public partial class AccountConventView : ContentView

public static readonly BindableProperty UsernameTextProperty = BindableProperty.Create(nameof(UsernameText), typeof(string), typeof(TitleViewAccountConventView), string.Empty);
public static readonly BindableProperty UserImageProperty = BindableProperty.Create(nameof(UserImage), typeof(ImageSource), typeof(TitleViewAccountConventView), null);

public static readonly BindableProperty IsSyncingProperty = BindableProperty.Create(nameof(IsSyncing), typeof(bool), typeof(TitleViewAccountConventView), false);
public static readonly BindableProperty IsSyncingTextProperty = BindableProperty.Create(nameof(IsSyncingText), typeof(string), typeof(TitleViewAccountConventView), string.Empty);

#endregion

Expand All @@ -21,6 +24,16 @@ public ImageSource UserImage
get => (ImageSource)GetValue(UserImageProperty);
set => SetValue(UserImageProperty, value);
}
public bool IsSyncing
{
get => (bool)GetValue(IsSyncingProperty);
set => SetValue(IsSyncingProperty, value);
}
public string IsSyncingText
{
get => (string)GetValue(IsSyncingTextProperty);
set => SetValue(IsSyncingTextProperty, value);
}

#endregion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@

<Style TargetType="ActivityIndicator" BasedOn="{StaticResource Style.Core.ActivityIndicator.Default}"/>

<Style x:Key="Style.Core.ActivityIndicator.Primary" TargetType="ActivityIndicator" BasedOn="{StaticResource Style.Core.ActivityIndicator.Default}">
<Setter Property="Color" Value="{DynamicResource PrimaryColor}" />
</Style>

</ResourceDictionary>

0 comments on commit 4190bdf

Please sign in to comment.