Esempio n. 1
0
        protected void GotoElementSamples(Element element)
        {
            var tb = new TableViewController(UITableViewStyle.Grouped);

            tb.Title = "Element Samples";

            var section = new TableViewSection(tb.Source);

            section.Header = "Sample Elements";

            section.Add(new ButtonElement("Button"));
            section.Add(new StringElement("String")
            {
                Command = this.UpdateText
            });
            section.Add(new SubtitleStringElement("Subtitle String", "Subtitle"));
            section.Add(new Value1StringElement("Value1 String", "Detail"));
            section.Add(new Value2StringElement("Value2 String", "Detail"));
            section.Add(new BooleanElement("Boolean", true));
            section.Add(new CheckboxElement("Checkbox", true));
            section.Add(new TextInputElement("Text Input", "")
            {
                Placeholder = "Placeholder text"
            });
            section.Add(new PasswordInputElement("Password"));
            section.Add(new DateInputElement("Date", DateTime.Today));

            // Use a DataViewWrapper to wrap an element with a different view definition from the one it would normally get
            var wrapper = new ElementDataViewWrapper(DefaultElementViewDefintions.DisclosureElementViewDefintion, new StringElement("Wrapped String"));

            section.Add(wrapper);


            this.rootController.PushViewController(tb, true);
        }
Esempio n. 2
0
        public void SetupMainIndexSection(TableViewSource source)
        {
            var section1 = new TableViewSection(source);

            section1.Header = "MonoKit Sample Index";

            section1.Add(new DisclosureElement("Element Samples") { Command = this.GotoElementSamples });
            section1.Add(new DisclosureElement("Binding Samples") { Command = this.GotoBindingSamples });
            section1.Add(new DisclosureElement("Large Data Sample") { Command = this.GotoLargeDataSample });
            section1.Add(new DisclosureElement("Bind to Single Object") { Command = this.GotoBindToSingleObject });

            var section2 = new TableViewSection(source);

            section2.Header = "Test Samples";

            section2.Add(new DisclosureElement("Tasks Test") { Command = this.DoTaskTest });
            section2.Add(new DisclosureElement("Snapshot Domain Test") { Command = this.DoDomainTest2 });
            section2.Add(new DisclosureElement("Event Sourced Domain Test") { Command = this.DoDomainTest1 });
            section2.Add(new DisclosureElement("SQLite Admin Test") { Command = this.DoSqliteTest });
            section2.Add(new DisclosureElement("Custom Control") { Command = this.GotoCustomControl });
            section2.Add(new DisclosureElement("GC Tests") { Command = this.GotoGCTests });

            var section3 = new TableViewSection(source);

            section3.Header = "Utils";

            section3.Add(new StringElement("GC.Collect") { Command = this.DoGCCollect });
        }
Esempio n. 3
0
        protected void DoDomainTest2(Element element)
        {
            var tb = new TableViewController(UITableViewStyle.Grouped);

            tb.Title = "Snapshot Sourced";

            var section1 = new TableViewSection(tb.Source);

            section1.Header = "commands";
            section1.Add(new StringElement("Test Command 1")
            {
                Command = (x) => SnapshotSamples.DoTest1()
            });
            section1.Add(new StringElement("Test Command 2")
            {
                Command = (x) => SnapshotSamples.DoTest2()
            });

            var adminSection = new TableViewSection(tb.Source);

            adminSection.Header = "Sql";
            adminSection.Add(new StringElement("Browse")
            {
                Command = (x) =>
                {
                    var admin = new SQLite.MonoTouchAdmin.SQLiteAdmin(SnapshotSourcedDB.Main);
                    this.rootController.PushViewController(admin.NewTablesViewController(), true);
                }
            });

            this.rootController.PushViewController(tb, true);
        }
Esempio n. 4
0
        public override void LoadView()
        {
            base.LoadView();

            var section1 = new TableViewSection(this.Source);
            section1.Add(new StringElement("cash") { Command = this.NavigateToMinion });
            section1.Add(new StringElement("banked") { Command = this.NavigateToMinion });
        }
Esempio n. 5
0
        public void InitController()
        {
            var section1 = new TableViewSection(this.Source);

            section1.Header = "Right";
            section1.Add(new StringElement("Show Center")
            {
                Command = this.ShowCenter
            });
        }
Esempio n. 6
0
        public void InitController()
        {
            var section1 = new TableViewSection(this.Source);

            section1.Header = "Left (Middle)";
            section1.Add(new StringElement("Open Left")
            {
                Command = this.Hello
            });
        }
Esempio n. 7
0
        public void InitController()
        {
            var section1 = new TableViewSection(this.Source);

            section1.Header = "Bottom";
            section1.Add(new StringElement("Hello")
            {
                Command = this.Hello
            });
        }
Esempio n. 8
0
        public void InitController()
        {
            var section1 = new TableViewSection(this.Source);

            section1.Header = " ";
            section1.Add(new StringElement("Close")
            {
                Command = this.Close
            });
        }
        public override void LoadView()
        {
            base.LoadView();

            var section1 = new TableViewSection(this.Source);
            section1.Add(new StringElement("today 1") { Command = this.NavigateToMinionToday });
            section1.Add(new StringElement("today 2") { Command = this.NavigateToMinionToday });
            section1.Add(new StringElement("today 3") { Command = this.NavigateToMinionToday });
            section1.Add(new StringElement("today 4") { Command = this.NavigateToMinionToday });

            this.View.Layer.CornerRadius = 10;
        }
Esempio n. 10
0
        public AllMinionsViewController(MinionContext context, string title, bool allowDelete)
            : base(allowDelete ? UITableViewStyle.Grouped : UITableViewStyle.Plain, new SettingsSource())
        {
            this.context = context;
            this.lifetime = new CompositeDisposable();

            this.NavigationItem.RightBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Done);
            this.NavigationItem.RightBarButtonItem.Clicked += DoneClicked;

            this.allowDelete = allowDelete;
            this.Title = title;
            var s = new TableViewSection(this.Source);
        }
Esempio n. 11
0
        public void InitSample()
        {
            var section1 = new TableViewSection(this.Source);

            section1.Add(new StringElement("test")
            {
                Command = this.DoTest
            });
            section1.Add(new StringElement("add")
            {
                Command = this.DoAdd
            });
        }
Esempio n. 12
0
        protected void GotoGCTests(Element element)
        {
            var tb = new TableViewController(UITableViewStyle.Grouped);

            tb.Title = "GC Tests";

            var section1 = new TableViewSection(tb.Source);

            section1.Add(new StringElement("Self Referencing Items")
            {
                Command = this.SelfReferencingItemsTest
            });

            this.rootController.PushViewController(tb, true);
        }
Esempio n. 13
0
        protected void GotoLargeDataSample(Element element)
        {
            var tb = new TableViewController(UITableViewStyle.Grouped);

            tb.Title = "Large Data Sample";

            var section1 = new TableViewSection(tb.Source);

            section1.Header = "1000 Items";

            for (int i = 0; i < 1000; i++)
            {
                section1.Add(new StringElement("String Element " + i.ToString()));
            }

            this.rootController.PushViewController(tb, true);
        }
Esempio n. 14
0
        public void InitController()
        {
            var section1 = new TableViewSection(this.Source);

            section1.Header = "Center (Top)";
            section1.Add(new StringElement("Close")
            {
                Command = this.Close
            });

            var section2 = new TableViewSection(this.Source);

            section2.Add(new StringElement("Open Left")
            {
                Command = this.Hello
            });
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            this.tableSource.TableView = this.tableView;

            // todo: section to be created in constructor -- that means that we hold a reference to it and sections.clear can't dispose of the section

            if (this.section == null)
            {
                this.section = new TableViewSection<TransactionContract>(this.tableSource,
                    new UIViewDefinition<StringElementTableViewCell, TransactionContract>(this.Bind) { Param = UITableViewCellStyle.Value1 }
                    );
            }

            this.LoadTransactions();

            // Perform any additional setup after loading the view, typically from a nib.
        }
Esempio n. 16
0
        protected void GotoBindingSamples(Element element)
        {
            var tb = new TableViewController(UITableViewStyle.Grouped);

            tb.Title = "Binding Samples";

            var section1 = new TableViewSection(tb.Source);

            section1.Header = "Same element";
            section1.Footer = "Note that both elements update";

            var boolElement = new BooleanElement("Bool Value", false);

            section1.Add(boolElement);
            section1.Add(boolElement);

            this.rootController.PushViewController(tb, true);
        }
Esempio n. 17
0
        protected void GotoBindToSingleObject(Element element)
        {
            var tb = new TableViewController(UITableViewStyle.Grouped);

            tb.Title = "Single Object Binding Sample";

            var section1 = new TableViewSection(tb.Source);

            section1.Add(new TextInputElement(this.bindToSingleObjectPersion, null, new Binding("FirstName"))
            {
                Placeholder = "First Name"
            });
            section1.Add(new TextInputElement(this.bindToSingleObjectPersion, null, new Binding("LastName"))
            {
                Placeholder = "Last Name"
            });
            section1.Add(new DateInputElement(this.bindToSingleObjectPersion, null, new Binding("Birthdate")));

            this.rootController.PushViewController(tb, true);
        }
        public void Load(MinionContract minion)
        {
            this.minion = minion;

            this.NavigationItem.Title = minion.MinionName ?? "New Minion";

            var section1 = new TableViewSection(this.Source);

            section1.Header = "Minion Name";
            section1.BeginUpdate();
            section1.Add(new TextInputElement(minion, null, new Binding("MinionName")) { Placeholder = "Name", CanEdit = (_) => false });
            section1.EndUpdate();

            var section2 = new TableViewSection(this.Source);

            section2.Header = "Weekly Allowance";
            section2.BeginUpdate();
            section2.Add(new DecimalInputElement(minion, null, new Binding("WeeklyAllowance")) { CanEdit = (_) => true });
            section2.EndUpdate();
        }
Esempio n. 19
0
        public void InitSample()
        {
            var section1 = new TableViewSection(this.Source);

            section1.Add(new StringElement("Simple")
            {
                Command = this.StartSimpleSample
            });
            section1.Add(new StringElement("Navigation (Contained)")
            {
                Command = this.StartContainedSample
            });
            section1.Add(new StringElement("Navigation (Integrated)")
            {
                Command = this.StartIntegratedSample
            });
            section1.Add(new StringElement("Multi-Deck")
            {
                Command = this.StartMultiDeckSample
            });
        }
Esempio n. 20
0
        public void InitController()
        {
            if (this.addCloseButton)
            {
                var section1 = new TableViewSection(this.Source);
                section1.Add(new StringElement("Close")
                {
                    Command = this.Close
                });
            }

            var section2 = new TableViewSection(this.Source);

            section2.Add(new StringElement("Open Left")
            {
                Command = this.OpenLeft
            });
            section2.Add(new StringElement("Open Right")
            {
                Command = this.OpenRight
            });

            var section3 = new TableViewSection(this.Source);

            section3.Add(new StringElement("Swap Left & Right")
            {
                Command = this.Swap
            });

            // for navigation sample
            if (this.NavigationController != null)
            {
                var section4 = new TableViewSection(this.Source);
                section4.Add(new StringElement("Some other controller")
                {
                    Command = this.GoNext
                });
            }
        }
Esempio n. 21
0
        protected void GotoCustomControl(Element element)
        {
            var tb = new TableViewController(UITableViewStyle.Grouped);

            tb.Title = "Custom Control";

            var section1 = new TableViewSection(tb.Source);

            section1.Header = "Custom Control";

            var view = new UIViewDefinition <CustomElementTableViewCell, StringElement>(DefaultElementViewDefintions.SimpleElementBinding)
            {
                Param = UITableViewCellStyle.Default
            };


            var customData = new StringElement("");
            var wrapper    = new ElementDataViewWrapper(view, customData);

            section1.Add(wrapper);

            this.rootController.PushViewController(tb, true);
        }
Esempio n. 22
0
        public void InitController()
        {
            var section1 = new TableViewSection(this.Source);
            section1.Header = "Center (Top)";
            section1.Add(new StringElement("Close") { Command = this.Close });

            var section2 = new TableViewSection(this.Source);
            section2.Add(new StringElement("Open Left") { Command = this.Hello });
        }
Esempio n. 23
0
 public void InitController()
 {
     var section1 = new TableViewSection(this.Source);
     section1.Header = "Left (Middle)";
     section1.Add(new StringElement("Open Left") { Command = this.Hello });
 }
Esempio n. 24
0
 public void InitController()
 {
     var section1 = new TableViewSection(this.Source);
     section1.Header = "Right";
     section1.Add(new StringElement("Show Center") { Command = this.ShowCenter });
 }
Esempio n. 25
0
        private void SetupTable()
        {
            if (this.section == null)
            {
                this.section = new TableViewSection<TransactionContract>(this.tableSource);

                this.tableSource.TableView = this.transactionTable;
            }
        }
Esempio n. 26
0
        private void Load(MinionContract minion)
        {
            // bit of a hack, ideally I'd have IEditableObject
            var isNew = minion == null;
            this.minion = new MinionContract
            {
                Id = !isNew ? minion.Id : Guid.NewGuid(),
                MinionName = !isNew ? minion.MinionName : "New Minion",
                WeeklyAllowance = !isNew ? minion.WeeklyAllowance : 0,
            };

            var section1 = new TableViewSection(this.Source);

            section1.Header = "Name";
            section1.Add(new TextInputElement(this.minion, null, new Binding("MinionName")) { Placeholder = "Name", });

            var section2 = new TableViewSection(this.Source);

            section2.Header = "Allowance";
            section2.Add(new DecimalInputElement(this.minion, null, new Binding("WeeklyAllowance")));

            if (!isNew)
            {
                var section3 = new TableViewSection(this.Source);

                section3.Header = "Deeds";
                section3.Add(new DisclosureElement("Deeds to Perform") { Command = this.EditDeeds });
            }
        }
Esempio n. 27
0
 private void LoadDeeds(TableViewSection section, IEnumerable<ScheduledDeedContract> deeds)
 {
     foreach (var deed in deeds)
     {
         section.Add(new StringElement(deed, new Binding("Description")));
     }
 }
Esempio n. 28
0
        protected void DoDomainTest2(Element element)
        {
            var tb = new TableViewController(UITableViewStyle.Grouped);
            tb.Title = "Snapshot Sourced";

            var section1 = new TableViewSection(tb.Source);

            section1.Header = "commands";
            section1.Add(new StringElement("Test Command 1"){ Command = (x) => SnapshotSamples.DoTest1()});
            section1.Add(new StringElement("Test Command 2"){ Command = (x) => SnapshotSamples.DoTest2()});

            var adminSection = new TableViewSection(tb.Source);

            adminSection.Header = "Sql";
            adminSection.Add(new StringElement("Browse"){ Command = (x) =>
                {
                var admin = new SQLite.MonoTouchAdmin.SQLiteAdmin(SnapshotSourcedDB.Main);
                this.rootController.PushViewController(admin.NewTablesViewController(), true);
                }
            });

            this.rootController.PushViewController(tb, true);
        }
Esempio n. 29
0
 public void InitController()
 {
     var section1 = new TableViewSection(this.Source);
     section1.Header = "Something";
     section1.Add(new StringElement("Hello") { Command = this.Hello });
 }
Esempio n. 30
0
 public void InitSample()
 {
     var section1 = new TableViewSection(this.Source);
     section1.Add(new StringElement("Simple") { Command = this.StartSimpleSample });
     section1.Add(new StringElement("Navigation (Contained)") { Command = this.StartContainedSample });
     section1.Add(new StringElement("Navigation (Integrated)") { Command = this.StartIntegratedSample });
     section1.Add(new StringElement("Multi-Deck") { Command = this.StartMultiDeckSample });
 }
 public override void ViewWillUnload()
 {
     this.tableSource.TableView = null;
     this.tableSource.ClearData();
     this.section = null;
     base.ViewWillUnload();
 }
Esempio n. 32
0
        public void InitController()
        {
            if (this.addCloseButton)
            {
                var section1 = new TableViewSection(this.Source);
                section1.Add(new StringElement("Close") { Command = this.Close });
            }

            var section2 = new TableViewSection(this.Source);
            section2.Add(new StringElement("Open Left") { Command = this.OpenLeft });
            section2.Add(new StringElement("Open Right") { Command = this.OpenRight });

            var section3 = new TableViewSection(this.Source);
            section3.Add(new StringElement("Swap Left & Right") { Command = this.Swap });

            // for navigation sample
            if (this.NavigationController != null)
            {
                var section4 = new TableViewSection(this.Source);
                section4.Add(new StringElement("Some other controller") { Command = this.GoNext });
            }
        }
Esempio n. 33
0
        protected void GotoElementSamples(Element element)
        {
            var tb = new TableViewController(UITableViewStyle.Grouped);
            tb.Title = "Element Samples";

            var section = new TableViewSection(tb.Source);

            section.Header = "Sample Elements";

            section.Add(new StringElement("String"));
            section.Add(new SubtitleStringElement("Subtitle String", "Subtitle"));
            section.Add(new Value1StringElement("Value1 String", "Detail"));
            section.Add(new Value2StringElement("Value2 String", "Detail"));
            section.Add(new BooleanElement("Boolean", true));
            section.Add(new CheckboxElement("Checkbox", true));
            section.Add(new TextInputElement("Text Input", "") {Placeholder = "Placeholder text" });
            section.Add(new PasswordInputElement("Password"));
            section.Add(new DateInputElement("Date", DateTime.Today));

            // Use a DataViewWrapper to wrap an element with a different view definition from the one it would normally get
            var wrapper = new ElementDataViewWrapper(DefaultElementViewDefintions.DisclosureElementViewDefintion, new StringElement("Wrapped String"));
            section.Add(wrapper);

            this.rootController.PushViewController(tb, true);
        }
Esempio n. 34
0
        public void InitController()
        {
            var section1 = new TableViewSection(this.Source);
            section1.Header = "";
            section1.Add(new StringElement("Close") { Command = this.Close });

            var section2 = new TableViewSection(this.Source);
            section2.Header = "";
            section2.Add(new StringElement("Go to Deck") { Command = this.GotoDeck });
        }
Esempio n. 35
0
        protected void GotoGCTests(Element element)
        {
            var tb = new TableViewController(UITableViewStyle.Grouped);
            tb.Title = "GC Tests";

            var section1 = new TableViewSection(tb.Source);

            section1.Add(new StringElement("Self Referencing Items"){ Command = this.SelfReferencingItemsTest});

            this.rootController.PushViewController(tb, true);
        }
Esempio n. 36
0
        protected void GotoLargeDataSample(Element element)
        {
            var tb = new TableViewController(UITableViewStyle.Grouped);
            tb.Title = "Large Data Sample";

            var section1 = new TableViewSection(tb.Source);

            section1.Header = "1000 Items";

            for (int i = 0; i < 1000; i++)
            {
                section1.Add(new StringElement("String Element " + i.ToString()));
            }

            this.rootController.PushViewController(tb, true);
        }
Esempio n. 37
0
        protected void GotoBindingSamples(Element element)
        {
            var tb = new TableViewController(UITableViewStyle.Grouped);
            tb.Title = "Binding Samples";

            var section1 = new TableViewSection(tb.Source);

            section1.Header = "Same element";
            section1.Footer = "Note that both elements update";

            var boolElement = new BooleanElement("Bool Value", false);
            section1.Add(boolElement);
            section1.Add(boolElement);

            this.rootController.PushViewController(tb, true);
        }
Esempio n. 38
0
        public void SetupMainIndexSection(TableViewSource source)
        {
            var section1 = new TableViewSection(source);

            section1.Header = "MonoKit Sample Index";

            section1.Add(new DisclosureElement("Element Samples")
            {
                Command = this.GotoElementSamples
            });
            section1.Add(new DisclosureElement("Binding Samples")
            {
                Command = this.GotoBindingSamples
            });
            section1.Add(new DisclosureElement("Large Data Sample")
            {
                Command = this.GotoLargeDataSample
            });
            section1.Add(new DisclosureElement("Bind to Single Object")
            {
                Command = this.GotoBindToSingleObject
            });

            var section2 = new TableViewSection(source);

            section2.Header = "Test Samples";

            section2.Add(new DisclosureElement("Tasks Test")
            {
                Command = this.DoTaskTest
            });
            section2.Add(new DisclosureElement("Snapshot Domain Test")
            {
                Command = this.DoDomainTest2
            });
            section2.Add(new DisclosureElement("Event Sourced Domain Test")
            {
                Command = this.DoDomainTest1
            });
            section2.Add(new DisclosureElement("SQLite Admin Test")
            {
                Command = this.DoSqliteTest
            });
            section2.Add(new DisclosureElement("Custom Control")
            {
                Command = this.GotoCustomControl
            });
            section2.Add(new DisclosureElement("GC Tests")
            {
                Command = this.GotoGCTests
            });

            var section3 = new TableViewSection(source);

            section3.Header = "Utils";

            section3.Add(new StringElement("GC.Collect")
            {
                Command = this.DoGCCollect
            });
        }
Esempio n. 39
0
 public override void ViewDidLoad()
 {
     base.ViewDidLoad();
     var section1 = new TableViewSection(this.Source);
     this.LoadScheduledDeedsAsync(this.minionId.Id);
 }
Esempio n. 40
0
        protected void GotoBindToSingleObject(Element element)
        {
            var tb = new TableViewController(UITableViewStyle.Grouped);
            tb.Title = "Single Object Binding Sample";

            var section1 = new TableViewSection(tb.Source);

            section1.Add(new TextInputElement(this.bindToSingleObjectPersion, null, new Binding("FirstName")) { Placeholder = "First Name" });
            section1.Add(new TextInputElement(this.bindToSingleObjectPersion, null, new Binding("LastName")) { Placeholder = "Last Name" });
            section1.Add(new DateInputElement(this.bindToSingleObjectPersion, null, new Binding("Birthdate")) );

            this.rootController.PushViewController(tb, true);
        }
Esempio n. 41
0
        protected void GotoCustomControl(Element element)
        {
            var tb = new TableViewController(UITableViewStyle.Grouped);
            tb.Title = "Custom Control";

            var section1 = new TableViewSection(tb.Source);

            section1.Header = "Custom Control";

            var view = new UIViewDefinition<CustomElementTableViewCell, StringElement>(DefaultElementViewDefintions.SimpleElementBinding)
            {
                Param = UITableViewCellStyle.Default
            };

            var customData = new StringElement("");
            var wrapper = new ElementDataViewWrapper(view, customData);
            section1.Add(wrapper);

            this.rootController.PushViewController(tb, true);
        }
Esempio n. 42
0
 public void InitSample()
 {
     var section1 = new TableViewSection(this.Source);
     section1.Add(new StringElement("test") { Command = this.DoTest });
     section1.Add(new StringElement("add") { Command = this.DoAdd });
 }