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

  • Home
  • SEARCH
  • 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 693409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:45:03+00:00 2026-05-14T02:45:03+00:00

I am trying to develop an application that uses a number of images that

  • 0

I am trying to develop an application that uses a number of images that are stored in a seperate remote file location. The file-paths to the UI elements are stored within the Application Settings. Although I understand how to access and use the file-path from Settings in C# (Properties.Settings.Default.pathToGridImages + “OK.png”), I am at a loss to figure out how to utilize the Settings paths in WPF, and can only seem to access the file if I include the file-path, such as:

<Grid.Background>
     <ImageBrush ImageSource="C:\Skins\bottomfill.png" TileMode="Tile" />
</Grid.Background>

I would have thought that concatenating “Properties.Settings.Default.pathToGridImages” with “bottomfill.png” in WPF could be done much like it can be done in C#. Can anyone please point me in the right direction?

  • 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-05-14T02:45:04+00:00Added an answer on May 14, 2026 at 2:45 am

    You can do this using a MultiBinding and a value converter. To start with, use a multibinding to bind your image source to the base path, and the image name:

    <ImageBrush>
        <ImageBrush.ImageSource>
            <MultiBinding Converter="{StaticResource MyConverter}">
                <Binding Source="{StaticResource MySettings}" Path="Default.FilePath" />
                <Binding Source="ImageName.png"></Binding>
            </MultiBinding>
        </ImageBrush.ImageSource>
    </ImageBrush>
    

    You then need to have a converter that implements IMultiValueConverter and combines the two parts of the path and creates the image using either an ImageSourceConverter or by creating a new BitmapImage:

    class MyConverter: IMultiValueConverter
    {
        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
        {
            // Concatenate the values.
            string filename = Path.Combine(values[0].ToString(), values[1].ToString());
    
            // You can either use an ImageSourceConverter
            // to create your image source from the path.
            ImageSourceConverter imageConverter = new ImageSourceConverter();
            return imageConverter.ConvertFromString(filename);
    
            // ...or you can create a new bitmap with the combined path.
            return new BitmapImage(new Uri(filename, UriKind.RelativeOrAbsolute));
        }
    
        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
        {
            // No need to implement the convert back as this will never be used in two way binding.
            throw new NotImplementedException();
        }
    }
    

    Obviously, you need to declare namespaces and resource to the CLR stuff in the XAML so you can access it (If you’ve called your settings and converter classes something different, make sure you change this to match up):

    ...
    xmlns:local ="clr-namespace:WpfApplication1">
    <Window.Resources>
        <local:MyConverter x:Key="MyConverter"></local:MyConverter>
        <local:MySettings x:Key="MySettings"></local:MySettings>
    </Window.Resources>
    

    I’ve tested it out and it works fine.

    [An alternative way would be just to bind the ImageSource property to a property on your data context that combined the paths in C# code, but that would depend on how you’ve got your datacontexts set up, so may be undesirable in many cases.]

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

Sidebar

Related Questions

I am trying to develop an application that uses a number of images that
I have been trying to develop a peer to peer application that uses Micosoft's
I am trying to develop an application that uses MySQL using C++. I downloaded
I'm trying to develop a web application that mainly uses PHP but i'm using
I am trying to develop a .NET 3.5 service application that uses: WCF for
I'm trying to develop an android application that uses network connection. The server is
I'm trying to develop a application that uses informations from google/bing maps, but I
I'm trying to develop an application that can stack FITS images. To read FITS
I was trying to develop the application that count the line of code my
I'm trying to develop a Lync application that allows a user to select which

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.