Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

URI with Relative Path does not working

$
0
0

hi,

First line with Absolute works perfect but the second one althought don't fail I cannot see any image in my Image control:

Code-behind:

  Try
            imatge = New BitmapImage(New Uri(dgvUsuarios.SelectedItem("Foto").ToString, UriKind.Absolute))

        Catch ex As Exception
            imatge = New BitmapImage(New Uri("Imagenes\no-icon.png", UriKind.Relative))

        End Try


        Me.ImagenMarcaSeleccionada.Source = imatge

Xaml:

<Image Name="ImagenMarcaSeleccionada" Visibility="Visible" HorizontalAlignment="Left" Height="134" Margin="130,36,0,-19" VerticalAlignment="Top" Width="154" Grid.ColumnSpan="2" Grid.Column="2" Grid.Row="7"/>


Primary platform is Windows 7 Ultimate 64 bit along with VS 2012/Sql2k8 for WPF/SilverLight projects.



Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>