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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:51:33+00:00 2026-05-27T18:51:33+00:00

First, I searched long and hard to try to find the answer to this.

  • 0

First, I searched long and hard to try to find the answer to this. I resorted to here for expert help with this problem.

I am currently reading a book about programming for the Windows Phone 7. I am currently learning about Data Binding (and doing pretty good too). I have come across a question about the formatting of DataBinding in WPF, mostly about the function of StaticResource.

In the following code you are about to see, there is a slider and a text block. The text block is binded to the slider so that when the slider is moved, the text block’s value changes. A class has been created, TruncationConverter, and has can be called in XAML with the keyword “truncate”. It is declared in phone:ApplicationPage.Resources.

So, this is right

    <TextBlock Name="txtblk"
Text="{Binding ElementName=slider,
Path=Value,
Converter={StaticResource truncate}}"

And this is wrong

<TextBlock Name="txtblk"
Text="{Binding ElementName=slider,
Path=Value,
Converter=truncate}"

The book never really went in to explaining why one must put StaticResource before the function.

So, the question is, why do you need to put StaticResource before the call? What does it do, what is its function? Why is there an error when you don’t put StaticResource before truncate.

Thanks in advance!

  • 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-27T18:51:34+00:00Added an answer on May 27, 2026 at 6:51 pm

    Basically placing StaticResource is telling it to find the external property likely in a ResourceDictionary which holds the function of for example “truncate”

    So like another example would be if I go and say create another control or converter or even a brush or other instance I wish to be made available throughout other elements of an application, it’s created as an available resource that is only editable in one spot (a resource dictionary) but usable by all, eg; a StaticResource

    Like when you placed your slider and your Textblock, it by default is calling a style for each found in your CoreStyles resource dictionary. If I wanted to change what they did or how they look for example I could copy the resource, edit it as necessary, rename it, and say call it by

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

Sidebar

Related Questions

I've searched long and hard for an answer to doing this & have come
first post here, I come in peace :) I've searched but can't quite find
Long time browser, first time asker... Maybe you can help. I've searched and searched,
all, I have searched for this problem for long time and tried different methods.
First of all I have searched many times in this forum but none is
this is my first question I have searched for any launching activity questions and
First, let me just say that I have searched for information on this topic;
searched this site and others - no joy. :: first for loop for /L
First off I just want to say I've searched everywhere and cant find a
First time poster, long time reader. I searched and found no questions that answered

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.