I got a bit stuck on a problem and I was wondered if it's possible you can make a video on my problem it seems may others may have the same problem but, I been looking online but no real straight forward solution to the issue. The problem is, for instance, I have a stack layout in a content page page1.xaml and I added labels to that page 4 of them and I set properties for those labels setters and getters. however, if I make page2.xaml how would I be able to move the labels along with the data to page2.xaml basically reuse the data/labels declared from page1.xaml to page2.xaml throughout the app? here is what I have so far.
<StackLayout>
<StackLayout x:Name = "CustomerOrderStackLayout" Orientation = "Horizontal" HorizontalOptions = "Center" Padding = "20" >
<Label x:Name ="CustomerOrderNumberLabel" HorizontalOptions = "Center" />
</StackLayout>
<StackLayout Orientation = "Vertical" Padding = "20" >
<Label x:Name ="CustomerFirstNameLabel"
VerticalOptions = "Start" />
<Label x:Name ="CustomerLastNameLabel"
VerticalOptions = "Start" />
<Label x:Name ="CustomerAddressLabel"
VerticalOptions = "Start" />
<Label x:Name ="CustomerZipCodeLabel"
VerticalOptions = "Start"/>
<Label x:Name ="CustomerPhoneNumberLabel"
VerticalOptions = "Start"/>
</StackLayout>
</StackLayout>
</ContentPage>
public partial class CustomerInfoContentV : ContentPage
{
public CustomerInfoContentV()
{
InitializeComponent();
orderNum = "N";
FirstName = "Nl";
LastName = "Jk";
Address = "203030 drive";
ZipCode = "77088";
PhoneNumber = "833-223-2222";
}
public string orderNum
{
get
{
return CustomerOrderNumberLabel.Text;
}
set
{
CustomerOrderNumberLabel.Text = value;
}
}
public string FirstName
{
get
{
return CustomerFirstNameLabel.Text;
}
set
{
CustomerFirstNameLabel.Text = value;
}
}
public string LastName
{
get
{
return CustomerLastNameLabel.Text;
}
set
{
CustomerLastNameLabel.Text = value;
}
}
public string Address
{
get
{
return CustomerAddressLabel.Text;
}
set
{
CustomerAddressLabel.Text = value;
}
}
public string ZipCode
{
get
{
return CustomerZipCodeLabel.Text;
}
set
{
CustomerZipCodeLabel.Text = value;
}
}
public string PhoneNumber
{
get
{
return CustomerPhoneNumberLabel.Text;
}
set
{
CustomerPhoneNumberLabel.Text = value;
}
}
}
I want to know is there a way to take this what i have and reuse it on a whole different contentpage thats my issue i want to take this what i created and reuse it through out the app is this possible? can anyone lead me in the right direction! please thanks :)