当前位置: 动力学知识库 > 问答 > 编程问答 >

c# - Can i choose more then one value for an attribute in XAML?

问题描述:

I am experimenting with ManipulationMode in XAML for an Windows store app. I want to have as many settings directly in my xaml so I don't have to use the code behind so much. When I found a solution to get my swipe recognition working I found something to do in code behind like the following:

myGrid.ManipulationMode = ManipulationModes.TranslateX | ManipulationModes.TranslateY;

Now I tried to get this working by using some xaml code. I then used this

<Grid Style="{StaticResource LayoutRootStyle}" ManipulationMode="TranslateY" ManipulationCompleted="manipulationCompleted">

This works fine but I didn't find a way to use ManipulationMode TranslateX AND TranslateY at the same time.

I tried to add some boolean operators in the attribute and the following snippet inside my grid.

<Grid.ManipulationMode>

<ManipulationModes>TranslateX</ManipulationModes>

<ManipulationModes>TranslateY</ManipulationModes>

</Grid.ManipulationMode>

What do I get wrong or is it not possible to make this in pure XAML?

Thanks Hermann

网友答案:

You need to use comma separated values.

分享给朋友:
您可能感兴趣的文章:
随机阅读: