You can create and add a frame in C# code-behind as follows:
C#
public MainPage()
{
InitializeComponent();
var frame = new Frame
{
CornerRadius = 5,
WidthRequest = 100,
HeightRequest = 100,
BorderColor = Colors.Black,
HasShadow = true,
BackgroundColor = Colors.Red,
Content = new Label { Text = "Hello, World!"},
};
Content = frame;
}
Share with