WinRT : Dependency Properties
La déclaration en WinRT est différente de WPF / Silverlight.
Elle différe lors de la phase Register sur l’objet static DependencyProperty.
On note qu’en WPF / SL4, le Register prend un Type (typeof(TOTO)) comme argument, alors qu’en WinRT, il prend une chaine de caractères.
Note : Pour moi, ceci est un comportement imputable à la CTP de WinRT, je serai surpris que ce soit encore le cas lors de la RTM. My 2 Cents ![]()
WPF:
public int MatchesCount { get { return (int)GetValue(MatchesCountProperty); } set { SetValue(MatchesCountProperty, value); } } public static readonly DependencyProperty MatchesCountProperty = DependencyProperty.Register("MatchesCount",typeof(int),typeof(WidthMatchConverter),
new PropertyMetadata(0));
WinRT:
public int MatchesCount
{
get { return (int)GetValue(MatchesCountProperty); }
set { SetValue(MatchesCountProperty, value); }
}public static readonly DependencyProperty MatchesCountProperty =
DependencyProperty.Register(
« MatchesCount »,
« Int32″,
« WidthMatchConverter »,
new PropertyMetadata(0));
-
http://www.dotmim.com/2011/09/21/winrt-my-2-cents/ DotMim » WinRT : My 2 cents
-
Olivier Dahan
-
Anonyme