1
wxr
2023-03-31 7e42cc13a14b7de31c9f5d5c61cdf24f3246335d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
using System;
 
namespace Shared.SimpleControl.Pad
{
    /// <summary>
    /// 用户界面标题栏
    /// </summary>
    public static class UserTop
    {
        /// <summary>
        /// 标题栏
        /// </summary>
        public static readonly FrameLayout FrameLayoutMain = new FrameLayout () {
            Y = Application.GetRealHeight (20),
            Height = Application.GetRealHeight (130)
        };
 
        /// <summary>
        /// 初始化用户界面的标题栏
        /// </summary>
        public static void Init ()
        {
            if (null != FrameLayoutMain.Parent) {
                return;
            }
            UserHomePage.FrameLayoutMain.AddChidren (FrameLayoutMain);
            initTopFrameLaout ();
        }
 
        static void initTopFrameLaout ()
        {
            Button LogoButton = new Button () {
               Width = Application.GetRealWidth (154),
                Height = Application.GetRealHeight (90),
                UnSelectedImagePath = MainPage.LogoString,
            };
            FrameLayoutMain.AddChidren (LogoButton);
            LogoButton.MouseLongEventHandler+=(sender, e) => {
                //new Alert ("No.", UserConfig.Current.tokenID, "Close").Show ();
                //UserConfig.Current.HideDeviceTypes = new System.Collections.Generic.List<int> ();
                //UserConfig.Current.SaveUserConfig ();
            };
 
            Button NameButton = new Button () {
                Width = Application.GetRealWidth (400),
                Height = Application.GetMinReal (60),
                Text = MainPage.SoftPadTitle,
                TextColor = SkinStyle.Current.TextColor1,
                Gravity = Gravity.Center,
                TextAlignment = TextAlignment.Center,
                TextSize = 20,
            };
            FrameLayoutMain.AddChidren (NameButton);
 
            Button ItemButton = new Button () {
                Width = Application.GetRealWidth (105),
                Height = Application.GetRealHeight (80),
                UnSelectedImagePath = "Item/Item.png",
                SelectedImagePath = "Item/Item.png",
                Y = Application.GetRealHeight (40),
            };
            ItemButton.X = FrameLayoutMain.Width - ItemButton.Width - Application.GetRealWidth(50);
            ItemButton.MouseUpEventHandler += (sender, e) => {
                //右边的菜单栏是否显示
                new UserListItem ().Show ();
            };
            FrameLayoutMain.AddChidren (ItemButton);
        }
    }
}