The first couple of TextBlock's gets their value by binding to the parent Window and getting its width and height. Sometimes anĮxample says more than a thousand words, so before I hit that word count, let's jump straight into an example: The StringFormat property does exactly what the name implies: It formats the output string, simply by calling the String.Format method. Using the StringFormat property of a binding, you lose some of the flexibility you get when using a converter, but in return, it's much simpler to use andĭoesn't involve the creation of a new class in a new file. Where you just want to change the way a certain value is shown and not necessarily convert it into a different type, the StringFormat property might very However, for more simple usage scenarios, Thing about the converters is that they allow you to convert any data type into a completely different data type. As we saw in the previous chapters, the way to manipulate the output of a binding before it is shown is typically through the use of a converter.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |