diff --git a/Xbim.Presentation/DrawingControl3D.xaml.cs b/Xbim.Presentation/DrawingControl3D.xaml.cs index f5268102..0eb33c8b 100644 --- a/Xbim.Presentation/DrawingControl3D.xaml.cs +++ b/Xbim.Presentation/DrawingControl3D.xaml.cs @@ -664,11 +664,13 @@ private IPersistEntity GetClickedEntity(RayMeshGeometry3DHitTestResult hit) : (modelHit.Instances[frag.EntityLabel]); } - #endregion + public event EventHandler GeometryLoaded; + + #endregion - #region Dependency Properties + #region Dependency Properties - public double ModelOpacity + public double ModelOpacity { get { return (double)GetValue(ModelOpacityProperty); } set { SetValue(ModelOpacityProperty, value); } @@ -1518,6 +1520,8 @@ public void LoadGeometry(IfcStore model, ModelRefreshOptions options = ModelRefr } RecalculateView(options); + + GeometryLoaded?.Invoke(this, EventArgs.Empty); } private void LoadReferencedModel(IReferencedModel refModel) diff --git a/Xbim.Presentation/Xbim.Presentation.csproj b/Xbim.Presentation/Xbim.Presentation.csproj index 6c862df6..70eb23c5 100644 --- a/Xbim.Presentation/Xbim.Presentation.csproj +++ b/Xbim.Presentation/Xbim.Presentation.csproj @@ -43,7 +43,7 @@ - + diff --git a/Xbim.WinformsSample/Xbim.WinformsSample.csproj b/Xbim.WinformsSample/Xbim.WinformsSample.csproj index 7da9346e..f7889308 100644 --- a/Xbim.WinformsSample/Xbim.WinformsSample.csproj +++ b/Xbim.WinformsSample/Xbim.WinformsSample.csproj @@ -49,8 +49,8 @@ - - + + diff --git a/XbimXplorer/Commands/wdwCommands.xaml.cs b/XbimXplorer/Commands/wdwCommands.xaml.cs index 69fff060..3434f505 100644 --- a/XbimXplorer/Commands/wdwCommands.xaml.cs +++ b/XbimXplorer/Commands/wdwCommands.xaml.cs @@ -2813,9 +2813,9 @@ private static string ReportPropValue(object propVal, ref List retIds, bool ? " [#" + propLabel + "]" : "" ); - if (pe as Xbim.Ifc2x3.Interfaces.IIfcCartesianPoint != null) + if (pe as IIfcCartesianPoint != null) { - var n = pe as Xbim.Ifc2x3.Interfaces.IIfcCartesianPoint; + var n = pe as IIfcCartesianPoint; var vals = n.Coordinates.Select(x => x.Value); ret += "\t" + string.Join("\t,\t", vals); } diff --git a/XbimXplorer/XbimXplorer.csproj b/XbimXplorer/XbimXplorer.csproj index 1cf6982e..bc783d86 100644 --- a/XbimXplorer/XbimXplorer.csproj +++ b/XbimXplorer/XbimXplorer.csproj @@ -62,8 +62,8 @@ - - + + diff --git a/XbimXplorer/XplorerMainWindow.xaml.cs b/XbimXplorer/XplorerMainWindow.xaml.cs index 60ed50e3..3eb8ca0e 100644 --- a/XbimXplorer/XplorerMainWindow.xaml.cs +++ b/XbimXplorer/XplorerMainWindow.xaml.cs @@ -47,6 +47,9 @@ using Xbim.IO; using Xbim.Geometry.Engine.Interop; using System.Windows.Media; +using Xbim.Common.Configuration; +using Microsoft.Extensions.DependencyInjection; + #endregion @@ -117,7 +120,7 @@ private void SetOpenedModelFileName(string ifcFilename) public XplorerMainWindow(bool preventPluginLoad = false) { // So we can use *.xbim files. - IfcStore.ModelProviderFactory.UseHeuristicModelProvider(); + XbimServices.Current.ConfigureServices(s => s.AddXbimToolkit(opt => opt.AddHeuristicModel())); LogSink = new InMemoryLogSink { Tag = "MainWindow" }; LogSink.Logged += LogEvent_Added; @@ -138,7 +141,7 @@ public XplorerMainWindow(bool preventPluginLoad = false) .Enrich.FromLogContext() .CreateLogger(); // Set XBIM Essentials/Geometries's LoggerFactory - so Serilog drives everything. - XbimLogging.LoggerFactory = LoggerFactory; + XbimServices.Current.ConfigureServices(s => s.AddSingleton(typeof(ILoggerFactory), LoggerFactory)); Logger = LoggerFactory.CreateLogger(); diff --git a/XplorerPlugin.Bcf/XplorerPlugin.Bcf.csproj b/XplorerPlugin.Bcf/XplorerPlugin.Bcf.csproj index df0e99d8..a80dcd1e 100644 --- a/XplorerPlugin.Bcf/XplorerPlugin.Bcf.csproj +++ b/XplorerPlugin.Bcf/XplorerPlugin.Bcf.csproj @@ -68,6 +68,6 @@ - + \ No newline at end of file