void ReleaseDesignerOutlets()
 {
     if (plotview != null)
     {
         plotview.Dispose();
         plotview = null;
     }
 }
Beispiel #2
0
        void ReleaseDesignerOutlets()
        {
            if (vwPieChart != null)
            {
                vwPieChart.Dispose();
                vwPieChart = null;
            }

            if (vwPieChart2 != null)
            {
                vwPieChart2.Dispose();
                vwPieChart2 = null;
            }
        }
        private void RenderView()
        {
            Title = "Kinvey Live Service - Doctor";
            View.BackgroundColor = UIColor.FromRGB(7, 69, 126);
            nfloat w           = View.Bounds.Width;
            var    buttonWidth = (w / 2) - 20;

            AppDelegate myAppDel   = (UIApplication.SharedApplication.Delegate as AppDelegate);
            var         titleLabel = new UILabel
            {
                Text          = "Bob's Device Reading",
                TextColor     = UIColor.White,
                Frame         = new CGRect(10, 80, w - 20, h),
                TextAlignment = UITextAlignment.Center
            };

            View.AddSubview(titleLabel);

            MessageView = new UILabel
            {
                Text          = "--",
                Frame         = new CGRect(10, 120, w - 20, 3 * h),
                TextColor     = UIColor.White,
                Font          = UIFont.FromName("Helvetica-Bold", 60f),
                TextAlignment = UITextAlignment.Center
            };

            View.AddSubview(MessageView);

            TimeView = new UITextField
            {
                Placeholder     = "Roundtrip Time",
                Frame           = new CGRect(10, 200, w - 20, h),
                BorderStyle     = UITextBorderStyle.RoundedRect,
                BackgroundColor = UIColor.White,
                TextColor       = UIColor.Black
            };

            View.AddSubview(TimeView);
            TimeView.Hidden = true;

            plotModel = new OxyPlot.PlotModel();
            //plotModel.Background = OxyColor.FromRgb(131, 195, 202);
            plotModel.Background = OxyColor.FromRgb(157, 194, 198);
            plotModel.Axes.Add(new OxyPlot.Axes.LinearAxis {
                Position = OxyPlot.Axes.AxisPosition.Bottom
            });
            plotModel.Axes.Add(new OxyPlot.Axes.LinearAxis {
                Position = OxyPlot.Axes.AxisPosition.Left
            });

            OxyPlot.Xamarin.iOS.PlotView plotView = new OxyPlot.Xamarin.iOS.PlotView(new CGRect(10, 240, w - 20, 200));
            plotView.Model = plotModel;

            View.AddSubview(plotView);
            //UIButton buttonPublishDecrement;
            //buttonPublishDecrement = UIButton.FromType(UIButtonType.System);
            //buttonPublishDecrement.Frame = new CGRect(10, 280, buttonWidth, 44);
            //buttonPublishDecrement.SetTitle("Decrease", UIControlState.Normal);
            //buttonPublishDecrement.SetTitleColor(UIColor.Red, UIControlState.Normal);
            //buttonPublishDecrement.BackgroundColor = colorLightBlue;
            //buttonPublishDecrement.TouchUpInside += async (sender, e) =>
            //{
            //	await this.Publish(MedicalDeviceCommand.EnumCommand.DECREMENT);
            //	//PublishMessageView.Text = String.Empty;
            //};

            //View.AddSubview(buttonPublishDecrement);

            //UIButton buttonPublishIncrement;
            //buttonPublishIncrement = UIButton.FromType(UIButtonType.System);
            //buttonPublishIncrement.Frame = new CGRect(w - buttonWidth - 10, 280, buttonWidth, 44);
            //buttonPublishIncrement.SetTitle("Increase", UIControlState.Normal);
            //buttonPublishIncrement.SetTitleColor(UIColor.Green, UIControlState.Normal);
            //buttonPublishIncrement.BackgroundColor = colorLightBlue;
            ////buttonPublishIncrement.BackgroundColor = UIColor.Green;
            //buttonPublishIncrement.TouchUpInside += async (sender, e) =>
            //{
            //	await this.Publish(MedicalDeviceCommand.EnumCommand.INCREMENT);
            //	//PublishMessageView.Text = String.Empty;
            //};

            //View.AddSubview(buttonPublishIncrement);

            UIButton buttonLogout;

            buttonLogout       = UIButton.FromType(UIButtonType.System);
            buttonLogout.Frame = new CGRect(10, 460, w - 20, 44);
            buttonLogout.SetTitle("Logout", UIControlState.Normal);
            buttonLogout.SetTitleColor(UIColor.Black, UIControlState.Normal);
            buttonLogout.BackgroundColor = UIColor.Gray;

            var user = new UIViewController();

            user.View.BackgroundColor = UIColor.FromRGB(7, 69, 126);

            buttonLogout.TouchUpInside += async(sender, e) =>
            {
                await myAppDel.Logout();
            };

            View.AddSubview(buttonLogout);
        }