using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Windows.Controls; using InABox.Core; using InABox.DynamicGrid; using InABox.Wpf; namespace PRSDesktop; public partial class PostCodePanel : UserControl, IPanel { public PostCodePanel() { InitializeComponent(); } private void CountryGrid_OnOnSelectItem(object sender, DynamicGridSelectionEventArgs e) { StateGrid.CountryId = CountryGrid.SelectedRows.FirstOrDefault()?.Get(x => x.ID) ?? Guid.Empty; StateGrid.Refresh(false,true); LocalityGrid.StateId = Guid.Empty; LocalityGrid.Refresh(false,true); } private void StateGrid_OnOnSelectItem(object sender, DynamicGridSelectionEventArgs e) { LocalityGrid.StateId = StateGrid.SelectedRows.FirstOrDefault()?.Get(x => x.ID) ?? Guid.Empty; LocalityGrid.Refresh(false,true); } public void Setup() { LocalityTree.Refresh(true,false); CountryGrid.Refresh(true,false); StateGrid.Refresh(true,false); LocalityGrid.Refresh(true,false); } public void Shutdown(CancelEventArgs? cancel) { } public void Refresh() { LocalityTree.Refresh(false,true); CountryGrid.Refresh(false,true); StateGrid.Refresh(false,true); LocalityGrid.Refresh(false,true); } public string SectionName { get; } public DataModel DataModel(Selection selection) { return new AutoDataModel(null); } public event DataModelUpdateEvent? OnUpdateDataModel; public bool IsReady { get; set; } public void CreateToolbarButtons(IPanelHost host) { } public Dictionary Selected() { return new Dictionary(); } public void Heartbeat(TimeSpan time) { } }