Flyout IsPinned = False / True(MahApps)

时间:2016-11-12 02:22:23

标签: c# wpf mahapps.metro

我在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>

0 个答案:

没有答案