XAML border versus rectangle

I want to get such a window enter image description here

How do I get this and I am confused between Border and Rectangle in XAML.

Border is container management, and its use is quite simple, which means using ractangle, since it cannot contain any control.

Request for help

+4
source share
4 answers

You can draw plygon as follows:

<Polygon Points="100 50, 100 150,250 150, 250 75, 225 50" Stroke="Black" StrokeThickness="2"> <Polygon.Fill> <SolidColorBrush Color="White"/> </Polygon.Fill> </Polygon> 

Here you can find another interesting example.

+2
source

Neither Border and Rectangle will achieve this, you will probably need Path or something similar.

+4
source

I would like to answer your last question

What is the use of ractangle, since it cannot contain any control.

Yes, it cannot contain any controls, but you can always draw it in the background

 <Grid> <Rectangle/> <TextBlock/> </Grid> 

The user will be comfortable so as not to see any difference. Why are there two different controls for this? Not sure, but I suppose Border is a shortcut to have a rectangle around the control, maybe there is more behind it, but here's how I see it. Rectangle is also a form, and it makes sense to have a rectangle, except for an ellipse, a line, etc.

+3
source

This path is similar to your shape, if you use Expression Blend, you can draw it in the editor.

 <Path Data="M20.5,0.5 L153.81876,0.5 194.5,41.181242 194.5,103.5 C194.5,114.54569 185.5457,123.5 174.5,123.5 L20.5,123.5 C9.4543047,123.5 0.5,114.54569 0.5,103.5 L0.5,20.500004 C0.5,9.4543067 9.4543047,0.50000197 20.5,0.5 z" Fill="#FFF4F4F5" Stretch="Fill" Stroke="Black" HorizontalAlignment="Left" Height="124" VerticalAlignment="Top" Width="195"/> 
0
source

Source: https://habr.com/ru/post/1403632/


All Articles