using Sarand.Net.Mobile.Xamarin.Forms.Controls; using Sarand.Net.Mobile.Xamarin.Forms.Layouts; using Sarand.Net.Mobile.Xamarin.Forms.Views; using System; using System.Collections.Generic; using System.Text; using Xamarin.Forms; namespace Sarand.Net.Mobile.Xamarin.Forms.Panels { //======================================================================= public class SaxPanel_Progress : SaxContentView { //------------------------------------------------------------------- // Definitions. public class Config { } //------------------------------------------------------------------- // Data members. private Config config; // Panel layout. private SaxGrid gridPanel = new SaxGrid(); private SaxContentView viewPanel = new SaxContentView(); private SaxLabel labelProgressMessage = new SaxLabel(); //------------------------------------------------------------------- // Construction. public SaxPanel_Progress (Config config) { this.config = config; InitialiseComponents(); } //------------------------------------------------------------------- // Properties. public double ProgressMessageDefaultFontSize { get { return labelProgressMessage.DefaultFontSize; } } public double ProgressMessageFontSize { get { return labelProgressMessage.FontSize; } set { labelProgressMessage.FontSize = value; } } public FontAttributes ProgressMessageFontAttributes { get { return labelProgressMessage.FontAttributes; } set { labelProgressMessage.FontAttributes = value; } } public Color ProgressMessageColor { get { return labelProgressMessage.TextColor; } set { labelProgressMessage.TextColor = value; } } public String ProgressMessage { get { return labelProgressMessage.Text; } set { labelProgressMessage.Text = value; } } public Thickness ProgressMessagePadding { get { return viewPanel.Padding; } set { viewPanel.Padding = value; } } public Color ProgressMessageBackgroundColor { get { return viewPanel.BackgroundColor; } set { viewPanel.BackgroundColor = value; } } //------------------------------------------------------------------- // I n i t i a l i s e //------------------------------------------------------------------- private void InitialiseComponents () { // Layout is a 3x3 grid with only the central cell populated. // All other cells are transparent/opaque. gridPanel.BackgroundColor = new Color(0, 0, 0, 0.5); gridPanel.HorizontalOptions = LayoutOptions.FillAndExpand; gridPanel.VerticalOptions = LayoutOptions.FillAndExpand; gridPanel.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Star }); gridPanel.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto }); gridPanel.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Star }); gridPanel.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Star }); gridPanel.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto }); gridPanel.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Star }); Content = gridPanel; // The panel's view. viewPanel.Padding = new Thickness(12.0); viewPanel.BackgroundColor = Color.WhiteSmoke; viewPanel.HorizontalOptions = LayoutOptions.Center; viewPanel.VerticalOptions = LayoutOptions.Center; gridPanel.Children.Add(viewPanel, 1, 1); // Progress message. viewPanel.Content = labelProgressMessage; // Complete panel configuration. ConfigurePanel(); } //------------------------------------------------------------------- // C o n f i g u r e P a n e l //------------------------------------------------------------------- private void ConfigurePanel () { // Panel initialisation that depends on the configuration. } //------------------------------------------------------------------- // P a n e l E v e n t s //------------------------------------------------------------------- //------------------------------------------------------------------- } //======================================================================= }