0
我有一個Silverlight網格,裏面有一堆內容(矩形,textBlocks等),它代表了房間中的內容。因爲它變得非常複雜,我決定我需要能夠在網格上「放大」。我發現了一些很好的代碼來做到這一點,但問題是,縮放相關的網格後,ScrollViewer不會向下或向右滾動全部距離。我如何強制更新,以便我可以滾動到底部並一路向右?Silverlight ScrollViewer在變焦後沒有更新
如果有幫助,下面的代碼允許我網的縮放:
var style = new Style(typeof(Grid));
var scale = new ScaleTransform();
scale.CenterX = .5;
scale.CenterY =.5;
scale.ScaleX = Scale;
scale.ScaleY = Scale;
var rs = new Setter();
rs.Property = DataGridCell.RenderTransformProperty;
rs.Value = scale;
style.Setters.Add(rs);
OtdrPatchLocationGrid.Style = style;
這裏是顯示網格和滾動瀏覽器的XAML
<ScrollViewer Name="scViewer" Grid.Row="1" Visibility="Visible" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Visible">
<Grid x:Name="OtdrPatchLocationGrid" MinHeight="350" VerticalAlignment="Stretch" Background="Yellow" Grid.Row="1" Grid.Column="0" Margin="0" MouseDown="OtdrRackViewer_MouseDown">
</Grid>
</ScrollViewer>