我是一名新手,对WPF不太了解,以下问题可能看起来很幼稚,请见谅。
如何在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'
有人能帮我吗?
谢谢!