Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Derivation and attributes of Xamarin XAML language tutorial basic pages ContentPage footprint content pages

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

Derivation and attributes of Xamarin XAML language tutorial basic pages ContentPage footprint content pages

3. Derivation of content pages

The ContentPage page is derived from Page and is the parent of other pages. The derived diagram is shown in figure 14.6.

Figure 14.6 derivative relationship

Note: ContentPage pages can be used as an element of other pages.

4. Attribute

The ContentPage page defines a property Content property that sets the content of the page, which the developer can set to a control, a view, or a layout.

(1) developers can set the Content attribute to button control, label control, etc., such as the following code snippet:

In this code, we set the Content property to the label control.

Note: in the chapter on attributes and attribute values, we mentioned that content attributes can be omitted. The Content property is a content property, so we omitted it in the code.

(2) the Content property can be set not only to a control, but also to a content view, such as the following code:

(3) the Content property of a ContentPage page can also be set to an object. When we set it as a control or a content view, we see only one element on the page. If the developer wants to have multiple elements on the page, they need to use the layout, in which there can be multiple views or controls. Such as the following code:

In this code, we set the layout as a stack layout and place five more label controls in this layout.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report