protected void Initialize() { Title = "Sync"; _vm = new SyncPageViewModel(); this.BindingContext = _vm; BackgroundColor = Color.White; Label labelUpdateAppData = new Label() { Text = "REFRESH APP DATA", TextColor = asbestos, FontFamily = Device.OnPlatform("OpenSans-Bold", "sans-serif-black", null) }; Label labelUpdateWarning = new Label() { Text = "This will refresh the data on your application, using the time frame that can be adjusted in Settings. It requires either mobile data or WiFi connectivity.", TextColor = asbestos, FontFamily = Device.OnPlatform("OpenSans-Regular", "sans-serif", null) }; Button buttonUpdateData = new Button() { TextColor = Color.White, BackgroundColor = emerald, FontFamily = Device.OnPlatform("OpenSans-Bold", "sans-serif-black", null) }; //later, add check for connectivity and make this presentation conditional buttonUpdateData.Text = "UPDATE APP DATA"; buttonUpdateData.Clicked += ButtonUpdateData_Clicked; BoxView separator = new BoxView() { HeightRequest = 1, HorizontalOptions = LayoutOptions.FillAndExpand, BackgroundColor = asbestos }; StackLayout refreshLayout = new StackLayout { Padding = 30, Children = { labelUpdateAppData, labelUpdateWarning, buttonUpdateData } }; Label labelSendDataTitle = new Label() { Text = "UPLOAD DATA", TextColor = asbestos, FontFamily = Device.OnPlatform("OpenSans-Bold", "sans-serif-black", null) }; Label labelSendWarning = new Label() { Text = "This will send data from Tech Dashboard to the central server. This operations requires either mobile data or WiFi connections.", TextColor = asbestos, FontFamily = Device.OnPlatform("OpenSans-Regular", "sans-serif", null) }; Label labelSendCount = new Label() { TextColor = Color.Red, FontFamily = Device.OnPlatform("OpenSans-Regular", "sans-serif", null) }; labelSendCount.SetBinding(Label.TextProperty, "UpdateCount"); Label labelSendContent = new Label() { TextColor = Color.Red, FontFamily = Device.OnPlatform("OpenSans-Regular", "sans-serif", null), Text = "records awaiting sync." }; Button buttonSendData = new Button() { TextColor = Color.White, BackgroundColor = emerald, FontFamily = Device.OnPlatform("OpenSans-Bold", "sans-serif-black", null) }; // same as bove, add check for connectivity and make this enabled conditional buttonSendData.Text = "SYNC DATA"; buttonSendData.Clicked += ButtonSendData_Clicked; Button buttonViewData = new Button() { TextColor = Color.White, BackgroundColor = alizarin, FontFamily = Device.OnPlatform("OpenSans-Bold", "sans-serif-black", null) }; buttonViewData.Text = "PREVIEW DATA"; buttonViewData.Clicked += ButtonViewData_Clicked; StackLayout titleLayout = new StackLayout { BackgroundColor = peterriver, Padding = 50, HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.Start, Children = { new Xamarin.Forms.Label { Text = "SYNC", FontFamily = Device.OnPlatform("OpenSans-Bold", "sans-serif-black", null), TextColor = Color.White, HorizontalOptions = LayoutOptions.CenterAndExpand, VerticalOptions = LayoutOptions.Center } } }; StackLayout syncLayout = new StackLayout { Padding = 30, Children = { labelSendDataTitle, labelSendWarning, new StackLayout { Spacing = 5, Orientation = StackOrientation.Horizontal, Children = { labelSendCount, labelSendContent } }, buttonViewData, buttonSendData } }; Content = new StackLayout { Spacing = 10, Children = { titleLayout, refreshLayout, separator, syncLayout } }; }
protected void Initialize() { _vm = new SyncPageViewModel(); this.DataContext = _vm; Label labelUpdateAppData = new Label() { Content = "REFRESH TECHNICIAN DASHBOARD DATA", Foreground = asbestos, FontWeight = FontWeights.Bold }; TextBlock labelUpdateWarning = new TextBlock() { Text = "Select the Technician Dashboard Data button to refresh the Technician Dashboard data. Access SETTINGS to specifiy a time range. The refresh process requires a mobile data or WiFi connection.", TextWrapping = TextWrapping.Wrap, Foreground = asbestos, //FontWeight = FontWeights.Bold dch rkl 12/02/2016 this should not be bold }; Button buttonUpdateData = new Button() { Foreground = new SolidColorBrush(Colors.White), Background = emerald, BorderBrush = emerald, FontWeight = FontWeights.Bold, Height = 50, Margin = new Thickness(0, 20, 0, 20) }; //later, add check for connectivity and make this presentation conditional buttonUpdateData.Content = "REFRESH TECHNCIAN DASHBOARD DATA"; buttonUpdateData.Click += ButtonUpdateData_Clicked; Rectangle separator = new Rectangle() { Height = 1, HorizontalAlignment = HorizontalAlignment.Stretch, Stroke = asbestos, Margin = new Thickness(30, 20, 30, 0) }; StackPanel refreshLayout = new StackPanel { Margin = new Thickness(30, 10, 30, 0), Children = { labelUpdateAppData, labelUpdateWarning, buttonUpdateData } }; Label labelSendDataTitle = new Label() { Content = "UPLOAD DATA", Foreground = asbestos, FontWeight = FontWeights.Bold, Margin = new Thickness(30, 10, 30, 0) }; TextBlock labelSendWarning = new TextBlock() { Text = "Select the UPLOAD DATA button to send data from Technician Dashboard to JobOps/Sage 100c Manufacturing. The sync process requires a mobile data or WiFi connection.", TextWrapping = TextWrapping.Wrap, Foreground = asbestos, Margin = new Thickness(30, 10, 30, 0) }; Label labelSendCount = new Label() { FontWeight = FontWeights.Bold, Foreground = new SolidColorBrush(Colors.Red) }; labelSendCount.SetBinding(ContentProperty, "UpdateCount"); Label labelSendContent = new Label() { Content = "records awaiting upload.", FontWeight = FontWeights.Bold, Foreground = new SolidColorBrush(Colors.Red) }; Label labelLastSyncDate = new Label() { FontWeight = FontWeights.Bold, Foreground = new SolidColorBrush(Colors.Red), Margin = new Thickness(30, 10, 30, 10) }; labelLastSyncDate.SetBinding(Label.ContentProperty, "LastSyncDate"); Button buttonSendData = new Button() { Foreground = new SolidColorBrush(Colors.White), Background = emerald, BorderBrush = emerald, FontWeight = FontWeights.Bold, Height = 50, HorizontalAlignment = HorizontalAlignment.Stretch, Margin = new Thickness(30, 10, 30, 10) }; // same as bove, add check for connectivity and make this enabled conditional buttonSendData.Content = "UPLOAD DATA"; buttonSendData.Click += ButtonSendData_Clicked; Button buttonViewData = new Button() { Foreground = new SolidColorBrush(Colors.White), Background = alizarin, BorderBrush = alizarin, FontWeight = FontWeights.Bold, Height = 50, HorizontalAlignment = HorizontalAlignment.Stretch, Margin = new Thickness(30, 10, 30, 10) }; buttonViewData.Content = "PREVIEW DATA"; buttonViewData.Click += ButtonViewData_Click; StackPanel titleLayout = new StackPanel { Background = peterriver, HorizontalAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Top, Children = { new Label { Content = "SYNC", FontWeight = FontWeights.Bold, Foreground = new SolidColorBrush(Colors.White), HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, FontSize = 18 // dch rkl 10/26/2016 } } }; gridMains.Children.Add(new StackPanel { Children = { titleLayout, refreshLayout, separator, labelSendDataTitle, labelSendWarning, new StackPanel() { Orientation = Orientation.Horizontal, Margin = new Thickness(30, 10, 30, 0), Children = { labelSendCount, labelSendContent } }, labelLastSyncDate, buttonViewData, buttonSendData } }); }