Hello,
It is recommended to use thread-safe singleton mode to achieve this functionality.
Please refer to the following code:
public class ContactInfo
{
private static ContactInfo instance = null;
private static readonly object obj = new object();
public static ContactInfo Instance
{
get
{
lock (obj)
{
if (instance == null)
{
instance = new ContactInfo();
}
return instance;
}
}
}
}
Then, you could use ContactInfo.Instance
to use this object by all the contentpage.
Best Regards,
Alec Liu.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.