2
我有一个弹出定义如下,WPF弹出式菜单控件消失立即
<Popup x:Name="popLines"
Placement="Bottom"
IsOpen="False"
Width="145" Height="42"
StaysOpen="False"
PopupAnimation="Fade"
AllowsTransparency="True"
HorizontalOffset="-2" VerticalOffset="0">
<Grid Margin="2">
<Path StrokeThickness="0.7" StrokeLineJoin="Round" Fill="#FFFFFFFF" Stretch="Fill" Stroke="Black" Data="M6.5,0.5 L30.167,0.5 30.167,8.4999992 190.16701,8.4999992 190.16701,44.166001 0.5,44.166001 0.5,8.4999992 6.5,8.4999992 6.5,0.5 z">
</Path>
<Grid>
<StackPanel Orientation="Horizontal">
<TextBox BorderBrush="Black" BorderThickness="0.5" Margin="5,10,2,2" Width="110" Height="20" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ToolTip="Excel File Path"></TextBox>
<Image Source="/App_Desktop;component/Resources/save.png" Margin="2,10,5,2" Width="16" Height="16"></Image>
</StackPanel>
</Grid>
</Grid>
</Popup>
我设置IsOpen=true
当图像MouseLeftButtonDown
事件fires.Except,弹出出现时应尽快消失。出了什么问题?
发生mouseup事件时,“IsOpen”属性是否自动设置为false?为什么? – Aks 2011-04-18 13:45:58
因为'StaysOpen =“False”',所以当Popup失去焦点时就会关闭它。 – dain 2011-04-18 13:49:29
但是,如果我设置了'StaysOpen =“True”'它将如何关闭? – Aks 2011-04-18 13:54:04