mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
Show news on application load.
This commit is contained in:
@@ -6,20 +6,22 @@ namespace Marechai.App.Presentation;
|
||||
|
||||
public partial class MainViewModel : ObservableObject
|
||||
{
|
||||
private INavigator _navigator;
|
||||
private readonly INavigator _navigator;
|
||||
|
||||
[ObservableProperty] private string? name;
|
||||
[ObservableProperty]
|
||||
private string? name;
|
||||
[ObservableProperty]
|
||||
private NewsViewModel? newsViewModel;
|
||||
|
||||
public MainViewModel(
|
||||
IStringLocalizer localizer,
|
||||
IOptions<AppConfig> appInfo,
|
||||
INavigator navigator)
|
||||
public MainViewModel(IStringLocalizer localizer, IOptions<AppConfig> appInfo, INavigator navigator,
|
||||
NewsViewModel newsViewModel)
|
||||
{
|
||||
_navigator = navigator;
|
||||
Title = "Main";
|
||||
Title += $" - {localizer["ApplicationName"]}";
|
||||
Title += $" - {appInfo?.Value?.Environment}";
|
||||
GoToSecond = new AsyncRelayCommand(GoToSecondView);
|
||||
_navigator = navigator;
|
||||
NewsViewModel = newsViewModel;
|
||||
Title = "Marechai";
|
||||
Title += $" - {localizer["ApplicationName"]}";
|
||||
Title += $" - {appInfo?.Value?.Environment}";
|
||||
GoToSecond = new AsyncRelayCommand(GoToSecondView);
|
||||
}
|
||||
|
||||
public string? Title { get; }
|
||||
@@ -30,4 +32,4 @@ public partial class MainViewModel : ObservableObject
|
||||
{
|
||||
await _navigator.NavigateViewModelAsync<SecondViewModel>(this, data: new Entity(Name!));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user