Пример #1
0
        public LocationPage(ArpansaViewModel mApransaModel, ArpansaRealtimeFeed mArpansaService)
        {
            InitializeComponent();

            this.arpansaModel   = mApransaModel;
            this.arpansaService = mArpansaService;

            this.BindingContext = this.arpansaModel;

            this.arpansaModel.PropertyChanged += ArpansaModel_PropertyChanged;
        }
Пример #2
0
        public MainPage()
        {
            InitializeComponent();

            ArpansaViewModel    arpansaModel   = new ArpansaViewModel();
            ArpansaRealtimeFeed arpansaService = new ArpansaRealtimeFeed();

            this.graphPage = new GraphPage(arpansaModel, arpansaService);
            this.Children.Add(this.graphPage);
            this.Children.Add(new LocationPage(arpansaModel, arpansaService));

            this.CurrentPageChanged += MainPage_CurrentPageChanged;
        }
Пример #3
0
        //constructor
        public UVPlotter(SKGLView mCanvasView, ArpansaViewModel mArpansaModel, TimeSpan mMinX, TimeSpan mMaxX, TimeSpan mDeltaX, float mMinY, float mMaxY, float mDeltaY, string mXAxisTitle, string mYAxisTitle, Color backgroundColor)
        {
            this.canvasView   = mCanvasView;
            this.arpansaModel = mArpansaModel;
            this.minX         = mMinX;
            this.maxX         = mMaxX;
            this.deltaX       = mDeltaX;
            this.minY         = mMinY;
            this.maxY         = mMaxY;
            this.deltaY       = mDeltaY;
            this.xAxisTitle   = mXAxisTitle;
            this.yAxisTitle   = mYAxisTitle;

            this.predictedLinePaint = new SKPaint
            {
                Color       = SKColors.Gray.WithAlpha(0.4f),
                Style       = SKPaintStyle.Stroke,
                StrokeWidth = 3f,
                IsAntialias = true
            };
            this.measuredLinePaint = new SKPaint
            {
                Color       = SKColors.DarkBlue,
                Style       = SKPaintStyle.Stroke,
                StrokeWidth = 3f,
                IsAntialias = true
            };
            this.measuredAreaPaint = new SKPaint
            {
                Color       = new SKColor(20, 20, 100).WithAlpha(0.1f),
                Style       = SKPaintStyle.Fill,
                IsAntialias = true
            };
            this.currentUVTextPaint = new SKPaint
            {
                Color       = SKColors.White,
                TextSize    = 20f,
                IsAntialias = true
            };

            this.backgroundColor = backgroundColor;

            this.arpansaModel.PropertyChanged += ArpansaModel_PropertyChanged;
        }
Пример #4
0
        public GraphPage(ArpansaViewModel mArpansaModel, ArpansaRealtimeFeed mArpansaService)
        {
            InitializeComponent();
            this.arpansaModel   = mArpansaModel;
            this.arpansaService = mArpansaService;
            this.uvGraph        = new UVPlotter(this.canvasView, this.arpansaModel, new TimeSpan(6, 0, 0), new TimeSpan(20, 0, 0), new TimeSpan(3, 0, 0), 0, 13, 2, "Time of Day", "UV Level", this.BackgroundColor);

            //subscribe to events
            arpansaModel.ArpansaUpdateEvent += UpdateGraph;
            this.Appearing += GraphPage_Appearing;

            //update graph every minute
            Device.StartTimer(TimeSpan.FromMinutes(1), () => {
                this.TimeExpired();
                return(true);
            });

            this.BindingContext = this.arpansaModel;
        }