mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +00:00
ColorPicker WIP
This commit is contained in:
1 parent
c99e549101
commit
515348241a
7 files changed
+288
-47
No files matched your search
@@ -4,10 +4,12 @@
|
||||
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.Workshop"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:s="https://github.com/canton7/Stylet"
|
||||
xmlns:controls="clr-namespace:Artemis.UI.Controls"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
<TextBlock Style="{DynamicResource MaterialDesignBody1TextBlock}">Work work!</TextBlock>
|
||||
<TextBlock Text="{Binding TestColor}"></TextBlock>
|
||||
<controls:ColorPicker Color="{Binding TestColor}" VerticalAlignment="Center" HorizontalAlignment="Center"></controls:ColorPicker>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -1,9 +1,38 @@
|
||||
using Stylet;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Media;
|
||||
using Stylet;
|
||||
|
||||
namespace Artemis.UI.Screens.Workshop
|
||||
{
|
||||
public class WorkshopViewModel : Screen, IScreenViewModel
|
||||
{
|
||||
public string Title => "Workshop";
|
||||
|
||||
public WorkshopViewModel()
|
||||
{
|
||||
PropertyChanged += OnPropertyChanged;
|
||||
}
|
||||
|
||||
private void OnPropertyChanged(object sender, PropertyChangedEventArgs e)
|
||||
{
|
||||
Console.WriteLine("Property changed:" + e.PropertyName);
|
||||
Console.WriteLine(TestColor);
|
||||
}
|
||||
|
||||
public Color TestColor { get; set; }
|
||||
|
||||
|
||||
protected override void OnActivate()
|
||||
{
|
||||
TestColor = Color.FromRgb(255, 0, 0);
|
||||
base.OnActivate();
|
||||
}
|
||||
|
||||
protected override void OnDeactivate()
|
||||
{
|
||||
Console.WriteLine(TestColor);
|
||||
base.OnDeactivate();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user