我定义了以下布局:
<Grid Name="RootGrid" Background="{StaticResource WindowBackground}" >
<s:ScatterView Name="RootScatter">
<Viewbox>
<s:LibraryContainer Name="RootContainer" Grid.Row="0" ViewingMode="Bar">
<s:LibraryContainer.BarView>
<s:BarView Rows="2" NormalizedTransitionSize="2.5,0.8" ItemTemplate="{StaticResource ContainerItemTemplate}">
</s:BarView>
</s:LibraryContainer.BarView>
<s:LibraryContainer.StackView>
<s:StackView NormalizedTransitionSize="1,1" ItemTemplate="{StaticResource ContainerItemTemplate}">
</s:StackView>
</s:LibraryContainer.StackView>
</s:LibraryContainer>
</Viewbox>
</s:ScatterView>
<s:ScatterView Name="ClassScatter"></s:ScatterView>
</Grid>
</s:SurfaceWindow>现在我将向第二个ScatterView动态添加项:
public void expand(SurfaceWindow1 surfaceWindow)
{
Logging.Logger.getInstance().log("Expand class " + name);
if (!isExpanded())
{
Viewbox vb = new Viewbox();
SurfaceTextBox txt = new SurfaceTextBox();
txt.Text = this.name + "\nLOC: " + this.getLoc() + "\nFanIn: " + this.getFanIn() + "\nFanOut: " + this.getFanOut() + "\nComplexity: " + this.getComplexity();
txt.IsReadOnly = true;
vb.Child = txt;
surfaceWindow.ClassScatter.Items.Add(vb);
this.setExpanded(true);
}
}这很好用,但不幸的是,我不能改变创建的对象的大小、移动或旋转。有什么线索吗?
发布于 2010-10-27 16:47:06
问题是你的TextBox捕捉到了触摸屏,而ScatterView却不能捕捉到它们来拖拽/缩放/旋转TextBox。有两个选项可以解决您的问题:
txt.Margin = new Thickness(20);https://stackoverflow.com/questions/4031183
复制相似问题