2009-08-20 15 views
1

サーフェスのソフトウェアで作業しているときに小さな問題があります。バインドされたScatterViewがあり、アイテムにDataTemplateがあります。私の質問は、ItemTemplateから作成されたScatterViewItemの幅と高さをどのように設定するのですか?s:ScatterView ItemTemplate - 高さまたは幅を設定する方法は?

 <s:ScatterView Name="svMain" Loaded="svMain_Loaded" ItemsSource="{Binding BallsCollection}" > 
     <s:ScatterView.ItemTemplate > 
      <DataTemplate> 
       <DockPanel LastChildFill="True" > 
        <DockPanel.Background> 
         <ImageBrush ImageSource="image\note.png" Stretch="Fill" /> 
        </DockPanel.Background> 
        <TextBox Background="Transparent" DockPanel.Dock="Top" Text="{Binding Path=Message}" 
          IsReadOnly="True" TextWrapping="Wrap"></TextBox> 
       </DockPanel> 
      </DataTemplate> 
     </s:ScatterView.ItemTemplate> 
    </s:ScatterView> 

答えて

3

私はあなたが他のItemsControlsと同じように、ItemContainerStyleを通じてその設定ができると信じて、私は表面SDKを持っていないとして、私は、確かではありませんよ。

<s:ScatterView.ItemContainerStyle> 
     <Style TargetType="{x:Type s:ScatterViewItem}"> 
      <Setter Property="Width" Value="100"/> 
      <Setter Property="Height" Value="100"/> 
     </Style>    
    </s:ScatterView.ItemContainerStyle> 

あなたはもちろん、代わりに固定されたユニットをバインディングを使用することができます。

+0

ありがとう、それは動作します! –

関連する問題