public void Execute(object parameter)
        {
            if (!this._tab.IsWindowed)
            {
                this._tab.PinButtonVisibility = Visibility.Collapsed;
                this._tab.IsWindowed          = true;

                (this._tab.ParentVM as aTabsWithTabExpVM).BottomTabbedExpanderItemsSource.Remove(this._tab);

                AsientosWindow w = new AsientosWindow();
                w.Name = "testWindow";
                w.AddExpanderUserControl(this._tab);
                w.Show();
                w.Focus();
            }
        }
Example #2
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();
            }
        }