protected void BlogPostRepeater_OnItemDataBound(object sender, RepeaterItemEventArgs e) { var post = (BlogPost)e.Item.DataItem; FollowButton follBtn = (FollowButton)e.Item.FindControl("follBtn"); follBtn.LoadState(post.ContentId, UnderstoodDotOrg.Common.Constants.TelligentContentType.BlogPost, post.ContentTypeId); }
void ReleaseDesignerOutlets() { if (UserImageView != null) { UserImageView.Dispose(); UserImageView = null; } if (UserTagLabel != null) { UserTagLabel.Dispose(); UserTagLabel = null; } if (UsernameLabel != null) { UsernameLabel.Dispose(); UsernameLabel = null; } if (FollowButton != null) { FollowButton.Dispose(); FollowButton = null; } }
private void Page_Load(object sender, EventArgs e) { wikiId = Request.QueryString["wikiId"]; wikiPageId = Request.QueryString["wikiPageId"]; contentId = Request.QueryString["contentId"]; Item currItem = Sitecore.Context.Item; // UnderstoodDotOrg.Services.Models.Telligent.Question question = TelligentService.GetQuestion(wikiId, wikiPageId, contentId); UnderstoodDotOrg.Services.Models.Telligent.Question question = Questions.GetQuestion(wikiId, wikiPageId, contentId); QuestionTitleLabel.Text = question.Title; QuestionBodyLabel.Text = question.Body; GroupLabel.Text = question.Group; AuthorLabel.Text = question.Author; hypAuthorLink.NavigateUrl = MembershipHelper.GetPublicProfileUrl(question.Author); DateLabel.Text = question.PublishedDate; //HtmlAnchor hrefTopicUrl = e.FindControlAs<HtmlAnchor>("hrefTopicUrl"); if (hrefTopicUrl != null) { Item parentItem = Sitecore.Context.Item.Parent; hrefTopicUrl.HRef = parentItem.GetUrl() + "?topic=" + HttpUtility.UrlEncode(question.Group); } SubmitButton.Text = UnderstoodDotOrg.Common.DictionaryConstants.SubmitAnswerLabel; FollowButton.LoadState(question.ContentId, Constants.TelligentContentType.Weblog, question.ContentTypeId); }
public override void ViewDidLoad() { base.ViewDidLoad(); // Perform any additional setup after loading the view, typically from a nib. this.NavigationController.NavigationBar.Translucent = true; this.NavigationController.NavigationBar.SetBackgroundImage(new UIImage(), UIBarMetrics.Default); this.NavigationController.NavigationBar.ShadowImage = new UIImage(); this.NavigationController.NavigationBar.BackgroundColor = new UIColor(0.0f, 0.0f, 0.0f, 0.0f); //this.EdgesForExtendedLayout = UIRectEdge.All; HeaderHeightConstraint.Constant = HeaderHeight; TeamOwnerHolderHeightConstraint.Constant = TeamOwnerHolderHeight; TeamRankingGraphHolderHeightConstraint.Constant = 0; TeamCyclersTable.ContentInset = new UIEdgeInsets(HeaderHeight + TeamOwnerHolderHeight, 0, 0, 0); TeamCyclersTable.ContentOffset = new CGPoint(0, -(HeaderHeight + TeamOwnerHolderHeight)); TeamCyclersTable.ScrollIndicatorInsets = new UIEdgeInsets(HeaderHeight + TeamOwnerHolderHeight, 0, 0, 0); this.View.LayoutIfNeeded(); Cyclers = DataSource.GetTeamCyclers(Team.Id); Results = DataSource.GetTeamResults(Team.Id); NSData teamImageData = NSData.FromArray(this.Team.TeamImageData); TeamImageView.Image = UIImage.LoadFromData(teamImageData, 1); CAGradientLayer transparencyLayer = new CAGradientLayer(); transparencyLayer.Frame = TeamImageView.Frame; transparencyLayer.Colors = new CGColor[] { UIColor.Black.CGColor, UIColor.Clear.CGColor }; //[NSArray arrayWithObjects:(id)[UIColor whiteColor].CGColor, (id)[UIColor clearColor].CGColor, nil]; transparencyLayer.StartPoint = new CGPoint(1.0f, 2.0f); transparencyLayer.EndPoint = new CGPoint(1.0f, -1.0f); TeamImageView.Layer.AddSublayer(transparencyLayer); RankingButton.Layer.CornerRadius = RankingButton.Frame.Height / 2; RankingButton.Layer.BorderWidth = 1; RankingButton.Layer.BorderColor = RankingButton.TitleColor(UIControlState.Normal).CGColor; FollowButton.Layer.CornerRadius = FollowButton.Frame.Height / 2; FollowButton.Layer.BorderWidth = 1; FollowButton.Layer.BorderColor = FollowButton.TitleColor(UIControlState.Normal).CGColor; OwnerNameLabel.Text = Team.OwnerName; OwnerImageView.Layer.CornerRadius = 5; NSData ownerImageData = NSData.FromArray(DataSource.GetResource(this.Team.OwnerAvatarUrl)); OwnerImageView.Image = UIImage.LoadFromData(ownerImageData, 1); TeamRankingGraphCurrentCompetitionNameLabel.Text = ""; TeamCyclersTable.WeakDelegate = this; TeamCyclersTable.WeakDataSource = this; }
public void UpdateCell(string userId, string targetUserId, string targetUserImagePath, string targetUserUsername, string targetUserUserTag) { ImageService.Instance.LoadUrl(targetUserImagePath).DownSample(62, 62).Into(UserImageView); UsernameLabel.Text = targetUserUsername; UserTagLabel.Text = targetUserUserTag; DataContext.UserId = userId; DataContext.TargetUserId = targetUserId; if (DataContext.UserIsFollowed) { FollowButton.SetTitle("Unfollow", UIControlState.Normal); } else { FollowButton.SetTitle("Follow", UIControlState.Normal); } Styler.SetBorderRadius(UserImageView, UserImageView.Frame.Size.Width / 2); Styler.SetBorderRadius(FollowButton, FollowButton.Frame.Size.Width / 12); Styler.SetBorders(FollowButton, Colors.mainFontColor, 0.5f); Styler.SetTextColor(FollowButton, Colors.secondFontColor); }
protected void questionsRepeater_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e) { var item = (Question)e.Item.DataItem; HyperLink hypUserProfileLink = (HyperLink)e.Item.FindControl("hypUserProfileLink"); if (hypUserProfileLink != null) { hypUserProfileLink.NavigateUrl = MembershipHelper.GetPublicProfileUrl(item.Author); } HtmlAnchor hrefTopicUrl = e.FindControlAs <HtmlAnchor>("hrefTopicUrl"); if (hrefTopicUrl != null) { Item currItem = Sitecore.Context.Item; hrefTopicUrl.HRef = currItem.GetUrl() + "?topic=" + HttpUtility.UrlEncode(item.Group); } FollowButton btnFoll = e.FindControlAs <FollowButton>("FollowButton"); if (btnFoll != null) { btnFoll.LoadState(item.ContentId, Constants.TelligentContentType.Weblog, item.ContentTypeId); } }
public override void AwakeFromNib() { base.AwakeFromNib(); FollowButton.SetCommand(DataContext.FollowCommand); }
void ReleaseDesignerOutlets() { if (FollowButton != null) { FollowButton.Dispose(); FollowButton = null; } if (HeaderHeightConstraint != null) { HeaderHeightConstraint.Dispose(); HeaderHeightConstraint = null; } if (OwnerImageView != null) { OwnerImageView.Dispose(); OwnerImageView = null; } if (OwnerNameLabel != null) { OwnerNameLabel.Dispose(); OwnerNameLabel = null; } if (RankingButton != null) { RankingButton.Dispose(); RankingButton = null; } if (TeamCyclersTable != null) { TeamCyclersTable.Dispose(); TeamCyclersTable = null; } if (TeamHeaderHolder != null) { TeamHeaderHolder.Dispose(); TeamHeaderHolder = null; } if (TeamImageView != null) { TeamImageView.Dispose(); TeamImageView = null; } if (TeamOwnerDetailHolder != null) { TeamOwnerDetailHolder.Dispose(); TeamOwnerDetailHolder = null; } if (TeamOwnerHolderHeightConstraint != null) { TeamOwnerHolderHeightConstraint.Dispose(); TeamOwnerHolderHeightConstraint = null; } if (TeamRankingGraphHolder != null) { TeamRankingGraphHolder.Dispose(); TeamRankingGraphHolder = null; } if (TeamRankingGraphCurrentCompetitionNameLabel != null) { TeamRankingGraphCurrentCompetitionNameLabel.Dispose(); TeamRankingGraphCurrentCompetitionNameLabel = null; } if (TeamRankingGraphHolderHeightConstraint != null) { TeamRankingGraphHolderHeightConstraint.Dispose(); TeamRankingGraphHolderHeightConstraint = null; } }