Hyperlink disappearing on rotation of radcoverflow control?

3 posts, 0 answers
  1. Aspnet
    Aspnet avatar
    2 posts
    Member since:
    Aug 2012

    Posted 09 Aug 2012 Link to this post

    Hi,

    I have a radcoverflow control within a usercontrol. At the base of each item (depending on the presence of a uri property) within the radcoverflow I am attempting to place a "Read More..." hyperlink. This works fine until an item with the "Read More..." link rotates out of view and then back into view where the "Read More..." link disappears?

    HyperlinkButton:

    <HyperlinkButton x:Name="OpenMorePopup" Content="Read More.." FontSize="10" VerticalAlignment="Bottom" Margin="2,0,10,-17" Foreground="White" Click="OpenMorePopup_Click" Loaded="OpenMorePopup_Loaded" Tag="{Binding uri}" />

    Events:

    private void OpenMorePopup_Click(object sender, RoutedEventArgs e)
            {
                string pageURL = ((HyperlinkButton)sender).Tag.ToString();
                HtmlPage.Window.Invoke("DialogOpenNewsPopup", 800, 600, "Firm News", pageURL);
            }
     
            private void OpenMorePopup_Loaded(object sender, RoutedEventArgs e)
            {
                HyperlinkButton button = (HyperlinkButton)sender;
     
                //Hide the link if the Tag proprty is empty.  This property
                //should only be populated for News items
                if (button.Tag == null)
                {
                    button.Visibility = System.Windows.Visibility.Collapsed;
                }
            }

    The logic says, if the "uri" property exists within the tag, make the button visible, if not collapse the button. As I mentioned, this seems to work until the item is rotated out of view and then back into view, at which the button disappears?

    Thanks.
  2. Lancelot
    Lancelot avatar
    251 posts
    Member since:
    Jul 2012

    Posted 09 Aug 2012 Link to this post

    Hi Aspnet,

    Have you tried something like this?

    private void OpenMorePopup_Loaded(object sender, RoutedEventArgs e)
            {
                HyperlinkButton button = (HyperlinkButton)sender;
     
                button.Visibility = button.Tag ? System.Windows.Visibility.Collapsed : System.Windows.Visibility.Visible;
     
     
                //Or you can do this, its the same as the above statement
                if (button.Tag == null)
                {
                    button.Visibility = System.Windows.Visibility.Collapsed;
                }
                else
                {
                     button.Visibility = System.Windows.Visibility.Visible;
                {
     
            }


    This way you provide a return to visibility if present. Also you should consider how often this event is firing. You may want to use it inside the coverflow's SelectionChanged event

    Lancelot
  3. DevCraft banner
  4. Aspnet
    Aspnet avatar
    2 posts
    Member since:
    Aug 2012

    Posted 10 Aug 2012 Link to this post

    Thanks for the code but I actually had the "IsVirtualizing" radcoverflow property set to true, this was only loading the viewable items into memory thus when the item went out of view and then back into view the link was not being loaded. Any comments on this?

    Thanks.
Back to Top