Beispiel #1
0
        public Realty_DG_ViewModel(DataGrid dg, string tN, Window PrimaryWindow, LoadingIcon LI, misc.ApplicationType anApplicationType) : base(dg, tN, PrimaryWindow, LI)
        {
            DataTemplate tempDT = new DataTemplate();

            this.theApplicationType = anApplicationType;
            dg.RowDetailsTemplate   = new DataTemplate();
        }
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            this.Loaded -= Page_Loaded;

            DependencyObject x = VisualTreeHelper.GetParent(this);

            do
            {
                x = VisualTreeHelper.GetParent(x);
            }while (x.GetType() != typeof(ClientPresentation));

            switch (this.rdtt)
            {
            case misc.TableGroup.None:
                dgvm = new DG_ViewModel(this.DG, tableName, x as ClientPresentation, loadingIcon);
                break;

            case misc.TableGroup.Realty_Offer:
                this.theApplicationType = misc.ApplicationType.Предложение;
                dgvm = new Realty_DG_ViewModel(this.DG, tableName, x as ClientPresentation, loadingIcon, misc.ApplicationType.Предложение);
                break;

            case misc.TableGroup.Realty_Demand:
                this.theApplicationType = misc.ApplicationType.Спрос;
                dgvm = new Realty_DG_ViewModel(this.DG, tableName, x as ClientPresentation, loadingIcon, misc.ApplicationType.Спрос);
                break;

            case misc.TableGroup.Employee:
                dgvm = new DG_ViewModel(this.DG, tableName, x as ClientPresentation, loadingIcon);
                break;

            case misc.TableGroup.Client:
                break;

            case misc.TableGroup.Service:
                break;

            default: dgvm = new DG_ViewModel(this.DG, tableName, x as ClientPresentation, loadingIcon); break;
            }
            this.DataContext = dgvm;
        }