UWP自定义按钮弹出

时间:2018-11-22 07:13:33

标签: .net xaml uwp

当我单击弹出显示时,我有一个按钮弹出。我可以在单击的按钮上重新放置弹出按钮吗?我在项目模板中使用Gridview和datatemplate有按钮,我希望按钮弹出按钮将在我单击的按钮上。我可以使用弹出按钮来做到吗?如果没有控制,我能做到吗?

enter image description here

<Grid Width="230" Height="230"
                Background="White"
                BorderBrush="White"
                BorderThickness="0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="3*"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="2*"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Row="0" Grid.Column="0"
                       HorizontalAlignment="Left"
                       VerticalAlignment="Bottom"
                       Text="{Binding Title}"/>
                <Button Grid.Row="0" Grid.Column="1"
                    Style="{StaticResource CircleButton}"
                    Content="&#xE712;"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center">
                    <Button.Flyout>
                        <Flyout>
                            <StackPanel>
                                <Grid Width="230" Height="230">
                                    <Grid.RowDefinitions>
                                        <RowDefinition/>
                                        <RowDefinition/>
                                        <RowDefinition/>
                                        <RowDefinition/>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                    </Grid.ColumnDefinitions>
                                    <Button Grid.Row="0">ạkdasdjhas</Button>
                                    <Button Grid.Row="1">123123123</Button>
                                    <Button Grid.Row="2">dfsdfsdfsd</Button>
                                    <Button Grid.Row="3">qưewqeqwe</Button>
                                </Grid>
                            </StackPanel>
                        </Flyout>
                    </Button.Flyout>
                </Button>
                <StackPanel Grid.Row="1" Grid.ColumnSpan="2" Orientation="Vertical">
                    <TextBlock HorizontalAlignment="Left"
                               VerticalAlignment="Center"
                               Text="{Binding Title}"
                               FontSize="20"
                               Margin="0,5,0,0"
                               FontWeight="Bold"/>
                    <TextBlock HorizontalAlignment="Left"
                               VerticalAlignment="Center"
                               Text="{Binding Title}"
                               FontSize="15"
                               Margin="0,5,0,0"/>
                    <TextBlock HorizontalAlignment="Left"
                               VerticalAlignment="Center"
                               Text="{Binding Title}"
                               FontSize="15"
                               Margin="0,5,0,0"
                               Foreground="Gray"/>
                </StackPanel>
            </Grid>

0 个答案:

没有答案