Skip to content

SpaceVmImpl

Namespace: SlottyMedia.Backend.ViewModel.Pages.Space

Implements ISpaceVm to manage the state of the Space Page.

public class SpaceVmImpl : ISpaceVm

Inheritance ObjectSpaceVmImpl
Implements ISpaceVm

Properties

IsLoadingPosts

A boolean flag indicating whether the posts on the page are being loaded.

public bool IsLoadingPosts { get; private set; }

Property Value

Boolean

IsLoadingPage

A boolean flag indicating whether the entire page is being loaded.

public bool IsLoadingPage { get; private set; }

Property Value

Boolean

AuthPrincipalId

The ID of the authenticated user (the currently logged-in user).

public Nullable<Guid> AuthPrincipalId { get; private set; }

Property Value

Nullable<Guid>

Space

Holds the details of the current space (ForumDto).

public ForumDto Space { get; private set; }

Property Value

ForumDto

Posts

Contains the paginated posts belonging to the space.

public IPage<PostDto> Posts { get; private set; }

Property Value

IPage<PostDto>

Constructors

SpaceVmImpl(IForumService, IPostService, IAuthService)

Initializes the ViewModel with the necessary services.

public SpaceVmImpl(IForumService forumService, IPostService postService, IAuthService authService)

Parameters

forumService IForumService

postService IPostService

authService IAuthService

Methods

Initialize(Guid)

Loads the details of a specific space based on the provided forum ID. This method also loads the posts for the space and sets the loading states accordingly. The space to load information from.

public Task Initialize(Guid forumId)

Parameters

forumId Guid

Returns

Task

LoadPosts(Int32)

Loads the posts for the space. This method is called when loading a specific page of posts.

public Task LoadPosts(int pageNumber)

Parameters

pageNumber Int32
The page number to load posts from.

Returns

Task