Exemplo n.º 1
0
        public void RemoveItemFromTabCollection(object param)
        {
            TabDataModel obj = param as TabDataModel;

            TabItemSource.Remove(obj);
            tabCounter--;
        }
Exemplo n.º 2
0
        private void OnRenderForm(object param)
        {
            if (param != null)
            {
                string[] formname = ((string[])param);

                contentcontrol = null;
                if (formname[0] == "Invoice")
                {
                    contentcontrol = new InvoiceDetails();
                }
                else if (formname[0] == "Bill")
                {
                    contentcontrol = new Billing();
                }
                else if (formname[0] == "Inventory Report")
                {
                    contentcontrol = new InventoryReport();
                }

                //if (formname[0] == "Student")
                //{
                //    if (formname.Length == 2)
                //    {
                //        contentcontrol = new StudentDetails(Convert.ToInt32(formname[1]));
                //    }
                //    else
                //    {

                //        contentcontrol = new StudentDetails();
                //        //contentcontrol = new UserControl1();
                //    }

                //}
                //else if (formname[0] == "Staff")
                //{
                //    contentcontrol = new StaffSearch();
                //    ((StaffSearch)contentcontrol).onCallback += OnRenderForm;

                //}
                //else if (formname[0] == "StaffAdd")
                //{
                //    if (formname.Length == 2)
                //    {
                //        contentcontrol = new StaffDetails(Convert.ToInt32(formname[1]));
                //    }
                //    else
                //    {
                //        contentcontrol = new StaffDetails();
                //    }
                //}
                //else if (formname[0] == "Report")
                //{

                //}
                //else if (formname[0] == "StudentClassMapping")
                //{
                //    contentcontrol = new StudentClassMapping();
                //}
                //else if (formname[0] == "StaffClassMapping")
                //{
                //    contentcontrol = new StaffClassMapping();
                //}
                //else if (formname[0] == "StaffSubjectMapping")
                //{
                //    contentcontrol = new StaffSubjectMapping();
                //}
                //else if (formname[0] == "Payments")
                //{
                //    contentcontrol = new StudentPayments();
                //}
                //else if (formname[0] == "Payment Report")
                //{
                //    ReportHostingFormUC obj = new ReportHostingFormUC("ARAP");
                //    contentcontrol = obj;
                //}
                //else if (formname[0] == "Expense")
                //{
                //    ExpenseEntry obj = new ExpenseEntry();
                //    contentcontrol = obj;
                //}
                //else if (formname[0] == "Expense Report")
                //{
                //    ExpenseReportHostingForm obj = new ExpenseReportHostingForm("ExpenseReport");
                //    contentcontrol = obj;
                //}
                //  else if (formname[0] == "Charts")
                //{
                //    ChartReports obj = new ChartReports();
                //    contentcontrol = obj;
                //}

                TabDataModel objTab = new TabDataModel(contentcontrol);
                objTab.Title     = formname[0];
                objTab.cmdClose  = new DelegateCommand(RemoveItemFromTabCollection);
                objTab.Parameter = objTab;
                this.tabindex    = tabCounter;
                tabCounter++;
                TabItemSource.Add(objTab);
            }
        }