/// <summary> /// Initializes a new instance of the <see cref="MoonDesk.MoonWindow"/> class. /// </summary> public MoonWindow() : base(Gtk.WindowType.Toplevel) { _host = new MoonArea(); this.Add (_host); this.ShowAll (); }
static void Start(string loadxaml, IEnumerable<Assembly> libs) { Gtk.Application.Init (); MoonBase.Init (); foreach (var lib in libs) MoonBase.Assemblies.Add (lib); var mw = new MoonArea (); mw.Content = new System.Windows.Controls.TextBlock (){ Text = "Loading..." }; MainWindow win = new MainWindow (); win.Title = "Xaml Source"; win.Show (); win.Resize (750, 600); win.MoonAreaContainer.Add (mw); var loader = new ViewLoader (mw); var xp = loader.LoadViewViewModel<XamlPanelViewModel> ("Views;component/Views/XamlPanel.xaml"); mw.Content = xp.View; win.XpVM = (XamlPanelViewModel)xp.ViewModel; if (loadxaml != null) { try { win.LoadFile (loadxaml); } catch (Exception e) { ((XamlPanelViewModel)xp.ViewModel).UserContent = new System.Windows.Controls.TextBlock () { Text = String.Format("Error\n\n{0}", e.Message ), Padding = new System.Windows.Thickness(10.0), FontStyle = System.Windows.FontStyles.Italic }; } } Gtk.Application.Run (); }
/// <summary> /// Initializes a new instance of the <see cref="MoonDesk.ViewLoader"/> class. /// </summary> public ViewLoader(MoonArea mhost) { Host = mhost; }
/// <summary> /// Initializes a new instance of the <see cref="MoonDesk.MoonWindow"/> class. /// </summary> public MoonWindow() : base(Gtk.WindowType.Toplevel) { _host = new MoonArea(); this.Add(_host); this.ShowAll(); }