Message 1 of 14
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I am trying to embed a webpage link as follows in my Revit Doackable window application/Command:
But I get a blank dockable window.
Trying to embed www.google.com works successfully, embedding google maps pops up a lot of script errors as such:
I was following this tutorial for creating this dockable window.
Next, I will be following this advanced solution made by @ricaun:
https://github.com/ricaun-io/RevitAddin.Dockable.Example/tree/master
My viewer xaml file is as simple as that:
<Page x:Class="RevitAddInsWPFSample.Viewer"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:RevitAddInsWPFSample"
mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="280" Title="WPF Sample" Background="White">
<Border BorderBrush="LightGray" BorderThickness="1">
<Grid Background="White" Margin="5" >
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<WebBrowser Grid.Row="1" Name="webbrowser" Margin="5"/>
</Grid>
</Border>
</Page>
While my .xaml.cs file contains:
public partial class Viewer : Page, IDockablePaneProvider
{
// fields
public ExternalCommandData eData = null;
public Document doc = null;
public UIDocument uidoc = null;
// IDockablePaneProvider abstrat method
public void SetupDockablePane(DockablePaneProviderData data)
{
// wpf object with pane's interface
data.FrameworkElement = this as FrameworkElement;
// initial state position
data.InitialState = new DockablePaneState
{
DockPosition = DockPosition.Tabbed,
TabBehind = DockablePanes.BuiltInDockablePanes.ProjectBrowser
};
}
// constructor
public Viewer()
{
InitializeComponent();
webbrowser.Source = new Uri("https://momento360.com/e/u/1eb0c5b8c1a64ef5a946b8ed3d53982e?utm_campaign=embed&utm_source=other&heading=0&pitch=0&field-of-view=75&size=medium&display-plan=true");
}
// custom initiator
public void CustomInitiator(ExternalCommandData e)
{
// ExternalCommandData and Doc
eData = e;
doc = e.Application.ActiveUIDocument.Document;
uidoc = eData.Application.ActiveUIDocument;
}
}
Any idea how can I sort this out?
Thank you!
Solved! Go to Solution.