0

C# と Windows Phone の学習を始めたばかりです。私の質問は、画像 (バインディング画像) を表示して水平方向にスクロールすることができないようです。xaml でハードコーディングすると、それらを機能させることができます。 .

<!-- row 4 start -->
    <Grid x:Name="row3" Grid.Row="3">
        <ScrollViewer HorizontalScrollBarVisibility="Auto">
        <StackPanel x:Name="imgStackPanel" Orientation="Horizontal" ScrollViewer.HorizontalScrollBarVisibility="Auto">

                <!--<Image Source="{Binding Path=DvdPhoto}" Width="150" Height="150"  Margin="5"/>-->

            <Image Source="/GmanDVDStore;component/Images/rain.jpg" Width="150" Height="150" Margin="5"/>
                <Image Source="/GmanDVDStore;component/Images/snow.jpg" Width="150" Height="150" Margin="5"/>
                <Image Source="/GmanDVDStore;component/Images/sun.jpg" Width="150" Height="150" Margin="5"/>
                <Image Source="/GmanDVDStore;component/Images/wind.jpg" Width="150" Height="150" Margin="5"/>
                <Image Source="/GmanDVDStore;component/Images/rain.jpg" Width="150" Height="150" Margin="5"/>
                <Image Source="/GmanDVDStore;component/Images/snow.jpg" Width="150" Height="150" Margin="5"/>
                <Image Source="/GmanDVDStore;component/Images/sun.jpg" Width="150" Height="150" Margin="5"/>
                <Image Source="/GmanDVDStore;component/Images/wind.jpg" Width="150" Height="150" Margin="5"/>
                <Image Source="/GmanDVDStore;component/Images/rain.jpg" Width="150" Height="150" Margin="5"/>
                <Image Source="/GmanDVDStore;component/Images/snow.jpg" Width="150" Height="150" Margin="5"/>
                <Image Source="/GmanDVDStore;component/Images/sun.jpg" Width="150" Height="150" Margin="5"/>
                <Image Source="/GmanDVDStore;component/Images/wind.jpg" Width="150" Height="150" Margin="5"/>
                <Image Source="/GmanDVDStore;component/Images/rain.jpg" Width="150" Height="150" Margin="5"/>
                <Image Source="/GmanDVDStore;component/Images/snow.jpg" Width="150" Height="150" Margin="5"/>
                <Image Source="/GmanDVDStore;component/Images/sun.jpg" Width="150" Height="150" Margin="5"/>
                <Image Source="/GmanDVDStore;component/Images/wind.jpg" Width="150" Height="150" Margin="5"/>

        </StackPanel>
        </ScrollViewer>
    </Grid>

これは機能し、画像が表示され、左から右にスクロールできます。画像をバインドしているコメントアウトされたコードは機能しません。

垂直にすると、リストボックスにあるため正常に機能し、リストボックスを水平にしようとしました。

誰でもこの問題の解決策を持っていますか。

前もって感謝します

グマン

追伸: Windows Phone の学習を始めたばかりだと言ったので、ご安心ください。:)

4

1 に答える 1

0

この質問への回答で言及されているように:

WP7 - 水平スクロール リストボックスの問題

これを行うには、ScrollViewer の幅の値を指定します。

これが何らかの形で役立つことを願っています。

于 2013-02-26T20:41:16.990 に答える