public FitnessChartView( ) { InitializeComponent( ); BindingContext = ViewModel = new FitnessChartViewModel(this.Navigation); CircularGauge.BindingContext = ViewModel; // Header position TitleHeader.Position = Device.OnPlatform(iOS: new Point(0.5, 0.65), Android: new Point(0.5, 0.65), WinPhone: new Point(0.5, 0.65)); ValueHeader.Position = Device.OnPlatform(iOS: new Point(0.5, 0.75), Android: new Point(0.5, 0.75), WinPhone: new Point(0.5, 0.75)); UnitsHeader.Position = Device.OnPlatform(iOS: new Point(0.5, 0.85), Android: new Point(0.5, 0.85), WinPhone: new Point(0.5, 0.85)); // TODO: Change Target set by User ViewModel.TargetSteps = StepCount.Steps.GetStepsGoal(); // TODO: The Steps Counted So Far set by the Step service StepCount.Steps.SetStepsGoal(1000); ViewModel.StepsCount = StepCount.Steps.GetTotalSteps(); PercentCompleteLabel.Text = ViewModel.Complete.ToString(); Debug.WriteLine("Percent Completed {0}", ViewModel.Complete); }
public FitnessDashboardPage() { this.SetBinding(Page.TitleProperty, new Binding() { Source = TextResources.FitnessDashboardPage_Title }); toolbarItem = new ToolbarItem() { Text = "Settings", Icon = "Setting.png" }; toolbarItem.Clicked += toolbartItem_Clicked; ToolbarItems.Add(toolbarItem); var fitnessChartView = new FitnessChartView() { BindingContext = FitnessChartViewModel = new FitnessChartViewModel(this.Navigation) }; _frameStackLayout = new StackLayout() { Spacing = 0, Padding = 10, Children = { fitnessChartView } }; Content = _frameStackLayout; }