Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/332.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 内容控件中定义的面板的绝对位置_C#_Xaml_Uwp_Winrt Xaml_Uwp Xaml - Fatal编程技术网

C# 内容控件中定义的面板的绝对位置

C# 内容控件中定义的面板的绝对位置,c#,xaml,uwp,winrt-xaml,uwp-xaml,C#,Xaml,Uwp,Winrt Xaml,Uwp Xaml,我试图通过继承控件类(具有自定义操作的按钮),在Windows UWP中编写自定义控件。单击此按钮后,我希望在页面底部显示一个面板,而不管控件在页面中的何处使用(有点像弹出窗口,但我需要在屏幕上定义面板位置的自由度) 谁能帮助我如何在XAML中完成这项工作。下面是我用于自定义控件的模板 <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x=

我试图通过继承
控件
类(具有自定义操作的按钮),在Windows UWP中编写自定义控件。单击此按钮后,我希望在页面底部显示一个面板,而不管控件在页面中的何处使用(有点像弹出窗口,但我需要在屏幕上定义面板位置的自由度)

谁能帮助我如何在XAML中完成这项工作。下面是我用于自定义控件的模板

<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:UI.Controls"
    xmlns:converters="using:UI.ValueConverters">
    <Style TargetType="local:Plugin">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:Plugin">
                    <Grid>
                        <Grid.Resources>
                            <converters:NullToVisibilityConverter x:Key="NullToVisibilityConverter" />
                            <x:Double x:Key="EllipseDimension">30</x:Double>
                        </Grid.Resources>
                        <Button Name="PluginButton"
                                Width="{TemplateBinding PluginWidth}"
                                Height="{TemplateBinding PluginHeight}"
                                Command="{Binding PluginTrigger}"
                                Padding="0"
                                VerticalAlignment="Top"
                                AutomationProperties.Name="Main button"
                                Background="Transparent"
                                BorderThickness="0"
                                TabIndex="0">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="48" />
                                </Grid.ColumnDefinitions>
                                <SymbolIcon Symbol="{TemplateBinding Symbol}"
                                            Visibility="{Binding Image, Converter={StaticResource NullToVisibilityConverter}, ConverterParameter=true}"
                                            Foreground="Black"
                                            VerticalAlignment="Center"
                                            HorizontalAlignment="Center"
                                            ToolTipService.ToolTip="{TemplateBinding Label}" />

                                <Ellipse Visibility="{Binding Image, Converter={StaticResource NullToVisibilityConverter}}"
                                         Width="{StaticResource EllipseDimension}" 
                                         Height="{StaticResource EllipseDimension}">
                                    <Ellipse.Fill>
                                        <ImageBrush ImageSource="{Binding Image}" />
                                    </Ellipse.Fill>
                                </Ellipse>
                            </Grid>
                        </Button>
                        <StackPanel Name="popuptoshow"></StackPanel>
                    </Grid>

                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>

30