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 8750075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:48:10+00:00 2026-06-13T12:48:10+00:00

I have small problem. Code behind: … public struct Project { string Name; string

  • 0

I have small problem.

Code behind:

...
public struct Project
{
    string Name;
    string Path;
    public Project(string Name, string Path = "")
    {
       this.Name = Name;
       this.Path = Path;
    }
}
...

Resources code:

<DataTemplate x:Key="ItemProjectTemplate">
        <StackPanel>
            <Image Source="Assets/project.png" Width="50" Height="50" />
            <TextBlock FontSize="22" Text="{Binding Name}" />
        </StackPanel>
</DataTemplate>

Normal code in Grid:

<ListView Grid.Column="1" HorizontalAlignment="Left" Height="511" 
     Margin="25,72,0,0" Grid.Row="1" VerticalAlignment="Top" Width="423"
     x:Name="Projects" ItemTemplate="{StaticResource ItemProjectTemplate}" />

I have no problem with ListView source, which is being set in C# code, and also my template is being loaded. But this happens when I’m running my application:

Project name is not being displayed

As you can see the project name (Project.Name) is not being displayed, but in my ListView template is data binding, so it should work. Does anybody know why is my data binding for a text not working? Please help.

  • 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-13T12:48:11+00:00Added an answer on June 13, 2026 at 12:48 pm

    DataBinding works for Properties and not on Fields. Replace Struct with class and make your fields as properties-

    public class Project
    {
        public string Name {get; set;}
        public string Path {get; set;}
        public Project(string Name, string Path = "")
        {
           this.Name = Name;
           this.Path = Path;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have small problem with simple code. This code is working properly on x86
Im having a small problem with my code. I have been trying to read
Here a small piece of code for testing and explain the problem. I have
I have a small problem in my code. I'm using fetch_assoc to get data
i have a small problem in my code when i try to update the
I have a small problem in my code. I have a function, which require
I have a small problem in my code. I have the following code: import
I have a small problem with interfaces. Here it is in Pseudo code :
I have small problem with my SQL code: UPDATE articles SET like=like+1 WHERE id=1
I have a small problem with my PHP image upload code, I`m not getting

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.