mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +00:00
Project cleanup
This commit is contained in:
1 parent
418b3adea7
commit
8d9076a241
27 files changed
+387
-141
No files matched your search
@@ -5,7 +5,7 @@ using Stylet;
|
||||
|
||||
namespace Artemis.UI.ViewModels
|
||||
{
|
||||
public class HomeViewModel : Screen, IMainViewModel
|
||||
public class HomeViewModel : Screen, IHomeViewModel
|
||||
{
|
||||
public string Title => "Home";
|
||||
|
||||
@@ -16,8 +16,4 @@ namespace Artemis.UI.ViewModels
|
||||
Process.Start(url);
|
||||
}
|
||||
}
|
||||
|
||||
public interface IMainViewModel : IArtemisViewModel
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace Artemis.UI.ViewModels.Interfaces
|
||||
{
|
||||
public interface IHomeViewModel : IArtemisViewModel
|
||||
{
|
||||
void OpenUrl(string url);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace Artemis.UI.ViewModels.Interfaces
|
||||
{
|
||||
public interface ISettingsViewModel : IArtemisViewModel
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -7,12 +7,37 @@ namespace Artemis.UI.ViewModels
|
||||
{
|
||||
public class RootViewModel : Conductor<IArtemisViewModel>.Collection.OneActive
|
||||
{
|
||||
private readonly ICollection<IArtemisViewModel> _artemisViewModels;
|
||||
|
||||
public RootViewModel(ICollection<IArtemisViewModel> artemisViewModels)
|
||||
{
|
||||
_artemisViewModels = artemisViewModels;
|
||||
// Add the built-in items
|
||||
Items.AddRange(artemisViewModels);
|
||||
// Activate the home item
|
||||
ActiveItem = artemisViewModels.First(v => v.GetType() == typeof(HomeViewModel));
|
||||
ActiveItem = _artemisViewModels.First(v => v.GetType() == typeof(HomeViewModel));
|
||||
}
|
||||
|
||||
public bool MenuOpen { get; set; }
|
||||
|
||||
public void NavigateToHome()
|
||||
{
|
||||
ActivateItem(_artemisViewModels.First(v => v.GetType() == typeof(HomeViewModel)));
|
||||
MenuOpen = false;
|
||||
}
|
||||
|
||||
public void NavigateToNews()
|
||||
{
|
||||
}
|
||||
|
||||
public void NavigateToWorkshop()
|
||||
{
|
||||
}
|
||||
|
||||
public void NavigateToSettings()
|
||||
{
|
||||
ActivateItem(_artemisViewModels.First(v => v.GetType() == typeof(SettingsViewModel)));
|
||||
MenuOpen = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using Artemis.UI.ViewModels.Interfaces;
|
||||
using Stylet;
|
||||
|
||||
namespace Artemis.UI.ViewModels
|
||||
{
|
||||
public class SettingsViewModel : Screen, ISettingsViewModel
|
||||
{
|
||||
public string Title => "Settings";
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user