locked
Big scrolling area RRS feed

  • Question

  • I have big area (around 1mX1m pixels) which can be displayed. I've separeted area on sectors and display each sector if it's visible after scrolling. Each sector places on it's own Canvas control. So in one time is displaying only a few Canvas controls without loading huge massive of target area (each sector is loading if it's need to display). Everything works fine exept one problem. If I trying to display moving object (for exm. Image) it's cutting around sector's borders (when Image cross border and mosing from one sector to another). I trying set ZIndex to the Image, but his ZIndex depends on parent container (in my case Canvas). What I need to do?

    Thursday, February 19, 2009 4:19 AM

Answers

  • Here are my test code

    <UserControl x:Class="ForumTest1.t_74047.SilverlightControl1"

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    Width="400" Height="300">

    <UserControl.Resources>

    <Storyboard x:Name="story1">

    <DoubleAnimation Storyboard.TargetName="r1"

    Storyboard.TargetProperty="(Canvas.Left)"

    From="0"

    To="500"

    Duration="0:0:1"/>

    </Storyboard>

    </UserControl.Resources>

    <Canvas>

    <Canvas Canvas.ZIndex="1" Canvas.Left="0" Canvas.Top="200" Background="AliceBlue" Width="200" Height="200">

    <Rectangle Name="r1" Fill="BlueViolet" Width="100" Height="100" MouseLeftButtonDown="Rectangle_MouseLeftButtonDown">

    </Rectangle>

    </Canvas>

    <Canvas Canvas.Left="200" Canvas.Top="200" Background="Aqua" Width="200" Height="200"/>

    <Canvas Canvas.Left="200" Canvas.Top="0" Background="Azure" Width="200" Height="200"/>

    <Canvas Canvas.Left="0" Canvas.Top="0" Background="BlanchedAlmond" Width="200" Height="200"/>

    </Canvas>

    </UserControl>

    C# codebehind

    public partial class SilverlightControl1 : UserControl

    {

    public SilverlightControl1()

    {

    InitializeComponent();

    }

    private void Rectangle_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)

    {

    story1.Begin();

     

    }

    }

    You could set the ZIndex property of animation object's container to be 1(higher than other).

    It seems lack some flexibilityHuh?

    Tuesday, February 24, 2009 2:56 AM

All replies

  • Try to set the ZIndex property of  moving object's container sector canvas bigger than of the other sector canvas

    Sunday, February 22, 2009 8:46 PM
  • Here are my test code

    <UserControl x:Class="ForumTest1.t_74047.SilverlightControl1"

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    Width="400" Height="300">

    <UserControl.Resources>

    <Storyboard x:Name="story1">

    <DoubleAnimation Storyboard.TargetName="r1"

    Storyboard.TargetProperty="(Canvas.Left)"

    From="0"

    To="500"

    Duration="0:0:1"/>

    </Storyboard>

    </UserControl.Resources>

    <Canvas>

    <Canvas Canvas.ZIndex="1" Canvas.Left="0" Canvas.Top="200" Background="AliceBlue" Width="200" Height="200">

    <Rectangle Name="r1" Fill="BlueViolet" Width="100" Height="100" MouseLeftButtonDown="Rectangle_MouseLeftButtonDown">

    </Rectangle>

    </Canvas>

    <Canvas Canvas.Left="200" Canvas.Top="200" Background="Aqua" Width="200" Height="200"/>

    <Canvas Canvas.Left="200" Canvas.Top="0" Background="Azure" Width="200" Height="200"/>

    <Canvas Canvas.Left="0" Canvas.Top="0" Background="BlanchedAlmond" Width="200" Height="200"/>

    </Canvas>

    </UserControl>

    C# codebehind

    public partial class SilverlightControl1 : UserControl

    {

    public SilverlightControl1()

    {

    InitializeComponent();

    }

    private void Rectangle_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)

    {

    story1.Begin();

     

    }

    }

    You could set the ZIndex property of animation object's container to be 1(higher than other).

    It seems lack some flexibilityHuh?

    Tuesday, February 24, 2009 2:56 AM