public DetailsPage(Mode mode)
        {
            InitializeComponent();
            // setAreaCodeToComboBox();
            this.mode = mode;

            if (mode.Equals(Mode.EDIT))
            {
                if (Session.SelectedCustomer != null)
                {
                    _customer = Session.SelectedCustomer;
                    GridCustomerInfo.DataContext = _customer;
                }
            }
            if (mode.Equals(Mode.VIEW))
            {
                List <Control> ControlList = HandleControllers.GetLogicalChildCollection <Control>(this);
                HandleControllers.enableContent(ControlList, false, false, false, false, false);

                CustomerPage.ViewMode = Mode.VIEW;

                if (Session.SelectedCustomer != null)
                {
                    _customer = Session.SelectedCustomer;
                    GridCustomerInfo.DataContext = _customer;
                }
            }
            if (mode.Equals(Mode.NEW))
            {
                this.mode = mode;
                _customer = new customer();
                GridCustomerInfo.DataContext = _customer;
            }
            this.DataContext = this;
            _instance        = this;
        }
        public DetailsPage(Mode mode)
        {
            InitializeComponent();
            // setAreaCodeToComboBox();
            this.mode = mode;

            if (mode.Equals(Mode.EDIT))
            {
                if (Session.SelectedCustomer != null)
                {
                    _customer = Session.SelectedCustomer;
                    GridCustomerInfo.DataContext = _customer;
                }
            }
            if (mode.Equals(Mode.VIEW))
            {
                List<Control> ControlList = HandleControllers.GetLogicalChildCollection<Control>(this);
                HandleControllers.enableContent(ControlList, false, false, false, false, false);

                CustomerPage.ViewMode = Mode.VIEW;

                if (Session.SelectedCustomer != null)
                {
                    _customer = Session.SelectedCustomer;
                    GridCustomerInfo.DataContext = _customer;
                }
            }
            if (mode.Equals(Mode.NEW))
            {
                this.mode = mode;
                _customer = new customer();
                GridCustomerInfo.DataContext = _customer;
            }
            this.DataContext = this;
            _instance = this;
        }