locked
ManipulationModes combination errors

    Question

  • Hello!

    According to this page, starting with windows 8.1 it is possible to combine "System" and other values in UIElement.ManipulationMode property.

    But when I write in XAML or in code

    this.ManipulationMode = ManipulationModes.System | ManipulationModes.Rotate;

    exception occurs: "Invalid ManipulationModes combination".

    What am i doing wrong?

    Thank you.


    Vladimir Khil

    Tuesday, April 15, 2014 6:56 AM

Answers

  • From the documentation:

    You can specify more than one of the flagwise ManipulationModes values as the value of the ManipulationMode property. This is possible in XAML using the comma syntax shown in the "XAML Values" section. For example, you can combine TranslateX, TranslateY, Rotate, and Scale, or any combination of these. However, not all combinations are valid. Validity is enforced only once ManipulationModesis used by a specific control, so issues with setting an invalid combination of ManipulationModesmight not appear until run-time when values are applied.

    http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.uielement.manipulationmode.aspx


    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    • Marked as answer by Ur-Quan Wednesday, April 16, 2014 4:29 AM
    Tuesday, April 15, 2014 1:29 PM
    Moderator

All replies

  • From the documentation:

    You can specify more than one of the flagwise ManipulationModes values as the value of the ManipulationMode property. This is possible in XAML using the comma syntax shown in the "XAML Values" section. For example, you can combine TranslateX, TranslateY, Rotate, and Scale, or any combination of these. However, not all combinations are valid. Validity is enforced only once ManipulationModesis used by a specific control, so issues with setting an invalid combination of ManipulationModesmight not appear until run-time when values are applied.

    http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.uielement.manipulationmode.aspx


    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    • Marked as answer by Ur-Quan Wednesday, April 16, 2014 4:29 AM
    Tuesday, April 15, 2014 1:29 PM
    Moderator
  • OK, thank you, i'll try it on another UIElement.

    Vladimir Khil

    Wednesday, April 16, 2014 4:29 AM