在UWP C#中在FlipView中对数据进行分组

问题描述 投票:0回答:1

我有json,它应该以flipview格式或滑动格式进行解码和显示。在我的json中,必须在翻页视图的一页上显示同一部分(具有相同的question_id)下的信息。

问题是它们在不同页面上显示为不同或独立,但我希望具有相同ID的页面一起显示在同一页面上

{
"total_questions": 3,
"as_id": "01401d9ec09a54b1db426462399c22f5",
"as_type": "assessment",
"as_title": "Structured test",
"as_no_sec_a": "3",
"as_no_sec_b": "0",
"duration": "00:20",
"subject": "11eaa833d04bde3362fa3ff6d7a96188",
"term": "84d2b094491c900cc455fe47709a5833",
"class": "ab904f3e0be607d7c29612a89b59d3e8",
"questions": [
    {
        "question_section": "b",
        "question_id": "55f0495109febf1d55f058a6d882a2b8",
        "question_type": "structured",
        "question_form": "short",
        "question_image": "",
        "question": "<p><span style=\"font-family:Lato;font-size:22px;\">Friction</span></p>",
        "question_instruction": "",
        "sections": [
            {
                "section_id": "2d15cc79ecd65beee2ab2bc74110fa12",
                "question_id": "55f0495109febf1d55f058a6d882a2b8",
                "section_type": "structured",
                "section_sub_type": "long",
                "section_question": "<p><span style=\"font-family:Lato;font-size:22px;\">What is friction</span></p>",
                "section_image": "",
                "section_instruction": "<p><span style=\"font-family:Lato;font-size:22px;\">Answer</span></p>"
            }
        ]
    },
    {
        "question_section": "a",
        "question_id": "2df3c9d9b5d9d85dd31ae39ff2aeda4b",
        "question_type": "structured",
        "question_form": "long",
        "question_image": "",
        "question": "<p><span style=\"font-family:Lato;font-size:22px;\">What is the importance of including calcium in chicken feed?</span></p>",
        "question_instruction": "<p><span style=\"font-family:Lato;font-size:22px;\">type your answer below</span></p>"
    },
    {
        "question_section": "a",
        "question_id": "1d02f11bbfb6741edb345b66b8fb147d",
        "question_type": "structured",
        "question_form": "short",
        "question_image": "",
        "question": "<p><span style=\"font-size:22px;font-family:Lato;\">Give any one example of a root tuber</span></p>",
        "question_instruction": "<p><span style=\"font-size:22px;\">Type your answer below</span></p>"
    },
    {
        "question_section": "b",
        "question_id": "82a3ecbf3cbfebd30d9dfe17a0f3354c",
        "question_type": "structured",
        "question_form": "short",
        "question_image": "",
        "question": "<p><span style=\"font-family:Lato;font-size:22px;\">Gravity as a force</span></p>",
        "question_instruction": "",
        "sections": [
            {
                "section_id": "b08b9467da3d21820ec223d46e1ec780",
                "question_id": "82a3ecbf3cbfebd30d9dfe17a0f3354c",
                "section_type": "structured",
                "section_sub_type": "long",
                "section_question": "<p><span style=\"font-family:Lato;font-size:22px;\">Why is gravity very important</span></p>",
                "section_image": "",
                "section_instruction": "<p>Give what its use is</p>"
            },
            {
                "section_id": "85e9d5ad8e41863825651a110b901744",
                "question_id": "82a3ecbf3cbfebd30d9dfe17a0f3354c",
                "section_type": "structured",
                "section_sub_type": "",
                "section_question": "<p><span style=\"font-family:Lato;font-size:22px;\">Where does gravity not function</span></p>",
                "section_image": "",
                "section_instruction": "<p><span style=\"font-family:Lato;font-size:22px;\">Give where it does not</span></p>"
            }
        ]
    }
],
"success": 1,
"title": "Successful",
"message": "Questions fetched."

}

我使用Newtonsoft.Json进行解码

下面是我需要如何在一张翻页显示我的信息的图像。它们根据翻页或翻页中的页面排列

Image of first flip

Image of second flip

Image of third flip

Image of fourth flip

c# win-universal-app
1个回答
0
投票

问题是它们在不同页面上的显示方式不同或独立,但我希望这些页面具有相同的ID。

© www.soinside.com 2019 - 2024. All rights reserved.