| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Linq;
- using System.Windows.Controls;
- using Comal.Classes;
- using InABox.Core;
- using InABox.DynamicGrid;
- using InABox.Wpf;
- namespace PRSDesktop
- {
- /// <summary>
- /// Interaction logic for QuoteTakeoffs.xaml
- /// </summary>
- public partial class QuoteDesigns : UserControl, IMasterDetailControl<Quote>, IPanel<Quote>
- {
- public Quote? Master
- {
- get => Designs.Master;
- set => Designs.Master = value;
- }
-
- public QuoteDesigns()
- {
- InitializeComponent();
- }
- public bool IsReady { get; set; }
- public event DataModelUpdateEvent? OnUpdateDataModel;
- public void CreateToolbarButtons(IPanelHost host)
- {
- }
- public string SectionName => "Quote Designs";
- public DataModel DataModel(Selection selected)
- {
- var designs = Designs.ExtractValues(x => x.ID, selected).ToArray();
- return new BaseDataModel<QuoteDesign>(new Filter<QuoteDesign>(x => x.ID).InList(designs));
- }
- public void Heartbeat(TimeSpan time)
- {
- }
- public void Refresh()
- {
- Designs.Refresh(false, true);
- Items.Refresh(false, true);
- }
- public Dictionary<string, object[]> Selected()
- {
- return new Dictionary<string, object[]>();
- }
- public void Setup()
- {
- Designs.Refresh(true, false);
- Items.Refresh(true, false);
- }
- public void Shutdown(CancelEventArgs? cancel)
- {
- }
-
- public Dictionary<Type, CoreTable> DataEnvironment()
- {
- return new Dictionary<Type, CoreTable>();
- }
- private void Designs_OnSelectItem(object sender, DynamicGridSelectionEventArgs e)
- {
- Items.Master = e.Rows?.FirstOrDefault()?.ToObject<QuoteDesign>();
- Items.Refresh(false, true);
- }
- }
- }
|