public DominoProviderVM(IDominoProvider dominoProvider, bool?AllowRegenerate) : base()
        {
            CurrentProject   = dominoProvider;
            CalculationVM    = CalculationVM.CalculationVMFactory(CurrentProject.PrimaryCalculation);
            ImageTreatmentVM = ImageTreatmentVM.ImageTreatmentVMFactory(CurrentProject.PrimaryImageTreatment);

            FillColorList();

            BuildtoolsClick = new RelayCommand(o => { OpenBuildTools(); });

            SetDominoCount = new RelayCommand(o =>
            {
                if (CurrentProject is ICountTargetable)
                {
                    DominoCount = (int)Math.Floor((double)o);
                }
            }
                                              );

            EditClick = new RelayCommand(o => { redoStack = new Stack <PostFilter>(); Editing = false; });
            OpenPopup = new RelayCommand(x => PopupOpen = true);

            ColorColumnConfig.Add(new Column()
            {
                DataField = "DominoColor.mediaColor", Header = "", Class = "Color"
            });
            ColorColumnConfig.Add(new Column()
            {
                DataField = "DominoColor.name", Header = _("Name"), Width = new GridLength(100), CanResize = true
            });
            ColorColumnConfig.Add(new Column()
            {
                DataField = "DominoColor.count", Header = GetParticularString("Number of stones available", "Total"), Class = "Count", Width = new GridLength(70), CanResize = true
            });
            ColorColumnConfig.Add(new Column()
            {
                DataField = "SumAll", Header = GetParticularString("Number of stones used in current project", "Used"), HighlightDataField = "DominoColor.count"
            });
            ColorColumnConfig.Add(new Column()
            {
                DataField = "Weight", Header = GetParticularString("Emphasis during calculation", "Weight")
            });

            AllowRegeneration = AllowRegenerate;
        }
Exemplo n.º 2
0
        public DominoProviderVM(IDominoProvider dominoProvider, bool?AllowRegenerate) : base()
        {
            CurrentProject   = dominoProvider;
            CalculationVM    = CalculationVM.CalculationVMFactory(CurrentProject.PrimaryCalculation);
            ImageTreatmentVM = ImageTreatmentVM.ImageTreatmentVMFactory(CurrentProject.PrimaryImageTreatment);

            FillColorList();

            BuildtoolsClick = new RelayCommand(o => { OpenBuildTools(); });

            EditClick         = new RelayCommand(o => { redoStack = new Stack <PostFilter>();  Editing = false; });
            OpenPopup         = new RelayCommand(x => PopupOpen = true);
            ColorColumnConfig = new ColumnConfig();

            var columns = new ObservableCollection <Column>();

            columns.Add(new Column()
            {
                DataField = "DominoColor.mediaColor", Header = ""
            });
            columns.Add(new Column()
            {
                DataField = "DominoColor.name", Header = "Name"
            });
            columns.Add(new Column()
            {
                DataField = "DominoColor.count", Header = "Total"
            });
            columns.Add(new Column()
            {
                DataField = "SumAll", Header = "Used", HighlightDataField = "DominoColor.count"
            });
            columns.Add(new Column()
            {
                DataField = "Weight", Header = "Weight"
            });
            ColorColumnConfig.Columns = columns;

            AllowRegeneration = AllowRegenerate;
        }