Example #1
0
        private static void OnIsSeparatorVisibleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            GamesFriendsActivityShortHeaderUC activityShortHeaderUc = d as GamesFriendsActivityShortHeaderUC;

            if (activityShortHeaderUc == null)
            {
                return;
            }
            // ISSUE: explicit reference operation
            bool newValue = (bool)e.NewValue;

            ((UIElement)activityShortHeaderUc.BottomSeparator).Visibility = (newValue ? Visibility.Visible : Visibility.Collapsed);
        }
Example #2
0
        private static void OnDataProviderChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            GamesFriendsActivityShortHeaderUC activityShortHeaderUc = d as GamesFriendsActivityShortHeaderUC;

            if (activityShortHeaderUc == null)
            {
                return;
            }
            // ISSUE: explicit reference operation
            GameActivityHeader newValue = e.NewValue as GameActivityHeader;

            if (newValue == null)
            {
                return;
            }
            ((FrameworkElement)activityShortHeaderUc.imageUserIcon).Tag = newValue.User;
            ImageLoader.SetUriSource(activityShortHeaderUc.imageUserIcon, newValue.User.photo_max);
            activityShortHeaderUc.textBlockDate.Text = (UIStringFormatterHelper.FormatDateTimeForUI(newValue.GameActivity.date));
            ((FrameworkElement)activityShortHeaderUc.textBlockDescription).Tag = newValue.Game;
            ((PresentationFrameworkCollection <Inline>)activityShortHeaderUc.textBlockDescription.Inlines).Clear();
            List <Inline> inlineList = newValue.ComposeActivityText(false);

            if (((IList)inlineList).IsNullOrEmpty())
            {
                return;
            }
            for (int index = 0; index < inlineList.Count; ++index)
            {
                Run run1 = inlineList[index] as Run;
                if (run1 != null)
                {
                    ((PresentationFrameworkCollection <Inline>)activityShortHeaderUc.textBlockDescription.Inlines).Add((Inline)run1);
                    if (index < inlineList.Count - 1)
                    {
                        Run    run2 = run1;
                        string str  = run2.Text + " ";
                        run2.Text = str;
                    }
                }
            }
        }