0
我有一個綁定到ObservableCollection
的ListBox控件。在WP7 ListBox控件中顯示應用程序設置
我XAML代碼:
<ListBox Margin="12,148,12,90" ItemsSource="{Binding FuelRecords}" Name="ListBox1">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="Fuel quantity: {Binding Quantity}" FontSize="20" />
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
我想顯示的計量單位(升,加侖),經量。在AppSettings
類(VolumeSetting
屬性)中使用IsolatedStorageSettings
保存測量單位。
最終結果: 燃料量:23.45加侖
的_VolumeSetting_是一個常數。我從'AppSettings'類閱讀它。 – milo2011
看我的更新... – Ku6opr
謝謝你,Ku6opr! – milo2011