Consuming the User Control
Consuming a user control is straightforward. You must simply reference the appropriate namespace for the element, which, in this case, is Chapter15
. Figure 15.1 shows three instances of the control on the following Page
:
<Page x:Class="Chapter15.MainPage" xmlns:local="using:Chapter15" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> <StackPanel HorizontalAlignment="Left"> <local:NumericUpDown/> <local:NumericUpDown Number="5"/> <local:NumericUpDown Number="10"/> </StackPanel> </Grid></Page>
Get XAML Unleashed now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.