Hello,
I recently got a task to make an item in the carousel grow when the IsMouseOver property is true. I can get the item to grow but since its contained inside of a scrollviewer i cant see the entire item when it grows. i did get it to work via popup but i was wondering if you had any other ideas on how this could be accomplished other than making the scrollviewer grow too. we'd like that to stay the same size.
I also got it to do exactly what i wanted using the RadCarouselPanel but when i have say... 10,000 records to display loading time becomes an issue.
here is the usercontrol I'm populating the carousel with
any ideas would be helpful
thanks much,
~Boots
I recently got a task to make an item in the carousel grow when the IsMouseOver property is true. I can get the item to grow but since its contained inside of a scrollviewer i cant see the entire item when it grows. i did get it to work via popup but i was wondering if you had any other ideas on how this could be accomplished other than making the scrollviewer grow too. we'd like that to stay the same size.
I also got it to do exactly what i wanted using the RadCarouselPanel but when i have say... 10,000 records to display loading time becomes an issue.
here is the usercontrol I'm populating the carousel with
| <UserControl x:Class="WpfApplication1.CarouselItem" |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| MouseDown="UserControl_MouseDown" |
| Width="120" > |
| <Grid> |
| <Grid.RenderTransform> |
| <ScaleTransform ScaleX="1" ScaleY="1" /> |
| </Grid.RenderTransform> |
| <Grid.Style> |
| <Style TargetType="Grid"> |
| <Style.Triggers> |
| <Trigger Property="IsMouseOver" Value="True"> |
| <Trigger.EnterActions> |
| <BeginStoryboard> |
| <Storyboard> |
| <DoubleAnimation |
| Storyboard.TargetProperty="(Grid.RenderTransform).(ScaleTransform.ScaleX)" |
| To="2" |
| BeginTime="0:0:0.5" |
| Duration="0:0:0.3"/> |
| <DoubleAnimation |
| Storyboard.TargetProperty="(Grid.RenderTransform).(ScaleTransform.ScaleY)" |
| To="2" |
| BeginTime="0:0:0.5" |
| Duration="0:0:0.3"/> |
| </Storyboard> |
| </BeginStoryboard> |
| </Trigger.EnterActions> |
| <Trigger.ExitActions> |
| <BeginStoryboard> |
| <Storyboard> |
| <DoubleAnimation |
| Storyboard.TargetProperty="(Grid.RenderTransform).(ScaleTransform.ScaleX)" |
| To="1" |
| Duration="0:0:0.3"/> |
| <DoubleAnimation |
| Storyboard.TargetProperty="(Grid.RenderTransform).(ScaleTransform.ScaleY)" |
| To="1" |
| Duration="0:0:0.3"/> |
| </Storyboard> |
| </BeginStoryboard> |
| </Trigger.ExitActions> |
| </Trigger> |
| </Style.Triggers> |
| </Style> |
| </Grid.Style> |
| <Border |
| CornerRadius="5" |
| BorderBrush="Black" |
| BorderThickness="2"> |
| <Image Source="pics\GreenDoor.png" Stretch="Fill" /> |
| </Border> |
| </Grid> |
| </UserControl> |
| using System; |
| using System.Collections.Generic; |
| using System.Linq; |
| using System.Text; |
| using System.Windows; |
| using System.Windows.Controls; |
| using System.Windows.Data; |
| using System.Windows.Documents; |
| using System.Windows.Input; |
| using System.Windows.Media; |
| using System.Windows.Media.Imaging; |
| using System.Windows.Navigation; |
| using System.Windows.Shapes; |
| namespace WpfApplication1 |
| { |
| /// <summary> |
| /// Interaction logic for UserControl1.xaml |
| /// </summary> |
| public partial class CarouselItem : UserControl |
| { |
| public delegate void ItemsMouseDown(object sender); |
| public event ItemsMouseDown ItemMouseDown; |
| public CarouselItem() |
| { |
| try |
| { |
| InitializeComponent(); |
| } |
| catch (Exception ex) |
| { |
| MessageBox.Show(ex.ToString()); |
| } |
| } |
| private void UserControl_MouseDown(object sender, MouseButtonEventArgs e) |
| { |
| if (ItemMouseDown != null) |
| ItemMouseDown(this); |
| } |
| } |
| } |
any ideas would be helpful
thanks much,
~Boots