自定义了一个下拉表格控件, Generic.xaml关键代码如下: <Popup IsOpen="{Binding IsDropdownOpened, Mode=TwoWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:DropDownTable}}, UpdateSourceTrigger=PropertyChanged}" AllowsTransparency="True" MaxHeight="{Binding MaxDropdownHeight, Mode=TwoWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:DropDownTable}}}" Width="{TemplateBinding ActualWidth}" StaysOpen="False" PopupAnimation="Fade" MinHeight="{Binding MinDropdownHeighte, Mode=TwoWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:DropDownTable}}}" > <Border Background="White" Margin="3"> <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto"> <VirtualizingStackPanel x:Name="PART_ItemPanel" MaxHeight="{TemplateBinding MaxDropdownHeight}" MinHeight="{TemplateBinding MinDropdownHeight}"> <DataGrid x:Name="PART_Data" DataContext="{TemplateBinding DataSource}"/> </VirtualizingStackPanel> </ScrollViewer> <Border.Effect> <DropShadowEffect BlurRadius="8" ShadowDepth="6" Opacity="0.8" Color="#FF939090" /> </Border.Effect> </Border> </Popup> |
|
40分 |
用blend做,省去这些麻烦
|
你的IsOpen属性绑定源有变化吗?
|
|
我有增加Ispen值改变事件。 |
|
up up up 求大大解答
|
|
用blend做很快就做好了,谢谢大大 |