1
<StackPanel Name="mypanel">
<ScrollViewer Height="{Binding ElementName=mypanel, Path=ActualHeight}">
我需要,Height = mypanel.ActualHeight-60
。StackPanel中的ScrollViewer
我該怎麼辦?
編輯:
<StackPanel Name="mypanel">
<ContentControl Content="{Binding HeaderPart}" /> <= here must be Expander
<ScrollViewer Height="{Binding ElementName=mypanel, Path=ActualHeight, Converter={StaticResource HeightConverter}}" >
<StackPanel>
</StackPanel>
</ScrollViewer>
當沒有Expander
,一切工作正常。當Expander
是,mypanel.ActualHeight
,HeightAdjustmentConverter = 0
。
發生了什麼事?
哦,謝謝=^^ = – Kira 2010-08-16 11:12:24
在XAML它會是這樣嗎? @ SciraViewer Height =「{Binding ElementName = mypanel,Path = ActualHeight,Converter = {StaticResource HeightAdjustmentConverter}}」 – Kira 2010-08-16 11:24:13
@Kira是的,這是對的,用一行代碼實際創建靜態資源。 – 2010-08-16 11:25:35