wxr
2019-12-25 3df772e4fdd553b2954e8f3f55ce7ff5905407c3
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
using Shared.SimpleControl.Phone;
using System;
 
namespace Shared.SimpleControl.Pad
{
    /// <summary>
    /// 后面配置界面的标题栏
    /// </summary>
    public static class SystemTop
    {
        /// <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;
            }
            SystemHomePage.FrameLayoutMain.AddChidren (FrameLayoutMain);
            initTopFrameLaout (); 
        }
            
         /// <summary>
         /// 初始所有的视图
         /// </summary>
        private static void initTopFrameLaout()
        {
            Button LogoButton = new Button () {
                Width = Application.GetRealWidth (154),
                Height = Application.GetRealHeight (90),
                X = Application.GetRealWidth (486),
                UnSelectedImagePath = MainPage.LogoString,
            };
        
            //常安logo弹出删除文件界面
            LogoButton.MouseLongEventHandler += (sender, e) => {
               Alert alert = new Alert (Language.StringByID (R.MyInternationalizationString.Tip), Language.StringByID (R.MyInternationalizationString.TipDeleteAllFiles), Language.StringByID (R.MyInternationalizationString.Cancel), Language.StringByID (R.MyInternationalizationString.Confrim));
                alert.ResultEventHandler += (object sender2, bool e2) => {
                    if (e2) {
                        IO.FileUtils.DeleteAllFile ();
                        SystemMiddleTop.selected (SystemMiddleTop.gateWay);
                        SystemMiddle.ShowGateWayFrameLayout ();
                        SystemMiddle.InitBottomButtonForReadGateWay ();
                    }
                };
                alert.Show ();
            };
            FrameLayoutMain.AddChidren (LogoButton);
 
            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 = 24,
            };
            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) => {
                SystemHomePage.FrameLayoutMain.Visible = false;
                UserHomePage.FrameLayoutMain.Visible=true;
                UserMiddle.DeviceMode ();
            };
            FrameLayoutMain.AddChidren (ItemButton);
        }
    }
}