This is a migrated thread and some comments may be shown as answers.

Personnalize containerShape with grid

1 Answer 71 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
nicolasf
Top achievements
Rank 2
nicolasf asked on 28 Jun 2017, 12:55 PM

Hi,

 

I would like to personnalize the ContainerShape but if i change Template property, all events (resize, connector) disappear.

Do you have a example of a full personnalized ContainerShape ?

Thanks.

This is my code

<Setter Property="Template">
    <Setter.Value>
        <ControlTemplate>
            <Grid Background="DimGray">
                <Grid.RowDefinitions>
                    <RowDefinition Height="35"></RowDefinition>
                    <RowDefinition Height="*"></RowDefinition>
                </Grid.RowDefinitions>
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Row="0">
                    <TextBlock x:Name="EntityContent" Text="test" Width="250" Height="35" Foreground="White" />
                </StackPanel>
                <Grid Grid.Row="2">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="40*" />
                        <ColumnDefinition Width="20*" />
                        <ColumnDefinition Width="40*" />
                    </Grid.ColumnDefinitions>
                    <StackPanel Orientation="Vertical" x:Name="EntityDataIn" Grid.Column="0"></StackPanel>
                    <StackPanel Orientation="Vertical" x:Name="EntityDataOut" Grid.Column="2"></StackPanel>
                </Grid>
            </Grid>
        </ControlTemplate>
    </Setter.Value>
</Setter>

1 Answer, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 03 Jul 2017, 08:39 AM
Hello ,

Looking at the provided code snippet you are overriding the custom template of the container shape and haven't implemented the visual states of the container. If you want to modify the container shape it will be better to extract the default template of the container shape and modify the part that you need. We have Editing Control Templates which will help to extract the default template of the container shape.

You can take a look at the OrgChart example in our desktop WPF Controls Demo application.

Regards,
Dinko
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which you to write beautiful native mobile apps using a single shared C# codebase.
Tags
Diagram
Asked by
nicolasf
Top achievements
Rank 2
Answers by
Dinko | Tech Support Engineer
Telerik team
Share this question
or