Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Diving into the RichTextBox (Silverlight TV #31)

Download

Right click “Save as…”

Mark Rideout, Program Manager on the Silverlight product team, joins John to dive deep into many of the RichTextBox control's features. Mark has worked on the text aspects of Silverlight since the first version. Here are just a few of the areas that Mark covers:

  1. Overview of RichTextBox vs. TextBlock and TextBox for rich content
  2. Wire-up logic for applying formatting
  3. Inline UI elements
  4. Using text position to point for simple and complex operations  
  5. Basic "position to point/point to position"
  6. How to walk content and getting rectangle data
  7. Using rectangle data to generate line metrics/highlight bar
  8. The clipboard XAML format and that the same data is exposed in the XAML property
  9. TextAlignment=Justify on paragraph

Don't miss this great deep dive into the RichTextBox control with Mark and John!

Relevant links:

Follow us on Twitter @SilverlightTV or on the web at http://silverlight.tv/

Tags:

Follow the Discussion

  • Want Hyperlinks to do customizable actions? Read about "interactive text" on The Code Project!

  • Unrelated and not sure if this is something the Silverlight team would be responsible for, but there really needs to be a common Silverlight/HTML app store.  Windows Phone 7 has its MarketPlace and licensing/update services.  I'd love to see something like this for slates/tablets/pcs.

  • HarlequinHarlequin http:/​/​twitter.​com/True​Harlequin

    Why is the Xaml property not bindable? Makes the RichTextBox useless in an MVVM-based application.

     

    Edit:

    Quick example,

    Xaml="{Binding SomeRichText}"

  • figuerresfiguerres ???

    Yeah i say that the RTB Xaml property got badly done int the first version.... in SL5 i hope they fix it so it's bindable!

  • rhmrhm

    You know this RichTextBox control is fine if it does exactly what you want out of the box.

     

    I would be happier if the Silverlight team would leave making complete high-level controls to 3rd parties (or at least have them as optional downloadable assemblies) and provide the APIs that people can use to write better text layout code. I'd much rather see FormattedText and TextFormatter make their way in so I can write some serious editor control without ugly workarounds. As far as I can see, the only way to lay text out yourself is create a TextBlock add words to it one at a time while measuring it's size and even then you don't get all the font metrics so you can only implement very amateurish text layout.

     

    When people ask "if Silverlight has all these features now and out of browser, why use WPF", text support is the main thing I always think of.

  • Vesuviusvesuvius Count Orlock

    I am still completely unsatisfied with the quality of Silverlight's text rendering, it is still very very poor, when you compare it with offerings like Adobe Air and Flash.

     

    Text is such an important feature, you really need to get it right, and soon. In WPF 4.0 you did improve the text so it was less poor, and not noticable, but if you do a like with like comparison with Winforms/Win32 a trained eye will choose the older technology because it is better - hands down.

     

     

  • rhmrhm

    Lets not get bogged down in that tedious issue. It doesn't matter how crisp the text is if you can't lay it out how you want.

  • Vesuviusvesuvius Count Orlock

    I'm afraid that post maketh no sense, and it is not a tedious issue, it is a rich text box after all! There are two issues here.

     

    If Silverlight is to proliferate the devices market (even embedded systems) then text must look great. I have just installed the MetroTwit application posted in the cofeehouse, and subsequently gone to the new york times website and installed the adobe air program for their times reader application, and it is clear (no pun intended) why they moved the application from WPF to Adobe, and have not elected Silverlight.

  • rhmrhm

    If my post makes no sense to you then you clearly have very poor reading comprehension skills, regardless of the text rendering technology employed.

  • Vesuviusvesuvius Count Orlock

    OK since puerile reasoning is afoot, maybe you can help me?

     

    Lets not get bogged down in that tedious issue. It doesn't matter how crisp the text is if you can't lay it out how you want.

     

    I interject that the text isn't crisp.

     

    You are appearing to suggest that you would prefer a more fully featured richtextbox, that renders text poorly, wheras I am saying that the richtextbox could be better, but the text is still of a very poor quality. This is exacerbated by the fact that the new metro design in silverlight is text centric.

     

    I think it is you that "should have gone to specsavers", I have 20/20 vision, I can see what is written.

  • rhmrhm

    ....

  • rhmrhm

    See, you've completely understood what I wrote, so saying "that makes no sense" is a puerile response. Tongue Out

     

    The text rendering in Silverlight might not meet your standards, but it is perfectly legible. It would be nice if it was better, but the quality isn't stopping people writing applications for Silverlight - I know you imagine it is, but it really isn't. Whereas if you cannot lay out the text in the way you want, that is a major problem.

     

    I find it hard to believe that nobody on the Silverlight team considered that text isn't always laid out in rectangles.

     

    btw. I describe the text 'crispness' issue as tedious because people like you, well mostly just you, are still moaning about WPF4 not being good enough. As such I think it's fair to say that you will never be happy, therefore bringing your whining over to the Silverlight world is just adding noise.

  • Vesuviusvesuvius Count Orlock

    I earn my daily crust in WPF and Silverlight, moving to .NET 4.0 when that was released. I think the steps taken in WPF are excellent, and we upgraded because of the improved text and things like multi-touch.

     

    Silverlight has to be inscrutable to succeed, especially if you are competing with Adobe and Apple. The "it's OK attitude", will only bite you back in the future when uptake of the product is slow. If you put an iPad next to a Silverlight application that is text heavy, the iPad wins. Most users will choose the iPad, because they will use phrases like "it just looks better, I can't quite put my finger on it"

     

    I really recommend you install the metrotwit application and also the newyork times reader application. Silverlight text is still of a very very poor standard, and if it remains as it is, consumers will vote with their feet. It's fine for LOB applications, lets remember the forcing of users  to use dull grey forms, but if you are anyway substandard in this game, you will lose, it is as simple as that.

  • Great Show. 

    and I don't have anything to complain about.

  • Dave Williamsondavewill here birdie birdie, get in my belly!

    Thanks John.  Without these FYI posts I wouldn't be able to keep up with the new stuff.

Remove this comment

Remove this thread

close

Comments Closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.