Beispiel #1
0
        public static PlayingCard Create(Card card)
        {
            var cardView = (PlayingCard)Nib.Instantiate(null, null).First();

            cardView.Layer.BorderWidth  = 1;
            cardView.Layer.CornerRadius = 5;
            cardView.Layer.BorderColor  = UIColor.Black.CGColor;

            cardView.CardSuitImage.Image       = GetcardSuit(card);
            cardView.CardValueTop.Text         = GetCardValue(card);
            cardView.CardValueBottom.Text      = GetCardValue(card);
            cardView.CardBackgroundImage.Image = null;

            return(cardView);
        }
        public static LocationChooserViewCell Create()
        {
            var cell = (LocationChooserViewCell)Nib.Instantiate(null, null)[0];

            cell.TitelLabel.SetFont();
            return(cell);
        }
Beispiel #3
0
        public static PriceTileErrorViewCell Create()
        {
            PriceTileErrorViewCell created = (PriceTileErrorViewCell)Nib.Instantiate(null, null) [0];

            created.ContentView.BackgroundColor = Styles.RTFailRed;
            return(created);
        }
Beispiel #4
0
        public static NativeiOSMessageCell Create(ChatMessage chatMessage, NSObject owner)
        {
            var cell = Nib.Instantiate(owner, null).First() as NativeiOSMessageCell;

            cell.ChatCell = chatMessage;
            return(cell);
        }
Beispiel #5
0
        public static PriceTileViewCell Create()
        {
            PriceTileViewCell created = (PriceTileViewCell)Nib.Instantiate(null, null) [0];

            created.ContentView.BackgroundColor = Styles.RTDarkerBlue;

            created.Notional.Delegate = new NotionalTextFieldDelegate(created);

            var numberToolbar = new UIToolbar(new RectangleF(0.0f, 0.0f, (float)created.Frame.Size.Width, 40.0f));

            numberToolbar.Items = new UIBarButtonItem[] {
                new UIBarButtonItem("Cancel", UIBarButtonItemStyle.Bordered, created, new ObjCRuntime.Selector("CancelNumberPad")),
                new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace),
                new UIBarButtonItem(UIBarButtonSystemItem.Done, created, new ObjCRuntime.Selector("DoneNumberPad"))
            };

            created.Notional.InputAccessoryView = numberToolbar;

            //
            // TODO: Reinstate change of notional currency once data model / back end support this.
            // For now we just disable the button (not that some relevant implementation of the button click remains).
            //

            created.NotionalCCY.UserInteractionEnabled = false;


            UserModel.Instance.OnChanged
            .Subscribe(created.OnUserModelChanged);
            created.DecorateWithTradingEnabled(UserModel.Instance.OneTouchTradingEnabled);

            return(created);
        }
        public static NodeViewCellDetail Create(IListNode nodeView)
        {
            var view = (NodeViewCellDetail)Nib.Instantiate(null, null)[0];

            view._nodeView = nodeView;
            return(view);
        }
Beispiel #7
0
        public static BaseItemView Create(CGRect frame, NodeViewController nodeViewController, TreeNode node, UIColor kleur)
        {
            var view = (BaseItemView)Nib.Instantiate(null, null) [0];

            view.Frame    = frame;
            view.Node     = node;
            view.NodePath = node.Path;
            view.SetShadow();

            view.TerugButton.TouchUpInside += delegate
            {
                nodeViewController.PopView();
            };

            view.TitelLabel.Text = node.Name;
            view.TitelLabel.SetFont();
            view.FullScreenButton.TouchUpInside += delegate {
                nodeViewController.ToggleFullScreen();
            };

            if (kleur != null)
            {
                view.kleurenBalk.BackgroundColor = kleur;
            }
            view.HideBackButton();
            return(view);
        }
Beispiel #8
0
        public static RepositoryCellView Create(bool fakeCell = false)
        {
            var cell = Nib.Instantiate(null, null).GetValue(0) as RepositoryCellView;

            cell._fakeCell = fakeCell;
            return(cell);
        }
        public static MenuViewCellTop Create()
        {
            var view = (MenuViewCellTop)Nib.Instantiate(null, null)[0];

            view.TitelLabel.SetFont();
            return(view);
        }
Beispiel #10
0
 public ListSettingsView(IntPtr handle) : base(handle)
 {
     ContentView                  = (UIView)Nib.Instantiate(this, null)[0];
     ContentView.Frame            = Bounds;
     ContentView.AutoresizingMask = UIViewAutoresizing.FlexibleDimensions;
     Add(ContentView);
 }
Beispiel #11
0
        public static TimelineView Create(TimelineViewModel viewModel)
        {
            TimelineView view = Nib.Instantiate(null, null)[0] as TimelineView;

            view.SetViewModel(viewModel);
            return(view);
        }
Beispiel #12
0
        public static NewsCellView Create()
        {
            var linkAttributes = new NSMutableDictionary();

            linkAttributes.Add(UIStringAttributeKey.UnderlineStyle, NSNumber.FromBoolean(true));

            var cell = (NewsCellView)Nib.Instantiate(null, null)[0];

            cell.SeparatorInset            = new UIEdgeInsets(0, 48f, 0, 0);
            cell.Body.LinkAttributes       = new NSDictionary();
            cell.Body.ActiveLinkAttributes = linkAttributes;
            cell.Body.Lines         = 4;
            cell.Body.LineBreakMode = UILineBreakMode.TailTruncation;

            cell.Header.LinkAttributes       = new NSDictionary();
            cell.Header.ActiveLinkAttributes = linkAttributes;
            cell.Header.Lines         = 2;
            cell.Header.LineBreakMode = UILineBreakMode.TailTruncation;

            cell.Image.Layer.MasksToBounds = true;
            cell.Image.Layer.CornerRadius  = cell.Image.Frame.Height / 2;

            cell.ActionImage.TintColor = cell.Time.TextColor;

            return(cell);
        }
Beispiel #13
0
        public static NodeViewCellDefault Create()
        {
            var view = (NodeViewCellDefault)Nib.Instantiate(null, null)[0];

            view.TitelLabel.SetFont();
            return(view);
        }
Beispiel #14
0
 public static MultilinedCellView Create()
 {
     var cell = (MultilinedCellView)Nib.Instantiate(null, null)[0];
     cell.CaptionLabel.TextColor = Theme.CurrentTheme.MainTextColor;
     cell.DetailsLabel.TextColor = Theme.CurrentTheme.MainTextColor;
     return cell;
 }
Beispiel #15
0
        public static NewsCellView Create(bool isFakeCell = false)
        {
            var cell = Nib.Instantiate(null, null).GetValue(0) as NewsCellView;

            cell._isFakeCell = isFakeCell;
            return(cell);
        }
Beispiel #16
0
        public static CustomImageTableCell Create(GalleryView BaseView2, GalleryDataModel GelenDTO)
        {
            var OlusanView = (CustomImageTableCell)Nib.Instantiate(null, null)[0];

            OlusanView.BaseView = BaseView2;
            OlusanView.GelenDTO = GelenDTO;
            return(OlusanView);
        }
Beispiel #17
0
        public static BuptisGoldCustomSlideItem Create(string imagee, string aciklama)
        {
            var OlusanView = (BuptisGoldCustomSlideItem)Nib.Instantiate(null, null)[0];

            OlusanView.SlideImage.Image = UIImage.FromBundle("Images/" + imagee);
            OlusanView.SlideMetin.Text  = aciklama;
            return(OlusanView);
        }
Beispiel #18
0
        public static MenuFooterViewCell Create()
        {
            var view = (MenuFooterViewCell)Nib.Instantiate(null, null)[0];

            view.BackgroundColor = UIColor.Clear;
            view.TitelLabel.SetFont();
            return(view);
        }
Beispiel #19
0
        public static GistDetailViewCell Create()
        {
            var cell = (GistDetailViewCell)Nib.Instantiate(null, null)[0];

            cell.MainImage.Layer.ShadowColor   = UIColor.DarkGray.CGColor;
            cell.MainImage.Layer.ShadowOffset  = new SizeF(0, 0);
            cell.MainImage.Layer.ShadowOpacity = 0.7f;
            return(cell);
        }
Beispiel #20
0
 public void FromName()
 {
     using (UINib n = UINib.FromName("EmptyNib", null)) {
         Assert.NotNull(n, "created with null options");
         // newer version (same selector)
         var result2 = n.Instantiate(null, null);
         Assert.That(result2.Length, Is.EqualTo(0), "Instantiate");
     }
 }
Beispiel #21
0
        public static RepositoryTableViewCell Create()
        {
            var cell = (RepositoryTableViewCell)Nib.Instantiate(null, null)[0];

            cell.RepositoryImageView.Layer.MasksToBounds = true;
            cell.RepositoryImageView.Layer.CornerRadius  = cell.RepositoryImageView.Frame.Height / 2f;
            cell.SeparatorInset = new UIEdgeInsets(0, cell.TitleLabel.Frame.Left, 0, 0);
            return(cell);
        }
Beispiel #22
0
        public static HediyelerCustomListItem Create(HediyeGonderVC BaseView2, HediyelerDataModel GelenDTO)
        {
            var OlusanView = (HediyelerCustomListItem)Nib.Instantiate(null, null)[0];

            OlusanView.BaseView = BaseView2;
            OlusanView.GelenDTO = GelenDTO;
            OlusanView.HediyeImageView.ContentMode = UIViewContentMode.ScaleAspectFit;
            return(OlusanView);
        }
        public static MenuViewCell Create()
        {
            var cell = (MenuViewCell)Nib.Instantiate(null, null)[0];

            cell.BackgroundColor = UIColor.Clear;
            cell.TitelLabel.SetFont();
            cell.Editing = true; // Make the cell deletable
            cell.ShouldIndentWhileEditing = true;
            return(cell);
        }
Beispiel #24
0
        public static GistCellView Create()
        {
            var cell = (GistCellView)Nib.Instantiate(null, null)[0];

            cell.MainImageView.Layer.MasksToBounds = true;
            cell.MainImageView.Layer.CornerRadius  = cell.MainImageView.Frame.Height / 2f;
            cell.SeparatorInset         = new UIEdgeInsets(0, cell.TitleLabel.Frame.Left, 0, 0);
            cell.TitleLabel.TextColor   = UIColor.FromRGB(0, 64, 128);
            cell.TimeLabel.TextColor    = UIColor.Gray;
            cell.ContentLabel.TextColor = UIColor.FromRGB(41, 41, 41);
            return(cell);
        }
        public static MenuViewCellDetail Create()
        {
            var view = (MenuViewCellDetail)Nib.Instantiate(null, null)[0];

            view.VerwijderButton.TouchUpInside += (object sender, EventArgs e) => {
                if (view.DeleteButtonPressed != null)
                {
                    view.DeleteButtonPressed();
                }
            };

            return(view);
        }
Beispiel #26
0
        public static NewsCellView Create()
        {
            var cell = (NewsCellView)Nib.Instantiate(null, null)[0];

            cell.SeparatorInset            = EdgeInsets;
            cell.Body.LinkAttributes       = new NSDictionary();
            cell.Body.ActiveLinkAttributes = new NSMutableDictionary();
            cell.Body.ActiveLinkAttributes[MonoTouch.CoreText.CTStringAttributeKey.UnderlineStyle] = NSNumber.FromBoolean(true);
            cell.Body.Lines         = 0;
            cell.Body.LineBreakMode = UILineBreakMode.TailTruncation;

            cell.Header.LinkAttributes       = new NSDictionary();
            cell.Header.ActiveLinkAttributes = new NSMutableDictionary();
            cell.Header.ActiveLinkAttributes[MonoTouch.CoreText.CTStringAttributeKey.UnderlineStyle] = NSNumber.FromBoolean(true);
            cell.Header.Lines         = 2;
            cell.Header.LineBreakMode = UILineBreakMode.TailTruncation;

            // Special for large fonts
            if (Theme.CurrentTheme.FontSizeRatio > 1.0f)
            {
                cell.Header.Font = HeaderFont;
                cell.Body.Font   = BodyFont;
                cell.Time.Font   = TimeFont;

                var timeSectionheight = (float)Math.Ceiling(TimeFont.LineHeight);
                var timeFrame         = cell.Time.Frame;
                timeFrame.Height = timeSectionheight;
                cell.Time.Frame  = timeFrame;

                var imageFrame = cell.ActionImage.Frame;
                imageFrame.Y          += (timeFrame.Height - imageFrame.Height) / 2f;
                cell.ActionImage.Frame = imageFrame;

                var headerSectionheight = (float)Math.Ceiling(TimeFont.LineHeight);
                var headerFrame         = cell.Header.Frame;
                headerFrame.Height = headerSectionheight * 2f + (float)Math.Ceiling(3f * Theme.CurrentTheme.FontSizeRatio);
                headerFrame.Y      = 6 + timeFrame.Height + 5f;
                cell.Header.Frame  = headerFrame;

                var picFrame = cell.Image.Frame;
                picFrame.Y       = 6 + timeFrame.Height + 5f;
                picFrame.Y      += (headerFrame.Height - picFrame.Height) / 2f;
                cell.Image.Frame = picFrame;

                var bodyFrame = cell.Body.Frame;
                bodyFrame.Y     = headerFrame.Y + headerFrame.Height + 4f;
                cell.Body.Frame = bodyFrame;
            }

            return(cell);
        }
Beispiel #27
0
        public void FromName()
        {
            using (UINib n = UINib.FromName("EmptyNib", null)) {
                Assert.NotNull(n, "created with null options");
#if !XAMCORE_2_0
                // obsolete name (too long and case typo)
                var result = n.InstantiateWithOwneroptions(null, null);
                Assert.That(result.Length, Is.EqualTo(0), "InstantiateWithOwneroptions");
#endif
                // newer version (same selector)
                var result2 = n.Instantiate(null, null);
                Assert.That(result2.Length, Is.EqualTo(0), "Instantiate");
            }
        }
Beispiel #28
0
        public static RepositoryCellView Create()
        {
            var cell = (RepositoryCellView)Nib.Instantiate(null, null)[0];

            cell.CaptionLabel.TextColor = Theme.CurrentTheme.MainTitleColor;
            cell.ContentLabel.TextColor = Theme.CurrentTheme.MainTextColor;

            cell.FollowersImageVIew.Image = Theme.CurrentTheme.RepositoryCellFollowers;
            cell.ForksImageView.Image     = Theme.CurrentTheme.RepositoryCellForks;
            cell.UserImageView.Image      = Theme.CurrentTheme.RepositoryCellUser;

            cell.OwnerImageView.Layer.MasksToBounds = true;
            cell.OwnerImageView.Layer.CornerRadius  = cell.OwnerImageView.Bounds.Height / 2f;

            //Create the icons
            return(cell);
        }
Beispiel #29
0
        public static NewsCellView Create()
        {
            var cell = (NewsCellView)Nib.Instantiate(null, null)[0];

            cell.Body.SetUnderlineLinks(false);
            cell.Body.LinkColor = CodeFramework.iOS.Elements.NewsFeedElement.LinkColor;
            cell.Header.SetUnderlineLinks(false);
            cell.Header.LinkColor = CodeFramework.iOS.Elements.NewsFeedElement.LinkColor;
            cell.SeparatorInset   = EdgeInsets;

            // Special for large fonts
            if (Theme.CurrentTheme.FontSizeRatio > 1.0f)
            {
                cell.Header.Font = HeaderFont;
                cell.Body.Font   = BodyFont;
                cell.Time.Font   = TimeFont;

                var timeSectionheight = (float)Math.Ceiling(TimeFont.LineHeight);
                var timeFrame         = cell.Time.Frame;
                timeFrame.Height = timeSectionheight;
                cell.Time.Frame  = timeFrame;

                var imageFrame = cell.ActionImage.Frame;
                imageFrame.Y          += (timeFrame.Height - imageFrame.Height) / 2f;
                cell.ActionImage.Frame = imageFrame;

                var headerSectionheight = (float)Math.Ceiling(TimeFont.LineHeight);
                var headerFrame         = cell.Header.Frame;
                headerFrame.Height = headerSectionheight * 2f + (float)Math.Ceiling(3f * Theme.CurrentTheme.FontSizeRatio);
                headerFrame.Y      = 6 + timeFrame.Height + 5f;
                cell.Header.Frame  = headerFrame;

                var picFrame = cell.Image.Frame;
                picFrame.Y       = 6 + timeFrame.Height + 5f;
                picFrame.Y      += (headerFrame.Height - picFrame.Height) / 2f;
                cell.Image.Frame = picFrame;

                var bodyFrame = cell.Body.Frame;
                bodyFrame.Y     = headerFrame.Y + headerFrame.Height + 4f;
                cell.Body.Frame = bodyFrame;
            }

            //cell.Header.CenterVertically = true;
            return(cell);
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            UINib nib = null;

            if (_cellMap.TryGetValue(typeof(TThing), out nib))
            {
                // Register the collection view cell
                collectionView.RegisterNibForCell(nib, "Cell");

                NSObject[] views = nib.Instantiate(null, null);
                _prototypeCell = (IThingCell)views.First <NSObject>();
            }

            // Add a + button to the navigation bar
            NavigationItem.SetRightBarButtonItem(
                new UIBarButtonItem(UIBarButtonSystemItem.Add,
                                    (sender, args) =>
            {
                AddButtonPressed();
            }),
                false);
        }