private void OnFootersRecieved(EditFreeHierarchyFooterViewModelContainer container, List <Dict_Balance_FreeHierarchy_Footers> footers)
        {
            container.Footers = footers;
            var footerListControl = new EditFreeHierarchyFooterListControl(container);

            Manager.UI.ShowLocalModal(footerListControl, "Итоги для '" + container.BalanceFreeHierarchySectionName + "'", this.FindTrueIModule(), false, true);
        }
        private void bEditFooterClick(object sender, RoutedEventArgs e)
        {
            var parentControl = this.FindParent <BalanceSectionControl>();

            if (parentControl == null)
            {
                return;
            }

            var itemRow = DataContext as BalanceFreeHierarchySectionRow;

            if (itemRow == null)
            {
                return;
            }

            var balanceFreeHierarchyUn = parentControl.TryFindResource("BalanceFreeHierarchyUn") as string;

            if (string.IsNullOrEmpty(balanceFreeHierarchyUn))
            {
                Manager.UI.ShowMessage("Идентификатор не присвоен. Сначала необходимо сохранить баланс");
                return;
            }

            var container = new EditFreeHierarchyFooterViewModelContainer
            {
                Sections = parentControl.FindResource("Sections") as List <Dict_Balance_FreeHierarchy_Section>,
                BalanceFreeHierarchyUn          = balanceFreeHierarchyUn,
                BalanceFreeHierarchySectionUN   = itemRow.BalanceFreeHierarchySectionUN,
                BalanceFreeHierarchySectionName = itemRow.BalanceFreeHierarchySectionName,
            };

            this.RunBackgroundAsync <List <Dict_Balance_FreeHierarchy_Footers> >("BL_GetFreeHierarchySectionFooters",
                                                                                 footers => OnFootersRecieved(container, footers), EnumServiceType.ArmService, container.BalanceFreeHierarchyUn, container.BalanceFreeHierarchySectionUN);
        }