Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
teocomi committed Apr 20, 2023
1 parent 72d2ae7 commit f36d72f
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions ConnectorRevit/ConnectorRevit/WebUI/WebUIPanel.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,37 @@ public partial class WebUIPanel : Page, Autodesk.Revit.UI.IDockablePaneProvider
{

#if DEBUG
public WebUIPanel(WebUIBindings webUIBindings, string address = "http://localhost:8080")
public WebUIPanel(WebUIBindings webUIBindings, string address = "https://distracted-jones-770c28.netlify.app/")
#else
public WebUIPanel(WebUIBindings webUIBindings, string address = "https://dashing-haupia-e8f6e3.netlify.app/")
#endif
{
//InitializeCef();
InitializeComponent();
Browser.FrameLoadEnd += Browser_FrameLoadEnd; ;
webUIBindings.Browser = Browser;

//CefSharpSettings.LegacyJavascriptBindingEnabled = true;


#if (REVIT2022)
// old method
Browser.RegisterAsyncJsObject("UiBindings", webUIBindings);
CefSharpSettings.LegacyJavascriptBindingEnabled = true;
Browser.RegisterAsyncJsObject("UiBindings", webUIBindings, options: BindingOptions.DefaultBinder);


#else
// new method
Browser.JavascriptObjectRepository.Settings.LegacyBindingEnabled = true;
Browser.JavascriptObjectRepository.Register("UiBindings", webUIBindings, isAsync: true, options: BindingOptions.DefaultBinder);
#endif
Browser.Address = address;

}

private void Browser_FrameLoadEnd(object sender, FrameLoadEndEventArgs e)
{
#if DEBUG
Browser.ShowDevTools();
#endif
}


Expand Down

0 comments on commit f36d72f

Please sign in to comment.