Ejemplo n.º 1
0
        public virtual void UiBtnCommandAddAction(Object param)
        {
            if (this.ModifyFeatureVM == null)
            {
                this.ModifyFeatureVM = new ModifyFeatureViewModel();
            }
            this.ModifyFeatureVM.DbContext        = this.DbContext;
            this.ModifyFeatureVM.AllowedFileTypes = this.AllowedFileTypes;
            this.ModifyFeatureVM.Feature          = new FeatureSerializable()
            {
                FeatureName = "NoNameFeature"
            };
            WindowModifyFeature dlg          = new WindowModifyFeature(this.ModifyFeatureVM);
            Nullable <bool>     dialogResult = dlg.ShowDialog();

            if (dialogResult.HasValue)
            {
                if (dialogResult.Value)
                {
                    if (FeatureContext == null)
                    {
                        FeatureContext = new FeatureContextSerializable();
                    }
                    if (FeatureContext.Features == null)
                    {
                        FeatureContext.Features = new List <FeatureSerializable>();
                    }
                    FeatureContext.Features.Add(this.ModifyFeatureVM.Feature);
                    Features.Add(this.ModifyFeatureVM.Feature);
                    SelectedFeature = this.ModifyFeatureVM.Feature;
                }
            }
        }
Ejemplo n.º 2
0
        public virtual void UiBtnCommandUpdateAction(Object param)
        {
            if (this.ModifyFeatureVM == null)
            {
                this.ModifyFeatureVM = new ModifyFeatureViewModel();
            }
            this.ModifyFeatureVM.DbContext        = this.DbContext;
            this.ModifyFeatureVM.AllowedFileTypes = this.AllowedFileTypes;
            this.ModifyFeatureVM.Feature          = SelectedFeature;
            WindowModifyFeature dlg          = new WindowModifyFeature(this.ModifyFeatureVM);
            Nullable <bool>     dialogResult = dlg.ShowDialog();

            if (dialogResult.HasValue)
            {
                if (dialogResult.Value)
                {
                    _SelectedFeature = null;
                    SelectedFeature  = this.ModifyFeatureVM.Feature;
                }
            }
        }