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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:37:35+00:00 2026-05-24T11:37:35+00:00

My scenario: I’ve got a Silverlight Application with a View, where i want to

  • 0

My scenario:
I’ve got a Silverlight Application with a View, where i want to bind the textboxes to an object (two-way) and all labels to a dictionary holding the label translations.

My approach was to set the datacontext of the page to a dictionary with two items, one of them is the object and the other is the translation-dictionary.

In xaml the code looks like the following:

<TextBlock Text="{Binding [dict].[name],FallbackValue='Fallback'}" />
<TextBox Text="{Binding [obj].name,Mode=TwoWay}" />

This works initially, if I however change the object on the datacontext, the xaml is not notified about any changes and doesn’t update.

I’ve had a working solution using a Converter for the translations, however due to the limitations on one converterparameter I didn’t like the solution. In addition it wasn’t possible to place a fallback-value in the textblock, which resulted in “invisible” textblocks while designing the page.

Any suggestions on how to solve this issue? It doesn’t have to be using my dictionary, it would be also okay if i could set the datacontext to the object (which works) and bind the labels somehow different.

  • 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-24T11:37:35+00:00Added an answer on May 24, 2026 at 11:37 am

    I found a solution, but wasn’t able to answer my own question (8h limit..)
    I think this is just the approach Hydroslide suggested.


    1. Create a class which holds all data and implements INotifyPropertyChanged

      Public Class MyDatacontext
        Implements ComponentModel.INotifyPropertyChanged
      
      'Properties
      Private _obj As Object
      Private _dict As Dictionary(Of String, String)
      
      'Events
      Public Event PropertyChanged(ByVal sender As Object, ByVal e As System.ComponentModel.PropertyChangedEventArgs) Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged
      
      'Methods
      Public Property Obj As Object
        Get
          Return _obj
        End Get
        Set(ByVal value As Object)
          _obj = value
          'Notify the xaml about the changed Object
          RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs("Obj"))
        End Set
      End Property
      
      Public Property Dict As Dictionary(Of String, String)
        Get
          Return _dict
        End Get
        Set(ByVal value As Dictionary(Of String, String))
          _dict = value
          'Notify the xaml about the changed translation
          RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs("Dict"))
        End Set
      End Property
      End Class
      
    2. Define a private var in your page code

      Private mycontext As New MyDatacontext
      
    3. In the constructor of your page, fill your “mycontext” with the desired data

      mycontext.Dict = LoadDictionary()
      mycontext.Obj = LoadObject()
      Me.DataContext = mycontext
      
    4. Change your xaml to the following

      <TextBlock Text="{Binding Dict.[name],FallbackValue=MyFallback}" />
      <TextBox Text="{Binding Obj.name,Mode=TwoWay}" />
      
    5. Update your object/dictionary as you like using

      mycontext.Obj = LoadNextObject()
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Scenario You've got several bug reports all showing the same problem. They're all cryptic
Scenario: I want to have an enum containing all the playing cards in a
Scenario I have two wrappers around Microsoft Office, one for 2003 and one for
Scenario: Let's say I have two tables, TableA and TableB. TableB's primary key is
Scenario is I've a big parking lot (with obstacles) and want to determine shortest
Scenario: I have a Question which has 2 radio buttons & two subforms: subformA
Scenario: Delphi did a non-normal shutdown. When I restarted I got the messages Could
Scenario: I have an application that pulls data from a SQL database as well
scenario: I want to do an ajax call to update the image shown. Example:
Scenario: 1. Show navigation controller based view 2. User select option 3.   Show modal

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.