Class MainViewModel

Inheritance
MainViewModel
Namespace: MOSAIC.ViewModels
Assembly: MOSAIC.dll
Syntax
public class MainViewModel : ViewModelBase, INotifyPropertyChanged, INotifyPropertyChanging

Constructors

MainViewModel()

Declaration
public MainViewModel()

Fields

_modelFiles

Declaration
[ObservableProperty]
private ObservableCollection<ModelFileItem> _modelFiles
Field Value
Type Description
ObservableCollection<ModelFileItem>

_recentFiles

Declaration
[ObservableProperty]
private ObservableCollection<RecentFile> _recentFiles
Field Value
Type Description
ObservableCollection<RecentFile>

_recentFilesService

Declaration
private readonly RecentFilesService _recentFilesService
Field Value
Type Description
RecentFilesService

clearRecentFilesCommand

The backing field for ClearRecentFilesCommand.

Declaration
private RelayCommand? clearRecentFilesCommand
Field Value
Type Description
RelayCommand

Properties

ClearRecentFilesCommand

Gets an IRelayCommand instance wrapping ClearRecentFiles().

Declaration
[ExcludeFromCodeCoverage]
public IRelayCommand ClearRecentFilesCommand { get; }
Property Value
Type Description
IRelayCommand

HasRecentFiles

Declaration
public bool HasRecentFiles { get; }
Property Value
Type Description
bool

ModelFiles

Declaration
[ExcludeFromCodeCoverage]
public ObservableCollection<ModelFileItem> ModelFiles { get; set; }
Property Value
Type Description
ObservableCollection<ModelFileItem>

RecentFiles

Declaration
[ExcludeFromCodeCoverage]
public ObservableCollection<RecentFile> RecentFiles { get; set; }
Property Value
Type Description
ObservableCollection<RecentFile>

Methods

AddRecentFile(string)

Declaration
public void AddRecentFile(string filePath)
Parameters
Type Name Description
string filePath

ClearRecentFiles()

Declaration
[RelayCommand]
private void ClearRecentFiles()

LoadModelFiles()

Declaration
public void LoadModelFiles()

OnModelFilesChanged(ObservableCollection<ModelFileItem>)

Executes the logic for when ModelFiles just changed.

Declaration
private void OnModelFilesChanged(ObservableCollection<ModelFileItem> value)
Parameters
Type Name Description
ObservableCollection<ModelFileItem> value

The new property value that was set.

Remarks

This method is invoked right after the value of ModelFiles is changed.

OnModelFilesChanged(ObservableCollection<ModelFileItem>?, ObservableCollection<ModelFileItem>)

Executes the logic for when ModelFiles just changed.

Declaration
private void OnModelFilesChanged(ObservableCollection<ModelFileItem>? oldValue, ObservableCollection<ModelFileItem> newValue)
Parameters
Type Name Description
ObservableCollection<ModelFileItem> oldValue

The previous property value that was replaced.

ObservableCollection<ModelFileItem> newValue

The new property value that was set.

Remarks

This method is invoked right after the value of ModelFiles is changed.

OnModelFilesChanging(ObservableCollection<ModelFileItem>)

Executes the logic for when ModelFiles is changing.

Declaration
private void OnModelFilesChanging(ObservableCollection<ModelFileItem> value)
Parameters
Type Name Description
ObservableCollection<ModelFileItem> value

The new property value being set.

Remarks

This method is invoked right before the value of ModelFiles is changed.

OnModelFilesChanging(ObservableCollection<ModelFileItem>?, ObservableCollection<ModelFileItem>)

Executes the logic for when ModelFiles is changing.

Declaration
private void OnModelFilesChanging(ObservableCollection<ModelFileItem>? oldValue, ObservableCollection<ModelFileItem> newValue)
Parameters
Type Name Description
ObservableCollection<ModelFileItem> oldValue

The previous property value that is being replaced.

ObservableCollection<ModelFileItem> newValue

The new property value being set.

Remarks

This method is invoked right before the value of ModelFiles is changed.

OnRecentFilesChanged(ObservableCollection<RecentFile>)

Executes the logic for when RecentFiles just changed.

Declaration
private void OnRecentFilesChanged(ObservableCollection<RecentFile> value)
Parameters
Type Name Description
ObservableCollection<RecentFile> value

The new property value that was set.

Remarks

This method is invoked right after the value of RecentFiles is changed.

OnRecentFilesChanged(ObservableCollection<RecentFile>?, ObservableCollection<RecentFile>)

Executes the logic for when RecentFiles just changed.

Declaration
private void OnRecentFilesChanged(ObservableCollection<RecentFile>? oldValue, ObservableCollection<RecentFile> newValue)
Parameters
Type Name Description
ObservableCollection<RecentFile> oldValue

The previous property value that was replaced.

ObservableCollection<RecentFile> newValue

The new property value that was set.

Remarks

This method is invoked right after the value of RecentFiles is changed.

OnRecentFilesChanging(ObservableCollection<RecentFile>)

Executes the logic for when RecentFiles is changing.

Declaration
private void OnRecentFilesChanging(ObservableCollection<RecentFile> value)
Parameters
Type Name Description
ObservableCollection<RecentFile> value

The new property value being set.

Remarks

This method is invoked right before the value of RecentFiles is changed.

OnRecentFilesChanging(ObservableCollection<RecentFile>?, ObservableCollection<RecentFile>)

Executes the logic for when RecentFiles is changing.

Declaration
private void OnRecentFilesChanging(ObservableCollection<RecentFile>? oldValue, ObservableCollection<RecentFile> newValue)
Parameters
Type Name Description
ObservableCollection<RecentFile> oldValue

The previous property value that is being replaced.

ObservableCollection<RecentFile> newValue

The new property value being set.

Remarks

This method is invoked right before the value of RecentFiles is changed.

RefreshRecentFiles()

Declaration
public void RefreshRecentFiles()

RemoveRecentFile(string)

Declaration
public void RemoveRecentFile(string filePath)
Parameters
Type Name Description
string filePath

Implements

INotifyPropertyChanged
INotifyPropertyChanging

Search documentation

Start typing to search the documentation.