Exemplo n.º 1
0
        public WoodViewModel(ItemViewModel source, IMaterial material) : base(source)
        {
            _material = material;
            var builder = new CaptionBuilder(this);

            Thickness = builder.CreateTextBox(nameof(Thickness), int.TryParse, 2);
            Width     = builder.CreateComboBox(nameof(Width), App.Config.Widths);
            Length    = builder.CreateComboBox(nameof(Length), App.Config.Lengths);
            Quantity  = builder.CreateTextBox(nameof(Quantity), int.TryParse, 1);

            Fields = new List <IHasValue>
            {
                Thickness, Width, Length, Quantity
            };
        }
Exemplo n.º 2
0
        public WoodItem(ItemViewModel parent, Wood wood) : base(parent)
        {
            _wood = wood;
            var builder = new CaptionBuilder(this);

            Thickness = builder.CreateTextBox(nameof(Thickness), int.TryParse, "in", 2);
            Width = builder.CreateComboBox(nameof(Width), this.GetCuboid().Widths, label: "in");
            Length = builder.CreateComboBox(nameof(Length), this.GetCuboid().Lengths, label: "ft");
            Quantity = builder.CreateTextBox(nameof(Quantity), int.TryParse, value: 1);

            Fields = new BindableCollection<IHasValue>
            {
                Thickness, Width, Length, Quantity
            };
        }
Exemplo n.º 3
0
        public FoamItem(ItemViewModel parent) : base(parent)
        {
            var widths = App.Config.Cuboids
                         .Single(x => x.Type == Type).Widths;
            var lengths = App.Config.Cuboids
                          .Single(x => x.Type == Type).Lengths;
            var builder = new CaptionBuilder(this);

            Thickness = builder.CreateTextBox(nameof(Thickness), int.TryParse, "in", 2);
            Width     = builder.CreateComboBox(nameof(Width), this.GetCuboid().Widths, label: "in");
            Length    = builder.CreateComboBox(nameof(Length), this.GetCuboid().Lengths, label: "ft");
            Quantity  = builder.CreateTextBox(nameof(Quantity), int.TryParse, value: 1);
            Labor     = builder.CreateComboBox(nameof(Labor), App.Config.PieceValues, decimal.TryParse, "PHP", 150);
            Amount    = builder.CreateComboBox(nameof(Amount), App.Config.PieceValues, decimal.TryParse, "PHP", 150);

            Fields = new BindableCollection <IHasValue>
            {
                Labor, Thickness, Width, Length, Amount, Quantity
            };
        }
Exemplo n.º 4
0
        public PlywoodItem(IParent parent) : base(parent)
        {
            var builder = new CaptionBuilder(this);

            Thickness = builder.CreateComboBox(nameof(Thickness), App.Config.Plywood);
            Quantity  = builder.CreateTextBox(nameof(Quantity), int.TryParse, value: 1);

            Fields = new BindableCollection <IHasValue>
            {
                Thickness, Quantity
            };
        }
Exemplo n.º 5
0
        public ConcealedViewModel(IParent parent) : base(parent)
        {
            var builder = new CaptionBuilder(this);

            Amount = builder.CreateComboBox(nameof(Amount), App.Config.Values, decimal.TryParse);
            Pairs  = builder.CreateTextBox <int>(nameof(Pairs), int.TryParse);

            Fields = new List <IHasValue>
            {
                Amount, Pairs
            };
        }
Exemplo n.º 6
0
        public GlassViewModel(IParent parent) : base(parent)
        {
            var builder = new CaptionBuilder(this);

            Amount   = builder.CreateComboBox(nameof(Amount), App.Config.Values, decimal.TryParse);
            Quantity = builder.CreateTextBox <int>(nameof(Quantity), int.TryParse);

            Fields = new List <IHasValue>
            {
                Amount, Quantity
            };
        }
Exemplo n.º 7
0
        public PlywoodViewModel(IParent parentModel) : base(parentModel)
        {
            var builder = new CaptionBuilder(this);

            Thickness = builder.CreateComboBox(nameof(Thickness), _plywood.Thicknesses);
            Quantity  = builder.CreateTextBox(nameof(Quantity), int.TryParse, 1);

            Fields = new List <IHasValue>
            {
                Thickness, Quantity
            };
        }
Exemplo n.º 8
0
        public FrameViewModel(IParent parent) : base(parent)
        {
            var builder = new CaptionBuilder(this);

            Labor    = builder.CreateComboBox(nameof(Labor), App.Config.Values, decimal.TryParse);
            Frame    = builder.CreateComboBox(nameof(Frame), App.Config.Values, decimal.TryParse);
            Quantity = builder.CreateTextBox <int>(nameof(Quantity), int.TryParse);

            Fields = new List <IHasValue>
            {
                Labor, Frame, Quantity
            };
        }
Exemplo n.º 9
0
        public PieceItem(IParent parent, Piece material) : base(parent)
        {
            _material = material;

            var builder = new CaptionBuilder(this);

            Amount = builder.CreateComboBox(nameof(Amount), App.Config.PieceValues, decimal.TryParse, "PHP",
                                            _material.Value);
            Quantity = builder.CreateTextBox(nameof(Quantity), int.TryParse, value: 1);

            Fields = new BindableCollection <IHasValue>
            {
                Amount, Quantity
            };
        }