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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T01:25:31+00:00 2026-05-15T01:25:31+00:00

I have the following XAML: <Grid x:Name=LayoutRoot Background=White DataContext={Binding Source={StaticResource MyDataKey}}> <TextBox Name=_myId Text={Binding

  • 0

I have the following XAML:

<Grid x:Name="LayoutRoot" Background="White" DataContext="{Binding Source={StaticResource MyDataKey}}">
 <TextBox Name="_myId" Text="{Binding MyDictionary[(Textbox.Name)]}" />
</Grid>

But it thinks the key in my dictionary is called “(Textbox.Name)”, instead of “_myId”. The format below works, where I have a property in my class called “_myId”:

<TextBox Name="_myId" Text="{Binding (Textbox.Name)}" />

I’ve tried using ^ and \ to escape the brackets. Is this syntax supported? I’m trying to avoid duplication of the name in two attributes.

  • 1 1 Answer
  • 1 View
  • 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-15T01:25:32+00:00Added an answer on May 15, 2026 at 1:25 am

    You can not have references to other instances in indexers in XAML binding expressions. You can only have acutal literals such as Text="{Binding MyDictionary[somename]"}, wich is the c# equivalent to myDictionary["somename"].

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

Sidebar

Related Questions

I have the following XAML: <UserControl.Resources> <local:MainPageViewModel x:Key=ViewModel /> </UserControl.Resources> <Grid x:Name=LayoutRoot DataContext={Binding Source={StaticResource
I have the following in my XAML: <Grid x:Name=LayoutRoot Background=White> <Grid.RowDefinitions> <RowDefinition Height=20/> <RowDefinition
BACKGROUND: I have xaml similar to the following pseudo code ... <DataContext><vm:parentVM/></DataContext> <Grid x:Name=LayoutRoot>
Is this a known issue? I have the following XAML: <Grid x:Name=LayoutRoot> <Popup> <Slider
I have a following XAML: <DataGrid Name=nodeDataGrid ItemsSource={Binding NodeList} AutoGenerateColumns=False RowBackground=White AlternatingRowBackground=AliceBlue Grid.Column=1 HorizontalAlignment=Stretch
I have the following XAML: <ListBox HorizontalAlignment=Left Margin=0,6,0,10 Name=listBox1 Width=468 ItemsSource={Binding} Grid.ColumnSpan=1> <ItemsControl.ItemTemplate> <DataTemplate>
I have the following XAML on my page: <Grid x:Name=LayoutRoot> <Viewbox Stretch=Uniform> <Image x:Name=myImage
I currently have the following XAML for my Grid control: <dxg:GridControl x:Name=DXGrid> <dxg:GridControl.Columns> <dxg:Column
I have the following XAML markup in a WPF DataGrid: <DataGrid ItemsSource={Binding ResultList} Grid.ColumnSpan=4
i have a parent usercontrol, here is an excerpt of xaml <Grid x:Name=LayoutRoot Width=Auto

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.