Example #1
0
        public static DialogCreator AddPassword(this DialogCreator c, string label)
        {
            if (c == null)
            {
                throw new ArgumentNullException("c");
            }

            return(AddString(c, label, Zetbox.NamedObjects.Gui.ControlKinds.Zetbox_App_GUI_PasswordKind.Find(c.FrozenCtx)));
        }
Example #2
0
        public DialogCreator(DialogCreator parent)
        {
            if (parent == null) throw new ArgumentNullException("parent");

            Parent = parent;

            Items = new List<ViewModel>();
            AdditionalButtons = new List<Tuple<string, string, Action<Dictionary<object, object>>>>();
            DataContext = parent.DataContext;
            ViewModelFactory = parent.ViewModelFactory;
            FrozenCtx = parent.FrozenCtx;
        }
Example #3
0
        public static DialogCreator AddString(this DialogCreator c, string label)
        {
            if (c == null)
            {
                throw new ArgumentNullException("c");
            }

            var mdl = new ClassValueModel <string>(label, "", false, false);

            c.ValueModels.Add(c.ViewModelFactory.CreateViewModel <ClassValueViewModel <string> .Factory>().Invoke(c.DataContext, null, mdl));
            return(c);
        }
Example #4
0
 public WpfModelFactory(ILifetimeScopeFactory scopeFactory, Autofac.ILifetimeScope scope, IFrozenContext frozenCtx, ZetboxConfig cfg, IPerfCounter perfCounter, DialogCreator.Factory dialogFactory)
     : base(scopeFactory, scope, frozenCtx, cfg, perfCounter, dialogFactory)
 {
 }
Example #5
0
 public static DialogCreator AddTabItem(this DialogCreator c, object key, string header, Action<DialogCreator> children, string helpText = null)
 {
     if (c == null) throw new ArgumentNullException("c");
     if (children == null) throw new ArgumentNullException("children");
     var sub = new DialogCreator(c);
     children(sub);
     var vmdl = c.ViewModelFactory.CreateViewModel<TabItemViewModel.Factory>().Invoke(c.DataContext, null, header, sub.Items);
     vmdl.HelpText = helpText;
     c.Add(key, vmdl);
     return c;
 }