aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/BitResultsView.xaml.cs
blob: 19f7185c4780642c7c15b28095900341454320d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Tango.PPC.UI.Dialogs
{
    /// <summary>
    /// Interaction logic for BitResultsView.xaml
    /// </summary>
    public partial class BitResultsView : UserControl
    {
        public BitResultsView()
        {
            InitializeComponent();
        }
    }
}
pan>; using Tango.BL.Entities; using Tango.ColorConversion; using Tango.PPC.Common.Models; using Tango.SharedUI; namespace Tango.PPC.Jobs.Dialogs { /// <summary> /// Represents the fine tuning pallet dialog ViewModel. /// </summary> /// <seealso cref="Tango.SharedUI.DialogViewVM" /> public class FineTuningPaletteViewVM : DialogViewVM { private Job _job; private bool _prevent_change; private IColorConverter _converter; private List<ColorConversionSuggestion> _suggestions; /// <summary> /// Gets or sets the triplet suggestions. /// </summary> public List<ColorConversionSuggestion> Suggestions { get { return _suggestions; } set { _suggestions = value; RaisePropertyChangedAuto(); } } private List<ColorConversionSuggestion> _hiveSuggestions; /// <summary> /// Gets or sets the hive suggestions. /// </summary> public List<ColorConversionSuggestion> HiveSuggestions { get { return _hiveSuggestions; } set { _hiveSuggestions = value; RaisePropertyChangedAuto(); } } private ColorConversionSuggestion _selectedHiveSuggestion; /// <summary> /// Gets or sets the selected hive suggestion. /// </summary> public ColorConversionSuggestion SelectedHiveSuggestion { get { return _selectedHiveSuggestion; } set { _selectedHiveSuggestion = value; RaisePropertyChangedAuto(); OnSelectedHiveSuggestionChanged(); } } private ColorConversionSuggestion _selectedSuggestion; /// <summary> /// Gets or sets the selected triplet suggestion. /// </summary> public ColorConversionSuggestion SelectedSuggestion { get { return _selectedSuggestion; } set { _selectedSuggestion = value; RaisePropertyChangedAuto(); } } /// <summary> /// Initializes a new instance of the <see cref="FineTuningPaletteViewVM"/> class. /// </summary> public FineTuningPaletteViewVM() { Suggestions = new List<ColorConversionSuggestion>(); HiveSuggestions = new List<ColorConversionSuggestion>(); _converter = new DefaultColorConverter(); } /// <summary> /// Called when the selected hive suggestion has been changed /// </summary> private void OnSelectedHiveSuggestionChanged() { if (!_prevent_change) { Suggestions = _converter.Convert(_job, SelectedHiveSuggestion.Color, true).CreateTrippletSuggestions(); SelectedSuggestion = Suggestions.GetCenterSuggestion(); } } /// <summary> /// Initializes a new instance of the <see cref="FineTuningPaletteViewVM"/> class. /// </summary> /// <param name="fineTuneItem">The fine tune item.</param> /// <param name="job">The job.</param> public FineTuningPaletteViewVM(FineTuneItem fineTuneItem, Job job) : this() { _prevent_change = true; _job = job; Suggestions = fineTuneItem.Suggestions; HiveSuggestions = fineTuneItem.HiveSuggestions; SelectedHiveSuggestion = HiveSuggestions.GetCenterSuggestion(); SelectedSuggestion = Suggestions[Suggestions.Count / 2]; _prevent_change = false; } } }