Skip to content

ISpaceVm

Namespace: SlottyMedia.Backend.ViewModel.Pages.Space

This ViewModel represents the state of the Space Page.

public interface ISpaceVm

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

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>

Space

The space whose page is being visited

public abstract ForumDto Space { get; }

Property Value

ForumDto

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 space-related information and loads the first posts for the visited space. Also initializes the ISpaceVm.AuthPrincipalId if one is present.

Task Initialize(Guid forumId)

Parameters

forumId Guid
The ID of the space whose page should be visited

Returns

Task

LoadPosts(Int32)

Loads more ISpaceVm.Posts for the visited space by changing the current page (as in pagination).

Task LoadPosts(int pageNumber)

Parameters

pageNumber Int32
The page number

Returns

Task