示例#1
0
        public MainPage()
        {
            this.InitializeComponent();
            this.HorizontalContentAlignment = HorizontalAlignment.Stretch;
            this.VerticalContentAlignment   = VerticalAlignment.Stretch;
            this.Content = new ContentControl()
            {
                HorizontalAlignment        = HorizontalAlignment.Stretch,
                VerticalAlignment          = VerticalAlignment.Stretch,
                HorizontalContentAlignment = HorizontalAlignment.Stretch,
                VerticalContentAlignment   = VerticalAlignment.Stretch
            };
            host = new UIAwareHost((ContentControl)this.Content, typeof(MainPage), "app.js");

            host.AutoCheckUpdates  = true; // will future changes to app.js in RoaminState directory will be shown?
            host.OverwriteIfExists = true; // will embedded app.js always be overwriten on program start?
            host.Runtime.Rendered += Host_Rendered;
            host.Startup();
        }
示例#2
0
 protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
 {
     host.Runtime.Close();
     host = null;
     base.OnNavigatingFrom(e);
 }