/// <summary>
        /// constructor for event
        /// </summary>
        /// <param name                 = "exEvent"></param>
        /// <param name                 = "handler"></param>
        public MagicRenumberViewModel(ExternalEvent exEvent, MagicRenumberHandler handler, MagicRenumberLogic logic)
        {
            //hooking up commands
            uiLoadSystemElementsCommand = new ReleyCommand(loadSystemElements, loadSystemCanUse);
            uiLoadSingleElementCommand  = new ReleyCommand(loadOrigin, loadOriginCanUse);
            uiRunCommand = new ReleyCommand(runRenumbering, renumberingCanUe);

            //konsturktor za handler
            this.handler = handler;
            this.exEvent = exEvent;
            this.logic   = logic;
        }
Ejemplo n.º 2
0
        public void ShowWindowMagicrenumber(UIApplication uiapp)
        {
            //if we do not have a dialoge yet, create it
            if (windowMagicRenumber == null)
            {
                //A new handeler to handle request posting by the dialog
                MagicRenumberHandler handler = new MagicRenumberHandler();

                //External event for the dialog to use (to post requests)
                ExternalEvent exEvent = ExternalEvent.Create(handler);

                //create LogicClass for
                MagicRenumberLogic logic = new MagicRenumberLogic();

                // We give the objects to the new dialog;
                // The dialog becomes the owner responsible fore disposing them, eventual
                mrVmod = new MagicRenumberViewModel(exEvent, handler, logic);
                windowMagicRenumber             = new MagicRenumber();
                windowMagicRenumber.DataContext = mrVmod;

                windowMagicRenumber.Show();
            }
        }