Exemplo n.º 1
0
        void pv_SetPlanEvent(object sender, SetPlanArgs e)
        {
            da.InsertPlan(e.PVM.Plan);

            PlanView pv = sender as PlanView;

            pv.SetPlan();
            pv.ModifyPlanEvent += pv_ModifyPlanEvent;

            if (e.PVM.Plan.UnitType == Model.Type.FRAME)
            {
                FramePlans = da.GetPlans(Model.Type.FRAME);
                FramePlanAddButton.IsEnabled = true;
            }
            else
            {
                BodyPlans = da.GetPlans(Model.Type.BODY);
                BodyPlanAddButton.IsEnabled = true;
            }

            MessageBox.Show(" Plan Set ", "Application Info", MessageBoxButton.OK, MessageBoxImage.Information);

            updateAvailableModels();
            return;
        }
Exemplo n.º 2
0
        void addPlanViews(PlanViewModel pvm)
        {
            if (pvm.Plan.UnitType == Model.Type.FRAME)
            {
                FramePlanPanel.RowDefinitions.Add(new RowDefinition());
                PlanView pv = new PlanView(pvm, Model.Type.FRAME);
                pv.SetValue(Grid.RowProperty, FramePlanPanel.RowDefinitions.Count - 1);
                pv.SetPlanEvent    += pv_SetPlanEvent;
                pv.ModifyPlanEvent += pv_ModifyPlanEvent;
                FramePlanPanel.Children.Add(pv);
            }

            if (pvm.Plan.UnitType == Model.Type.BODY)
            {
                BodyPlanPanel.RowDefinitions.Add(new RowDefinition());
                PlanView pv = new PlanView(pvm, Model.Type.BODY);
                pv.SetValue(Grid.RowProperty, BodyPlanPanel.RowDefinitions.Count - 1);
                pv.SetPlanEvent    += pv_SetPlanEvent;
                pv.ModifyPlanEvent += pv_ModifyPlanEvent;
                BodyPlanPanel.Children.Add(pv);
            }
        }