mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Added some of the architecture for the profile editor
This commit is contained in:
parent
b22fcb3c2a
commit
c846d63acf
@ -1,4 +1,5 @@
|
||||
using System.Drawing;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using Artemis.Core.Models.Surface;
|
||||
using Artemis.Core.Plugins.Models;
|
||||
using RGB.NET.Core;
|
||||
@ -42,9 +43,9 @@ namespace Artemis.Core.Plugins.Abstract
|
||||
public abstract void Render(double deltaTime, Surface surface, Graphics graphics);
|
||||
|
||||
/// <summary>
|
||||
/// Called when the module's main view is being shown
|
||||
/// Called when the module's view model is being show, return view models here to create tabs for them
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public abstract IScreen GetMainViewModel();
|
||||
public abstract IEnumerable<ModuleViewModel> GetViewModels();
|
||||
}
|
||||
}
|
||||
@ -4,11 +4,13 @@ namespace Artemis.Core.Plugins.Abstract
|
||||
{
|
||||
public abstract class ModuleViewModel : Screen
|
||||
{
|
||||
protected ModuleViewModel(Module module)
|
||||
protected ModuleViewModel(Module module, string name)
|
||||
{
|
||||
Module = module;
|
||||
Name = name;
|
||||
}
|
||||
|
||||
public string Name { get; }
|
||||
public Module Module { get; }
|
||||
}
|
||||
}
|
||||
@ -15,6 +15,7 @@ using Ninject;
|
||||
using Ninject.Extensions.ChildKernel;
|
||||
using Ninject.Parameters;
|
||||
using RGB.NET.Core;
|
||||
using Serilog;
|
||||
|
||||
namespace Artemis.Core.Services
|
||||
{
|
||||
@ -24,12 +25,14 @@ namespace Artemis.Core.Services
|
||||
public class PluginService : IPluginService
|
||||
{
|
||||
private readonly IKernel _kernel;
|
||||
private readonly ILogger _logger;
|
||||
private readonly List<PluginInfo> _plugins;
|
||||
private IKernel _childKernel;
|
||||
|
||||
internal PluginService(IKernel kernel)
|
||||
internal PluginService(IKernel kernel, ILogger logger)
|
||||
{
|
||||
_kernel = kernel;
|
||||
_logger = logger;
|
||||
_plugins = new List<PluginInfo>();
|
||||
|
||||
// Ensure the plugins directory exists
|
||||
@ -114,7 +117,9 @@ namespace Artemis.Core.Services
|
||||
// Load the metadata
|
||||
var metadataFile = Path.Combine(subDirectory.FullName, "plugin.json");
|
||||
if (!File.Exists(metadataFile))
|
||||
throw new ArtemisPluginException("Couldn't find the plugins metadata file at " + metadataFile);
|
||||
{
|
||||
_logger.Warning(new ArtemisPluginException("Couldn't find the plugins metadata file at " + metadataFile), "Plugin exception");
|
||||
}
|
||||
|
||||
// Locate the main entry
|
||||
var pluginInfo = JsonConvert.DeserializeObject<PluginInfo>(File.ReadAllText(metadataFile));
|
||||
@ -124,14 +129,21 @@ namespace Artemis.Core.Services
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new ArtemisPluginException("Failed to load plugin", e);
|
||||
_logger.Warning(new ArtemisPluginException("Failed to load plugin", e), "Plugin exception");
|
||||
}
|
||||
}
|
||||
|
||||
// Activate plugins after they are all loaded
|
||||
foreach (var pluginInfo in _plugins.Where(p => p.Enabled))
|
||||
{
|
||||
pluginInfo.Instance.EnablePlugin();
|
||||
try
|
||||
{
|
||||
pluginInfo.Instance.EnablePlugin();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_logger.Warning(new ArtemisPluginException(pluginInfo, "Failed to load enable plugin", e), "Plugin exception");
|
||||
}
|
||||
OnPluginEnabled(new PluginEventArgs(pluginInfo));
|
||||
}
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Linq;
|
||||
@ -6,15 +7,14 @@ using Artemis.Core.Models.Surface;
|
||||
using Artemis.Core.Plugins.Abstract;
|
||||
using Artemis.Core.Plugins.Models;
|
||||
using Artemis.Plugins.Modules.General.ViewModels;
|
||||
using Stylet;
|
||||
using Device = Artemis.Core.Models.Surface.Device;
|
||||
|
||||
namespace Artemis.Plugins.Modules.General
|
||||
{
|
||||
public class GeneralModule : Module
|
||||
{
|
||||
private readonly PluginSettings _settings;
|
||||
private readonly ColorBlend _rainbowColorBlend;
|
||||
private readonly PluginSettings _settings;
|
||||
|
||||
public GeneralModule(PluginInfo pluginInfo, PluginSettings settings) : base(pluginInfo)
|
||||
{
|
||||
@ -118,9 +118,9 @@ namespace Artemis.Plugins.Modules.General
|
||||
}
|
||||
}
|
||||
|
||||
public override IScreen GetMainViewModel()
|
||||
public override IEnumerable<ModuleViewModel> GetViewModels()
|
||||
{
|
||||
return new GeneralViewModel(this);
|
||||
return new List<ModuleViewModel> {new GeneralViewModel(this)};
|
||||
}
|
||||
|
||||
public override void Dispose()
|
||||
|
||||
@ -5,7 +5,7 @@ namespace Artemis.Plugins.Modules.General.ViewModels
|
||||
{
|
||||
public class GeneralViewModel : ModuleViewModel
|
||||
{
|
||||
public GeneralViewModel(Module module) : base(module)
|
||||
public GeneralViewModel(Module module) : base(module, "General")
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,8 @@
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:s="https://github.com/canton7/Stylet"
|
||||
xmlns:local="clr-namespace:Artemis.UI">
|
||||
xmlns:local="clr-namespace:Artemis.UI"
|
||||
xmlns:dragablz="http://dragablz.net/winfx/xaml/dragablz">
|
||||
|
||||
<Application.Resources>
|
||||
<ResourceDictionary>
|
||||
@ -28,6 +29,9 @@
|
||||
Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.Teal.xaml" />
|
||||
<ResourceDictionary
|
||||
Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Teal.xaml" />
|
||||
|
||||
<!-- Include the Dragablz Material Design style -->
|
||||
<ResourceDictionary Source="pack://application:,,,/Dragablz;component/Themes/materialdesign.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<!-- MahApps Brushes -->
|
||||
@ -54,6 +58,9 @@
|
||||
<SolidColorBrush x:Key="MahApps.Metro.Brushes.ToggleSwitchButton.ThumbIndicatorCheckedBrush.Win10"
|
||||
Color="{DynamicResource Primary500Foreground}" />
|
||||
|
||||
<!-- tell Dragablz tab control to use the Material Design theme -->
|
||||
<Style TargetType="{x:Type dragablz:TabablzControl}" BasedOn="{StaticResource MaterialDesignTabablzControlStyle}" />
|
||||
|
||||
<!-- Some general convertes etc. -->
|
||||
<BooleanToVisibilityConverter x:Key="BoolToVisibilityConverter" />
|
||||
|
||||
|
||||
@ -69,6 +69,9 @@
|
||||
<Reference Include="ControlzEx, Version=3.0.2.4, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ControlzEx.3.0.2.4\lib\net462\ControlzEx.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dragablz, Version=0.0.3.203, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dragablz.0.0.3.203\lib\net45\Dragablz.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="FluentValidation, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7de548da2fbae0f0, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\FluentValidation.8.5.0\lib\net45\FluentValidation.dll</HintPath>
|
||||
</Reference>
|
||||
@ -163,6 +166,7 @@
|
||||
<Compile Include="Converters\NullToVisibilityConverter.cs" />
|
||||
<Compile Include="Extensions\RgbColorExtensions.cs" />
|
||||
<Compile Include="Extensions\RgbRectangleExtensions.cs" />
|
||||
<Compile Include="Ninject\Factories\ModuleViewModelFactory.cs" />
|
||||
<Compile Include="Ninject\UIModule.cs" />
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
@ -176,30 +180,33 @@
|
||||
<Compile Include="Stylet\FluentValidationAdapter.cs" />
|
||||
<Compile Include="Stylet\NinjectBootstrapper.cs" />
|
||||
<Compile Include="ViewModels\Controls\ProfileEditor\ProfileDeviceViewModel.cs" />
|
||||
<Compile Include="ViewModels\Controls\ProfileEditor\ProfileEditorViewModel.cs" />
|
||||
<Compile Include="ViewModels\Controls\ProfileEditor\ProfileLedViewModel.cs" />
|
||||
<Compile Include="ViewModels\Controls\SurfaceEditor\SurfaceLedViewModel.cs" />
|
||||
<Compile Include="ViewModels\Controls\SurfaceEditor\SurfaceDeviceViewModel.cs" />
|
||||
<Compile Include="ViewModels\Dialogs\ConfirmDialogViewModel.cs" />
|
||||
<Compile Include="ViewModels\Dialogs\SurfaceCreateViewModelValidator.cs" />
|
||||
<Compile Include="ViewModels\Dialogs\SurfaceCreateViewModel.cs" />
|
||||
<Compile Include="ViewModels\Screens\ModuleRootViewModel.cs" />
|
||||
<Compile Include="ViewModels\Screens\SplashViewModel.cs" />
|
||||
<Compile Include="ViewModels\Utilities\DialogViewModelHost.cs" />
|
||||
<Compile Include="ViewModels\Dialogs\DialogViewModelBase.cs" />
|
||||
<Compile Include="ViewModels\Utilities\PanZoomViewModel.cs" />
|
||||
<Compile Include="ViewModels\Screens\DebugViewModel.cs" />
|
||||
<Compile Include="ViewModels\Screens\SurfaceEditorViewModel.cs" />
|
||||
<Compile Include="ViewModels\Interfaces\IEditorViewModel.cs" />
|
||||
<Compile Include="ViewModels\Controls\Settings\DeviceSettingsViewModel.cs" />
|
||||
<Compile Include="ViewModels\Interfaces\IHomeViewModel.cs" />
|
||||
<Compile Include="ViewModels\Interfaces\IScreenViewModel.cs" />
|
||||
<Compile Include="ViewModels\Screens\HomeViewModel.cs" />
|
||||
<Compile Include="ViewModels\Interfaces\ISettingsViewModel.cs" />
|
||||
<Compile Include="ViewModels\Screens\RootViewModel.cs" />
|
||||
<Compile Include="App.xaml.cs">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ViewModels\Screens\SettingsViewModel.cs" />
|
||||
<Page Include="Views\Controls\ProfileEditor\ProfileEditorView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\Controls\SurfaceEditor\SurfaceLedView.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
@ -232,6 +239,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\Screens\ModuleRootView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\Screens\RootView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
||||
10
src/Artemis.UI/Ninject/Factories/ModuleViewModelFactory.cs
Normal file
10
src/Artemis.UI/Ninject/Factories/ModuleViewModelFactory.cs
Normal file
@ -0,0 +1,10 @@
|
||||
using Artemis.Core.Plugins.Abstract;
|
||||
using Artemis.UI.ViewModels.Screens;
|
||||
|
||||
namespace Artemis.UI.Ninject.Factories
|
||||
{
|
||||
public interface IModuleViewModelFactory
|
||||
{
|
||||
ModuleRootViewModel CreateModuleViewModel(Module module);
|
||||
}
|
||||
}
|
||||
@ -1,9 +1,11 @@
|
||||
using Artemis.UI.Services.Interfaces;
|
||||
using Artemis.UI.Ninject.Factories;
|
||||
using Artemis.UI.Services.Interfaces;
|
||||
using Artemis.UI.Stylet;
|
||||
using Artemis.UI.ViewModels.Dialogs;
|
||||
using Artemis.UI.ViewModels.Interfaces;
|
||||
using FluentValidation;
|
||||
using Ninject.Extensions.Conventions;
|
||||
using Ninject.Extensions.Factory;
|
||||
using Ninject.Modules;
|
||||
using Stylet;
|
||||
|
||||
@ -32,6 +34,9 @@ namespace Artemis.UI.Ninject
|
||||
.BindAllBaseClasses();
|
||||
});
|
||||
|
||||
// Bind the module VM
|
||||
Bind<IModuleViewModelFactory>().ToFactory();
|
||||
|
||||
// Bind all UI services as singletons
|
||||
Kernel.Bind(x =>
|
||||
{
|
||||
|
||||
@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Artemis.Core.Plugins.Abstract;
|
||||
|
||||
namespace Artemis.UI.ViewModels.Controls.ProfileEditor
|
||||
{
|
||||
public class ProfileEditorViewModel : ModuleViewModel
|
||||
{
|
||||
public ProfileEditorViewModel(Module module) : base(module, "Profile Editor")
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,7 +0,0 @@
|
||||
namespace Artemis.UI.ViewModels.Interfaces
|
||||
{
|
||||
public interface ISurfaceEditorViewModel : IScreenViewModel
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,7 +0,0 @@
|
||||
namespace Artemis.UI.ViewModels.Interfaces
|
||||
{
|
||||
public interface IHomeViewModel : IScreenViewModel
|
||||
{
|
||||
void OpenUrl(string url);
|
||||
}
|
||||
}
|
||||
@ -1,6 +0,0 @@
|
||||
namespace Artemis.UI.ViewModels.Interfaces
|
||||
{
|
||||
public interface ISettingsViewModel : IScreenViewModel
|
||||
{
|
||||
}
|
||||
}
|
||||
@ -7,11 +7,12 @@ using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using Artemis.Core.Events;
|
||||
using Artemis.Core.Services.Interfaces;
|
||||
using Artemis.UI.ViewModels.Interfaces;
|
||||
using Stylet;
|
||||
|
||||
namespace Artemis.UI.ViewModels.Screens
|
||||
{
|
||||
public class DebugViewModel : Screen
|
||||
public class DebugViewModel : Screen, IScreenViewModel
|
||||
{
|
||||
private readonly ICoreService _coreService;
|
||||
private readonly IRgbService _rgbService;
|
||||
@ -76,5 +77,7 @@ namespace Artemis.UI.ViewModels.Screens
|
||||
[DllImport("gdi32.dll", EntryPoint = "DeleteObject")]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
public static extern bool DeleteObject([In] IntPtr hObject);
|
||||
|
||||
public string Title => "Debugger";
|
||||
}
|
||||
}
|
||||
@ -5,7 +5,7 @@ using Stylet;
|
||||
|
||||
namespace Artemis.UI.ViewModels.Screens
|
||||
{
|
||||
public class HomeViewModel : Screen, IHomeViewModel
|
||||
public class HomeViewModel : Screen, IScreenViewModel
|
||||
{
|
||||
public string Title => "Home";
|
||||
|
||||
|
||||
21
src/Artemis.UI/ViewModels/Screens/ModuleRootViewModel.cs
Normal file
21
src/Artemis.UI/ViewModels/Screens/ModuleRootViewModel.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using Artemis.Core.Plugins.Abstract;
|
||||
using Artemis.UI.ViewModels.Controls.ProfileEditor;
|
||||
using Stylet;
|
||||
|
||||
namespace Artemis.UI.ViewModels.Screens
|
||||
{
|
||||
public class ModuleRootViewModel : Screen
|
||||
{
|
||||
public ModuleRootViewModel(Module module)
|
||||
{
|
||||
Module = module;
|
||||
ModuleViewModels = new BindableCollection<ModuleViewModel> {new ProfileEditorViewModel(Module)};
|
||||
ModuleViewModels.AddRange(Module.GetViewModels());
|
||||
}
|
||||
|
||||
public Module Module { get; }
|
||||
public BindableCollection<ModuleViewModel> ModuleViewModels { get; set; }
|
||||
|
||||
public int FixedHeaderCount => ModuleViewModels.Count;
|
||||
}
|
||||
}
|
||||
@ -1,11 +1,13 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Controls;
|
||||
using Artemis.Core.Events;
|
||||
using Artemis.Core.Plugins.Abstract;
|
||||
using Artemis.Core.Services.Interfaces;
|
||||
using Artemis.UI.Ninject.Factories;
|
||||
using Artemis.UI.ViewModels.Interfaces;
|
||||
using Stylet;
|
||||
|
||||
@ -15,11 +17,13 @@ namespace Artemis.UI.ViewModels.Screens
|
||||
{
|
||||
private readonly ICollection<IScreenViewModel> _artemisViewModels;
|
||||
private readonly IPluginService _pluginService;
|
||||
private readonly IModuleViewModelFactory _moduleViewModelFactory;
|
||||
|
||||
public RootViewModel(ICollection<IScreenViewModel> artemisViewModels, IPluginService pluginService)
|
||||
public RootViewModel(ICollection<IScreenViewModel> artemisViewModels, IPluginService pluginService, IModuleViewModelFactory moduleViewModelFactory)
|
||||
{
|
||||
_artemisViewModels = artemisViewModels;
|
||||
_pluginService = pluginService;
|
||||
_moduleViewModelFactory = moduleViewModelFactory;
|
||||
|
||||
// Add the built-in items
|
||||
Items.AddRange(artemisViewModels);
|
||||
@ -28,7 +32,7 @@ namespace Artemis.UI.ViewModels.Screens
|
||||
|
||||
// Sync up with the plugin service
|
||||
Modules = new BindableCollection<Module>();
|
||||
// Modules.AddRange(_pluginService.GetPluginsOfType<Module>());
|
||||
Modules.AddRange(_pluginService.GetPluginsOfType<Module>());
|
||||
|
||||
_pluginService.PluginEnabled += PluginServiceOnPluginEnabled;
|
||||
_pluginService.PluginDisabled += PluginServiceOnPluginDisabled;
|
||||
@ -47,8 +51,7 @@ namespace Artemis.UI.ViewModels.Screens
|
||||
return;
|
||||
|
||||
// Create a view model for the given plugin info (which will be a module)
|
||||
var viewModel = await Task.Run(() => SelectedModule.GetMainViewModel());
|
||||
// Tell Stylet to active the view model, the view manager will compile and show the XAML
|
||||
var viewModel = await Task.Run(() => _moduleViewModelFactory.CreateModuleViewModel(SelectedModule));
|
||||
ActivateItem(viewModel);
|
||||
|
||||
SelectedPage = null;
|
||||
|
||||
@ -8,7 +8,7 @@ using Stylet;
|
||||
|
||||
namespace Artemis.UI.ViewModels.Screens
|
||||
{
|
||||
public class SettingsViewModel : Screen, ISettingsViewModel
|
||||
public class SettingsViewModel : Screen, IScreenViewModel
|
||||
{
|
||||
private readonly ICoreService _coreService;
|
||||
private readonly IKernel _kernel;
|
||||
|
||||
@ -1,9 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Artemis.Core.Services.Interfaces;
|
||||
using Artemis.Core.Services.Interfaces;
|
||||
using Ninject;
|
||||
using Stylet;
|
||||
|
||||
@ -26,6 +21,7 @@ namespace Artemis.UI.ViewModels.Screens
|
||||
var pluginService = _kernel.Get<IPluginService>();
|
||||
pluginService.CopyingBuildInPlugins += (sender, args) => Status = "Updating built-in plugins";
|
||||
pluginService.PluginLoading += (sender, args) => Status = "Loading plugin: " + args.PluginInfo.Name;
|
||||
pluginService.PluginLoaded += (sender, args) => Status = "Initializing UI";
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -17,7 +17,7 @@ using Stylet;
|
||||
|
||||
namespace Artemis.UI.ViewModels.Screens
|
||||
{
|
||||
public class SurfaceEditorViewModel : Screen, ISurfaceEditorViewModel
|
||||
public class SurfaceEditorViewModel : Screen, IScreenViewModel
|
||||
{
|
||||
private readonly IDialogService _dialogService;
|
||||
private readonly ISurfaceService _surfaceService;
|
||||
|
||||
@ -0,0 +1,14 @@
|
||||
<UserControl x:Class="Artemis.UI.Views.Controls.ProfileEditor.ProfileEditorView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:Artemis.UI.Views.Controls.ProfileEditor"
|
||||
xmlns:profileEditor="clr-namespace:Artemis.UI.ViewModels.Controls.ProfileEditor"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800"
|
||||
d:DataContext="{d:DesignInstance {x:Type profileEditor:ProfileEditorViewModel}}">
|
||||
<Grid>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@ -4,7 +4,6 @@
|
||||
xmlns:s="https://github.com/canton7/Stylet"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:vms="clr-namespace:Artemis.UI.ViewModels"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:screens="clr-namespace:Artemis.UI.ViewModels.Screens"
|
||||
mc:Ignorable="d"
|
||||
|
||||
25
src/Artemis.UI/Views/Screens/ModuleRootView.xaml
Normal file
25
src/Artemis.UI/Views/Screens/ModuleRootView.xaml
Normal file
@ -0,0 +1,25 @@
|
||||
<UserControl x:Class="Artemis.UI.Views.Screens.ModuleRootView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:Artemis.UI.Views.Screens"
|
||||
xmlns:screens="clr-namespace:Artemis.UI.ViewModels.Screens"
|
||||
xmlns:dragablz="http://dragablz.net/winfx/xaml/dragablz"
|
||||
xmlns:s="https://github.com/canton7/Stylet"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800"
|
||||
d:DataContext="{d:DesignInstance screens:ModuleRootViewModel}">
|
||||
<dragablz:TabablzControl Margin="0 -1 0 0" FixedHeaderCount="{Binding FixedHeaderCount}" ItemsSource="{Binding ModuleViewModels}">
|
||||
<dragablz:TabablzControl.HeaderItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Name}" />
|
||||
</DataTemplate>
|
||||
</dragablz:TabablzControl.HeaderItemTemplate>
|
||||
<dragablz:TabablzControl.ContentTemplate>
|
||||
<DataTemplate>
|
||||
<ContentControl s:View.Model="{Binding}" />
|
||||
</DataTemplate>
|
||||
</dragablz:TabablzControl.ContentTemplate>
|
||||
</dragablz:TabablzControl>
|
||||
</UserControl>
|
||||
@ -114,7 +114,7 @@
|
||||
</DockPanel>
|
||||
</materialDesign:DrawerHost.LeftDrawerContent>
|
||||
<DockPanel>
|
||||
<materialDesign:ColorZone Padding="16"
|
||||
<materialDesign:ColorZone Padding="10"
|
||||
materialDesign:ShadowAssist.ShadowDepth="Depth2"
|
||||
Mode="PrimaryMid"
|
||||
DockPanel.Dock="Top">
|
||||
@ -134,6 +134,7 @@
|
||||
<Button Content="Goodbye" />
|
||||
</StackPanel>
|
||||
</materialDesign:PopupBox>
|
||||
|
||||
<TextBlock HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="22"
|
||||
|
||||
@ -1,24 +1,22 @@
|
||||
<mah:MetroWindow x:Class="Artemis.UI.Views.Screens.SplashView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:Artemis.UI.Views.Screens"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
|
||||
xmlns:screens="clr-namespace:Artemis.UI.ViewModels.Screens"
|
||||
mc:Ignorable="d"
|
||||
Title="Artemis"
|
||||
Height="450"
|
||||
Width="450"
|
||||
ShowTitleBar="False"
|
||||
ShowMaxRestoreButton="False"
|
||||
ShowCloseButton="False"
|
||||
ShowMinButton="False"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
GlowBrush="{DynamicResource AccentColorBrush}"
|
||||
FontFamily="{StaticResource DefaultFont}"
|
||||
d:DataContext="{d:DesignInstance screens:SplashViewModel}">
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
|
||||
xmlns:screens="clr-namespace:Artemis.UI.ViewModels.Screens"
|
||||
mc:Ignorable="d"
|
||||
Title="Artemis"
|
||||
Height="450"
|
||||
Width="450"
|
||||
ShowTitleBar="False"
|
||||
ShowMaxRestoreButton="False"
|
||||
ShowCloseButton="False"
|
||||
ShowMinButton="False"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
GlowBrush="{DynamicResource AccentColorBrush}"
|
||||
FontFamily="{StaticResource DefaultFont}"
|
||||
d:DataContext="{d:DesignInstance screens:SplashViewModel}">
|
||||
<Grid Background="{DynamicResource PrimaryHueMidBrush}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="250" />
|
||||
@ -28,7 +26,7 @@
|
||||
</Grid.RowDefinitions>
|
||||
<Image Source="{StaticResource BowIcon}" Stretch="Uniform" Margin="6,50,6,6" />
|
||||
<TextBlock Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Bottom" Foreground="White" FontSize="16">Artemis is initializing...</TextBlock>
|
||||
<TextBlock Grid.Row="2" HorizontalAlignment="Center" Foreground="#FFDDDDDD" Text="{Binding Status}"/>
|
||||
<ProgressBar Grid.Row="3" IsIndeterminate="True" Maximum="1" Minimum="1" Margin="16 0"/>
|
||||
<TextBlock Grid.Row="2" HorizontalAlignment="Center" Foreground="#FFDDDDDD" Text="{Binding Status}" />
|
||||
<ProgressBar Grid.Row="3" IsIndeterminate="True" Maximum="1" Minimum="1" Margin="16 0" />
|
||||
</Grid>
|
||||
</mah:MetroWindow>
|
||||
@ -2,6 +2,7 @@
|
||||
<packages>
|
||||
<package id="Castle.Core" version="4.4.0" targetFramework="net461" />
|
||||
<package id="ControlzEx" version="3.0.2.4" targetFramework="net472" />
|
||||
<package id="Dragablz" version="0.0.3.203" targetFramework="net472" />
|
||||
<package id="FluentValidation" version="8.5.0" targetFramework="net472" />
|
||||
<package id="Fody" version="5.0.6" targetFramework="net472" developmentDependency="true" />
|
||||
<package id="Humanizer.Core" version="2.6.2" targetFramework="net461" />
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user