Ejemplo n.º 1
0
        private KeyedDescription GetDialogAutoView()
        {
            var auto = new RootAuto(caption: "Some Dialog Info")
            {
                new SectionAuto(header: "Strings")
                {
                    new EntryAuto(caption: "Name", bindingExpression: () => Name),
                    new EntryAuto(caption: "Password", bindingExpression: () => Password)
                    {
                        Password = true
                    },
                },
                new SectionAuto(header: "Booleans")
                {
                    new BooleanAuto(caption: "Is available", bindingExpression: () => IsAvailable),
                    new CheckboxAuto(caption: "Is active", bindingExpression: () => IsActive),
                },
                new SectionAuto(header: "DateTimes")
                {
                    new DateAuto(caption: "Date of Birth", bindingExpression: () => DateOfBirth),
                    new TimeAuto(caption: "When", bindingExpression: () => PreferredContactTime),
                },
                new SectionAuto(header: "Debug Info")
                {
                    new StringAuto(caption: "Name", bindingExpression: () => Name),
                    new StringAuto(caption: "Password", bindingExpression: () => Password),
                    new StringAuto(caption: "Is available", bindingExpression: () => IsAvailable),
                    new StringAuto(caption: "Is active", bindingExpression: () => IsActive),
                    new StringAuto(caption: "Date of Birth", bindingExpression: () => DateOfBirth),
                    new StringAuto(caption: "When", bindingExpression: () => PreferredContactTime),
                },
            };

            return(auto.ToElementDescription());
        }
        private KeyedDescription GetDialogAutoView()
        {
            var auto = new RootAuto(caption: "TestRootElement")
            {
                new SectionAuto(header: "Customer Info")
                {
                    new StringAuto(caption: "ID", bindingExpression: () => Customer.ID),
                    new StringAuto(caption: "Name", bindingExpression: () => Customer.Name),
                    new StringAuto(caption: "Website",
                                   bindingExpression: () => Customer.Website,
                                   selectedCommand: () => ShowWebsiteCommand),
                    new StringAuto(caption: "Phone",
                                   bindingExpression: () => Customer.PrimaryPhone,
                                   selectedCommand: () => CallCustomerCommand),
                },
                new SectionAuto(header: "General Info")
                {
                    new StringAuto(caption: "Address",
                                   bindingExpression: () => Customer.PrimaryAddress,
                                   selectedCommand: () => ShowOnMapCommand),
                }
            };

            return(auto.ToElementDescription());
        }
        private KeyedDescription GetDialogAutoView()
        {
            var auto = new RootAuto(caption: "Children")
            {
                new SectionAuto(header: "Options")
                    {
                        new StringAuto(caption: "Dialog", selectedCommand: () => ShowDialogCommand ) ,
                        new StringAuto(caption: "List", selectedCommand: () => ShowListCommand ) ,
                    },
            };

            return auto.ToElementDescription();
        }
Ejemplo n.º 4
0
        private KeyedDescription GetDialogAutoView()
        {
            var auto = new RootAuto(caption: "Children")
            {
                new SectionAuto(header: "Options")
                {
                    new StringAuto(caption: "Dialog", selectedCommand: () => ShowDialogCommand),
                    new StringAuto(caption: "List", selectedCommand: () => ShowListCommand),
                },
            };

            return(auto.ToElementDescription());
        }
Ejemplo n.º 5
0
        private KeyedDescription GetDialogAutoView()
        {
            var auto = new RootAuto(caption: "The Person")
            {
                new SectionAuto(header: "Name")
                {
                    new EntryAuto(caption: "Name", bindingExpression: () => Person.Name),
                    new EntryAuto(caption: "Job", bindingExpression: () => Person.Job),
                },
            };

            return(auto.ToElementDescription());
        }
        public static ElementDescription CreateMissingDialogDescription(this IMvxViewModel viewModel)
        {
            var viewModelType   = viewModel.GetType();
            var propertySection = new SectionAuto(header: "Properties");
            var commandSection  = new SectionAuto(header: "Commands");
            var auto            = new RootAuto(caption: viewModelType.Name)
            {
                propertySection,
                commandSection
            };

            foreach (var property in viewModelType.GetRuntimeProperties())
            {
                if (typeof(ICommand).IsAssignableFrom(property.PropertyType))
                {
                    commandSection.Add(new StringAuto(caption: property.Name)
                    {
                        SelectedCommandNameOverride = property.Name
                    });
                }
                else if (typeof(ICollection).IsAssignableFrom(property.PropertyType))
                {
                    propertySection.Add(new StringAuto(caption: property.Name)
                    {
                        BindingExpressionTextOverride = property.Name + ".Count"
                    });
                }
                else
                {
                    propertySection.Add(new StringAuto(caption: property.Name)
                    {
                        BindingExpressionTextOverride = property.Name
                    });
                }
            }

            var description = auto.ToElementDescription();

            return(description);
        }
        public static ElementDescription CreateMissingDialogDescription(this IMvxViewModel viewModel)
        {
            var viewModelType = viewModel.GetType();
            var propertySection = new SectionAuto(header: "Properties");
            var commandSection = new SectionAuto(header: "Commands");
            var auto = new RootAuto(caption: viewModelType.Name)
                {
                    propertySection,
                    commandSection
                };

            foreach (var property in viewModelType.GetRuntimeProperties())
            {
                if (typeof(ICommand).IsAssignableFrom(property.PropertyType))
                {
                    commandSection.Add(new StringAuto(caption: property.Name)
                    {
                        SelectedCommandNameOverride = property.Name
                    });
                }
                else if (typeof(ICollection).IsAssignableFrom(property.PropertyType))
                {
                    propertySection.Add(new StringAuto(caption: property.Name)
                    {
                        BindingExpressionTextOverride = property.Name + ".Count"
                    });
                }
                else
                {
                    propertySection.Add(new StringAuto(caption: property.Name)
                    {
                        BindingExpressionTextOverride = property.Name
                    });
                }
            }

            var description = auto.ToElementDescription();
            return description;
        }
        private KeyedDescription GetDialogAutoView()
        {
            var auto = new RootAuto(caption: "The Person")
            {
                new SectionAuto(header: "Name")
                    {
                        new EntryAuto(caption: "Name", bindingExpression: () => Person.Name),
                        new EntryAuto(caption: "Job", bindingExpression: () => Person.Job),
                    },
            };

            return auto.ToElementDescription();
        }
        private KeyedDescription GetDialogAutoView()
        {
            var auto = new RootAuto(caption: "Some Dialog Info")
            {
                new SectionAuto(header: "Strings")
                    {
                        new EntryAuto(caption: "Name", bindingExpression: () => Name),
                        new EntryAuto(caption: "Password", bindingExpression: () => Password) { Password = true },
                    },
                new SectionAuto(header: "Booleans")
                    {
                        new BooleanAuto(caption: "Is available", bindingExpression: () => IsAvailable),
                        new CheckboxAuto(caption: "Is active", bindingExpression: () => IsActive),
                    },
                new SectionAuto(header: "DateTimes")
                    {
                        new DateAuto(caption: "Date of Birth", bindingExpression: () => DateOfBirth),
                        new TimeAuto(caption: "When", bindingExpression: () => PreferredContactTime),
                    },
                new SectionAuto(header: "Debug Info")
                    {
                        new StringAuto(caption: "Name", bindingExpression: () => Name),
                        new StringAuto(caption: "Password", bindingExpression: () => Password),
                        new StringAuto(caption: "Is available", bindingExpression: () => IsAvailable),
                        new StringAuto(caption: "Is active", bindingExpression: () => IsActive),
                        new StringAuto(caption: "Date of Birth", bindingExpression: () => DateOfBirth),
                        new StringAuto(caption: "When", bindingExpression: () => PreferredContactTime),
                    },
            };

            return auto.ToElementDescription();
        }
Ejemplo n.º 10
0
        private KeyedDescription GetDialogAutoView()
        {
            var auto = new RootAuto(caption: "TestRootElement")
            {
                new SectionAuto(header: "Customer Info")
                    {
                        new StringAuto(caption: "ID", bindingExpression: () => Customer.ID),
                        new StringAuto(caption: "Name", bindingExpression: () => Customer.Name),
                        new StringAuto(caption: "Website", 
                                       bindingExpression: () => Customer.Website,
                                       selectedCommand: () => ShowWebsiteCommand),
                        new StringAuto(caption: "Phone", 
                                       bindingExpression: () => Customer.PrimaryPhone,
                                       selectedCommand: () => CallCustomerCommand),
                    },
                new SectionAuto(header: "General Info")
                    {
                        new StringAuto(caption: "Address", 
                                       bindingExpression: () => Customer.PrimaryAddress,
                                       selectedCommand: () => ShowOnMapCommand),
                    }
            };

            return auto.ToElementDescription();
        }