Esempio n. 1
0
        private void CreateVisual()
        {
            _background = new ScaledBackground(Settings.Background);
            AddElement(_background);

            this.AddElement(_topBar = new ScreenTopBar(new Size(ScreenConsts.ScreenWidth.ToLogic(), topbarHeight), true)
            {
                Location = new Point(0,0),
            });

            this.AddElement(_mediaPlayer = new ScreenMedia(new Size(ScreenConsts.ScreenWidth.ToLogic(), 150), true)
            {
                Location = new Point(0,topbarHeight),
            });

            this.AddElement(_statusPhone = new ScreenStatus(new Size(ScreenConsts.ScreenWidth.ToLogic(), 80), true)
            {
                Location = new Point(0, this.Size.Height - 80 - bottomOffset),
            });

            this.AddElement(_appointment = new ScreenAppointment(new Size(ScreenConsts.ScreenWidth.ToLogic(), 10), true)
            {
                Location = new Point(0, this._statusPhone.Location.Y),
            });
            _appointment.Location = new Point(0, this._statusPhone.Location.Y - _appointment.Size.Height);

            var lineHeight = FleuxApplication.DummyDrawingGraphics.Style(_style).CalculateMultilineTextHeight("0", 100);

            this.AddElement(_lblClock = new TextElement(GetText())
            {
                Style = _style,
                AutoSizeMode = TextElement.AutoSizeModeOptions.None,
                Size = new Size(ScreenConsts.ScreenWidth.ToLogic() - leftOffset - rightOffset, lineHeight * 3),
                Location = new Point(leftOffset, _appointment.Location.Y - bottomOffset - lineHeight * 3),
            });

            this.TapHandler = OnTap;
            _topBar.Active();
            _mediaPlayer.Active();
            UpdateTime();
            _appointment.Active();
            _statusPhone.Active();

            var messenger = TinyIoCContainer.Current.Resolve<ITinyMessengerHub>();
            messenger.Subscribe<FullScreenMessage>(OnFullScreen);
        }
Esempio n. 2
0
        public HubPage(string folderGuid)
            : base(false)
        {
            _folderGuid = folderGuid;

            ScreenRoutines.CursorWait();
            try
            {
                theForm.Menu = null;

                Control.ShadowedAnimationMode = FleuxControl.ShadowedAnimationOptions.FromRight;

                _background = new ScaledBackground("") { Size = this.Size.ToPixels() };
                Control.AddElement(_background);

                Content = new Canvas
                {
                    Size = new Size(this.Size.Width, this.Size.Height),
                    Location = new Point(0, 0)
                };
                Control.AddElement(Content);

                _appBar = new ApplicationBar
                {
                    Size = new Size(Content.Size.Width, AppBarHeight),
                    Location = new Point(0, Content.Size.Height - AppBarHeight)
                };
                _appBar.ButtonTap += OnAppBarButtonTap;
                _appBar.AddButton(ResourceManager.Instance.GetBitmapFromEmbeddedResource(
                    (MetroTheme.PhoneBackgroundBrush == Color.White) ?
                        "FolderWidget.Images.back-light.bmp" : "FolderWidget.Images.back-dark.bmp"
                    ));
                Content.AddElement(_appBar.AnimateHorizontalEntrance(false));

                _title = new TextElement("Folder hub")
                {
                    Style = MetroTheme.PhoneTextTitle1Style,
                    Location = new Point(24 - 3, 5), // -3 is a correction for Segoe fonts
                    AutoSizeMode = TextElement.AutoSizeModeOptions.OneLineAutoHeight,
                };
                _title.ResizeForWidth(Content.Size.Width);
                Content.AddElement(_title);

                _tileGrid = new HubPageTileGrid(new TileThemeWP7() { TilesPaddingTop = 0 },
                    _background, "", 4, 100)
                                {
                                    OnReadSettings = ReadSettings,
                                    OnWriteSettings = WriteSettings,
                                    OnShowMainSettings = ShowHubSettings,
                                };
                SetTilesLocation(_title.Bounds.Bottom + 50);
                Content.AddElement(_tileGrid);

                ReadSettings();

            }
            finally
            {
                ScreenRoutines.CursorNormal();
            }
        }
Esempio n. 3
0
        private void CreateVisual()
        {
            _background = new ScaledBackground(Settings.Background);
            AddElement(_background);

            const int leftOffset = 20;
            const int rightOffset = 10;

            var lineHeight = FleuxApplication.DummyDrawingGraphics.Style(_style).CalculateMultilineTextHeight("0", 100);

            _lblClock = new TextElement(GetText())
                            {
                                Style = _style,
                                AutoSizeMode = TextElement.AutoSizeModeOptions.None,
                                Size = new Size(ScreenConsts.ScreenWidth.ToLogic() - leftOffset - rightOffset, lineHeight * 4),
                                Location = new Point(leftOffset, ScreenConsts.ScreenHeight.ToLogic() - lineHeight * 4),
                            };
            AddElement(_lblClock);

            this.TapHandler = OnTap;
        }