/// <summary> /// Initializes an instance of this class. /// </summary> /// <param name="viewModel">The viewmodel represented by this view.</param> /// <param name="builder">The Gtk# builder used to build this view.</param> /// <param name="handle">The handle of the main widget.</param> protected DemoWindowView(DemoViewModel viewModel, Builder builder, IntPtr handle) : base(handle) { _viewModel = viewModel; builder.Autoconnect(this); // === Create sub-views. === var masterScopeScreenView = ScopeScreenView.Create(_viewModel.MasterScopeScreenVM); masterGraphicsContainer.Add(masterScopeScreenView); var slaveScopeScreenView = ScopeScreenView.Create(_viewModel.SlaveScopeScreenVM); slaveGraphicsContainer.Add(slaveScopeScreenView); // === Register event handlers. === DeleteEvent += OnDeleteEvent; // === Do some additional stuff. === graphicsContainerPane.Orientation = Orientation.Vertical; }
/// <summary> /// Creates a new instance of this class. /// </summary> /// <param name="viewModel">The viewmodel represented by the instance created.</param> public static DemoWindowView Create(DemoViewModel viewModel) { var builder = new Builder(null, "DemoWindowView.glade", null); return(new DemoWindowView(viewModel, builder, builder.GetObject("mainWidget").Handle)); }