How can I reuse an existing XAML layout without create the same layout several times and increasing overall app size? I want to access each TextBlock and add different text in each one.
Resuable XAML
<Grid>
<StackPanel>
<TextBlock x:Name="txtPlantTitle" Style="{StaticResource HeaderTextBlockStyle}" />
<TextBlock x:Name="txtPlantSubtitle" Style="{StaticResource SubheaderTextBlockStyle}"/>
<TextBlock x:Name="txtPlantDetails" Style="{StaticResource NormalTextBlockStyle}"/>
</StackPanel>
</Grid>
Resuable XAML's C#
public sealed partial class PlantChosen: Page
{
public PlantChosen()
{
this.InitializeComponent();
}
}
Sunflower XAML
<Grid>
</Grid>
Resuable XAML's C#
public sealed partial class Sunflower: Page
{
public Sunflower()
{
this.InitializeComponent();
}
}