开发者

Binding a list of controls to a canvas

开发者 https://www.devze.com 2022-12-08 04:27 出处:网络
Is it possible to bind an Ov开发者_JS百科servableCollection of Labels or and FrameworkElement to a canvas?

Is it possible to bind an Ov开发者_JS百科servableCollection of Labels or and FrameworkElement to a canvas? If so how can this be implemented?


You can use an ItemsControl and set its ItemsPanel property to a Canvas:

<ItemsControl ItemsSource={Binding Items}>
  <ItemsControl.ItemsPanel>
    <ItemsPanelTemplate>
      <Canvas/>
    </ItemsPanelTemplate>
  </ItemsControl.ItemsPanel>
</ItemsControl>

Hope this help

0

精彩评论

暂无评论...
验证码 换一张
取 消