Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7771847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:44:57+00:00 2026-06-01T16:44:57+00:00

Can you see this tag: <Image Source={Binding Image} Stretch=UniformToFill/> But below? What I’m trying

  • 0

Can you see this tag:

<Image Source="{Binding Image}" Stretch="UniformToFill"/>

But below? What I’m trying to do is, when the Image is null, set another default image. Is this possible?

<!-- Grid-appropriate 250 pixel square item template as seen in the GroupedItemsPage and ItemsPage -->
<DataTemplate x:Key="Standard250x250ItemTemplate">
    <Grid HorizontalAlignment="Left" Width="320" Height="240">
        <Border Background="{StaticResource ListViewItemPlaceholderRectBrush}">
            <Image Source="{Binding Image}" Stretch="UniformToFill"/>
        </Border>
        <StackPanel VerticalAlignment="Bottom" Background="{StaticResource ListViewItemOverlayBackgroundBrush}">
            <TextBlock Text="{Binding ShortTitle}" Foreground="{StaticResource ListViewItemOverlayTextBrush}" Style="{StaticResource TitleTextStyle}" Height="48" Margin="15,0,15,0"/>
        </StackPanel>
    </Grid>
</DataTemplate>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T16:44:58+00:00Added an answer on June 1, 2026 at 4:44 pm

    Add a Style with a DataTrigger. e.g. something like

    <Image Stretch="UniformToFill">
         <Image.Style>
             <Style TargetType="Image">
                 <Setter Property="Source" Value="{Binding Image}"/>
                 <Style.Triggers>
                     <DataTrigger Binding="{Binding Image}" Value="{x:Null}">
                         <Setter Property="Source" Value="Images/Default.png"/>
                     </DataTrigger>
                 </Style.Triggers>
             </Style>
        </Image.Style>
    </Image>
    

    Watch out for precedence of local values.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is not a programming question but I hope Microsoft programmer can see this
Morning all. I can see this has been discussed elsewhere but was wondering if
I can't see this in the docs, but I presume it's a solved problem.
As you can see in this jsfiddle , I'm trying to make a toggle
I have a Dell Inspiron E1505 and as you can see in this image
I can see some potential difficulties with this concept but the idea is: I
I am trying to set source for Img tag using Javascript at button click.
I have this site here As you can see there is a tiny image
As far as I can see this is not the case, however, I thought
As you can see on this screenshot the close button is not styled properly

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.