Example #1
0
        public void RemoveModal(ActionBlock modal)
        {
            modal.IsShaded = true;
            var adorner = modals[modal];
            modals.Remove(modal);
            modalsPositions.Remove(modal);
            this.AdornerLayer.Remove(adorner);

            if (currentModal == modal)
            {
                currentModal = null;

                if (modalsPositions.Keys.Count() > 0)
                {
                    var maxPos = modalsPositions.Values.Max();
                    currentModal = modalsPositions.FirstOrDefault(kvp => kvp.Value == maxPos).Key;

                    if (currentModal != null)
                    {
                        currentModal.IsShaded = false;
                        this.AdornerLayer.Add(modals[currentModal]);
                    }
                }
            }
        }
Example #2
0
        public void AddModal(ActionBlock modal)
        {
            if (!modals.ContainsKey(modal))
            {
                var adorner = new SmokeScreenAdorner(modal, modal.ModalScopeElement ?? modal);
                modals.Add(modal, adorner);
            }

            if (!modalsPositions.ContainsKey(modal))
                modalsPositions.Add(modal, GetGlobalZIndex(modal));

            if (currentModal != null && modalsPositions[currentModal] < modalsPositions[modal])
            {
                this.AdornerLayer.Remove(modals[currentModal]);
                currentModal.IsShaded = true;
                currentModal = null;
            }

            if (currentModal == null)
            {
                currentModal = modal;
                currentModal.IsShaded = false;
                this.AdornerLayer.Add(modals[currentModal]);
            }
        }
Example #3
0
 public static void RegisterForm(ActionBlock form)
 {
     var p = FormsSpace.GetSpace(form);
     if (p != null)
     {
         p.AddForm(form);
     }
 }
Example #4
0
 public static void ShowModal(ActionBlock modal, bool isShow)
 {
     var space = ModalSpace.GetSpace(modal);
     if (space != null)
         if (isShow)
             space.AddModal(modal);
         else
             space.RemoveModal(modal);
 }
Example #5
0
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.Shell = ((RF.WinApp.ShellWindow)(target));
     return;
     case 2:
     this.GlobalGrid = ((System.Windows.Controls.Grid)(target));
     return;
     case 3:
     this.MainFrame = ((RF.WinApp.TabsPlatesCC)(target));
     
     #line 31 "..\..\..\..\Views\ShellWindow.xaml"
     this.MainFrame.RemoveItems += new System.EventHandler<System.Collections.Specialized.NotifyCollectionChangedEventArgs>(this.PlatesCC_RemovePlate);
     
     #line default
     #line hidden
     return;
     case 4:
     this.menu1 = ((System.Windows.Controls.Menu)(target));
     return;
     case 5:
     
     #line 34 "..\..\..\..\Views\ShellWindow.xaml"
     ((RF.WinApp.RadioMenuHeader)(target)).RadioChanged += new System.EventHandler<RF.WinApp.RadioMenuEventArgs>(this.MenuItem_Click);
     
     #line default
     #line hidden
     return;
     case 6:
     this.statusBar1 = ((System.Windows.Controls.Primitives.StatusBar)(target));
     return;
     case 7:
     this.ModalPlace = ((RF.WinApp.ActionBlock)(target));
     
     #line 49 "..\..\..\..\Views\ShellWindow.xaml"
     this.ModalPlace.Applied += new System.EventHandler(this.ModalPlace_Applied);
     
     #line default
     #line hidden
     
     #line 49 "..\..\..\..\Views\ShellWindow.xaml"
     this.ModalPlace.Closed += new System.EventHandler(this.ModalPlace_Closed);
     
     #line default
     #line hidden
     return;
     }
     this._contentLoaded = true;
 }
Example #6
0
 internal void AddForm(ActionBlock form)
 {
     if (!this.forms.Contains(form))
         this.forms.Add(form);
 }
Example #7
0
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     
     #line 39 "..\..\..\AssetsPage.xaml"
     ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.ImportExcelButton_Click);
     
     #line default
     #line hidden
     return;
     case 2:
     
     #line 49 "..\..\..\AssetsPage.xaml"
     ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.ReportButton_Click);
     
     #line default
     #line hidden
     return;
     case 3:
     this.AssetsCRUD = ((RF.WinApp.CrudCC)(target));
     return;
     case 4:
     this.C1 = ((System.Windows.Controls.Canvas)(target));
     return;
     case 5:
     this.C2 = ((System.Windows.Controls.Canvas)(target));
     return;
     case 6:
     this.crudGovernors = ((RF.WinApp.CrudCC)(target));
     return;
     case 7:
     this.drDate = ((RF.WinApp.UC.DateRangeUC)(target));
     return;
     case 8:
     this.cbInsuranceType = ((System.Windows.Controls.ComboBox)(target));
     return;
     case 9:
     this.xlsImport = ((RF.WinApp.ActionBlock)(target));
     return;
     case 10:
     this.rbImportValue = ((System.Windows.Controls.RadioButton)(target));
     return;
     case 11:
     this.rbImportCashFlow = ((System.Windows.Controls.RadioButton)(target));
     return;
     case 12:
     this.tbImportFileNameBorder = ((System.Windows.Controls.Border)(target));
     return;
     case 13:
     this.tbImportFileName = ((System.Windows.Controls.TextBox)(target));
     return;
     case 14:
     
     #line 193 "..\..\..\AssetsPage.xaml"
     ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.FileBrowse_Click);
     
     #line default
     #line hidden
     return;
     case 15:
     this.cbDataSheet = ((System.Windows.Controls.ComboBox)(target));
     return;
     case 16:
     this.cbImportInsuranceType = ((System.Windows.Controls.ComboBox)(target));
     return;
     case 17:
     this.reportForm = ((RF.WinApp.ActionBlock)(target));
     return;
     case 18:
     this.cbReportInsuranceType = ((System.Windows.Controls.ComboBox)(target));
     return;
     case 19:
     this.drReportPeriod = ((RF.WinApp.UC.DateRangeUC)(target));
     return;
     }
     this._contentLoaded = true;
 }
Example #8
0
 private void ToggleBlock(ActionBlock block)
 {
     if (block != null)
     {
         if (block.IsOpened)
             block.Close(block, null);
         else if (block.IsNotEmpty)
             block.Open(block, null);
     }
 }
Example #9
0
        private ZIndex GetZIndex(ActionBlock modal, DependencyObject parent, ZIndex parentIdx)
        {
            if (parent == modal)
                return parentIdx;

            for (int i = 0; i < VisualTreeHelper.GetChildrenCount(parent); i++)
            {
                var newIdx = new ZIndex(parentIdx.Index);
                newIdx.Add(i);
                var ret = GetZIndex(modal, VisualTreeHelper.GetChild(parent, i), newIdx);
                if (ret != null)
                    return ret;
            }

            return null;
        }
Example #10
0
 private ZIndex GetGlobalZIndex(ActionBlock modal)
 {
     var idx = new ZIndex();
     return GetZIndex(modal, Application.Current.MainWindow, idx);
 }