Вопрос

I am working with the Windows 8 developer build. I am attempting to create a basic dependency property. I've used them before in WPF and Silverlight. However, I'm not trying to create one in WinRT without any luck.

public static DependencyProperty GPAProperty = DependencyProperty.Register("GPA", "double", "MyNamespace.MyClass", new PropertyMetadata(0));
public double GPA
{
  get { return (double)GetValue(GPAProperty); }
  set { SetValue(GPAProperty, value); }
}

When I run my code, I get a runtime exception when the app first starts that says:

A first chance exception of type 'System.TypeInitializationException' occurred in mscorlib.dll

My question is, does this look right? I keep thinking I'm overlooking something. But it all looks correct to me.

Нет правильного решения

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top