Esempio n. 1
0
        public void AddExpanderUserControl(TabExpTabAsientoVM vm)
        {
            this.CPresenter.Content = vm;
            //DataGrid DGrid = this.CPresenter.FindVisualChild<DataGrid>(x => (x as DataGrid).Name == "DGridAsiento");

            //DGrid.SetBinding(DGrid.Height, new Binding("DGridHeight"));
        }
Esempio n. 2
0
        private void TabExpCloseTabButton_Click(object sender, RoutedEventArgs e)
        {
            Button button = sender as Button;
            //TabItem tab = button.FindFirstParentOfType<TabItem>();
            TabMayorUC         mayorUC = button.FindFirstParentOfType <TabMayorUC>();
            TabExpTabAsientoVM VM      = this.DataContext as TabExpTabAsientoVM;

            //if (VM.BaseTab.Type == TabType.Mayor)
            (VM.ParentVM as AdConta.ViewModel.aTabsWithTabExpVM).BottomTabbedExpanderItemsSource.Remove(VM);
            //TODO manage rest of tab types
        }
Esempio n. 3
0
        public void Execute(object parameter)
        {
            //If !is windowed by default, add the usercontrol to the expander of the tab
            if (!GlobalSettings.Properties.Settings.Default.ASIENTOSIMPLE_WINDOWED)
            {
                VMTabMayor         tab = this._tab as VMTabMayor;
                TabExpTabAsientoVM VM  = new TabExpTabAsientoVM();
                VM.TabComCod  = tab.TabCodigoComunidad;
                VM.ParentVM   = tab;
                VM.TabExpType = TabExpTabType.Inferior_AsientoSimple;


                tab.AddAndSelectTabInTabbedExpander(VM, TabExpWhich.Bottom);
                //tab.TabbedExpanderSelectedIndex = tab.TabbedExpanderItemsSource.IndexOf(VM);
                //tab.PublicNotifyPropChanged("TabbedExpanderItemsSource");

                /*MainWindow w = App.Current.MainWindow as MainWindow;
                 * TabMayorUC mayorUC = w.AbleTabControl.RootTabControl.FindVisualChild<TabMayorUC>(x =>
                 * {
                 *  if (x is TabMayorUC)
                 *      return (x as TabMayorUC).DataContext == tab;
                 *  else return false;
                 * });
                 * mayorUC.TabExpItemsSource.Add(VM);
                 * mayorUC.TabExpSelectedIndex = mayorUC.TabExpItemsSource.IndexOf(VM);*/
            }
            //else create, show and focus a new window with the usercontrol as content
            else
            {
                TabExpInferiorTabAsientoUC ASUC = new TabExpInferiorTabAsientoUC();
                TabExpTabAsientoVM         VM   = new TabExpTabAsientoVM();
                VM.TabComCod     = this._tab.TabCodigoComunidad;
                VM.ParentVM      = this._tab as VMTabMayor;
                VM.TabExpType    = TabExpTabType.Inferior_AsientoSimple;
                ASUC.DataContext = VM;
                AsientosWindow w = new AsientosWindow();

                w.RootAsGrid.Children.Add(ASUC);
                w.Show();
                w.Focus();
            }
        }
Esempio n. 4
0
        public void MoveUserControlToAbleTabcontrol(object sender, EventArgs e)
        {
            //AsientoSimple ASUC = this.CPresenter.Content as AsientoSimple;//FindFirstVisualChildren<AsientoSimple>();
            TabExpTabAsientoVM VM = this.CPresenter.Content as TabExpTabAsientoVM;

            VM.PinButtonVisibility = Visibility.Visible;
            VM.IsWindowed          = false;
            //ViewModel.TabsWithTabbedExpVM baseT = VM.BaseTab;// as ViewModel.VMTabBase;

            this.CPresenter.Content = null;

            /*if (baseT.Type == TabType.Mayor)
             * {
             *  MainWindow w = App.Current.MainWindow as MainWindow;
             *  TabMayorUC mayorUC = w.AbleTabControl.RootTabControl.FindVisualChild<TabMayorUC>(x =>
             *  {
             *      if (x is TabMayorUC)
             *          return (x as TabMayorUC).DataContext == baseT;
             *      else return false;
             *  });
             *  mayorUC.TabExpItemsSource.Add(VM);
             *  ASUC.PinButton.Visibility = Visibility.Visible;
             *  VM.IsWindowed = false;
             *  (baseT as VMTabMayor).TabbedExpanderItemsSource.Add(VM);
             *  int index = mayorUC.TabExpItemsSource.IndexOf(VM);
             *  mayorUC.TabExpSelectedIndex = mayorUC.TabExpItemsSource.IndexOf(VM);
             *  -----------------------------------------------------------------------------------
             *  VMTabMayor mayorVM = baseT as VMTabMayor;
             *  mayorVM.AddAndSelectTabInTabbedExpander(VM);
             * }
             *
             * //TODO else to manage AbleTabControl.VMTabDiario*/

            (VM.ParentVM as aTabsWithTabExpVM).AddAndSelectTabInTabbedExpander(VM, AdConta.TabExpWhich.Bottom);
            this.Close();
        }
Esempio n. 5
0
        public override ValidationResult Validate(object value, CultureInfo cultureInfo, BindingExpressionBase owner)
        {
            TabExpTabAsientoVM VM    = (TabExpTabAsientoVM)((BindingExpression)owner).DataItem;
            string             input = (string)value;

            if (!VM.Asiento.Abierto)
            {
                return(new ValidationResult(false, GlobalSettings.Properties.ContabilidadSettings.Default.MENSAJESERROR_ASIENTO_ASIENTOCERRADO));
            }

            decimal importe;

            if (!decimal.TryParse(input, out importe))
            {
                if (!VM.AsientoComplejoSiHayMasDeDosApuntes())
                {
                    return(new ValidationResult(false, GlobalSettings.Properties.ContabilidadSettings.Default.MENSAJESERROR_ASIENTO_LETRASENCELDAIMPORTE));
                }

                return(new ValidationResult(true, null));
            }

            return(new ValidationResult(true, null));
        }
 public Command_MoveAsientoToWindow(TabExpTabAsientoVM tab)
 {
     this._tab = tab;
 }
Esempio n. 7
0
 public Command_DeshacerCambios(TabExpTabAsientoVM tab)
 {
     this._tab = tab;
 }
Esempio n. 8
0
 public Command_GuardarAsiento(TabExpTabAsientoVM tab)
 {
     this._tab = tab;
 }
Esempio n. 9
0
 public Command_CerrarTabExpTabAsiento(TabExpTabAsientoVM tab)
 {
     this._tab = tab;
 }