95 lines
4.0 KiB
C#
95 lines
4.0 KiB
C#
using Sarand.Net.Mobile.Maui.Controls;
|
|
using Sarand.Net.Mobile.Maui.Layouts;
|
|
using Sarand.Net.Mobile.Maui.Views;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Sarand.Net.Mobile.Maui.Panels
|
|
{
|
|
//=======================================================================
|
|
public class SamPanel_Progress : SamContentView
|
|
{
|
|
//-------------------------------------------------------------------
|
|
// Definitions.
|
|
public class Config
|
|
{
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
// Data members.
|
|
private Config config;
|
|
// Panel layout.
|
|
private SamGrid gridPanel = new SamGrid();
|
|
private SamContentView viewPanel = new SamContentView();
|
|
private SamLabel labelProgressMessage = new SamLabel();
|
|
|
|
//-------------------------------------------------------------------
|
|
// Construction.
|
|
public SamPanel_Progress(Config config)
|
|
{
|
|
this.config = config;
|
|
InitialiseComponents();
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
// Properties.
|
|
public double ProgressMessageFontSizeDefault { get { return labelProgressMessage.FontSizeDefault; } }
|
|
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.5f);
|
|
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 = Colors.WhiteSmoke;
|
|
viewPanel.HorizontalOptions = LayoutOptions.Center;
|
|
viewPanel.VerticalOptions = LayoutOptions.Center;
|
|
gridPanel.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
|
|
//-------------------------------------------------------------------
|
|
|
|
//-------------------------------------------------------------------
|
|
}
|
|
//=======================================================================
|
|
}
|