How do I databind a ColumnDefinition's Width or RowDefinition's Height?
问题 Under the View-Model-ViewModel pattern for WPF, I am trying to databind the Heights and Widths of various definitions for grid controls, so I can store the values the user sets them to after using a GridSplitter. However, the normal pattern doesn't seem to work for these particular properties. Note: I'm posting this as a reference question that I'm posting as Google failed me and I had to work this out myself. My own answer to follow. 回答1: Create a IValueConverter as follows: public class