我在MahApps中有弹出窗口的2个“问题”
1)当IsPinned="False"
和ExternalCloseButton="Left"
时,需要两次点击才能将焦点放在控件上(本例中为文本框),1表示关闭弹出窗口,1表示焦点控制。是否有可能只需单击一下,关闭弹出按钮并专注于控件?
当“IsPinned=True
”和控件具有焦点时,当弹出按钮自动关闭时,控件将失去焦点。
THX!
<mahApps:MetroWindow x:Class="IsPinned.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mahApps="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
Title="MainWindow"
Height="350"
Width="525"
WindowTransitionsEnabled="False"
WindowStartupLocation="CenterScreen"
BorderBrush="{DynamicResource AccentColorBrush}">
<mahApps:MetroWindow.Flyouts>
<mahApps:FlyoutsControl>
<mahApps:Flyout IsPinned="False"
Height="150"
Width="250"
IsOpen="True"
Position="Left"
ExternalCloseButton="Left"
AutoCloseInterval="6000"
IsAutoCloseEnabled="True">
<mahApps:Flyout.HeaderTemplate>
<DataTemplate>
<Label Content="Test"/>
</DataTemplate>
</mahApps:Flyout.HeaderTemplate>
</mahApps:Flyout>
</mahApps:FlyoutsControl>
</mahApps:MetroWindow.Flyouts>
<StackPanel>
<TextBox Margin="5"></TextBox>
</StackPanel>
</mahApps:MetroWindow>