Section CreateButtonSection(float labelHeight, float containerWidth)
        {
            Section     buttonSection = new Section();
            GlassButton button        = new GlassButton(new RectangleF(0, 0, containerWidth, labelHeight));

            button.SetTitleColor(UIColor.FromRGBA(255, 255, 0, 255), UIControlState.Normal);
            button.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
            button.SetTitle("Create Dataset", UIControlState.Normal);
            button.TouchUpInside += (o, e) =>
            {
                string name = _name.Summary();
                if (string.IsNullOrEmpty(name))
                {
                    //show an alert if data is not filled
                    new UIAlertView(string.Empty, "Enter a name", null, "OK", null).Show();
                }
                else
                {
                    // navigate to next screen
                    MXTouchContainer.Navigate("Dashboard/CreateData/" + name);
                }
            };
            UIViewElement imageElement = new UIViewElement(string.Empty, button, true);

            imageElement.Flags = UIViewElement.CellFlags.DisableSelection | UIViewElement.CellFlags.Transparent;
            buttonSection.Add(imageElement);

            return(buttonSection);
        }
        private bool ConstructUI()
        {
            // check if UI has already been built
            if (!_uiContructed)
            {
                Title = "Welcome!";

                UIImageView imgBackground = new UIImageView(new RectangleF(0, 0, 320, 480));
                imgBackground.Image = UIImage.FromFile("images/Wallpaper.png");
                this.Add(imgBackground);

                var         loc  = new PointF(10, 20);
                var         size = new SizeF(300, 44);
                var         rect = new RectangleF(loc, size);
                GlassButton b    = new GlassButton(rect);
                b.SetTitleColor(UIColor.Black, UIControlState.Normal);
                b.NormalColor         = UIColor.FromRGB(0x62, 0x63, 0x70);
                b.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
                b.SetTitle("Next Screen", UIControlState.Normal);
                b.TouchUpInside += (o, e) => { MXTouchContainer.Navigate("Dashboard"); };
                this.Add(b);

                // UI construction completed
                _uiContructed = true;
            }
            return(_uiContructed);
        }
예제 #3
0
        // This method is invoked when the application has loaded its UI and its ready to run
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            _window = new UIWindow(UIScreen.MainScreen.Bounds);

            MXTouchContainer.Initialize(new BestSellers.App(), this, _window);

            //Add some Views
            MXTouchContainer.AddView <CategoryList>(new Views.CategoryListView(), ViewPerspective.Read);
            MXTouchContainer.AddView <BookList>(new Views.BookListView(), ViewPerspective.Read);
            MXTouchContainer.AddView <Book>(new Views.BookView(), ViewPerspective.Read);

            MXTouchContainer.Navigate(null, MXContainer.Instance.App.NavigateOnLoad);

            return(true);
        }
예제 #4
0
        // This method is invoked when the application has loaded its UI and its ready to run
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            _window = new UIWindow(UIScreen.MainScreen.Bounds);

            var theApp = new App();

            MXTouchContainer.Initialize(theApp, this, _window);

            //Add some Views
            MXTouchContainer.AddView <object>(new WelcomeScreenView());
            MXTouchContainer.AddView <DataSet>(new DashboardView());
            MXTouchContainer.AddView <DataSet>(new GenericDashboardView(), ViewPerspective.Create);

            MXTouchContainer.Navigate(MXContainer.Instance.App.NavigateOnLoad);

            return(true);
        }
예제 #5
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            // create a new window instance based on the screen size
            window = new UIWindow(UIScreen.MainScreen.Bounds);

            MXTouchContainer.Initialize(new CustomerManagement.App(), this, window);

            // Add Views
            MXTouchContainer.AddView <List <Customer> >(typeof(CustomerListView), ViewPerspective.Default);
            MXTouchContainer.AddView <Customer>(typeof(CustomerView), ViewPerspective.Default);
            MXTouchContainer.AddView <Customer>(typeof(CustomerEditView), ViewPerspective.Update);

            MXTouchContainer.Navigate(null, MXContainer.Instance.App.NavigateOnLoad);

            UIDevice.CurrentDevice.BeginGeneratingDeviceOrientationNotifications();

            return(true);
        }
예제 #6
0
        private bool ConstructUI()
        {
            // check if UI has already been built
            if (!_uiContructed)
            {
                Title = "Dashboard";

                UIImageView imgBackground = new UIImageView(new RectangleF(0, 0, 320, 480));
                imgBackground.Image = UIImage.FromFile("images/Wallpaper.png");
                this.Add(imgBackground);

                float yLoc        = 0;
                float labelHeight = 44;

                var    loc       = new PointF(10, 75);
                var    size      = new SizeF(300, labelHeight);
                var    viewRect  = new RectangleF(loc, size);
                UIView statsView = new UIView(viewRect);
                statsView.BackgroundColor = UIColor.Clear;

                var labelSize = new SizeF(150, labelHeight);

                var rect        = new RectangleF(new PointF(0, yLoc), labelSize);
                var userIdLabel = new UILabel(rect);
                userIdLabel.Text = "DataSet GUID:";
                userIdLabel.Layer.BorderColor  = new CGColor(1.0f, 0.0f, 0.0f, 1.0f);
                userIdLabel.Layer.CornerRadius = 15f;
                userIdLabel.BackgroundColor    = UIColor.FromWhiteAlpha(0.5f, 0.5f);

                var labelRect  = new RectangleF();
                var labelStart = labelSize.Width - 20;
                labelRect.Width    = size.Width - labelStart;
                labelRect.Height   = labelHeight;
                labelRect.Location = new PointF(labelStart, yLoc);
                _userIdValueLabel  = new UILabel(labelRect);
                _userIdValueLabel.BackgroundColor    = UIColor.FromWhiteAlpha(0.5f, 0.5f);
                _userIdValueLabel.Layer.CornerRadius = 15f;
                _userIdValueLabel.Text = Model != null ? Model.Name : "NULL";

                statsView.Add(userIdLabel);
                statsView.Add(_userIdValueLabel);
                this.Add(statsView);

                //float buttonStart = labelRect.Y + labelHeight + 10;
                loc  = new PointF(10, 20);
                size = new SizeF(300, 44);
                rect = new RectangleF(loc, size);
                GlassButton b = new GlassButton(rect);
                b.SetTitleColor(UIColor.FromRGBA(255, 255, 0, 255), UIControlState.Normal);
                b.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
                b.SetTitle("Delete Data", UIControlState.Normal);
                b.TouchUpInside += (o, e) => {
                    string s = !string.IsNullOrEmpty(s) ? Model.Name : s = "NoData";
                    MXTouchContainer.Navigate("WelcomeScreen/Data/" + s);
                };
                this.Add(b);

                var button = new UIBarButtonItem(UIBarButtonSystemItem.Refresh);
                button.Clicked += delegate(object sender, EventArgs e) {
                    MXTouchContainer.Navigate("WelcomeScreen");
                };
                NavigationItem.SetRightBarButtonItem(button, true);



                // UI construction completed
                _uiContructed = true;
            }
            return(_uiContructed);
        }
예제 #7
0
 public void NewCustomer()
 {
     MXTouchContainer.Navigate(this, "Customers/NEW");
 }