我創建了我的用戶有Owner
財產依賴屬性空
<shared:NavigationControl Owner="{Binding ElementName=This, Converter={StaticResource TestConverter}}" />
This
財產是我的網頁x:Name
。
這裏是後面的代碼:
public MvxWindowsPage Owner
{
get { return (MvxWindowsPage)GetValue(OwnerProperty); }
set { SetValue(OwnerProperty, value); }
}
public static readonly DependencyProperty OwnerProperty =
DependencyProperty.Register("Owner", typeof(MvxWindowsPage), typeof(NavigationControl), null);
我創建TestConverter
檢查結合是確定的,它是。
爲什麼Owner
屬性是null
in cs?
您測試過這不是空嗎?顯示你在哪裏/如何設置這個。 – loopedcode
你可以顯示轉換器,你在那裏返回?我懷疑問題在轉換器內部 - 你有沒有'返回值';最後? – Romasz
當然,我認爲問題是,在窗口被加載後,價值獲得綁定,我想要在我的結構和它的綁定可能會得到的價值? – miechooy