【发布时间】:2013-12-10 23:32:03
【问题描述】:
我有这个问题,所以在 WPF 设计期间我什么都看不到。
这是乞讨时的 WPF 代码:
<UserControl x:Class="VolumeControlInterface.VolumeControlInterface"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vtkVC="clr-namespace:VtkVolumeControl;assembly=VtkVolumeControl"
xmlns:local="clr-namespace:VolumeControlInterface"
Height="700" Width="700" Margin="5"
下面是我的 WPF 代码:
<Grid DataContext="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}">
<vtkVC:VolumeRenderer Name="VolumeControl" Width="Auto" Height="Auto" Margin="5" Grid.Column="0"
LowerThresholdChanA="{Binding Path=BlackPoint0, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
UpperThresholdChanA="{Binding Path=WhitePoint0, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
LowerThresholdChanB="{Binding Path=BlackPoint1, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
UpperThresholdChanB="{Binding Path=WhitePoint1, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
LowerThresholdChanC="{Binding Path=BlackPoint2, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
UpperThresholdChanC="{Binding Path=WhitePoint2, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
LowerThresholdChanD="{Binding Path=BlackPoint3, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
UpperThresholdChanD="{Binding Path=WhitePoint3, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
IsChanASelected="{Binding Path=IsChanASelected, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
IsChanBSelected="{Binding Path=IsChanBSelected, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
IsChanCSelected="{Binding Path=IsChanCSelected, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
IsChanDSelected="{Binding Path=IsChanDSelected, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
DataSpacingZ="{Binding Path=DataSpacingZ, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
DataSpacingZMultiplier="{Binding Path=DataSpacingZMultiplier, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
FolderDirectory="{Binding Path=ZStackCacheDirectory, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
HardwareSettingsFile="{Binding Path=HardwareSettingsFile, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
TileIndex="{Binding Path=TileIndex, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
WellIndex="{Binding Path=WellIndex, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
TimePointIndex="{Binding Path=TimePointIndex, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
TotalSystemChannels="4"
Timepoints="1">
</vtkVC:VolumeRenderer>
</Grid>
这个项目是VolumeControlInterface,它从另一个项目导入VtkVolumeControl.dll作为参考。 VolumeRenderer 是 VtkVolumeControl 中的一个类。 VtkVolumeControl 构建成功,整个项目运行没有问题。只是我在VolumeControlInterface 的设计过程中看不到任何东西,它说“无法创建'VolumeRender'类型的实例”
我试过了:
删除VtkVolumeControl,然后重新添加。不工作。
在构造函数中使用if (!System.ComponentModel.DesignerProperties.GetIsInDesignMode(this)),也不起作用。
我想知道这里发生了什么,我应该如何使设计可见?
编辑: 我用的是VS2008,WINDOWS 7 64BIT
另外,每次我构建vtkVolumeControl.dll,VolumeControlInterface中的引用都会显示一个警告,说找不到vtkVolumeControl.dll;但是如果我继续构建VolumeControlInterface,它不会有任何问题,而且它似乎设法找到vtkVolumeControl.dll。
编辑: 这是它的外观:
【问题讨论】:
-
可能是一些设计时数据.....例如查看这篇文章 - blogs.msdn.com/b/wpfsldesigner/archive/2010/06/30/…
-
有没有可能是我错过了一些 VS 补丁?