How to set transparency for user management in wpf

I am creating a custom message box element, the radius for the corner, as shown below, however I cannot set the transaparent for this user control. Please help me.

Many thanks.

enter image description here

Update:

I implemented it as my instruction, but it is not yet transparent, I think the background user control is white, please help me. Below is my code:

<UserControl x:Class="Nanote.TestDialog"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             d:DesignHeight="200"
             Height="200" Width="450"
             d:DesignWidth="300"
             mc:Ignorable="d">
    <Border CornerRadius="20" BorderBrush="Black" BorderThickness="10" 
        Background="Transparent">
        <Rectangle Fill="White" Margin="10" />
    </Border>
</UserControl>
+4
source share
2 answers

Consider the following XAML:

<Grid Background="Red">
    <Grid.RowDefinitions>
        <RowDefinition />
        <RowDefinition />
        <RowDefinition />
    </Grid.RowDefinitions>
    <Grid Margin="20">
        <Border CornerRadius="20" BorderBrush="Black" BorderThickness="10" 
            Background="Transparent">
            <Rectangle Fill="White" />
        </Border>
    </Grid>
    <Grid Grid.Row="1" Margin="20">
        <Rectangle Fill="White" />
        <Border CornerRadius="20" BorderBrush="Black" BorderThickness="10" 
            Background="Transparent" />
    </Grid>
    <Border Grid.Row="2" CornerRadius="20" BorderBrush="Black" BorderThickness="10" 
        Background="White" Margin="20">
        <Rectangle Fill="White" Margin="10" />
    </Border>
</Grid>

This leads to the following conclusion:

enter image description here

I hope you can now work out your solution from this example.

+6
source

, (CornerRadius = "10" ), INSIDE, GRID

 <Border BorderBrush="Black"  BorderThickness="1,1,1,1" Background="White" CornerRadius="10,10,10,10">
 <Grid ></Grid>
 </Border>
+3

All Articles