locked
Layout cycle detected. Layout could not complete. RRS feed

  • Question

  • Hi ,

    I'm building a UWP with C# and XAML. I have used VS2015 and the UWP for 8.1 template. In my windows phone solution I'm getting the error layout cycle.... 

    In my XAML page I have a datagrid, a progress ring and a button. When I press the button, a Filesavepicker opens were I'm allowing the user to save the data in his preferred location. When the Filesavepicker closes and the app is resuming the application crashes with the error.

    I have disabled a lot of UI things and the LayoutUpdated event but with no success. I cannot track where the problem is.

    The code is working with the emulator but it doesn't work when I deploy to the device which loads windows 10 as OS.

    Also the code was working in windows phone 8.1.

    Another error I'm getting is

    "A cycle occurred while laying out the GUI."

    The data that I'm binding in the Grid are only two rows.

    Does anyone has any clue what to search for or some guidance would be mostly appreciated ?

    thank you



    • Edited by zakkar Thursday, June 2, 2016 12:51 PM
    Thursday, June 2, 2016 12:17 PM

Answers

  • Hi Leon ,

    It seems to be an issue with the progressring controls.

    Before I open the FilePicker I'm displaying a progressring . When finally the user returns (after he has selected the file location that he wishes to save his data) then I'm making the progressring invisible. Then the app crashes.

    I have removed the progressing and everything I'm doing in the LayoutUpdated event and it worked.

    I cannot give you an example because I'm also using some third party controls and it will not work for you.

    But when I disabled  the display of the progressing it worked.

    This is completely strange.

    • Proposed as answer by Active Geometry Wednesday, June 8, 2016 3:04 AM
    • Marked as answer by Barry Wang Thursday, June 16, 2016 9:45 AM
    Friday, June 3, 2016 1:42 PM

All replies

  • Hi zakkar,

    Could you please share some related code? Or just share a demo project with us, we could help make a test with it and to see if we could reproduce this issue. Also, have you tried to run your project in other machine to check if this issue is related with the environment?

    Best Regards,

    Leon Guang


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, June 3, 2016 9:39 AM
  • Hi Leon ,

    It seems to be an issue with the progressring controls.

    Before I open the FilePicker I'm displaying a progressring . When finally the user returns (after he has selected the file location that he wishes to save his data) then I'm making the progressring invisible. Then the app crashes.

    I have removed the progressing and everything I'm doing in the LayoutUpdated event and it worked.

    I cannot give you an example because I'm also using some third party controls and it will not work for you.

    But when I disabled  the display of the progressing it worked.

    This is completely strange.

    • Proposed as answer by Active Geometry Wednesday, June 8, 2016 3:04 AM
    • Marked as answer by Barry Wang Thursday, June 16, 2016 9:45 AM
    Friday, June 3, 2016 1:42 PM