Example #1
0
        protected override void BindModelFull()
        {
            if (ViewModel.ArePeekPostsAvailable)
            {
                var pp1 = ViewModel.Entry.PeekPosts.First();
                if (ForumIndexPageBoardItemPeekPost1Image.Tag == null ||
                    (string)ForumIndexPageBoardItemPeekPost1Image.Tag != pp1.User.ImgUrl)
                {
                    ForumIndexPageBoardItemPeekPost1Image.Into(pp1.User.ImgUrl, new CircleTransformation());
                }
                else
                {
                    ForumIndexPageBoardItemPeekPost1Image.Visibility = ViewStates.Visible;
                }

                if (ViewModel.Entry.PeekPosts.Count() == 2)
                {
                    var pp2 = ViewModel.Entry.PeekPosts.Last();
                    if (ForumIndexPageBoardItemPeekPost2Image.Tag == null ||
                        (string)ForumIndexPageBoardItemPeekPost2Image.Tag != pp2.User.ImgUrl)
                    {
                        ForumIndexPageBoardItemPeekPost2Image.Into(pp2.User.ImgUrl, new CircleTransformation());
                    }
                    else
                    {
                        ForumIndexPageBoardItemPeekPost2Image.Visibility = ViewStates.Visible;
                    }
                }


                //ForumIndexPageBoardItemPeekPost1ImgPlaceholder.Visibility = ViewStates.Gone;
                //ForumIndexPageBoardItemPeekPost2ImgPlaceholder.Visibility = ViewStates.Gone;
            }
            else
            {
                ForumIndexPageBoardItemPeekPost1Image.Visibility = ViewStates.Invisible;
                ForumIndexPageBoardItemPeekPost2Image.Visibility = ViewStates.Invisible;

                //ForumIndexPageBoardItemPeekPost1ImgPlaceholder.Visibility = ViewStates.Visible;
                //ForumIndexPageBoardItemPeekPost2ImgPlaceholder.Visibility = ViewStates.Visible;
            }


            ForumIndexPageBoardItemRootContainer.SetOnClickListener(new OnClickListener(view =>
                                                                                        _parentViewModel.NavigateBoardCommand.Execute(ViewModel.Board)));
        }
Example #2
0
        protected override void BindModelFling()
        {
            if (ViewModel.ArePeekPostsAvailable)
            {
                if (ForumIndexPageBoardItemPeekPost1Image.IntoIfLoaded(ViewModel.Entry.PeekPosts.First().User.ImgUrl, new CircleTransformation()))
                {
                    ForumIndexPageBoardItemPeekPost1Image.Visibility = ViewStates.Visible;
                    //ForumIndexPageBoardItemPeekPost1ImgPlaceholder.Visibility = ViewStates.Gone;
                }
                else
                {
                    ForumIndexPageBoardItemPeekPost1Image.Visibility = ViewStates.Invisible;
                    //ForumIndexPageBoardItemPeekPost1ImgPlaceholder.Visibility = ViewStates.Visible;
                }

                if (ViewModel.Entry.PeekPosts.Count() == 2)
                {
                    if (ForumIndexPageBoardItemPeekPost2Image.IntoIfLoaded(ViewModel.Entry.PeekPosts.Last().User.ImgUrl, new CircleTransformation()))
                    {
                        ForumIndexPageBoardItemPeekPost2Image.Visibility = ViewStates.Visible;
                        //ForumIndexPageBoardItemPeekPost2ImgPlaceholder.Visibility = ViewStates.Gone;
                    }
                    else
                    {
                        ForumIndexPageBoardItemPeekPost2Image.Visibility = ViewStates.Invisible;
                        //ForumIndexPageBoardItemPeekPost2ImgPlaceholder.Visibility = ViewStates.Visible;
                    }
                }
                else
                {
                    ForumIndexPageBoardItemPeekPost2Image.Visibility = ViewStates.Invisible;
                    //ForumIndexPageBoardItemPeekPost2ImgPlaceholder.Visibility = ViewStates.Visible;
                }
            }
            else
            {
                ForumIndexPageBoardItemPeekPost1Image.Visibility = ViewStates.Invisible;
                ForumIndexPageBoardItemPeekPost2Image.Visibility = ViewStates.Invisible;

                //ForumIndexPageBoardItemPeekPost1ImgPlaceholder.Visibility = ViewStates.Visible;
                //ForumIndexPageBoardItemPeekPost2ImgPlaceholder.Visibility = ViewStates.Visible;
            }
        }