Skip to content

Commit

Permalink
Settings work
Browse files Browse the repository at this point in the history
  • Loading branch information
Offline-R503B committed Jan 28, 2021
1 parent 0619eee commit 9097b9e
Show file tree
Hide file tree
Showing 30 changed files with 467 additions and 118 deletions.
5 changes: 4 additions & 1 deletion WolvenKit/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,16 @@ protected override async void OnStartup(StartupEventArgs e)
viewModelLocator.Register(typeof(Views.SettingsPages.GeneralSettingsView), typeof(ViewModels.SettingsPages.GeneralSettingsViewModel));
viewModelLocator.Register(typeof(Views.SettingsPages.SubPages.General.GlobalSubSettingsView), typeof(ViewModels.SettingsPages.SubPages.General.GlobalSubSettingsViewModel));
viewModelLocator.Register(typeof(Views.SettingsPages.SubPages.General.AccountSubSettingsView), typeof(ViewModels.SettingsPages.SubPages.General.AccountSubSettingsViewModel));
viewModelLocator.Register(typeof(Views.SettingsPages.SubPages.General.LanguageSubSettingsView), typeof(ViewModels.SettingsPages.SubPages.General.LanguageSubSettingsViewModel));
viewModelLocator.Register(typeof(Views.SettingsPages.SubPages.General.UpdatesSubSettingsView), typeof(ViewModels.SettingsPages.SubPages.General.UpdatesSubSettingsViewModel));
viewModelLocator.Register(typeof(Views.SettingsPages.SubPages.General.ThemeSubSettingsView), typeof(ViewModels.SettingsPages.SubPages.General.ThemeSubSettingsViewModel));
viewModelLocator.Register(typeof(Views.SettingsPages.SubPages.General.LoggingSubSettingsView), typeof(ViewModels.SettingsPages.SubPages.General.LoggingSubSettingsViewModel));


viewModelLocator.Register(typeof(Views.SettingsPages.ToolSettingsView), typeof(ViewModels.SettingsPages.ToolSettingsViewModel));
viewModelLocator.Register(typeof(Views.SettingsPages.SubPages.Tool.AssetBrowserSubSettingsView), typeof(ViewModels.SettingsPages.SubPages.Tool.AssetBrowserSubSettingsViewModel));
viewModelLocator.Register(typeof(Views.SettingsPages.SubPages.Tool.CodeEditorSubSettingsView), typeof(ViewModels.SettingsPages.SubPages.Tool.CodeEditorSubSettingsViewModel));
viewModelLocator.Register(typeof(Views.SettingsPages.SubPages.Tool.PluginManagerSubSettingsView), typeof(ViewModels.SettingsPages.SubPages.Tool.PluginManagerSubSettingsViewModel));
viewModelLocator.Register(typeof(Views.SettingsPages.SubPages.Tool.VisualEditorSubSettingsView), typeof(ViewModels.SettingsPages.SubPages.Tool.VisualEditorSubSettingsViewModel));


viewModelLocator.Register(typeof(Views.SettingsPages.EditorSettingsView), typeof(ViewModels.SettingsPages.EditorSettingsViewModel));
Expand Down
20 changes: 15 additions & 5 deletions WolvenKit/ViewModels/AD/RibbonViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public class RibbonViewModel : ViewModel
public RibbonViewModel(
ISettingsManager settingsManager,
IProjectManager projectManager,
ILoggerService loggerService,
INavigationService navigationService,
ILoggerService loggerService,
INavigationService navigationService,
IUIVisualizerService uiVisualizerService
)
{
Expand Down Expand Up @@ -77,8 +77,18 @@ public enum ERibbonContextualTabGroupVisibility
/// <summary>
/// Dependency Property on RibbonView
/// </summary>
public List<string> ListOfThemes => new List<string>(){
"Dark.Red", "Dark.Green", "Dark.Blue", "Dark.Purple", "Dark.Orange", "Dark.Lime", "Dark.Emerald", "Dark.Teal", "Dark.Cyan", "Dark.Cobalt", "Dark.Indigo", "Dark.Violet", "Dark.Pink", "Dark.Magenta", "Dark.Crimson", "Dark.Amber", "Dark.Yellow", "Dark.Brown", "Dark.Olive", "Dark.Steel", "Dark.Mauve", "Dark.Taupe", "Dark.Sienna" , "Light.Red", "Light.Green", "Light.Blue", "Light.Purple", "Light.Orange", "Light.Lime", "Light.Emerald", "Light.Teal", "Light.Cyan", "Light.Cobalt", "Light.Indigo", "Light.Violet", "Light.Pink", "Light.Magenta", "Light.Crimson", "Light.Amber", "Light.Yellow", "Light.Brown", "Light.Olive", "Light.Steel", "Light.Mauve", "Light.Taupe", "Light.Sienna"};
public List<string> ListOfThemes => new List<string>()
{
"Dark.Red", "Dark.Green", "Dark.Blue",
"Dark.Purple", "Dark.Orange", "Dark.Lime",
"Dark.Emerald", "Dark.Teal", "Dark.Cyan",
"Dark.Cobalt", "Dark.Indigo", "Dark.Violet",
"Dark.Pink", "Dark.Magenta", "Dark.Crimson",
"Dark.Amber", "Dark.Yellow", "Dark.Brown",
"Dark.Olive", "Dark.Steel", "Dark.Mauve",
"Dark.Taupe", "Dark.Sienna"
};

private string _selectedTheme;
/// <summary>
/// Dependency Property on RibbonView
Expand Down Expand Up @@ -123,7 +133,7 @@ private void ExecuteViewSelected(object viewmodel)
private bool CanRunCommand1() => true;
private void RunCommand1()
{

}
#endregion

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
using System;
using Catel.MVVM;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WolvenKit.ViewModels.SettingsPages.SubPages.General
{
class AccountSubSettingsViewModel
class AccountSubSettingsViewModel : ViewModelBase
{
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
using System;
using Catel.MVVM;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WolvenKit.ViewModels.SettingsPages.SubPages.General
{
class GlobalSubSettingsViewModel
class GlobalSubSettingsViewModel : ViewModelBase
{
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
using System;
using Catel.MVVM;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WolvenKit.ViewModels.SettingsPages.SubPages.General
{
class LoggingSubSettingsViewModel
class LoggingSubSettingsViewModel : ViewModelBase
{
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
using System;
using Catel.MVVM;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WolvenKit.ViewModels.SettingsPages.SubPages.General
{
class ThemeSubSettingsViewModel
class ThemeSubSettingsViewModel : ViewModelBase
{
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
using System;
using Catel.MVVM;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WolvenKit.ViewModels.SettingsPages.SubPages.General
{
class UpdatesSubSettingsViewModel
class UpdatesSubSettingsViewModel : ViewModelBase
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using Catel.MVVM;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WolvenKit.ViewModels.SettingsPages.SubPages.Tool
{
class AssetBrowserSubSettingsViewModel : ViewModelBase
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using Catel.MVVM;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WolvenKit.ViewModels.SettingsPages.SubPages.Tool
{
class CodeEditorSubSettingsViewModel : ViewModelBase
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using Catel.MVVM;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WolvenKit.ViewModels.SettingsPages.SubPages.Tool
{
class PluginManagerSubSettingsViewModel : ViewModelBase
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using Catel.MVVM;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WolvenKit.ViewModels.SettingsPages.SubPages.Tool
{
class VisualEditorSubSettingsViewModel : ViewModelBase
{
}
}
29 changes: 15 additions & 14 deletions WolvenKit/Views/SettingsPages/GeneralSettingsView.xaml
Original file line number Diff line number Diff line change
@@ -1,44 +1,45 @@
<catel:UserControl x:Class="WolvenKit.Views.SettingsPages.GeneralSettingsView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:catel="http://schemas.catelproject.com" xmlns:hc="https://handyorg.github.io/handycontrol">
xmlns:catel="http://schemas.catelproject.com" xmlns:hc="https://handyorg.github.io/handycontrol" xmlns:sp="clr-namespace:WolvenKit.Views.SettingsPages.SubPages.General">

<Grid hc:ThemeManager.AccentColorElement="{DynamicResource MahApps.Brushes.Accent3}" Background="{DynamicResource Fluent.Ribbon.Brushes.Backstage.Background}">
<hc:SideMenu Width="150" SideBrush="{DynamicResource MahApps.Brushes.Accent}" HorizontalAlignment="Left" >

<hc:SideMenuItem >
<hc:SideMenuItem x:Name="GlobalSubItem" Selected="GlobalSubItem_Selected" >
<hc:SideMenuItem.Header>
<TextBlock Text="Global" FontSize="10.5"/>
</hc:SideMenuItem.Header>
</hc:SideMenuItem>
<hc:SideMenuItem >

<hc:SideMenuItem x:Name="AccountSubItem" Selected="AccountSubItem_Selected" >
<hc:SideMenuItem.Header>
<TextBlock Text="Account" FontSize="10.5"/>
</hc:SideMenuItem.Header>
</hc:SideMenuItem>
<hc:SideMenuItem >
<hc:SideMenuItem.Header>
<TextBlock Text="Language" FontSize="10.5"/>
</hc:SideMenuItem.Header>
</hc:SideMenuItem>
<hc:SideMenuItem >

<hc:SideMenuItem x:Name="UpdatesSubItem" Selected="UpdatesSubItem_Selected" >
<hc:SideMenuItem.Header>
<TextBlock Text="Updates" FontSize="10.5"/>
</hc:SideMenuItem.Header>
</hc:SideMenuItem>
<hc:SideMenuItem >

<hc:SideMenuItem x:Name="ThemeSubItem" Selected="ThemeSubItem_Selected" >
<hc:SideMenuItem.Header>
<TextBlock Text="Theme" FontSize="10.5"/>
</hc:SideMenuItem.Header>
</hc:SideMenuItem.Header>
</hc:SideMenuItem>
<hc:SideMenuItem >

<hc:SideMenuItem x:Name="LoggingSubItem" Selected="LoggingSubItem_Selected" >
<hc:SideMenuItem.Header>
<TextBlock Text="Logging" FontSize="10.5"/>
</hc:SideMenuItem.Header>
</hc:SideMenuItem>

</hc:SideMenu>




<Grid Margin="150,1,0,0" x:Name="SettingsViewer"> </Grid>

</Grid>

Expand Down
49 changes: 49 additions & 0 deletions WolvenKit/Views/SettingsPages/GeneralSettingsView.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

using WolvenKit.Views.SettingsPages.SubPages.General;

namespace WolvenKit.Views.SettingsPages
{
public partial class GeneralSettingsView
Expand All @@ -7,5 +9,52 @@ public GeneralSettingsView()
{
InitializeComponent();
}

private void GlobalSubItem_Selected(object sender, System.Windows.RoutedEventArgs e)
{
if (IsLoaded && IsVisible && IsInitialized)
{
SettingsViewer.Children.Clear();
SettingsViewer.Children.Add(new GlobalSubSettingsView());
}
}

private void AccountSubItem_Selected(object sender, System.Windows.RoutedEventArgs e)
{
if (IsLoaded && IsVisible && IsInitialized)
{
SettingsViewer.Children.Clear();
SettingsViewer.Children.Add(new AccountSubSettingsView());
}
}



private void UpdatesSubItem_Selected(object sender, System.Windows.RoutedEventArgs e)
{
if (IsLoaded && IsVisible && IsInitialized)
{
SettingsViewer.Children.Clear();
SettingsViewer.Children.Add(new UpdatesSubSettingsView());
}
}

private void ThemeSubItem_Selected(object sender, System.Windows.RoutedEventArgs e)
{
if (IsLoaded && IsVisible && IsInitialized)
{
SettingsViewer.Children.Clear();
SettingsViewer.Children.Add(new ThemeSubSettingsView());
}
}

private void LoggingSubItem_Selected(object sender, System.Windows.RoutedEventArgs e)
{
if (IsLoaded && IsVisible && IsInitialized)
{
SettingsViewer.Children.Clear();
SettingsViewer.Children.Add(new LoggingSubSettingsView());
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,42 @@
<catel:UserControl x:Class="WolvenKit.Views.SettingsPages.SubPages.General.AccountSubSettingsView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:catel="http://schemas.catelproject.com">

<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>

<Label Grid.Row="0" Content="{Binding Title}" />
<Label Grid.Row="1" Content="Here goes your real content" />
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"

xmlns:catel="http://schemas.catelproject.com" xmlns:hc="https://handyorg.github.io/handycontrol">

<Grid hc:ThemeManager.AccentColorElement="{DynamicResource MahApps.Brushes.Accent3}">
<Grid VerticalAlignment="Top" HorizontalAlignment="Left">

<StackPanel>


<Border BorderThickness="4,0,0,2" Margin="15,15,32,10" Background="{DynamicResource Fluent.Ribbon.Brushes.Backstage.Background}" Style="{StaticResource BorderTipPrimary}">
<Grid>
<TextBlock Text="WolvenKit Profile" VerticalAlignment="Center" Margin="0,0,50,0"/>
<StackPanel Orientation="Horizontal">
<TextBox Margin="250,0,0,0" Width="250" Text=""/>
</StackPanel>
</Grid>


</Border>

<Border BorderThickness="4,0,0,2" Margin="15,5,32,10" Background="{DynamicResource Fluent.Ribbon.Brushes.Backstage.Background}" Style="{StaticResource BorderTipPrimary}">
<Grid>
<TextBlock Text="Nexus Account" VerticalAlignment="Center" Margin="0,0,50,0"/>
<StackPanel Orientation="Horizontal">
<ComboBox Margin="250,0,0,0" VerticalAlignment="Center" Width="250" Text=""/>

</StackPanel>
</Grid>

</Border>


</StackPanel>

</Grid>

</Grid>

</catel:UserControl>
Loading

0 comments on commit 9097b9e

Please sign in to comment.