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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:40:57+00:00 2026-06-11T09:40:57+00:00

I want to Bind a String element in a List to a Textbox. When

  • 0

I want to Bind a String element in a List to a Textbox. When i click an element the Text gets updated. But when the element in the List changes the Textbox Text doesn’t change..

My Code looks like this:

XAML:

   <TextBlock Foreground="White" Name="xTitel" Text="{Binding Titel}" Width="200"  FontSize="36" FontWeight="Bold"/>

OnClick Function:

        foreach (Channel c in App.Connector.ChannelList)
        {
            if (c.StationName == StationName)
            {

                Binding b = new Binding();
                b.Source = c.CurrentTitle;
                xTitel.SetBinding(TextBlock.TextProperty, b);
            }
        }

Channel Definition:

 public class GlobalVariables : INotifyPropertyChanged
{
    public static MediaElement mediaElement;
    private ObservableCollection<Channel> channelList;
    public ObservableCollection<Channel> ChannelList
    {
        get { return channelList; }
        set
        {
            channelList = value;
            NotifyPropertyChanged("ChannelList");
        }
    }

    public event PropertyChangedEventHandler PropertyChanged;
    private void NotifyPropertyChanged(String propertyName)
    {
        PropertyChangedEventHandler handler = PropertyChanged;
        if (null != handler)
        {
            handler(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}

EDIT:

What i forgot to say:

In my XAML i have a GridView where it works with Channellist Binding. If I am correct the Textbox should update everytime when my Gridview Updates. This is my Gridview:

<local:VariableGridView
            IsSwipeEnabled="True"
            Background="Transparent"
            x:Name="itemGridView"
            Margin="0,0,0,-3"
            Padding="116,0,40,46"
            SelectionMode="None"
            IsItemClickEnabled="True"
            ItemClick="ItemView_ItemClick" 
            Grid.RowSpan="2"

            >
            <local:VariableGridView.ItemsPanel>
                <ItemsPanelTemplate>
                    <VariableSizedWrapGrid Background="Transparent" Orientation="Vertical" ItemWidth="120" ItemHeight="120"/>
                </ItemsPanelTemplate>
            </local:VariableGridView.ItemsPanel>
            <local:VariableGridView.ItemTemplate>
                <DataTemplate>
                    <Grid Background="{Binding Background}">
                        <StackPanel Orientation="Horizontal" Margin="10,0,0,0">
                            <Image x:Name="CurrentCover" Source="{Binding CurrentCover}"  Width="90" Height="90"/>
                            <StackPanel Orientation="Vertical" HorizontalAlignment="Left" Margin="10,25,10,10">
                                <TextBlock Foreground="White" Text="{Binding Name}" Width="200"  FontSize="24" FontWeight="Bold"/>
                                <TextBlock Foreground="White" Text="{Binding CurrentArtist}" Width="200"  FontSize="12" FontWeight="Bold" />
                                <TextBlock Foreground="White" Text="{Binding CurrentTitle}" Width="200"  FontSize="12" />
                            </StackPanel>                            
                        </StackPanel>
                    </Grid>
                </DataTemplate>
            </local:VariableGridView.ItemTemplate>
        </local:VariableGridView>

And the Channel class:

 public class Channel : INotifyPropertyChanged
{

    public int Width { get; set; }
    public int Height { get; set; }
    public string Logo { get; set; }
    public string StationName { get; set; }
    public string Color { get; set; }
    public SolidColorBrush Background { get; set; }
    //public string Name { get; set; }
    private string name;
    public string Name
    {
        get { return name; }
        set
        {
            name = value;
           NotifyPropertyChanged("Name");
        }
    }

     //..... More Code ...
 }

(The Textboxes in this Gridview do Update. But the other textboxes, where I want to set the Binding over the Code don’t update)

  • 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-11T09:40:58+00:00Added an answer on June 11, 2026 at 9:40 am

    Should it be this?

    Binding b = new Binding("CurrentTitle");
    b.Source = c;
    xTitel.SetBinding(TextBlock.TextProperty, b);
    

    Edit to explain a little more: If you bind directly to the string property you will not see the changes because strings are immutable. It’ll be set on the original string forever. You have to bind to the object that holds the string property and give the binding a property name (path) to watch for changes to.

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

Sidebar

Related Questions

I want to bind a string value to a text box but only if
I want to bind a function to an event but I want to change
I want to bind a click event with the element: $('a').click(function(){ btn_submit_pressed=false; }); Now,
I want to bind string property with Button.Content. But why it didn't work? The
I want to bind my ListView control to a generic list of objects? I
I want to bind the user score to a text box on the windows
I want to bind a class member of an element I added to a
Hi i want to Bind GridView with images from the sd-card but not in
I have a class that stores a list of dictionary entries. I want bind
I have this code I want to bind data to grid view without using

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.