protected override void Dispose(bool disposing) { if (disposing) { this.Document.DocumentRoot.TypesChanged -= new EventHandler(this.DocumentRoot_TypesChanged); base.Dispose(disposing); if (this.imageHost != null) { this.imageHost.SizeChanged -= new SizeChangedEventHandler(this.ImageHost_DocumentSizeChanged); this.imageHost.Dispose(); this.imageHost = (ImageHost)null; } if (this.platformSurface == null) { return; } this.platformSurface.UnhandledException -= new UnhandledExceptionEventHandler(this.SilverlightImageHost_UnhandledException); this.platformSurface.Dispose(); this.platformSurface = (IPlatformSpecificView)null; } else { base.Dispose(disposing); } }
public SilverlightArtboard(IPlatformSpecificView platformView, IViewObjectFactory viewObjectFactory, ViewExceptionCallback viewExceptionCallback, ImageHost silverlightImageHost) : base(viewObjectFactory, viewExceptionCallback) { this.platformView = platformView; this.viewExceptionCallback = viewExceptionCallback; this.silverlightImageHost = silverlightImageHost; this.SilverlightRootTransform = (GeneralTransform) new MatrixTransform(Matrix.Identity); ((Panel)this.ResourcesHost).Children.Insert(1, (UIElement)this.silverlightImageHost); }
protected override Artboard CreateArtboard() { this.platformSurface = this.viewModel.ProjectContext.Platform.CreateSurface(); this.platformSurface.UnhandledException += new UnhandledExceptionEventHandler(this.SilverlightImageHost_UnhandledException); this.imageHost = this.platformSurface.CreateImageHost(); this.imageHost.DocumentSizeChanged += new EventHandler(this.ImageHost_DocumentSizeChanged); this.Document.DocumentRoot.TypesChanged += new EventHandler(this.DocumentRoot_TypesChanged); SilverlightArtboard silverlightArtboard = new SilverlightArtboard(this.platformSurface, this.Platform.ViewObjectFactory, new ViewExceptionCallback(((SceneView)this).OnExceptionWithUnknownSource), this.imageHost); this.platformSurface.BaseUri = this.ViewModel.ProjectContext.MakeDesignTimeUri(new Uri("/", UriKind.Relative), (string)null).OriginalString; return((Artboard)silverlightArtboard); }