2012-02-24 10 views
0

私のXMLファイルのチャプタータグにはチャプタータグが多くあります。最初のページにチャプター名を表示する必要があります。リストボックスのチャプターをクリックすると次のページにチャプターのタイトルが表示されます。 content.iは静的page.itがWindows携帯電話用の動的なxmlリーダーを読み取りますか?

<chapter> 
    <title> 
    <![CDATA[Decorating Tips]]> 
    </title> 
    <position>1</position> 
    <paragraphs> 
    <paragraph> 
     <title>To Determine Gender or Not</title> 
     <position>1</position> 
     <text> 
     <![CDATA[<meta name="viewport" content="width=320" /><p style="text-align: justify;">With the creation of ultrasounds,<br/>many decision, you can move forward.</p>]]> 
     </text> 
    </paragraph> 
    <paragraph> 
     <title>Neutral, Please</title> 
     <position>2</position> 
     <text> 
     <![CDATA[<meta name='viewport' content='width=device-width,height=device-height' /><p style="text-align: just></p>]]> 
     </text> 
    </paragraph> 
    <paragraph> 
     <title>Noah&#8217;s Ark</title> 
      </chapter> 
<chapter> 
    <title> 
    <![CDATA[The Necessities]]> 
    </title> 
    <position>2</position> 
    <paragraphs> 
    <paragraph> 
     <title>Paint</title> 
     <position>1</position> 
     <text> 
     <![CDATA[<p style="text-align: justify;">Sne are shades of yellow,&nbsp; green, beige of.</p>]]> 
     </text> 
    </paragraph> 
    <paragraph> 
     <title>Wall Paper and Bedding</title> 
     <position>2</position> 
     <text> 
     <![CDATA[<p style="text-align: justifinundated with themes. And&nbsp; since the or baby.</p>]]> 
     </text> 
    </paragraph>   
    </paragraphs> 
</chapter> 
<chapter> 
    <title> 
    <![CDATA[Other Fun Ways to Decorate]]> 
    </title> 
    <position>3</position> 
    <paragraphs> 
    <paragraph> 
     <title>Twinkle Lights Around the Perimeter</title> 
     <position>1</position> 
     <text> 
     <![CDATA[<p style="text-align: justify;">during the day.<br /></p>]]> 
     </text> 
    </paragraph> 
    <paragraph> 
     <title>Growth Chart</title> 
     <position>2</position> 
     <text> 
     <![CDATA[<p style="text-align: justify;">Ysomeday &ndash; and the date.</p>]]> 
     </text> 
    </paragraph> 
      </paragraphs> 
</chapter> 
</chaptesr>` 
+0

1の提案

、より良い章のページやタイトルページ中2ページ(IEで同じXMLファイルを読み込みます)? –

+1

私がチャプターリストをクリックすると、対応するタイトルが表示されます。クリックすると、タイトル説明が別のページに表示されます。 – Malarkodi

+1

その単純な私は、xmlreaderを使用してすべての章を最初に読んで、あなたのページに表示する。ユーザがチャプタをクリックした後、ナビゲーション技術を使用してチャプタの値を次のページに渡します。同じxmlファイルを読み込みますが、必要な章だけを探します。たとえば、reader.Name.equals(章名)解決策ではありません。それは別のロジックthats thats!章値「NavigationService.Navigate(新しいUri(/ SecondPage.xaml?msg = "+ string_chapter、UriKind.Relative)); ' –

答えて

1

はすでに章・段落段落の構造を記述するクラス階層を作成するとnavigation.`私は動的ページに問題があったclearly.but実行されます試してみました。

最初のページに各章を表示するには、DataContextChapters collectionをバインドします。

ユーザがいくつかの章をクリックすると、にSelectedChapterプロパティを設定して、Chapterオブジェクトをクリックします。次に、DataContextSelectedChapterプロパティにバインドされ、各段落を表示する2番目のページに移動します。いくつかの段落をユーザーがクリックすると、ParagraphオブジェクトをクリックするViewModelSelectedParagraphプロパティを設定する、など...

+0

私は自分自身を試しました。いくつかのサンプルコードを与えてください。 – Malarkodi

関連する問題