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 }; }
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 }; }
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 }; }
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 }; }
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 }; }
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 }; }
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 }; }
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 }; }
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 }; }