0
我想直接將ViewModel綁定到PropertyGrid,而ViewModel不必包含對其自身的引用。即在現階段,我有:將ViewModel直接綁定到擴展WPF工具包PropertyGrid
<xctk:PropertyGrid SelectedObject="{Binding ViewModel}">
而在視圖模型我有:
public class WatcherBaseViewModel : ObservableObject
{
[Browsable(false)]
// Do I really need this?
public WatcherBaseViewModel ViewModel
{
get { return this; }
}
// Rest of class removed for clarity
}
因爲這個作品這一切都非常的學術,但簡潔是智慧的靈魂和所有的...有什麼方式我可以直接在XAML綁定中引用ViewModel?
衛生署,知道它是簡單的東西,但是這只是從來沒有想過,我... – Gareth
呀有時會發生。 。! :) –