using System;
|
using System.Collections.Generic;
|
|
namespace Shared.SimpleControl.Phone
|
{
|
/// <summary>
|
/// BasePage
|
/// </summary>
|
public class BasePage : FrameLayout
|
{
|
#region TopView
|
/// <summary>
|
/// 顶部导航栏背景View
|
/// </summary>
|
public FrameLayout TopView;
|
/// <summary>
|
/// 返回按钮
|
/// </summary>
|
public Button topBackBtn;
|
/// <summary>
|
/// 标题
|
/// </summary>
|
public Button topTitleBtn;
|
/// <summary>
|
/// 右边菜单按钮
|
/// </summary>
|
public Button topItemButton;
|
#endregion
|
/// <summary>
|
///
|
/// </summary>
|
public FrameLayout BaseContentView;
|
|
|
/// <summary>
|
///
|
/// </summary>
|
public BasePage()
|
{
|
BackgroundColor = SkinStyle.Current.MainColor;
|
}
|
|
/// <summary>
|
/// 加载页面
|
/// </summary>
|
public virtual void ShowPage()
|
{
|
#region ---TopView---
|
TopView = new FrameLayout()
|
{
|
Y = Application.GetRealHeight(36),
|
Height = Application.GetRealHeight(90),
|
BackgroundColor = SkinStyle.Current.MainColor,
|
};
|
AddChidren(TopView);
|
|
topBackBtn = new Button()
|
{
|
Height = Application.GetRealHeight(90),
|
Width = Application.GetRealWidth(85),
|
UnSelectedImagePath = "Item/Back.png",
|
SelectedImagePath = "Item/BackSelected.png",
|
};
|
TopView.AddChidren(topBackBtn);
|
topBackBtn.MouseUpEventHandler += (sender, e) => {
|
(Parent as PageLayout).PageIndex -= 1;
|
};
|
|
topTitleBtn = new Button()
|
{
|
Width = Application.GetMinRealAverage(400),
|
Height = Application.GetMinRealAverage(90),
|
TextColor = SkinStyle.Current.TextColor1,
|
Gravity = Gravity.CenterHorizontal,
|
TextAlignment = TextAlignment.Center,
|
TextSize = 20,
|
};
|
TopView.AddChidren(topTitleBtn);
|
|
topItemButton = new Button()
|
{
|
Width = Application.GetMinRealAverage(55),
|
Height = Application.GetMinRealAverage(55),
|
UnSelectedImagePath = "Item/+.png",
|
SelectedImagePath = "Item/+.png",
|
Gravity = Gravity.CenterVertical,
|
X = Application.GetRealWidth(640 - 80),
|
};
|
TopView.AddChidren(topItemButton);
|
#endregion
|
|
#region
|
|
BaseContentView = new FrameLayout()
|
{
|
Y = TopView.Bottom,
|
Width = LayoutParams.MatchParent,
|
Height = Application.GetRealHeight(Application.DesignHeight) - TopView.Bottom,
|
BackgroundColor = SkinStyle.Current.ViewColor,
|
};
|
AddChidren(BaseContentView);
|
|
#endregion
|
|
}
|
|
/// <summary>
|
/// 关闭页面
|
/// </summary>
|
public void BackAction()
|
{
|
(Parent as PageLayout).PageIndex -= 1;
|
}
|
|
}
|
|
|
}
|