Example #1
0
        /// <summary>
        /// 新增实体的方法(UI后期实现)
        /// </summary>
        private static EntityConfig AddFieldsCommand()
        {
            var window = new NewEntityWindow();
            var vm     = (NewEntityViewModel)window.DataContext;

            if (window.ShowDialog() != true)
            {
                return(null);
            }
            GlobalTrigger.OnCreate(vm.Model.Entity);
            return(vm.Model.Entity);
        }
Example #2
0
        /// <summary>
        /// 生成新配置
        /// </summary>
        /// <returns></returns>
        public static bool NewConfigCommand(ConfigBase config)
        {
            var window = new NewConfigWindow();
            var vm     = (NewConfigViewModel)window.DataContext;

            vm.Config = config;
            if (window.ShowDialog() != true)
            {
                return(false);
            }
            GlobalTrigger.OnCreate(vm.Config);
            return(true);
        }
Example #3
0
        /// <summary>
        /// 枚举编辑的方法(UI后期实现)
        /// </summary>
        /// <param name="property"></param>
        /// <returns></returns>
        private static EnumConfig EditEnumCommand(PropertyConfig property)
        {
            var window = new EnumEdit();
            var vm     = (EnumEditViewModel)window.DataContext;

            vm.Model.Config = property.EnumConfig ?? new EnumConfig
            {
                LinkField   = property.Key,
                Name        = property.Name + "Type",
                Caption     = property.Caption + "枚举类型",
                Description = property.Description
            };
            if (window.ShowDialog() != true)
            {
                return(null);
            }
            GlobalTrigger.OnCreate(vm.Model.Config);
            return(vm.Model.Config);
        }