This is a migrated thread and some comments may be shown as answers.

Hyperlink disappearing on rotation of radcoverflow control?

2 Answers 107 Views
CoverFlow
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Aspnet
Top achievements
Rank 1
Aspnet asked on 09 Aug 2012, 02:58 PM
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 Answers, 1 is accepted

Sort by
0
Lancelot
Top achievements
Rank 1
answered on 09 Aug 2012, 05:50 PM
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
0
Aspnet
Top achievements
Rank 1
answered on 10 Aug 2012, 01:34 PM
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.
Tags
CoverFlow
Asked by
Aspnet
Top achievements
Rank 1
Answers by
Lancelot
Top achievements
Rank 1
Aspnet
Top achievements
Rank 1
Share this question
or