"wpf itemscontrol in itemscontrol" Code Answer's

You're definitely familiar with the best coding language C# that developers use to develop their projects and they get all their queries like "wpf itemscontrol in itemscontrol" answered properly. Developers are finding an appropriate answer about wpf itemscontrol in itemscontrol related to the C# coding language. By visiting this online portal developers get answers concerning C# codes question like wpf itemscontrol in itemscontrol. Enter your desired code related query in the search bar and get every piece of information about C# code related question on wpf itemscontrol in itemscontrol. 

wpf itemscontrol in itemscontrol

By SolsticeSolstice on Oct 22, 2020
//<!--WPF: this nested ItemsControl allows for placement of items on a screen based on bound properties-->
//<!--A key factor to make this work is the Content="{Binding}" statement on line 33, as this links the items to the ItemControl's datacontext-->
//<!--Collections must be of type ObservableCollection<T> for XAML to register updates to the collection-->

<ItemsControl x:Name="outerIC" ItemsSource="{Binding Source={x:Static namespace:Class.CollectionProperty}}">
    <ItemsControl.ItemsPanel>
        <ItemsPanelTemplate>
            <Canvas IsItemsHost="True"/>
        </ItemsPanelTemplate>
    </ItemsControl.ItemsPanel>
    <ItemsControl.ItemContainerStyle>
        <Style>
            <Setter Property="Canvas.Top" Value="0" />
            <Setter Property="Canvas.Left" Value="0" />
        </Style>
    </ItemsControl.ItemContainerStyle>
    <ItemsControl.ItemTemplate>
        <DataTemplate>
            <ItemsControl ItemsSource="{Binding SomeCollectionPropertyInClass}">
                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                        <Canvas IsItemsHost="True"/>
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel>
                <ItemsControl.ItemContainerStyle>
                    <Style>
                        <Setter Property="Canvas.Top" Value="0" />
                        <Setter Property="Canvas.Left" Value="0" />
                    </Style>
                </ItemsControl.ItemContainerStyle>
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <ContentControl Content="{Binding}">
                            <ContentControl.Style>
                                <Style TargetType="ContentControl">
                                    <Setter Property="ContentTemplate">
                                        <Setter.Value>
                                            <DataTemplate>
                                                <Canvas>
                                                    <Button Canvas.Left="{Binding X}"
                                                            Canvas.Top="{Binding Y}"/>
                                                </Canvas>
                                            </DataTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                            </ContentControl.Style>
                        </ContentControl>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
        </DataTemplate>
    </ItemsControl.ItemTemplate>
</ItemsControl>

Add Comment

0

All those coders who are working on the C# based application and are stuck on wpf itemscontrol in itemscontrol can get a collection of related answers to their query. Programmers need to enter their query on wpf itemscontrol in itemscontrol related to C# code and they'll get their ambiguities clear immediately. On our webpage, there are tutorials about wpf itemscontrol in itemscontrol for the programmers working on C# code while coding their module. Coders are also allowed to rectify already present answers of wpf itemscontrol in itemscontrol while working on the C# language code. Developers can add up suggestions if they deem fit any other answer relating to "wpf itemscontrol in itemscontrol". Visit this developer's friendly online web community, CodeProZone, and get your queries like wpf itemscontrol in itemscontrol resolved professionally and stay updated to the latest C# updates. 

C# answers related to "wpf itemscontrol in itemscontrol"

View All C# queries

C# queries related to "wpf itemscontrol in itemscontrol"

Browse Other Code Languages

CodeProZone