コード例 #1
0
        public override UIKit.UITableViewCell GetCell(UIKit.UITableView tv)
        {
            Value = Provider?.Email ?? "";
            if (string.IsNullOrWhiteSpace(Value))
            {
                Caption = string.Format(Strings.SignInToService, ApiManager.Shared.DisplayName(ServiceType));
            }
            else
            {
                Caption = Strings.Logout;
            }

            var cell = base.GetCell(tv);

            cell.ImageView.LoadSvg(ApiManager.Shared.GetSvg(ServiceType), new NGraphics.Size(30, 30));


            cell.StyleAsMenuElement();
            var style = tv.GetStyle();

            cell.TextLabel.TextColor = style.MainTextColor;
            if (cell.DetailTextLabel != null)
            {
                cell.DetailTextLabel.TextAlignment = UIKit.UITextAlignment.Center;
                cell.DetailTextLabel.TextColor     = style.SubTextColor;
            }
            cell.TextLabel.TextAlignment = UIKit.UITextAlignment.Center;
            return(cell);
        }
コード例 #2
0
ファイル: AccountCell.cs プロジェクト: xjpeter/gMusic
        public override UIKit.UITableViewCell GetCell(UIKit.UITableView tv)
        {
            var email = ApiManager.Shared.GetAccount(ServiceType);

            if (string.IsNullOrWhiteSpace(email))
            {
                Caption = $"Sign in to {ApiManager.Shared.DisplayName(ServiceType)}";
            }
            else
            {
                Caption = "Logout";
                Value   = email;
            }

            var cell = base.GetCell(tv);

            cell.ImageView.LoadSvg(ApiManager.Shared.GetSvg(ServiceType), new NGraphics.Size(30, 30));


            cell.StyleAsMenuElement();
            var style = tv.GetStyle();

            cell.TextLabel.TextColor = style.MainTextColor;
            if (cell.DetailTextLabel != null)
            {
                cell.DetailTextLabel.TextAlignment = UIKit.UITextAlignment.Center;
                cell.DetailTextLabel.TextColor     = style.SubTextColor;
            }
            cell.TextLabel.TextAlignment = UIKit.UITextAlignment.Center;
            return(cell);
        }