2013-04-16 32 views
0

我在一個小小的pickel,這裏是:MVVM和UserControl

我有一個MainWindow.xaml使用userControl。後者需要一個正常工作的路徑,並通過公共字符串屬性傳遞。

MainWindow與視圖模型結合在一起,我在其中創建上面所需的路徑。

是否有一個乾淨的方法來設置從MainWindow.xaml userControl的路徑屬性,例如綁定到其視圖模型的屬性之一? 喜歡的東西

<uc:MyUserControl x:Name="controlsName" 
    PathPropertyNeeded="{Binding ViewModelsProperty}" /> 

回答

相關問題