简体   繁体   中英

Xamarin Forms Can Draw ContentPage On ContentPage?

enter image description here

I want Draw Other ContentPage On ContentPage Like Parent And Child Relationship.

Xamarin Can This?

how can I draw ContentView in a ContentPage?

From document Xamarin.Forms ContentView ,we can know:

The Xamarin.Forms ContentView class is a type of Layout that contains a single child element and is typically used to create custom, reusable controls. The ContentView class inherits from TemplatedView.

The ContentView class defines a single property:

Content is a View object. This property is backed by a BindableProperty object so it can be the target of data bindings. The ContentView also inherits a property from the TemplatedView class:

ControlTemplate is a ControlTemplate that can define or override the appearance of the control.

The ContentView class can be used to create a custom control.

The process for creating a custom control is to:

  1. Create a new class using the ContentView template in Visual Studio 2019.
  2. Define any unique properties or events in the code-behind file for the new custom control.
  3. Create the UI for the custom control.

For more details, you can check: https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/layouts/contentview .

And there is also a sample included in above document , you can check it here: https://docs.microsoft.com/en-us/samples/xamarin/xamarin-forms-samples/userinterface-contentviewdemos/ .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM