Reputation: 66577
Maybe I'm expecting too much here, but I figure I can't be the first person to have tried. Do I have to create (yet another) converter for this?
Upvotes: 12
Views: 11991
Reputation: 178740
Not if you're using MVVM. Just expose a Version property from your view model and bind to that.
Upvotes: 6
Reputation: 311127
Accessing the current assembly's version requires method calls, so you can't do it with WPF binding:
Version version = Assembly.GetExecutingAssembly().GetName().Version;
Either use a converter (as you suggest), or create a property on your view model (as Kent suggests).
Upvotes: 14