私はすべてのアイテムについて4枚の写真でリストボックスを作成しました。それは速く、すべての甘くて素敵ですが、私は画面の解像度に応じてこのdinamicalyを行う方法がわかりません。ダイナミックスタックパネルスタイルwp7
現在のところ、90x90 + 5マージンの行に4枚の写真がありますが、画面解像度が4枚しかサポートできない場合はどうすればいいですか?例えば、私が電話機を傾けた場合、私は赤色になり、320×480の解像度も導入する予定です。
<ListBox Height="646" HorizontalAlignment="Left" Margin="6,19,0,0" Name="MainListbox" VerticalAlignment="Top" Width="444" ScrollViewer.VerticalScrollBarVisibility="Visible" >
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</ListBox>
private void GetDataToBind(List<string> images, int spliter)
{
for (int i = spliter; i < images.Count; i += spliter)
{
StackPanel temp = new StackPanel();
temp.Orientation = System.Windows.Controls.Orientation.Horizontal;
for (int j = i - spliter; j < i && j < images.Count + spliter; j++)
{
Grid tempGrid = new Grid();
Rectangle temprect = new Rectangle();
temprect.Fill = new SolidColorBrush(Colors.White);
temprect.Height = 90;
temprect.Width = 90;
tempGrid.Children.Add(temprect);
tempGrid.Children.Add(GetImageSourceFromString(images[j]));
temp.Children.Add(tempGrid);
}
MainListbox.Items.Add(temp);
}
}
intスプリッタは、1つの行にいくつの画像があるかを決定します。
解決方法私はラップパネル、LazyListboxに興味がありません。誰かが動的なスタイルや何かエレガントなものでこれを解決する方法を知っていますか?
最高のお礼
また、ノキアも異なる解像度を持つでしょう。 http://www.istartedsomething.com/20110214/evidence-of-different-screen-resolution-for-nokias-concept-windows-phone-7/ –
私が知る限り、解像度320x480は仕様から削除されました。また、Nokia特有の決議は現実には起こりそうもない。 – Ku6opr
確かに....ノキアは結局同じ解像度を持つことに気づきました。しかし、そのようなスタイルをハードコードするのは危険だとは思わないでください。もし新しい解像度のデバイスが出たら、私は頭を傷つけるでしょう:( –