WPF

All things WPF

UserControl in WPF considered harmful?

I am currently working on a large app that is using WPF as its UI technology. I’m on a small team of talented developers (i.e. I think my colleagues are talented!) and we came at WPF six months ago from scratch, although everyone apart from me had WinForms experience. As we built our app, we made frequent use of the WPF UserControl. I think the main reasons for this were: Visual Studio lists UserControl as an item and this encourages its use. It’s a convenient container for XAML that can be reused...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Sunday, September 28, 2008 3:14 PM | Feedback (2)

Aligning text baseline in WPF

I had a very frustrating experience last week trying to align the baselines of adjacent pieces of text in a WPF app. The problem seems to be that this is supported behaviour in a flow document, but not in general UI (e.g. the visual tree of a Window). After a lot of fiddling, head scratching and googling we discovered that the easiest way to do this is to have two TextBlock elements inside an outer TextBlock. The following markup: produces this end result: The TextBlock has magically communicated...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Saturday, September 27, 2008 12:19 PM | Feedback (1)

Copyright © CodeCurve

Design by Bartosz Brzezinski

Design by Phil Haack Based On A Design By Bartosz Brzezinski