Windows Phone 8.1(运行时):如何在FlipView中显示图像列表?

时间:2015-09-27 14:40:38

标签: c# windows-runtime windows-phone-8.1 winrt-xaml flipview

我这样做:

<FlipView x:Name="flipView"
              SelectionChanged="flipView_SelectionChanged">
        <FlipView.ItemTemplate>
            <DataTemplate>
                <Image Stretch="UniformToFill" Source="{Binding}" />
            </DataTemplate>
        </FlipView.ItemTemplate>
    </FlipView>

XAML

 await bitmapImage.SetSourceAsync(stream);

我得到了这个例外

  

发生了'System.Exception'类型的第一次机会异常   mscorlib.ni.dll

     

其他信息:找不到该组件。 (例外   HRESULT:0x88982F50)

在这一行

server {
listen            80;
    server_name   blablasite.com;

    # add ssl settings
    return 301 https://$host$request_uri;
}

server {
listen            443;
    server_name   blablasite.com;
    root              html;
    keepalive_timeout 70;

    client_max_body_size 50m;

    #charset koi8-r;

    ssl_certificate          /blablasite.com-combined.crt;
    ssl_certificate_key      /ssl/blablasite.com.key;

    ssl on;
    ssl_protocols             TLSv1 TLSv1.1 TLSv1.2;
    #ssl_ciphers              HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
    ssl_session_cache         shared:SSL:10m;
    ssl_prefer_server_ciphers on;

    # HTTP Strict Transport Security
    add_header                Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
    add_header                X-Frame-Options "DENY";

    # OCSP Stapling
    ssl_stapling              on;
    ssl_stapling_verify   on;
    resolver                  8.8.8.8 8.8.4.4 valid=300s;
    resolver_timeout          5s;

    access_log  /var/log/nginx/host.access.log  main;

    # Media: images, icons, video, audio, HTC
    location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
        expires    1d;
        access_log off;
        add_header Cache-Control "public";

        # boilerplate copied from location /
        proxy_pass              http://localhost:8080;
        proxy_set_header        X-Real-IP $remote_addr;
        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header        Host $http_host;
    }

    location / {
        if (-f /webapps/blablasite/maintenance_on.html) {
            return 503;
        }

        index index.html index.jsp;

        proxy_pass              http://localhost:8080;
        proxy_set_header        X-Real-IP $remote_addr;
        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header        Host $http_host;
    }

    location /login {
        # apply rate limiting
        limit_req zone=login burst=5;

        # boilerplate copied from location /
        proxy_pass              http://localhost:8080;
        proxy_set_header        X-Real-IP $remote_addr;
        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header        Host $http_host;
    }

请问,问题是什么?

1 个答案:

答案 0 :(得分:0)

该程序有效,但问题是jpg文件损坏。 它们的大小为0字节,因此无法创建stream。 检查是否已创建此变量或是否已填充数据。