Skip to content

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

Boolean

IsLoadingPosts

Whether the posts on the page are being loaded

public abstract bool IsLoadingPosts { get; }

Property Value

Boolean

IsUserFollowed

Whether the authentication principal is following the user whose profile is being visited

public abstract bool IsUserFollowed { get; }

Property Value

Boolean

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

Boolean

AuthPrincipalId

The authentication principal's user ID (i.e. the user that's logged in)

public abstract Nullable<Guid> AuthPrincipalId { get; }

Property Value

Nullable<Guid>

UserInfo

Information about the user whose profile is being visited

public abstract UserInformationDto UserInfo { get; }

Property Value

UserInformationDto

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

Task

FollowThisUser()

Has the authentication principal follow the visited profile. Does nothing if no authentication principal is present.

Task FollowThisUser()

Returns

Task

UnfollowThisUser()

Has the authentication principal unfollow the visited profile. Does nothing if no authentication principal is present.

Task UnfollowThisUser()

Returns

Task

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

Task

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

Task

OnDescriptionUpdate(String)

An event that is triggered when the user updates their own description.

Task OnDescriptionUpdate(string description)

Parameters

description String
The new description

Returns

Task