예제 #1
0
        public virtual void ItemClose(object sender, ExecutedRoutedEventArgs e)
        {
            var      tabs           = Template.FindName(TabsTemplatePartName, this) as TabControl;
            PlatesCC platesToRemove = e.Parameter as PlatesCC;
            NotifyCollectionChangedEventArgs removeArgs = new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, this.platesItems[platesToRemove]);

            platesToRemove.RemovePlate -= PlatesCC_RemovePlate;

            tabs.Items.Remove(platesToRemove);
            this.platesItems.Remove(platesToRemove);

            OnRemoveItems(removeArgs);
            platesToRemove.Free();
        }
예제 #2
0
        public void SetWaitOverdoor(bool on)
        {
            var tabs = Template.FindName(TabsTemplatePartName, this) as TabControl;

            if (tabs != null)
            {
                PlatesCC activePlates = tabs.SelectedItem as PlatesCC;
                if (activePlates != null)
                {
                    activePlates.SetWaitOverdoor(on);
                }
                //else                    SetSelfWaitOverdoor(on);
            }
        }
예제 #3
0
        private void CreateNewTab()
        {
            var tabs = Template.FindName(TabsTemplatePartName, this) as TabControl;

            if (tabs != null)
            {
                PlatesCC plates = new PlatesCC();
                plates.RemovePlate += PlatesCC_RemovePlate;
                var list  = new List <object>();
                var items = new ObservableCollection <object>(list);
                plates.ItemsSource = items;
                tabs.Items.Add(plates);
                tabs.SelectedItem = plates;
                this.platesItems.Add(plates, items);
            }
        }
예제 #4
0
 private void CreateNewTab()
 {
     var tabs = Template.FindName(TabsTemplatePartName, this) as TabControl;
     if (tabs != null)
     {
         PlatesCC plates = new PlatesCC();
         plates.RemovePlate += PlatesCC_RemovePlate;
         var list = new List<object>();
         var items = new ObservableCollection<object>(list);
         plates.ItemsSource = items;
         tabs.Items.Add(plates);
         tabs.SelectedItem = plates;
         this.platesItems.Add(plates, items);
     }
 }