基本的に私はこのシンプルなメモアプリを作っていて、リストボックスを持っています。ユーザーが保存ボタンをクリックしてメモを追加すると、メモは .txt ファイルとして保存され、リストボックスにメモが表示されます。したがって、ユーザーが変更などを行いたい場合は、保存したメモの名前になるリストボックス項目をクリックするだけです。私がやりたいことは、基本的にユーザーが保存をクリックすると保存され、リストボックスにメモの名前が表示されるので、たとえばメモ名がtest.txtの場合、リストボックスにtest.txtが表示されます。リストボックスに表示されるアイテム名のすぐ下に、サブアイテムのようなものを追加するにはどうすればよいですか? たとえば、wp7 のメールのように。メールの件名と、最初の 12 程度の単語を示すサブアイテムがあります。アプリでこれを行うにはどうすればよいですか? これまでのところ、音名しかわかりませんでした。名前とメッセージの最初の 14 語をアイテムの下に表示したい。
私のコードはこれまでのところ:
これにより、基本的に myNote フォルダー内のアイテムがリストボックスに追加され、保存されたメモが表示されます。
Dim myIsolatedStorage As IsolatedStorageFile = IsolatedStorageFile.GetUserStoreForApplication()
myIsolatedStorage.CreateDirectory("myNote")
Dim directory As String = "./myNote/*.*"
Dim filenames As String() = myIsolatedStorage.GetFileNames(directory)
ListBox1.ItemsSource = filenames
これはリストボックスのxmlです
<ListBox HorizontalAlignment="Left" Margin="8,8,0,8" x:Name="ListBox1" Width="440" SelectionMode="Single" FontSize="32" FontFamily="Segoe WP SemiLight" RenderTransformOrigin="0.5,0.5" Grid.Row="2" Style="{StaticResource ListBoxStyle1}" Foreground="White" BorderBrush="#00000000" ItemContainerStyle="{StaticResource ListBoxItemStyle1}" ItemsPanel="{StaticResource ItemsPanelTemplate1}" />
誰?ありがとう!