Example #1
0
        private void RemoveTabs()
        {
            frameControllers       = tabController.GetFrameControllers();
            currentFrameController = tabController.GetCurrentFrameController();
            tabController          = null;

            ((GnosisTile)ControlImplementation).LoadFrameImplementation((IGnosisFrameImplementation)currentFrameController.ControlImplementation);
        }
Example #2
0
        public void NavigateForward()
        {
            int currentIndex = frameControllers.FindIndex(x => x == currentFrameController);

            if (frameControllers.Count > currentIndex + 1 && frameControllers[currentIndex + 1] != null)
            {
                currentFrameController = frameControllers[currentIndex + 1];
                ((IGnosisTileTabItemImplementation)ControlImplementation).LoadFrame((IGnosisFrameImplementation)currentFrameController.ControlImplementation, currentFrameController.TabHeaderButton);
            }
        }
Example #3
0
        public void AddFrameController(GnosisFrameController frameController)
        {
            if (((IGnosisTileTabImplementation)ControlImplementation).CurrentTileTabItem == null)
            {
                if (tabItemControllers.Count == 0)
                {
                    Setup();
                }
                else
                {
                    GlobalData.Singleton.ErrorHandler.HandleError("No tab item selected", "GnosisTileTabController.AddFrameController");
                }
            }

            //Find the selected tab item and pass it the frame
            GnosisTileTabItemController controller = tabItemControllers.Find(i => i.ControlImplementation == ((IGnosisTileTabImplementation)ControlImplementation).CurrentTileTabItem);

            controller.LoadFrame(frameController);
            controller.IsDummyTabItem = false;

            //string caption = frameController.Caption;
            //if (frameController.InstanceController != null)
            //{
            //    if (frameController.InstanceController.Instance.InstanceName != null && frameController.InstanceController.Instance.InstanceName.Length > 0)
            //    {
            //        caption += " - " + frameController.InstanceController.Instance.InstanceName;
            //    }
            //}
            //((IGnosisTileTabItemImplementation)ControlImplementation).SetCaption(caption);
            //((IGnosisTileTabImplementation)ControlImplementation).CurrentTileTabItem.LoadFrame((IGnosisFrameImplementation)frameController.ControlImplementation, caption);

            //check if there is a '+' tab item
            GnosisTileTabItemController dummy = tabItemControllers.Find(i => i.IsDummyTabItem);

            if (dummy == null)
            {
                //create dummy tabitem
                GnosisTileTabItem tabItem = GnosisControlCreator.CreateGnosisTabItem(1);
                // IGnosisTileTabItemImplementation tabItemImp = GlobalData.Singleton.ImplementationCreator.GetGnosisTabItemImplementation();
                GnosisTileTabItemController itemController = new GnosisTileTabItemController(tabItem, EntityController, this);
                itemController.IsDummyTabItem = true;
                itemController.ControlImplementation.Order = tabItemControllers.Count + 1;
                tabItemControllers.Add(itemController);

                GnosisToggleButton headerButton = GnosisControlCreator.CreateGnosisToggleButton(1, "+");
                GlobalData.Singleton.StyleHelper.ApplyStyle(headerButton, frameController.EntityController.GetNormalStyle());
                // headerButton.SetCaption("+");
                headerButton.Order = itemController.ControlImplementation.Order;
                tabItem.SetHeaderButton(headerButton);

                ((IGnosisTileTabImplementation)ControlImplementation).LoadTabItem(tabItem);

                //headerButtons.Add(headerButton);
            }
        }
Example #4
0
        internal override void RemoveFrame(GnosisFrameController frameController)
        {
            if (currentFrameController == frameController)
            {
                currentFrameController = null;
            }

            frameControllers.Remove(frameController);

            ((IGnosisTileTabItemImplementation)ControlImplementation).RemoveFrame((IGnosisFrameImplementation)frameController.ControlImplementation);
        }
Example #5
0
        //public double GetWidth()
        //{
        //    return ((IGnosisTileImplemenation)ControlImplementation).GetWidth();
        //}
        //public void AddFrame(GnosisFrameController frameController)
        //{
        //    frameControllers.Add(frameController);

        //    if (loaded)
        //    {
        //        LoadFrame();
        //    }
        //}


        public void LoadFrame(GnosisFrameController frame)
        {
            if (tabController != null)
            {
                tabController.AddFrameController(frame);
            }
            else
            {
                frameControllers.Add(frame);
                currentFrameController = frame;

                ((GnosisTile)ControlImplementation).Clear();
                ((GnosisTile)ControlImplementation).LoadFrameImplementation((IGnosisFrameImplementation)frame.ControlImplementation);
            }
        }
Example #6
0
        public void TileLoaded(double width)
        {
            // loaded = true;

            if (((GnosisTile)ControlImplementation).HasTabs)
            {
                CreateTabs();
            }
            else if (frameControllers.Count > 0)
            {
                if (currentFrameController == null)
                {
                    currentFrameController = frameControllers[frameControllers.Count - 1];
                }
                ((GnosisTile)ControlImplementation).LoadFrameImplementation((IGnosisFrameImplementation)currentFrameController.ControlImplementation);
            }
        }
Example #7
0
        public void NavigateForward()
        {
            if (((GnosisTile)ControlImplementation).HasTabs)
            {
                tabController.NavigateForward();
            }
            else
            {
                int currentIndex = frameControllers.FindIndex(x => x == currentFrameController);

                if (frameControllers.Count > currentIndex + 1 && frameControllers[currentIndex + 1] != null)
                {
                    currentFrameController = frameControllers[currentIndex + 1];
                    ((IGnosisTileImplemenation)ControlImplementation).LoadFrameImplementation((IGnosisFrameImplementation)currentFrameController.ControlImplementation);
                }
                else
                {
                    GlobalData.Singleton.ErrorHandler.HandleError("No frame to navigate to", "GnosisTileController.NavigateForward");
                }
            }
        }
Example #8
0
        //private void LoadFrame()
        //{
        //    if (frameControllers.Count > 0)
        //    {
        //        GnosisFrameController lastFrame = frameControllers[frameControllers.Count - 1];
        //        ((IGnosisTileImplemenation)ControlImplementation).LoadFrameImplementation((IGnosisFrameImplementation)lastFrame.ControlImplementation);
        //    }
        //}

        private void CreateTabs()
        {
            //create a tab controller
            // IGnosisTileTabImplementation tabImp = GlobalData.Singleton.ImplementationCreator.GetGnosisTabImplementation();

            GnosisTileTab tab = GnosisControlCreator.CreateGnosisTab();

            tabController = new GnosisTileTabController(tab, EntityController, this);
            tabController.Setup();

            //pass the frames to the tab controller
            foreach (GnosisFrameController frameController in frameControllers)
            {
                tabController.AddFrameController(frameController);
            }

            //update the UI
            ((GnosisTile)ControlImplementation).LoadTabImplementation((IGnosisTileTabImplementation)tabController.ControlImplementation);

            frameControllers       = new List <GnosisFrameController>();
            currentFrameController = null;
        }
Example #9
0
        private void lstFrames_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ListBoxItem item = (ListBoxItem)lstFrames.SelectedItem;

            currentFrameController = (GnosisFrameController)item.Tag;
            currentFrameController.SetEditMode();

            //register for property changes, include child panels. Content of panels can change so
            //we must register for their child property changes on the panel loaded event
            currentFrameController.PropertyChanged += Controller_PropertyChanged;
            foreach (GnosisInnerLayoutController child in currentFrameController.ChildControllers)
            {
                child.PropertyChanged += Controller_PropertyChanged;
            }

            //List<GnosisFramePresentation> presentations = currentFrameController.FramePresentations;
            //pnlButtonFormats.Children.Clear();
            //lstLabels = new List<Label>();
            //foreach (GnosisFramePresentation framePresentation in presentations)
            //{
            //    Label lblPresentation = new Label();
            //    lblPresentation.Tag = framePresentation;
            //   // btnPresentation.Click += BtnPresentation_Click;
            //    lblPresentation.Content = framePresentation.Format.ToString();
            //    if (framePresentation.Format == currentFrameController.CurrentPresentation.Format)
            //    {
            //        //highlight current format
            //        lblPresentation.Background = Brushes.Lime;

            //        //update fields
            //        UpdateFramePresentationFields(framePresentation);
            //    }
            //    lstLabels.Add(lblPresentation);
            //    pnlButtonFormats.Children.Add(lblPresentation);
            //}

            mainTile.Clear();
            mainTile.LoadFrameImplementation((IGnosisFrameImplementation)currentFrameController.ControlImplementation);
        }
Example #10
0
        public void LoadFrame(GnosisFrameController frameController)
        {
            showLoadingAnimation = false;

            frameControllers.Add(frameController);
            currentFrameController = frameController;

            ((GnosisTileTabItem)ControlImplementation).Clear();

            //((IGnosisTileTabItemImplementation)ControlImplementation).SetHeader(headerButton);

            string caption = ((IGnosisFrameImplementation)frameController.ControlImplementation).Caption;

            if (frameController.InstanceController != null)
            {
                if (frameController.InstanceController.Instance.InstanceName != null && frameController.InstanceController.Instance.InstanceName.Length > 0)
                {
                    caption += " - " + frameController.InstanceController.Instance.InstanceName;
                }
            }
            ((IGnosisFrameImplementation)frameController.ControlImplementation).Caption = caption;

            //Create a toggle button for the tab item header. Apply the style of the frame to it
            //Use the tile tab item as the binding source for the toggle button so that it changes with mouse over of tab item etc
            GnosisToggleButton headerButton = GnosisControlCreator.CreateGnosisToggleButton(
                this.ControlImplementation.Order,
                caption);

            GlobalData.Singleton.StyleHelper.ApplyStyle(headerButton, frameController.EntityController.GetNormalStyle());
            frameController.TabHeaderButton = headerButton;



            if (loaded)
            {
                ((IGnosisTileTabItemImplementation)ControlImplementation)
                .LoadFrame((IGnosisFrameImplementation)currentFrameController.ControlImplementation, headerButton);
            }
        }
Example #11
0
        //public void RemoveFrame(GnosisFrameController frameController)
        //{
        //    ((IGnosisTileImplemenation)ControlImplementation).RemoveFrameImplementation((IGnosisFrameImplementation)frameController.ControlImplementation);
        //    frameControllers.Remove(frameController);

        //}

        internal override void RemoveFrame(GnosisFrameController frameController)
        {
            ((IGnosisTileImplemenation)ControlImplementation).RemoveFrameImplementation((IGnosisFrameImplementation)frameController.ControlImplementation);
            frameControllers.Remove(frameController);
        }
 internal virtual void RemoveFrame(GnosisFrameController frameController)
 {
     throw new NotImplementedException();
 }
Example #13
0
 internal void Clear()
 {
     ((IGnosisTileTabItemImplementation)ControlImplementation).Clear();
     frameControllers       = new List <GnosisFrameController>();
     currentFrameController = null;
 }