IProfilePageVm
Namespace: SlottyMedia.Backend.ViewModel.Pages.Profile
This ViewModel represents the page.
public interface IProfilePageVm
Properties
IsLoadingPage
Whether the whole page is being loaded
public abstract bool IsLoadingPage { get; }
Property Value
IsLoadingPosts
Whether the posts on the page are being loaded
public abstract bool IsLoadingPosts { get; }
Property Value
IsUserFollowed
Whether the authentication principal is following the user whose profile is being visited
public abstract bool IsUserFollowed { get; }
Property Value
IsOwnProfilePage
Whether the visited profile is actually the authentication principal's profile (i.e. if this is your own profile page).
public abstract bool IsOwnProfilePage { get; }
Property Value
AuthPrincipalId
The authentication principal's user ID (i.e. the user that's logged in)
public abstract Nullable<Guid> AuthPrincipalId { get; }
Property Value
UserInfo
Information about the user whose profile is being visited
public abstract UserInformationDto UserInfo { get; }
Property Value
Posts
The posts that are currently being rendered
public abstract IPage<PostDto> Posts { get; }
Property Value
IPage<PostDto>
Methods
Initialize(Guid)
Initialized the page's state. This fetches all user-related information and loads the first posts for the visited user. Also initializes the IProfilePageVm.AuthPrincipalId if one is present.
Task Initialize(Guid userId)
Parameters
userId Guid
The ID of the user whose profile should be visited
Returns
FollowThisUser()
Has the authentication principal follow the visited profile. Does nothing if no authentication principal is present.
Task FollowThisUser()
Returns
UnfollowThisUser()
Has the authentication principal unfollow the visited profile. Does nothing if no authentication principal is present.
Task UnfollowThisUser()
Returns
LoadPosts(Int32)
Loads more IProfilePageVm.Posts for the visited profile by changing the current page (as in pagination).
Task LoadPosts(int pageNumber)
Parameters
pageNumber Int32
The page number
Returns
OnAvatarClick(String)
An event that is triggered when the avatar is clicked. It should update the profile picture if the user is on their own profile page.
Task OnAvatarClick(string imgB64)
Parameters
imgB64 String
The new profile page as a base 64 string
Returns
OnDescriptionUpdate(String)
An event that is triggered when the user updates their own description.
Task OnDescriptionUpdate(string description)
Parameters
description String
The new description