我是WPF的新手,下面的問題可能會讓很多人看起來很傻,請原諒。app.xaml.cs中的依賴屬性
如何在app.xaml.cs中創建依賴項屬性?
其實我試圖去創造它。下面的代碼,
public static DependencyProperty TempProperty =
DependencyProperty.Register("Temp", typeof(string), typeof(App));
public string Temp
{
get { return (string)GetValue(TempProperty); }
set { SetValue(TempProperty, value); }
}
拋出下面的編譯時錯誤:
「的GetValue」這個名字不會在目前情況下
名稱存在「的SetValue」在目前情況下不存在
有人可以幫我嗎?
謝謝!
沒有問題是愚蠢的。至少,不是你的:) – shahkalpesh 2009-08-28 20:06:09
哦......謝謝! :) – Vijay 2009-08-28 20:40:28