2012-08-16 73 views
0

我是Silverlight新手。我正在嘗試與inkpresenter一起提供放大功能。我正在使用Silverlight 4,c#,asp.net。我可以將滑塊綁定到畫布,並且它可以放大,但我面臨的問題與沒有更新的scrollviewer佈局。有一篇文章提到我需要使用佈局轉換。任何人都可以讓我知道我在做什麼錯誤或任何其他建議。silverlight 4.0 scrollviewer沒有更新

<Slider x:Name="slider" Maximum="2" Minimum="0" Value="1" Width="100"/> 
</StackPanel> 

<ScrollViewer x:Name="scrollBar" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" Grid.Column="1" Margin="6,1,1,1" Grid.Row="1"> 
    <ScrollViewer.Content> 
     <toolkit:LayoutTransformer Name="TheTransformer" Background="{x:Null}"> 
      <toolkit:LayoutTransformer.LayoutTransform> 
       <ScaleTransform x:Name="contentScale" ScaleX="{Binding ElementName=slider,Path=Value}" ScaleY="{Binding ElementName=slider,Path=Value}" /> 
      </toolkit:LayoutTransformer.LayoutTransform> 

      <toolkit:LayoutTransformer.Content> 
       <Canvas x:Name="cnsImageEditable" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" OpacityMask="#FFE89E9E"> 

        <!--The following commented bit does work i can zoomin and out but scroller not updating -->     
        <!--<Canvas.RenderTransform> 
         <ScaleTransform x:Name="scale" ScaleX="{Binding ElementName=slider,Path=Value}" ScaleY="{Binding ElementName=slider,Path=Value}"/> 
        </Canvas.RenderTransform>--> 

       <InkPresenter x:Name="inkCanvas" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> 
        <Image x:Name="imgEditableImage" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"></Image> 
       </InkPresenter> 

       </Canvas> 
      </toolkit:LayoutTransformer.Content> 
     </toolkit:LayoutTransformer> 
    </ScrollViewer.Content> 
</ScrollViewer> 

任何幫助深表感謝appretiated

回答

相關問題