Popup弹窗
<pre><code class="language-csharp">&lt;StackPanel Orientation=&quot;Horizontal&quot; Margin=&quot;20&quot; Height=&quot;40&quot;&gt;
&lt;TextBlock Margin=&quot;10 0&quot; Text=&quot;加油!&quot; Height=&quot;35&quot; VerticalAlignment=&quot;Center&quot;&gt;&lt;/TextBlock&gt;
&lt;TextBox GotFocus=&quot;TextMenu_GotFocus&quot; LostFocus=&quot;TextMenu_LostFocus&quot; x:Name=&quot;TextMenu&quot; Margin=&quot;10 0&quot; Width=&quot;200&quot; Height=&quot;35&quot; VerticalAlignment=&quot;Center&quot;&gt;&lt;/TextBox&gt;
&lt;Button Margin=&quot;10 0&quot; Content=&quot;确定&quot; Width=&quot;80&quot; Height=&quot;35&quot; VerticalAlignment=&quot;Center&quot;&gt;&lt;/Button&gt;
&lt;Popup x:Name=&quot;MyPopup&quot;
Placement=&quot;Top&quot;
PopupAnimation=&quot;Slide&quot;
Width=&quot;{Binding ElementName=TextMenu,Path=ActualWidth}&quot;
PlacementTarget=&quot;{Binding ElementName=TextMenu}&quot;&gt;
&lt;ListBox x:Name=&quot;MyList&quot; SelectionChanged=&quot;ListBox_SelectionChanged&quot;&gt;
&lt;ListBoxItem Content=&quot;笑死&quot;&gt;&lt;/ListBoxItem&gt;
&lt;ListBoxItem Content=&quot;唧唧歪歪&quot;&gt;&lt;/ListBoxItem&gt;
&lt;ListBoxItem Content=&quot;逼逼奈奈&quot;&gt;&lt;/ListBoxItem&gt;
&lt;/ListBox&gt;
&lt;!--&lt;TextBlock Text=&quot;hello!popup&quot; Foreground=&quot;Red&quot; FontSize=&quot;25&quot;&gt;&lt;/TextBlock&gt;--&gt;
&lt;/Popup&gt;
&lt;/StackPanel&gt;</code></pre>