Exemple #1
0
        public void Init(IQFrameworkContainer container)
        {
            var expendLayout = new TreeNode(false, LocaleText.UserInfo)
                               .AddTo(this);

            var verticalLyaout = new VerticalLayout("box");

            expendLayout.Add2Spread(verticalLyaout);

            AccountModel.Subject
            .StartWith(AccountModel.State)
            .Subscribe(state =>
            {
                verticalLyaout.Clear();

                if (state.Logined)
                {
                    new ButtonView("注销", () =>
                    {
                        AccountModel.Effects.Logout();
                    }).AddTo(verticalLyaout);
                }
                else
                {
                    if (state.InLoginView)
                    {
                        new LoginView().AddTo(verticalLyaout);
                    }
                    else
                    {
                        new RegisterView().AddTo(verticalLyaout);
                    }
                }
            });
        }
Exemple #2
0
        public void Init(IQFrameworkContainer container)
        {
            var frameworkData    = mPackageDatas.Find(packageData => packageData.Name == "Framework");
            var frameworkVersion = string.Format("QFramework:{0}", frameworkData.Version);

            mEGORootLayout = new VerticalLayout();


            var frameworkInfoLayout = new HorizontalLayout("box")
                                      .AddTo(mEGORootLayout);

            new EGO.Framework.LabelView(frameworkVersion)
            .Width(150)
            .FontBold()
            .FontSize(12)
            .AddTo(frameworkInfoLayout);

            new ToggleView(LocaleText.VersionCheck, VersionCheck)
//                .FontSize(12)
//                .FontBold()
            .AddTo(frameworkInfoLayout)
            .Toggle.Bind(newValue => VersionCheck = newValue);

            new ToolbarView(ToolbarIndex)
            .Menus(ToolbarNames.ToList())
            .AddTo(mEGORootLayout)
            .Index.Bind(newIndex => ToolbarIndex = newIndex);


            new HeaderView()
            .AddTo(mEGORootLayout);

            var packageList = new VerticalLayout("box")
                              .AddTo(mEGORootLayout);

            var scroll = new ScrollLayout()
                         .Height(240)
                         .AddTo(packageList);

            new EGO.Framework.SpaceView(2).AddTo(scroll);

            mOnToolbarIndexChanged = () =>
            {
                scroll.Clear();

                foreach (var packageData in SelectedPackageType)
                {
                    new EGO.Framework.SpaceView(2).AddTo(scroll);
                    new PackageView(packageData).AddTo(scroll);
                }
            };

            foreach (var packageData in SelectedPackageType)
            {
                new EGO.Framework.SpaceView(2).AddTo(scroll);
                new PackageView(packageData).AddTo(scroll);
            }
        }
        public void Init(IQFrameworkContainer container)
        {
            PackageKitModel.Subject
            .StartWith(PackageKitModel.State)
            .Subscribe(state =>
            {
//                    var frameworkData = PackageInfosRequestCache.Get().PackageDatas.Find(packageData => packageData.Name == "Framework");
//                    var frameworkVersion = string.Format("QFramework:{0}", frameworkData.Version);

                mRootLayout = new VerticalLayout();

                var treeNode = new TreeNode(true, LocaleText.FrameworkPackages).AddTo(mRootLayout);


                var verticalLayout = new VerticalLayout("box");


                treeNode.Add2Spread(verticalLayout);

//                    var frameworkInfoLayout = new HorizontalLayout("box")
//                        .AddTo(mEGORootLayout);

//                    new EGO.Framework.LabelView(frameworkVersion)
//                        .Width(150)
//                        .FontBold()
//                        .FontSize(12)
//                        .AddTo(frameworkInfoLayout);

//                    new ToggleView(LocaleText.VersionCheck, state.VersionCheck)
//                        .AddTo(frameworkInfoLayout)
//                        .Toggle
//                        .Bind(newValue => state.VersionCheck = newValue);

                new ToolbarView(ToolbarIndex)
                .Menus(ToolbarNames.ToList())
                .AddTo(verticalLayout)
                .Index.Bind(newIndex => ToolbarIndex = newIndex);


                new HeaderView()
                .AddTo(verticalLayout);

                var packageList = new VerticalLayout("box")
                                  .AddTo(verticalLayout);

                var scroll = new ScrollLayout()
                             .Height(240)
                             .AddTo(packageList);

                new EGO.Framework.SpaceView(2).AddTo(scroll);

                mOnToolbarIndexChanged = () =>
                {
                    scroll.Clear();

                    foreach (var packageData in SelectedPackageType(state.PackageDatas))
                    {
                        new EGO.Framework.SpaceView(2).AddTo(scroll);
                        new PackageView(packageData).AddTo(scroll);
                    }
                };

                foreach (var packageData in SelectedPackageType(state.PackageDatas))
                {
                    new EGO.Framework.SpaceView(2).AddTo(scroll);
                    new PackageView(packageData).AddTo(scroll);
                }
            });
        }