Table of Contents

Class ModDetailsViewModel

Namespace
McServerLauncher.ViewModels
Assembly
McServerLauncher.dll

The details page of one store item: everything Modrinth knows about a project, plus the two things Modrinth doesn't say — what it does in plain language, and whether it fits this server.

It paints in two passes. What the search result already carried (title, author, icon, summary) is shown at once, so opening a mod is instant; the long description, gallery, versions, dependencies and related items arrive as their requests come back. Nothing here decides whether a version is compatible or how a file is installed: both come from the existing services.

public class ModDetailsViewModel : ObservableObject, INotifyPropertyChanged, INotifyPropertyChanging, IDisposable
Inheritance
ModDetailsViewModel
Implements
Inherited Members

Constructors

ModDetailsViewModel(ServerModsViewModel, ModrinthService, StoreItem)

public ModDetailsViewModel(ServerModsViewModel parent, ModrinthService modrinth, StoreItem seed)

Parameters

parent ServerModsViewModel
modrinth ModrinthService
seed StoreItem

Properties

AuthorText

[ExcludeFromCodeCoverage]
public string AuthorText { get; set; }

Property Value

string

BackCommand

Gets an IRelayCommand instance wrapping McServerLauncher.ViewModels.ModDetailsViewModel.Back().

[ExcludeFromCodeCoverage]
public IRelayCommand BackCommand { get; }

Property Value

IRelayCommand

Body

[ExcludeFromCodeCoverage]
public string? Body { get; set; }

Property Value

string

BodyTruncated

True when the description was cut, so the page can point at Modrinth for the rest.

[ExcludeFromCodeCoverage]
public bool BodyTruncated { get; set; }

Property Value

bool

CompatibilityBrush

public IBrush CompatibilityBrush { get; }

Property Value

IBrush

CompatibilityDetail

[ExcludeFromCodeCoverage]
public string CompatibilityDetail { get; set; }

Property Value

string

CompatibilityKnown

[ExcludeFromCodeCoverage]
public bool CompatibilityKnown { get; set; }

Property Value

bool

CompatibilityText

[ExcludeFromCodeCoverage]
public string CompatibilityText { get; set; }

Property Value

string

CurrentItem

What this page is showing, so the browser can push it onto its history.

public StoreItem CurrentItem { get; }

Property Value

StoreItem

Dependencies

public ObservableCollection<StoreLinkViewModel> Dependencies { get; }

Property Value

ObservableCollection<StoreLinkViewModel>

DownloadsText

[ExcludeFromCodeCoverage]
public string DownloadsText { get; set; }

Property Value

string

ErrorText

[ExcludeFromCodeCoverage]
public string? ErrorText { get; set; }

Property Value

string

FollowersText

[ExcludeFromCodeCoverage]
public string FollowersText { get; set; }

Property Value

string
public ObservableCollection<GalleryImageViewModel> Gallery { get; }

Property Value

ObservableCollection<GalleryImageViewModel>

HasBody

public bool HasBody { get; }

Property Value

bool

HasDependencies

public bool HasDependencies { get; }

Property Value

bool

HasError

public bool HasError { get; }

Property Value

bool

HasGallery

public bool HasGallery { get; }

Property Value

bool

HasIcon

public bool HasIcon { get; }

Property Value

bool

HasLicense

public bool HasLicense { get; }

Property Value

bool
public bool HasLinks { get; }

Property Value

bool

HasPublished

public bool HasPublished { get; }

Property Value

bool

HasRelated

public bool HasRelated { get; }

Property Value

bool

HasTags

public bool HasTags { get; }

Property Value

bool

HasUpdated

public bool HasUpdated { get; }

Property Value

bool

HasVersions

public bool HasVersions { get; }

Property Value

bool

Icon

[ExcludeFromCodeCoverage]
public Bitmap? Icon { get; set; }

Property Value

Bitmap

InstallCommand

Gets an IAsyncRelayCommand instance wrapping McServerLauncher.ViewModels.ModDetailsViewModel.Install().

[ExcludeFromCodeCoverage]
public IAsyncRelayCommand InstallCommand { get; }

Property Value

IAsyncRelayCommand

IsCompatible

[ExcludeFromCodeCoverage]
public bool IsCompatible { get; set; }

Property Value

bool

IsInstalling

[ExcludeFromCodeCoverage]
public bool IsInstalling { get; set; }

Property Value

bool

IsLoading

[ExcludeFromCodeCoverage]
public bool IsLoading { get; set; }

Property Value

bool

LicenseText

[ExcludeFromCodeCoverage]
public string LicenseText { get; set; }

Property Value

string
public ObservableCollection<ExternalLinkViewModel> Links { get; }

Property Value

ObservableCollection<ExternalLinkViewModel>

ModrinthUrl

Modrinth's own page, offered as the escape hatch for anything not shown here.

public string ModrinthUrl { get; }

Property Value

string

NeedsClient

The warning that matters most on a server: everyone has to install this one.

[ExcludeFromCodeCoverage]
public bool NeedsClient { get; set; }

Property Value

bool

OpenLinkCommand

Gets an IRelayCommand<T> instance wrapping OpenLink(string).

[ExcludeFromCodeCoverage]
public IRelayCommand<string?> OpenLinkCommand { get; }

Property Value

IRelayCommand<string>

ProjectId

public string ProjectId { get; }

Property Value

string

PublishedText

[ExcludeFromCodeCoverage]
public string PublishedText { get; set; }

Property Value

string
public ObservableCollection<StoreLinkViewModel> Related { get; }

Property Value

ObservableCollection<StoreLinkViewModel>

RelatedTitle

public string RelatedTitle { get; }

Property Value

string

SelectImageCommand

[ExcludeFromCodeCoverage]
public IRelayCommand<GalleryImageViewModel?> SelectImageCommand { get; }

Property Value

IRelayCommand<GalleryImageViewModel>

SelectedImage

[ExcludeFromCodeCoverage]
public GalleryImageViewModel? SelectedImage { get; set; }

Property Value

GalleryImageViewModel

SideText

[ExcludeFromCodeCoverage]
public string SideText { get; set; }

Property Value

string

Summary

The plain-language summary: the curated catalogue, or the built one.

[ExcludeFromCodeCoverage]
public string Summary { get; set; }

Property Value

string

Tagline

The author's own one-line description, shown under the summary when they differ.

[ExcludeFromCodeCoverage]
public string Tagline { get; set; }

Property Value

string

Tags

public ObservableCollection<StoreTagViewModel> Tags { get; }

Property Value

ObservableCollection<StoreTagViewModel>

Title

[ExcludeFromCodeCoverage]
public string Title { get; set; }

Property Value

string

UpdatedText

[ExcludeFromCodeCoverage]
public string UpdatedText { get; set; }

Property Value

string

Versions

public ObservableCollection<ModVersionViewModel> Versions { get; }

Property Value

ObservableCollection<ModVersionViewModel>

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

LoadAsync()

Loads the rest of the page. Every step is independent: a failure in one (say, the related strip) leaves the others intact, because a details page with less on it beats an error.

public Task LoadAsync()

Returns

Task