Ejemplo n.º 1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            var xamlLoader = new XamlLoader(new[]
            {
                Assembly.Load(new AssemblyName("OmniGui")),
                Assembly.Load(new AssemblyName("OmniGui.Xaml")),
                Assembly.Load(new AssemblyName("AndroidApp")),
                Assembly.Load(new AssemblyName("ViewModels")),
            });

            string xaml;

            using (var r = new StreamReader(Assets.Open("layout.xaml")))
            {
                xaml = r.ReadToEnd();
            }

            var layout = (Layout)xamlLoader.Load(xaml).Instance;

            var omniGuiView = new OmniGuiView(ApplicationContext, layout);

            Platform.Current = new AndroidPlatform(omniGuiView);
            SetContentView(omniGuiView);
        }
Ejemplo n.º 2
0
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            // create a new window instance based on the screen size
            Window = new UIWindow(UIScreen.MainScreen.Bounds);

            // If you have defined a root view controller, set it here:
            var vc = new UIViewController();
            var sampleViewModel     = new SampleViewModel(new iOSMessageService());
            var omniGuiViewReloaded = new OmniGuiView {
                Source = "Layout.xaml"
            };

            omniGuiViewReloaded.DataContext = sampleViewModel;
            vc.View = omniGuiViewReloaded;

            Window.RootViewController = vc;

            UIApplication.SharedApplication.StatusBarHidden = true;

            // make the window visible
            Window.MakeKeyAndVisible();

            return(true);
        }
Ejemplo n.º 3
0
 public AndroidPlatform(OmniGuiView view)
 {
     TextEngine  = new AndroidTextEngine();
     EventSource = new AndroidEventProcessor(view);
 }