mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2025-12-12 17:48:31 +00:00
Removed UI-project
This commit is contained in:
parent
98226a251d
commit
5b5b0fb9fe
@ -1,28 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>RGB.NET.WPF</id>
|
||||
<title>RGB.NET.WPF</title>
|
||||
<version>0.0.1</version>
|
||||
<authors>Darth Affe</authors>
|
||||
<owners>Darth Affe</owners>
|
||||
<projectUrl>https://github.com/DarthAffe/RGB.NET</projectUrl>
|
||||
<licenseUrl>https://raw.githubusercontent.com/DarthAffe/RGB.NET/master/LICENSE</licenseUrl>
|
||||
<requireLicenseAcceptance>true</requireLicenseAcceptance>
|
||||
<description>WPF-Controls of RGB.NET</description>
|
||||
<releaseNotes></releaseNotes>
|
||||
<summary>WPF-Controls of RGB.NET, a C# (.NET) library for accessing various RGB-peripherals</summary>
|
||||
<copyright>Copyright © Wyrez 2017</copyright>
|
||||
<language>en-US</language>
|
||||
<dependencies>
|
||||
<dependency id="RGB.NET.Core" version="0.0.1" />
|
||||
<dependency id="System.ValueTuple" version="4.3.1" />
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="..\bin\RGB.NET.WPF.dll" target="lib\net45\RGB.NET.WPF.dll" />
|
||||
<file src="..\bin\RGB.NET.WPF.pdb" target="lib\net45\RGB.NET.WPF.pdb" />
|
||||
<file src="..\bin\RGB.NET.WPF.xml" target="lib\net45\RGB.NET.WPF.xml" />
|
||||
<file src="..\RGB.NET.WPF\**\*.cs" target="src" exclude="..\RGB.NET.WPF\obj\**\*.*" />
|
||||
</files>
|
||||
</package>
|
||||
@ -1,34 +0,0 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.WPF.Controls
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Visualizes a <see cref="T:RGB.NET.Core.Led" /> in an wpf-application.
|
||||
/// </summary>
|
||||
public class LedVisualizer : Control
|
||||
{
|
||||
#region DependencyProperties
|
||||
// ReSharper disable InconsistentNaming
|
||||
|
||||
/// <summary>
|
||||
/// Backing-property for the <see cref="Led"/>-property.
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty LedProperty = DependencyProperty.Register(
|
||||
"Led", typeof(Led), typeof(LedVisualizer), new PropertyMetadata(default(Led)));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the <see cref="Core.Led"/> to visualize.
|
||||
/// </summary>
|
||||
public Led Led
|
||||
{
|
||||
get => (Led)GetValue(LedProperty);
|
||||
set => SetValue(LedProperty, value);
|
||||
}
|
||||
|
||||
// ReSharper restore InconsistentNaming
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,77 +0,0 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.WPF.Controls
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Visualizes a <see cref="T:RGB.NET.Core.IRGBDevice" /> in an wpf-application.
|
||||
/// </summary>
|
||||
[TemplatePart(Name = PART_CANVAS, Type = typeof(Canvas))]
|
||||
public class RGBDeviceVisualizer : Control
|
||||
{
|
||||
#region Constants
|
||||
|
||||
private const string PART_CANVAS = "PART_Canvas";
|
||||
|
||||
#endregion
|
||||
|
||||
#region Properties & Fields
|
||||
|
||||
private Canvas _canvas;
|
||||
|
||||
#endregion
|
||||
|
||||
#region DependencyProperties
|
||||
// ReSharper disable InconsistentNaming
|
||||
|
||||
/// <summary>
|
||||
/// Backing-property for the <see cref="Device"/>-property.
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty DeviceProperty = DependencyProperty.Register(
|
||||
"Device", typeof(IRGBDevice), typeof(RGBDeviceVisualizer), new PropertyMetadata(default(IRGBDevice), DeviceChanged));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the <see cref="IRGBDevice"/> to visualize.
|
||||
/// </summary>
|
||||
public IRGBDevice Device
|
||||
{
|
||||
get => (IRGBDevice)GetValue(DeviceProperty);
|
||||
set => SetValue(DeviceProperty, value);
|
||||
}
|
||||
|
||||
// ReSharper restore InconsistentNaming
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnApplyTemplate()
|
||||
{
|
||||
_canvas = (Canvas)GetTemplateChild(PART_CANVAS);
|
||||
|
||||
LayoutLeds();
|
||||
}
|
||||
|
||||
private static void DeviceChanged(DependencyObject dependencyObject,
|
||||
DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
|
||||
{
|
||||
((RGBDeviceVisualizer)dependencyObject).LayoutLeds();
|
||||
}
|
||||
|
||||
private void LayoutLeds()
|
||||
{
|
||||
if (_canvas == null) return;
|
||||
|
||||
_canvas.Children.Clear();
|
||||
|
||||
if (Device == null) return;
|
||||
|
||||
foreach (Led led in Device)
|
||||
_canvas.Children.Add(new LedVisualizer { Led = led });
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,99 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.WPF.Controls
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Visualizes the <see cref="T:RGB.NET.Core.RGBSurface" /> in an wpf-application.
|
||||
/// </summary>
|
||||
[TemplatePart(Name = PART_CANVAS, Type = typeof(Canvas))]
|
||||
public class RGBSurfaceVisualizer : Control
|
||||
{
|
||||
#region Constants
|
||||
|
||||
private const string PART_CANVAS = "PART_Canvas";
|
||||
|
||||
#endregion
|
||||
|
||||
#region Properties & Fields
|
||||
|
||||
private RGBSurface _surface;
|
||||
private Canvas _canvas;
|
||||
|
||||
//TODO DarthAffe 17.06.2017: This is ugly - redesign how device connect/disconnect is generally handled!
|
||||
private readonly List<IRGBDevice> _newDevices = new List<IRGBDevice>();
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.WPF.Controls.RGBSurfaceVisualizer" /> class.
|
||||
/// </summary>
|
||||
public RGBSurfaceVisualizer()
|
||||
{
|
||||
this.Loaded += OnLoaded;
|
||||
this.Unloaded += OnUnloaded;
|
||||
}
|
||||
|
||||
private void OnLoaded(object sender, RoutedEventArgs routedEventArgs)
|
||||
{
|
||||
_surface = RGBSurface.Instance;
|
||||
|
||||
_surface.SurfaceLayoutChanged += RGBSurfaceOnSurfaceLayoutChanged;
|
||||
foreach (IRGBDevice device in _surface.Devices)
|
||||
_newDevices.Add(device);
|
||||
|
||||
UpdateSurface();
|
||||
}
|
||||
|
||||
private void OnUnloaded(object sender, RoutedEventArgs routedEventArgs)
|
||||
{
|
||||
_surface.SurfaceLayoutChanged -= RGBSurfaceOnSurfaceLayoutChanged;
|
||||
_canvas?.Children.Clear();
|
||||
_newDevices.Clear();
|
||||
}
|
||||
|
||||
private void RGBSurfaceOnSurfaceLayoutChanged(SurfaceLayoutChangedEventArgs args)
|
||||
{
|
||||
if (args.DeviceAdded)
|
||||
foreach (IRGBDevice device in args.Devices)
|
||||
_newDevices.Add(device);
|
||||
|
||||
UpdateSurface();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnApplyTemplate()
|
||||
{
|
||||
_canvas?.Children.Clear();
|
||||
_canvas = (Canvas)GetTemplateChild(PART_CANVAS);
|
||||
UpdateSurface();
|
||||
}
|
||||
|
||||
private void UpdateSurface()
|
||||
{
|
||||
if ((_canvas == null) || (_surface == null)) return;
|
||||
|
||||
if (_newDevices.Count > 0)
|
||||
{
|
||||
foreach (IRGBDevice device in _newDevices)
|
||||
_canvas.Children.Add(new RGBDeviceVisualizer { Device = device });
|
||||
_newDevices.Clear();
|
||||
}
|
||||
|
||||
_canvas.Width = _surface.SurfaceRectangle.Size.Width;
|
||||
_canvas.Height = _surface.SurfaceRectangle.Size.Height;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,31 +0,0 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace RGB.NET.WPF.Converter
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Converts <see cref="T:RGB.NET.Core.Color" /> into <see cref="T:System.Windows.Media.SolidColorBrush" />.
|
||||
/// </summary>
|
||||
[ValueConversion(typeof(Core.Color), typeof(SolidColorBrush))]
|
||||
public class ColorToSolidColorBrushConverter : IValueConverter
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
return new SolidColorBrush(!(value is Core.Color color)
|
||||
? Color.FromArgb(0, 0, 0, 0)
|
||||
: Color.FromArgb(color.A, color.R, color.G, color.B));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
return !(value is SolidColorBrush brush)
|
||||
? Core.Color.Transparent
|
||||
: new Core.Color(brush.Color.A, brush.Color.R, brush.Color.G, brush.Color.B);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,35 +0,0 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("RGB.NET.WPF")]
|
||||
[assembly: AssemblyDescription("WPF-Controls of RGB.NET")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Wyrez")]
|
||||
[assembly: AssemblyProduct("RGB.NET.WPF")]
|
||||
[assembly: AssemblyCopyright("Copyright © Wyrez 2017")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("347c5f0f-f490-4dec-9c1c-6e84750d838d")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@ -1,89 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{8D6C4FE6-0046-4E98-876F-4C0B87249989}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>RGB.NET.WPF</RootNamespace>
|
||||
<AssemblyName>RGB.NET.WPF</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\bin\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<DocumentationFile>..\bin\RGB.NET.WPF.XML</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>..\bin\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<DocumentationFile>..\bin\RGB.NET.WPF.XML</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.ValueTuple, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.ValueTuple.4.3.1\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xaml" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="WindowsBase" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Controls\LedVisualizer.cs" />
|
||||
<Compile Include="Controls\RGBDeviceVisualizer.cs" />
|
||||
<Compile Include="Controls\RGBSurfaceVisualizer.cs" />
|
||||
<Compile Include="Converter\ColorToSolidColorBrushConverter.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\RGB.NET.Core\RGB.NET.Core.csproj">
|
||||
<Project>{5a4f9a75-75fe-47cd-90e5-914d5b20d232}</Project>
|
||||
<Name>RGB.NET.Core</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="Styles\LedVisualizer.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Styles\RGBDeviceVisualizer.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Styles\RGBSurfaceVisualizer.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@ -1,99 +0,0 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:RGB.NET.WPF.Controls"
|
||||
xmlns:converter="clr-namespace:RGB.NET.WPF.Converter">
|
||||
|
||||
<converter:ColorToSolidColorBrushConverter x:Key="ConverterColorToSolidColorBrush" />
|
||||
|
||||
<ControlTemplate x:Key="ControlTemplateLedRectangle"
|
||||
TargetType="{x:Type controls:LedVisualizer}">
|
||||
<Border VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
|
||||
<Border.Background>
|
||||
<ImageBrush AlignmentX="Center" AlignmentY="Center"
|
||||
Stretch="Fill"
|
||||
ImageSource="{Binding Led.Image, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
</Border.Background>
|
||||
|
||||
<Rectangle VerticalAlignment="Stretch"
|
||||
HorizontalAlignment="Stretch"
|
||||
Opacity="0.5"
|
||||
Stroke="{TemplateBinding BorderBrush}"
|
||||
StrokeThickness="1"
|
||||
Fill="{TemplateBinding Background}" />
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
|
||||
<ControlTemplate x:Key="ControlTemplateLedCircle"
|
||||
TargetType="{x:Type controls:LedVisualizer}">
|
||||
<Border VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
|
||||
<Border.Background>
|
||||
<ImageBrush AlignmentX="Center" AlignmentY="Center"
|
||||
Stretch="Fill"
|
||||
ImageSource="{Binding Led.Image, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
</Border.Background>
|
||||
|
||||
<Ellipse VerticalAlignment="Stretch"
|
||||
HorizontalAlignment="Stretch"
|
||||
Opacity="0.5"
|
||||
Stroke="{TemplateBinding BorderBrush}"
|
||||
StrokeThickness="1"
|
||||
Fill="{TemplateBinding Background}" />
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
|
||||
<ControlTemplate x:Key="ControlTemplateLedCustom"
|
||||
TargetType="{x:Type controls:LedVisualizer}">
|
||||
<Border x:Name="Border" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
|
||||
<Border.Background>
|
||||
<ImageBrush AlignmentX="Center" AlignmentY="Center"
|
||||
Stretch="Fill"
|
||||
ImageSource="{Binding Led.Image, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
</Border.Background>
|
||||
|
||||
<Path Opacity="0.5"
|
||||
Clip="{Binding Data, RelativeSource={RelativeSource Self}}"
|
||||
Stroke="{TemplateBinding BorderBrush}"
|
||||
StrokeThickness="2"
|
||||
Fill="{TemplateBinding Background}">
|
||||
<Path.Data>
|
||||
<PathGeometry Figures="{Binding Led.ShapeData, RelativeSource={RelativeSource TemplatedParent}}">
|
||||
<PathGeometry.Transform>
|
||||
<ScaleTransform ScaleX="{Binding ActualWidth, ElementName=Border}"
|
||||
ScaleY="{Binding ActualHeight, ElementName=Border}" />
|
||||
</PathGeometry.Transform>
|
||||
</PathGeometry>
|
||||
</Path.Data>
|
||||
</Path>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
|
||||
<Style x:Key="StyleLedVisualizer"
|
||||
TargetType="{x:Type controls:LedVisualizer}">
|
||||
<Setter Property="Width" Value="{Binding Led.LedRectangle.Size.Width, RelativeSource={RelativeSource Self}}" />
|
||||
<Setter Property="Height" Value="{Binding Led.LedRectangle.Size.Height, RelativeSource={RelativeSource Self}}" />
|
||||
<Setter Property="Canvas.Left" Value="{Binding Led.LedRectangle.Location.X, RelativeSource={RelativeSource Self}}" />
|
||||
<Setter Property="Canvas.Top" Value="{Binding Led.LedRectangle.Location.Y, RelativeSource={RelativeSource Self}}" />
|
||||
|
||||
<Setter Property="BorderBrush" Value="#000000" />
|
||||
<Setter Property="Background" Value="{Binding Led.Color, RelativeSource={RelativeSource Self},
|
||||
Converter={StaticResource ConverterColorToSolidColorBrush}}" />
|
||||
|
||||
<Setter Property="Template" Value="{StaticResource ControlTemplateLedRectangle}" />
|
||||
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="BorderBrush" Value="#FFFFFF" />
|
||||
</Trigger>
|
||||
|
||||
<DataTrigger Binding="{Binding Led.Shape, RelativeSource={RelativeSource Self}}" Value="Circle">
|
||||
<Setter Property="Template" Value="{StaticResource ControlTemplateLedCircle}" />
|
||||
</DataTrigger>
|
||||
|
||||
<DataTrigger Binding="{Binding Led.Shape, RelativeSource={RelativeSource Self}}" Value="Custom">
|
||||
<Setter Property="Template" Value="{StaticResource ControlTemplateLedCustom}" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
<Style TargetType="{x:Type controls:LedVisualizer}" BasedOn="{StaticResource StyleLedVisualizer}" />
|
||||
|
||||
</ResourceDictionary>
|
||||
@ -1,45 +0,0 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:RGB.NET.WPF.Controls">
|
||||
|
||||
<Style x:Key="StyleRGBDeviceVisualizer"
|
||||
TargetType="{x:Type controls:RGBDeviceVisualizer}">
|
||||
<Setter Property="Width" Value="{Binding Device.Size.Width, RelativeSource={RelativeSource Self}}" />
|
||||
<Setter Property="Height" Value="{Binding Device.Size.Height, RelativeSource={RelativeSource Self}}" />
|
||||
<Setter Property="Canvas.Left" Value="{Binding Device.Location.X, RelativeSource={RelativeSource Self}}" />
|
||||
<Setter Property="Canvas.Top" Value="{Binding Device.Location.Y, RelativeSource={RelativeSource Self}}" />
|
||||
|
||||
<Setter Property="BorderThickness" Value="2" />
|
||||
<Setter Property="BorderBrush" Value="#202020" />
|
||||
<!--<Setter Property="Background" Value="#3A3A3A" />-->
|
||||
<Setter Property="Background">
|
||||
<Setter.Value>
|
||||
<ImageBrush AlignmentX="Left" AlignmentY="Top"
|
||||
Stretch="Uniform"
|
||||
ImageSource="{Binding Device.DeviceInfo.Image, RelativeSource={RelativeSource AncestorType=controls:RGBDeviceVisualizer}}" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type controls:RGBDeviceVisualizer}">
|
||||
<Grid VerticalAlignment="Stretch"
|
||||
HorizontalAlignment="Stretch"
|
||||
Background="{TemplateBinding Background}">
|
||||
<Canvas x:Name="PART_Canvas"
|
||||
VerticalAlignment="Stretch"
|
||||
HorizontalAlignment="Stretch" />
|
||||
|
||||
<Border VerticalAlignment="Stretch"
|
||||
HorizontalAlignment="Stretch"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Background="{x:Null}" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style TargetType="{x:Type controls:RGBDeviceVisualizer}" BasedOn="{StaticResource StyleRGBDeviceVisualizer}" />
|
||||
|
||||
</ResourceDictionary>
|
||||
@ -1,36 +0,0 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:RGB.NET.WPF.Controls">
|
||||
|
||||
<Style x:Key="StyleRGBSurfaceVisualizer" TargetType="{x:Type controls:RGBSurfaceVisualizer}">
|
||||
<Setter Property="VerticalAlignment" Value="Stretch" />
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Top" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||
|
||||
<Setter Property="Background" Value="{x:Null}" />
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
<Setter Property="BorderBrush" Value="{x:Null}" />
|
||||
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type controls:RGBSurfaceVisualizer}">
|
||||
<ScrollViewer VerticalAlignment="{TemplateBinding VerticalAlignment}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
|
||||
VerticalScrollBarVisibility="Auto"
|
||||
HorizontalScrollBarVisibility="Auto">
|
||||
<Border VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Background="{TemplateBinding Background}">
|
||||
<Canvas x:Name="PART_Canvas" Background="Transparent" />
|
||||
</Border>
|
||||
</ScrollViewer>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style TargetType="{x:Type controls:RGBSurfaceVisualizer}" BasedOn="{StaticResource StyleRGBSurfaceVisualizer}" />
|
||||
|
||||
</ResourceDictionary>
|
||||
@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="System.ValueTuple" version="4.3.1" targetFramework="net45" />
|
||||
</packages>
|
||||
12
RGB.NET.sln
12
RGB.NET.sln
@ -1,7 +1,7 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.27130.0
|
||||
VisualStudioVersion = 15.0.27130.2010
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RGB.NET.Core", "RGB.NET.Core\RGB.NET.Core.csproj", "{5A4F9A75-75FE-47CD-90E5-914D5B20D232}"
|
||||
EndProject
|
||||
@ -38,13 +38,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NuGet", "NuGet", "{06416566
|
||||
NuGet\RGB.NET.Groups.nuspec = NuGet\RGB.NET.Groups.nuspec
|
||||
NuGet\RGB.NET.Input.Corsair.nuspec = NuGet\RGB.NET.Input.Corsair.nuspec
|
||||
NuGet\RGB.NET.Input.nuspec = NuGet\RGB.NET.Input.nuspec
|
||||
NuGet\RGB.NET.WPF.nuspec = NuGet\RGB.NET.WPF.nuspec
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UI", "UI", "{BD7C9994-1747-4595-9C21-298E8FDCB657}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RGB.NET.WPF", "RGB.NET.WPF\RGB.NET.WPF.csproj", "{8D6C4FE6-0046-4E98-876F-4C0B87249989}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RGB.NET.Devices.Logitech", "RGB.NET.Devices.Logitech\RGB.NET.Devices.Logitech.csproj", "{E7B2F174-FCC6-4FC7-9970-3138B5F4C921}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RGB.NET.Devices.CoolerMaster", "RGB.NET.Devices.CoolerMaster\RGB.NET.Devices.CoolerMaster.csproj", "{85609427-D433-44E2-A249-CE890B66D845}"
|
||||
@ -100,10 +95,6 @@ Global
|
||||
{2A39F859-AAD0-4C16-94F8-78057820B376}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{2A39F859-AAD0-4C16-94F8-78057820B376}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{2A39F859-AAD0-4C16-94F8-78057820B376}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{8D6C4FE6-0046-4E98-876F-4C0B87249989}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{8D6C4FE6-0046-4E98-876F-4C0B87249989}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{8D6C4FE6-0046-4E98-876F-4C0B87249989}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{8D6C4FE6-0046-4E98-876F-4C0B87249989}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{E7B2F174-FCC6-4FC7-9970-3138B5F4C921}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E7B2F174-FCC6-4FC7-9970-3138B5F4C921}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E7B2F174-FCC6-4FC7-9970-3138B5F4C921}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
@ -142,7 +133,6 @@ Global
|
||||
{C854766D-9C1D-474B-B5B8-249DF4A9E552} = {33D5E279-1C4E-4AB6-9D1E-6D18109A6C25}
|
||||
{F905C418-76BB-4BA6-88AB-0793BC2681D3} = {C854766D-9C1D-474B-B5B8-249DF4A9E552}
|
||||
{2A39F859-AAD0-4C16-94F8-78057820B376} = {FFBCAF88-6646-43EC-9F24-2D719D3779C8}
|
||||
{8D6C4FE6-0046-4E98-876F-4C0B87249989} = {BD7C9994-1747-4595-9C21-298E8FDCB657}
|
||||
{E7B2F174-FCC6-4FC7-9970-3138B5F4C921} = {33D5E279-1C4E-4AB6-9D1E-6D18109A6C25}
|
||||
{85609427-D433-44E2-A249-CE890B66D845} = {33D5E279-1C4E-4AB6-9D1E-6D18109A6C25}
|
||||
{DB2911F6-404C-4BC8-B35F-232A7450755F} = {33D5E279-1C4E-4AB6-9D1E-6D18109A6C25}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user