1

Say I have an 'ContentPage' - object without the XAML file. Is it possible to display the contents of it in foreground fullscreen or in a grid column of an app?

I have a plugin which has an Interface

public interface IPlugin
{
    ContentPage GetPluginUI();
}

The Plugin itself returns a new instance of my source XAML file "BigView"

    public ContentPage GetPluginUI()
    {
        return new BigView();
    }

which is derived from "ContentPage".

Now when I load the Plugin in the host program, I get the ContentPage object:

ContentPage pluginContentPage = plugin.GetPluginUI();

How to display "pluginContentPage" for testing?

jgoldberger - MSFT
  • 5,978
  • 2
  • 20
  • 44
Christoph
  • 542
  • 4
  • 24
  • Please show the code you are trying to use; Generally speaking if you have an instance of a `UIElement` you can display it. – BradleyDotNET Dec 07 '16 at 18:17
  • @BradleyDotNET I'm sorry! I updated the question with my code. Perhaps you can take a look on it! Have a nice day! – Christoph Dec 08 '16 at 08:47
  • I'm not aware of the `ContentPage` class; is it a custom class deriving from `UIElement` or one of its sub classes? I have solved this general problem many times, just want to make sure my knowledge will apply – BradleyDotNET Dec 08 '16 at 18:15
  • @BradleyDotNET This is the ContentPage class: https://developer.xamarin.com/api/type/Xamarin.Forms.ContentPage – Christoph Dec 08 '16 at 20:29
  • The concept you are looking for is `ContentControl` I can't find one in Xamarin (especially not one that displays a page). Sorry I can't be more help than that. For fullscreen display you could try navigating to your page object – BradleyDotNET Dec 08 '16 at 21:49
  • @BradleyDotNET Ok. Thanks for your response. Is there a change to display it in *any* way. Even that I could not get to work. – Christoph Dec 09 '16 at 08:17
  • I'm just not sure, sorry. I haven't actually worked in Xamarin before (just WPF and UWP). – BradleyDotNET Dec 09 '16 at 17:20
  • 1
    What are you using as MainPage of your app? If it is NavigationPage then you can PushAsync(GetPluginUI()); If your BigView is a main page then you can assign apps MainPage to BigView – Yuri S Dec 09 '16 at 21:32

0 Answers0