Value Type Duration is not allowed on property Duration in XAML
问题 I am trying to do the following with an ordinary Windows Metro style application: public class MyButton : Button { public Duration Duration { get; set; } } <Grid> <local:MyButton Duration="0:0:0.2" /> </Grid> But I receive the error: Value Type Duration is not allowed on property Duration in XAML Any idea what I might be doing wrong? Any help would be greatly appreciated. 回答1: This is a bug in the Visual Studio 11 Beta XAML compiler. You cannot set user-defined value type properties via XAML.