Writing an app for Windows Phone, I want to create custom control, inherited from TextBlock. But form of this control should be not rectangular. I tried to use Blend for this task, but I couldn't find properties to change form of controls.

On the image above there is schematic form of control. I suppose, that there is possibility to set coordinates of angles of control, but I didn't find it. Thank you.
This problem can be solved in several ways, I chose to use a Template with their figures. In the role of the figures will be performing standard Rectangles. Template for TextBlock can not be set, so I opted for a more universal control - Label.
Example:
<Style TargetType="{x:Type Label}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Label}">
<Border Background="{TemplateBinding Background}">
<Grid>
<Rectangle Width="30" Height="70" Fill="Gainsboro" StrokeThickness="1" Margin="0,0,0,10" Panel.ZIndex="0" />
<ContentPresenter HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="33,0,0,25" Panel.ZIndex="1" />
<Rectangle MinWidth="55" Height="30" StrokeThickness="1" Fill="Gainsboro" HorizontalAlignment="Left" Margin="30,30,0,0" />
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
Declared Label in XAML:
<Label Background="Transparent" Width="200" Height="90" Content="Test your label" />
Output

Naturally, you will need to change the Template to fit your needs.
Note about several ways:
For a more sophisticated method and more advanced ways you can use your own Decorator, where with the help of DrawingContext you will draw your object. Example - How can I draw a border with squared corners in wpf?
Using the properties of the Geometry, where a Path, setting the desired shape of the figure. Example - WPF freeform border control.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With