Core - Flattened namespaces

Shared UI - Flattened namespaces
Shared UI - General housekeeping
Project - Code cleanup
This commit is contained in:
SpoinkyNL committed 2020-09-01 00:14:08 +02:00
1 parent 029e39ec1d
commit 8718d01eae
454 files changed
+1678 -1938

No files matched your search

@@ -1,5 +1,5 @@
using System.Threading.Tasks;
using Artemis.UI.Shared.Services.Dialog;
using Artemis.UI.Shared.Services;
using FluentValidation;
using Stylet;
@@ -3,7 +3,6 @@
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.Screens.ProfileEditor.Dialogs"
xmlns:s="https://github.com/canton7/Stylet"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
@@ -1,7 +1,7 @@
using System.Windows;
using Artemis.Core.Models.Profile;
using Artemis.Core.Services.Storage.Interfaces;
using Artemis.UI.Shared.Services.Dialog;
using Artemis.Core;
using Artemis.Core.Services;
using Artemis.UI.Shared.Services;
using MaterialDesignThemes.Wpf;
namespace Artemis.UI.Screens.ProfileEditor.Dialogs
@@ -1,12 +1,11 @@
<UserControl x:Class="Artemis.UI.Screens.ProfileEditor.Dialogs.ProfileImportView"
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.Screens.ProfileEditor.Dialogs"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:s="https://github.com/canton7/Stylet"
xmlns:avalonedit="http://icsharpcode.net/sharpdevelop/avalonedit"
mc:Ignorable="d"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid Margin="16" Width="800">
<Grid.RowDefinitions>
@@ -48,4 +47,4 @@
</Button>
</StackPanel>
</Grid>
</UserControl>
</UserControl>
@@ -1,6 +1,6 @@
using Artemis.Core.Plugins.Modules;
using Artemis.Core.Services.Storage.Interfaces;
using Artemis.UI.Shared.Services.Dialog;
using Artemis.Core.Modules;
using Artemis.Core.Services;
using Artemis.UI.Shared.Services;
using ICSharpCode.AvalonEdit.Document;
using MaterialDesignThemes.Wpf;
@@ -1,5 +1,5 @@
using System.Threading.Tasks;
using Artemis.UI.Shared.Services.Dialog;
using Artemis.UI.Shared.Services;
using FluentValidation;
using Stylet;
@@ -1,5 +1,5 @@
using System;
using Artemis.Core.Models.Profile.Conditions.Abstract;
using Artemis.Core;
using Stylet;
namespace Artemis.UI.Screens.ProfileEditor.DisplayConditions.Abstract
@@ -1,17 +1,17 @@
<UserControl
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.Screens.ProfileEditor.DisplayConditions"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:s="https://github.com/canton7/Stylet"
xmlns:Converters="clr-namespace:Artemis.UI.Converters"
xmlns:utilities="clr-namespace:Artemis.UI.Utilities"
x:Class="Artemis.UI.Screens.ProfileEditor.DisplayConditions.DisplayConditionGroupView"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"
d:DataContext="{d:DesignInstance IsDesignTimeCreatable=False, Type={x:Type local:DisplayConditionGroupViewModel}}">
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.Screens.ProfileEditor.DisplayConditions"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:s="https://github.com/canton7/Stylet"
xmlns:Converters="clr-namespace:Artemis.UI.Converters"
xmlns:utilities="clr-namespace:Artemis.UI.Utilities"
x:Class="Artemis.UI.Screens.ProfileEditor.DisplayConditions.DisplayConditionGroupView"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"
d:DataContext="{d:DesignInstance IsDesignTimeCreatable=False, Type={x:Type local:DisplayConditionGroupViewModel}}">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
@@ -87,7 +87,7 @@
<Button.ContextMenu>
<ContextMenu>
<ContextMenu.Resources>
<Converters:InverseBooleanConverter x:Key="InverseBooleanConverter"/>
<Converters:InverseBooleanConverter x:Key="InverseBooleanConverter" />
</ContextMenu.Resources>
<MenuItem Header="Add static condition"
ToolTip="A condition that compares a data model property to a static input"
@@ -108,7 +108,7 @@
<MenuItem Header="Add list condition"
ToolTip="A condition that evaluates on items in a list"
Command="{s:Action AddCondition}"
CommandParameter="List"
CommandParameter="List"
IsEnabled="{Binding Data.IsListGroup, Converter={StaticResource InverseBooleanConverter}, Source={StaticResource DataContextProxy}}">
<MenuItem.Icon>
<materialDesign:PackIcon Kind="FormatListBulleted" />
@@ -2,11 +2,10 @@
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using Artemis.Core.Models.Profile;
using Artemis.Core.Models.Profile.Conditions;
using Artemis.Core;
using Artemis.UI.Ninject.Factories;
using Artemis.UI.Screens.ProfileEditor.DisplayConditions.Abstract;
using Artemis.UI.Shared.Services.Interfaces;
using Artemis.UI.Shared.Services;
using Humanizer;
using Stylet;
@@ -130,7 +129,7 @@ namespace Artemis.UI.Screens.ProfileEditor.DisplayConditions
case DisplayConditionPredicate displayConditionPredicate:
if (!IsListGroup)
Children.Add(_displayConditionsVmFactory.DisplayConditionPredicateViewModel(displayConditionPredicate, this));
break;
break;
case DisplayConditionListPredicate displayConditionListPredicate:
if (IsListGroup)
Children.Add(_displayConditionsVmFactory.DisplayConditionListPredicateViewModel(displayConditionListPredicate, this));
@@ -3,7 +3,6 @@
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.Screens.ProfileEditor.DisplayConditions"
xmlns:s="https://github.com/canton7/Stylet"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:converters="clr-namespace:Artemis.UI.Converters"
@@ -5,17 +5,13 @@ using System.Threading.Tasks;
using System.Timers;
using System.Windows;
using System.Windows.Input;
using Artemis.Core.Models.Profile;
using Artemis.Core.Models.Profile.Conditions;
using Artemis.Core.Plugins.Settings;
using Artemis.Core;
using Artemis.Core.Services;
using Artemis.Core.Services.Interfaces;
using Artemis.UI.Events;
using Artemis.UI.Exceptions;
using Artemis.UI.Screens.ProfileEditor.DisplayConditions.Abstract;
using Artemis.UI.Shared.DataModelVisualization;
using Artemis.UI.Shared.DataModelVisualization.Shared;
using Artemis.UI.Shared.Services.Interfaces;
using Artemis.UI.Shared;
using Artemis.UI.Shared.Services;
using Artemis.UI.Utilities;
using Stylet;
@@ -1,14 +1,14 @@
<UserControl x:Class="Artemis.UI.Screens.ProfileEditor.DisplayConditions.DisplayConditionListView"
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Artemis.UI.Screens.ProfileEditor.DisplayConditions"
xmlns:converters="clr-namespace:Artemis.UI.Converters"
xmlns:utilities="clr-namespace:Artemis.UI.Utilities"
xmlns:s="https://github.com/canton7/Stylet"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
mc:Ignorable="d"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"
d:DataContext="{d:DesignInstance Type=local:DisplayConditionListViewModel, IsDesignTimeCreatable=False}">
<UserControl.Resources>
@@ -100,7 +100,7 @@
<MenuItem Header="Any" Command="{s:Action SelectListOperator}" CommandParameter="Any" />
<MenuItem Header="All" Command="{s:Action SelectListOperator}" CommandParameter="All" />
<MenuItem Header="None" Command="{s:Action SelectListOperator}" CommandParameter="None" />
<MenuItem Header="Count (NYI)" Command="{s:Action SelectListOperator}" CommandParameter="Count" IsEnabled="False"/>
<MenuItem Header="Count (NYI)" Command="{s:Action SelectListOperator}" CommandParameter="Count" IsEnabled="False" />
</ContextMenu>
</Button.ContextMenu>
</Button>
@@ -3,14 +3,12 @@ using System.Collections;
using System.Linq;
using System.Threading.Tasks;
using System.Timers;
using Artemis.Core.Models.Profile;
using Artemis.Core.Models.Profile.Conditions;
using Artemis.Core.Plugins.Settings;
using Artemis.Core;
using Artemis.Core.Services;
using Artemis.UI.Ninject.Factories;
using Artemis.UI.Screens.ProfileEditor.DisplayConditions.Abstract;
using Artemis.UI.Shared.DataModelVisualization.Shared;
using Artemis.UI.Shared.Services.Interfaces;
using Artemis.UI.Shared;
using Artemis.UI.Shared.Services;
using Artemis.UI.Utilities;
using Humanizer;
@@ -3,7 +3,6 @@
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.Screens.ProfileEditor.DisplayConditions"
xmlns:s="https://github.com/canton7/Stylet"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:converters="clr-namespace:Artemis.UI.Converters"
@@ -5,16 +5,12 @@ using System.Threading.Tasks;
using System.Timers;
using System.Windows;
using System.Windows.Input;
using Artemis.Core.Models.Profile;
using Artemis.Core.Models.Profile.Conditions;
using Artemis.Core.Plugins.Settings;
using Artemis.Core;
using Artemis.Core.Services;
using Artemis.Core.Services.Interfaces;
using Artemis.UI.Events;
using Artemis.UI.Screens.ProfileEditor.DisplayConditions.Abstract;
using Artemis.UI.Shared.DataModelVisualization;
using Artemis.UI.Shared.DataModelVisualization.Shared;
using Artemis.UI.Shared.Services.Interfaces;
using Artemis.UI.Shared;
using Artemis.UI.Shared.Services;
using Artemis.UI.Utilities;
using Stylet;
@@ -3,7 +3,6 @@
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.Screens.ProfileEditor.DisplayConditions"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:s="https://github.com/canton7/Stylet"
xmlns:converters="clr-namespace:Artemis.UI.Converters"
@@ -18,7 +17,7 @@
<materialDesign:Transitioner AutoApplyTransitionOrigins="True" SelectedIndex="{Binding TransitionerIndex}">
<!-- Conditions intro -->
<materialDesign:ColorZone Mode="PrimaryDark" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" VerticalContentAlignment="Stretch">
<materialDesign:ColorZone Mode="PrimaryDark" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" VerticalContentAlignment="Stretch">
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Margin="32">
<TextBlock Style="{StaticResource MaterialDesignHeadline6TextBlock}" TextWrapping="Wrap" TextAlignment="Center" Margin="0 15">Unleash Artemis's true potential</TextBlock>
<TextBlock TextWrapping="Wrap" TextAlignment="Center">Start using conditions to dynamically show and hide groups and layers</TextBlock>
@@ -38,7 +37,7 @@
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock Style="{StaticResource MaterialDesignSubtitle1TextBlock}" Margin="0 0 0 -4">
Display conditions
Display conditions
</TextBlock>
<Separator Grid.Row="1" Grid.Column="0" Style="{StaticResource MaterialDesignDarkSeparator}" Margin="-2 0" />
@@ -65,11 +64,11 @@
<TextBlock.ToolTip>
<ToolTip Placement="Center" VerticalOffset="-30">
<TextBlock>
Configure how the layer should act while the conditions above are met
Configure how the layer should act while the conditions above are met
</TextBlock>
</ToolTip>
</TextBlock.ToolTip>
</TextBlock>
</TextBlock>
</StackPanel>
<materialDesign:ColorZone Grid.Row="1" Grid.Column="0" Mode="Standard" CornerRadius="3" Margin="0 0 2 0">
@@ -79,14 +78,14 @@
<ColumnDefinition />
</Grid.ColumnDefinitions>
<RadioButton Grid.Column="0"
Style="{StaticResource MaterialDesignTabRadioButton}"
IsChecked="{Binding DisplayContinuously}"
MinWidth="0"
Padding="5 0">
Style="{StaticResource MaterialDesignTabRadioButton}"
IsChecked="{Binding DisplayContinuously}"
MinWidth="0"
Padding="5 0">
<RadioButton.ToolTip>
<ToolTip Placement="Center" VerticalOffset="-40">
<TextBlock>
Continue repeating the main segment of the timeline while the condition is met
Continue repeating the main segment of the timeline while the condition is met
</TextBlock>
</ToolTip>
</RadioButton.ToolTip>
@@ -96,14 +95,14 @@
</StackPanel>
</RadioButton>
<RadioButton Grid.Column="1"
Style="{StaticResource MaterialDesignTabRadioButton}"
IsChecked="{Binding DisplayContinuously, Converter={StaticResource InverseBooleanConverter}}"
MinWidth="0"
Padding="5 0">
Style="{StaticResource MaterialDesignTabRadioButton}"
IsChecked="{Binding DisplayContinuously, Converter={StaticResource InverseBooleanConverter}}"
MinWidth="0"
Padding="5 0">
<RadioButton.ToolTip>
<ToolTip Placement="Center" VerticalOffset="-40">
<TextBlock>
Only play the timeline once when the condition is met
Only play the timeline once when the condition is met
</TextBlock>
</ToolTip>
</RadioButton.ToolTip>
@@ -122,11 +121,11 @@
<TextBlock.ToolTip>
<ToolTip Placement="Center" VerticalOffset="-30">
<TextBlock>
Configure how the layer should act when the conditions above are no longer met
Configure how the layer should act when the conditions above are no longer met
</TextBlock>
</ToolTip>
</TextBlock.ToolTip>
</TextBlock>
</TextBlock>
</StackPanel>
<materialDesign:ColorZone Grid.Row="1" Grid.Column="1" Mode="Standard" CornerRadius="3" Margin="2 0 0 0" HorizontalAlignment="Stretch">
<Grid>
@@ -135,14 +134,14 @@
<ColumnDefinition MinWidth="100" />
</Grid.ColumnDefinitions>
<RadioButton Grid.Column="0"
Style="{StaticResource MaterialDesignTabRadioButton}"
IsChecked="{Binding AlwaysFinishTimeline}"
MinWidth="0"
Padding="5 0">
Style="{StaticResource MaterialDesignTabRadioButton}"
IsChecked="{Binding AlwaysFinishTimeline}"
MinWidth="0"
Padding="5 0">
<RadioButton.ToolTip>
<ToolTip Placement="Center" VerticalOffset="-40">
<TextBlock>
When conditions are no longer met, finish the the current run of the main timeline
When conditions are no longer met, finish the the current run of the main timeline
</TextBlock>
</ToolTip>
</RadioButton.ToolTip>
@@ -152,14 +151,14 @@
</StackPanel>
</RadioButton>
<RadioButton Grid.Column="1"
Style="{StaticResource MaterialDesignTabRadioButton}"
IsChecked="{Binding AlwaysFinishTimeline, Converter={StaticResource InverseBooleanConverter}}"
MinWidth="0"
Padding="5 0">
Style="{StaticResource MaterialDesignTabRadioButton}"
IsChecked="{Binding AlwaysFinishTimeline, Converter={StaticResource InverseBooleanConverter}}"
MinWidth="0"
Padding="5 0">
<RadioButton.ToolTip>
<ToolTip Placement="Center" VerticalOffset="-40">
<TextBlock>
When conditions are no longer met, skip to the end segment of the timeline
When conditions are no longer met, skip to the end segment of the timeline
</TextBlock>
</ToolTip>
</RadioButton.ToolTip>
@@ -1,9 +1,8 @@
using System.Linq;
using Artemis.Core.Models.Profile;
using Artemis.Core.Models.Profile.Conditions;
using Artemis.Core;
using Artemis.UI.Ninject.Factories;
using Artemis.UI.Shared.Events;
using Artemis.UI.Shared.Services.Interfaces;
using Artemis.UI.Shared;
using Artemis.UI.Shared.Services;
namespace Artemis.UI.Screens.ProfileEditor.DisplayConditions
{
@@ -11,11 +10,11 @@ namespace Artemis.UI.Screens.ProfileEditor.DisplayConditions
{
private readonly IDisplayConditionsVmFactory _displayConditionsVmFactory;
private readonly IProfileEditorService _profileEditorService;
private bool _alwaysFinishTimeline;
private bool _displayContinuously;
private RenderProfileElement _renderProfileElement;
private DisplayConditionGroupViewModel _rootGroup;
private int _transitionerIndex;
private bool _displayContinuously;
private bool _alwaysFinishTimeline;
public DisplayConditionsViewModel(IProfileEditorService profileEditorService, IDisplayConditionsVmFactory displayConditionsVmFactory)
{
@@ -85,7 +84,7 @@ namespace Artemis.UI.Screens.ProfileEditor.DisplayConditions
NotifyOfPropertyChange(nameof(DisplayContinuously));
_alwaysFinishTimeline = RenderProfileElement?.AlwaysFinishTimeline ?? false;
NotifyOfPropertyChange(nameof(AlwaysFinishTimeline));
if (e.RenderProfileElement == null)
{
RootGroup?.Dispose();
@@ -1,4 +1,4 @@
using Artemis.Core.Plugins.LayerBrushes;
using Artemis.Core.LayerBrushes;
using Stylet;
namespace Artemis.UI.Screens.ProfileEditor
@@ -1,4 +1,4 @@
using Artemis.Core.Plugins.LayerEffects;
using Artemis.Core.LayerEffects;
using Stylet;
namespace Artemis.UI.Screens.ProfileEditor
@@ -1,14 +1,14 @@
using System;
using System.Collections.Generic;
using Artemis.Core.Models.Profile.LayerProperties;
using Artemis.Core;
using Stylet;
namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Abstract
{
public abstract class LayerPropertyBaseViewModel : PropertyChangedBase, IDisposable
{
private bool _isExpanded;
private BindableCollection<LayerPropertyBaseViewModel> _children;
private bool _isExpanded;
protected LayerPropertyBaseViewModel()
{
@@ -3,7 +3,6 @@
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.Screens.ProfileEditor.LayerProperties.DataBindings"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:converters="clr-namespace:Artemis.UI.Converters"
xmlns:utilities="clr-namespace:Artemis.UI.Utilities"
@@ -1,5 +1,5 @@
using System.Reflection;
using Artemis.Core.Models.Profile.LayerProperties;
using Artemis.Core;
using Stylet;
namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.DataBindings
@@ -3,12 +3,10 @@
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.Screens.ProfileEditor.LayerProperties.DataBindings"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:s="https://github.com/canton7/Stylet"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<TabControl ItemsSource="{Binding Tabs}" DisplayMemberPath="DisplayName" Style="{StaticResource MaterialDesignTabControl}" >
<TabControl ItemsSource="{Binding Tabs}" DisplayMemberPath="DisplayName" Style="{StaticResource MaterialDesignTabControl}">
<TabControl.ContentTemplate>
<DataTemplate>
<ContentControl s:View.Model="{Binding}" TextElement.Foreground="{DynamicResource MaterialDesignBody}" />
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
using Stylet;
using Stylet;
namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.DataBindings
{
@@ -11,6 +8,7 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.DataBindings
{
Tabs = new BindableCollection<DataBindingViewModel>();
}
public BindableCollection<DataBindingViewModel> Tabs { get; set; }
}
}
}
@@ -4,7 +4,6 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Artemis.UI.Screens.ProfileEditor.LayerProperties.DataBindings"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:s="https://github.com/canton7/Stylet"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"
@@ -1,13 +1,13 @@
using System.Linq;
using Artemis.Core.Models.Profile.LayerProperties;
using Artemis.Core;
using Stylet;
namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.DataBindings
{
public class DataBindingsViewModel : PropertyChangedBase
{
private DataBindingViewModel _dataBindingViewModel;
private DataBindingsTabsViewModel _dataBindingsTabsViewModel;
private DataBindingViewModel _dataBindingViewModel;
public DataBindingsViewModel(BaseLayerProperty layerProperty)
{
@@ -36,9 +36,7 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.DataBindings
return;
if (properties.Count == 1)
{
DataBindingViewModel = new DataBindingViewModel(LayerProperty, properties.First());
}
else
{
DataBindingsTabsViewModel = new DataBindingsTabsViewModel();
@@ -7,7 +7,7 @@
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:s="https://github.com/canton7/Stylet"
xmlns:behaviors="clr-namespace:Artemis.UI.Behaviors"
xmlns:layerEffect="clr-namespace:Artemis.Core.Plugins.LayerEffects;assembly=Artemis.Core"
xmlns:layerEffect="clr-namespace:Artemis.Core.LayerEffects;assembly=Artemis.Core"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"
d:DataContext="{d:DesignInstance local:EffectsViewModel}">
@@ -1,19 +1,19 @@
using System.ComponentModel;
using System.Linq;
using System.Threading.Tasks;
using Artemis.Core.Models.Profile;
using Artemis.Core.Plugins.LayerEffects;
using Artemis.Core.Services.Interfaces;
using Artemis.UI.Shared.Services.Interfaces;
using Artemis.Core;
using Artemis.Core.LayerEffects;
using Artemis.Core.Services;
using Artemis.UI.Shared.Services;
using Stylet;
namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.LayerEffects
{
public class EffectsViewModel : PropertyChangedBase
{
private readonly IRenderElementService _renderElementService;
private readonly IPluginService _pluginService;
private readonly IProfileEditorService _profileEditorService;
private readonly IRenderElementService _renderElementService;
private BindableCollection<LayerEffectDescriptor> _layerEffectDescriptors;
private LayerEffectDescriptor _selectedLayerEffectDescriptor;
@@ -41,7 +41,7 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.LayerEffects
get => _selectedLayerEffectDescriptor;
set => SetAndNotify(ref _selectedLayerEffectDescriptor, value);
}
public void PopulateDescriptors()
{
var layerBrushProviders = _pluginService.GetPluginsOfType<LayerEffectProvider>();
@@ -3,9 +3,7 @@
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.Screens.ProfileEditor.LayerProperties"
xmlns:s="https://github.com/canton7/Stylet"
xmlns:timeline="clr-namespace:Artemis.UI.Screens.ProfileEditor.LayerProperties.Timeline"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:behaviors="clr-namespace:Artemis.UI.Behaviors"
xmlns:Converters="clr-namespace:Artemis.UI.Converters"
@@ -2,23 +2,18 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;
using Artemis.Core.Events;
using Artemis.Core.Models.Profile;
using Artemis.Core.Models.Profile.LayerProperties;
using Artemis.Core.Models.Profile.LayerProperties.Attributes;
using Artemis.Core;
using Artemis.Core.Services;
using Artemis.Core.Services.Interfaces;
using Artemis.UI.Ninject.Factories;
using Artemis.UI.Screens.ProfileEditor.LayerProperties.DataBindings;
using Artemis.UI.Screens.ProfileEditor.LayerProperties.LayerEffects;
using Artemis.UI.Screens.ProfileEditor.LayerProperties.Timeline;
using Artemis.UI.Screens.ProfileEditor.LayerProperties.Tree;
using Artemis.UI.Shared.Events;
using Artemis.UI.Shared.Services.Interfaces;
using Artemis.UI.Shared;
using Artemis.UI.Shared.Services;
using GongSolutions.Wpf.DragDrop;
using Stylet;
using static Artemis.UI.Screens.ProfileEditor.LayerProperties.LayerPropertyGroupViewModel.ViewModelType;
@@ -29,19 +24,19 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties
{
private readonly ILayerPropertyVmFactory _layerPropertyVmFactory;
private LayerPropertyGroupViewModel _brushPropertyGroup;
private DataBindingsViewModel _dataBindingsViewModel;
private EffectsViewModel _effectsViewModel;
private TimelineSegmentViewModel _endTimelineSegmentViewModel;
private BindableCollection<LayerPropertyGroupViewModel> _layerPropertyGroups;
private TimelineSegmentViewModel _mainTimelineSegmentViewModel;
private bool _playing;
private int _propertyTreeIndex;
private bool _repeatAfterLastKeyframe;
private int _rightSideIndex;
private RenderProfileElement _selectedProfileElement;
private DataBindingsViewModel _dataBindingsViewModel;
private TimelineSegmentViewModel _startTimelineSegmentViewModel;
private TimelineViewModel _timelineViewModel;
private TreeViewModel _treeViewModel;
private TimelineSegmentViewModel _startTimelineSegmentViewModel;
private TimelineSegmentViewModel _mainTimelineSegmentViewModel;
private TimelineSegmentViewModel _endTimelineSegmentViewModel;
private int _rightSideIndex;
public LayerPropertiesViewModel(IProfileEditorService profileEditorService, ICoreService coreService, ISettingsService settingsService,
ILayerPropertyVmFactory layerPropertyVmFactory)
@@ -161,6 +156,20 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties
set => SetAndNotify(ref _endTimelineSegmentViewModel, value);
}
#region Segments
public void EnableSegment(string segment)
{
if (segment == "Start")
StartTimelineSegmentViewModel.EnableSegment();
else if (segment == "Main")
MainTimelineSegmentViewModel.EnableSegment();
else if (segment == "End")
EndTimelineSegmentViewModel.EnableSegment();
}
#endregion
protected override void OnInitialActivate()
{
PopulateProperties(ProfileEditorService.SelectedProfileElement);
@@ -626,19 +635,5 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties
}
#endregion
#region Segments
public void EnableSegment(string segment)
{
if (segment == "Start")
StartTimelineSegmentViewModel.EnableSegment();
else if (segment == "Main")
MainTimelineSegmentViewModel.EnableSegment();
else if (segment == "End")
EndTimelineSegmentViewModel.EnableSegment();
}
#endregion
}
}
@@ -1,14 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Artemis.Core.Models.Profile;
using Artemis.Core.Models.Profile.LayerProperties;
using Artemis.Core.Models.Profile.LayerProperties.Attributes;
using Artemis.Core;
using Artemis.UI.Ninject.Factories;
using Artemis.UI.Screens.ProfileEditor.LayerProperties.Abstract;
using Artemis.UI.Screens.ProfileEditor.LayerProperties.Timeline;
using Artemis.UI.Screens.ProfileEditor.LayerProperties.Tree;
using Artemis.UI.Shared.Services.Interfaces;
using Artemis.UI.Shared.Services;
using Humanizer;
using Ninject;
using Ninject.Parameters;
@@ -17,19 +15,10 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties
{
public class LayerPropertyGroupViewModel : LayerPropertyBaseViewModel
{
public enum ViewModelType
{
General,
Transform,
LayerBrushRoot,
LayerEffectRoot,
None
}
private readonly ILayerPropertyVmFactory _layerPropertyVmFactory;
private ViewModelType _groupType;
private TreePropertyGroupViewModel _treePropertyGroupViewModel;
private TimelinePropertyGroupViewModel _timelinePropertyGroupViewModel;
private TreePropertyGroupViewModel _treePropertyGroupViewModel;
public LayerPropertyGroupViewModel(LayerPropertyGroup layerPropertyGroup, PropertyGroupDescriptionAttribute propertyGroupDescription,
IProfileEditorService profileEditorService, ILayerPropertyVmFactory layerPropertyVmFactory)
@@ -58,7 +47,7 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties
DetermineType();
}
public override bool IsVisible => !LayerPropertyGroup.IsHidden;
public override bool IsVisible => !LayerPropertyGroup.IsHidden;
public IProfileEditorService ProfileEditorService { get; }
public LayerPropertyGroup LayerPropertyGroup { get; }
public PropertyGroupDescriptionAttribute PropertyGroupDescription { get; }
@@ -125,6 +114,12 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties
return result;
}
public void UpdateOrder(int order)
{
LayerPropertyGroup.LayerEffect.Order = order;
NotifyOfPropertyChange(nameof(IsExpanded));
}
private void DetermineType()
{
if (LayerPropertyGroup is LayerGeneralProperties)
@@ -186,10 +181,13 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties
NotifyOfPropertyChange(nameof(IsVisible));
}
public void UpdateOrder(int order)
public enum ViewModelType
{
LayerPropertyGroup.LayerEffect.Order = order;
NotifyOfPropertyChange(nameof(IsExpanded));
General,
Transform,
LayerBrushRoot,
LayerEffectRoot,
None
}
}
}
@@ -1,14 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Artemis.Core.Models.Profile.LayerProperties;
using Artemis.Core;
using Artemis.UI.Exceptions;
using Artemis.UI.PropertyInput;
using Artemis.UI.Screens.ProfileEditor.LayerProperties.Abstract;
using Artemis.UI.Screens.ProfileEditor.LayerProperties.Timeline;
using Artemis.UI.Screens.ProfileEditor.LayerProperties.Tree;
using Artemis.UI.Shared.PropertyInput;
using Artemis.UI.Shared.Services.Interfaces;
using Artemis.UI.Shared;
using Artemis.UI.Shared.Services;
using Humanizer;
using Ninject;
using Ninject.Parameters;
@@ -17,8 +17,8 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties
{
public class LayerPropertyViewModel<T> : LayerPropertyViewModel
{
private TreePropertyViewModel<T> _treePropertyViewModel;
private TimelinePropertyViewModel<T> _timelinePropertyViewModel;
private TreePropertyViewModel<T> _treePropertyViewModel;
public LayerPropertyViewModel(IProfileEditorService profileEditorService, LayerProperty<T> layerProperty) : base(profileEditorService, layerProperty)
{
@@ -114,8 +114,8 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties
public abstract class LayerPropertyViewModel : LayerPropertyBaseViewModel
{
private TreePropertyViewModel _treePropertyBaseViewModel;
private TimelinePropertyViewModel _timelinePropertyBaseViewModel;
private TreePropertyViewModel _treePropertyBaseViewModel;
protected LayerPropertyViewModel(IProfileEditorService profileEditorService, BaseLayerProperty baseLayerProperty)
{
@@ -1,6 +1,6 @@
using System.Windows;
using System.Windows.Media;
using Artemis.Core.Utilities;
using Artemis.Core;
using Humanizer;
namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Timeline
@@ -1,9 +1,8 @@
using System;
using System.ComponentModel;
using System.Linq;
using Artemis.Core.Models.Profile.LayerProperties;
using Artemis.Core.Utilities;
using Artemis.UI.Shared.Services.Interfaces;
using Artemis.Core;
using Artemis.UI.Shared.Services;
using Stylet;
namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Timeline
@@ -42,7 +41,7 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Timeline
if (desiredPosition > TimeSpan.Zero)
newKeyframe.Position = desiredPosition;
}
LayerPropertyKeyframe.LayerProperty.AddKeyframe(newKeyframe);
_profileEditorService.UpdateSelectedProfileElement();
}
@@ -100,6 +99,11 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Timeline
set => SetAndNotify(ref _timestamp, value);
}
public void Dispose()
{
BaseLayerPropertyKeyframe.PropertyChanged -= BaseLayerPropertyKeyframeOnPropertyChanged;
}
public void Update(int pixelsPerSecond)
{
_pixelsPerSecond = pixelsPerSecond;
@@ -182,10 +186,5 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Timeline
}
#endregion
public void Dispose()
{
BaseLayerPropertyKeyframe.PropertyChanged -= BaseLayerPropertyKeyframeOnPropertyChanged;
}
}
}
@@ -5,8 +5,6 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Artemis.UI.Screens.ProfileEditor.LayerProperties.Timeline"
xmlns:s="https://github.com/canton7/Stylet"
xmlns:layerProperties="clr-namespace:Artemis.UI.Screens.ProfileEditor.LayerProperties"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:layerProperties1="clr-namespace:Artemis.UI.Screens.ProfileEditor.LayerProperties"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"
@@ -58,11 +56,11 @@
<Style TargetType="ContentPresenter">
<Setter Property="VerticalAlignment" Value="Stretch" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
</Style >
</Style>
</ItemsControl.ItemContainerStyle>
<ItemsControl.Resources>
<DataTemplate DataType="{x:Type layerProperties1:LayerPropertyGroupViewModel}">
<ContentControl s:View.Model="{Binding TimelinePropertyGroupViewModel}" IsTabStop="False" HorizontalAlignment="Stretch"/>
<ContentControl s:View.Model="{Binding TimelinePropertyGroupViewModel}" IsTabStop="False" HorizontalAlignment="Stretch" />
</DataTemplate>
<DataTemplate DataType="{x:Type layerProperties1:LayerPropertyViewModel}">
<ContentControl s:View.Model="{Binding TimelinePropertyBaseViewModel}" IsTabStop="False" HorizontalAlignment="Stretch" />
@@ -2,7 +2,7 @@
using System.ComponentModel;
using System.Linq;
using Artemis.UI.Screens.ProfileEditor.LayerProperties.Abstract;
using Artemis.UI.Shared.Services.Interfaces;
using Artemis.UI.Shared.Services;
using Stylet;
namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Timeline
@@ -1,7 +1,7 @@
using System;
using System.Linq;
using Artemis.UI.Screens.ProfileEditor.LayerProperties.Abstract;
using Artemis.UI.Shared.Services.Interfaces;
using Artemis.UI.Shared.Services;
using Stylet;
namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Timeline
@@ -30,7 +30,7 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Timeline
{
var keyframes = LayerPropertyViewModel.LayerProperty.Keyframes.ToList();
var toRemove = TimelineKeyframeViewModels.Where(t => !keyframes.Contains(t.BaseLayerPropertyKeyframe)).ToList();
foreach (var timelineKeyframeViewModel in toRemove)
foreach (var timelineKeyframeViewModel in toRemove)
timelineKeyframeViewModel.Dispose();
TimelineKeyframeViewModels.RemoveRange(toRemove);
@@ -57,7 +57,7 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Timeline
private void DisposeKeyframeViewModels()
{
foreach (var timelineKeyframeViewModel in TimelineKeyframeViewModels)
foreach (var timelineKeyframeViewModel in TimelineKeyframeViewModels)
timelineKeyframeViewModel.Dispose();
TimelineKeyframeViewModels.Clear();
}
@@ -3,7 +3,6 @@
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.Screens.ProfileEditor.LayerProperties.Timeline"
xmlns:s="https://github.com/canton7/Stylet"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:utilities="clr-namespace:Artemis.UI.Utilities"
@@ -17,11 +16,11 @@
<StackPanel Orientation="Horizontal" Visibility="{Binding SegmentEnabled, Converter={x:Static s:BoolToVisibilityConverter.Instance}}">
<StackPanel.ContextMenu>
<ContextMenu>
<MenuItem Header="Repeat main segment"
<MenuItem Header="Repeat main segment"
IsCheckable="True"
IsChecked="{Binding Data.RepeatSegment, Source={StaticResource DataContextProxy}}"
Visibility="{Binding Data.IsMainSegment, Converter={x:Static s:BoolToVisibilityConverter.Instance}, Source={StaticResource DataContextProxy}}"/>
<MenuItem Header="Disable segment" Command="{s:Action DisableSegment}"/>
IsChecked="{Binding Data.RepeatSegment, Source={StaticResource DataContextProxy}}"
Visibility="{Binding Data.IsMainSegment, Converter={x:Static s:BoolToVisibilityConverter.Instance}, Source={StaticResource DataContextProxy}}" />
<MenuItem Header="Disable segment" Command="{s:Action DisableSegment}" />
</ContextMenu>
</StackPanel.ContextMenu>
@@ -86,8 +85,8 @@
<QuadraticEase EasingMode="EaseInOut" />
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" >
<DiscreteObjectKeyFrame KeyTime="00:00:0.25" Value="{x:Static Visibility.Collapsed}"/>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)">
<DiscreteObjectKeyFrame KeyTime="00:00:0.25" Value="{x:Static Visibility.Collapsed}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
@@ -96,7 +95,7 @@
<BeginStoryboard>
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)">
<DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Visible}"/>
<DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Visible}" />
</ObjectAnimationUsingKeyFrames>
<DoubleAnimation Storyboard.TargetProperty="Opacity" From="0.0" To="1.0" Duration="0:0:0.25" />
</Storyboard>
@@ -4,9 +4,9 @@ using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using Artemis.Core.Models.Profile;
using Artemis.UI.Shared.Services.Interfaces;
using Artemis.UI.Shared.Utilities;
using Artemis.Core;
using Artemis.UI.Shared;
using Artemis.UI.Shared.Services;
using Stylet;
namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Timeline
@@ -14,9 +14,9 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Timeline
public class TimelineSegmentViewModel : PropertyChangedBase, IDisposable
{
private bool _draggingSegment;
private bool _showSegmentName;
private bool _showRepeatButton;
private bool _showDisableButton;
private bool _showRepeatButton;
private bool _showSegmentName;
public TimelineSegmentViewModel(IProfileEditorService profileEditorService, SegmentViewModelType segment)
{
@@ -49,8 +49,8 @@
X2="{Binding StartSegmentEndPosition}"
Y1="0"
Y2="{Binding ActualHeight, ElementName=TimelineContainerGrid}"
HorizontalAlignment="Left"
Visibility="{Binding StartSegmentEnabled, Converter={x:Static s:BoolToVisibilityConverter.Instance}}"/>
HorizontalAlignment="Left"
Visibility="{Binding StartSegmentEnabled, Converter={x:Static s:BoolToVisibilityConverter.Instance}}" />
<Line Stroke="{StaticResource PrimaryHueDarkBrush}"
Opacity="0.5"
StrokeDashArray="4 2"
@@ -65,7 +65,7 @@
X2="{Binding EndSegmentEndPosition}"
Y1="0"
Y2="{Binding ActualHeight, ElementName=TimelineContainerGrid}"
Visibility="{Binding EndSegmentEnabled, Converter={x:Static s:BoolToVisibilityConverter.Instance}}"/>
Visibility="{Binding EndSegmentEnabled, Converter={x:Static s:BoolToVisibilityConverter.Instance}}" />
<!-- Multi-selection rectangle -->
<Path x:Name="MultiSelectionPath"
@@ -7,10 +7,10 @@ using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Shapes;
using Artemis.Core.Models.Profile;
using Artemis.Core;
using Artemis.UI.Screens.ProfileEditor.LayerProperties.Abstract;
using Artemis.UI.Shared.Services.Interfaces;
using Artemis.UI.Shared.Utilities;
using Artemis.UI.Shared;
using Artemis.UI.Shared.Services;
using Stylet;
namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Timeline
@@ -63,6 +63,20 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Timeline
SelectedProfileElement.PropertyChanged -= SelectedProfileElementOnPropertyChanged;
}
public void Update()
{
foreach (var layerPropertyGroupViewModel in LayerPropertyGroups)
{
layerPropertyGroupViewModel.TimelinePropertyGroupViewModel.UpdateKeyframes();
foreach (var layerPropertyBaseViewModel in layerPropertyGroupViewModel.GetAllChildren())
{
if (layerPropertyBaseViewModel is LayerPropertyViewModel layerPropertyViewModel)
layerPropertyViewModel.TimelinePropertyBaseViewModel.UpdateKeyframes();
}
}
}
private void SelectedProfileElementOnPropertyChanged(object sender, PropertyChangedEventArgs e)
{
if (e.PropertyName == nameof(_profileEditorService.SelectedProfileElement.StartSegmentLength))
@@ -90,20 +104,6 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Timeline
}
}
public void Update()
{
foreach (var layerPropertyGroupViewModel in LayerPropertyGroups)
{
layerPropertyGroupViewModel.TimelinePropertyGroupViewModel.UpdateKeyframes();
foreach (var layerPropertyBaseViewModel in layerPropertyGroupViewModel.GetAllChildren())
{
if (layerPropertyBaseViewModel is LayerPropertyViewModel layerPropertyViewModel)
layerPropertyViewModel.TimelinePropertyBaseViewModel.UpdateKeyframes();
}
}
}
private void ProfileEditorServiceOnPixelsPerSecondChanged(object sender, EventArgs e)
{
NotifyOfPropertyChange(nameof(StartSegmentWidth));
@@ -1,11 +1,11 @@
using System;
using System.Collections.Generic;
using Artemis.Core.Plugins.LayerBrushes;
using Artemis.Core.Plugins.LayerEffects;
using Artemis.Core.Services.Interfaces;
using Artemis.Core.LayerBrushes;
using Artemis.Core.LayerEffects;
using Artemis.Core.Services;
using Artemis.UI.Screens.ProfileEditor.Dialogs;
using Artemis.UI.Screens.ProfileEditor.LayerProperties.Abstract;
using Artemis.UI.Shared.Services.Interfaces;
using Artemis.UI.Shared.Services;
using Ninject;
using Ninject.Parameters;
using Stylet;
@@ -15,10 +15,10 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Tree
public class TreePropertyGroupViewModel : PropertyChangedBase
{
private readonly IDialogService _dialogService;
private readonly IWindowManager _windowManager;
private readonly IKernel _kernel;
private readonly IRenderElementService _renderElementService;
private readonly IProfileEditorService _profileEditorService;
private readonly IRenderElementService _renderElementService;
private readonly IWindowManager _windowManager;
public TreePropertyGroupViewModel(LayerPropertyBaseViewModel layerPropertyBaseViewModel,
IProfileEditorService profileEditorService,
@@ -3,7 +3,6 @@
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.Screens.ProfileEditor.LayerProperties.Tree"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:s="https://github.com/canton7/Stylet"
xmlns:tree="clr-namespace:Artemis.UI.Screens.ProfileEditor.LayerProperties.Tree"
@@ -46,9 +45,9 @@
</ContentControl.Resources>
</ContentControl>
<ToggleButton Grid.Column="3"
<ToggleButton Grid.Column="3"
Style="{StaticResource MaterialDesignFlatPrimaryToggleButton}"
ToolTip="Change the property's data binding"
ToolTip="Change the property's data binding"
Width="20"
Height="20"
VerticalAlignment="Center"
@@ -1,10 +1,9 @@
using System;
using System.Linq;
using Artemis.Core.Models.Profile.LayerProperties;
using Artemis.Core.Utilities;
using Artemis.Core;
using Artemis.UI.Screens.ProfileEditor.LayerProperties.Abstract;
using Artemis.UI.Shared.PropertyInput;
using Artemis.UI.Shared.Services.Interfaces;
using Artemis.UI.Shared;
using Artemis.UI.Shared.Services;
using Stylet;
namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Tree
@@ -3,11 +3,8 @@
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.Screens.ProfileEditor.LayerProperties.Tree"
xmlns:s="https://github.com/canton7/Stylet"
xmlns:converters="clr-namespace:Artemis.UI.Converters"
xmlns:abstract="clr-namespace:Artemis.UI.Screens.ProfileEditor.LayerProperties.Abstract"
xmlns:layerProperties="clr-namespace:Artemis.UI.Screens.ProfileEditor.LayerProperties"
xmlns:dd="urn:gong-wpf-dragdrop"
xmlns:tree="clr-namespace:Artemis.UI.Screens.ProfileEditor.LayerProperties.Tree"
xmlns:layerProperties1="clr-namespace:Artemis.UI.Screens.ProfileEditor.LayerProperties"
@@ -7,7 +7,6 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Tree
{
public class TreeViewModel : PropertyChangedBase
{
public TreeViewModel(LayerPropertiesViewModel layerPropertiesViewModel, BindableCollection<LayerPropertyGroupViewModel> layerPropertyGroups)
{
LayerPropertiesViewModel = layerPropertiesViewModel;
@@ -7,8 +7,8 @@
xmlns:s="https://github.com/canton7/Stylet"
xmlns:profileEditor="clr-namespace:Artemis.UI.Screens.ProfileEditor"
xmlns:behaviors="clr-namespace:Artemis.UI.Behaviors"
xmlns:profile="clr-namespace:Artemis.Core.Models.Profile;assembly=Artemis.Core"
xmlns:dataTemplateSelectors="clr-namespace:Artemis.UI.DataTemplateSelectors"
xmlns:profile="clr-namespace:Artemis.Core;assembly=Artemis.Core"
mc:Ignorable="d"
behaviors:InputBindingBehavior.PropagateInputBindingsToWindow="True"
d:DesignHeight="450" d:DesignWidth="800"
@@ -132,7 +132,7 @@
SelectedItem="{Binding SelectedProfile}"
ItemTemplateSelector="{dataTemplateSelectors:ComboBoxTemplateSelector
SelectedItemTemplate={StaticResource SimpleTemplate},
DropdownItemsTemplate={StaticResource ExtendedTemplate}}" >
DropdownItemsTemplate={StaticResource ExtendedTemplate}}">
<ComboBox.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel />
@@ -3,18 +3,15 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using Artemis.Core.Models.Profile;
using Artemis.Core.Plugins.Modules;
using Artemis.Core.Plugins.Settings;
using Artemis.Core;
using Artemis.Core.Modules;
using Artemis.Core.Services;
using Artemis.Core.Services.Interfaces;
using Artemis.Core.Services.Storage.Interfaces;
using Artemis.UI.Screens.ProfileEditor.Dialogs;
using Artemis.UI.Screens.ProfileEditor.DisplayConditions;
using Artemis.UI.Screens.ProfileEditor.LayerProperties;
using Artemis.UI.Screens.ProfileEditor.ProfileTree;
using Artemis.UI.Screens.ProfileEditor.Visualization;
using Artemis.UI.Shared.Services.Interfaces;
using Artemis.UI.Shared.Services;
using MaterialDesignThemes.Wpf;
using Stylet;
@@ -22,21 +19,21 @@ namespace Artemis.UI.Screens.ProfileEditor
{
public class ProfileEditorViewModel : Conductor<ProfileEditorPanelViewModel>.Collection.AllActive
{
private readonly IModuleService _moduleService;
private readonly IProfileEditorService _profileEditorService;
private readonly IProfileService _profileService;
private readonly ISettingsService _settingsService;
private readonly IModuleService _moduleService;
private readonly ISnackbarMessageQueue _snackbarMessageQueue;
private BindableCollection<ProfileDescriptor> _profiles;
private PluginSetting<GridLength> _sidePanelsWidth;
private PluginSetting<GridLength> _displayConditionsHeight;
private PluginSetting<GridLength> _bottomPanelsHeight;
private PluginSetting<GridLength> _elementPropertiesWidth;
private ProfileViewModel _profileViewModel;
private ProfileTreeViewModel _profileTreeViewModel;
private LayerPropertiesViewModel _layerPropertiesViewModel;
private PluginSetting<GridLength> _displayConditionsHeight;
private DisplayConditionsViewModel _displayConditionsViewModel;
private PluginSetting<GridLength> _elementPropertiesWidth;
private LayerPropertiesViewModel _layerPropertiesViewModel;
private BindableCollection<ProfileDescriptor> _profiles;
private ProfileTreeViewModel _profileTreeViewModel;
private ProfileViewModel _profileViewModel;
private ProfileDescriptor _selectedProfile;
private PluginSetting<GridLength> _sidePanelsWidth;
public ProfileEditorViewModel(ProfileModule module,
ICollection<ProfileEditorPanelViewModel> viewModels,
@@ -6,8 +6,6 @@
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:s="https://github.com/canton7/Stylet"
xmlns:dd="urn:gong-wpf-dragdrop"
xmlns:profileTree="clr-namespace:Artemis.UI.Screens.ProfileEditor.ProfileTree"
xmlns:treeItem="clr-namespace:Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem"
xmlns:behaviors="clr-namespace:Artemis.UI.Behaviors"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
xmlns:profileTree1="clr-namespace:Artemis.UI.Screens.ProfileEditor.ProfileTree"
@@ -1,11 +1,11 @@
using System;
using System.Linq;
using System.Windows;
using Artemis.Core.Models.Profile;
using Artemis.Core;
using Artemis.UI.Ninject.Factories;
using Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem;
using Artemis.UI.Shared.Events;
using Artemis.UI.Shared.Services.Interfaces;
using Artemis.UI.Shared;
using Artemis.UI.Shared.Services;
using GongSolutions.Wpf.DragDrop;
using Stylet;
@@ -15,9 +15,9 @@ namespace Artemis.UI.Screens.ProfileEditor.ProfileTree
{
private readonly IFolderVmFactory _folderVmFactory;
private readonly IProfileEditorService _profileEditorService;
private FolderViewModel _rootFolder;
private TreeItemViewModel _selectedTreeItem;
private bool _updatingTree;
private FolderViewModel _rootFolder;
public ProfileTreeViewModel(IProfileEditorService profileEditorService, IFolderVmFactory folderVmFactory)
{
@@ -101,6 +101,21 @@ namespace Artemis.UI.Screens.ProfileEditor.ProfileTree
RootFolder?.AddLayer();
}
protected override void OnInitialActivate()
{
Subscribe();
CreateRootFolderViewModel();
}
protected override void OnClose()
{
Unsubscribe();
RootFolder?.Dispose();
RootFolder = null;
base.OnClose();
}
private void CreateRootFolderViewModel()
{
_updatingTree = true;
@@ -152,21 +167,6 @@ namespace Artemis.UI.Screens.ProfileEditor.ProfileTree
}
}
protected override void OnInitialActivate()
{
Subscribe();
CreateRootFolderViewModel();
}
protected override void OnClose()
{
Unsubscribe();
RootFolder?.Dispose();
RootFolder = null;
base.OnClose();
}
#region Event handlers
private void Subscribe()
@@ -5,7 +5,6 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:s="https://github.com/canton7/Stylet"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:treeItem="clr-namespace:Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem"
xmlns:treeItem1="clr-namespace:Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"
@@ -1,24 +1,12 @@
using Artemis.Core.Models.Profile;
using Artemis.Core.Services.Interfaces;
using Artemis.Core;
using Artemis.Core.Services;
using Artemis.UI.Ninject.Factories;
using Artemis.UI.Shared.Services.Interfaces;
using Artemis.UI.Shared.Services;
namespace Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem
{
public class FolderViewModel : TreeItemViewModel
{
protected override void Dispose(bool disposing)
{
if (disposing)
{
foreach (var treeItemViewModel in Children)
treeItemViewModel.Dispose();
Children.Clear();
}
base.Dispose(disposing);
}
// I hate this about DI, oh well
public FolderViewModel(ProfileElement folder,
IProfileEditorService profileEditorService,
@@ -42,5 +30,17 @@ namespace Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem
}
public override bool SupportsChildren => true;
protected override void Dispose(bool disposing)
{
if (disposing)
{
foreach (var treeItemViewModel in Children)
treeItemViewModel.Dispose();
Children.Clear();
}
base.Dispose(disposing);
}
}
}
@@ -5,7 +5,6 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:s="https://github.com/canton7/Stylet"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:treeItem="clr-namespace:Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem"
xmlns:treeItem1="clr-namespace:Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"
@@ -1,7 +1,7 @@
using Artemis.Core.Models.Profile;
using Artemis.Core.Services.Interfaces;
using Artemis.Core;
using Artemis.Core.Services;
using Artemis.UI.Ninject.Factories;
using Artemis.UI.Shared.Services.Interfaces;
using Artemis.UI.Shared.Services;
namespace Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem
{
@@ -2,12 +2,12 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Artemis.Core.Models.Profile;
using Artemis.Core.Services.Interfaces;
using Artemis.Core;
using Artemis.Core.Services;
using Artemis.UI.Exceptions;
using Artemis.UI.Ninject.Factories;
using Artemis.UI.Screens.ProfileEditor.Dialogs;
using Artemis.UI.Shared.Services.Interfaces;
using Artemis.UI.Shared.Services;
using Stylet;
namespace Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem
@@ -191,7 +191,7 @@ namespace Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem
{
// Remove VMs that are no longer a child
var toRemove = Children.Where(c => c.ProfileElement.Parent != ProfileElement).ToList();
foreach (var treeItemViewModel in toRemove)
foreach (var treeItemViewModel in toRemove)
Children.Remove(treeItemViewModel);
// Order the children
@@ -20,17 +20,17 @@ namespace Artemis.UI.Screens.ProfileEditor.Visualization
set => SetAndNotify(ref _y, value);
}
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
if (disposing)
{
}
}
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
}
}
@@ -5,8 +5,6 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:s="https://github.com/canton7/Stylet"
xmlns:converters="clr-namespace:Artemis.UI.Converters"
xmlns:visualization="clr-namespace:Artemis.UI.Screens.ProfileEditor.Visualization"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:visualization1="clr-namespace:Artemis.UI.Screens.ProfileEditor.Visualization"
mc:Ignorable="d"
d:DesignHeight="450"
@@ -2,16 +2,16 @@
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using Artemis.Core.Models.Surface;
using Artemis.Core;
using Stylet;
namespace Artemis.UI.Screens.ProfileEditor.Visualization
{
public class ProfileDeviceViewModel : CanvasViewModel
{
private ObservableCollection<ProfileLedViewModel> _leds;
private ArtemisDevice _device;
private bool _addedLeds;
private ArtemisDevice _device;
private ObservableCollection<ProfileLedViewModel> _leds;
public ProfileDeviceViewModel(ArtemisDevice device)
{
@@ -3,8 +3,6 @@
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.Screens.ProfileEditor.Visualization"
xmlns:s="https://github.com/canton7/Stylet"
xmlns:visualization="clr-namespace:Artemis.UI.Screens.ProfileEditor.Visualization"
mc:Ignorable="d"
d:DesignHeight="450"
@@ -31,26 +29,6 @@
</DataTrigger>
</Style.Triggers>
</Style>
<Style TargetType="{x:Type Path}" x:Key="SelectedLayerStyle">
<Style.Triggers>
<DataTrigger Binding="{Binding IsSelected}" Value="False">
<DataTrigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<ColorAnimation Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#A7A7A7" Duration="0:0:0.5" />
</Storyboard>
</BeginStoryboard>
</DataTrigger.EnterActions>
<DataTrigger.ExitActions>
<BeginStoryboard>
<Storyboard>
<ColorAnimation Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#00A7A7A7" Duration="0:0:0.5" />
</Storyboard>
</BeginStoryboard>
</DataTrigger.ExitActions>
</DataTrigger>
</Style.Triggers>
</Style>
</UserControl.Resources>
<Canvas>
<Path Data="{Binding ShapeGeometry, Mode=OneWay}" StrokeThickness="{Binding StrokeThickness}" Style="{StaticResource SelectedShapeStyle}">
@@ -3,12 +3,10 @@ using System.ComponentModel;
using System.Linq;
using System.Windows;
using System.Windows.Media;
using Artemis.Core.Models.Profile;
using Artemis.Core.Models.Profile.LayerShapes;
using Artemis.Core.Models.Surface;
using Artemis.Core;
using Artemis.UI.Extensions;
using Artemis.UI.Services.Interfaces;
using Artemis.UI.Shared.Services.Interfaces;
using Artemis.UI.Shared.Services;
using Stylet;
namespace Artemis.UI.Screens.ProfileEditor.Visualization
@@ -133,10 +131,10 @@ namespace Artemis.UI.Screens.ProfileEditor.Visualization
var shapeGeometry = Geometry.Empty;
switch (Layer.LayerShape)
{
case Ellipse _:
case EllipseShape _:
shapeGeometry = new EllipseGeometry(bounds);
break;
case Rectangle _:
case RectangleShape _:
shapeGeometry = new RectangleGeometry(bounds);
break;
}
@@ -4,7 +4,6 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:converters="clr-namespace:Artemis.UI.Converters"
xmlns:visualization="clr-namespace:Artemis.UI.Screens.ProfileEditor.Visualization"
xmlns:visualization1="clr-namespace:Artemis.UI.Screens.ProfileEditor.Visualization"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance {x:Type visualization1:ProfileLedViewModel}}"
@@ -1,7 +1,7 @@
using System;
using System.Windows;
using System.Windows.Media;
using Artemis.Core.Models.Surface;
using Artemis.Core;
using Artemis.UI.Extensions;
using RGB.NET.Core;
using Stylet;
@@ -11,11 +11,11 @@ namespace Artemis.UI.Screens.ProfileEditor.Visualization
{
public class ProfileLedViewModel : PropertyChangedBase
{
private bool _isSelected;
private bool _isDimmed;
private Geometry _displayGeometry;
private Geometry _strokeGeometry;
private Color _displayColor;
private Geometry _displayGeometry;
private bool _isDimmed;
private bool _isSelected;
private Geometry _strokeGeometry;
public ProfileLedViewModel(ArtemisLed led)
{
@@ -5,10 +5,8 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:s="https://github.com/canton7/Stylet"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:profileEditor="clr-namespace:Artemis.UI.Screens.ProfileEditor.Visualization"
xmlns:utilities="clr-namespace:Artemis.UI.Shared.Utilities;assembly=Artemis.UI.Shared"
xmlns:controls="clr-namespace:Artemis.UI.Shared.Controls;assembly=Artemis.UI.Shared"
xmlns:visualization="clr-namespace:Artemis.UI.Screens.ProfileEditor.Visualization"
xmlns:shared="clr-namespace:Artemis.UI.Shared;assembly=Artemis.UI.Shared"
mc:Ignorable="d"
d:DesignHeight="510.9" d:DesignWidth="800"
d:DataContext="{d:DesignInstance {x:Type visualization:ProfileViewModel}}">
@@ -77,9 +75,9 @@
MouseDown="{s:Action CanvasMouseDown}"
MouseMove="{s:Action CanvasMouseMove}"
Cursor="{Binding ActiveToolViewModel.Cursor}"
utilities:SizeObserver.Observe="True"
utilities:SizeObserver.ObservedWidth="{Binding PanZoomViewModel.CanvasWidth, Mode=OneWayToSource}"
utilities:SizeObserver.ObservedHeight="{Binding PanZoomViewModel.CanvasHeight, Mode=OneWayToSource}">
shared:SizeObserver.Observe="True"
shared:SizeObserver.ObservedWidth="{Binding PanZoomViewModel.CanvasWidth, Mode=OneWayToSource}"
shared:SizeObserver.ObservedHeight="{Binding PanZoomViewModel.CanvasHeight, Mode=OneWayToSource}">
<Grid.Background>
<VisualBrush TileMode="Tile" Stretch="Uniform" Viewport="{Binding PanZoomViewModel.BackgroundViewport}" ViewportUnits="Absolute">
@@ -123,9 +121,9 @@
</ItemsControl.ItemContainerStyle>
<ItemsControl.ItemTemplate>
<DataTemplate>
<controls:DeviceVisualizer Device="{Binding}"
ShowColors="True"
HighlightedLeds="{Binding DataContext.HighlightedLeds, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}, Mode=OneWay}" />
<shared:DeviceVisualizer Device="{Binding}"
ShowColors="True"
HighlightedLeds="{Binding DataContext.HighlightedLeds, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}, Mode=OneWay}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
@@ -3,18 +3,14 @@ using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Input;
using Artemis.Core.Events;
using Artemis.Core.Models.Profile;
using Artemis.Core.Models.Surface;
using Artemis.Core.Plugins.Settings;
using Artemis.Core;
using Artemis.Core.Services;
using Artemis.Core.Services.Storage.Interfaces;
using Artemis.UI.Events;
using Artemis.UI.Extensions;
using Artemis.UI.Ninject.Factories;
using Artemis.UI.Screens.ProfileEditor.Visualization.Tools;
using Artemis.UI.Screens.Shared;
using Artemis.UI.Shared.Services.Interfaces;
using Artemis.UI.Shared.Services;
using Stylet;
namespace Artemis.UI.Screens.ProfileEditor.Visualization
@@ -211,6 +207,11 @@ namespace Artemis.UI.Screens.ProfileEditor.Visualization
base.OnClose();
}
protected override void OnActivate()
{
ApplyActiveProfile();
}
private void OnActiveSurfaceConfigurationSelected(object sender, SurfaceConfigurationEventArgs e)
{
ApplySurfaceConfiguration(e.Surface);
@@ -237,11 +238,6 @@ namespace Artemis.UI.Screens.ProfileEditor.Visualization
}
}
protected override void OnActivate()
{
ApplyActiveProfile();
}
private void ApplySurfaceConfiguration(ArtemisSurface surface)
{
Devices.Clear();
@@ -3,8 +3,6 @@
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.Screens.ProfileEditor.Visualization.Tools"
xmlns:userControls="clr-namespace:Artemis.UI.Screens.ProfileEditor.Visualization.UserControls"
xmlns:s="https://github.com/canton7/Stylet"
xmlns:tools="clr-namespace:Artemis.UI.Screens.ProfileEditor.Visualization.Tools"
xmlns:userControls1="clr-namespace:Artemis.UI.Screens.ProfileEditor.Visualization.UserControls"
@@ -14,17 +12,17 @@
d:DataContext="{d:DesignInstance {x:Type tools:EditToolViewModel}}">
<Canvas UseLayoutRounding="False">
<userControls1:LayerShapeControl Zoom="{Binding ProfileViewModel.PanZoomViewModel.Zoom}"
ShapePath="{Binding ShapePath}"
ShapeAnchor="{Binding ShapeAnchor}"
ShapeGeometry="{Binding ShapeGeometry}"
RotateMouseDown="{s:Action RotateMouseDown}"
RotateMouseUp="{s:Action RotateMouseUp}"
RotateMouseMove="{s:Action RotateMouseMove}"
ResizeMouseDown="{s:Action ResizeMouseDown}"
ResizeMouseUp="{s:Action ResizeMouseUp}"
ResizeMouseMove="{s:Action ResizeMouseMove}"
MoveMouseDown="{s:Action MoveMouseDown}"
MoveMouseUp="{s:Action MoveMouseUp}"
MoveMouseMove="{s:Action MoveMouseMove}" />
ShapePath="{Binding ShapePath}"
ShapeAnchor="{Binding ShapeAnchor}"
ShapeGeometry="{Binding ShapeGeometry}"
RotateMouseDown="{s:Action RotateMouseDown}"
RotateMouseUp="{s:Action RotateMouseUp}"
RotateMouseMove="{s:Action RotateMouseMove}"
ResizeMouseDown="{s:Action ResizeMouseDown}"
ResizeMouseUp="{s:Action ResizeMouseUp}"
ResizeMouseMove="{s:Action ResizeMouseMove}"
MoveMouseDown="{s:Action MoveMouseDown}"
MoveMouseUp="{s:Action MoveMouseUp}"
MoveMouseMove="{s:Action MoveMouseMove}" />
</Canvas>
</UserControl>
@@ -2,10 +2,10 @@
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;
using Artemis.Core.Models.Profile;
using Artemis.Core;
using Artemis.UI.Events;
using Artemis.UI.Services.Interfaces;
using Artemis.UI.Shared.Services.Interfaces;
using Artemis.UI.Shared.Services;
using SkiaSharp;
using SkiaSharp.Views.WPF;
using Stylet;
@@ -17,10 +17,10 @@ namespace Artemis.UI.Screens.ProfileEditor.Visualization.Tools
private readonly ILayerEditorService _layerEditorService;
private SKPoint _dragOffset;
private SKPoint _dragStart;
private SKPoint _topLeft;
private SKPath _shapePath;
private SKPoint _shapeAnchor;
private RectangleGeometry _shapeGeometry;
private SKPath _shapePath;
private SKPoint _topLeft;
public EditToolViewModel(ProfileViewModel profileViewModel, IProfileEditorService profileEditorService, ILayerEditorService layerEditorService)
: base(profileViewModel, profileEditorService)
@@ -2,9 +2,9 @@
using System.Linq;
using System.Windows;
using System.Windows.Input;
using Artemis.Core.Models.Profile;
using Artemis.Core;
using Artemis.UI.Properties;
using Artemis.UI.Shared.Services.Interfaces;
using Artemis.UI.Shared.Services;
namespace Artemis.UI.Screens.ProfileEditor.Visualization.Tools
{
@@ -2,10 +2,10 @@
using System.Linq;
using System.Windows;
using System.Windows.Input;
using Artemis.Core.Models.Profile;
using Artemis.Core.Services.Interfaces;
using Artemis.Core;
using Artemis.Core.Services;
using Artemis.UI.Properties;
using Artemis.UI.Shared.Services.Interfaces;
using Artemis.UI.Shared.Services;
namespace Artemis.UI.Screens.ProfileEditor.Visualization.Tools
{
@@ -3,7 +3,6 @@
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.Screens.ProfileEditor.Visualization.Tools"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid />
@@ -1,5 +1,5 @@
using System.Windows.Input;
using Artemis.UI.Shared.Services.Interfaces;
using Artemis.UI.Shared.Services;
namespace Artemis.UI.Screens.ProfileEditor.Visualization.Tools
{
@@ -1,7 +1,7 @@
using System;
using System.Windows;
using System.Windows.Input;
using Artemis.UI.Shared.Services.Interfaces;
using Artemis.UI.Shared.Services;
namespace Artemis.UI.Screens.ProfileEditor.Visualization.Tools
{