Code cleanup

This commit is contained in:
Robert committed 2019-11-13 14:08:26 +01:00
1 parent 0d02e144ba
commit da4b691717
70 files changed
+492 -488

No files matched your search

+12 -6
View File
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
@@ -30,7 +31,8 @@
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Security.Cryptography.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<assemblyIdentity name="System.Security.Cryptography.Primitives" publicKeyToken="b03f5f7f11d50a3a"
culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
<dependentAssembly>
@@ -54,7 +56,8 @@
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.CodeAnalysis.CSharp.Scripting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<assemblyIdentity name="Microsoft.CodeAnalysis.CSharp.Scripting" publicKeyToken="31bf3856ad364e35"
culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
@@ -70,7 +73,8 @@
<bindingRedirect oldVersion="0.0.0.0-2.6.0.0" newVersion="2.6.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Security.Cryptography.Algorithms" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<assemblyIdentity name="System.Security.Cryptography.Algorithms" publicKeyToken="b03f5f7f11d50a3a"
culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0" />
</dependentAssembly>
<dependentAssembly>
@@ -86,7 +90,8 @@
<bindingRedirect oldVersion="0.0.0.0-2.2.0.0" newVersion="2.2.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a"
culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
</dependentAssembly>
<dependentAssembly>
@@ -94,7 +99,8 @@
<bindingRedirect oldVersion="0.0.0.0-4.2.1.0" newVersion="4.2.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51"
culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.1" newVersion="4.0.3.1" />
</dependentAssembly>
<dependentAssembly>
@@ -107,4 +113,4 @@
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
</configuration>
@@ -7,12 +7,6 @@ namespace Artemis.UI.Converters
{
public class NullToVisibilityConverter : IValueConverter
{
private enum Parameters
{
Normal,
Inverted
}
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var direction = (Parameters) Enum.Parse(typeof(Parameters), (string) parameter ?? throw new InvalidOperationException());
@@ -22,6 +16,7 @@ namespace Artemis.UI.Converters
return Visibility.Hidden;
return Visibility.Visible;
}
if (value == null)
return Visibility.Visible;
return Visibility.Hidden;
@@ -31,5 +26,11 @@ namespace Artemis.UI.Converters
{
throw new NotImplementedException();
}
private enum Parameters
{
Normal,
Inverted
}
}
}
@@ -1,5 +1,4 @@
using System;
using RGB.NET.Core;
using RGB.NET.Core;
using Color = System.Windows.Media.Color;
namespace Artemis.UI.Extensions
@@ -1,17 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RGB.NET.Core;
using System.Drawing;
namespace Artemis.UI.Extensions
{
public static class RgbRectangleExtensions
{
public static System.Drawing.Rectangle ToDrawingRectangle(this Rectangle rectangle)
public static Rectangle ToDrawingRectangle(this RGB.NET.Core.Rectangle rectangle)
{
return new System.Drawing.Rectangle((int) rectangle.X, (int) rectangle.Y, (int) rectangle.Width, (int) rectangle.Height);
return new Rectangle((int) rectangle.X, (int) rectangle.Y, (int) rectangle.Width, (int) rectangle.Height);
}
}
}
+1 -1
View File
@@ -37,7 +37,7 @@ namespace Artemis.UI.Ninject
// Bind the module VM
Bind<IModuleViewModelFactory>().ToFactory();
Bind<IProfileEditorViewModelFactory>().ToFactory();
// Bind all UI services as singletons
Kernel.Bind(x =>
{
+3 -4
View File
@@ -1,5 +1,5 @@
using System.Resources;
using System.Reflection;
using System.Reflection;
using System.Resources;
using System.Runtime.InteropServices;
using System.Windows;
@@ -52,5 +52,4 @@ using System.Windows;
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: NeutralResourcesLanguage("en-US")]
+3 -3
View File
@@ -26,10 +26,10 @@ namespace Artemis.UI.Services
new ConstructorArgument("header", header),
new ConstructorArgument("text", text),
new ConstructorArgument("confirmText", confirmText),
new ConstructorArgument("cancelText", cancelText),
new ConstructorArgument("cancelText", cancelText)
};
var result = await ShowDialog<ConfirmDialogViewModel>(arguments);
return (bool)result;
return (bool) result;
}
public async Task<bool> ShowConfirmDialogAt(string identifier, string header, string text, string confirmText = "Confirm", string cancelText = "Cancel")
@@ -39,7 +39,7 @@ namespace Artemis.UI.Services
new ConstructorArgument("header", header),
new ConstructorArgument("text", text),
new ConstructorArgument("confirmText", confirmText),
new ConstructorArgument("cancelText", cancelText),
new ConstructorArgument("cancelText", cancelText)
};
var result = await ShowDialogAt<ConfirmDialogViewModel>(identifier, arguments);
return (bool) result;
@@ -1,7 +1,6 @@
using System;
using System.Collections.ObjectModel;
using System.Linq;
using System.Timers;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;
@@ -9,7 +8,6 @@ using Artemis.Core.Events;
using Artemis.Core.Models.Surface;
using Artemis.Core.Plugins.Abstract;
using Artemis.Core.Services;
using Artemis.Core.Services.Interfaces;
using Artemis.Core.Services.Storage;
using Artemis.UI.ViewModels.Screens;
using Artemis.UI.ViewModels.Utilities;
@@ -21,7 +19,7 @@ namespace Artemis.UI.ViewModels.Controls.ProfileEditor
{
public class ProfileEditorViewModel : ModuleViewModel
{
private TimerUpdateTrigger _updateTrigger;
private readonly TimerUpdateTrigger _updateTrigger;
public ProfileEditorViewModel(Module module, ISurfaceService surfaceService, ISettingsService settingsService) : base(module, "Profile Editor")
{
@@ -37,7 +35,7 @@ namespace Artemis.UI.ViewModels.Controls.ProfileEditor
// Borrow RGB.NET's update trigger, update up to 25 FPS, ignore higher settings than that
var targetFps = Math.Min(settingsService.GetSetting("TargetFrameRate", 25).Value, 25);
_updateTrigger = new TimerUpdateTrigger {UpdateFrequency = 1.0 / targetFps };
_updateTrigger = new TimerUpdateTrigger {UpdateFrequency = 1.0 / targetFps};
_updateTrigger.Update += UpdateLeds;
_updateTrigger.Start();
@@ -11,6 +11,13 @@ namespace Artemis.UI.ViewModels.Controls.SurfaceEditor
ApplyLedToViewModel();
}
public Led Led { get; set; }
public double X { get; set; }
public double Y { get; set; }
public double Width { get; set; }
public double Height { get; set; }
public void ApplyLedToViewModel()
{
X = Led.LedRectangle.X;
@@ -18,12 +25,5 @@ namespace Artemis.UI.ViewModels.Controls.SurfaceEditor
Width = Led.LedRectangle.Width;
Height = Led.LedRectangle.Height;
}
public Led Led { get; set; }
public double X { get; set; }
public double Y { get; set; }
public double Width { get; set; }
public double Height { get; set; }
}
}
@@ -29,6 +29,8 @@ namespace Artemis.UI.ViewModels.Screens
public ImageSource CurrentFrame { get; set; }
public double CurrentFps { get; set; }
public string Title => "Debugger";
public void ForceGarbageCollection()
{
GC.Collect();
@@ -42,10 +44,7 @@ namespace Artemis.UI.ViewModels.Screens
var imageSource = ImageSourceFromBitmap(e.Bitmap);
imageSource.Freeze();
Execute.OnUIThread(() =>
{
CurrentFrame = imageSource;
});
Execute.OnUIThread(() => { CurrentFrame = imageSource; });
}
private void CoreServiceOnFrameRendering(object sender, FrameRenderingEventArgs e)
@@ -72,12 +71,10 @@ namespace Artemis.UI.ViewModels.Screens
{
DeleteObject(handle);
}
}
}
[DllImport("gdi32.dll", EntryPoint = "DeleteObject")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool DeleteObject([In] IntPtr hObject);
public string Title => "Debugger";
}
}
@@ -1,7 +1,6 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Controls;
using Artemis.Core.Events;
@@ -16,8 +15,8 @@ namespace Artemis.UI.ViewModels.Screens
public class RootViewModel : Conductor<IScreen>.Collection.OneActive
{
private readonly ICollection<IScreenViewModel> _artemisViewModels;
private readonly IPluginService _pluginService;
private readonly IModuleViewModelFactory _moduleViewModelFactory;
private readonly IPluginService _pluginService;
public RootViewModel(ICollection<IScreenViewModel> artemisViewModels, IPluginService pluginService, IModuleViewModelFactory moduleViewModelFactory)
{
@@ -12,6 +12,7 @@ namespace Artemis.UI.ViewModels.Utilities
{
_viewManager = viewManager;
}
public DialogViewModelBase ActiveDialogViewModel { get; set; }
public bool IsOpen { get; set; }
@@ -59,7 +59,7 @@ namespace Artemis.UI.ViewModels.Utilities
PanX = Math.Min(0, PanX - delta.Value.X);
PanY = Math.Min(0, PanY - delta.Value.Y);
_lastPanPosition = position;
}
@@ -12,9 +12,12 @@
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Button.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.PopupBox.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.TextBlock.xaml" />
<ResourceDictionary
Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Button.xaml" />
<ResourceDictionary
Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.PopupBox.xaml" />
<ResourceDictionary
Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.TextBlock.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
@@ -26,7 +29,8 @@
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Rectangle Grid.Row="0" Height="140" Width="196" Fill="{DynamicResource MaterialDesignPaper}" />
<Image Grid.Row="0" Source="{Binding Device.RgbDevice.DeviceInfo.Image}" Height="130" Width="190" RenderOptions.BitmapScalingMode="HighQuality" />
<Image Grid.Row="0" Source="{Binding Device.RgbDevice.DeviceInfo.Image}" Height="130" Width="190"
RenderOptions.BitmapScalingMode="HighQuality" />
<Button Grid.Row="0"
Style="{StaticResource MaterialDesignFloatingActionMiniButton}"
HorizontalAlignment="Right"
@@ -15,7 +15,7 @@
MouseLeave="{s:Action MouseLeave}"
ToolTip="{Binding Device.RgbDevice.DeviceInfo.DeviceName}">
<UserControl.Resources>
<converters:NullToImageConverter x:Key="NullToImageConverter"/>
<converters:NullToImageConverter x:Key="NullToImageConverter" />
<converters:NullToVisibilityConverter x:Key="NullToVisibilityConverter" />
</UserControl.Resources>
<Grid>
@@ -64,29 +64,40 @@
<Rectangle.Style>
<Style TargetType="{x:Type Rectangle}">
<Style.Triggers>
<DataTrigger Binding="{Binding SelectionStatus}" Value="{x:Static surfaceEditor:SelectionStatus.Hover}">
<DataTrigger Binding="{Binding SelectionStatus}"
Value="{x:Static surfaceEditor:SelectionStatus.Hover}">
<DataTrigger.EnterActions>
<StopStoryboard BeginStoryboardName="ToSelected" />
<BeginStoryboard x:Name="ToHover">
<Storyboard>
<ColorAnimation Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" To="{StaticResource IdealForegroundColor}" Duration="0:0:0.25" />
<ColorAnimation Storyboard.TargetProperty="(Shape.Stroke).(SolidColorBrush.Color)" To="{StaticResource IdealForegroundColor}" Duration="0:0:0.25" />
<ColorAnimation
Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)"
To="{StaticResource IdealForegroundColor}" Duration="0:0:0.25" />
<ColorAnimation
Storyboard.TargetProperty="(Shape.Stroke).(SolidColorBrush.Color)"
To="{StaticResource IdealForegroundColor}" Duration="0:0:0.25" />
</Storyboard>
</BeginStoryboard>
</DataTrigger.EnterActions>
</DataTrigger>
<DataTrigger Binding="{Binding SelectionStatus}" Value="{x:Static surfaceEditor:SelectionStatus.Selected}">
<DataTrigger Binding="{Binding SelectionStatus}"
Value="{x:Static surfaceEditor:SelectionStatus.Selected}">
<DataTrigger.EnterActions>
<StopStoryboard BeginStoryboardName="ToHover" />
<BeginStoryboard x:Name="ToSelected">
<Storyboard>
<ColorAnimation Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" To="{StaticResource Primary400}" Duration="0:0:0.25" />
<ColorAnimation Storyboard.TargetProperty="(Shape.Stroke).(SolidColorBrush.Color)" To="{StaticResource Primary400}" Duration="0:0:0.25" />
<ColorAnimation
Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)"
To="{StaticResource Primary400}" Duration="0:0:0.25" />
<ColorAnimation
Storyboard.TargetProperty="(Shape.Stroke).(SolidColorBrush.Color)"
To="{StaticResource Primary400}" Duration="0:0:0.25" />
</Storyboard>
</BeginStoryboard>
</DataTrigger.EnterActions>
</DataTrigger>
<DataTrigger Binding="{Binding SelectionStatus}" Value="{x:Static surfaceEditor:SelectionStatus.None}">
<DataTrigger Binding="{Binding SelectionStatus}"
Value="{x:Static surfaceEditor:SelectionStatus.None}">
<DataTrigger.EnterActions>
<BeginStoryboard>
<Storyboard>
@@ -1,19 +1,21 @@
<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:surfaceEditor="clr-namespace:Artemis.UI.ViewModels.Controls.SurfaceEditor"
xmlns:Converters="clr-namespace:Artemis.UI.Converters" x:Class="Artemis.UI.Views.Controls.SurfaceEditor.SurfaceLedView"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance {x:Type surfaceEditor:SurfaceLedViewModel}}"
d:DesignHeight="25" d:DesignWidth="25">
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:surfaceEditor="clr-namespace:Artemis.UI.ViewModels.Controls.SurfaceEditor"
xmlns:Converters="clr-namespace:Artemis.UI.Converters"
x:Class="Artemis.UI.Views.Controls.SurfaceEditor.SurfaceLedView"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance {x:Type surfaceEditor:SurfaceLedViewModel}}"
d:DesignHeight="25" d:DesignWidth="25">
<UserControl.Resources>
<Converters:NullToImageConverter x:Key="NullToImageConverter"/>
<Converters:NullToImageConverter x:Key="NullToImageConverter" />
</UserControl.Resources>
<Grid Width="{Binding Width}" Height="{Binding Height}">
<Grid.Background>
<ImageBrush AlignmentX="Center" AlignmentY="Center" Stretch="Fill" ImageSource="{Binding Led.Image, Converter={StaticResource NullToImageConverter}}" />
<ImageBrush AlignmentX="Center" AlignmentY="Center" Stretch="Fill"
ImageSource="{Binding Led.Image, Converter={StaticResource NullToImageConverter}}" />
</Grid.Background>
</Grid>
</UserControl>
@@ -1,22 +1,25 @@
<UserControl x:Class="Artemis.UI.Views.Dialogs.ConfirmDialogView"
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.Views.Dialogs"
xmlns:s="https://github.com/canton7/Stylet"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:dialogs="clr-namespace:Artemis.UI.ViewModels.Dialogs"
mc:Ignorable="d"
mc:Ignorable="d"
d:DesignHeight="163.274" d:DesignWidth="254.425"
d:DataContext="{d:DesignInstance dialogs:ConfirmDialogViewModel}">
<StackPanel Margin="16">
<TextBlock Style="{StaticResource MaterialDesignTitleTextBlock}" Text="{Binding Header}" TextWrapping="Wrap"/>
<TextBlock Style="{StaticResource MaterialDesignBody1TextBlock}" Margin="0 20 0 20" Text="{Binding Text}" TextWrapping="Wrap"/>
<TextBlock Style="{StaticResource MaterialDesignTitleTextBlock}" Text="{Binding Header}" TextWrapping="Wrap" />
<TextBlock Style="{StaticResource MaterialDesignBody1TextBlock}" Margin="0 20 0 20" Text="{Binding Text}"
TextWrapping="Wrap" />
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Button Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True" Margin="0 8 8 0" Command="{s:Action Cancel}" Content="{Binding CancelText}"/>
<Button Style="{StaticResource MaterialDesignFlatButton}" IsDefault="True" Margin="0 8 0 0" Command="{s:Action Confirm}" Content="{Binding ConfirmText}"/>
<Button Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True" Margin="0 8 8 0"
Command="{s:Action Cancel}" Content="{Binding CancelText}" />
<Button Style="{StaticResource MaterialDesignFlatButton}" IsDefault="True" Margin="0 8 0 0"
Command="{s:Action Confirm}" Content="{Binding ConfirmText}" />
</StackPanel>
</StackPanel>
</UserControl>
@@ -1,22 +1,24 @@
<UserControl x:Class="Artemis.UI.Views.Dialogs.SurfaceCreateView"
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.Views.Dialogs"
xmlns:s="https://github.com/canton7/Stylet"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
mc:Ignorable="d"
mc:Ignorable="d"
d:DesignHeight="213.053" d:DesignWidth="254.425">
<StackPanel Margin="16">
<TextBlock>
Add a new surface layout
</TextBlock>
<TextBox materialDesign:HintAssist.Hint="Layout name" Margin="0 8 0 16" Style="{StaticResource MaterialDesignFloatingHintTextBox}" Text="{Binding SurfaceName}"/>
<TextBox materialDesign:HintAssist.Hint="Layout name" Margin="0 8 0 16"
Style="{StaticResource MaterialDesignFloatingHintTextBox}" Text="{Binding SurfaceName}" />
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Button Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True" Margin="0 8 8 0" Command="{s:Action Cancel}">
<Button Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True" Margin="0 8 8 0"
Command="{s:Action Cancel}">
<Button.CommandParameter>
<system:Boolean xmlns:system="clr-namespace:System;assembly=mscorlib">
False
@@ -24,7 +26,8 @@
</Button.CommandParameter>
CANCEL
</Button>
<Button Style="{StaticResource MaterialDesignFlatButton}" IsDefault="True" Margin="0 8 8 0" Command="{s:Action Accept}">
<Button Style="{StaticResource MaterialDesignFlatButton}" IsDefault="True" Margin="0 8 8 0"
Command="{s:Action Accept}">
<Button.CommandParameter>
<system:Boolean xmlns:system="clr-namespace:System;assembly=mscorlib">
True
@@ -34,4 +37,4 @@
</Button>
</StackPanel>
</StackPanel>
</UserControl>
</UserControl>
+7 -6
View File
@@ -73,9 +73,9 @@
<Grid Margin="0,10,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0">
This image shows what is being rendered and dispatched to RGB.NET
@@ -83,14 +83,15 @@
<TextBlock Grid.Column="1" HorizontalAlignment="Right" Margin="0,0,5,0" FontWeight="Bold">
FPS:
</TextBlock>
<TextBlock Grid.Column="2" HorizontalAlignment="Right" Text="{Binding CurrentFps}"/>
<TextBlock Grid.Column="2" HorizontalAlignment="Right" Text="{Binding CurrentFps}" />
</Grid>
<materialDesign:Card VerticalAlignment="Stretch" Margin="0, 5,0,0">
<Image Source="{Binding CurrentFrame}" />
</materialDesign:Card>
<Button Command="{s:Action ForceGarbageCollection}" Style="{StaticResource MaterialDesignRaisedButton}" HorizontalAlignment="Left" Margin="0, 10, 0, 0">
<Button Command="{s:Action ForceGarbageCollection}" Style="{StaticResource MaterialDesignRaisedButton}"
HorizontalAlignment="Left" Margin="0, 10, 0, 0">
Force garbage collection
</Button>
</StackPanel>
@@ -10,7 +10,8 @@
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"
d:DataContext="{d:DesignInstance screens:ModuleRootViewModel}">
<dragablz:TabablzControl Margin="0 -1 0 0" FixedHeaderCount="{Binding FixedHeaderCount}" ItemsSource="{Binding ModuleViewModels}">
<dragablz:TabablzControl Margin="0 -1 0 0" FixedHeaderCount="{Binding FixedHeaderCount}"
ItemsSource="{Binding ModuleViewModels}">
<dragablz:TabablzControl.HeaderItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}" />
+15 -13
View File
@@ -33,26 +33,27 @@
</Grid.ColumnDefinitions>
<TextBlock VerticalAlignment="Bottom" Grid.Row="0" Grid.Column="0">Render scale</TextBlock>
<Slider Minimum="0.10"
Maximum="1"
TickFrequency="0.05"
Grid.Row="1"
Grid.Column="0"
Style="{StaticResource MaterialDesignDiscreteSlider}"
<Slider Minimum="0.10"
Maximum="1"
TickFrequency="0.05"
Grid.Row="1"
Grid.Column="0"
Style="{StaticResource MaterialDesignDiscreteSlider}"
ToolTip="MaterialDesignDiscreteSlider"
Value="{Binding RenderScale}" />
<TextBlock VerticalAlignment="Bottom" Grid.Row="0" Grid.Column="1">Target framerate</TextBlock>
<Slider Minimum="5"
Maximum="60"
Grid.Row="1"
Grid.Column="1"
Style="{StaticResource MaterialDesignDiscreteSlider}"
<Slider Minimum="5"
Maximum="60"
Grid.Row="1"
Grid.Column="1"
Style="{StaticResource MaterialDesignDiscreteSlider}"
ToolTip="MaterialDesignDiscreteSlider"
Value="{Binding TargetFrameRate}" />
</Grid>
<Button Command="{s:Action ShowDebugger}" Style="{StaticResource MaterialDesignRaisedButton}" HorizontalAlignment="Left" Margin="0, 10, 0, 0">
<Button Command="{s:Action ShowDebugger}" Style="{StaticResource MaterialDesignRaisedButton}"
HorizontalAlignment="Left" Margin="0, 10, 0, 0">
Show debugger
</Button>
</StackPanel>
@@ -69,7 +70,8 @@
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<ContentControl xaml:View.Model="{Binding}" Margin="5" HorizontalAlignment="Left" VerticalAlignment="Top" />
<ContentControl xaml:View.Model="{Binding}" Margin="5" HorizontalAlignment="Left"
VerticalAlignment="Top" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
+4 -1
View File
@@ -25,7 +25,10 @@
<RowDefinition />
</Grid.RowDefinitions>
<Image Source="{StaticResource BowIcon}" Stretch="Uniform" Margin="6,50,6,6" />
<TextBlock Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Bottom" Foreground="White" FontSize="16">Artemis is initializing...</TextBlock>
<TextBlock Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Bottom" Foreground="White"
FontSize="16">
Artemis is initializing...
</TextBlock>
<TextBlock Grid.Row="2" HorizontalAlignment="Center" Foreground="#FFDDDDDD" Text="{Binding Status}" />
<ProgressBar Grid.Row="3" IsIndeterminate="True" Maximum="1" Minimum="1" Margin="16 0" />
</Grid>
@@ -176,37 +176,41 @@
</Grid>
</materialDesign:Card>
<materialDesign:Card materialDesign:ShadowAssist.ShadowDepth="Depth1" Grid.Row="2" Grid.Column="1" VerticalAlignment="Stretch" Margin="5,0,0,0">
<materialDesign:DialogHost Identifier="SurfaceListDialogHost" CloseOnClickAway="True" UseLayoutRounding="True">
<materialDesign:Card materialDesign:ShadowAssist.ShadowDepth="Depth1" Grid.Row="2" Grid.Column="1"
VerticalAlignment="Stretch" Margin="5,0,0,0">
<materialDesign:DialogHost Identifier="SurfaceListDialogHost" CloseOnClickAway="True"
UseLayoutRounding="True">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<ListBox Grid.Row="0" ItemsSource="{Binding SurfaceConfigurations}" SelectedItem="{Binding SelectedSurface}">
<ListBox Grid.Row="0" ItemsSource="{Binding SurfaceConfigurations}"
SelectedItem="{Binding SelectedSurface}">
<ListBox.Resources>
<DataTemplate DataType="{x:Type models:Surface}">
<Grid HorizontalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="230"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="230" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Name}" ToolTip="{Binding Name}" HorizontalAlignment="Left" VerticalAlignment="Center"/>
<Button Grid.Column="1"
<TextBlock Text="{Binding Name}" ToolTip="{Binding Name}"
HorizontalAlignment="Left" VerticalAlignment="Center" />
<Button Grid.Column="1"
Command="{s:Action DeleteSurfaceConfiguration}"
CommandParameter="{Binding}"
Style="{StaticResource MaterialDesignIconForegroundButton}"
ToolTip="Delete layout configuration"
HorizontalAlignment="Right" >
Style="{StaticResource MaterialDesignIconForegroundButton}"
ToolTip="Delete layout configuration"
HorizontalAlignment="Right">
<materialDesign:PackIcon Kind="Trashcan" />
</Button>
</Grid>
</DataTemplate>
</ListBox.Resources>
</ListBox>
<Button Grid.Row="0"
Style="{StaticResource MaterialDesignFloatingActionButton}"
<Button Grid.Row="0"
Style="{StaticResource MaterialDesignFloatingActionButton}"
Command="{s:Action AddSurfaceConfiguration}"
Margin="0 0 10 10"
HorizontalAlignment="Right"
+1
View File
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Castle.Core" version="4.4.0" targetFramework="net461" />
<package id="ControlzEx" version="3.0.2.4" targetFramework="net472" />