WPF Speech Bubble

I am currently creating a little bland where you can create your own comic strip. I'm currently trying to add speech bubbles. What I did was that I put a text box inside a rounded corner frame. This is my result.

Now I would like to add an arrow pointing to the character speaking ( An example of what I would like to get ). The arrow position must be selected by the user. He would like to turn around the border. I don’t know if something like this can be done. If I didn’t want the user to be able to choose the direction of the arrow before adding a speech bubble (between the eight main directions). Here is the code I use to create my bubbles:

 Border bdrBubble = new Border();
            bdrBubble.BorderThickness = new Thickness(2);
            bdrBubble.BorderBrush = Brushes.Black;
            System.Windows.Controls.TextBox txtBubble = new System.Windows.Controls.TextBox();

            txtBubble.Background = Brushes.White;
            txtBubble.TextWrapping = TextWrapping.Wrap;
            txtBubble.AcceptsReturn = true;
            txtBubble.Background = Brushes.Transparent;

            txtBubble.BorderThickness = new Thickness(0);
            txtBubble.Text = tbxBubble.Text;
            bdrBubble.CornerRadius = new CornerRadius(100);
            txtBubble.ClipToBounds = true;
            bdrBubble.Background = Brushes.White;
            bdrBubble.Padding = new Thickness(10);
            txtBubble.TextAlignment = TextAlignment.Center;
            bdrBubble.Child = txtBubble;

, - !

0
1

, , .

<Grid>
<Grid.RowDefinitions>
    <RowDefinition Height="*"/>
    <RowDefinition Height="40"/>
</Grid.RowDefinitions>
<Rectangle Fill="#FF686868" Stroke="#FF000000" RadiusX="10" RadiusY="10"/>
<Path Fill="#FF686868" Stretch="Fill" Stroke="#FF000000" HorizontalAlignment="Left" Margin="30,-5.597,0,-0.003" Width="25" Grid.Row="1" Data="M22.166642,154.45381 L29.999666,187.66699 40.791059,154.54395"/>                  
<Rectangle Fill="#FF686868" RadiusX="10" RadiusY="10" Margin="1"/>
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="25" Text="Hello World" TextWrapping="Wrap"/>                       
</Grid>

: WPF ?

WPF

0

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


All Articles