예제 #1
0
        public ImageSettingsControl()
        {
            _lblCaption = new TextElement("<image parameter>")
                {
                    Size = new Size(SettingsConsts.MaxWidth, 50),
                };
            AddElement(_lblCaption);

            _pictureBox = new SettingsImageElement(new Bitmap(1, 1))
                {
                  Size = new Size(SettingsConsts.MaxWidth, 175),
                };
            AddElement(_pictureBox);

            AddElement(new Canvas { Size = new Size(SettingsConsts.MaxWidth, 10), });

            var buttonPanel = new Canvas { Size = new Size(SettingsConsts.MaxWidth, 50), };
            AddElement(buttonPanel);

            var buttonSelectImage = new Fleux.UIElements.Button("select".Localize())
                {
                    Size = new Size(SettingsConsts.MaxWidth / 2 - 10, 50),
                    Location = new Point(0, 0),
                    TapHandler = p => ButtonSelectBgClick(),
                };
            buttonPanel.AddElement(buttonSelectImage);

            var buttonClearImage = new Fleux.UIElements.Button("clear".Localize())
               {
                   Size = new Size(SettingsConsts.MaxWidth / 2 - 10, 50),
                   Location = new Point(SettingsConsts.MaxWidth / 2 + 10, 0),
                   TapHandler = p => { Value = ""; return true; },
               };
            buttonPanel.AddElement(buttonClearImage);
        }
예제 #2
0
 public Tile(string tileName, Image icon, int x, int y, bool wide)
 {
     this.Size = new Size(wide ? 358 : 173, 173);
     this.Location = new Point(x, y);
     m_Icon = new ImageElement(icon);
     //m_Icon.Location = new Point((this.Size.Width - m_Icon.Size.Width) / 2, (this.Size.Height - m_Icon.Size.Height) / 2);
     m_Icon.Location = new Point(0, 0);
     m_Text = new TextElement(tileName) { Style = MetroTheme.TileTextStyle, Location = new Point(13, 140) };
 }
예제 #3
0
 public ImageButton(Image image)
 {
     m_image = new ImageElement(image);
     this.Size = image.Size;
 }
예제 #4
0
 private ImageElement CreateTile(string name, int x, int y, bool wide)
 {
     var image = new ImageElement(ResourceManager.Instance.GetBitmapFromEmbeddedResource(string.Format("{0}.png", name)))
     {
         Location = new Point(x, y),
         Size = new Size(wide ? 358 : 173, 173),
     };
     this.SetEntranceAnimationFromLeft(image);
     return image;
 }
예제 #5
0
        private void SetContact(Contact value)
        {
            if (value == null) return;

            ScreenRoutines.CursorWait();
            try
            {
                _contact = value;

                // write contact's name as title
                title1.Text = string.Format("{0} {1}", _contact.FirstName, _contact.LastName).ToUpper();

                _stackPanel.Clear();

                // contact's picture
                if (_contact.Picture != null)
                {
                    var img = new ImageElement(_contact.Picture) { Size = new Size(180, 180), };
                    _stackPanel.AddElement(img);
                    _stackPanel.AddElement(new DelegateUIElement { Size = new Size(10, PaddingVer), });
                }

                // call mobile
                AddCallPanel(_stackPanel, str_Mobile.Localize(), _contact.MobileTelephoneNumber);

                // call home
                AddCallPanel(_stackPanel, str_Home.Localize(), _contact.HomeTelephoneNumber);

                // call work
                AddCallPanel(_stackPanel, str_Work.Localize(), _contact.BusinessTelephoneNumber);

                // send sms to mobile
                if (!string.IsNullOrEmpty(_contact.MobileTelephoneNumber))
                {
                    _stackPanel.AddElement(new TextElement(str_Text.Localize())
                    {
                        Style = _titleStyle,
                        AutoSizeMode = TextElement.AutoSizeModeOptions.OneLineAutoHeight,
                        TapHandler = p => SendSMS(_contact.MobileTelephoneNumber),
                    });
                    _stackPanel.AddElement(new TextElement(str_SMS.Localize())
                    {
                        Style = _subTitleStyle,
                        AutoSizeMode = TextElement.AutoSizeModeOptions.OneLineAutoHeight,
                        TapHandler = p => SendSMS(_contact.MobileTelephoneNumber),
                    });
                    _stackPanel.AddElement(new DelegateUIElement { Size = new Size(10, PaddingVer), });
                }

                // send email to mobile
                if (!string.IsNullOrEmpty(_contact.Email1Address))
                {
                    _stackPanel.AddElement(new TextElement(str_SendEmail.Localize())
                    {
                        Style = _titleStyle,
                        AutoSizeMode = TextElement.AutoSizeModeOptions.OneLineAutoHeight,
                        TapHandler = p => SendEmail(_contact.Email1Address),
                    });
                    _stackPanel.AddElement(new TextElement(_contact.Email1Address)
                    {
                        Style = _subTitleStyle,
                        AutoSizeMode = TextElement.AutoSizeModeOptions.OneLineAutoHeight,
                        TapHandler = p => SendEmail(_contact.Email1Address),
                    });
                    _stackPanel.AddElement(new DelegateUIElement { Size = new Size(10, PaddingVer), });
                }
            }
            finally
            {
                ScreenRoutines.CursorNormal();
            }
        }
예제 #6
0
파일: HomePage.cs 프로젝트: cail/hobd
        private PanoramaSection CreateHorizontalFeaturedSection()
        {
            var img1 = ResourceManager.Instance.GetBitmapFromEmbeddedResource("thumbnail.png");
            var img2 = ResourceManager.Instance.GetBitmapFromEmbeddedResource("squareimg.png");
            var img3 = ResourceManager.Instance.GetBitmapFromEmbeddedResource("thumbnail2.png");
            var img4 = ResourceManager.Instance.GetBitmapFromEmbeddedResource("thumbnail3.png");
            var imageSize = new Size(190, 150);

            var grid = new Grid
            {
                Columns = new MeasureDefinition[] { 200, 200, 200, 200 },
                Rows = new MeasureDefinition[] { 160, 160 }
            };

            grid[0, 0] = new ImageElement(img1) { Size = imageSize };
            grid[0, 1] = new ImageElement(img2) { Size = imageSize };
            grid[0, 2] = new ImageElement(img3) { Size = imageSize };
            grid[0, 3] = new ImageElement(img4) { Size = imageSize };
            grid[1, 0] = new ImageElement(img3) { Size = imageSize };
            grid[1, 1] = new ImageElement(img4) { Size = imageSize };
            grid[1, 2] = new ImageElement(img1) { Size = imageSize };
            grid[1, 3] = new ImageElement(img2) { Size = imageSize };

            var section = new PanoramaSection("features");
            section.AddElement(grid);
            //, 0, 0, 480, 320
            return section;
        }
예제 #7
0
파일: HomePage.cs 프로젝트: cail/hobd
        private PanoramaSection CreateFeaturedSection()
        {
            var img1 = ResourceManager.Instance.GetBitmapFromEmbeddedResource("thumbnail.png");
            var img2 = ResourceManager.Instance.GetBitmapFromEmbeddedResource("squareimg.png");
            var img3 = ResourceManager.Instance.GetBitmapFromEmbeddedResource("thumbnail2.png");

            var titleStyle = new TextStyle(HOBD.theme.PhoneFontFamilySemiBold, HOBD.theme.PhoneFontSizeLarge, Color.White);
            var subtitleStyle = HOBD.theme.PhoneTextBlockBase;
            var moreStyle = new TextStyle(HOBD.theme.PhoneTextLargeStyle.FontFamily, HOBD.theme.PhoneFontSizeMediumLarge, HOBD.theme.PanoramaNormalBrush);

            var section = new PanoramaSection("small");

            var grid = new Grid
            {
                Columns = new MeasureDefinition[] { 120, 180 },
                Rows = new MeasureDefinition[] { 70, 50, 70, 50, 70, 50, 75 }
            };

            grid[0, 0] = new ImageElement(img1) { Size = new Size(100, 100) };
            grid[0, 1] = new DynamicElement("ONE") { Style = titleStyle };
            grid[1, 1] = new DynamicElement("LOREM IPSUM LOREM") { Style = subtitleStyle };

            grid[2, 0] = new ImageElement(img2) { Size = new Size(100, 100) };
            grid[2, 1] = new DynamicElement("TWO") { Style = titleStyle };
            grid[3, 1] = new DynamicElement("LOREM IPSUM LOREM") { Style = subtitleStyle };

            grid[4, 0] = new ImageElement(img3) { Size = new Size(100, 100) };
            grid[4, 1] = new DynamicElement("THREE") { Style = titleStyle };
            grid[5, 1] = new DynamicElement("LOREM IPSUM LOREM") { Style = subtitleStyle };

            grid[6, 1] = new TextElement("more") { Style = moreStyle };

            section.AddElement(grid);
            // , 0, 0, 300, 700

            return section;
        }