扩展器在MS Surface中不起作用 [英] Expander is not working in MS Surface

查看:78
本文介绍了扩展器在MS Surface中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Surface应用程序中使用扩展器,但是在单击箭头按钮时它没有工作。

< DataTemplate x :密钥= QUOT; ProductBacklogItemDataTemplate"> 
< Grid>
< StackPanel Orientation =" Horizo​​ntal"宽度= QUOT; 280"的Horizo​​ntalAlignment = QUOT;中心">
< Expander>
< Expander.Header>
< StackPanel Orientation =" Horizo​​ntal">
< Label Width =" 200"高度= QUOT; 40" VerticalAlignment = QUOT;中心" VerticalContentAlignment = QUOT;中心" Content =" {Binding StoryName}"的FontFamily = QUOT; Arial字体"字号= QUOT; 15" />
< Ellipse Fill =" {Binding State}"高度= QUOT; 15"宽度= QUOT; 15"的Horizo​​ntalAlignment = QUOT;中心" VerticalAlignment = QUOT;中心" />
< / StackPanel>
< /Expander.Header>
< TextBlock Width =" 280"的Horizo​​ntalAlignment = QUOT;拉伸"高度= QUOT;自动" Text =" {Binding StoryContent}"的FontFamily = QUOT; Arial字体"字号= QUOT; 15"前景= QUOT;白色" />
< / Expander>
< / StackPanel>
< / Grid>
< / DataTemplate>

任何人都可以帮我吗?


谢谢。


Frank

解决方案

Surface响应Touch的所有兼容控件都带有Surfacexxxxx前缀,如SurfaceButton,SurfaceTextBox etcc。


Expender不是其中之一,也不是与Surface兼容的控件。 

Expender只不过是基于clik可见或不可见的内容。


在Surface下,您可以使用SurfaceButton轻松重现该行为,您可以更改样式和堆栈面板的内容。

然后当您触摸SurfaceButton你可以用动画和触发器改变Stack面板的高度值。


其他选项包括更多的工作是创建你自己的Expender并添加Touch功能但是在我看来有没有任何意义,因为tehre更简单的工作


reagrds


哔叽


I am trying to using expander in surface app, but it didn't work while click on the arrow button.

<DataTemplate x:Key="ProductBacklogItemDataTemplate">
            <Grid>
                <StackPanel Orientation="Horizontal" Width="280" HorizontalAlignment="Center">
                    <Expander>
                        <Expander.Header>
                            <StackPanel Orientation="Horizontal">                                
                                <Label Width="200" Height="40" VerticalAlignment="Center" VerticalContentAlignment="Center" Content="{Binding StoryName}" FontFamily="Arial" FontSize="15"/>
                                <Ellipse Fill="{Binding State}" Height="15" Width="15" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                            </StackPanel>
                        </Expander.Header>
                        <TextBlock Width="280" HorizontalAlignment="Stretch" Height="Auto" Text="{Binding StoryContent}" FontFamily="Arial" FontSize="15" Foreground="White"/>
                    </Expander>
                </StackPanel>
            </Grid>
        </DataTemplate>

Can anybody help me with this?

Thanks.

Frank

解决方案

All compatible control with Surface responsing to Touch are with the prefix Surfacexxxxx like SurfaceButton, SurfaceTextBox etcc.

Expender is not one of those and not a control compatible with Surface. 
Expender is nothing else than a content which gets visible or not based on a clik.

Under surface you can easily reproduce that behaviour with a SurfaceButton that you can change the styling and stack panel where your content will go.
Then when you Touch the SurfaceButton you can change the Height value of the Stack panel with animation and triggers.

Other option with more work would be to create your own Expender and add Touch functionnalities but in my mind there is no sense for that as tehre is simpler work around

reagrds

serge


这篇关于扩展器在MS Surface中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆