- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Thanks on all great posts on the forum which helped me to start entering into Revit API world 🙂
At the very beginning I have a problem with Dockable panel created for revit 2017.
The problem is shown in the attached picture (blank/black dockable panel space even though I created page.xaml)
What do I do wrong?
Here's the code for App:
namespace DockTest
{
class App : IExternalApplication
{
public Result OnStartup(UIControlledApplication a)
{
//TODO: Register dockable panel "Test".
Test page1 = new Test();
DockablePaneId paneId = new DockablePaneId(new Guid("9d7ed357-534f-4d87-afc4-8e784e3b119e"));
a.RegisterDockablePane(paneId, "Test", (IDockablePaneProvider)page1);
return Result.Succeeded;
}
public Result OnShutdown(UIControlledApplication a)
{
return Result.Succeeded;
}
}
}
and this is the code for .xaml:
<Page x:Class="DockTest.Test"
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:DockTest"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300"
Title="Test">
<Grid Background="#FFE1E1E1">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
</Grid.ColumnDefinitions>
<Label Grid.Row="0">Log</Label>
<StackPanel Grid.Row="0">
<Button Name="checkAllButton" Click="checkAllButton_Click">Check All</Button>
<Button Name="checkNoneButton" Click="checkNoneButton_Click">Check None</Button>
<Button Name="okButton" Click="okButton_Click">OK</Button>
<Button Name="cancelButton" Click="cancelButton_Click">Cancel</Button>
<Button Name="isolateButton" Click="isolateButton_Click">Isolate</Button>
</StackPanel>
<TextBox Name="tb_output" Grid.Row="1" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Visible" TextChanged="tb_output_TextChanged"/>
<Label Content="Project Name:" Grid.Row="2" Height="28" HorizontalAlignment="Left" Name="lblProjectNameHeading" VerticalAlignment="Top" Margin="-1,6,0,0" />
<Label Content="Label" Grid.Row="2" Height="26" HorizontalAlignment="Left" Margin="76,6,0,0" Name="lblProjectName" VerticalAlignment="Top" Width="114" />
</Grid>
</Page>
code for xaml.cs:
namespace DockTest
{
/// <summary>
/// Interaction logic for Test.xaml
/// </summary>
public partial class Test : Page, IDockablePaneProvider
{
public void SetupDockablePane(DockablePaneProviderData data)
{
data.FrameworkElement = this as FrameworkElement; ;
data.InitialState.DockPosition = DockPosition.Tabbed;
//data.InitialState.TabBehind = Autodesk.Revit.UI.DockablePanes.BuiltInDockablePanes.PropertiesPalette;
data.InitialState.TabBehind = Autodesk.Revit.UI.DockablePanes.BuiltInDockablePanes.ElementView;
}
private void checkAllButton_Click(object sender, RoutedEventArgs e)
{
}
private void checkNoneButton_Click(object sender, RoutedEventArgs e)
{
}
private void okButton_Click(object sender, RoutedEventArgs e)
{
}
private void cancelButton_Click(object sender, RoutedEventArgs e)
{
}
private void isolateButton_Click(object sender, RoutedEventArgs e)
{
}
private void tb_output_TextChanged(object sender, TextChangedEventArgs e)
{
}
}
}
Thanks in advance,
Mileta
Solved! Go to Solution.