开发者

how to add DragDockPanel Dynamically, using ItemsControl?

开发者 https://www.devze.com 2023-03-22 08:01 出处:网络
<Grid> <Blacklight_Controls:DragDockPanelHost > <ItemsControl ItemsSource=\"{Binding Path=DashBoardItemList}\">
 <Grid>  

<Blacklight_Controls:DragDockPanelHost >
          <ItemsControl ItemsSource="{Binding Path=DashBoardItemList}">
                        <ItemsControl.ItemTemplate>
                            <DataTemplate>
                                <Blacklight_Controls:DragDockPanel Header="Titel"/>
                            </DataTemplate>
                        </ItemsControl.ItemTemplate>
                    </ItemsControl>
                </Blacklight_Controls:DragDockPanelHost>
       </Grid>

This appear like this..

how to add DragDockPanel Dynamically, using ItemsControl?

The newly generated DragD开发者_Go百科ockPanels by ItemsControl, added inside another DragDockPanel. Not the DragDockPanelHost. Because DragDockPanels cannot be move. What I need is , generated DragDockPanes must be directly add to the DragDockPanelHost, no inside a another DragDockPanel.


I had the same problem. Removing the ItemTemplate produced the effect I wanted.

<blacklight:DragDockPanelHost x:Name="Fields" >
        <ItemsControl>
            <blacklight:DragDockPanel Style="{StaticResource DragDockPanelStyle}">
                <ContentControl cal:View.Model="{Binding}" />
            </blacklight:DragDockPanel>
        </ItemsControl>

    </blacklight:DragDockPanelHost>
0

精彩评论

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