mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 19:36:28 +00:00
Project cleanup
This commit is contained in:
1 parent
418b3adea7
commit
8d9076a241
27 files changed
+387
-141
No files matched your search
@@ -1,8 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
|
||||
</startup>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
|
||||
</startup>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
|
||||
+36
-26
@@ -17,44 +17,54 @@
|
||||
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />
|
||||
<ResourceDictionary
|
||||
Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />
|
||||
|
||||
<!-- Material Design -->
|
||||
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.Teal.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Teal.xaml" />
|
||||
<ResourceDictionary
|
||||
Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml" />
|
||||
<ResourceDictionary
|
||||
Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
|
||||
<ResourceDictionary
|
||||
Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.Teal.xaml" />
|
||||
<ResourceDictionary
|
||||
Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Teal.xaml" />
|
||||
|
||||
<!-- Material Design: MahApps Compatibility -->
|
||||
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.MahApps;component/Themes/MaterialDesignTheme.MahApps.Fonts.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.MahApps;component/Themes/MaterialDesignTheme.MahApps.Flyout.xaml" />
|
||||
<ResourceDictionary
|
||||
Source="pack://application:,,,/MaterialDesignThemes.MahApps;component/Themes/MaterialDesignTheme.MahApps.Fonts.xaml" />
|
||||
<ResourceDictionary
|
||||
Source="pack://application:,,,/MaterialDesignThemes.MahApps;component/Themes/MaterialDesignTheme.MahApps.Flyout.xaml" />
|
||||
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<!-- MahApps Brushes -->
|
||||
<SolidColorBrush x:Key="HighlightBrush" Color="{DynamicResource Primary700}"/>
|
||||
<SolidColorBrush x:Key="HighlightBrush" Color="{DynamicResource Primary700}" />
|
||||
<SolidColorBrush x:Key="AccentBaseColorBrush" Color="{DynamicResource Primary600}" />
|
||||
<SolidColorBrush x:Key="AccentColorBrush" Color="{DynamicResource Primary500}"/>
|
||||
<SolidColorBrush x:Key="AccentColorBrush2" Color="{DynamicResource Primary400}"/>
|
||||
<SolidColorBrush x:Key="AccentColorBrush3" Color="{DynamicResource Primary300}"/>
|
||||
<SolidColorBrush x:Key="AccentColorBrush4" Color="{DynamicResource Primary200}"/>
|
||||
<SolidColorBrush x:Key="WindowTitleColorBrush" Color="{DynamicResource Primary700}"/>
|
||||
<SolidColorBrush x:Key="AccentSelectedColorBrush" Color="{DynamicResource Primary500Foreground}"/>
|
||||
<SolidColorBrush x:Key="AccentColorBrush" Color="{DynamicResource Primary500}" />
|
||||
<SolidColorBrush x:Key="AccentColorBrush2" Color="{DynamicResource Primary400}" />
|
||||
<SolidColorBrush x:Key="AccentColorBrush3" Color="{DynamicResource Primary300}" />
|
||||
<SolidColorBrush x:Key="AccentColorBrush4" Color="{DynamicResource Primary200}" />
|
||||
<SolidColorBrush x:Key="WindowTitleColorBrush" Color="{DynamicResource Primary700}" />
|
||||
<SolidColorBrush x:Key="AccentSelectedColorBrush" Color="{DynamicResource Primary500Foreground}" />
|
||||
<LinearGradientBrush x:Key="ProgressBrush" EndPoint="0.001,0.5" StartPoint="1.002,0.5">
|
||||
<GradientStop Color="{DynamicResource Primary700}" Offset="0"/>
|
||||
<GradientStop Color="{DynamicResource Primary300}" Offset="1"/>
|
||||
<GradientStop Color="{DynamicResource Primary700}" Offset="0" />
|
||||
<GradientStop Color="{DynamicResource Primary300}" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<SolidColorBrush x:Key="CheckmarkFill" Color="{DynamicResource Primary500}"/>
|
||||
<SolidColorBrush x:Key="RightArrowFill" Color="{DynamicResource Primary500}"/>
|
||||
<SolidColorBrush x:Key="IdealForegroundColorBrush" Color="{DynamicResource Primary500Foreground}"/>
|
||||
<SolidColorBrush x:Key="IdealForegroundDisabledBrush" Color="{DynamicResource Primary500}" Opacity="0.4"/>
|
||||
<SolidColorBrush x:Key="MahApps.Metro.Brushes.ToggleSwitchButton.OnSwitchBrush.Win10" Color="{DynamicResource Primary500}" />
|
||||
<SolidColorBrush x:Key="MahApps.Metro.Brushes.ToggleSwitchButton.OnSwitchMouseOverBrush.Win10" Color="{DynamicResource Primary400}" />
|
||||
<SolidColorBrush x:Key="MahApps.Metro.Brushes.ToggleSwitchButton.ThumbIndicatorCheckedBrush.Win10" Color="{DynamicResource Primary500Foreground}" />
|
||||
|
||||
<SolidColorBrush x:Key="CheckmarkFill" Color="{DynamicResource Primary500}" />
|
||||
<SolidColorBrush x:Key="RightArrowFill" Color="{DynamicResource Primary500}" />
|
||||
<SolidColorBrush x:Key="IdealForegroundColorBrush" Color="{DynamicResource Primary500Foreground}" />
|
||||
<SolidColorBrush x:Key="IdealForegroundDisabledBrush" Color="{DynamicResource Primary500}" Opacity="0.4" />
|
||||
<SolidColorBrush x:Key="MahApps.Metro.Brushes.ToggleSwitchButton.OnSwitchBrush.Win10"
|
||||
Color="{DynamicResource Primary500}" />
|
||||
<SolidColorBrush x:Key="MahApps.Metro.Brushes.ToggleSwitchButton.OnSwitchMouseOverBrush.Win10"
|
||||
Color="{DynamicResource Primary400}" />
|
||||
<SolidColorBrush x:Key="MahApps.Metro.Brushes.ToggleSwitchButton.ThumbIndicatorCheckedBrush.Win10"
|
||||
Color="{DynamicResource Primary500Foreground}" />
|
||||
|
||||
<!-- Some general convertes etc. -->
|
||||
<BooleanToVisibilityConverter x:Key="BoolToVisibilityConverter" />
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
|
||||
</Application>
|
||||
|
||||
</Application>
|
||||
@@ -94,13 +94,16 @@
|
||||
<Compile Include="Bootstrapper.cs" />
|
||||
<Compile Include="Ninject\UIModule.cs" />
|
||||
<Compile Include="Stylet\NinjectBootstrapper.cs" />
|
||||
<Compile Include="ViewModels\Interfaces\IHomeViewModel.cs" />
|
||||
<Compile Include="ViewModels\Interfaces\IArtemisViewModel.cs" />
|
||||
<Compile Include="ViewModels\HomeViewModel.cs" />
|
||||
<Compile Include="ViewModels\Interfaces\ISettingsViewModel.cs" />
|
||||
<Compile Include="ViewModels\RootViewModel.cs" />
|
||||
<Compile Include="App.xaml.cs">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ViewModels\SettingsViewModel.cs" />
|
||||
<Page Include="Views\HomeView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@@ -109,6 +112,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\SettingsView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
|
||||
@@ -4,14 +4,18 @@ using Ninject.Modules;
|
||||
|
||||
namespace Artemis.UI.Ninject
|
||||
{
|
||||
// ReSharper disable once InconsistentNaming
|
||||
public class UIModule : NinjectModule
|
||||
{
|
||||
public override void Load()
|
||||
{
|
||||
// Bind all viewmodels
|
||||
// Bind all built-in viewmodels
|
||||
Kernel.Bind(x =>
|
||||
{
|
||||
x.FromThisAssembly().SelectAllClasses().InheritedFrom<IArtemisViewModel>().BindAllInterfaces();
|
||||
x.FromThisAssembly()
|
||||
.SelectAllClasses()
|
||||
.InheritedFrom<IArtemisViewModel>()
|
||||
.BindAllInterfaces();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,8 @@
|
||||
Title="Artemis"
|
||||
d:DesignHeight="639.411"
|
||||
d:DesignWidth="1113.251"
|
||||
d:DataContext="{d:DesignInstance vms:RootViewModel}">
|
||||
d:DataContext="{d:DesignInstance vms:RootViewModel}"
|
||||
Icon="/Artemis.UI;component/Resources/logo-512.png">
|
||||
<metro:MetroWindow.Resources>
|
||||
<DrawingImage x:Key="BowIcon">
|
||||
<DrawingImage.Drawing>
|
||||
@@ -75,9 +76,82 @@
|
||||
HorizontalAlignment="Right"
|
||||
Margin="16"
|
||||
IsChecked="{Binding ElementName=MenuToggleButton, Path=IsChecked, Mode=TwoWay}" />
|
||||
<ListBox Margin="0 16 0 16" SelectedIndex="0">
|
||||
|
||||
|
||||
<!-- Built-in pages -->
|
||||
<ListBox Margin="0 16 0 16"
|
||||
SelectedIndex="0"
|
||||
DockPanel.Dock="Top">
|
||||
<ListBoxItem PreviewMouseLeftButtonUp="{s:Action NavigateToHome}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon Kind="Home"
|
||||
Margin="0,0,8,0" />
|
||||
<TextBlock>Home</TextBlock>
|
||||
</StackPanel>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem PreviewMouseLeftButtonUp="{s:Action NavigateToNews}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon Kind="Newspaper"
|
||||
Margin="0,0,8,0" />
|
||||
<TextBlock>News</TextBlock>
|
||||
</StackPanel>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem PreviewMouseLeftButtonUp="{s:Action NavigateToWorkshop}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon Kind="TestTube"
|
||||
Margin="0,0,8,0" />
|
||||
<TextBlock>Workshop</TextBlock>
|
||||
</StackPanel>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem PreviewMouseLeftButtonUp="{s:Action NavigateToSettings}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon Kind="Settings"
|
||||
Margin="0,0,8,0" />
|
||||
<TextBlock>Settings</TextBlock>
|
||||
</StackPanel>
|
||||
</ListBoxItem>
|
||||
</ListBox>
|
||||
|
||||
<!-- Modules -->
|
||||
<TextBlock Margin="8,8,0,8"
|
||||
DockPanel.Dock="Top">
|
||||
Modules
|
||||
</TextBlock>
|
||||
<Border BorderThickness="0 1 0 0"
|
||||
BorderBrush="{DynamicResource MaterialDesignDivider}">
|
||||
<ScrollViewer DockPanel.Dock="Top">
|
||||
<ListBox Margin="0 0 0 16"
|
||||
SelectedIndex="0">
|
||||
<ListBoxItem>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon Kind="Home"
|
||||
Margin="0,0,8,0" />
|
||||
<TextBlock>Home</TextBlock>
|
||||
</StackPanel>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon Kind="Newspaper"
|
||||
Margin="0,0,8,0" />
|
||||
<TextBlock>News</TextBlock>
|
||||
</StackPanel>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon Kind="TestTube"
|
||||
Margin="0,0,8,0" />
|
||||
<TextBlock>Workshop</TextBlock>
|
||||
</StackPanel>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon Kind="Settings"
|
||||
Margin="0,0,8,0" />
|
||||
<TextBlock>Settings</TextBlock>
|
||||
</StackPanel>
|
||||
</ListBoxItem>
|
||||
</ListBox>
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
</DockPanel>
|
||||
</materialDesign:DrawerHost.LeftDrawerContent>
|
||||
<DockPanel>
|
||||
@@ -87,7 +161,7 @@
|
||||
DockPanel.Dock="Top">
|
||||
<DockPanel>
|
||||
<ToggleButton Style="{StaticResource MaterialDesignHamburgerToggleButton}"
|
||||
IsChecked="False"
|
||||
IsChecked="{Binding MenuOpen}"
|
||||
x:Name="MenuToggleButton" />
|
||||
<materialDesign:PopupBox DockPanel.Dock="Right"
|
||||
PlacementMode="BottomAndAlignRightEdges"
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<UserControl x:Class="Artemis.UI.Views.SettingsView"
|
||||
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"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="300" d:DesignWidth="300">
|
||||
<Grid />
|
||||
</UserControl>
|
||||
Reference in new issue
Block a user