< ? x m l   v e r s i o n = " 1 . 0 "   e n c o d i n g = " u t f - 1 6 " ? >  
 < r s s   v e r s i o n = " 2 . 0 "   x m l n s : a t o m = " h t t p : / / w w w . w 3 . o r g / 2 0 0 5 / A t o m "   x m l n s : c o n t e n t = " h t t p : / / p u r l . o r g / r s s / 1 . 0 / m o d u l e s / c o n t e n t / " >  
     < c h a n n e l >  
         < a t o m : l i n k   r e l = " s e l f "   t y p e = " a p p l i c a t i o n / r s s + x m l "   h r e f = " h t t p s : / / w w w . r e f l e c t i o n i t . n l / b l o g / r s s "   / >  
         < t i t l e > R e f l e c t i o n   I T   B l o g < / t i t l e >  
         < l i n k > h t t p s : / / w w w . r e f l e c t i o n i t . n l / b l o g / r s s < / l i n k >  
         < d e s c r i p t i o n > T i m e   t o   r e f l e c t < / d e s c r i p t i o n >  
         < c o p y r i g h t > 2 0 2 6   R e f l e c t i o n   I T < / c o p y r i g h t >  
         < l a n g u a g e > e n < / l a n g u a g e >  
         < i t e m >  
             < t i t l e > C #   1 3   P a r a m s   C o l l e c t i o n s < / t i t l e >  
             < l i n k > h t t p s : / / w w w . r e f l e c t i o n i t . n l / b l o g / 2 0 2 4 / c s h a r p - 1 3 - p a r a m s - c o l l e c t i o n s < / l i n k >  
             < d e s c r i p t i o n   / >  
             < a u t h o r > f o n s . s o n n e m a n s @ r e f l e c t i o n i t . n l   ( F o n s   S o n n e m a n s ) < / a u t h o r >  
             < c a t e g o r y > C S h a r p < / c a t e g o r y >  
             < g u i d > h t t p s : / / w w w . r e f l e c t i o n i t . n l / b l o g / 2 0 2 4 / c s h a r p - 1 3 - p a r a m s - c o l l e c t i o n s < / g u i d >  
             < p u b D a t e > T u e ,   1 6   A p r   2 0 2 4   0 0 : 0 0 : 0 0   G M T < / p u b D a t e >  
             < c o n t e n t : e n c o d e d > < ! [ C D A T A [ < h t m l > < b o d y > < p > W i t h   t h e   v e r s i o n   1 7 . 1 0 . 0   P r e v i e w   3 . 0   o f   < a   h r e f = " h t t p s : / / v i s u a l s t u d i o . m i c r o s o f t . c o m / v s / p r e v i e w / " > V i s u a l   S t u d i o   P r e v i e w < / a >   y o u   c a n   t e s t   s o m e   n e w   C #   1 3   f e a t u r e s .   I n   t h i s   b l o g   I   w i l l   e x p l a i n   t h e   < s t r o n g > p a r a m s   C o l l e c t i o n < / s t r o n g >   f e a t u r e   a s   d o c u m e n t e d   i n   t h i s   < a   h r e f = " h t t p s : / / g i t h u b . c o m / d o t n e t / c s h a r p l a n g / b l o b / m a i n / p r o p o s a l s / p a r a m s - c o l l e c t i o n s . m d " > p r o p o s a l < / a > .   T o   u s e   t h i s   f e a t u r e   y o u   h a v e   t o   s e t   t h e   < s t r o n g > L a n g V e r s i o n < / s t r o n g >   i n   y o u r   c s p r o j   f i l e   t o   < s t r o n g > p r e v i e w < / s t r o n g > . < / p >  
 < p r e   c l a s s = " b r u s h :   h t m l " > & l t ; P r o j e c t   S d k = & q u o t ; M i c r o s o f t . N E T . S d k & q u o t ; & g t ;  
 	 & l t ; P r o p e r t y G r o u p & g t ;  
 	 	 & l t ; O u t p u t T y p e & g t ; E x e & l t ; / O u t p u t T y p e & g t ;  
 	 	 & l t ; T a r g e t F r a m e w o r k & g t ; n e t 8 . 0 & l t ; / T a r g e t F r a m e w o r k & g t ;  
 	 	 & l t ; I m p l i c i t U s i n g s & g t ; e n a b l e & l t ; / I m p l i c i t U s i n g s & g t ;  
 	 	 & l t ; N u l l a b l e & g t ; e n a b l e & l t ; / N u l l a b l e & g t ;  
 	 	 & l t ; L a n g V e r s i o n & g t ; p r e v i e w & l t ; / L a n g V e r s i o n & g t ;  
 	 & l t ; / P r o p e r t y G r o u p & g t ;  
 & l t ; / P r o j e c t & g t ;  
 < / p r e >  
 < p > I n   C # ,   t h e   ` p a r a m s `   k e y w o r d   a l l o w s   a   m e t h o d   t o   a c c e p t   a   v a r i a b l e   n u m b e r   o f   a r g u m e n t s ,   p r o v i d i n g   f l e x i b i l i t y   i n   h o w   m a n y   p a r a m e t e r s   y o u   p a s s   w i t h o u t   n e e d i n g   t o   d e f i n e   m u l t i p l e   m e t h o d   o v e r l o a d s .   T h i s   c a n   m a k e   y o u r   c o d e   m o r e   c o n c i s e   a n d   e a s i e r   t o   m a i n t a i n .   F o r   i n s t a n c e ,   i t & a p o s ; s   p a r t i c u l a r l y   u s e f u l   w h e n   t h e   e x a c t   n u m b e r   o f   i n p u t s   i s   n o t   k n o w n   i n   a d v a n c e   o r   c a n   v a r y .   M o r e o v e r ,   i t   s i m p l i f i e s   t h e   c a l l i n g   c o d e ,   a s   y o u   c a n   p a s s   a n   a r r a y   o r   a   c o m m a - s e p a r a t e d   l i s t   o f   a r g u m e n t s   t h a t   t h e   m e t h o d   w i l l   i n t e r p r e t   a s   a n   a r r a y . < / p >  
 < p > F r o m   C #   1 . 0   t i l l   1 2 . 0   p a r a m s   p a r a m e t e r   m u s t   b e   a n   a r r a y   t y p e .   H o w e v e r ,   i t   m i g h t   b e   b e n e f i c i a l   f o r   a   d e v e l o p e r   t o   b e   a b l e   t o   h a v e   t h e   s a m e   c o n v e n i e n c e   w h e n   c a l l i n g   A P I s   t h a t   t a k e   o t h e r   c o l l e c t i o n   t y p e s .   F o r   e x a m p l e ,   a n   I m m u t a b l e A r r a y & l t ; T & g t ; ,   R e a d O n l y S p a n & l t ; T & g t ; ,   o r   p l a i n   I E n u m e r a b l e .   E s p e c i a l l y   i n   c a s e s   w h e r e   c o m p i l e r   i s   a b l e   t o   a v o i d   a n   i m p l i c i t   a r r a y   a l l o c a t i o n   f o r   t h e   p u r p o s e   o f   c r e a t i n g   t h e   c o l l e c t i o n   ( I m m u t a b l e A r r a y & l t ; T & g t ; ,   R e a d O n l y S p a n & l t ; T & g t ; ,   e t c ) .   T h i s   s a v e s   H e a p   m e m o r y   a l l o c a t i o n   w h i c h   i m p r o v e s   t h e   p e r f o r m a n c e .   T h e   G a r b a g e   c o l l e c t o r   d o e s n & a p o s ; t   h a v e   t o   f r e e   t h i s   m e m o r y . < / p >  
 < h 2 > C #   1 . 0   p a r a m s   a r r a y < / h 2 >  
 < p > L e t s   s t a r t   w i t h   a n   e x a m p l e   o f   a n   o l d - s c h o o l   p a r a m s   a r r a y   p a r a m e t e r   i n   a   S u m   m e t h o d . & # 1 6 0 ; < / p >  
 < p r e   c l a s s = " b r u s h :   c s h a r p " > i n t e r n a l   c l a s s   P r o g r a m   {  
  
         s t a t i c   v o i d   M a i n ( s t r i n g [ ]   a r g s )   {  
                 C o n s o l e . W r i t e L i n e ( S u m ( 1 ,   2 ,   3 ,   a r g s . L e n g t h ) ) ;  
         }  
  
         p r i v a t e   s t a t i c   S u m ( p a r a m s   i n t [ ]   v a l u e s )   {  
                 i n t   s u m   =   0 ;  
                 f o r e a c h   ( v a r   i t e m   i n   v a l u e s )   {  
                         s u m   + =   i t e m ;  
                 }  
                 r e t u r n   s u m ;  
         }  
 }  
 < / p r e >  
 < p > W h e n   y o u   d e c o m p i l e   t h i s   c o d e   u s i n g   a   t o o l   l i k e   < a   h r e f = " h t t p s : / / g i t h u b . c o m / i c s h a r p c o d e / I L S p y " > I L S p y < / a >   o r   t h e   < a   h r e f = " h t t p s : / / s h a r p l a b . i o / # v 2 : E Y L g Z g p g h g L g r g J w g Z w L Q A U o K g W 2 Q Y Q H s A b Y i A Y x g E t C A 7 Z A G g B M Q B q A H w A E A m A R g F g A U E K q 0 Y E B L S j E A B D z m 8 A 7 D I D e Q o T M 0 K A b H I A s M g L J R R A C k 6 8 A D A G 0 A u j K w B z Z A E p V G r Z 4 s B O U w G U 4 H F N e B h l u U I B m U K d k A D o A G Q h a R x g A C x c X A G 4 P T Q B f d U F P A A c E K g A 3 W A g d G V E Y G Q C g o q x c Z B q x O x k K 4 j g U N z V C z y 1 a m W R A m Q B e G U t s g c G Z M E I k K H J U m V M K h B r x H D b O 6 R 7 X d 1 m 5 r V G d 1 k m q b Z m T m X z j r 2 U z m 6 1 7 + 6 A = " > S h a r p L a b . i o < / a >   w e b s i t e   y o u   s e e   t h a t   a n   a r r a y   o f   i n t [ 4 ]   i s   c r e a t e d   i n   t h e   M a i n ( )   m e t h o d   ( l i n e   5 ) .   T h i s   i s   h e a p   a l l o c a t i o n   w h i c h   i s   s o m e t h i n g   y o u   c a n / s h o u l d   a v o i d . < / p >  
 < p r e   c l a s s = " b r u s h :   c s h a r p " > i n t e r n a l   c l a s s   P r o g r a m  
 {  
         p r i v a t e   s t a t i c   v o i d   M a i n ( s t r i n g [ ]   a r g s )  
         {  
                 i n t [ ]   a r r a y   =   n e w   i n t [ 4 ] ;  
                 R u n t i m e H e l p e r s . I n i t i a l i z e A r r a y ( a r r a y ,   ( R u n t i m e F i e l d H a n d l e ) / * O p C o d e   n o t   s u p p o r t e d :   L d M e m b e r T o k e n * / ) ;  
                 a r r a y [ 3 ]   =   a r g s . L e n g t h ;  
                 C o n s o l e . W r i t e L i n e ( S u m ( a r r a y ) ) ;  
         }  
  
         p r i v a t e   s t a t i c   i n t   S u m ( p a r a m s   i n t [ ]   v a l u e s )  
         {  
                 i n t   n u m   =   0 ;  
                 i n t   n u m 2   =   0 ;  
                 w h i l e   ( n u m 2   & l t ;   v a l u e s . L e n g t h )  
                 {  
                         i n t   n u m 3   =   v a l u e s [ n u m 2 ] ;  
                         n u m   + =   n u m 3 ;  
                         n u m 2 + + ;  
                 }  
                 r e t u r n   n u m ;  
         }  
 }  
 < / p r e >  
 < h 2 > C #   1 3   p a r a m s   C o l l e c t i o n s < / h 2 >  
 < p > I n   t h e   n e x t   e x a m p l e   t h e   S u m ( )   m e t h o d   i s   u s i n g   a   < s t r o n g > p a r a m s   R e a d O n l y S p a n & l t ; i n t & g t ; < / s t r o n g >   p a r a m e t e r   i n   l i n e   7 .   N o t h i n g   e l s e   i s   c h a n g e d . & # 1 6 0 ; < / p >  
 < p r e   c l a s s = " b r u s h :   c s h a r p " > i n t e r n a l   c l a s s   P r o g r a m   {  
  
         s t a t i c   v o i d   M a i n ( s t r i n g [ ]   a r g s )   {  
                 C o n s o l e . W r i t e L i n e ( S u m ( 1 ,   2 ,   3 ,   a r g s . L e n g t h ) ) ;  
         }  
  
         p r i v a t e   s t a t i c   i n t   S u m ( p a r a m s   R e a d O n l y S p a n & l t ; i n t & g t ;   v a l u e s )   {  
                 i n t   s u m   =   0 ;  
                 f o r e a c h   ( v a r   i t e m   i n   v a l u e s )   {  
                         s u m   + =   i t e m ;  
                 }  
                 r e t u r n   s u m ;  
         }  
 }  
 < / p r e >  
 < p > W h e n   y o u   < a   h r e f = " h t t p s : / / s h a r p l a b . i o / # v 2 : E Y L g Z g p g h g L g r g J w g Z w L Q A U o K g W 2 Q Y Q H s A b Y i A Y x g E t C A 7 Z A G g B M Q B q A H w A E A m A R g F g A U F V o w I C W l G I A C H r N 4 B 2 a Q G 8 h Q 6 R v k A 2 W Q B Z p A W S g i A F J 1 4 A G A N o B d a V g D m y A J Q r 1 m j + Y C c J g M p w c E 1 4 G a W 4 Q g G Y Q x 2 Q A O g A Z C F o H G A A L Z 2 c A b n c N A F 8 1 Q Q 8 A B w Q q A D d Y C G 1 p E R h p f 0 D C r F x k a Q A l a C Y A e V p i A E 9 f R t o A H h q A P m l y 4 j g U V 1 U C j 0 0 a 6 W Q A 6 Q B e a Q s s + Y X p M E I k K H I U 6 R N y h G q x H G r a C a l p l z c d 3 c 0 V 6 9 Y N q i v t l + k 8 5 8 8 S j e P 0 0 / x y Q A = = " > d e c o m p i l e < / a >   t h i s   c o d e   y o u   s e e   a & # 1 6 0 ;   & l t ; & g t ; y _ _ I n l i n e A r r a y 4 & l t ; i n t & g t ;   v a l u e   i s   u s e d   i n   t h e   M a i n ( )   m e t h o d   ( l i n e   6 ) .   T h i s   i s   a   s t r u c t   w h i c h   i s   c r e a t e d   b y   t h e   c o m p i l e r .   I t   u s e s   t h e   < a   h r e f = " h t t p s : / / l e a r n . m i c r o s o f t . c o m / e n - u s / d o t n e t / c s h a r p / l a n g u a g e - r e f e r e n c e / p r o p o s a l s / c s h a r p - 1 2 . 0 / i n l i n e - a r r a y s " > I n l i n e   A r r a y s < / a >   f e a t u r e   o f   C #   1 2 .   S t r u c t s   a r e   a l l o c a t e d   o n   t h e   S t a c k   s o   t h i s   c o d e   d o e s n & a p o s ; t   a l l o c a t e   a n y   h e a p   m e m o r y . < / p >  
 < p r e   c l a s s = " b r u s h :   c s h a r p " > i n t e r n a l   c l a s s   P r o g r a m  
 {  
         [ N u l l a b l e C o n t e x t ( 1 ) ]  
         p r i v a t e   s t a t i c   v o i d   M a i n ( s t r i n g [ ]   a r g s )  
         {  
                 & l t ; & g t ; y _ _ I n l i n e A r r a y 4 & l t ; i n t & g t ;   b u f f e r   =   d e f a u l t ( & l t ; & g t ; y _ _ I n l i n e A r r a y 4 & l t ; i n t & g t ; ) ;  
                 & l t ; P r i v a t e I m p l e m e n t a t i o n D e t a i l s & g t ; . I n l i n e A r r a y E l e m e n t R e f & l t ; & l t ; & g t ; y _ _ I n l i n e A r r a y 4 & l t ; i n t & g t ; ,   i n t & g t ; ( r e f   b u f f e r ,   0 )   =   1 ;  
                 & l t ; P r i v a t e I m p l e m e n t a t i o n D e t a i l s & g t ; . I n l i n e A r r a y E l e m e n t R e f & l t ; & l t ; & g t ; y _ _ I n l i n e A r r a y 4 & l t ; i n t & g t ; ,   i n t & g t ; ( r e f   b u f f e r ,   1 )   =   2 ;  
                 & l t ; P r i v a t e I m p l e m e n t a t i o n D e t a i l s & g t ; . I n l i n e A r r a y E l e m e n t R e f & l t ; & l t ; & g t ; y _ _ I n l i n e A r r a y 4 & l t ; i n t & g t ; ,   i n t & g t ; ( r e f   b u f f e r ,   2 )   =   3 ;  
                 & l t ; P r i v a t e I m p l e m e n t a t i o n D e t a i l s & g t ; . I n l i n e A r r a y E l e m e n t R e f & l t ; & l t ; & g t ; y _ _ I n l i n e A r r a y 4 & l t ; i n t & g t ; ,   i n t & g t ; ( r e f   b u f f e r ,   3 )   =   a r g s . L e n g t h ;  
                 C o n s o l e . W r i t e L i n e ( S u m ( & l t ; P r i v a t e I m p l e m e n t a t i o n D e t a i l s & g t ; . I n l i n e A r r a y A s R e a d O n l y S p a n & l t ; & l t ; & g t ; y _ _ I n l i n e A r r a y 4 & l t ; i n t & g t ; ,   i n t & g t ; ( r e f   b u f f e r ,   4 ) ) ) ;  
         }  
  
         p r i v a t e   s t a t i c   i n t   S u m ( [ P a r a m C o l l e c t i o n ]   R e a d O n l y S p a n & l t ; i n t & g t ;   v a l u e s )  
         {  
                 i n t   n u m   =   0 ;  
                 R e a d O n l y S p a n & l t ; i n t & g t ;   r e a d O n l y S p a n   =   v a l u e s ;  
                 i n t   n u m 2   =   0 ;  
                 w h i l e   ( n u m 2   & l t ;   r e a d O n l y S p a n . L e n g t h )  
                 {  
                         i n t   n u m 3   =   r e a d O n l y S p a n [ n u m 2 ] ;  
                         n u m   + =   n u m 3 ;  
                         n u m 2 + + ;  
                 }  
                 r e t u r n   n u m ;  
         }  
 }  
  
 }  
  
 [ S t r u c t L a y o u t ( L a y o u t K i n d . A u t o ) ]  
 [ I n l i n e A r r a y ( 4 ) ]  
 i n t e r n a l   s t r u c t   & l t ; & g t ; y _ _ I n l i n e A r r a y 4 & l t ; T & g t ;  
 {  
         [ C o m p i l e r G e n e r a t e d ]  
         p r i v a t e   T   _ e l e m e n t 0 ;  
 }  
 < / p r e >  
 < h 2 > B e n c h m a r k < / h 2 >  
 < p > T o   c o m p a r e   t h e   p e r f o r m a n c e   b e t w e e n   t h e   t w o   I   h a v e   c r e a t e d   t h i s   B e n c h m a r k   u s i n g   < a   h r e f = " h t t p s : / / g i t h u b . c o m / d o t n e t / B e n c h m a r k D o t N e t " > B e n c h m a r k D o t N e t < / a > .   I t   c o m p a r e s   t h e   S u m   o f   5   d e c i m a l s   u s i n g   o l d - s c h o o l   < s t r o n g > p a r a m s   a r r a y s   < / s t r o n g > a n d   < s t r o n g > p a r a m s   R e a d O n l y C o l l e c t i o n & l t ; d e c i m a l & g t ; < / s t r o n g > . < / p >  
 < p r e   c l a s s = " b r u s h :   c s h a r p " > u s i n g   B e n c h m a r k D o t N e t . A t t r i b u t e s ;  
 u s i n g   B e n c h m a r k D o t N e t . R u n n i n g ;  
  
 B e n c h m a r k R u n n e r . R u n & l t ; B M & g t ; ( ) ;  
  
 [ M e m o r y D i a g n o s e r ( f a l s e ) ]  
 [ H i d e C o l u m n s ( & q u o t ; R a t i o S D & q u o t ; ,   & q u o t ; A l l o c   R a t i o & q u o t ; ) ]  
 / / [ S h o r t R u n J o b ]  
 p u b l i c   c l a s s   B M   {  
  
         p r i v a t e   d e c i m a l   _ v a l u e   =   5 0 0 m ;  
  
         [ B e n c h m a r k ]  
         p u b l i c   d e c i m a l   C a l l S u m A r r a y ( )   = & g t ;   S u m A r r a y ( 1 m ,   1 0 0 m ,   2 0 0 m ,   3 0 0 m ,   4 0 0 m ,   _ v a l u e ) ;  
  
         [ B e n c h m a r k ( B a s e l i n e   =   t r u e ) ]  
         p u b l i c   d e c i m a l   C a l l S u m S p a n ( )   = & g t ;   S u m S p a n ( 1 m ,   1 0 0 m ,   2 0 0 m ,   3 0 0 m ,   4 0 0 m ,   _ v a l u e ) ;  
  
         p r i v a t e   s t a t i c   d e c i m a l   S u m A r r a y ( p a r a m s   d e c i m a l [ ]   v a l u e s )   {  
                 d e c i m a l   s u m   =   0 ;  
                 f o r e a c h   ( v a r   i t e m   i n   v a l u e s )   {  
                         s u m   + =   i t e m ;  
                 }  
                 r e t u r n   s u m ;  
         }  
  
         p r i v a t e   s t a t i c   d e c i m a l   S u m S p a n ( p a r a m s   R e a d O n l y S p a n & l t ; d e c i m a l & g t ;   v a l u e s )   {  
                 d e c i m a l   s u m   =   0 ;  
                 f o r e a c h   ( v a r   i t e m   i n   v a l u e s )   {  
                         s u m   + =   i t e m ;  
                 }  
                 r e t u r n   s u m ;  
         }      
 }  
 < / p r e >  
 < p > T h e   C a l l S u m S p a n   m e t h o d   i s   2 8 %   f a s t e r   a n d   d o e s n & a p o s ; t   a l l o c a t e   a n y   h e a p   m e m o r y .   T h e   C a l l S u m A r r a y   m e t h o d   a l l o c a t e d   1 2 0   b y t e s . < / p >  
 < p > < i m g   s r c = " h t t p s : / / w w w . r e f l e c t i o n i t . n l / I m a g e s / B l o g / C S h a r p / P a r a m s / P a r a m s B M . p n g "   a l t = " B e n c h m a r k   s u m m a r y "   / > < / p >  
 < h 2 > D o n & a p o s ; t   w a n t   t o   w a i t   f o r   C #   1 3 < / h 2 >  
 < p > I f   y o u   d o n & a p o s ; t   w a n t   t o   w a i t   f o r   C #   1 3   y o u   c a n   a l r e a d y   u s e   a   s o l u t i o n   w i t h   s i m u l a r   r e s u l t s   i n   C #   1 2 .   Y o u   c a n   u s e   < a   h r e f = " h t t p s : / / l e a r n . m i c r o s o f t . c o m / e n - u s / d o t n e t / c s h a r p / l a n g u a g e - r e f e r e n c e / o p e r a t o r s / c o l l e c t i o n - e x p r e s s i o n s " > C o l l e c t i o n   E x p r e s s i o n < / a >   w i t h   a   n o r m a l   R e a d O n l y S p a n & l t ; T & g t ;   p a r a m e t e r .   A   c o l l e c t i o n   e x p r e s s i o n   c o n t a i n s   a   s e q u e n c e   o f   e l e m e n t s   b e t w e e n   < s t r o n g > [ < / s t r o n g >   a n d   < s t r o n g > ] < / s t r o n g >   b r a c k e t s ,   s e e   l i n e   4 . & # 1 6 0 ; < / p >  
 < p r e   c l a s s = " b r u s h :   c s h a r p " > i n t e r n a l   c l a s s   P r o g r a m   {  
  
         s t a t i c   v o i d   M a i n ( s t r i n g [ ]   a r g s )   {  
                 C o n s o l e . W r i t e L i n e ( S u m ( [ 1 ,   2 ,   3 ,   a r g s . L e n g t h ] ) ) ;  
         }  
  
         p r i v a t e   s t a t i c   i n t   S u m ( R e a d O n l y S p a n & l t ; i n t & g t ;   v a l u e s )   {  
                 i n t   s u m   =   0 ;  
                 f o r e a c h   ( v a r   i t e m   i n   v a l u e s )   {  
                         s u m   + =   i t e m ;  
                 }  
                 r e t u r n   s u m ;  
         }  
 }  
 < / p r e >  
 < p > W h e n   y o u & # 1 6 0 ; < a   h r e f = " h t t p s : / / s h a r p l a b . i o / # v 2 : E Y L g Z g p g h g L g r g J w g Z w L Q A U o K g W 2 Q Y Q H s A b Y i A Y x g E t C A 7 Z A G g B M Q B q A H w A E A m A R g F g A U E K q 0 Y E B L S j E A B D z m 8 A 7 D I D e Q o T M 0 K A b H I A s M g L J R R A C k 6 8 A D A G 0 A u j K w B z Z A E p V G r Z 4 s B O U w G U 4 H F N r X g Y Z b j C A Z j C n Z A A 6 A B k I W k c Y A A t b F x c A b g 9 N A F 9 1 Q U 8 A B w Q q A D d Y C B 0 Z U R g Z A K C A J W g m A H l a Y g B P P x K o W g A e e o A + G S r i O B Q 3 N W L P L X q Z Z E C Z A F 4 Z S 1 y 5 + Z k w Q i Q o c j S Z U y q E O v E c O t p x 6 S n X d 2 2 d r W W r 1 n W q S 6 3 n m U K n r 2 U r 2 + W j + f y A A = = = " > d e c o m p i l e < / a >   t h i s   c o d e   y o u   s e e   t h e   s a m e   c o d e   y o u   s a w   w h e n   y o u   u s e d   t h e   < s t r o n g > p a r a m s   R e a d O n l y C o l l e c t i o n & l t ; d e c i m a l & g t ; < / s t r o n g > . < / p >  
 < h 3 > C l o s u r e < / h 3 >  
 < p > I n   t h i s   b l o g   p o s t   I   s h o w e d   y o u   t h e   n e w   & a p o s ; p a r a m s   C o l l e c t i o n & a p o s ;   f e a t u r e   i n   C #   1 3 ,   a v a i l a b l e   i n   V i s u a l   S t u d i o   P r e v i e w   1 7 . 1 0 . 0   P r e v i e w   3 . 0 .   I t   e x p l a i n s   h o w   t o   e n a b l e   t h e   f e a t u r e   b y   s e t t i n g   & a p o s ; L a n g V e r s i o n & a p o s ;   t o   p r e v i e w   i n   t h e   p r o j e c t   f i l e   a n d   d e l v e s   i n t o   t h e   b e n e f i t s   o f   u s i n g   & a p o s ; p a r a m s & a p o s ;   w i t h   c o l l e c t i o n   t y p e s   o t h e r   t h a n   a r r a y s ,   l i k e   & a p o s ; R e a d O n l y S p a n & l t ; T & g t ; & a p o s ; .   T h i s   e n h a n c e m e n t   a i m s   t o   i m p r o v e   p e r f o r m a n c e   b y   r e d u c i n g   h e a p   m e m o r y   a l l o c a t i o n s ,   t h u s   e a s i n g   t h e   w o r k l o a d   o n   t h e   g a r b a g e   c o l l e c t o r .   T h e   p o s t   i n c l u d e s   a n   e x a m p l e   o f   t h e   t r a d i t i o n a l   & a p o s ; p a r a m s   a r r a y & a p o s ;   i n   a   ` S u m `   m e t h o d   t o   i l l u s t r a t e   t h e   c o n c e p t . < / p >  
 < p > H o p e f u l l y   M i c r o s o f t   w i l l   a d d   i n   . N E T   9   ( a n d   l a t e r )   m o r e   o v e r l o a d s   w i t h   & a p o s ; p a r a m s   R e a d O n l y S p a n & l t ; T & g t ; & a p o s ;   t o   t h e   m e t h o d s   w h i c h   a r e   u s i n g   & a p o s ; p a r a m s   a r r a y s & a p o s ; .   F o r   e x a m p l e   t h e   < a   h r e f = " h t t p s : / / l e a r n . m i c r o s o f t . c o m / e n - u s / d o t n e t / a p i / s y s t e m . s t r i n g . s p l i t ? v i e w = n e t - 8 . 0 # s y s t e m - s t r i n g - s p l i t ( s y s t e m - c h a r ( ) ) " > S t r i n g . S p l i t < / a >   m e t h o d . < / p >  
 < p > & # 1 6 0 ; < / p > < / b o d y > < / h t m l > ] ] > < / c o n t e n t : e n c o d e d >  
         < / i t e m >  
         < i t e m >  
             < t i t l e > U s i n g   M V V M   D e s i g n   P a t t e r n   i n   W i n d o w s   F o r m s < / t i t l e >  
             < l i n k > h t t p s : / / w w w . r e f l e c t i o n i t . n l / b l o g / 2 0 2 3 / u s i n g - m v v m - d e s i g n - p a t t e r n - i n - w i n d o w s - f o r m s < / l i n k >  
             < d e s c r i p t i o n   / >  
             < a u t h o r > f o n s . s o n n e m a n s @ r e f l e c t i o n i t . n l   ( F o n s   S o n n e m a n s ) < / a u t h o r >  
             < c a t e g o r y > M V V M < / c a t e g o r y >  
             < c a t e g o r y > W P F < / c a t e g o r y >  
             < c a t e g o r y > X A M L < / c a t e g o r y >  
             < c a t e g o r y > W i n F o r m s < / c a t e g o r y >  
             < g u i d > h t t p s : / / w w w . r e f l e c t i o n i t . n l / b l o g / 2 0 2 3 / u s i n g - m v v m - d e s i g n - p a t t e r n - i n - w i n d o w s - f o r m s < / g u i d >  
             < p u b D a t e > S a t ,   3 0   D e c   2 0 2 3   0 0 : 0 0 : 0 0   G M T < / p u b D a t e >  
             < c o n t e n t : e n c o d e d > < ! [ C D A T A [ < h t m l > < b o d y > < p > T h e   M V V M   D e s i g n   P a t t e r n   i s   m a i n l y   u s e d   i n   X A M L   e n v i r o m e n t s   l i k e   W P F ,   U W P ,   W i n U I ,   X a m a r i n   F o r m s   a n d   M A U I ,   b e c a u s e   t h e y   s u p p o r t   d a t a b i n d i n g   b e t w e e n   C o n t r o l s   a n d & # 1 6 0 ;   M o d e l s   b u t   a l s o   b e t w e e n   B u t t o n s   a n d   C o m m a n d s . < / p >  
 < p > I n   . N E T   8   i t   i s   p o s s i b l e   t o   i m p l e m e n t   t h e   M V V M   D e s i g n   P a t t e r n   i n   W i n d o w s   F o r m s   a p p s .   I t   u s e s   a   n e w   d a t a   b i n d i n g   e n g i n e   w h i c h   w a s   i n   p r e v i e w   w i t h   < a   h r e f = " h t t p s : / / l e a r n . m i c r o s o f t . c o m / e n - u s / d o t n e t / d e s k t o p / w i n f o r m s / w h a t s - n e w / n e t 7 0 ? v i e w = n e t d e s k t o p - 6 . 0 # d a t a - b i n d i n g - i m p r o v e m e n t s - p r e v i e w " > . N E T   7 < / a > ,   a n d   i s   n o w   f u l l y   e n a b l e d   i n   < a   h r e f = " h t t p s : / / l e a r n . m i c r o s o f t . c o m / e n - u s / d o t n e t / d e s k t o p / w i n f o r m s / w h a t s - n e w / n e t 8 0 ? v i e w = n e t d e s k t o p - 6 . 0 # d a t a - b i n d i n g - i m p r o v e m e n t s " > . N E T   8 < / a > .   T h i s   n e w   e n g i n e   i s   m o d e l e d   a f t e r   W P F ,   w h i c h   m a k e s   i t   e a s i e r   t o   i m p l e m e n t   M V V M   d e s i g n   p r i n c i p l e s .   T i m e   t o   w r i t e   a   b l o g   p o s t   a b o u t   i t . < / p >  
 < p > F o r   t h i s   p o s t   I   h a v e   w r i t t e n   a   s i m p l e   d e m o   S o l u t i o n   c o n t a i n i n g   3   p r o j e c t s .   T h e   M o d e l s L i b r a r y   p r o j e c t   c o n t a i n s   a   V i e w M o d e l   a n d   i s   r e f e r e n c e d   b y   a   W i n d o w s   F o r m s   a n d   W P F   p r o j e c t .   I   h a v e   p u b l i s h e d   t h i s   s o l u t i o n   i n   t h i s   < a   h r e f = " h t t p s : / / g i t h u b . c o m / s o n n e m a f / M v v m A p p s " > G i t H u b   r e p o s i t o r y < / a > . & # 1 6 0 ; < / p >  
 < p > T h e   U I   o f   t h e   W i n d o w s   F o r m s   a n d   W P F   a p p s   a r e   v e r y   s i m p l e .   I t   s h o w s   t h e   v a l u e   o f   a   C o u n t e r   a n d   h a s   a n   I n c r e m e n t   b u t t o n   t o   i n c r e m e n t   t h e   v a l u e   b y   1 .   S i m u l a r   t o   t h e   C o u n t e r   s a m p l e   p a g e   o f   a   B l a z o r   a p p . < / p >  
 < p > < i m g   s r c = " h t t p s : / / w w w . r e f l e c t i o n i t . n l / I m a g e s / B l o g / W i n F o r m s / M v v m / M v v m U I . p n g "   a l t = " E x a m p l e   a p p s "   / > < / p >  
 < h 2 > M o d e l s L i b r a r y < / h 2 >  
 < p > T h i s   p r o j e c t   i s   a   . N E T   S t a r d a r d   2 . 0   p r o j e c t   w i t h   t h e   L a n g V e r s i o n   s e t   t o   1 0 . 0 .   I   u s e   . N E T   S t a n d a r d   t o   a l l o w   i t   t o   b e   r e f e r e n c e d   f r o m   a   U W P   p r o j e c t .   I   u s e   C #   1 0   b e c a u s e   I   u s e   < a   h r e f = " h t t p s : / / l e a r n . m i c r o s o f t . c o m / e n - u s / d o t n e t / c o m m u n i t y t o o l k i t / m v v m / g e n e r a t o r s / o v e r v i e w " > C #   S o u r c e   G e n e r a t o r s < / a >   f r o m   t h e   < a   h r e f = " h t t p s : / / l e a r n . m i c r o s o f t . c o m / e n - u s / d o t n e t / c o m m u n i t y t o o l k i t / m v v m / " > C o m m u n i t y T o o l k i t . M v v m < / a >   N u G e t   p a c k a g e .   T h e   C o m m u n i t y T o o l k i t . M v v m   p a c k a g e   ( a k a   M V V M   T o o l k i t ,   f o r m e r l y   n a m e d   M i c r o s o f t . T o o l k i t . M v v m )   i s   a   m o d e r n ,   f a s t ,   a n d   m o d u l a r   M V V M   l i b r a r y .   I   u s e   i t   i n   a l l   m y   M V V M   p r o j e c t s . < / p >  
 < p > < i m g   s r c = " h t t p s : / / w w w . r e f l e c t i o n i t . n l / I m a g e s / B l o g / W i n F o r m s / M v v m / M o d e l s L i b r a r y P r o j e c t . p n g "   / > < / p >  
 < p > I n   t h i s   p r o j e c t   t h e r e   i s   o n l y   o n e   m o d e l   c l a s s   n a m e d   M a i n V i e w M o d e l .   I t   i s   a   p a r t i a l   c l a s s   t o   s u p p o r t   C #   s o u r c e   g e n e r a t i o n .   I t   i n h e r i t s   f r o m   < a   h r e f = " h t t p s : / / l e a r n . m i c r o s o f t . c o m / e n - u s / d o t n e t / c o m m u n i t y t o o l k i t / m v v m / o b s e r v a b l e o b j e c t " > O b s e r v a b l e O b j e c t < / a >   t o   a l l o w   d a t a   b i n d i n g   ( b y   i m p l e m e n t i n g   t h e   I N o t i f y P r o p e r t y C h a n g e d   i n t e r f a c e ) . < / p >  
 < p > T h e   p r i v a t e   f i e l d   < e m > _ c o u n t e r   < / e m > i s   a n n o t a t e d   w i t h   t h e   < a   h r e f = " h t t p s : / / l e a r n . m i c r o s o f t . c o m / e n - u s / d o t n e t / c o m m u n i t y t o o l k i t / m v v m / g e n e r a t o r s / o b s e r v a b l e p r o p e r t y " > O b s e r v a b l e P r o p e r t y < / a >   a t t r i b u t e .   T h i s   a t t r i b u t e   g e n e r a t e s   o b s e r v a b l e   p r o p e r t i e s   f r o m   a n n o t a t e d   f i e l d s .   I t s   p u r p o s e   i s   t o   g r e a t l y   r e d u c e   t h e   a m o u n t   o f   b o i l e r p l a t e   t h a t   i s   n e e d e d   t o   d e f i n e   o b s e r v a b l e   p r o p e r t i e s . < / p >  
 < p > T h e   I n c r e m e n t   m e t h o d   i s   a n n o t a t e d   w i t h   t h e   < a   h r e f = " h t t p s : / / l e a r n . m i c r o s o f t . c o m / e n - u s / d o t n e t / c o m m u n i t y t o o l k i t / m v v m / g e n e r a t o r s / r e l a y c o m m a n d " > R e l a y C o m m a n d < / a >   a t t r i b u t e .   T h e   m e t h o d   w i l l   i n c r e a s e   t h e   C o u n t e r   p r o p e r t y   b y   1 .   T h i s   a t t r i b u t e   g e n e r a t e s   r e l a y   c o m m a n d   p r o p e r t i e s   f o r   a n n o t a t e d   m e t h o d s .   I t s   p u r p o s e   i s   t o   c o m p l e t e l y   e l i m i n a t e   t h e   b o i l e r p l a t e   t h a t   i s   n e e d e d   t o   d e f i n e   c o m m a n d s   w r a p p i n g   p r i v a t e   m e t h o d s   i n   a   v i e w m o d e l .   I t   i s   o f t e n   u s e f u l   t o   b e   a b l e   t o   d i s a b l e   c o m m a n d s ,   a n d   t o   t h e n   l a t e r   o n   i n v a l i d a t e   t h e i r   s t a t e   a n d   h a v e   t h e m   c h e c k   a g a i n   w h e t h e r   t h e y   c a n   b e   e x e c u t e d   o r   n o t .   I n   o r d e r   t o   s u p p o r t   t h i s ,   t h e   R e l a y C o m m a n d   a t t r i b u t e   e x p o s e s   t h e   C a n E x e c u t e   p r o p e r t y ,   w h i c h   c a n   b e   u s e d   t o   i n d i c a t e   a   t a r g e t   p r o p e r t y   o r   m e t h o d   t o   u s e   t o   e v a l u a t e   w h e t h e r   a   c o m m a n d   c a n   b e   e x e c u t e d .   I n   t h i s   d e m o   t h e   I n c r e m e n t   i s   o n l y   v a l i d   i f   t h e   C o u n t e r   v a l u e   i s   l e s s   t h a n   1 0 . < / p >  
 < p r e   c l a s s = " b r u s h :   c s h a r p " > u s i n g   C o m m u n i t y T o o l k i t . M v v m . C o m p o n e n t M o d e l ;  
 u s i n g   C o m m u n i t y T o o l k i t . M v v m . I n p u t ;  
  
 n a m e s p a c e   M o d e l s L i b r a r y . V i e w M o d e l s ;  
  
 / /   T h i s   m u s t   b e   a   p a r t i a l   c l a s s ,   t h e   C o m m u n i t y T o o l k i t . M v v m  
 / /   S o u r c e   G e n e r a t o r   w i l l   a d d   P r o p e r t i e s   t o   i t .  
 p u b l i c   p a r t i a l   c l a s s   M a i n V i e w M o d e l   :   O b s e r v a b l e O b j e c t   {  
  
         [ O b s e r v a b l e P r o p e r t y ]  
         [ N o t i f y C a n E x e c u t e C h a n g e d F o r ( n a m e o f ( I n c r e m e n t C o m m a n d ) ) ]  
         p r i v a t e   i n t   _ c o u n t e r ;  
  
         [ R e l a y C o m m a n d ( C a n E x e c u t e   =   n a m e o f ( C a n I n c r e m e n t ) ) ]  
         p r i v a t e   v o i d   I n c r e m e n t ( )   {  
                 C o u n t e r + + ;  
         }  
  
         p r i v a t e   b o o l   C a n I n c r e m e n t   = & g t ;   C o u n t e r   & l t ;   1 0 ;  
 }  
 < / p r e >  
 < h 2 > W P F   a p p < / h 2 >  
 < p > T h e   W P F   a p p   h a s   a   M a i n W i n d o w   i n   t h e   < e m > V i e w s / W i n d o w s < / e m >   f o l d e r .   T h e   p r o j e c t   r e f e r e n c e s   t h e   M o d e l s L i b r a r y   p r o j e c t . < / p >  
 < p > < i m g   s r c = " h t t p s : / / w w w . r e f l e c t i o n i t . n l / I m a g e s / B l o g / W i n F o r m s / M v v m / W p f P r o j e c t . p n g "   / > < / p >  
 < p > I n   t h e   M a i n W i n d o w   t h e   W i n d o w . D a t a C o n t e x t   p r o p e r t y   c r e a t e s   a   n e w   i n s t a n c e   ( o b j e c t )   o f   t h e   M a i n V i e w M o d e l   c l a s s .   T h e   T e x t   o f   t h e   T e x t B l o c k   i s   < a   h r e f = " h t t p s : / / l e a r n . m i c r o s o f t . c o m / e n - u s / d o t n e t / d e s k t o p / w p f / d a t a / ? v i e w = n e t d e s k t o p - 8 . 0 " > d a t a b o u n d < / a >   t o   t h e   ( g e n e r a t e d )   C o u n t e r   p r o p e r t y   o f   t h e   M a i n V i e w M o d e l   o b j e c t .   T h e   C o m m a n d   o f   t h e   B u t t o n   i s   d a t a b o u n d   t o   t h e   ( g e n e r a t e d )   I n c r e m e n t C o m m a n d   p r o p e r t y .   T h e r e   i s   n o   c o d e   a d d e d   t o   t h e   c o d e b e h i n d   ( M a i n W i n d o w . x a m l . c s ) .   T h i s   b i n d i n g   i s   < a   h r e f = " h t t p s : / / l e a r n . m i c r o s o f t . c o m / e n - u s / d o t n e t / d e s k t o p / w p f / d a t a / b i n d i n g - d e c l a r a t i o n s - o v e r v i e w ? v i e w = n e t d e s k t o p - 8 . 0 " > d e c l a r e d < / a >   i n   X A M L   u s i n g   < s t r o n g > { B i n d i n g } < / s t r o n g > .   T h e   B i n d i n g   o f   t h e   T e x t B l o c k   u s e s   a & # 1 6 0 ; < e m > C 2   < / e m > S t r i n g F o r m a t   t o   f o r m a t   t h e   v a l u e   t o   a   c u r r e n c y . < / p >  
 < p r e   c l a s s = " b r u s h :   h t m l " > & l t ; W i n d o w   x : C l a s s = & q u o t ; W p f M v v m A p p . V i e w s . W i n d o w s . M a i n W i n d o w & q u o t ;  
                 x m l n s = & q u o t ; h t t p : / / s c h e m a s . m i c r o s o f t . c o m / w i n f x / 2 0 0 6 / x a m l / p r e s e n t a t i o n & q u o t ;  
                 x m l n s : x = & q u o t ; h t t p : / / s c h e m a s . m i c r o s o f t . c o m / w i n f x / 2 0 0 6 / x a m l & q u o t ;  
                 x m l n s : d = & q u o t ; h t t p : / / s c h e m a s . m i c r o s o f t . c o m / e x p r e s s i o n / b l e n d / 2 0 0 8 & q u o t ;  
                 x m l n s : m c = & q u o t ; h t t p : / / s c h e m a s . o p e n x m l f o r m a t s . o r g / m a r k u p - c o m p a t i b i l i t y / 2 0 0 6 & q u o t ;  
                 x m l n s : v m = & q u o t ; c l r - n a m e s p a c e : M o d e l s L i b r a r y . V i e w M o d e l s ; a s s e m b l y = M o d e l s L i b r a r y & q u o t ;  
                 T i t l e = & q u o t ; M v v m   W P F   a p p & q u o t ;  
                 W i d t h = & q u o t ; 3 0 0 & q u o t ;  
                 H e i g h t = & q u o t ; 2 0 0 & q u o t ;  
                 F o n t S i z e = & q u o t ; 2 5 & q u o t ;  
                 m c : I g n o r a b l e = & q u o t ; d & q u o t ; & g t ;  
         & l t ; W i n d o w . D a t a C o n t e x t & g t ;  
                 & l t ; v m : M a i n V i e w M o d e l   / & g t ;  
         & l t ; / W i n d o w . D a t a C o n t e x t & g t ;  
         & l t ; G r i d & g t ;  
                 & l t ; G r i d . R o w D e f i n i t i o n s & g t ;  
                         & l t ; R o w D e f i n i t i o n   H e i g h t = & q u o t ; 1 * & q u o t ;   / & g t ;  
                         & l t ; R o w D e f i n i t i o n   H e i g h t = & q u o t ; 1 * & q u o t ;   / & g t ;  
                 & l t ; / G r i d . R o w D e f i n i t i o n s & g t ;  
                 & l t ; T e x t B l o c k   H o r i z o n t a l A l i g n m e n t = & q u o t ; C e n t e r & q u o t ;  
                                       V e r t i c a l A l i g n m e n t = & q u o t ; C e n t e r & q u o t ;  
                                       T e x t = & q u o t ; { B i n d i n g   C o u n t e r ,   M o d e = O n e W a y ,   S t r i n g F o r m a t = C 2 } & q u o t ;   / & g t ;  
                 & l t ; B u t t o n   G r i d . R o w = & q u o t ; 1 & q u o t ;  
                                 P a d d i n g = & q u o t ; 8 & q u o t ;  
                                 H o r i z o n t a l A l i g n m e n t = & q u o t ; C e n t e r & q u o t ;  
                                 V e r t i c a l A l i g n m e n t = & q u o t ; C e n t e r & q u o t ;  
                                 C o m m a n d = & q u o t ; { B i n d i n g   I n c r e m e n t C o m m a n d ,   M o d e = O n e T i m e } & q u o t ;  
                                 C o n t e n t = & q u o t ; I n c r e m e n t & q u o t ;   / & g t ;  
         & l t ; / G r i d & g t ;  
 & l t ; / W i n d o w & g t ;  
 < / p r e >  
 < h 2 > W i n d o w s   F o r m s   a p p < / h 2 >  
 < p > T h e   W i n d o w s   F o r m s   a p p   h a s   a   M a i n F o r m   i n   t h e   < e m > V i e w s / F o r m s < / e m >   f o l d e r .   T h i s   p r o j e c t   a l s o   r e f e r e n c e s   t h e   M o d e l s L i b r a r y   p r o j e c t . < / p >  
 < p > < i m g   s r c = " h t t p s : / / w w w . r e f l e c t i o n i t . n l / I m a g e s / B l o g / W i n F o r m s / M v v m / W i n F o r m s P r o j e c t . p n g "   / > < / p >  
 < p > T h e   M a i n F o r m   h a s   a   L a b e l   a n d   a   B u t t o n   c o n t r o l .   T h e   d a t a b i n d i n g   i s   d e f i n e d   i n   t h e   c o d e b e h i n d   o f   t h e   f o r m .   I   c o u l d   h a v e   u s e d   t h e   W i n d o w s   F o r m s   d e s i g n e r   f o r   t h i s   b u t   I   p r e f e r   t o   d o   t h i s   m a n u a l l y   i n   t h e   C o d e B e h i n d .   I n   t h e   c o n s t r u c t o r   o f   t h e   M a i n F o r m   a   n e w   i n s t a n c e   o f   t h e   M a i n V i e w M o d e l   i s   c r e a t e d .   I t   i s   s t o r e d   i n   a   p r i v a t e   r e a d o n l y   f i e l d   s o   y o u   c a n   u s e   i t   e v e r w h e r e .   N o t   t h a t   I & a p o s ; m   u s i n g   i t   i n   t h i s   d e m o . < / p >  
 < p > I n   t h e   c o n s t r u c t o r   I   c r e a t e d   a   B i n d i n g   o b j e c t   b y   c a l l i n g   t h e   A d d   m e t h o d   o f   t h e   D a t a B i n d i n g s   p r o p e r t y   o f   t h e   L a b e l .   T h e   A d d   m e t h o d   b i n d s   t h e   T e x t   p r o p e r t y   t o   t h e   C o u n t e r   p r o p e r t y   o f   t h e   M a i n V i e w M o d e l   i n s t a n c e .   O n   t h i s   B i n d i n g   o b j e c t   I   s e t   t h e   F o r m a t S t r i n g   p r o p e r t y   t o   < e m > C 2 < / e m >   a n d   e n a b l e d   t h e   F o r m a t t i n g . < / p >  
 < p > T h e   < a   h r e f = " h t t p s : / / l e a r n . m i c r o s o f t . c o m / e n - u s / d o t n e t / d e s k t o p / w i n f o r m s / w h a t s - n e w / n e t 8 0 ? v i e w = n e t d e s k t o p - 6 . 0 # b u t t o n - c o m m a n d s " > C o m m a n d < / a >   p r o p e r t y   o f   t h e   B u t t o n   c o n t r o l   i s   n e w   i n   . N E T   8 .   I   h a v e   s e t   i t   t o   t h e   I n c r e m e n t P r o p e r t y   o f   t h e   M a i n V i e w M o d e l   i n s t a n c e .   W h e n   t h e   b u t t o n   i s   c l i c k e d   t h e   C o m m a n d   i s   e x e c u t e d .   T h e   b u t t o n   w i l l   b e   d i s a b l e d   w h e n   t h e   v a l u e   o f   t h e   C o u n t e r   r e a c h e s   1 0 . < / p >  
 < p r e   c l a s s = " b r u s h :   c s h a r p " > u s i n g   M o d e l s L i b r a r y . V i e w M o d e l s ;  
  
 n a m e s p a c e   W i n F o r m s M v v m A p p . V i e w s . F o r m s ;    
  
 p u b l i c   p a r t i a l   c l a s s   M a i n F o r m   :   F o r m   {  
  
         p r i v a t e   r e a d o n l y   M a i n V i e w M o d e l   _ v m ;  
  
         p u b l i c   M a i n F o r m ( )   {  
                 I n i t i a l i z e C o m p o n e n t ( ) ;  
  
                 _ v m   =   n e w   M a i n V i e w M o d e l ( ) ;  
  
                 v a r   b i n d i n g   =   l a b e l C o u n t e r . D a t a B i n d i n g s . A d d ( n a m e o f ( l a b e l C o u n t e r . T e x t ) ,   _ v m ,   n a m e o f ( _ v m . C o u n t e r ) ) ;  
                 b i n d i n g . F o r m a t S t r i n g   =   & q u o t ; C 2 & q u o t ; ;  
                 b i n d i n g . F o r m a t t i n g E n a b l e d   =   t r u e ;  
  
                 b u t t o n I n c r e m e n t . C o m m a n d   =   _ v m . I n c r e m e n t C o m m a n d ;  
         }  
 }  
 < / p r e >  
 < h 2 > C l o s u r e < / h 2 >  
 < p > I   l o v e   t h e   M V V M   D e s i g n   p a t t e r n .   I   u s e   i t   i n   a l l   m y   X A M L   a p p s .   Y o u   c a n   u s e   i t   n o w   i n   W i n d o w s   F o r m s   a p p s   t o o .   T h i s   i s   v e r y   c o o l   a n d   e a s y .   W a y   b e t t e r   t h a n   i m p l e m e n t i n g   C l i c k   e v e n t s   i n   t h e   C o d e B e h i n d .   E s p e c i a l l y   i f   y o u   c a r e   a b o u t   w r i t i n g   < a   h r e f = " h t t p s : / / l e a r n . m i c r o s o f t . c o m / e n - u s / a r c h i v e / m s d n - m a g a z i n e / 2 0 1 3 / n o v e m b e r / m v v m - w r i t i n g - a - t e s t a b l e - p r e s e n t a t i o n - l a y e r - w i t h - m v v m " > U n i t   T e s t s < / a > . & # 1 6 0 ; < / p >  
 < p > I n   a   n e x t   b l o g   I   w i l l   e x p l a i n   s o m e   m o r e   a d v a n c e d   W i n d o w s   F o r m s   s c e n a r i o s   l i k e   b i n d i n g   t o   O b s e r v a b l e C o l l e c t i o n s   a n d   u s i n g   C o m m a n d   P a r a m e t e r s . < / p >  
 < p > B e l o w   y o u   c a n   f i n d   s o m e   l i n k s   a b o u t   t h e   u s a g e   o f   t h e   M V V M   d e s i g n   p a t t e r n s   i n   U W P ,   W P F   a n d   M A U I   a p p s . < / p >  
 < u l >  
 < l i > < a   h r e f = " h t t p s : / / l e a r n . m i c r o s o f t . c o m / e n - u s / w i n d o w s / u w p / d a t a - b i n d i n g / d a t a - b i n d i n g - a n d - m v v m " > h t t p s : / / l e a r n . m i c r o s o f t . c o m / e n - u s / w i n d o w s / u w p / d a t a - b i n d i n g / d a t a - b i n d i n g - a n d - m v v m < / a > & # 1 6 0 ; < / l i >  
 < l i > < a   h r e f = " h t t p s : / / l e a r n . m i c r o s o f t . c o m / e n - u s / a r c h i v e / m s d n - m a g a z i n e / 2 0 0 9 / f e b r u a r y / p a t t e r n s - w p f - a p p s - w i t h - t h e - m o d e l - v i e w - v i e w m o d e l - d e s i g n - p a t t e r n " > h t t p s : / / l e a r n . m i c r o s o f t . c o m / e n - u s / a r c h i v e / m s d n - m a g a z i n e / 2 0 0 9 / f e b r u a r y / p a t t e r n s - w p f - a p p s - w i t h - t h e - m o d e l - v i e w - v i e w m o d e l - d e s i g n - p a t t e r n < / a > & # 1 6 0 ; < / l i >  
 < l i > < a   h r e f = " h t t p s : / / l e a r n . m i c r o s o f t . c o m / e n - u s / d o t n e t / a r c h i t e c t u r e / m a u i / m v v m " > h t t p s : / / l e a r n . m i c r o s o f t . c o m / e n - u s / d o t n e t / a r c h i t e c t u r e / m a u i / m v v m < / a > < / l i >  
 < / u l > < / b o d y > < / h t m l > ] ] > < / c o n t e n t : e n c o d e d >  
         < / i t e m >  
         < i t e m >  
             < t i t l e > X A M L   N u m b e r B o x   n o t   a c c e p t i n g   l e t t e r s < / t i t l e >  
             < l i n k > h t t p s : / / w w w . r e f l e c t i o n i t . n l / b l o g / 2 0 2 3 / x a m l - n u m b e r b o x - n o t - a c c e p t i n g - l e t t e r s < / l i n k >  
             < d e s c r i p t i o n   / >  
             < a u t h o r > f o n s . s o n n e m a n s @ r e f l e c t i o n i t . n l   ( F o n s   S o n n e m a n s ) < / a u t h o r >  
             < c a t e g o r y > A p p s < / c a t e g o r y >  
             < c a t e g o r y > X A M L < / c a t e g o r y >  
             < c a t e g o r y > U W P < / c a t e g o r y >  
             < c a t e g o r y > W i n U I < / c a t e g o r y >  
             < c a t e g o r y > W i n d o w s A p p S D K < / c a t e g o r y >  
             < c a t e g o r y > C S h a r p < / c a t e g o r y >  
             < g u i d > h t t p s : / / w w w . r e f l e c t i o n i t . n l / b l o g / 2 0 2 3 / x a m l - n u m b e r b o x - n o t - a c c e p t i n g - l e t t e r s < / g u i d >  
             < p u b D a t e > M o n ,   0 4   S e p   2 0 2 3   0 0 : 0 0 : 0 0   G M T < / p u b D a t e >  
             < c o n t e n t : e n c o d e d > < ! [ C D A T A [ < h t m l > < b o d y > < p > L a s t   w e e k   t h e r e   w a s   a & # 1 6 0 ; < a   h r e f = " h t t p s : / / t w i t t e r . c o m / a r c h i e c o d e r / s t a t u s / 1 6 9 7 4 0 9 7 2 0 5 5 2 6 5 2 8 2 3 " > d i s c u s s i o n < / a >   o n   X   ( f o r m e r   T w i t t e r )   a b o u t   t h e   u s a g e   o f   t h e   N u m b e r B o x   i n   W i n U I   a p p s .   S h o u l d   i t   a c c e p t   l e t t e r   i n p u t s   o r   n o t .   T h e   & a p o s ; c o n l u s i o n & a p o s ;   w a s   t h a t   i t   s h o u l d   b e c a u s e   y o u   c a n   e n t e r   f o r m u l a s .   B u t   t h e r e   a r e   a l s o   a   f e w   d e v e l o p e r s   w h i c h   d o n & a p o s ; t   l i k e   t h i s .   S o   I   t o o k   u p   t h e   c h a l l e n g e   t o   f i n d   a   s o l u t i o n   f o r   t h i s   p r o b l e m .   M y   f i r s t   g u e s s   w a s   t h a t   I   s h o u l d   c r e a t e   a n   A t t a c h e d P r o p e r t y   o r   B e h a v i o r   f o r   t h i s .   I   w a s   w r o n g .   A t t a c h e d P r o p e r t i e s   c a n & a p o s ; t   b e   u s e d   f o r   t h i s .   Y o u   c a n & a p o s ; t   u s e   t h e m   f o r   h a n d i n g   e v e n t s   o n   c o n t r o l s .   B e h a v i o r s   c a n   b u t   t h e y   r e q u i r e   y o u   t o   a d d   a n   e x t r a   < a   h r e f = " h t t p s : / / w w w . n u g e t . o r g / p a c k a g e s / M i c r o s o f t . X a m l . B e h a v i o r s . W i n U I . M a n a g e d " > N u G e t < / a >   p a c k a g e   t o   t h e   p r o j e c t .   S o m e t h i n g   y o u   m i g h t   n o t   w a n t .   S o   I   d e c i d e d   t o   u s e   c o m p i l e d   b i n d i n g   ( x : B i n d )   t o   e v e n t s ,   a l s o   k n o w n   a s   < a   h r e f = " h t t p s : / / l e a r n . m i c r o s o f t . c o m / e n - u s / w i n d o w s / u w p / x a m l - p l a t f o r m / x - b i n d - m a r k u p - e x t e n s i o n # e v e n t - b i n d i n g " > E v e n t   B i n d i n g < / a > . < / p >  
 < h 3 > M y   S o l u t i o n < / h 3 >  
 < p > < i m g   s r c = " h t t p s : / / w w w . r e f l e c t i o n i t . n l / I m a g e s / B l o g / X A M L / N u m b e r B o x / N u m b e r B o x S c r e e n s h o t . p n g "   a l t = " W i n U I   a n d   U W P   N u m b e r B o x   s c r e e n s h o t "   / > < / p >  
 < p > T h e r e   a r e   a   f e w   & a p o s ; K e y & a p o s ;   e v e n t s   y o u   c a n   u s e :   K e y D o w n ,   K e y U p ,   P r e v i e w K e y D o w n   a n d   P r e v i e w K e y U p .   A l l   e v e n t s   u s e   t h e   K e y E v e n t H a n d l e r   d e l e g a t e   b u t   i t   i s   t h e   P r e v i e w K e y D o w n   y o u   s h o u l d   u s e .   I t   a l l o w s   y o u   t o   s e t   t h e   H a n d l e d   p r o p e r t y   o f   t h e   K e y R o u t e d E v e n t A r g s   t o   t r u e .   T h i s   w i l l   c a n c e l   t h e   i n p u t . < / p >  
 < p > I & a p o s ; m   u s i n g   E v e n t   B i n d i n g   i n s t e a d   o f   t h e   m o r e   c o m m o n   s o l u t i o n   i n   w h i c h   y o u   h a n d l e   e v e n t s   i n   t h e   c o d e - b e h i n d   o f   t h e   W i n d o w ,   P a g e   o r   U s e r C o n t r o l .   T h i s   m a k e s   m y   s o l u t i o n   r e u s a b l e   w h i c h   I   a l w a y s   p r e f e r .   A l l   c o d e   i s   j u s t   i n   a   s i n g l e   c l a s s .   T h i s & # 1 6 0 ; < s t r o n g > P r e v i e w K e y D o w n H a n d l e r   < / s t r o n g > c l a s s   h a s   3   p u b l i c   s t a t i c   m e t h o d s   t o   w h i c h   y o u   c a n   b i n d   t o .   U s e   t h e   o n e   y o u   t h i n k   w o r k s   b e s t   f o r   y o u . < / p >  
 < u l >  
 < l i > R e j e c t L e t t e r s ,   d o n & a p o s ; t   a c c e p t   l e t t e r s   A   t o   Z < / l i >  
 < l i > A c c e p t N u m b e r s O n l y ,   o n l y   s u p p o r t   n u m b e r s   b u t   o f f   c o u r s e   a l s o   c u r s o r   & a m p ;   t a b   k e y s < / l i >  
 < l i > A c c e p t N u m b e r s A n d O p e r a t o r s ,   u s e   t h i s   w h e n   y o u   h a v e   A c c e p t s E x p r e s s i o n   t u r n e d   o n . < / l i >  
 < / u l >  
 < p > T h i s   c l a s s   i s   w r i t t e n   u s i n g   C #   9 . 0   s o   m a k e   s u r e   y o u   u p g r a d e   t o   t h i s   v e r s i o n   i n   U W P   p r o j e c t ,   s e t   L a n g V e r s i o n   t o   9 . 0   o r   h i g h e r   i n   y o u r   p r o j e c t   f i l e .   I   u s e   c o n d i t i o n a l   c o m p i l a t i o n   f o r   i m p o r t i n g   t h e   c o r r e c t   n a m e s p a c e s   a n d   t h e   G e t K e y S t a t e   f u n c t i o n   w h i c h   a r e   d i f f e r e n t   i n   W i n U I .   I   u s e   t h e   I s M o d i f i e r K e y D o w n ( )   m e t h o d   t o   h a n d l e   s p e c i a l   c a s e s   l i k e   a   C t r l + C   o r   a   W i n d o w s + P .   T h o s e   s h o u l d   n o t   b e   c a n c e l l e d . < / p >  
 < p r e   c l a s s = " b r u s h :   c s h a r p " > # i f   W I N D O W S _ U W P  
 u s i n g   W i n d o w s . U I . X a m l . I n p u t ;  
 # e l s e  
 u s i n g   M i c r o s o f t . U I . X a m l . I n p u t ;  
 # e n d i f  
 u s i n g   S y s t e m ;  
 u s i n g   W i n d o w s . S y s t e m ;  
 u s i n g   W i n d o w s . U I . C o r e ;  
  
 n a m e s p a c e   H e l p e r s   {  
  
         / / /   & l t ; s u m m a r y & g t ;  
         / / /   T h i s   h e l p e r   c l a s s   i s   u s e d   t o   a v o i d   l e t t e r   i n p u t s   f o r   a   N u m b e r B o x .    
         / / /   M a k e   s u r e   y o u   u p g r a d e   y o u r   U W P   p r o j e c t   t o   a t   l e a s t   C #   9 . 0 ,   w e   u s e   s w i t c h   e x p r e s s i o n s   a n d    
         / / /   l o g i c a l   p a t t e r n   m a t c h i n g .  
         / / /   & l t ; c o d e & g t ;  
         / / /   & l t ; N u m b e r B o x   P r e v i e w K e y D o w n = & q u o t ; { x : B i n d   h e l p e r s : P r e v i e w K e y D o w n H a n d l e r . A c c e p t N u m b e r s O n l y } & q u o t ;   / & g t ;  
         / / /   & l t ; / c o d e & g t ;  
         / / /   & l t ; / s u m m a r y & g t ;  
         s t a t i c   c l a s s   P r e v i e w K e y D o w n H a n d l e r   {  
  
 # i f   W I N D O W S _ U W P  
                 p r i v a t e   s t a t i c   r e a d o n l y   F u n c & l t ; V i r t u a l K e y ,   C o r e V i r t u a l K e y S t a t e s & g t ;   _ k e y S t a t e F u n c t i o n   =   C o r e W i n d o w . G e t F o r C u r r e n t T h r e a d ( ) . G e t K e y S t a t e ;  
 # e l s e  
                 p r i v a t e   s t a t i c   r e a d o n l y   F u n c & l t ; V i r t u a l K e y ,   C o r e V i r t u a l K e y S t a t e s & g t ;   _ k e y S t a t e F u n c t i o n   =   M i c r o s o f t . U I . I n p u t . I n p u t K e y b o a r d S o u r c e . G e t K e y S t a t e F o r C u r r e n t T h r e a d ;  
 # e n d i f  
  
                 p r i v a t e   s t a t i c   b o o l   I s M o d i f i e r K e y D o w n ( )   {  
                         r e t u r n   _ k e y S t a t e F u n c t i o n ( V i r t u a l K e y . C o n t r o l ) . H a s F l a g ( C o r e V i r t u a l K e y S t a t e s . D o w n )   | |  
                                       _ k e y S t a t e F u n c t i o n ( V i r t u a l K e y . L e f t M e n u ) . H a s F l a g ( C o r e V i r t u a l K e y S t a t e s . D o w n )   | |  
                                       _ k e y S t a t e F u n c t i o n ( V i r t u a l K e y . R i g h t M e n u ) . H a s F l a g ( C o r e V i r t u a l K e y S t a t e s . D o w n )   | |  
                                       _ k e y S t a t e F u n c t i o n ( V i r t u a l K e y . L e f t W i n d o w s ) . H a s F l a g ( C o r e V i r t u a l K e y S t a t e s . D o w n )   | |  
                                       _ k e y S t a t e F u n c t i o n ( V i r t u a l K e y . R i g h t W i n d o w s ) . H a s F l a g ( C o r e V i r t u a l K e y S t a t e s . D o w n ) ;  
                 }  
  
                 [ S y s t e m . D i a g n o s t i c s . C o d e A n a l y s i s . S u p p r e s s M e s s a g e ( & q u o t ; S t y l e & q u o t ; ,   & q u o t ; I D E 0 0 6 0 : R e m o v e   u n u s e d   p a r a m e t e r & q u o t ; ,   J u s t i f i c a t i o n   =   & q u o t ; M u s t   m a t c h   K e y E v e n t H a n d l e r   d e l e g a t e ,   d o n & a p o s ; t   r e m o v e   s e n d e r & q u o t ; ) ]  
                 p u b l i c   s t a t i c   v o i d   R e j e c t L e t t e r s ( o b j e c t   s e n d e r ,   K e y R o u t e d E v e n t A r g s   e )   {  
                         i f   ( I s M o d i f i e r K e y D o w n ( ) )   {  
                                 r e t u r n ;  
                         }  
                         i f   ( e . K e y   i s   & g t ; =   V i r t u a l K e y . A   a n d   & l t ; =   V i r t u a l K e y . Z )   {  
                                 e . H a n d l e d   =   t r u e ;  
                         }  
                 }  
  
                 [ S y s t e m . D i a g n o s t i c s . C o d e A n a l y s i s . S u p p r e s s M e s s a g e ( & q u o t ; S t y l e & q u o t ; ,   & q u o t ; I D E 0 0 6 0 : R e m o v e   u n u s e d   p a r a m e t e r & q u o t ; ,   J u s t i f i c a t i o n   =   & q u o t ; M u s t   m a t c h   K e y E v e n t H a n d l e r   d e l e g a t e ,   d o n & a p o s ; t   r e m o v e   s e n d e r & q u o t ; ) ]  
                 p u b l i c   s t a t i c   v o i d   A c c e p t N u m b e r s O n l y ( o b j e c t   s e n d e r ,   K e y R o u t e d E v e n t A r g s   e )   {  
                         i f   ( I s M o d i f i e r K e y D o w n ( ) )   {  
                                 r e t u r n ;  
                         }  
  
                         e . H a n d l e d   =   e . K e y   s w i t c h   {  
                                 & g t ; =   V i r t u a l K e y . N u m b e r 0   a n d   & l t ; =   V i r t u a l K e y . N u m b e r 9   = & g t ;   f a l s e ,  
                                 & g t ; =   V i r t u a l K e y . N u m b e r P a d 0   a n d   & l t ; =   V i r t u a l K e y . N u m b e r P a d 9   = & g t ;   f a l s e ,  
                                 V i r t u a l K e y . L e f t   = & g t ;   f a l s e ,  
                                 V i r t u a l K e y . R i g h t   = & g t ;   f a l s e ,  
                                 V i r t u a l K e y . U p   = & g t ;   f a l s e ,  
                                 V i r t u a l K e y . D o w n   = & g t ;   f a l s e ,  
                                 V i r t u a l K e y . P a g e U p   = & g t ;   f a l s e ,  
                                 V i r t u a l K e y . P a g e D o w n   = & g t ;   f a l s e ,  
                                 V i r t u a l K e y . T a b   = & g t ;   f a l s e ,  
                                 V i r t u a l K e y . H o m e   = & g t ;   f a l s e ,  
                                 V i r t u a l K e y . E n d   = & g t ;   f a l s e ,  
                                 V i r t u a l K e y . S h i f t   = & g t ;   f a l s e ,  
                                 V i r t u a l K e y . B a c k   = & g t ;   f a l s e ,  
                                 V i r t u a l K e y . D e l e t e   = & g t ;   f a l s e ,  
                                 V i r t u a l K e y . E n t e r   = & g t ;   f a l s e ,  
                                 V i r t u a l K e y . D e c i m a l   = & g t ;   f a l s e ,  
                                 ( V i r t u a l K e y ) 1 8 8   = & g t ;   f a l s e ,   / /   C o m m a  
                                 ( V i r t u a l K e y ) 1 8 9   = & g t ;   f a l s e ,   / /   M i n u s  
                                 ( V i r t u a l K e y ) 1 9 0   = & g t ;   f a l s e ,   / /   D o t  
                                 _   = & g t ;   t r u e ,  
                         } ;  
                 }  
  
                 [ S y s t e m . D i a g n o s t i c s . C o d e A n a l y s i s . S u p p r e s s M e s s a g e ( & q u o t ; S t y l e & q u o t ; ,   & q u o t ; I D E 0 0 6 0 : R e m o v e   u n u s e d   p a r a m e t e r & q u o t ; ,   J u s t i f i c a t i o n   =   & q u o t ; M u s t   m a t c h   K e y E v e n t H a n d l e r   d e l e g a t e ,   d o n & a p o s ; t   r e m o v e   s e n d e r & q u o t ; ) ]  
                 p u b l i c   s t a t i c   v o i d   A c c e p t N u m b e r s A n d O p e r a t o r s ( o b j e c t   s e n d e r ,   K e y R o u t e d E v e n t A r g s   e )   {  
                         i f   ( I s M o d i f i e r K e y D o w n ( ) )   {  
                                 r e t u r n ;  
                         }  
  
                         A c c e p t N u m b e r s O n l y ( s e n d e r ,   e ) ;  
                         i f   ( e . H a n d l e d )   {  
                                 e . H a n d l e d   =   e . K e y   s w i t c h   {  
                                         V i r t u a l K e y . M u l t i p l y   = & g t ;   f a l s e ,  
                                         V i r t u a l K e y . D i v i d e   = & g t ;   f a l s e ,  
                                         V i r t u a l K e y . A d d   = & g t ;   f a l s e ,  
                                         V i r t u a l K e y . S u b t r a c t   = & g t ;   f a l s e ,  
                                         V i r t u a l K e y . S p a c e   = & g t ;   f a l s e ,  
                                         ( V i r t u a l K e y ) 1 8 7   = & g t ;   f a l s e ,   / /   +  
                                         _   = & g t ;   t r u e ,  
                                 } ;  
                         }  
                 }  
         }  
 }  
 < / p r e >  
 < h 3 > W i n U I 3   u s a g e < / h 3 >  
 < p > I n   a   W i n U I   a p p   y o u   c a n   u s e   i t   l i k e   t h i s .   T h e   x : B i n d   i n   t h e   P r e v i e w K e y D o w n   e v e n t   i s   a l l   y o u   n e e d .   Y o u   c a n   s e t   t h i s   o n   a   N u m b e r B o x   b u t   a l s o   o n   a   P a n e l   w h i c h   c o n t a i n   m u l t i p l e   N u m b e r B o x   c o n t r o l s .   T h i s   w o r k s   b e c a u s e s   t h e   P r e v i e w K e y D o w n   i s   a & # 1 6 0 ; < a   h r e f = " h t t p s : / / l e a r n . m i c r o s o f t . c o m / e n - u s / w i n d o w s / u w p / x a m l - p l a t f o r m / e v e n t s - a n d - r o u t e d - e v e n t s - o v e r v i e w # r o u t e d - e v e n t s " > R o u t i n g   E v e n t < / a > & # 1 6 0 ; w h i c h   b u b b l e s   u p   t o   i t & a p o s ; s   p a r e n t . < / p >  
 < p r e   c l a s s = " b r u s h :   h t m l " > & l t ; ? x m l   v e r s i o n = & q u o t ; 1 . 0 & q u o t ;   e n c o d i n g = & q u o t ; u t f - 8 & q u o t ;   ? & g t ;  
 & l t ; W i n d o w   x : C l a s s = & q u o t ; W i n U I 3 A p p 1 . M a i n W i n d o w & q u o t ;  
                 x m l n s = & q u o t ; h t t p : / / s c h e m a s . m i c r o s o f t . c o m / w i n f x / 2 0 0 6 / x a m l / p r e s e n t a t i o n & q u o t ;  
                 x m l n s : x = & q u o t ; h t t p : / / s c h e m a s . m i c r o s o f t . c o m / w i n f x / 2 0 0 6 / x a m l & q u o t ;  
                 x m l n s : d = & q u o t ; h t t p : / / s c h e m a s . m i c r o s o f t . c o m / e x p r e s s i o n / b l e n d / 2 0 0 8 & q u o t ;  
                 x m l n s : h e l p e r s = & q u o t ; u s i n g : H e l p e r s & q u o t ;  
                 x m l n s : m c = & q u o t ; h t t p : / / s c h e m a s . o p e n x m l f o r m a t s . o r g / m a r k u p - c o m p a t i b i l i t y / 2 0 0 6 & q u o t ;  
                 m c : I g n o r a b l e = & q u o t ; d & q u o t ; & g t ;  
  
         & l t ; G r i d   B a c k g r o u n d = & q u o t ; { T h e m e R e s o u r c e   A p p l i c a t i o n P a g e B a c k g r o u n d T h e m e B r u s h } & q u o t ; & g t ;  
                 & l t ; S t a c k P a n e l   W i d t h = & q u o t ; 2 0 8 & q u o t ;  
                                         H o r i z o n t a l A l i g n m e n t = & q u o t ; C e n t e r & q u o t ;  
                                         V e r t i c a l A l i g n m e n t = & q u o t ; C e n t e r & q u o t ;  
                                         S p a c i n g = & q u o t ; 8 & q u o t ; & g t ;  
  
                         & l t ; N u m b e r B o x   H e a d e r = & q u o t ; A & q u o t ;  
                                               P r e v i e w K e y D o w n = & q u o t ; { x : B i n d   h e l p e r s : P r e v i e w K e y D o w n H a n d l e r . R e j e c t L e t t e r s } & q u o t ;  
                                               S p i n B u t t o n P l a c e m e n t M o d e = & q u o t ; I n l i n e & q u o t ;   / & g t ;  
  
                         & l t ; N u m b e r B o x   A c c e p t s E x p r e s s i o n = & q u o t ; T r u e & q u o t ;  
                                               H e a d e r = & q u o t ; B & q u o t ;  
                                               P r e v i e w K e y D o w n = & q u o t ; { x : B i n d   h e l p e r s : P r e v i e w K e y D o w n H a n d l e r . A c c e p t N u m b e r s A n d O p e r a t o r s } & q u o t ;   / & g t ;  
  
                         & l t ; S t a c k P a n e l   O r i e n t a t i o n = & q u o t ; H o r i z o n t a l & q u o t ;  
                                                 P r e v i e w K e y D o w n = & q u o t ; { x : B i n d   h e l p e r s : P r e v i e w K e y D o w n H a n d l e r . A c c e p t N u m b e r s O n l y } & q u o t ;  
                                                 S p a c i n g = & q u o t ; 8 & q u o t ; & g t ;  
                                 & l t ; N u m b e r B o x   W i d t h = & q u o t ; 1 0 0 & q u o t ;  
                                                       H e a d e r = & q u o t ; C & q u o t ;   / & g t ;  
                                 & l t ; N u m b e r B o x   W i d t h = & q u o t ; 1 0 0 & q u o t ;  
                                                       H e a d e r = & q u o t ; D & q u o t ;   / & g t ;  
                         & l t ; / S t a c k P a n e l & g t ;  
                 & l t ; / S t a c k P a n e l & g t ;  
         & l t ; / G r i d & g t ;  
 & l t ; / W i n d o w & g t ;  
 < / p r e >  
 < h 3 > U W P   u s a g e < / h 3 >  
 < p > I n   a   U W P   a p p   u s i n g   W i n U I 2   y o u   u s e   i t   l i k e   t h i s .   T h e   o n l y   r e a l   d i f f e r e n c e   w i t h   W i n U I   3   i s   t h e   p r e f i x   o f   t h e   < e m > w i n u i < / e m > :   i n   f r o n t   o f   t h e   N u m b e r B o x .   I t   r e f e r s   t o   < e m > x m l n s : w i n u i < / e m >   n a m e s p a c e   d e c l a r a t i o n   i n   t h e   P a g e   e l e m e n t . < / p >  
 < p r e   c l a s s = " b r u s h :   h t m l " > & l t ; P a g e   x : C l a s s = & q u o t ; U w p A p p 1 . M a i n P a g e & q u o t ;  
             x m l n s = & q u o t ; h t t p : / / s c h e m a s . m i c r o s o f t . c o m / w i n f x / 2 0 0 6 / x a m l / p r e s e n t a t i o n & q u o t ;  
             x m l n s : x = & q u o t ; h t t p : / / s c h e m a s . m i c r o s o f t . c o m / w i n f x / 2 0 0 6 / x a m l & q u o t ;  
             x m l n s : d = & q u o t ; h t t p : / / s c h e m a s . m i c r o s o f t . c o m / e x p r e s s i o n / b l e n d / 2 0 0 8 & q u o t ;  
             x m l n s : h e l p e r s = & q u o t ; u s i n g : H e l p e r s & q u o t ;  
             x m l n s : m c = & q u o t ; h t t p : / / s c h e m a s . o p e n x m l f o r m a t s . o r g / m a r k u p - c o m p a t i b i l i t y / 2 0 0 6 & q u o t ;  
             x m l n s : w i n u i = & q u o t ; u s i n g : M i c r o s o f t . U I . X a m l . C o n t r o l s & q u o t ;  
             B a c k g r o u n d = & q u o t ; { T h e m e R e s o u r c e   A p p l i c a t i o n P a g e B a c k g r o u n d T h e m e B r u s h } & q u o t ;  
             m c : I g n o r a b l e = & q u o t ; d & q u o t ; & g t ;  
  
         & l t ; S t a c k P a n e l   W i d t h = & q u o t ; 2 0 8 & q u o t ;  
                                 H o r i z o n t a l A l i g n m e n t = & q u o t ; C e n t e r & q u o t ;  
                                 V e r t i c a l A l i g n m e n t = & q u o t ; C e n t e r & q u o t ;  
                                 S p a c i n g = & q u o t ; 8 & q u o t ; & g t ;  
  
                 & l t ; w i n u i : N u m b e r B o x   H e a d e r = & q u o t ; A & q u o t ;  
                                                   P r e v i e w K e y D o w n = & q u o t ; { x : B i n d   h e l p e r s : P r e v i e w K e y D o w n H a n d l e r . R e j e c t L e t t e r s } & q u o t ;  
                                                   S p i n B u t t o n P l a c e m e n t M o d e = & q u o t ; I n l i n e & q u o t ;   / & g t ;  
  
                 & l t ; w i n u i : N u m b e r B o x   A c c e p t s E x p r e s s i o n = & q u o t ; T r u e & q u o t ;  
                                                   H e a d e r = & q u o t ; B & q u o t ;  
                                                   P r e v i e w K e y D o w n = & q u o t ; { x : B i n d   h e l p e r s : P r e v i e w K e y D o w n H a n d l e r . A c c e p t N u m b e r s A n d O p e r a t o r s } & q u o t ;   / & g t ;  
  
                 & l t ; S t a c k P a n e l   O r i e n t a t i o n = & q u o t ; H o r i z o n t a l & q u o t ;  
                                         P r e v i e w K e y D o w n = & q u o t ; { x : B i n d   h e l p e r s : P r e v i e w K e y D o w n H a n d l e r . A c c e p t N u m b e r s O n l y } & q u o t ;  
                                         S p a c i n g = & q u o t ; 8 & q u o t ; & g t ;  
                         & l t ; w i n u i : N u m b e r B o x   W i d t h = & q u o t ; 1 0 0 & q u o t ;  
                                                           H e a d e r = & q u o t ; C & q u o t ;   / & g t ;  
                         & l t ; w i n u i : N u m b e r B o x   W i d t h = & q u o t ; 1 0 0 & q u o t ;  
                                                           H e a d e r = & q u o t ; D & q u o t ;   / & g t ;  
                 & l t ; / S t a c k P a n e l & g t ;  
         & l t ; / S t a c k P a n e l & g t ;  
 & l t ; / P a g e & g t ;  
 < / p r e >  
 < h 3 > C l o s u r e < / h 3 >  
 < p > I   h o p e   y o u   l i k e   t h i s   s o l u t i o n .   I   h a v e   p u b l i s h e d   t h i s   s o l u t i o n   c o n t a i n i n g   t h e   W i n U I   a n d   U W P   p r o j e c t   i n   t h i s   < a   h r e f = " h t t p s : / / g i t h u b . c o m / s o n n e m a f / N u m b e r B o x I n p u t S a m p l e " > G i t H u b   r e p o s i t o r y < / a > . & # 1 6 0 ; < / p > < / b o d y > < / h t m l > ] ] > < / c o n t e n t : e n c o d e d >  
         < / i t e m >  
         < i t e m >  
             < t i t l e > S y s t e m   c o n t r o l s   n e e d   B a s e d O n   S t y l i n g   i n   W i n U I < / t i t l e >  
             < l i n k > h t t p s : / / w w w . r e f l e c t i o n i t . n l / b l o g / 2 0 2 3 / s y s t e m - c o n t r o l s - n e e d - b a s e d o n - s t y l i n g - i n - w i n u i < / l i n k >  
             < d e s c r i p t i o n   / >  
             < a u t h o r > f o n s . s o n n e m a n s @ r e f l e c t i o n i t . n l   ( F o n s   S o n n e m a n s ) < / a u t h o r >  
             < c a t e g o r y > A p p s < / c a t e g o r y >  
             < c a t e g o r y > X A M L < / c a t e g o r y >  
             < c a t e g o r y > U W P < / c a t e g o r y >  
             < c a t e g o r y > W i n U I < / c a t e g o r y >  
             < c a t e g o r y > W i n d o w s A p p S D K < / c a t e g o r y >  
             < g u i d > h t t p s : / / w w w . r e f l e c t i o n i t . n l / b l o g / 2 0 2 3 / s y s t e m - c o n t r o l s - n e e d - b a s e d o n - s t y l i n g - i n - w i n u i < / g u i d >  
             < p u b D a t e > S u n ,   2 6   M a r   2 0 2 3   0 0 : 0 0 : 0 0   G M T < / p u b D a t e >  
             < c o n t e n t : e n c o d e d > < ! [ C D A T A [ < h t m l > < b o d y > < p > Y o u   c a n   c u s t o m i z e   t h e   a p p e a r a n c e   o f   y o u r   a p p s   i n   m a n y   w a y s   b y   u s i n g   t h e   X A M L   f r a m e w o r k   l i k e   W P F ,   U W P ,   W i n U I   a n d   M A U I .   S t y l e s   l e t   y o u   s e t   c o n t r o l   p r o p e r t i e s   a n d   r e u s e   t h o s e   s e t t i n g s   f o r   a   c o n s i s t e n t   a p p e a r a n c e   a c r o s s   m u l t i p l e   c o n t r o l s .   S t y l i n g   i s   t o   X A M L   w h a t   C S S   i s   t o   H T M L .   U s i n g   s t y l e s ,   y o u   c a n   g r o u p   a   s e t   o f   p r o p e r t i e s   a n d   a s s i g n   t h e m   t o   s p e c i f i c   c o n t r o l s   o r   a l l   c o n t r o l s   o f   a   s p e c i f i c   t y p e ,   a n d   j u s t   l i k e   i n   C S S ,   a   s t y l e   c a n   i n h e r i t   ( B a s e d O n )   f r o m   a n o t h e r   s t y l e . < / p >  
 < p > S t a r t i n g   w i t h   W i n U I   2 . 6   t h e r e   a r e   n e w   s t y l e s   f o r   m o s t   o f   t h e   c o n t r o l s .   I t   i s   e n c o u r a g e   y o u   t o   u s e   t h e   n e w   s t y l e s ,   a s   t h e y   b e t t e r   m a t c h   t h e   d e s i g n   d i r e c t i o n   o f   W i n d o w s .   Y o u   c a n   r e a d   m o r e   a b o u t   < a   h r e f = " h t t p s : / / l e a r n . m i c r o s o f t . c o m / e n - u s / w i n d o w s / a p p s / d e s i g n / s t y l e / x a m l - s t y l e s " > s t y l i n g < / a > . < / p >  
 < h 2 > B a s e d O n   f o r   S y s t e m   c o n t r o l s < / h 2 >  
 < p > I n   W i n U I   t h e   S t y l e s   f o r   s y s t e m   c o n t r o l s   ( B u t t o n ,   C h e c k B o x ,   T e x t B o x ,   e t c )   s h o u l d   s e t   B a s e d O n = & q u o t ; { S t a t i c R e s o u r c e   D e f a u l t & l t ; C o n t r o l N a m e & g t ; S t y l e } & q u o t ; ,   w h e r e   & l t ; C o n t r o l N a m e & g t ;   i s   t h e   n a m e   o f   t h e   c o n t r o l . & # 1 6 0 ; < / p >  
 < p > T a k e   t h e   n e x t   W i n U I 3   e x a m p l e   i n   w h i c h   I   h a v e   d e f i n e d   t w o   b u t t o n   s t y l e s .   M y B u t t o n S t y l e 1   i s   n o t   u s i n g   B a s e d O n ,   M y B u t t o n S t y l e 2   u s e s   t h e   < e m > D e f a u l t B u t t o n S t y l e < / e m > . < / p >  
 < p r e   c l a s s = " b r u s h :   h t m l " > & l t ; W i n d o w   x : C l a s s = & q u o t ; B u t t o n S t y l i n g D e m o . M a i n W i n d o w & q u o t ;  
                 x m l n s = & q u o t ; h t t p : / / s c h e m a s . m i c r o s o f t . c o m / w i n f x / 2 0 0 6 / x a m l / p r e s e n t a t i o n & q u o t ;  
                 x m l n s : x = & q u o t ; h t t p : / / s c h e m a s . m i c r o s o f t . c o m / w i n f x / 2 0 0 6 / x a m l & q u o t ;  
                 x m l n s : d = & q u o t ; h t t p : / / s c h e m a s . m i c r o s o f t . c o m / e x p r e s s i o n / b l e n d / 2 0 0 8 & q u o t ;  
                 x m l n s : m c = & q u o t ; h t t p : / / s c h e m a s . o p e n x m l f o r m a t s . o r g / m a r k u p - c o m p a t i b i l i t y / 2 0 0 6 & q u o t ;  
                 m c : I g n o r a b l e = & q u o t ; d & q u o t ; & g t ;  
         & l t ; G r i d   B a c k g r o u n d = & q u o t ; { T h e m e R e s o u r c e   A p p l i c a t i o n P a g e B a c k g r o u n d T h e m e B r u s h } & q u o t ; & g t ;  
                 & l t ; S t a c k P a n e l   H o r i z o n t a l A l i g n m e n t = & q u o t ; C e n t e r & q u o t ;  
                                         V e r t i c a l A l i g n m e n t = & q u o t ; C e n t e r & q u o t ;  
                                         O r i e n t a t i o n = & q u o t ; V e r t i c a l & q u o t ;  
                                         S p a c i n g = & q u o t ; 1 2 & q u o t ; & g t ;  
                         & l t ; S t a c k P a n e l . R e s o u r c e s & g t ;  
                                 & l t ; S t y l e   x : K e y = & q u o t ; M y B u t t o n S t y l e 1 & q u o t ;  
                                               T a r g e t T y p e = & q u o t ; B u t t o n & q u o t ; & g t ;  
                                         & l t ; S e t t e r   P r o p e r t y = & q u o t ; B o r d e r B r u s h & q u o t ;   V a l u e = & q u o t ; B l a c k & q u o t ;   / & g t ;  
                                         & l t ; S e t t e r   P r o p e r t y = & q u o t ; F o n t S i z e & q u o t ;   V a l u e = & q u o t ; 1 6 & q u o t ;   / & g t ;  
                                 & l t ; / S t y l e & g t ;  
                                 & l t ; S t y l e   x : K e y = & q u o t ; M y B u t t o n S t y l e 2 & q u o t ;  
                                               B a s e d O n = & q u o t ; { S t a t i c R e s o u r c e   D e f a u l t B u t t o n S t y l e } & q u o t ;  
                                               T a r g e t T y p e = & q u o t ; B u t t o n & q u o t ; & g t ;  
                                         & l t ; S e t t e r   P r o p e r t y = & q u o t ; B o r d e r B r u s h & q u o t ;   V a l u e = & q u o t ; R e d & q u o t ;   / & g t ;  
                                         & l t ; S e t t e r   P r o p e r t y = & q u o t ; F o n t S i z e & q u o t ;   V a l u e = & q u o t ; 1 6 & q u o t ;   / & g t ;  
                                 & l t ; / S t y l e & g t ;  
                         & l t ; / S t a c k P a n e l . R e s o u r c e s & g t ;  
                         & l t ; B u t t o n & g t ; B u t t o n 1   w i t h o u t   a n y   S t y l e & l t ; / B u t t o n & g t ;  
                         & l t ; B u t t o n   S t y l e = & q u o t ; { S t a t i c R e s o u r c e   A c c e n t B u t t o n S t y l e } & q u o t ; & g t ; B u t t o n 2   w i t h   A c c e n t B u t t o n S t y l e & l t ; / B u t t o n & g t ;  
                         & l t ; B u t t o n   S t y l e = & q u o t ; { S t a t i c R e s o u r c e   M y B u t t o n S t y l e 1 } & q u o t ; & g t ; B u t t o n 3   w i t h   M y S t y l e 1 & l t ; / B u t t o n & g t ;  
                         & l t ; B u t t o n   S t y l e = & q u o t ; { S t a t i c R e s o u r c e   M y B u t t o n S t y l e 2 } & q u o t ; & g t ; B u t t o n 4   w i t h   M y S t y l e 2 & l t ; / B u t t o n & g t ;  
                 & l t ; / S t a c k P a n e l & g t ;  
         & l t ; / G r i d & g t ;  
 & l t ; / W i n d o w & g t ;  
 < / p r e >  
 < p > T h e   W i n d o w   w i t h   t h e   b u t t o n s   w i l l   d i s p l a y   l i k e   t h i s . < / p >  
 < p > < i m g   s r c = " h t t p s : / / w w w . r e f l e c t i o n i t . n l / I m a g e s / B l o g / W i n U I / S t y l i n g / W i n U I B u t t o n S t y l i n g . p n g "   a l t = " W i n U I   B u t t o n   S t y l e s   e x a m p l e "   w i d t h = " 4 3 3 "   / > < / p >  
 < p > B u t t o n 1   a n d   B u t t o n 2   h a v e   t h e   r o u n d e d   c o r n e r s   w h i c h   w h e r e   i n t r o d u c e d   i n   t h e   W i n d o w s   1 1   d e s i g n .   B u t t o n 3   h a s   < s t r o n g > s q u a r e   c o r n e r s   < / s t r o n g > d u e   t o   t h e   f a c t   t h a t   i t & a p o s ; s   s t y l e   i s   n o t   b a s e d   o n   t h e   D e f a u l t B u t t o n S t y l e ,   i t   d o e s n & a p o s ; t   m a t c h   w i t h   t h e   n e w   W i n d o w s   d e s i g n .   T h e   S t y l e   o f   B u t t o n 4   i s   b a s e d   o n   t h e   D e f a u l t B u t t o n S t y l e   w h i c h   m a k e s   t h e   b u t t o n   h a v e   t h e   c o r r e c t   c o r n e r r a d i u s . < / p >  
 < p > I n   W P F   a n d   U W P   ( n o t   u s i n g   W i n U I 2 )   t h e r e   a r e   n o   d e f a u l t   s t y l e s   f o r   t h e   s y s t e m   c o n t r o l s .   M a k e   s u r e   y o u   a l w a y s   i n h e r i t   ( u s i n g   B a s e d O n )   y o u r   S t y l e s   f r o m   t h e   d e f a u l t   s t y l e s   i n   W i n U I   2   a n d   W i n U I   3   a p p s .   N o t   o n l y   f o r   a   B u t t o n s   b u t   f o r   a l l   s y s t e m   c o n t r o l s   l i k e   C h e c k B o x ,   T e x t B o x ,   e t c . < / p >  
 < p > & # 1 6 0 ; < / p >  
 < p > & # 1 6 0 ; < / p > < / b o d y > < / h t m l > ] ] > < / c o n t e n t : e n c o d e d >  
         < / i t e m >  
         < i t e m >  
             < t i t l e > F o n s   S o n n e m a n s   2 0 2 3   D e v e l o p m e n t   T o o l s   L i s t < / t i t l e >  
             < l i n k > h t t p s : / / w w w . r e f l e c t i o n i t . n l / b l o g / 2 0 2 3 / f o n s - s o n n e m a n s - 2 0 2 3 - d e v e l o p m e n t - t o o l s - l i s t < / l i n k >  
             < d e s c r i p t i o n   / >  
             < a u t h o r > f o n s . s o n n e m a n s @ r e f l e c t i o n i t . n l   ( F o n s   S o n n e m a n s ) < / a u t h o r >  
             < c a t e g o r y > T o o l s < / c a t e g o r y >  
             < c a t e g o r y > A p p s < / c a t e g o r y >  
             < c a t e g o r y > X A M L < / c a t e g o r y >  
             < c a t e g o r y > U W P < / c a t e g o r y >  
             < c a t e g o r y > B l e n d < / c a t e g o r y >  
             < c a t e g o r y > C S h a r p < / c a t e g o r y >  
             < c a t e g o r y > V i s u a l   S t u d i o < / c a t e g o r y >  
             < g u i d > h t t p s : / / w w w . r e f l e c t i o n i t . n l / b l o g / 2 0 2 3 / f o n s - s o n n e m a n s - 2 0 2 3 - d e v e l o p m e n t - t o o l s - l i s t < / g u i d >  
             < p u b D a t e > T u e ,   2 4   J a n   2 0 2 3   0 0 : 0 0 : 0 0   G M T < / p u b D a t e >  
             < c o n t e n t : e n c o d e d > < ! [ C D A T A [ < h t m l > < b o d y > < p > M a n y   y e a r s   a g o   S c o t t   H a n s e l m a n   w r o t e   t h e   f a m o u s   < a   h r e f = " h t t p s : / / h a n s e l m a n . c o m / t o o l s " > S c o t t   H a n s e l m a n   U l t i m a t e   T o o l s   L i s t < / a >   p o s t .   I n   2 0 1 9   I   w r o t e   m y   o w n   < a   h r e f = " . . / . . / . . / b l o g / 2 0 1 9 / f o n s - s o n n e m a n s - 2 0 1 9 - d e v e l o p m e n t - t o o l s - l i s t " > l i s t < / a > ,   n o w   i t   i s   t i m e   f o r   a n   u p d a t e   b e c a u s e   t h e r e   a r e   n e w   t o o l s   I   u s e .   I & a p o s ; m   a   W i n d o w s   A p p   d e v e l o p e r   m o r e   t h a n   a   W e b   d e v e l o p e r   s o   I   u s e   d i f f e r e n t   t o o l s .   I   w r i t e   m a i n l y   X A M L   ( U W P ,   W P F ,   W i n U I   a n d   < a   h r e f = " h t t p s : / / p l a t f o r m . u n o / " > U n o P l a t f o r m < / a > )   a p p s   a n d   o n l y   o c c a s i o n a l l y   a n   A S P . N E T   M V C ,   W e b A P I   o r   B l a z o r   W A S M   p r o j e c t s .   M y   c o d e   i s   w r i t t e n   i n   C # .   I   c r e a t e   t h e m   b e c a u s e   i t   i s   f u n   t o   d o   a n d   i t   h e l p s   m e   t o   t r a i n   m y   o w n   s k i l l s .   I   u s e   t h i s   e x p e r i e n c e   f o r   m y   t r a i n i n g s   ( < a   h r e f = " . . / . . / . . / t r a i n i n g / c s h a r p " > C # < / a > , & # 1 6 0 ; < a   h r e f = " . . / . . / . . / t r a i n i n g / x a m l " > X A M L < / a > , & # 1 6 0 ; < a   h r e f = " . . / . . / . . / t r a i n i n g / w e b " > A S P . N E T < / a > & # 1 6 0 ; a n d & # 1 6 0 ; < a   h r e f = " . . / . . / . . / t r a i n i n g / d a t a " > S Q L < / a > ) .   I   w r i t e   m y   o w n   t r a i n i n g   m a t e r i a l   s o   I   n e e d   t h e   e x p e r i e n c e .   I   h a v e   d e v e l o p e d   a b o u t   5 0   W i n d o w s   ( a n d   W i n d o w s   P h o n e )   < a   h r e f = " . . / . . / a p p s " > a p p s < / a > ,   s o m e   a r e   v e r y   p o p u l a r .   T h e   a p p s   h a v e   m o r e   t h a n   5   m i l l i o n   d o w n l o a d s   a n d   d a i l y   t h o u s a n d s   o f   p l a y e r s .   M o s t   o f   m y   a p p s   a r e   f r e e   b u t   t h e r e   a r e   A d s   i n   i t   t o   g e n e r a t e   s o m e   r e v e n u e . < / p >  
 < h 3 > S o f t w a r e < / h 3 >  
 < u l >  
 < l i > < a   h r e f = " h t t p s : / / v i s u a l s t u d i o . m i c r o s o f t . c o m / " > V i s u a l   S t u d i o < / a >   i s   m y   f a v o r i t e   I D E ,   v e r s i o n   2 0 2 2 .   I   u s e   i t   f o r   c o d i n g   ( m a i n l y   C #   b u t   o c c a s i o n a l l y   a l s o   J a v a S c r i p t   a n d   T y p e S c r i p t ) ,   d e b u g g i n g   a n d   X A M L / H T M L / C S S   e d i t i n g .   I   t h i n k   8 5 %   o f   m y   d e v e l o p m e n t   t i m e   i s   w i t h   V i s u a l   S t u d i o . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / d o c s . m i c r o s o f t . c o m / e n - u s / v i s u a l s t u d i o / x a m l - t o o l s / c r e a t i n g - a - u i - b y - u s i n g - b l e n d - f o r - v i s u a l - s t u d i o ? v i e w = v s - 2 0 1 9 " > B l e n d   f o r   V i s u a l   S t u d i o < / a >   i s   i n s t a l l e d   w i t h   V i s u a l   S t u d i o .   I   u s e   i t   f o r   d e s i g n i n g   t h e   X A M L   o f   m y   U W P   a n d   W P F   a p p s .   C o m p a r e d   t o   V i s u a l   S t u d i o ,   B l e n d   h a s   a   b e t t e r   A s s e t s   p a n e l ,   R e s o u r c e   m a n a g e m e n t ,   D a t a   m a n a g e m e n t ,   A n i m a t i o n s ,   S t a t e s   a n d   T e m p l a t i n g   & a m p ;   S t y l i n g   e d i t i n g .   M o s t   d e v e l o p e r s   d o n & a p o s ; t   u s e   i t   a n d   t h a t   i s   a   p i t t y .   Y o u   s h o u l d   g i v e   i t   a   t r y .   Y o u   c a n   w r i t e   X A M L   w a y   b e t t e r   a n d   f a s t e r   w i t h   B l e n d . < / l i >  
 < l i > < a   h r e f = " h t t p : / / e x p r e s s i o n d e s i g n 4 . c o m / " > M i c r o s o f t   E x p r e s s i o n   D e s i g n < / a >   i s   a   g r e a t   t o o l   f o r   c r e a t i v e   p r o f e s s i o n a l s   a n d   d e v e l o p e r s   w h o   w a n t   t o   b u i l d   g r a p h i c s   f o r   a p p l i c a t i o n   u s e r   i n t e r f a c e s ,   t h e   w e b ,   o r   a n y   o t h e r   m e d i u m .   I t   i s   a n   a l t e r n a t i v e   f o r   A d o b e   I l l u s t r a t o r .   I   u s e   i t   f o r   m y   g r a p h i c   a s s e t s   ( l o g o & a p o s ; s ,   i m a g e s ,   p a t h s )   i n   m y   a p p s .   I t   i s   a   v e c t o r   d r a w i n g   t o o l   w h i c h   y o u   c a n   u s e   t o   e x p o r t   y o u r   g r a p h i c s   t o   X A M L   p a t h s .   I t   i s   r e a l l y   n i c e . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / w w w . m i c r o s o f t . c o m / e n - u s / d o w n l o a d / d e t a i l s . a s p x ? i d = 1 8 9 7 4 " > M i c r o s o f t   E x p r e s s i o n   E n c o d e r < / a > & # 1 6 0 ; i s   a n   a d v a n c e d   a p p l i c a t i o n   f o r   b r i n g i n g   y o u r   e d i t e d   v i d e o   p r o j e c t   t o   t h e   w e b   f o r   h i g h - q u a l i t y   p l a y b a c k .   I   u s e   i t   t o   e d i t   a p p   p r o m o   v i d e o & a p o s ; s .   I   r e c o r d   t h e   v i d e o s   u s i n g   t h e   X b o x   G a m e   B a r . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / w w w . g e t p a i n t . n e t / % 2 0 " > P a i n t . N E T < / a >   i s   g r e a t   f o r   i m a g e   a n d   p h o t o   e d i t i n g .   Y o u   c a n   < a   h r e f = " h t t p s : / / w w w . g e t p a i n t . n e t / d o w n l o a d . h t m l # d o w n l o a d " > d o w n l o a d   < / a > i t   o r   i n s t a l l   i t   f r o m   t h e   < a   h r e f = " h t t p s : / / w w w . m i c r o s o f t . c o m / e n - u s / p / p a i n t n e t / 9 n b h c s 1 l x 4 r 0 ? o c i d = b a d g e & a m p ; r t c = 1 # a c t i v e t a b = p i v o t : o v e r v i e w t a b " > M i c r o s o f t   S t o r e < / a > . < / l i >  
 < l i > < a   h r e f = " h t t p : / / w w w . 7 - z i p . o r g / " > 7 - Z i p < / a >   -   T h e   b e s t   a p p   t o   c r e a t e   o r   u n p a c k   a r c h i v e s   ( z i p ,   r a r ,   e t c ) .   V e r y   f a s t ,   f r e e   a n d   o p e n   s o u r c e . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / n o t e p a d - p l u s - p l u s . o r g " > N o t e p a d + + < / a >   i s   a   f r e e   ( a s   i n   & # 8 2 2 0 ; f r e e   s p e e c h & # 8 2 2 1 ;   a n d   a l s o   a s   i n   & # 8 2 2 0 ; f r e e   b e e r & # 8 2 2 1 ; )   s o u r c e   c o d e   e d i t o r   a n d   N o t e p a d   r e p l a c e m e n t   t h a t   s u p p o r t s   s e v e r a l   l a n g u a g e s . & # 1 6 0 ; < / l i >  
 < l i > < a   h r e f = " h t t p s : / / f r e e f i l e s y n c . o r g / " > F r e e F i l e S y n c < / a > & # 1 6 0 ; F r e e F i l e S y n c   i s   a   f o l d e r   c o m p a r i s o n   a n d   s y n c h r o n i z a t i o n   s o f t w a r e   t h a t   c r e a t e s   a n d   m a n a g e s   b a c k u p   c o p i e s   o f   a l l   y o u r   i m p o r t a n t   f i l e s .   I n s t e a d   o f   c o p y i n g   e v e r y   f i l e   e v e r y   t i m e ,   F r e e F i l e S y n c   d e t e r m i n e s   t h e   d i f f e r e n c e s   b e t w e e n   a   s o u r c e   a n d   a   t a r g e t   f o l d e r   a n d   t r a n s f e r s   o n l y   t h e   m i n i m u m   a m o u n t   o f   d a t a   n e e d e d .   I   u s e   i t   t o   k e e p   m y   d e s k t o p   a n d   l a p t o p s   i n   s y n c . & # 1 6 0 ; < / l i >  
 < l i > < a   h r e f = " h t t p s : / / d o c s . m i c r o s o f t . c o m / e n - u s / s y s i n t e r n a l s / d o w n l o a d s / z o o m i t " > Z o o m I t   < / a > i s   a   s c r e e n   z o o m   a n d   a n n o t a t i o n   t o o l   f o r   t e c h n i c a l   p r e s e n t a t i o n s   t h a t   i n c l u d e   a p p l i c a t i o n   d e m o n s t r a t i o n s .   I   u s e   i t   a   l o t   i n   m y   t r a i n i n g s   a n d   p r e s e n t a t i o n s . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / d o t n e t . m i c r o s o f t . c o m / e n - u s / p l a t f o r m / u p g r a d e - a s s i s t a n t " > . N E T   U p g r a d e   A s s i s t a n t < / a > & # 1 6 0 ; T h e   . N E T   U p g r a d e   A s s i s t a n t   i s   a   . N E T   g l o b a l   t o o l   t h a t   h e l p s   y o u   i n c r e m e n t a l l y   u p g r a d e   y o u r   . N E T   F r a m e w o r k - b a s e d   a p p l i c a t i o n s .   T a k e   a d v a n t a g e   o f   p e r f o r m a n c e   g a i n s ,   d e p l o y m e n t   f l e x i b i l i t y ,   a n d   i n n o v a t i o n   b y   u p g r a d i n g   t o   t h e   m o d e r n   . N E T   ( C o r e )   p l a t f o r m . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / w w w . m i c r o s o f t . c o m / s t o r e / p r o d u c t I d / 9 W Z D N C R D X F 4 1 " > C h a r a c t e r   M a p   U W P < / a >   i s   a   m o d e r n ,   n a t i v e   U W P   r e p l a c e m e n t   f o r   t h e   W i n 3 2   C h a r a c t e r   M a p   a n d   W i n d o w s   F o n t   V i e w e r   w i t h   f l a w l e s s   h i g h   D P I   a n d   t o u c h   s u p p o r t . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / w w w . m i c r o s o f t . c o m / s t o r e / p r o d u c t I d / 9 M S V H 1 2 8 X 2 Z T " > W i n U I   2   G a l l e r y < / a >   a p p   d e m o n s t r a t e s   a l l   o f   t h e   X a m l   a n d   W i n d o w s   U I   l i b r a r y   c o n t r o l s   a v a i l a b l e   t o   m a k e   a   F l u e n t   W i n d o w s   1 0   a p p . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / w w w . m i c r o s o f t . c o m / s t o r e / p r o d u c t I d / 9 P 3 J F P W W D Z R C " > W i n U I   3   G a l l e r y < / a >   a p p   d e m o n s t r a t e s   a l l   o f   t h e   W i n d o w s   U I   3   l i b r a r y   c o n t r o l s   a n d   s t y l e s   a v a i l a b l e   t o   m a k e   a   W i n U I   3   a p p   w i t h   t h e   W i n d o w s   A p p   S D K . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / w w w . m i c r o s o f t . c o m / s t o r e / p r o d u c t I d / 9 N 2 X D 3 Q 8 X 5 7 C " > F l u e n t   X A M L   T h e m e   E d i t o r < / a >   i s   a & # 1 6 0 ; d e s i g n   d e v e l o p m e n t   t o o l   y o u   c a n   u s e   t o   c r e a t e   c u s t o m   t h e m e s   f o r   t h e   W i n d o w s   U n i v e r s a l   P l a t f o r m .   T h i s   t o o l   a l s o   h e l p s   w i t h   t h e   d e v e l o p m e n t   f l o w   b y   g e n e r a t i n g   a n d   e x p o r t i n g   y o u r   c h o s e n   t h e m e   t o   a   X A M L   m a r k u p   r e s o u r c e   d i c t i o n a r y . T h i s   t o o l   a n d   i t & a p o s ; s   s o u r c e   a r e   p u b l i c   o n   < a   h r e f = " h t t p s : / / g i t h u b . c o m / M i c r o s o f t / f l u e n t - x a m l - t h e m e - e d i t o r " > G i t H u b < / a > . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / w w w . m i c r o s o f t . c o m / e n - u s / p / x a m l - d i f f / 9 n b l g g h 6 3 p 3 x ? r t c = 1 & a m p ; a c t i v e t a b = p i v o t : o v e r v i e w t a b " > X A M L   D i f f < / a > & # 1 6 0 ; I s   a   t o o l   w h i c h   g e n e r a t e s   t h e   U W P   V i s u a l   S t a t e   S e t t e r s   u s i n g   a   d i f f   a n a l y s i s   o f   y o u r   n a m e d   e l e m e n t s   i n   y o u r   X A M L .   I   w r o t e   i t   m y s e l f   a n d   p u b l i s h e d   i t   i n   t h e   M i c r o s o f t   S t o r e .   I   w r o t e   a & # 1 6 0 ; < a   h r e f = " . . / . . / b l o g / 2 0 1 8 / x a m l - d i f f - g e n e r a t e - v i s u a l - s t a t e - s e t t e r s " > b l o g & # 1 6 0 ; < / a > p o s t   a b o u t   i t   l a s t   y e a r .   I   h o p e   y o u   l i k e   i t .   I   f i n d   i t   v e r y   u s e f u l . & # 1 6 0 ; < / l i >  
 < l i > < a   h r e f = " h t t p s : / / w w w . m i c r o s o f t . c o m / s t o r e / p r o d u c t I d / 9 N B L G G H 4 T L C Q " > W i n d o w s   C o m m u n i t y   T o o l k i t   S a m p l e   A p p < / a > .   T h e   W i n d o w s   C o m m u n i t y   T o o l k i t   i s   a   c o l l e c t i o n   o f   h e l p e r s ,   e x t e n s i o n s ,   a n d   c u s t o m   c o n t r o l s .   I t   s i m p l i f i e s   a n d   d e m o n s t r a t e s   c o m m o n   . N E T   d e v e l o p e r   t a s k s   b u i l d i n g   U W P   a n d   W i n U I   3   a p p s   f o r   W i n d o w s   1 0   a n d   W i n d o w s   1 1 .   T h e   t o o l k i t   i s   p a r t   o f   t h e   . N E T   F o u n d a t i o n   a n d   a v a i l a b l e   o n   G i t H u b   a t   h t t p : / / a k a . m s / w i n d o w s t o o l k i t < / l i >  
 < l i > < a   h r e f = " T h e % 2 0 C o m m u n i t y T o o l k i t . M v v m % 2 0 p a c k a g e % 2 0 ( a k a % 2 0 M V V M % 2 0 T o o l k i t , % 2 0 f o r m e r l y % 2 0 n a m e d % 2 0 M i c r o s o f t . T o o l k i t . M v v m ) % 2 0 i s % 2 0 a % 2 0 m o d e r n , % 2 0 f a s t , % 2 0 a n d % 2 0 m o d u l a r % 2 0 M V V M % 2 0 l i b r a r y . % 2 0 I t % 2 0 i s % 2 0 p a r t % 2 0 o f % 2 0 t h e % 2 0 . N E T % 2 0 C o m m u n i t y % 2 0 T o o l k i t % 2 0 a n d % 2 0 i s % 2 0 b u i l t % 2 0 t o % 2 0 b e % 2 0 p l a t f o r m % 2 0 a n d % 2 0 r u n t i m e % 2 0 i n d e p e n d e n t , % 2 0 s i m p l e % 2 0 t o % 2 0 p i c k - u p % 2 0 a n d % 2 0 u s e , % 2 0 & # 2 2 4 ; % 2 0 l a % 2 0 c a r t e , % 2 0 a n d % 2 0 p r o v i d i n g % 2 0 a % 2 0 l e a n % 2 0 a n d % 2 0 p e r f o r m a n t % 2 0 r e f e r e n c e % 2 0 i m p l e m e n t a t i o n % 2 0 f o r % 2 0 a l l % 2 0 b a s i c % 2 0 M V V M % 2 0 b u i l d i n g % 2 0 b l o c k s . % 2 0 T h e % 2 0 M V V M % 2 0 T o o l k i t % 2 0 i s % 2 0 m a i n t a i n e d % 2 0 a n d % 2 0 p u b l i s h e d % 2 0 b y % 2 0 M i c r o s o f t , % 2 0 a n d % 2 0 p a r t % 2 0 o f % 2 0 t h e % 2 0 . N E T % 2 0 F o u n d a t i o n . % 2 0 I t % 2 0 i s % 2 0 a l s o % 2 0 u s e d % 2 0 b y % 2 0 s e v e r a l % 2 0 f i r s t % 2 0 p a r t y % 2 0 a p p l i c a t i o n s % 2 0 t h a t % 2 0 a r e % 2 0 b u i l t % 2 0 i n t o % 2 0 W i n d o w s , % 2 0 s u c h % 2 0 a s % 2 0 t h e % 2 0 M i c r o s o f t % 2 0 S t o r e . % 2 0 T h e % 2 0 t o o l k i t % 2 0 i s % 2 0 a v a i l a b l e % 2 0 o n % 2 0 G i t H u b % 2 0 a t % 2 0 h t t p : / a k a . m s / w i n d o w s t o o l k i t . " > M V V M   T o o l k i t   S a m p l e   A p p < / a > .   T h e   C o m m u n i t y T o o l k i t . M v v m   p a c k a g e   ( a k a   M V V M   T o o l k i t ,   f o r m e r l y   n a m e d   M i c r o s o f t . T o o l k i t . M v v m )   i s   a   m o d e r n ,   f a s t ,   a n d   m o d u l a r   M V V M   l i b r a r y .   I t   i s   p a r t   o f   t h e   < a   h r e f = " h t t p s : / / g i t h u b . c o m / C o m m u n i t y T o o l k i t / d o t n e t " > . N E T   C o m m u n i t y   T o o l k i t < / a >   a n d   i s   b u i l t   t o   b e   p l a t f o r m   a n d   r u n t i m e   i n d e p e n d e n t ,   s i m p l e   t o   p i c k - u p   a n d   u s e ,   & # 2 2 4 ;   l a   c a r t e ,   a n d   p r o v i d i n g   a   l e a n   a n d   p e r f o r m a n t   r e f e r e n c e   i m p l e m e n t a t i o n   f o r   a l l   b a s i c   M V V M   b u i l d i n g   b l o c k s .   T h e   M V V M   T o o l k i t   i s   m a i n t a i n e d   a n d   p u b l i s h e d   b y   M i c r o s o f t ,   a n d   p a r t   o f   t h e   . N E T   F o u n d a t i o n .   I t   i s   a l s o   u s e d   b y   s e v e r a l   f i r s t   p a r t y   a p p l i c a t i o n s   t h a t   a r e   b u i l t   i n t o   W i n d o w s ,   s u c h   a s   t h e   M i c r o s o f t   S t o r e . & # 1 6 0 ; < / l i >  
 < l i > < a   h r e f = " h t t p s : / / w w w . m i c r o s o f t . c o m / s t o r e / p r o d u c t I d / 9 N B L G G H 4 N N S 1 " > M i c r o s o f t   A p p   I n s t a l l e r < / a >   f o r   W i n d o w s   1 0   m a k e s   s i d e l o a d i n g   W i n d o w s   1 0   a p p s   e a s y :   J u s t   d o u b l e - c l i c k   t h e   a p p   p a c k a g e ,   a n d   y o u   w o n & a p o s ; t   h a v e   t o   r u n   P o w e r S h e l l   t o   i n s t a l l   a p p s .   A p p   I n s t a l l e r   p r e s e n t s   t h e   p a c k a g e   i n f o r m a t i o n   l i k e   a p p   n a m e ,   p u b l i s h e r ,   v e r s i o n ,   d i s p l a y   l o g o ,   a n d   t h e   c a p a b i l i t i e s   r e q u e s t e d   b y   t h e   a p p .   G e t   r i g h t   i n t o   t h e   a p p ,   n o   h a s s l e s - - a n d   i f   i n s t a l l a t i o n   d o e s n & a p o s ; t   w o r k ,   t h e   e r r o r   m e s s a g e s   w e r e   d e s i g n e d   t o   h e l p   y o u   f i x   t h e   p r o b l e m .   W i n d o w s   P a c k a g e   M a n a g e r   i s   s u p p o r t e d   t h r o u g h   A p p   I n s t a l l e r   s t a r t i n g   o n   W i n d o w s   1 0   1 8 0 9 . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / w w w . p w a b u i l d e r . c o m / " > P W A B u i l d e r < / a >   < s p a n   s t y l e = " c o l o r :   # 4 d 4 d 4 d ;   f o n t - f a m i l y :   - a p p l e - s y s t e m ,   B l i n k M a c S y s t e m F o n t ,   & a p o s ; S e g o e   U I & a p o s ; ,   H e l v e t i c a ,   A r i a l ,   s a n s - s e r i f ,   & a p o s ; A p p l e   C o l o r   E m o j i & a p o s ; ,   & a p o s ; S e g o e   U I   E m o j i & a p o s ; ,   & a p o s ; S e g o e   U I   S y m b o l & a p o s ; ;   f o n t - s i z e :   1 6 p x ;   b a c k g r o u n d - c o l o r :   # f f f f f f ; " > e n a b l e s   d e v e l o p e r s   t o   q u i c k l y   a n d   e a s i l y   t o   g e n e r a t e   s t o r e   u p l o a d a b l e   p a c k a g e s   f o r   t h e   M i c r o s o f t ,   G o o g l e   P l a y ,   a n d   i O S   A p p   s t o r e s . < / s p a n > < / l i >  
 < l i > < a   h r e f = " h t t p s : / / w w w . o f f i c e . c o m / ? o m k t = n l - n l " > M i c r o s o f t   O f f i c e < / a >   i s   g r e a t   a n d   I   u s e   i t   a   l o t .   I   u s e   P o w e r P o i n t   f o r   m y   s l i d e s ,   O n e N o t e   f o r   m y   n o t e s   a n d   O u t l o o k   f o r   m y   m a i l s .   I   d o n & a p o s ; t   l i k e   W o r d   b u t   I   h a v e   n o   b e t t e r   a l t e r n a t i v e .   E x c e l   i s   g r e a t   b u t   I   d o n & a p o s ; t   h a v e   t o   u s e   i t   a   l o t .   I   l o v e   t h a t   O n e N o t e   s y n c s   a l l   m y   n o t e s   o n   e v e r y   c o m p u t e r   a n d   m y   p h o n e . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / w w w . m i c r o s o f t . c o m / s t o r e / p r o d u c t I d / 9 N B L G G H 4 N N S 1 " > M i c r o s o f t   T o   D o < / a > . W h e t h e r   y o u   w a n t   t o   i n c r e a s e   y o u r   p r o d u c t i v i t y ,   d e c r e a s e   y o u r   s t r e s s   l e v e l s ,   o r   j u s t   f r e e   u p   s o m e   m e n t a l   s p a c e ,   M i c r o s o f t   T o   D o   m a k e s   i t   e a s y   t o   p l a n   y o u r   d a y   a n d   m a n a g e   y o u r   l i f e . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / l e a r n . m i c r o s o f t . c o m / e n - u s / w i n d o w s / p o w e r t o y s / " > M i c r o s o f t   P o w e r T o y s < / a >   i s   a   s e t   o f   u t i l i t i e s   f o r   p o w e r   u s e r s   t o   t u n e   a n d   s t r e a m l i n e   t h e i r   W i n d o w s   e x p e r i e n c e   f o r   g r e a t e r   p r o d u c t i v i t y . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / s u p p o r t . m i c r o s o f t . c o m / e n - g b / h e l p / 2 2 8 7 8 / w i n d o w s - 1 0 - r e c o r d - s t e p s " > S t e p s   R e c o r d e r < / a >   ( c a l l e d   P r o b l e m s   S t e p s   R e c o r d e r   i n   W i n d o w s   7 ) ,   i s   a   p r o g r a m   t h a t   h e l p s   y o u   t r o u b l e s h o o t   a   p r o b l e m   o n   y o u r   d e v i c e   b y   r e c o r d i n g   t h e   e x a c t   s t e p s   y o u   t o o k   w h e n   t h e   p r o b l e m   o c c u r r e d .   Y o u   c a n   t h e n   s e n d   t h i s   r e c o r d   t o   a   s u p p o r t   p r o f e s s i o n a l   t o   h e l p   t h e m   d i a g n o s e   t h e   p r o b l e m .   I t   i s   a l r e a d y   i n s t a l l e d   o n   y o u r   W i n d o w s   c o m p u t e r .   J u s t   h i t   W i n d o w s + R   a n d   t y p e   P S R .   I   w i s h   a l l   m y   u s e r s   w o u l d   u s e   i t   t o   r e p o r t   p r o b l e m s   t o   m e . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / w w w . m i c r o s o f t . c o m / e n - u s / p / n u g e t - p a c k a g e - e x p l o r e r / 9 w z d n c r d m d m 3 # a c t i v e t a b = p i v o t : o v e r v i e w t a b " > N u G e t   E x p l o r e r < / a > & # 1 6 0 ; a l l o w s   b r o w s i n g   < a   h r e f = " h t t p s : / / w w w . n u g e t . o r g / " > N u G e t < / a >   p a c k a g e s   f r o m   a n   o n l i n e   f e e d   a n d   v i e w i n g   c o n t e n t s   o f   t h e   p a c k a g e s .   N u G e t   i s   a   p a c k a g e   m a n a g e m e n t   t o o l   i n   V i s u a l   S t u d i o .   I t   i s   < a   h r e f = " h t t p s : / / g i t h u b . c o m / N u G e t P a c k a g e E x p l o r e r / N u G e t P a c k a g e E x p l o r e r " > o p e n   s o u r c e < / a >   a n d   s e t u p   b y & # 1 6 0 ; < a   h r e f = " h t t p s : / / o r e n . c o d e s / " > O r e n   N o v o t n y < / a > . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / w w w . a u d a c i t y t e a m . o r g / " > A u d a c i t y < / a >   i s   a n   e a s y - t o - u s e ,   m u l t i - t r a c k   a u d i o   e d i t o r   a n d   r e c o r d e r   f o r   W i n d o w s ,   M a c   O S   X ,   G N U / L i n u x   a n d   o t h e r   o p e r a t i n g   s y s t e m s .   I   u s e   i t   f o r   e d i t i n g   t h e   s o u n d s   i n   m y   g a m e s . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / w w w . g e t p o s t m a n . c o m / " > P o s t m a n < / a >   i s   a   c o l l a b o r a t i o n   p l a t f o r m   f o r   W e b   A P I   ( R E S T   & a m p ;   H T T P )   d e v e l o p m e n t .   P o s t m a n & a p o s ; s   f e a t u r e s   s i m p l i f y   e a c h   s t e p   o f   b u i l d i n g   a n   A P I   a n d   s t r e a m l i n e   c o l l a b o r a t i o n   s o   y o u   c a n   c r e a t e   b e t t e r   A P I s   -   f a s t e r . < / l i >  
 < l i > < a   h r e f = " h t t p : / / w w w . f i d d l e r t o o l . c o m / " > F i d d l e r < / a >   i s   t h e   e a s y ,   c l e a n ,   a n d   p o w e r f u l   d e b u g g i n g   p r o x y   f o r   c h e c k i n g   o u t   H T T P   b e t w e e n   h e r e   a n d   t h e r e .   I t   e v e n   s u p p o r t s   s n i f f i n g   S S L   t r a f f i c . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / r u f u s . i e / " > R u f u s < / a >   c r e a t e s   b o o t a b l e   U S B   d r i v e s   t h e   e a s y   w a y . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / g i t h u b . c o m / " > G i t H u b < / a >   i s   t h e   p l a c e   w h e r e   I   s t o r e   < a   h r e f = " h t t p s : / / g i t h u b . c o m / s o n n e m a f " > m y   < / a > r e p o s i t o r i e s .   I   u s e   < a   h r e f = " h t t p s : / / d e s k t o p . g i t h u b . c o m / " > G i t H u b   D e s k t o p < / a > ,   < a   h r e f = " h t t p s : / / g i t h u b . c o m / g i t e x t e n s i o n s / g i t e x t e n s i o n s " > G i t   E x t e n s i o n s < / a >   a n d & # 1 6 0 ; < a   h r e f = " h t t p s : / / w w w . s o u r c e t r e e a p p . c o m / " > S o u r c e t r e e   < / a > a s   m y   g i t   c l i e n t s . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / d o c s . m i c r o s o f t . c o m / e n - u s / s q l / s s m s / d o w n l o a d - s q l - s e r v e r - m a n a g e m e n t - s t u d i o - s s m s ? v i e w = s q l - s e r v e r - v e r 1 5 " > S Q L   S e r v e r   M a n a g e m e n t   S t u d i o < / a >   ( S S M S )   - & # 1 6 0 ; S Q L   S e r v e r   M a n a g e m e n t   S t u d i o   ( S S M S )   i s   a n   i n t e g r a t e d   e n v i r o n m e n t   f o r   m a n a g i n g   a n y   S Q L   i n f r a s t r u c t u r e ,   f r o m   S Q L   S e r v e r   t o   A z u r e   S Q L   D a t a b a s e . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / d o c s . m i c r o s o f t . c o m / e n - u s / s q l / s s d t / d o w n l o a d - s q l - s e r v e r - d a t a - t o o l s - s s d t ? v i e w = s q l - s e r v e r - v e r 1 5 " > S Q L   S e r v e r   D a t a   T o o l s < / a >   ( S S D T )   i s   a   m o d e r n   d e v e l o p m e n t   t o o l   f o r   b u i l d i n g   S Q L   S e r v e r   r e l a t i o n a l   d a t a b a s e s ,   A z u r e   S Q L   d a t a b a s e s ,   A n a l y s i s   S e r v i c e s   ( A S )   d a t a   m o d e l s ,   I n t e g r a t i o n   S e r v i c e s   ( I S )   p a c k a g e s ,   a n d   R e p o r t i n g   S e r v i c e s   ( R S )   r e p o r t s .   W i t h   S S D T ,   y o u   c a n   d e s i g n   a n d   d e p l o y   a n y   S Q L   S e r v e r   c o n t e n t   t y p e   w i t h   t h e   s a m e   e a s e   a s   y o u   w o u l d   d e v e l o p   a n   a p p l i c a t i o n   i n   V i s u a l   S t u d i o .   I t   i s   a n   i n d i v i d u a l   c o m p o n e n t   i n s i d e   t h e   V i s u a l   S t u d i o   I n s t a l l e r . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / w w w . m i c r o s o f t . c o m / s t o r e / p r o d u c t I d / 9 N K S Q G P 7 F 2 N H " > W h a t s A p p < / a >   f r o m   M e t a   i s   a   1 0 0 %   f r e e   m e s s a g i n g   a p p .   I t & # 8 2 1 7 ; s   u s e d   b y   o v e r   2 B   p e o p l e   i n   m o r e   t h a n   1 8 0   c o u n t r i e s .   I t & # 8 2 1 7 ; s   s i m p l e ,   r e l i a b l e ,   a n d   p r i v a t e ,   s o   y o u   c a n   e a s i l y   k e e p   i n   t o u c h   w i t h   y o u r   f r i e n d s   a n d   f a m i l y . & # 1 6 0 ; < / l i >  
 < l i > < a   h r e f = " h t t p s : / / g i t h u b . c o m / v a l i n e t / E x p l o r e r P a t c h e r " > E x p l o r e r P a t c h e r < / a >   i s   a n   O p e n   S o u r c e   p o r t a b l e   e x e c u t a b l e   t h a t   l e t s   y o u   c u s t o m i z e   t h e   W i n d o w s   1 1   S t a r t   M e n u ,   T a s k b a r ,   S y s t e m   T r a y ,   F i l e   E x p l o r e r ,   a n d   m o r e . < / l i >  
 < / u l >  
 < h 3 > A n a l y z e r s < / h 3 >  
 < p > A n a l y z e r s   w h e r e   a d d e d   t o   V i s u a l   S t u d i o   2 0 1 5 .   I   l o v e   t h i s   t e c h n i q u e   a n d   h e r e   i s   a   l i s t   o f   a n a l y z e r s   w h i c h   I   u s e   a   l o t . < / p >  
 < u l >  
 < l i > < a   h r e f = " h t t p s : / / g i t h u b . c o m / m i c r o s o f t / R o s l y n C l r H e a p A l l o c a t i o n A n a l y z e r " > C l r H e a p A l l o c a t i o n A n a l y z e r < / a >   -   R o s l y n   b a s e d   C #   h e a p   a l l o c a t i o n   d i a g n o s t i c   a n a l y z e r   t h a t   c a n   d e t e c t   e x p l i c i t   a n d   m a n y   i m p l i c i t   a l l o c a t i o n s   l i k e   b o x i n g ,   d i s p l a y   c l a s s e s   ( a k a   c l o s u r e s ) ,   i m p l i c i t   d e l e g a t e   c r e a t i o n s ,   e t c . & # 1 6 0 ; < / l i >  
 < l i > < a   h r e f = " h t t p s : / / g i t h u b . c o m / s o n n e m a f / R e f l e c t i o n I T . A n a l y z e r " > R e f l e c t i o n I T   A n a l y z e r < / a >   -   I   w r o t e   t h i s   a n a l y z e r   m y s e l f .   I t   c o n t a i n s   a   f e w   a n a l y z e r s   a n d   f i x e s   o f   t h i n g s   I   d i d   w r o n g   i n   m y   c o d e .   N o w   I   c a n   q u i c k l y   f i n d   a n d   f i x   t h e m . & # 1 6 0 ; < / l i >  
 < l i > < a   h r e f = " h t t p s : / / w w w . n u g e t . o r g / p a c k a g e s / E r r o r P r o n e . N E T . C o r e A n a l y z e r s / 0 . 4 . 0 - b e t a . 1 " > E r r o r P r o n e . N E T . C o r e A n a l y z e r s < / a >   a n d   < a   h r e f = " h t t p s : / / w w w . n u g e t . o r g / p a c k a g e s / E r r o r P r o n e . N E T . S t r u c t s / 0 . 4 . 0 - b e t a . 1 " > E r r o r P r o n e . N E T . S t r u c t s < / a >   a n d   i s   a   s e t   o f   R o s l y n - b a s e d   a n a l y z e r s   t h a t   w i l l   h e l p   y o u   t o   w r i t e   c o r r e c t   c o d e .   T h e   i d e a   i s   s i m i l a r   t o   G o o g l e & a p o s ; s   b u t   i n s t e a d   o f   J a v a ,   t h e   a n a l y z e r s   a r e   f o c u s i n g   o n   c o r r e c t n e s s   ( a n d ,   m a y b e ,   p e r f o r m a n c e )   o f   C #   p r o g r a m s .   Y o u   m i g h t   w a n t   t o   s e t   < e m > e r r o r _ p r o n e . l a r g e _ s t r u c t _ t h r e s h o l d   < / e m > t o   a   v a l u e   b e l o w   t h e   d e f a u l t   o f   2 4 . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / g i t h u b . c o m / D o t N e t A n a l y z e r s / W p f A n a l y z e r s " > W p f A n a l y z e r s < / a >   R o s l y n   a n a l y z e r s   f o r   W P F . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / g i t h u b . c o m / m e z i a n t o u / M e z i a n t o u . A n a l y z e r " > M e z i a n t o u . A n a l y z e r < / a > & # 1 6 0 ; A   R o s l y n   a n a l y z e r   t o   e n f o r c e   s o m e   g o o d   p r a c t i c e s   i n   C # . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / g i t h u b . c o m / m i c r o s o f t / R a p i d - X A M L - T o o l k i t " > R a p i d   X A M L   T o o l k i t < / a > & # 1 6 0 ; T o o l s   t o   a c c e l e r a t e   X A M L   a p p   d e v e l o p m e n t .   I t   i s   e v e n   < a   h r e f = " h t t p s : / / g i t h u b . c o m / m i c r o s o f t / R a p i d - X A M L - T o o l k i t / b l o b / d e v / d o c s / e x t e n d i n g - x a m l - a n a l y s i s . m d " > e x t e n d a b l e < / a > . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / s e c u r i t y - c o d e - s c a n . g i t h u b . i o / " >   S e c u r i t y   C o d e   S c a n < / a > & # 1 6 0 ; D e t e c t s   v a r i o u s   < a   h r e f = " h t t p s : / / s e c u r i t y - c o d e - s c a n . g i t h u b . i o / # r u l e s " > s e c u r i t y   v u l n e r a b i l i t y   p a t t e r n s < / a > :   S Q L   I n j e c t i o n ,   C r o s s - S i t e   S c r i p t i n g   ( X S S ) ,   C r o s s - S i t e   R e q u e s t   F o r g e r y   ( C S R F ) ,   X M L   e X t e r n a l   E n t i t y   I n j e c t i o n   ( X X E ) ,   e t c . < / l i >  
 < / u l >  
 < h 3 > V i s u a l   S t u d i o   E x t e n s i o n s < / h 3 >  
 < u l >  
 < l i > < a   h r e f = " h t t p s : / / m a r k e t p l a c e . v i s u a l s t u d i o . c o m / i t e m s ? i t e m N a m e = S h a r p D e v e l o p T e a m . I L S p y " > I L S p y < / a >   - & # 1 6 0 ; I n t e g r a t e s   t h e   I L S p y   d e c o m p i l e r   i n t o   V i s u a l   S t u d i o . & # 1 6 0 ; < / l i >  
 < l i > < a   h r e f = " h t t p s : / / m a r k e t p l a c e . v i s u a l s t u d i o . c o m / i t e m s ? i t e m N a m e = G i t H u b . c o p i l o t " > G i t H u b   C o p i l o t < / a >   p r o v i d e s   a u t o c o m p l e t e - s t y l e   s u g g e s t i o n s   f r o m   a n   A I   p a i r   p r o g r a m m e r   a s   y o u   c o d e .   Y o u   c a n   r e c e i v e   s u g g e s t i o n s   f r o m   G i t H u b   C o p i l o t   e i t h e r   b y   s t a r t i n g   t o   w r i t e   t h e   c o d e   y o u   w a n t   t o   u s e ,   o r   b y   w r i t i n g   a   n a t u r a l   l a n g u a g e   c o m m e n t   d e s c r i b i n g   w h a t   y o u   w a n t   t h e   c o d e   t o   d o . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / m a r k e t p l a c e . v i s u a l s t u d i o . c o m / i t e m s ? i t e m N a m e = u n o p l a t f o r m . u n o - p l a t f o r m - a d d i n - 2 0 2 2 " > U n o   P l a t f o r m   S o l u t i o n   T e m p l a t e s < / a >   -   S o l u t i o n   t e m p l a t e s   f o r   U n o   P l a t f o r m   e n a b l e d   p r o j e c t s . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / m a r k e t p l a c e . v i s u a l s t u d i o . c o m / i t e m s ? i t e m N a m e = M a d s K r i s t e n s e n . W e b E s s e n t i a l s 2 0 1 9 " > W e b   E s s e n t i a l s < / a >   -   E s s e n t i a l   t o o l s   f o r   w r i t i n g   W e b   ( i n   m y   c a s e   A S P . N E T )   a p p s .   T h e   e a s i e s t   w a y   t o   s e t   u p   V i s u a l   S t u d i o   2 0 1 9   f o r   t h e   u l t i m a t e   w e b   d e v e l o p m e n t   e x p e r i e n c e .   C o u l d n & a p o s ; t   f i n d   a   2 0 2 2   v e r s i o n   b u t   m a n y   o f   t h e   e x t e n s i o n s   i n   t h i s   p a c k a g e   a r e   a l s o   a v a i l a b l e   f o r   2 0 2 2 . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / m a r k e t p l a c e . v i s u a l s t u d i o . c o m / i t e m s ? i t e m N a m e = T e a m X a v a l o n . X A M L S t y l e r " > X A M L   S t y l e r < / a >   -   F o r m a t s   X A M L   s o u r c e   c o d e   b y   s o r t i n g   t h e   a t t r i b u t e s   b a s e d   o n   t h e i r   i m p o r t a n c e .   T h i s   t o o l   c a n   h e l p   y o u / y o u r   t e a m   m a i n t a i n   a   b e t t e r   X A M L   c o d i n g   s t y l e   a s   w e l l   a s   a   m u c h   b e t t e r   X A M L   r e a d a b i l i t y . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / m a r k e t p l a c e . v i s u a l s t u d i o . c o m / i t e m s ? i t e m N a m e = S t e p h a n Z e h e t n e r . I n l i n i n g A n a l y z e r " > I n l i n i n g   A n a l y z e r s < / a >   s h o w s   i f   a   m e t h o d   c a l l   w i l l   b e   i n l i n e d   b y   t h e   J I T   C o m p i l e r .   M e t h o d   c a l l s   a r e   h i g h l i g h t e d   r i g h t   i n   t h e   s o u r c e   c o d e   a n d   a l s o   d i s p l a y   t h e   r e a s o n   f o r   a   f a i l e d   i n l i n e   a s   g i v e n   b y   t h e   J I T   C o m p i l e r . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / m a r k e t p l a c e . v i s u a l s t u d i o . c o m / i t e m s ? i t e m N a m e = E r i k E J . E F C o r e P o w e r T o o l s " > E F   C o r e   P o w e r   T o o l s < / a >   -   I   u s e   i t   t o   r e v e r s e   e n g i n e e r   e x i s t i n g   d a t a b a s e s   t o   < a   h r e f = " h t t p s : / / d o c s . m i c r o s o f t . c o m / e n - u s / e f / # p i v o t = e f c o r e " > E n t i t y   F r a m e w o k   C o r e < / a > < / l i >  
 < l i > < a   h r e f = " h t t p s : / / m a r k e t p l a c e . v i s u a l s t u d i o . c o m / i t e m s ? i t e m N a m e = r u d y h u y n . R e s w P l u s " > R e s w P l u s < / a >   - & # 1 6 0 ; A d v a n c e d   R e s w   F i l e   C o d e   G e n e r a t o r   f o r   U W P   a p p s .   R e s w P l u s   i s   a   V i s u a l   S t u d i o   e x t e n s i o n   e n r i c h i n g   y o u r   e x i s t i n g   . r e s w   f i l e s .   W r i t t e n   b y   < a   h r e f = " h t t p s : / / w w w . r u d y h u y n . c o m / b l o g / " > R u d y   H u y n < / a > < / l i >  
 < l i > < a   h r e f = " h t t p s : / / m a r k e t p l a c e . v i s u a l s t u d i o . c o m / i t e m s ? i t e m N a m e = M a d s K r i s t e n s e n . O p e n C o m m a n d L i n e " > O p e n   C o m m a n d   L i n e < / a >   - & # 1 6 0 ; O p e n s   a   c o m m a n d   l i n e   a t   t h e   r o o t   o f   t h e   p r o j e c t . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / m a r k e t p l a c e . v i s u a l s t u d i o . c o m / i t e m s ? i t e m N a m e = D i a g n o s t i c s . C o n c u r r e n c y V i s u a l i z e r 2 0 1 7 " > C o n c u r r e n c y   V i s u a l i z e r   f o r   V i s u a l   S t u d i o   2 0 2 2 < / a >   -   V i s u a l i z e s   e x e c u t i o n   h i s t o r y   a n d   p r o f i l e s   a p p l i c a t i o n s . & # 1 6 0 ; < / l i >  
 < l i > < a   h r e f = " h t t p s : / / m a r k e t p l a c e . v i s u a l s t u d i o . c o m / i t e m s ? i t e m N a m e = E g o r B o g a t o v . D i s a s m o " > D i s a s m o < / a >   -   C l i c k   o n   a n y   m e t h o d   t o   s e e   w h a t   A S M   J I T   w i l l   g e n e r a t e   f o r   i t . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / m a r k e t p l a c e . v i s u a l s t u d i o . c o m / i t e m s ? i t e m N a m e = M u l t i l i n g u a l A p p T o o l k i t . M u l t i l i n g u a l A p p T o o l k i t - 1 8 3 0 8 " > M u l t i l i n g u a l   A p p   T o o l k i t   v 4 . 0   ( V S   2 0 1 7 + ) < / a >   h e l p s   y o u   l o c a l i z e   y o u r   W i n d o w s   a n d   X a m a r i n   A p p s   b y   p r o v i d i n g   f i l e   m a n a g e m e n t ,   t r a n s l a t i o n   s e r v i c e s ,   t r a n s l a t i o n   e d i t o r ,   a n d   b u i l d   i n t e g r a t i o n . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / m a r k e t p l a c e . v i s u a l s t u d i o . c o m / i t e m s ? i t e m N a m e = F o n s S o n n e m a n s . R e f l e c t i o n I T R e f a c t o r i n g " > R e f l e c t i o n I T . R e f a c t o r i n g < / a > & # 1 6 0 ; -   I   w r o t e   t h i s   e x t e n s i o n   m y s e l f .   I t   c o n t a i n s   a   f e w   r e f a c t o r i n g s   t o   s p e e d u p   m y   c o d i n g . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / m a r k e t p l a c e . v i s u a l s t u d i o . c o m / i t e m s ? i t e m N a m e = j o s e f p i h r t . R o s l y n a t o r 2 0 1 9 " > R o s l y n a t o r < / a >   -   A   c o l l e c t i o n   o f   5 0 0 +   a n a l y z e r s ,   r e f a c t o r i n g s   a n d   f i x e s   f o r   C # ,   p o w e r e d   b y   R o s l y n .   I   d o n & a p o s ; t   u s e   i t   a   l o t   b u t   i t   i s   w o r t h   t o   m e n t i o n . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / m a r k e t p l a c e . v i s u a l s t u d i o . c o m / i t e m s ? i t e m N a m e = M a d s K r i s t e n s e n . R a i n b o w B r a c e s " > R a i n b o w   B r a c e s < / a >   -   C o l o r i z e s   m a t c h i n g   b r a c e   p a i r s   t o   m a k e   i t   e a s y   t o   i d e n t i f y   t h e m   a n d   t h e i r   s c o p e .   W o r k s   f o r   c u r l y   b r a c k e t s ,   p a r e n t h e s e s ,   a n d   s q u a r e   b r a c k e t s . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / m a r k e t p l a c e . v i s u a l s t u d i o . c o m / i t e m s ? i t e m N a m e = C h r i s D e x t e r . R u n C o v e r l e t R e p o r t V s 2 0 2 2 " > R u n C o v e r l e t R e p o r t < / a >   A n   e a s y   t o   u s e   v i s u a l   s t u d i o   2 0 2 2   e x t e n s i o n   t o   r u n   c o v e r l e t   c o d e   c o v e r a g e   a n d   t h e n   u s e   r e p o r t   g e n e r a t o r   a n d   s h o w   r e s u l t s   i n   v i s u a l   s t u d i o   w i t h   s y n t a x   h i g h l i g h t i n g .   N o t e :   R e l i e s   o n   < a   h r e f = " h t t p s : / / g i t h u b . c o m / c o v e r l e t - c o v e r a g e / c o v e r l e t " > C o v e r l e t < / a >   a n d   < a   h r e f = " h t t p s : / / g i t h u b . c o m / d a n i e l p a l m e / R e p o r t G e n e r a t o r " > R e p o r t   G e n e r a t o r < / a >   b e i n g   a v a i l a b l e . & # 1 6 0 ; < / l i >  
 < l i > < a   h r e f = " h t t p s : / / m a r k e t p l a c e . v i s u a l s t u d i o . c o m / i t e m s ? i t e m N a m e = F o r t u n e N g w e n y a . F i n e C o d e C o v e r a g e 2 0 2 2 " > F i n e   C o d e   C o v e r a g e < / a >   -   V i s u a l i z e   u n i t   t e s t   c o d e   c o v e r a g e   e a s i l y   f o r   f r e e   i n   V i s u a l   S t u d i o   C o m m u n i t y   E d i t i o n   ( a n d   o t h e r   e d i t i o n s   t o o ) < / l i >  
 < l i > < a   h r e f = " h t t p s : / / m a r k e t p l a c e . v i s u a l s t u d i o . c o m / i t e m s ? i t e m N a m e = F o n s S o n n e m a n s . R D w C B " > R e s o u r c e D i c t i o n a r y   w i t h   C o d e - b e h i n d < / a >   -   I t e m T e m p l a t e   f o r   a n   e m p t y ,   k e y e d   c o l l e c t i o n   o f   X A M L   r e s o u r c e s   w i t h   C o d e - b e h i n d   w h i c h   c a n   b e   u s e d   f o r   x : B i n d   ( U W P   & a m p ;   W i n U I )   a n d   E v e n t H a n d l e r s   ( U W P   +   W i n U I   +   W P F ) . < / l i >  
 < / u l >  
 < h 3 > N u G e t   P a c k a g e s < / h 3 >  
 < u l >  
 < l i > < a   h r e f = " h t t p s : / / g i t h u b . c o m / C o m m u n i t y T o o l k i t / W i n d o w s C o m m u n i t y T o o l k i t " > W i n d o w s   C o m m u n i t y   T o o l k i t < / a >   i s   a   c o l l e c t i o n   o f   h e l p e r   f u n c t i o n s ,   c u s t o m   c o n t r o l s ,   a n d   a p p   s e r v i c e s .   I t   s i m p l i f i e s   a n d   d e m o n s t r a t e s   c o m m o n   d e v e l o p e r   t a s k s   b u i l d i n g   U W P   a n d   W i n A p p S d k / W i n U I 3   a p p s   f o r   W i n d o w s   1 0 .   I t   i s   < a   h r e f = " h t t p s : / / g i t h u b . c o m / w i n d o w s - t o o l k i t / W i n d o w s C o m m u n i t y T o o l k i t " > o p e n   s o u r c e < / a >   a n d   h a s   g r e a t   < a   h r e f = " h t t p s : / / d o c s . m i c r o s o f t . c o m / e n - u s / w i n d o w s / c o m m u n i t y t o o l k i t / " > d o c u m e n t a t i o n < / a > . & # 1 6 0 ; < / l i >  
 < l i > < a   h r e f = " h t t p s : / / w w w . n u g e t . o r g / p a c k a g e s / C o m m u n i t y T o o l k i t . D i a g n o s t i c s / " > C o m m u n i t y T o o l k i t . D i a g n o s t i c s < / a > .   A   s e t   o f   h e l p e r   A P I s   ( s p e c i f i c a l l y ,   G u a r d   a n d   T h r o w H e l p e r )   t h a t   c a n   b e   u s e d   f o r   c l e a n e r ,   m o r e   e f f i c i e n t   a n d   l e s s   e r r o r - p r o n e   a r g u m e n t   v a l i d a t i o n   a n d   e r r o r   c h e c k i n g . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / w w w . n u g e t . o r g / p a c k a g e s / C o m m u n i t y T o o l k i t . M v v m " > C o m m u n i t y T o o l k i t . M v v m < / a > .   A   f a s t ,   m o d u l a r ,   p l a t f o r m - a g n o s t i c   M V V M   l i b r a r y ,   w h i c h   i s   t h e   o f f i c i a l   s u c c e s s o r   o f   M v v m L i g h t .   I t & a p o s ; s   u s e d   e x t e n s i v e l y   i n   t h e   M i c r o s o f t   S t o r e   a n d   o t h e r   f i r s t   p a r t y   a p p s . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / w w w . n u g e t . o r g / p a c k a g e s / C o m m u n i t y T o o l k i t . H i g h P e r f o r m a n c e / " > C o m m u n i t y T o o l k i t . H i g h P e r f o r m a n c e < / a > .   A   c o l l e c t i o n   o f   h e l p e r s   f o r   w o r k i n g   i n   h i g h - p e r f o r m a n c e   s c e n a r i o s . & # 1 6 0 ; < / l i >  
 < l i > < a   h r e f = " h t t p s : / / w w w . n u g e t . o r g / p a c k a g e s / M i c r o s o f t . U I . X a m l " > M i c r o s o f t . U I . X a m l < / a >   ( a k a   W i n U I 2 )   -   T h i s   p a c k a g e   p r o v i d e s   b a c k w a r d - c o m p a t i b l e   v e r s i o n s   o f   W i n d o w s   U I   f e a t u r e s   i n c l u d i n g   U W P   X A M L   c o n t r o l s ,   a n d   F l u e n t   s t y l e s   a n d   m a t e r i a l s .   I t   i s   p a r t   o f   t h e   W i n d o w s   U I   L i b r a r y .   I   u s e   i t   i n   a l l   o f   m y   U W P   a p p s .   T h e   n e x t   m i n o r   v e r s i o n   w i l l   a l s o   c o n t a i n   t h e   N u m b e r B o x   c o n t r o l   w h i c h   I   < a   h r e f = " h t t p s : / / g i t h u b . c o m / m i c r o s o f t / m i c r o s o f t - u i - x a m l / i s s u e s / 4 8 3 " > p r o p o s e d < / a > .   T h e   n e x t   m a j o r   r e l e a s e   i s   W i n U I   3 . 0 ,   i t   i s   n o w   a l r e a d y   i n   < a   h r e f = " h t t p s : / / d o c s . m i c r o s o f t . c o m / e n - u s / u w p / t o o l k i t s / w i n u i 3 / " > A l p h a < / a > .   I t   w i l l   a l l o w   y o u   t o   u s e   t h e   U W P   c o n t r o l s   i n   . N E T   ( C o r e / 5 )   a s   a n   a l t e r n a t i v e   f o r   W P F . & # 1 6 0 ; < / l i >  
 < l i > < a   h r e f = " h t t p s : / / w w w . n u g e t . o r g / p a c k a g e s / M i c r o s o f t . W i n d o w s A p p S D K " > M i c r o s o f t . W i n d o w s A p p S D K < / a >   ( a k a   W i n U I 3 )   -   T h e   < a   h r e f = " h t t p s : / / g i t h u b . c o m / m i c r o s o f t / w i n d o w s a p p s d k " > W i n d o w s   A p p   S D K < / a >   e m p o w e r s   a l l   W i n d o w s   D e s k t o p   a p p s   w i t h   m o d e r n   W i n d o w s   U I ,   A P I s ,   a n d   p l a t f o r m   f e a t u r e s ,   i n c l u d i n g   b a c k - c o m p a t   s u p p o r t . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / w w w . n u g e t . o r g / p a c k a g e s / N e w t o n s o f t . J s o n / " > N e w t o n s o f t . J s o n < / a >   ( a k a   J s o n . N E T )   i s   a   p o p u l a r   h i g h - p e r f o r m a n c e   J S O N   f r a m e w o r k   f o r   . N E T .   I   u s e   i t   f o r   a l l   m y   J S O N   w o r k .   I n   . N E T   C o r e   3   I   s w i t c h e d   t o   < a   h r e f = " h t t p s : / / d e v b l o g s . m i c r o s o f t . c o m / d o t n e t / t r y - t h e - n e w - s y s t e m - t e x t - j s o n - a p i s / " > S y s t e m . T e x t . J s o n < / a > . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / w w w . n u g e t . o r g / p a c k a g e s / M i c r o s o f t . X a m l . B e h a v i o r s . U w p . M a n a g e d / " > M i c r o s o f t . X a m l . B e h a v i o r s . U w p . M a n a g e d < / a >   -   B l e n d   B e h a v i o r s   a n d   A c t i o n s   f o r   U W P ,   < a   h r e f = " h t t p s : / / g i t h u b . c o m / M i c r o s o f t / X a m l B e h a v i o r s " > o p e n   s o u r c e < / a > . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / w w w . n u g e t . o r g / p a c k a g e s / M i c r o s o f t . X a m l . B e h a v i o r s . W i n U I . M a n a g e d " > M i c r o s o f t . X a m l . B e h a v i o r s . W i n U I . M a n a g e d < / a >   -   E a s i l y   a d d   i n t e r a c t i v i t y   t o   y o u r   W i n U I   a p p s   u s i n g   X A M L   B e h a v i o r s .   B e h a v i o r s   e n c a p s u l a t e   r e u s a b l e   f u n c t i o n a l i t i e s   f o r   e l e m e n t s   t h a t   c a n   b e   e a s i l y   a d d e d   t o   y o u r   X A M L   w i t h o u t   t h e   n e e d   f o r   m o r e   i m p e r a t i v e   c o d e .   T h i s   i s   t h e   m a n a g e d   v e r s i o n   f o r   C #   W i n U I 3   p r o j e c t s . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / w w w . n u g e t . o r g / p a c k a g e s / M i c r o s o f t . X a m l . B e h a v i o r s . W p f / " > M i c r o s o f t . X a m l . B e h a v i o r s . W p f < / a > & # 1 6 0 ;   -   B l e n d   B e h a v i o r s ,   A c t i o n s   a n d   T r i g g e r s   f o r   W P F ,   < a   h r e f = " h t t p s : / / g i t h u b . c o m / M i c r o s o f t / X a m l B e h a v i o r s W p f % 2 0 " > o p e n   s o u r c e < / a > . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / g i t h u b . c o m / d o t M o r t e n / W i n d o w s S t a t e T r i g g e r s " > W i n d o w s S t a t e T r i g g e r s < / a >   a n d   < a   h r e f = " h t t p s : / / g i t h u b . c o m / H e r d o / A d a p t i v e T r i g g e r L i b r a r y " > A d a p t i v e T r i g g e r L i b r a r y < / a >   -   C o l l e c t i o n s   o f   c u s t o m   U W P   v i s u a l   s t a t e   t r i g g e r s . & # 1 6 0 ; < / l i >  
 < l i > < a   h r e f = " h t t p s : / / w w w . n u g e t . o r g / p a c k a g e s / P l a y F a b A l l S D K / " > P l a y F a b A l l S D K < / a >   -   I   u s e   t h i s   f o r   l e a d e r b o a r d s   i n   m y   g a m e s . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / w w w . n u g e t . o r g / p a c k a g e s / T h o m a s L e v e s q u e . W e a k E v e n t " > T h o m a s L e v e s q u e . W e a k E v e n t < / a >   - & # 1 6 0 ; A   g e n e r i c   w e a k   e v e n t   i m p l e m e n t a t i o n . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / w w w . n u g e t . o r g / p a c k a g e s / N i t o . A s y n c E x / " > N i t o . A s y n c E x < / a >   - & # 1 6 0 ; A   h e l p e r   l i b r a r y   f o r   t h e   T a s k - B a s e d   A s y n c h r o n o u s   P a t t e r n   ( T A P ) . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / w w w . n u g e t . o r g / p a c k a g e s ? q = M i c r o s o f t . A p p C e n t e r " > M i c r o s o f t . A p p C e n t e r < / a >   -   I   u s e   i t   t o   d i a g n o s e   t h e   < a   h r e f = " h t t p s : / / w w w . n u g e t . o r g / p a c k a g e s / M i c r o s o f t . A p p C e n t e r . C r a s h e s / " > C r a s h e s < / a >   a n d   t r a c k   < a   h r e f = " h t t p s : / / w w w . n u g e t . o r g / p a c k a g e s / M i c r o s o f t . A p p C e n t e r . A n a l y t i c s / " > A n a l i t y c s   < / a > e v e n t s   o f   m y   U W P   a p p s .   T h e   q u a l i t y   o f   t h e   S t a c k T r a c e s   i s   r e a l l y   g r e a t . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / w w w . n u g e t . o r g / p a c k a g e s / M i c r o s o f t . S e r v i c e s . S t o r e . S D K / " > M i c r o s o f t . S e r v i c e s . S t o r e . S D K < / a >   - & # 1 6 0 ; T h e   M i c r o s o f t   S t o r e   S e r v i c e s   S D K   i n c l u d e s   a d v e r t i s i n g   a n d   e n g a g e m e n t   f r a m e w o r k s .   T h e   b e s t   w a y   t o   g e n e r a t e   r e v e n u e   i n   m y   f r e e   g a m e s . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / w w w . n u g e t . o r g / p a c k a g e s / W i n 2 D . u w p / " > W i n 2 D . u w p < / a >   - & # 1 6 0 ; A n   e a s y - t o - u s e   W i n d o w s   R u n t i m e   A P I   f o r   i m m e d i a t e   m o d e   2 D   g r a p h i c s   r e n d e r i n g .   I   u s e   i t   i n   s o m e   o f   m y   U W P   a p p s . & # 1 6 0 ; < / l i >  
 < l i > < a   h r e f = " h t t p s : / / w w w . n u g e t . o r g / p a c k a g e s / R e p o r t G e n e r a t o r " > R e p o r t G e n e r a t o r < / a >   c o n v e r t s   c o v e r a g e   r e p o r t s   g e n e r a t e d   b y   c o v e r l e t ,   O p e n C o v e r ,   d o t C o v e r ,   V i s u a l   S t u d i o ,   N C o v e r ,   C o b e r t u r a ,   J a C o C o ,   C l o v e r ,   g c o v   o r   l c o v   i n t o   h u m a n   r e a d a b l e   r e p o r t s   i n   v a r i o u s   f o r m a t s .   T h e   r e p o r t s   s h o w   t h e   c o v e r a g e   q u o t a s   a n d   a l s o   v i s u a l i z e   w h i c h   l i n e s   o f   y o u r   s o u r c e   c o d e   h a v e   b e e n   c o v e r e d . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / w w w . n u g e t . o r g / p a c k a g e s / M i c r o s o f t . E n t i t y F r a m e w o r k C o r e " > M i c r o s o f t . E n t i t y F r a m e w o r k C o r e < / a >   a n d & # 1 6 0 ; < a   h r e f = " h t t p s : / / w w w . n u g e t . o r g / p a c k a g e s / D a p p e r / " > D a p p e r < / a >   -   M y   t w o   f a v o r i t e   O R M s .   E F   i s   e a s y   a n d   D a p p e r   i s   f a s t .   I   o f t e n   u s e   t h e m   b o t h   i n   a   p r o j e c t . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / w w w . n u g e t . o r g / p a c k a g e s / x u n i t / " > x U n i t < / a >   i s   a   d e v e l o p e r   t e s t i n g   f r a m e w o r k ,   b u i l t   t o   s u p p o r t   T e s t   D r i v e n   D e v e l o p m e n t ,   w i t h   a   d e s i g n   g o a l   o f   e x t r e m e   s i m p l i c i t y   a n d   a l i g n m e n t   w i t h   f r a m e w o r k   f e a t u r e s .   I   u s e   i t   w i t h   < a   h r e f = " h t t p s : / / w w w . n u g e t . o r g / p a c k a g e s / x u n i t . r u n n e r . v i s u a l s t u d i o / " > x u n i t . r u n n e r . v i s u a l s t u d i o < / a >   w h i c h   i n t e g r a t e s   i t   w i t h   t h e   V i s u a l   S t u d i o   T e s t   E x p l o r e r .   & # 1 6 0 ; < / l i >  
 < l i > < a   h r e f = " h t t p s : / / w w w . n u g e t . o r g / p a c k a g e s / b u n i t . t e m p l a t e / " > b U n i t < / a >   i s   a   t e s t i n g   l i b r a r y   f o r   B l a z o r   C o m p o n e n t s .   I t s   g o a l   i s   t o   m a k e   i t   e a s y   t o   w r i t e   c o m p r e h e n s i v e ,   s t a b l e   u n i t   t e s t s . & # 1 6 0 ; < / l i >  
 < l i > < a   h r e f = " h t t p s : / / w w w . n u g e t . o r g / p a c k a g e s / M i c r o s o f t . A s p N e t C o r e . C o m p o n e n t s . Q u i c k G r i d " > Q u i c k G r i d   f o r   B l a z o r < / a >   i s   a n   e x p e r i m e n t a l   g r i d   c o m p o n e n t   b u i l t   b y   t h e   B l a z o r   t e a m . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / d a t a l n e t . c o m " > D a t a l n e t   B l a z o r   C o m p o n e n t s < / a >   i s   a   B l a z o r   c o m p o n e n t   l i b r a r y .   A l l   c o m p o n e n t s   a r e   w r i t t e n   i n   C # .   I t   i n c l u d e s   t h e   s u p e r   f a s t   B l G r i d . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / b l a z o r i s e . c o m / " > B l a z o r i s e < / a >   i s   a   c o m p o n e n t   l i b r a r y   b u i l t   o n   t o p   o f   B l a z o r   w i t h   s u p p o r t   f o r   m u l t i p l e   C S S   f r a m e w o r k s   l i k e   B o o t s t r a p ,   B u l m a ,   A n t D e s i g n   a n d   M a t e r i a l . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / w w w . n u g e t . o r g / p a c k a g e s / B l a z o r S t r a p . V 5 " > B l a z o r S t r a p < / a >   B o o t s t r a p   4 / 5   c o m p o n e n t s   f o r   B l a z o r . < / l i >  
 < l i > < a   h r e f = " h t t p s : / / w w w . m a t b l a z o r . c o m / " > M a t B l a z o r < / a >   M a t e r i a l   D e s i g n   c o m p o n e n t s   f o r   B l a z o r < / l i >  
 < / u l >  
 < h 3 > C l o s u r e < / h 3 >  
 < p > I   h o p e   t h i s   l i s t   i s   u s e f u l   f o r   y o u .   E s p e c i a l l y   i f   y o u   a r e   a l s o   a n   W i n d o w s   A p p   d e v e l o p e r .   I   w i l l   p r o b a b l y   w r i t e   a   n e w   o n e   i n   t h e   f u t u r e   b e c a u s e   t h i n g s   w i l l   c h a n g e ,   a s   a l w a y s . < / p >  
 < p > F o n s < / p > < / b o d y > < / h t m l > ] ] > < / c o n t e n t : e n c o d e d >  
         < / i t e m >  
         < i t e m >  
             < t i t l e > I m p l e m e n t   I X m l S e r i a l i z a b l e   i n   a   r e a d o n l y   s t r u c t < / t i t l e >  
             < l i n k > h t t p s : / / w w w . r e f l e c t i o n i t . n l / b l o g / 2 0 2 2 / i m p l e m e n t - i x m l s e r i a l i z a b l e - i n - a - r e a d o n l y - s t r u c t < / l i n k >  
             < d e s c r i p t i o n   / >  
             < a u t h o r > f o n s . s o n n e m a n s @ r e f l e c t i o n i t . n l   ( F o n s   S o n n e m a n s ) < / a u t h o r >  
             < c a t e g o r y > C S h a r p < / c a t e g o r y >  
             < g u i d > h t t p s : / / w w w . r e f l e c t i o n i t . n l / b l o g / 2 0 2 2 / i m p l e m e n t - i x m l s e r i a l i z a b l e - i n - a - r e a d o n l y - s t r u c t < / g u i d >  
             < p u b D a t e > T u e ,   1 4   J u n   2 0 2 2   0 0 : 0 0 : 0 0   G M T < / p u b D a t e >  
             < c o n t e n t : e n c o d e d > < ! [ C D A T A [ < h t m l > < b o d y > < p > X m l   s e r i a l i z a t i o n   i s   r e a l l y   c o m m o n .   F o r   a   c l a s s   t h i s   i s   d o n e   a u t o m a t i c a l l y ,   b u t   n o t   f o r   y o u r   o w n   s t r u c t .   T h e   p r i m i t i v e   s t r u c t s   f r o m   M i c r o s o f t   ( b o o l ,   b y t e ,   s h o r t ,   i n t ,   l o n g ,   d o u b l e ,   d e c i m a l ,   e t c . )   d o n & # 8 2 1 7 ; t   h a v e   t h i s   p r o b l e m .   T h e   s e r i a l i z a t i o n   a n d   d e s e r i a l i z a t i o n   o f   t h o s e   t y p e s   a r e   d o n e   b y   t h e   X m l S e r i a l i z e r   c l a s s .   F o r   y o u r   o w n   s t r u c t   y o u   h a v e   t o   i m p l e m e n t   t h e   I X m l S e r i a l i z a b l e   i n t e r f a c e .   T h i s   i s n & # 8 2 1 7 ; t   r e a l l y   h a r d ,   b u t   i t   i s   h a r d e r   w h e n   t h e   s t r u c t   i s   a   r e a d o n l y   s t r u c t .   A   f e a t u r e   w h i c h   M i c r o s o f t   a d d e d   t o   C #   7 . 2   a   f e w   y e a r s   a g o .   T h e   p r o b l e m   i s   c a u s e d   b y   t h e   R e a d X m l ( )   m e t h o d   o f   t h i s   i n t e r f a c e .   T h i s   m e t h o d   r e t u r n s   a   v o i d   w h i c h   m e a n s   t h a t   y o u   h a v e   t o   m o d i f y   t h e   f i e l d s   i n s i d e   t h e   s t r u c t ,   w h i c h   i s   n o t   a l l o w e d   i f   t h e   s t r u c t   i s   r e a d o n l y .   L u c k i l y   t h e r e   i s   a   s o l u t i o n   u s i n g   t h e   U n s a f e . A s R e f ( )   m e t h o d .   I n   t h i s   b l o g   I   w i l l   e x p l a i n   h o w   t o   u s e   i t . < / p >  
 < h 3 > X m l   S e r i a l i z a t i o n < / h 3 >  
 < p > T o   s e r i a l i z e   o r   d e s e r i a l i z e   a n   o b j e c t   y o u   c a n   u s e   a n   X m l S e r i a l i z e r .   T h e   f o l l o w i n g   c o d e   e x a m p l e   s h o w s   y o u   h o w   t o   d o   t h i s .   I t   u s e s   a   S t r i n g W r i t e r   t o   s e r i a l i z e   i t   t o   a   s t r i n g .   I t   u s e s   a   S t r i n g R e a d e r   t o   d e s e r i a l i z e   f r o m   a   s t r i n g .   Y o u   c a n   u s e   d i f f e r e n t   r e a d e r s   a n d   w r i t e r s   l i k e   t h e   S t r e a m W r i t e r   a n d   S t r e a m R e a d e r   w h e n   y o u   w a n t   t o   w r i t e   i t   t o   d i s k   o r   t h e   n e t w o r k .   T h e   n e x t   c o d e   i s   w r i t t e n   i n   C #   1 0   s o   i t   u s e s   m o d e r n   f e a t u r e s   l i k e   t o p - l e v e l   s t a t e m e n t s ,   n u l l a b l e   r e f e r e n c e   t y p e s   a n d   i m p l i c i t   u s i n g s . < / p >  
 < p r e   c l a s s = " b r u s h :   c s h a r p " > u s i n g   S y s t e m . X m l ;  
 u s i n g   S y s t e m . X m l . S c h e m a ;  
 u s i n g   S y s t e m . X m l . S e r i a l i z a t i o n ;  
  
 v a r   e m p l o y e e   =   n e w   E m p l o y e e ( & q u o t ; F o n s & q u o t ; ,   2 0 0 0 ) ;  
  
 v a r   x m l   =   S e r i a l i z e T o X m l ( e m p l o y e e ) ;  
 C o n s o l e . W r i t e L i n e ( x m l ) ;  
  
 x m l   =   & q u o t ; & l t ; E m p l o y e e & g t ; & l t ; N a m e & g t ; J i m & l t ; / N a m e & g t ; & l t ; S a l a r y & g t ; 4 0 0 0 & l t ; / S a l a r y & g t ; & l t ; / E m p l o y e e & g t ; & q u o t ; ;  
 e m p l o y e e   =   D e s e r i a l i z e F r o m X m l & l t ; E m p l o y e e & g t ; ( x m l ) ;  
 C o n s o l e . W r i t e L i n e ( e m p l o y e e . T o S t r i n g ( ) ) ;  
  
 s t a t i c   s t r i n g   S e r i a l i z e T o X m l & l t ; T & g t ; ( T   p o i n t )   {  
         X m l S e r i a l i z e r   s e r i a l i z e r   =   n e w   X m l S e r i a l i z e r ( t y p e o f ( T ) ) ;  
         u s i n g   ( v a r   s w   =   n e w   S t r i n g W r i t e r ( ) )   {  
                 s e r i a l i z e r . S e r i a l i z e ( s w ,   p o i n t ) ;  
                 r e t u r n   s w . T o S t r i n g ( ) ;  
         }  
 }  
  
 s t a t i c   T   D e s e r i a l i z e F r o m X m l & l t ; T & g t ; ( s t r i n g   x m l )   {  
         X m l S e r i a l i z e r   s e r i a l i z e r   =   n e w   X m l S e r i a l i z e r ( t y p e o f ( T ) ) ;  
         u s i n g   ( v a r   s r   =   n e w   S t r i n g R e a d e r ( x m l ) )   {  
                 r e t u r n   ( T ) s e r i a l i z e r . D e s e r i a l i z e ( s r ) ! ;  
         }  
 }  
  
 p u b l i c   c l a s s   E m p l o y e e   {  
  
         p u b l i c   s t r i n g ?   N a m e   {   g e t ;   s e t ;   }  
  
         p u b l i c   d e c i m a l   S a l a r y   {   g e t ;   s e t ;   }  
  
         p u b l i c   E m p l o y e e ( )   {  
                 / /   P u b l i c   p a r a m e t e r l e s s   c o n s t r u c t u c t o r   i s  
                 / /   r e q u i r e d   f o r   D e s e r i a l i z a t i o n  
         }  
  
         p u b l i c   E m p l o y e e ( s t r i n g ?   n a m e ,   d e c i m a l   s a l a r y )   {  
                 N a m e   =   n a m e ;  
                 S a l a r y   =   s a l a r y ;  
         }  
  
         p u b l i c   o v e r r i d e   s t r i n g   T o S t r i n g ( )   = & g t ;   $ & q u o t ; E m p l o y e e   { N a m e }   { S a l a r y } & q u o t ; ;  
 }  
 < / p r e >  
 < p > T h e   o u t p u t   o f   t h e   s e r i a l i z a t i o n   i s   t h e n < / p >  
 < p r e   c l a s s = " b r u s h :   h t m l " > & l t ; ? x m l   v e r s i o n = & q u o t ; 1 . 0 & q u o t ;   e n c o d i n g = & q u o t ; u t f - 1 6 & q u o t ; ? & g t ;  
 & l t ; E m p l o y e e   x m l n s : x s i = & q u o t ; h t t p : / / w w w . w 3 . o r g / 2 0 0 1 / X M L S c h e m a - i n s t a n c e & q u o t ;    
                     x m l n s : x s d = & q u o t ; h t t p : / / w w w . w 3 . o r g / 2 0 0 1 / X M L S c h e m a & q u o t ; & g t ;  
       & l t ; N a m e & g t ; F o n s & l t ; / N a m e & g t ;  
       & l t ; S a l a r y & g t ; 2 0 0 0 & l t ; / S a l a r y & g t ;  
 & l t ; / E m p l o y e e & g t ;  
 < / p r e >  
 < p > B e c a u s e   t h e   E m p l o y e e   i s   a   c l a s s   t h e   s e r i a l i z a t i o n   d o e s n & # 8 2 1 7 ; t   r e q u i r e   a n y   s p e c i a l   t r e a t m e n t .   Y o u   c a n   a l t h o u g h   u s e   a t t r i b u t e s   t o   f i n e t u n e   t h e   p r o c e s s .   F o r   e x a m p l e   y o u   c a n   u s e   t h e   X m l A t t r i b u t e   t o   i n d i c a t e   t h a t   a   p r o p e r t y   s h o u l d   b e   s e r i a l i z e d   i n t o   a n   x m l   a t t r i b u t e   a n d   n o t   i n t o   a n   x m l   e l e m e n t .   I n   t h e   n e x t   e x a m p l e   t h i s   a t t r i b u t e   i s   u s e d   f o r   t h e   S a l a r y   p r o p e r t y . < / p >  
 < p r e   c l a s s = " b r u s h :   c s h a r p " > p u b l i c   c l a s s   E m p l o y e e   {  
  
         p u b l i c   s t r i n g ?   N a m e   {   g e t ;   s e t ;   }  
  
         [ X m l A t t r i b u t e ]  
         p u b l i c   d e c i m a l   S a l a r y   {   g e t ;   s e t ;   }  
  
         p u b l i c   E m p l o y e e ( )   {  
                 / /   P u b l i c   p a r a m e t e r l e s s   c o n s t r u c t u c t o r   i s  
                 / /   r e q u i r e d   f o r   D e s e r i a l i z a t i o n  
         }  
  
         p u b l i c   E m p l o y e e ( s t r i n g ?   n a m e ,   d e c i m a l   s a l a r y )   {  
                 N a m e   =   n a m e ;  
                 S a l a r y   =   s a l a r y ;  
         }  
  
         p u b l i c   o v e r r i d e   s t r i n g   T o S t r i n g ( )   = & g t ;   $ & q u o t ; E m p l o y e e   { N a m e }   { S a l a r y } & q u o t ; ;  
 }  
 < / p r e >  
 < p > T h e   o u t p u t   o f   t h e   S e r i a l i z a t i o n   i s   t h e n < / p >  
 < p r e   c l a s s = " b r u s h :   h t m l " > & l t ; ? x m l   v e r s i o n = & q u o t ; 1 . 0 & q u o t ;   e n c o d i n g = & q u o t ; u t f - 1 6 & q u o t ; ? & g t ;  
 & l t ; E m p l o y e e   x m l n s : x s i = & q u o t ; h t t p : / / w w w . w 3 . o r g / 2 0 0 1 / X M L S c h e m a - i n s t a n c e & q u o t ;    
                     x m l n s : x s d = & q u o t ; h t t p : / / w w w . w 3 . o r g / 2 0 0 1 / X M L S c h e m a & q u o t ;    
                     S a l a r y = & q u o t ; 2 0 0 0 & q u o t ; & g t ;  
       & l t ; N a m e & g t ; F o n s & l t ; / N a m e & g t ;  
 & l t ; / E m p l o y e e & g t ;  
 < / p r e >  
 < h 3 > S t r u c t   S e r i a l i z a t i o n < / h 3 >  
 < p > I f   y o u   w a n t   t o   s e r i a l i z e   a   s t r u c t   y o u   h a v e   t o   i m p l e m e n t   t h e   I X m l S e r i a l i z a b l e   i n t e r f a c e .   T h i s   i n t e r f a c e   h a s   3   m e t h o d s   w h i c h   a r e n & # 8 2 1 7 ; t   r e a l l y   d i f f i c u l t   t o   i m p l e m e n t .   I n   t h i s   e x a m p l e   I   u s e   a   P o i n t   s t r u c t .   I t   i s   i m p l e m e n t e d   a s   a   C #   1 0   r e c o r d   s t r u c t   w h i c h   w i l l   a u t o m a t i c a l l y   i m p l e m e n t   f a s t   e q u a l i t y   l o g i c .   T h i s   l o g i c   y o u   s h o u l d   o t h e r w i s e   h a v e   t o   w r i t e   y o u r s e l f .   I n   t h e   n e x t   e x a m p l e   t h e   W r i t e X m l ( )   w r i t e s   t h e   p u b l i c   f i e l d s   X   a n d   Y   t o   x m l   a t t r i b u t e s .   T h e   R e a d X m l ( )   r e a d   t h e m   f r o m   t h e   x m l   a t t r i b u t e s . < / p >  
 < p r e   c l a s s = " b r u s h :   c s h a r p " > u s i n g   S y s t e m . X m l ;  
 u s i n g   S y s t e m . X m l . S c h e m a ;  
 u s i n g   S y s t e m . X m l . S e r i a l i z a t i o n ;  
  
 v a r   p o i n t   =   n e w   P o i n t ( 1 ,   2 ) ;  
 C o n s o l e . W r i t e L i n e ( p o i n t . T o S t r i n g ( ) ) ;  
  
 v a r   x m l   =   S e r i a l i z e T o X m l ( p o i n t ) ;  
 C o n s o l e . W r i t e L i n e ( x m l ) ;  
  
 x m l   =   & q u o t ; & l t ; P o i n t   X = \ & q u o t ; 3 \ & q u o t ;   Y = \ & q u o t ; 4 \ & q u o t ;   / & g t ; & q u o t ; ;  
 p o i n t   =   D e s e r i a l i z e F r o m X m l & l t ; P o i n t & g t ; ( x m l ) ;  
 C o n s o l e . W r i t e L i n e ( p o i n t . T o S t r i n g ( ) ) ;  
  
 p u b l i c   r e c o r d   s t r u c t   P o i n t   :   I X m l S e r i a l i z a b l e   {  
  
         p u b l i c   i n t   X ;    
         p u b l i c   i n t   Y ;    
  
         p u b l i c   P o i n t ( i n t   x ,   i n t   y )   {  
                 X   =   x ;  
                 Y   =   y ;  
         }  
  
         p u b l i c   d o u b l e   D i s t   = & g t ;   M a t h . S q r t ( ( l o n g ) X   *   X   +   ( l o n g ) Y   *   Y ) ;  
  
         p u b l i c   o v e r r i d e   s t r i n g   T o S t r i n g ( )   = & g t ;   $ & q u o t ; { X } : { Y } & q u o t ; ;  
  
         p u b l i c   X m l S c h e m a   G e t S c h e m a ( )   = & g t ;   n u l l ! ;  
  
         p u b l i c   v o i d   R e a d X m l ( X m l R e a d e r   r e a d e r )   {  
                 i n t   x   =   i n t . P a r s e ( r e a d e r . M o v e T o A t t r i b u t e ( & q u o t ; X & q u o t ; )   ?   r e a d e r . V a l u e   :   & q u o t ; 0 & q u o t ; ) ;  
                 i n t   y   =   i n t . P a r s e ( r e a d e r . M o v e T o A t t r i b u t e ( & q u o t ; Y & q u o t ; )   ?   r e a d e r . V a l u e   :   & q u o t ; 0 & q u o t ; ) ;  
                 r e a d e r . S k i p ( ) ;  
  
                 t h i s   =   n e w   P o i n t ( x ,   y ) ;  
         }  
  
         p u b l i c   v o i d   W r i t e X m l ( X m l W r i t e r   w r i t e r )   {  
                 w r i t e r . W r i t e A t t r i b u t e S t r i n g ( & q u o t ; X & q u o t ; ,   X . T o S t r i n g ( ) ) ;  
                 w r i t e r . W r i t e A t t r i b u t e S t r i n g ( & q u o t ; Y & q u o t ; ,   Y . T o S t r i n g ( ) ) ;  
         }  
 }  
 < / p r e >  
 < p > T h e   o u t p u t   o f   t h e   S e r i a l i z a t i o n   i s   t h e n < / p >  
 < p r e   c l a s s = " b r u s h :   h t m l " > & l t ; ? x m l   v e r s i o n = & q u o t ; 1 . 0 & q u o t ;   e n c o d i n g = & q u o t ; u t f - 1 6 & q u o t ; ? & g t ;  
 & l t ; P o i n t   X = & q u o t ; 1 & q u o t ;   Y = & q u o t ; 2 & q u o t ;   / & g t ;  
 < / p r e >  
 < h 3 > R e a d o n l y   S t r u c t   S e r i a l i z a t i o n < / h 3 >  
 < p > I f   y o u r   s t r u c t   i s   r e a d o n l y   y o u   h a v e   t o   m o d i f y   t h e   R e a d X m l ( )   m e t h o d .   I n   a   r e a d o n l y   s t r u c t   y o u   c a n & # 8 2 1 7 ; t   m o d i f y   t h e   f i e l d s   o f   t h e   s t r u c t .   T h e   U n s a f e . A s R e f ( )   m e t h o d   a l l o w s   y o u   t o   m o d i f y   t h e   c u r r e n t   v a l u e   a l t h o u g h   i t   i s   r e a d o n l y .   I t   f e e l s   l i k e   a   h a c k   b u t   l i b r a r i e s   l i k e   < a   h r e f = " h t t p s : / / n o d a t i m e . o r g / " > N o d a T i m e < / a >   a n d   < a   h r e f = " h t t p s : / / g i t h u b . c o m / Q o w a i v / Q o w a i v " > Q o w a i v < / a >   u s e   t h e   s a m e   s o l u t i o n .   N o d a T i m e   i s   w r i t t e n   b y   J o h n   S k e e t   a n d   i f   h e   d a r e s   t o   u s e   i t ,   I   w i l l   u s e   i t   t o o .   T h e   o n l y   d i f f e r e n c e   i n   t h e   c o d e   i s   i n   l i n e   2 8 . < / p >  
 < p r e   c l a s s = " b r u s h :   c s h a r p " > u s i n g   S y s t e m . R u n t i m e . C o m p i l e r S e r v i c e s ;  
 u s i n g   S y s t e m . X m l ;  
 u s i n g   S y s t e m . X m l . S c h e m a ;  
 u s i n g   S y s t e m . X m l . S e r i a l i z a t i o n ;  
  
 p u b l i c   r e a d o n l y   r e c o r d   s t r u c t   P o i n t   :   I X m l S e r i a l i z a b l e   {  
  
         p u b l i c   r e a d o n l y   i n t   X ;  
         p u b l i c   r e a d o n l y   i n t   Y ;  
  
         p u b l i c   P o i n t ( i n t   x ,   i n t   y )   {  
                 X   =   x ;  
                 Y   =   y ;  
         }  
  
         p u b l i c   d o u b l e   D i s t   = & g t ;   M a t h . S q r t ( ( l o n g ) X   *   X   +   ( l o n g ) Y   *   Y ) ;  
  
         p u b l i c   o v e r r i d e   s t r i n g   T o S t r i n g ( )   = & g t ;   $ & q u o t ; { X } : { Y } & q u o t ; ;  
  
         p u b l i c   X m l S c h e m a   G e t S c h e m a ( )   = & g t ;   n u l l ! ;  
  
         p u b l i c   v o i d   R e a d X m l ( X m l R e a d e r   r e a d e r )   {  
                 i n t   x   =   i n t . P a r s e ( r e a d e r . M o v e T o A t t r i b u t e ( & q u o t ; X & q u o t ; )   ?   r e a d e r . V a l u e   :   & q u o t ; 0 & q u o t ; ) ;  
                 i n t   y   =   i n t . P a r s e ( r e a d e r . M o v e T o A t t r i b u t e ( & q u o t ; Y & q u o t ; )   ?   r e a d e r . V a l u e   :   & q u o t ; 0 & q u o t ; ) ;  
                 r e a d e r . S k i p ( ) ;  
  
                 / /   U p d a t e   t h i s   u s i n g   t h e   U n s a f e . A s R e f ( )   w o r k a r o u n d    
                 U n s a f e . A s R e f ( t h i s )   =   n e w   P o i n t ( x ,   y ) ;  
         }  
  
         p u b l i c   v o i d   W r i t e X m l ( X m l W r i t e r   w r i t e r )   {  
                 w r i t e r . W r i t e A t t r i b u t e S t r i n g ( & q u o t ; X & q u o t ; ,   X . T o S t r i n g ( ) ) ;  
                 w r i t e r . W r i t e A t t r i b u t e S t r i n g ( & q u o t ; Y & q u o t ; ,   Y . T o S t r i n g ( ) ) ;  
         }  
 }  
 < / p r e >  
 < p > I f   y o u   w a n t   t o   u s e   t h i s   s o l u t i o n   i n   a   p r o j e c t   t a r g e t i n g   t h e   o l d   . N E T   F r a m e w o r k   o f   . N E T   S t a n d a r d   2 . 0   y o u   h a v e   t o   a d d   t h e   < a   h r e f = " h t t p s : / / w w w . n u g e t . o r g / p a c k a g e s / S y s t e m . R u n t i m e . C o m p i l e r S e r v i c e s . U n s a f e " > S y s t e m . R u n t i m e . C o m p i l e r S e r v i c e s . U n s a f e < / a >   N u G e t   p a c k a g e   t o   t h e   p r o j e c t .   T h i s   w i l l   a l l o w   y o u   t o   u s e   t h e   U n s a f e   c l a s s . < / p >  
 < h 3 > C l o s u r e < / h 3 >  
 < p > I   h o p e   y o u   l i k e   t h i s   b l o g   p o s t .   C #   a n d   . N E T   a r e   g r e a t   b u t   y o u   h a v e   t o   k n o w   t h e   q u i r k s . < / p >  
 < p > F o n s < / p > < / b o d y > < / h t m l > ] ] > < / c o n t e n t : e n c o d e d >  
         < / i t e m >  
         < i t e m >  
             < t i t l e > A c c e l e r a t o r   k e y s   f o r   C o n t e n t D i a l o g   B u t t o n s < / t i t l e >  
             < l i n k > h t t p s : / / w w w . r e f l e c t i o n i t . n l / b l o g / 2 0 2 2 / a c c e l e r a t o r - k e y s - f o r - c o n t e n t d i a l o g - b u t t o n s < / l i n k >  
             < d e s c r i p t i o n   / >  
             < a u t h o r > f o n s . s o n n e m a n s @ r e f l e c t i o n i t . n l   ( F o n s   S o n n e m a n s ) < / a u t h o r >  
             < c a t e g o r y > A p p s < / c a t e g o r y >  
             < c a t e g o r y > X A M L < / c a t e g o r y >  
             < c a t e g o r y > U W P < / c a t e g o r y >  
             < c a t e g o r y > W i n U I < / c a t e g o r y >  
             < c a t e g o r y > W i n d o w s A p p S D K < / c a t e g o r y >  
             < g u i d > h t t p s : / / w w w . r e f l e c t i o n i t . n l / b l o g / 2 0 2 2 / a c c e l e r a t o r - k e y s - f o r - c o n t e n t d i a l o g - b u t t o n s < / g u i d >  
             < p u b D a t e > F r i ,   2 5   F e b   2 0 2 2   0 0 : 0 0 : 0 0   G M T < / p u b D a t e >  
             < c o n t e n t : e n c o d e d > < ! [ C D A T A [ < h t m l > < b o d y > < p > < s p a n   s t y l e = " f o n t - s i z e :   1 e m ; " > A c c e l e r a t o r   k e y s   ( o r   k e y b o a r d   a c c e l e r a t o r s )   a r e   k e y b o a r d   s h o r t c u t s   t h a t   i m p r o v e   t h e   u s a b i l i t y   a n d   a c c e s s i b i l i t y   o f   y o u r   W i n d o w s   a p p l i c a t i o n s   b y   p r o v i d i n g   a n   i n t u i t i v e   w a y   f o r   u s e r s   t o   i n v o k e   c o m m o n   a c t i o n s   o r   c o m m a n d s   w i t h o u t   n a v i g a t i n g   t h e   a p p   U I .   Y o u   c a n   a d d   t h e m   t o   a   B u t t o n   u s i n g   t h e   K e y b o a r d A c c e l e r a t o r s   p r o p e r t y .   S e e   t h e   e x a m p l e   b e l o w . < / s p a n > < / p >  
 < p r e   c l a s s = " b r u s h :   h t m l " > & l t ; B u t t o n   H o r i z o n t a l A l i g n m e n t = & q u o t ; C e n t e r & q u o t ;  
         C l i c k = & q u o t ; B u t t o n _ C l i c k & q u o t ;  
         C o n t e n t = & q u o t ; T e s t & q u o t ; & g t ;  
         & l t ; B u t t o n . K e y b o a r d A c c e l e r a t o r s & g t ;  
                 & l t ; K e y b o a r d A c c e l e r a t o r   K e y = & q u o t ; T & q u o t ;   / & g t ;  
         & l t ; / B u t t o n . K e y b o a r d A c c e l e r a t o r s & g t ;  
 & l t ; / B u t t o n & g t ;  
 < / p r e >  
 < p > A   k e y b o a r d   i s   i n d i s p e n s a b l e   f o r   u s e r s   w i t h   c e r t a i n   d i s a b i l i t i e s   ( s e e   K e y b o a r d   a c c e s s i b i l i t y ) ,   a n d   i s   a l s o   a n   i m p o r t a n t   t o o l   f o r   u s e r s   w h o   p r e f e r   i t   a s   a   m o r e   e f f i c i e n t   w a y   t o   i n t e r a c t   w i t h   a n   a p p . < / p >  
 < h 3 > C o n t e n t D i a l o g & # 1 6 0 ; < / h 3 >  
 < p > C o n t e n t D i a l o g   c o n t r o l s   i n   W i n U I 3   a n d   U W P   a r e   m o d a l   U I   o v e r l a y s   t h a t   p r o v i d e   c o n t e x t u a l   a p p   i n f o r m a t i o n .   T h e y   b l o c k   i n t e r a c t i o n s   w i t h   t h e   a p p   w i n d o w   u n t i l   b e i n g   e x p l i c i t l y   d i s m i s s e d .   T h e y   o f t e n   r e q u e s t   s o m e   k i n d   o f   a c t i o n   f r o m   t h e   u s e r .   T h e y   r e p l a c e   t h e   M e s s a g e B o x   f r o m   W i n d o w s   F o r m s   a n d   W P F . < / p >  
 < p > < i m g   s r c = " h t t p s : / / w w w . r e f l e c t i o n i t . n l / I m a g e s / B l o g / X A M L / C o n t e n t D i a l o g / C o n f i r m C o n t e n t D i a l o g . p n g "   a l t = " W i n U I   X A M L   w i t h   n o r m a l   R o w   a n d   C o l u m n   D e f i n i t i o n s "   w i d t h = " 4 2 0 "   / > < / p >  
 < p > Y o u   c a n   c r e a t e   t h e   a b o v e   C o n t e n t D i a l o g   u s i n g   c o d e . < / p >  
 < p r e   c l a s s = " b r u s h :   c s h a r p " > p r i v a t e   a s y n c   v o i d   B u t t o n _ C l i c k ( o b j e c t   s e n d e r ,   R o u t e d E v e n t A r g s   e )   {  
         v a r   c o n f i r m D i a l o g   =   n e w   C o n t e n t D i a l o g   {  
                 T i t l e   =   & q u o t ; C o n f i r m & q u o t ; ,  
                 P r i m a r y B u t t o n T e x t   =   & q u o t ; Y e s & q u o t ; ,  
                 S e c o n d a r y B u t t o n T e x t   =   & q u o t ; N o & q u o t ; ,  
                 C l o s e B u t t o n T e x t   =   & q u o t ; C a n c e l & q u o t ; ,  
                 C o n t e n t   =   & q u o t ; A r e   y o u   s u r e   y o u   w a n t   t h i s ? & q u o t ; ,  
         } ;  
         v a r   r e s u l t   =   a w a i t   c o n f i r m D i a l o g . S h o w A s y n c ( ) ;  
  
         ( s e n d e r   a s   B u t t o n ) . C o n t e n t   =   r e s u l t . T o S t r i n g ( ) ;  
 }  
 < / p r e >  
 < p > Y o u   c a n   a l s o   a d d   a   C o n f i r m D i a l o g   t o   y o u r   p r o j e c t   w h i c h   m a k e s   i t   e a s i e r   c r e a t e   a   m o r e   c o m p l e x   c o n t e n t .   T h e   f o l l o w i n g   C o n f i r m C o n t e n t D i a l o g   u s i n g   t h e   C o n t e n t D i a l o g   I t e m   T e m p l a t e .   T h i s   t e m p l a t e   i s   < a   h r e f = " h t t p s : / / g i t h u b . c o m / m i c r o s o f t / m i c r o s o f t - u i - x a m l / i s s u e s / 6 5 8 3 " > m i s s i n g < / a >   i n   W i n U I .   Y o u   c a n   w o r k a r o u n d   t h i s   b y   c o p i n g   a   U W P   C o n t e n t D i a l o g . x a m l   i n t o   y o u r   W i n U I   p r o j e c t   a n d   t h e n   r e n a m e   t h e   n a m e s p a c e   W i n d o w s . U I . *   t o   M i c r o s o f t . U I . * . < / p >  
 < p r e   c l a s s = " b r u s h :   h t m l " > & l t ; C o n t e n t D i a l o g   x : C l a s s = & q u o t ; C o n t e n t D i a l o g D e m o U W P . C o n f i r m C o n t e n t D i a l o g & q u o t ;  
                               x m l n s = & q u o t ; h t t p : / / s c h e m a s . m i c r o s o f t . c o m / w i n f x / 2 0 0 6 / x a m l / p r e s e n t a t i o n & q u o t ;  
                               x m l n s : x = & q u o t ; h t t p : / / s c h e m a s . m i c r o s o f t . c o m / w i n f x / 2 0 0 6 / x a m l & q u o t ;  
                               T i t l e = & q u o t ; C o n f i r m & q u o t ;  
                               C l o s e B u t t o n T e x t = & q u o t ; C a n c e l & q u o t ;  
                               P r i m a r y B u t t o n T e x t = & q u o t ; Y e s & q u o t ;  
                               S e c o n d a r y B u t t o n T e x t = & q u o t ; N o & q u o t ; & g t ;  
         & l t ; G r i d & g t ;  
                 & l t ; T e x t B l o c k   T e x t = & q u o t ; A r e   y o u   s u r e   y o u   w a n t   t h i s ? & q u o t ;   / & g t ;  
         & l t ; / G r i d & g t ;  
 & l t ; / C o n t e n t D i a l o g & g t ;  
 < / p r e >  
 < p > Y o u   c a n   s h o w   t h i s   C o n f i r m C o n t e n t D i a l o g   u s i n g   t h e   S h o w A s y n c ( )   m e t h o d .   T h e   r e s u l t   ( W h i c h   a c t i o n   b u t t o n   w a s   c l i c k e d :   P r i m a r y ,   S e c o n d a r y   o r   C l o s e   ( N o n e ) )   i s   t h e n   p l a c e d   i n   t h e   C o n t e n t   o f   t h e   B u t t o n   w h i c h   o p e n e d   t h e   c o n t e n t   d i a l o g . < / p >  
 < p r e   c l a s s = " b r u s h :   c s h a r p " > p r i v a t e   a s y n c   v o i d   B u t t o n _ C l i c k ( o b j e c t   s e n d e r ,   R o u t e d E v e n t A r g s   e )   {  
         v a r   c o n f i r m D i a l o g   =   n e w   C o n f i r m C o n t e n t D i a l o g ( ) ;  
         v a r   r e s u l t   =   a w a i t   c o n f i r m D i a l o g . S h o w A s y n c ( ) ;  
  
         ( s e n d e r   a s   B u t t o n ) . C o n t e n t   =   r e s u l t . T o S t r i n g ( ) ;  
 }  
 < / p r e >  
 < p > < s p a n   s t y l e = " f o n t - s i z e :   1 e m ; " > A   C o n t e n t D i a l o g   c a n   h a v e   3   b u t t o n s :   P r i m a r y ,   S e c o n d a r y   a n d   C l o s e .   T h e   C l o s e   b u t t o n   h a s   a l w a y s   t h e   E s c a p e   a s   a c c e s s   k e y .   T h e   P r i m a r y   a n d   S e c o n d a r y   h a v e   n o n e .   T h e r e   i s   n o   e a s y   w a y   t o   s e t   t h e m .   T h e r e   i s   o n l y   a   T e x t   a n d   a   S t y l e   p r o p e r t y   f o r   e a c h   b u t t o n   i n   t h e   C o n t e n t D i a l o g .   T h e   P r i m a r y K e y b o a r d A c c e l e r a t o r s   a n d   S e c o n d a r y K e y b o a r d A c c e l e r a t o r s   p r o p e r t i e s   a r e   j u s t   n o t   t h e r e .   I   t h o u g h t   I   c o u l d   & a p o s ; f i x & a p o s ;   t h i s   b y   s e t t i n g   t h e   K e y b o a r d A c c e l e r a t o r s   p r o p e r t y   u s i n g   t h e   S t y l e   t h e   B u t t o n .   U n f o r t u n a t l y   t h a t   d i d n & a p o s ; t   w o r k   b e c a u s e   t h i s   K e y b o a r d A c c e l e r a t o r s   p r o p e r t y   i s   n o t   a   D e p e n d e n c y P r o p e r t y .   O n l y   D e p e n d e n c y P r o p e r t y   c a n   b e   s e t   i n   a   S t y l e .   I   a l r e a d y   c r e a t e d   t h i s   < / s p a n > < a   s t y l e = " f o n t - s i z e :   1 e m ; "   h r e f = " h t t p s : / / g i t h u b . c o m / m i c r o s o f t / m i c r o s o f t - u i - x a m l / i s s u e s / 6 6 7 2 " > i s s u e < / a > < s p a n   s t y l e = " f o n t - s i z e :   1 e m ; " >   t o   g e t   t h i s   f i x e d   i n   W i n U I 3 . < / s p a n > < / p >  
 < h 3 > & # 1 6 0 ; S o l u t i o n < / h 3 >  
 < p > T h e   s o l u t i o n   I   f o u n d   i s   q u i t e   s i m p l e .   I n   X A M L   y o u   c a n   c r e a t e   a t t a c h t e d   p r o p e r t i e s . & # 1 6 0 ; A n   a t t a c h e d   p r o p e r t y   i s   a   E x t e n s i b l e   A p p l i c a t i o n   M a r k u p   L a n g u a g e   ( X A M L )   c o n c e p t .   A t t a c h e d   p r o p e r t i e s   e n a b l e   e x t r a   p r o p e r t y / v a l u e   p a i r s   t o   b e   s e t   o n   a n y   X A M L   e l e m e n t   t h a t   d e r i v e s   f r o m & # 1 6 0 ; < a   c l a s s = " n o - l o c "   h r e f = " h t t p s : / / d o c s . m i c r o s o f t . c o m / e n - u s / d o t n e t / a p i / s y s t e m . w i n d o w s . d e p e n d e n c y o b j e c t "   d a t a - l i n k t y p e = " a b s o l u t e - p a t h " > D e p e n d e n c y O b j e c t < / a > ,   e v e n   t h o u g h   t h e   e l e m e n t   d o e s n & a p o s ; t   d e f i n e   t h o s e   e x t r a   p r o p e r t i e s   i n   i t s   o b j e c t   m o d e l .   T h e   a t t a c h e d   p r o p e r t i e s   c a n   b e   u s e d   i n   t h e   S t y l e   w h i c h   a l l o w s   m e   t o   s e t   t h e   K e y b o a r d A c c e l e r a t o r s   f o r   t h e   B u t t o n s . < / p >  
 < p > I   c r e a t e d   a   K e y b o a r d A c c e l e r a t o r   a n d   K e y b o a r d A c c e l e r a t o r s   a t t a c h e d   p r o p e r t i e s   i n   m y   K e y b o a r d A c c e l e r a t o r s S e r v i c e s   c l a s s .   T h e   f i r s t   o n e   i s   u s e d   i f   y o u   o n l y   n e e d   o n e   K e y b o a r d A c c e l e r a t o r .   T h e   s e c o n d   o n e   i f   y o u   n e e d   m o r e   t h a n   o n e .   T h e   O n K e y b o a r d A c c e l e r a t o r C h a n g e d ( )   a n d   O n K e y b o a r d A c c e l e r a t o r s C h a n g e d ( )   m e t h o d s   a d d   t h e   K e y b o a r d A c c e l e r a t o r ( s )   t o   t h e   B u t t o n . < / p >  
 < p r e   c l a s s = " b r u s h :   c s h a r p " > u s i n g   S y s t e m . C o l l e c t i o n s . G e n e r i c ;  
 u s i n g   W i n d o w s . U I . X a m l ;  
 u s i n g   W i n d o w s . U I . X a m l . I n p u t ;  
  
 n a m e s p a c e   C o n t e n t D i a l o g D e m o U W P . H e l p e r s   {  
  
         p u b l i c   c l a s s   K e y b o a r d A c c e l e r a t o r s S e r v i c e s   {  
  
                 # r e g i o n   K e y b o a r d A c c e l e r a t o r   A t t a c h e d   P r o p e r t y  
  
                 / / /   & l t ; s u m m a r y & g t ;    
                 / / /   I d e n t i f i e s   t h e   K e y b o a r d A c c e l e r a t o r   a t t a c h t e d   p r o p e r t y .   T h i s   e n a b l e s   a n i m a t i o n ,   s t y l i n g ,   b i n d i n g ,   e t c . . .  
                 / / /   & l t ; / s u m m a r y & g t ;  
                 p u b l i c   s t a t i c   r e a d o n l y   D e p e n d e n c y P r o p e r t y   K e y b o a r d A c c e l e r a t o r P r o p e r t y   =  
                         D e p e n d e n c y P r o p e r t y . R e g i s t e r A t t a c h e d ( & q u o t ; K e y b o a r d A c c e l e r a t o r & q u o t ; ,  
                                                                                                 t y p e o f ( K e y b o a r d A c c e l e r a t o r ) ,  
                                                                                                 t y p e o f ( K e y b o a r d A c c e l e r a t o r s S e r v i c e s ) ,  
                                                                                                 n e w   P r o p e r t y M e t a d a t a ( d e f a u l t ( K e y b o a r d A c c e l e r a t o r ) ,   O n K e y b o a r d A c c e l e r a t o r C h a n g e d ) ) ;  
  
                 / / /   & l t ; s u m m a r y & g t ;  
                 / / /   K e y b o a r d A c c e l e r a t o r   c h a n g e d   h a n d l e r .    
                 / / /   & l t ; / s u m m a r y & g t ;  
                 / / /   & l t ; p a r a m   n a m e = & q u o t ; d & q u o t ; & g t ; U I E l e m e n t   t h a t   c h a n g e d   i t s   K e y b o a r d A c c e l e r a t o r   a t t a c h e d   p r o p e r t y . & l t ; / p a r a m & g t ;  
                 / / /   & l t ; p a r a m   n a m e = & q u o t ; e & q u o t ; & g t ; D e p e n d e n c y P r o p e r t y C h a n g e d E v e n t A r g s   w i t h   t h e   n e w   a n d   o l d   v a l u e . & l t ; / p a r a m & g t ;    
                 p r i v a t e   s t a t i c   v o i d   O n K e y b o a r d A c c e l e r a t o r C h a n g e d ( D e p e n d e n c y O b j e c t   d ,   D e p e n d e n c y P r o p e r t y C h a n g e d E v e n t A r g s   e )   {  
                         i f   ( d   i s   U I E l e m e n t   s o u r c e )   {  
                                 i f   ( e . N e w V a l u e   i s   K e y b o a r d A c c e l e r a t o r   v a l u e )   {  
                                         s o u r c e . K e y b o a r d A c c e l e r a t o r s . A d d ( v a l u e ) ;  
                                 }  
                         }  
                 }  
  
                 / / /   & l t ; s u m m a r y & g t ;  
                 / / /   G e t s   t h e   v a l u e   o f   t h e   K e y b o a r d A c c e l e r a t o r   a t t a c h e d   p r o p e r t y   f r o m   t h e   s p e c i f i e d   F r a m e w o r k E l e m e n t   .  
                 / / /   & l t ; / s u m m a r y & g t ;  
                 p u b l i c   s t a t i c   K e y b o a r d A c c e l e r a t o r   G e t K e y b o a r d A c c e l e r a t o r ( D e p e n d e n c y O b j e c t   o b j )   {  
                         r e t u r n   ( K e y b o a r d A c c e l e r a t o r ) o b j . G e t V a l u e ( K e y b o a r d A c c e l e r a t o r P r o p e r t y ) ;  
                 }  
  
  
                 / / /   & l t ; s u m m a r y & g t ;  
                 / / /   S e t s   t h e   v a l u e   o f   t h e   K e y b o a r d A c c e l e r a t o r   a t t a c h e d   p r o p e r t y   t o   t h e   s p e c i f i e d   F r a m e w o r k E l e m e n t   .  
                 / / /   & l t ; / s u m m a r y & g t ;  
                 / / /   & l t ; p a r a m   n a m e = & q u o t ; o b j & q u o t ; & g t ; T h e   o b j e c t   o n   w h i c h   t o   s e t   t h e   K e y b o a r d A c c e l e r a t o r   a t t a c h e d   p r o p e r t y . & l t ; / p a r a m & g t ;  
                 / / /   & l t ; p a r a m   n a m e = & q u o t ; v a l u e & q u o t ; & g t ; T h e   p r o p e r t y   v a l u e   t o   s e t . & l t ; / p a r a m & g t ;  
                 p u b l i c   s t a t i c   v o i d   S e t K e y b o a r d A c c e l e r a t o r ( D e p e n d e n c y O b j e c t   o b j ,   K e y b o a r d A c c e l e r a t o r   v a l u e )   {  
                         o b j . S e t V a l u e ( K e y b o a r d A c c e l e r a t o r P r o p e r t y ,   v a l u e ) ;  
                 }  
  
                 # e n d r e g i o n   K e y b o a r d A c c e l e r a t o r   A t t a c h e d   P r o p e r t y  
  
                 # r e g i o n   K e y b o a r d A c c e l e r a t o r s   A t t a c h e d   P r o p e r t y  
  
                 / / /   & l t ; s u m m a r y & g t ;    
                 / / /   I d e n t i f i e s   t h e   K e y b o a r d A c c e l e r a t o r s   a t t a c h t e d   p r o p e r t y .   T h i s   e n a b l e s   a n i m a t i o n ,   s t y l i n g ,   b i n d i n g ,   e t c . . .  
                 / / /   & l t ; / s u m m a r y & g t ;  
                 p u b l i c   s t a t i c   r e a d o n l y   D e p e n d e n c y P r o p e r t y   K e y b o a r d A c c e l e r a t o r s P r o p e r t y   =  
                         D e p e n d e n c y P r o p e r t y . R e g i s t e r A t t a c h e d ( & q u o t ; K e y b o a r d A c c e l e r a t o r s & q u o t ; ,  
                                                                                                 t y p e o f ( I L i s t & l t ; K e y b o a r d A c c e l e r a t o r & g t ; ) ,  
                                                                                                 t y p e o f ( K e y b o a r d A c c e l e r a t o r s S e r v i c e s ) ,  
                                                                                                 n e w   P r o p e r t y M e t a d a t a ( d e f a u l t ,   O n K e y b o a r d A c c e l e r a t o r s C h a n g e d ) ) ;  
  
                 / / /   & l t ; s u m m a r y & g t ;  
                 / / /   K e y b o a r d A c c e l e r a t o r s   c h a n g e d   h a n d l e r .    
                 / / /   & l t ; / s u m m a r y & g t ;  
                 / / /   & l t ; p a r a m   n a m e = & q u o t ; d & q u o t ; & g t ; U I E l e m e n t   t h a t   c h a n g e d   i t s   K e y b o a r d A c c e l e r a t o r s   a t t a c h e d   p r o p e r t y . & l t ; / p a r a m & g t ;  
                 / / /   & l t ; p a r a m   n a m e = & q u o t ; e & q u o t ; & g t ; D e p e n d e n c y P r o p e r t y C h a n g e d E v e n t A r g s   w i t h   t h e   n e w   a n d   o l d   v a l u e . & l t ; / p a r a m & g t ;    
                 p r i v a t e   s t a t i c   v o i d   O n K e y b o a r d A c c e l e r a t o r s C h a n g e d ( D e p e n d e n c y O b j e c t   d ,   D e p e n d e n c y P r o p e r t y C h a n g e d E v e n t A r g s   e )   {  
                         i f   ( d   i s   U I E l e m e n t   s o u r c e )   {  
                                 i f   ( e . N e w V a l u e   i s   I L i s t & l t ; K e y b o a r d A c c e l e r a t o r & g t ;   v a l u e )   {  
                                         f o r e a c h   ( v a r   i t e m   i n   v a l u e )   {  
                                                 s o u r c e . K e y b o a r d A c c e l e r a t o r s . A d d ( i t e m ) ;  
                                         }  
                                 }  
                         }  
                 }  
  
                 / / /   & l t ; s u m m a r y & g t ;  
                 / / /   G e t s   t h e   v a l u e   o f   t h e   K e y b o a r d A c c e l e r a t o r s   a t t a c h e d   p r o p e r t y   f r o m   t h e   s p e c i f i e d   F r a m e w o r k E l e m e n t .  
                 / / /   & l t ; / s u m m a r y & g t ;  
                 p u b l i c   s t a t i c   o b j e c t   G e t K e y b o a r d A c c e l e r a t o r s ( D e p e n d e n c y O b j e c t   o b j )   {  
                         r e t u r n   ( o b j e c t ) o b j . G e t V a l u e ( K e y b o a r d A c c e l e r a t o r s P r o p e r t y ) ;  
                 }  
  
                 / / /   & l t ; s u m m a r y & g t ;  
                 / / /   S e t s   t h e   v a l u e   o f   t h e   K e y b o a r d A c c e l e r a t o r s   a t t a c h e d   p r o p e r t y   t o   t h e   s p e c i f i e d   F r a m e w o r k E l e m e n t .  
                 / / /   & l t ; / s u m m a r y & g t ;  
                 / / /   & l t ; p a r a m   n a m e = & q u o t ; o b j & q u o t ; & g t ; T h e   o b j e c t   o n   w h i c h   t o   s e t   t h e   K e y b o a r d A c c e l e r a t o r s   a t t a c h e d   p r o p e r t y . & l t ; / p a r a m & g t ;  
                 / / /   & l t ; p a r a m   n a m e = & q u o t ; v a l u e & q u o t ; & g t ; T h e   p r o p e r t y   v a l u e   t o   s e t . & l t ; / p a r a m & g t ;  
                 p u b l i c   s t a t i c   v o i d   S e t K e y b o a r d A c c e l e r a t o r s ( D e p e n d e n c y O b j e c t   o b j ,   o b j e c t   v a l u e )   {  
                         o b j . S e t V a l u e ( K e y b o a r d A c c e l e r a t o r s P r o p e r t y ,   v a l u e ) ;  
                 }  
  
                 # e n d r e g i o n   K e y b o a r d A c c e l e r a t o r s   A t t a c h e d   P r o p e r t y  
         }  
  
         p u b l i c   c l a s s   K e y b o a r d A c c e l e r a t o r L i s t   :   L i s t & l t ; K e y b o a r d A c c e l e r a t o r & g t ;   {  
         }  
 }  
 < / p r e >  
 < p > I   c a n   n o w   c r e a t e   a   S t y l e   f o r   t h e   P r i m a r y   a n d   S e c o n d a r y   b u t t o n s   i n   t h e   C o n t e n t D i a l o g .   I n   t h i s   S t y l e   I   c a n   u s e   t h e   a t t a c h e d   p r o p e r t i e s   t o   s e t   t h e   K e y b o a r d A c c e l e r a t o r .   T h e   P r i m a r y B u t t o n   ( Y e s )   h a s   t w o   K e y b o a r d A c c e l e r a t o r s   ( l i n e s   1 1 - 1 8 ) .   O n e   f o r   t h e   Y   k e y   a n d   a n o t h e r   o n e   f o r   t h e   J   k e y   ( j u s t   f o r   d e m o   p u r p o s e ) .   T h e   S e c o n d a r y B u t t o n   ( N o )   h a s   o n l y   o n e   f o r   t h e   N   k e y   ( l i n e s   2 3 - 2 7 ) .   I   a l s o   h a d   t o   a d d   t h e   x m l   n a m e s p a c e   < s t r o n g > h e l p e r s < / s t r o n g >   t o   t h e   C o n t e n t D i a l o g   e l e m e n t ,   l i n e   4 . < / p >  
 < p r e   c l a s s = " b r u s h :   h t m l " > & l t ; C o n t e n t D i a l o g   x : C l a s s = & q u o t ; C o n t e n t D i a l o g D e m o U W P . C o n f i r m C o n t e n t D i a l o g & q u o t ;  
                               x m l n s = & q u o t ; h t t p : / / s c h e m a s . m i c r o s o f t . c o m / w i n f x / 2 0 0 6 / x a m l / p r e s e n t a t i o n & q u o t ;  
                               x m l n s : x = & q u o t ; h t t p : / / s c h e m a s . m i c r o s o f t . c o m / w i n f x / 2 0 0 6 / x a m l & q u o t ;  
                               x m l n s : h e l p e r s = & q u o t ; u s i n g : C o n t e n t D i a l o g D e m o U W P . H e l p e r s & q u o t ;  
                               T i t l e = & q u o t ; C o n f i r m & q u o t ;  
                               C l o s e B u t t o n T e x t = & q u o t ; C a n c e l & q u o t ;  
                               P r i m a r y B u t t o n T e x t = & q u o t ; Y e s & q u o t ;  
                               S e c o n d a r y B u t t o n T e x t = & q u o t ; N o & q u o t ; & g t ;  
         & l t ; C o n t e n t D i a l o g . P r i m a r y B u t t o n S t y l e & g t ;  
                 & l t ; S t y l e   B a s e d O n = & q u o t ; { S t a t i c R e s o u r c e   A c c e n t B u t t o n S t y l e } & q u o t ;   T a r g e t T y p e = & q u o t ; B u t t o n & q u o t ; & g t ;  
                         & l t ; S e t t e r   P r o p e r t y = & q u o t ; h e l p e r s : K e y b o a r d A c c e l e r a t o r s S e r v i c e s . K e y b o a r d A c c e l e r a t o r s & q u o t ; & g t ;  
                                 & l t ; S e t t e r . V a l u e & g t ;  
                                         & l t ; h e l p e r s : K e y b o a r d A c c e l e r a t o r L i s t & g t ;  
                                                 & l t ; K e y b o a r d A c c e l e r a t o r   K e y = & q u o t ; Y & q u o t ;   / & g t ;  
                                                 & l t ; K e y b o a r d A c c e l e r a t o r   K e y = & q u o t ; J & q u o t ;   / & g t ;  
                                         & l t ; / h e l p e r s : K e y b o a r d A c c e l e r a t o r L i s t & g t ;  
                                 & l t ; / S e t t e r . V a l u e & g t ;  
                         & l t ; / S e t t e r & g t ;  
                 & l t ; / S t y l e & g t ;  
         & l t ; / C o n t e n t D i a l o g . P r i m a r y B u t t o n S t y l e & g t ;  
         & l t ; C o n t e n t D i a l o g . S e c o n d a r y B u t t o n S t y l e & g t ;  
                 & l t ; S t y l e   T a r g e t T y p e = & q u o t ; B u t t o n & q u o t ; & g t ;  
                         & l t ; S e t t e r   P r o p e r t y = & q u o t ; h e l p e r s : K e y b o a r d A c c e l e r a t o r s S e r v i c e s . K e y b o a r d A c c e l e r a t o r & q u o t ; & g t ;  
                                 & l t ; S e t t e r . V a l u e & g t ;  
                                         & l t ; K e y b o a r d A c c e l e r a t o r   K e y = & q u o t ; N & q u o t ;   / & g t ;  
                                 & l t ; / S e t t e r . V a l u e & g t ;  
                         & l t ; / S e t t e r & g t ;  
                 & l t ; / S t y l e & g t ;  
         & l t ; / C o n t e n t D i a l o g . S e c o n d a r y B u t t o n S t y l e & g t ;  
         & l t ; G r i d & g t ;  
                 & l t ; T e x t B l o c k   T e x t = & q u o t ; A r e   y o u   s u r e   y o u   w a n t   t h i s ? & q u o t ;   / & g t ;  
         & l t ; / G r i d & g t ;  
 & l t ; / C o n t e n t D i a l o g & g t ;  
 < / p r e >  
 < p > A n d   t h a t & # 8 2 1 7 ; s   i t   & # 8 2 1 1 ;   t h e   u s e r   c a n   n o w   u s e   t h e   Y ,   J   o r   N   k e y s   t o   s e l e c t   t h e   c o r r e c t   a c t i o n .   T h e   s a m p l e   p r o j e c t s   ( U W P   a n d   W i n U I 3 )   a r e   a v a i l a b l e   o n   < a   h r e f = " h t t p s : / / g i t h u b . c o m / s o n n e m a f / C o n t e n t D i a l o g W i t h K e y b o a r d A c c e l e r a t o r s " > G i t H u b < / a >   f o r   f u l l   s o u r c e   c o d e . < / p > < / b o d y > < / h t m l > ] ] > < / c o n t e n t : e n c o d e d >  
         < / i t e m >  
         < i t e m >  
             < t i t l e > X A M L   i n l i n e   R o w D e f i n i t i o n s   a n d   C o l u m n D e f i n i t i o n s < / t i t l e >  
             < l i n k > h t t p s : / / w w w . r e f l e c t i o n i t . n l / b l o g / 2 0 2 1 / x a m l - i n l i n e - r o w d e f i n i t i o n s - a n d - c o l u m n d e f i n i t i o n s < / l i n k >  
             < d e s c r i p t i o n   / >  
             < a u t h o r > f o n s . s o n n e m a n s @ r e f l e c t i o n i t . n l   ( F o n s   S o n n e m a n s ) < / a u t h o r >  
             < c a t e g o r y > X A M L < / c a t e g o r y >  
             < c a t e g o r y > U W P < / c a t e g o r y >  
             < c a t e g o r y > W P F < / c a t e g o r y >  
             < c a t e g o r y > W i n U I 3 < / c a t e g o r y >  
             < c a t e g o r y > W i n d o w s A p p S D K < / c a t e g o r y >  
             < g u i d > h t t p s : / / w w w . r e f l e c t i o n i t . n l / b l o g / 2 0 2 1 / x a m l - i n l i n e - r o w d e f i n i t i o n s - a n d - c o l u m n d e f i n i t i o n s < / g u i d >  
             < p u b D a t e > W e d ,   0 1   D e c   2 0 2 1   0 0 : 0 0 : 0 0   G M T < / p u b D a t e >  
             < c o n t e n t : e n c o d e d > < ! [ C D A T A [ < h t m l > < b o d y > < p > I n   t h e   X A M L   o f   < a   h r e f = " h t t p s : / / d o c s . m i c r o s o f t . c o m / e n - u s / w i n d o w s / a p p s / w i n u i / w i n u i 3 / " > W i n U I 3 < / a >   a p p s   y o u   c a n   u s e   t h e   i n l i n e   s y n t a x   f o r   c r e a t i n g   R o w s   a n d   C o l u m n s   i n s i d e   a   G r i d .   T h i s   i s   a   f e a t u r e   w h i c h   < a   h r e f = " h t t p s : / / a v a l o n i a u i . n e t / " > A v a l o n i a < / a > & # 1 6 0 ; h a d   f o r   a   l o n g   t i m e .   I t   i s   m o r e   c o m p a c t   a n d   w o r k s   f i n e   a s   l o n g   a s   y o u   d o n & a p o s ; t   n e e d   a   M a x   o r   M i n   W i d t h / H e i g h t . < / p >  
 < p > T h e   f o l l o w i n g   s c r e e n s h o t   s h o w s   y o u   a   G r i d   w i t h   2   R o w s   a n d   C o l u m n s .   B o t h   i n   e q u a l   s i z e .   U s i n g   4   R e c t a n g l e   e l e m e n t s   I   c r e a t e d   t h e   M i c r o s o f t   l o g o   i n s i d e   t h i s   G r i d . < / p >  
 < p > < i m g   s r c = " h t t p s : / / w w w . r e f l e c t i o n i t . n l / I m a g e s / B l o g / X A M L / I n l i n e R o w C o l u m n D e f i n i t i o n s / W i n U I R o w C o l u m n D e f i n i t i o n s . p n g "   a l t = " W i n U I   X A M L   w i t h   n o r m a l   R o w   a n d   C o l u m n   D e f i n i t i o n s "   w i d t h = " 6 0 0 "   / > < / p >  
 < p > T h e   f o l l o w i n g   s c r e e n s h o t   s h o w s   y o u   t h e   s a m e   G r i d   b u t   n o w   w i t h   i n l i n e   R o w D e f i n i t i o n s   a n d   C o l u m n D e f i n i t i o n s .   I t   s a v e s   y o u   a   f e w   l i n e s   o f   X A M L . < / p >  
 < p > < i m g   s r c = " h t t p s : / / w w w . r e f l e c t i o n i t . n l / I m a g e s / B l o g / X A M L / I n l i n e R o w C o l u m n D e f i n i t i o n s / W i n U I I n l i n e R o w C o l u m n D e f i n i t i o n s . p n g "   a l t = " W i n U I   X A M L   w i t h   i n l i n e   R o w   a n d   C o l u m n   D e f i n i t i o n s "   w i d t h = " 6 0 0 "   / > < / p >  
 < h 3 > U W P   S u p p o r t < / h 3 >  
 < p > T h i s   i n l i n e   s y n t a x   i s   o n l y   a v a i l a b l e   i n   W i n U I 3 ,   n o t   i n   W P F   o r   U W P .   L u c k e l y   w e   c a n   c r e a t e   a   s i m i l a r   s o l u t i o n   u s i n g   A t t a c h e d   P r o p e r t i e s .   S o ,   I   c r e a t e d   f o r   m y   U W P   p r o j e c t s   a   h e l p e r   c l a s s   c a l l e d   G r i d   w i t h   t h e   t w o   a t t a c h e d   P r o p e r t i e s :   R o w D e f i n i t i o n s   a n d   C o l u m n D e f i n i t i o n s . < / p >  
 < p r e   c l a s s = " b r u s h :   c s h a r p " > u s i n g   S y s t e m ;  
 u s i n g   W i n d o w s . U I . X a m l ;  
 u s i n g   W i n d o w s . U I . X a m l . M a r k u p ;  
  
 n a m e s p a c e   R e f l e c t i o n I T . U n i v e r s a l . H e l p e r s   {  
  
         / / /   & l t ; s u m m a r y & g t ;  
         / / /   & l t ; G r i d   h e l p e r s : G r i d . R o w D e f i n i t i o n s = & q u o t ; 1 * ,   5 0 ,   A u t o , 2 * & q u o t ;  
         / / /               h e l p e r s : G r i d . C o l u m n D e f i n i t i o n s = & q u o t ; 1 . 5 * , 5 0 , A u t o , 2 . 5 * & q u o t ;   . . .  
         / / /   & l t ; / s u m m a r y & g t ;  
         p u b l i c   c l a s s   G r i d   {  
  
                 # r e g i o n   C o l u m n D e f i n i t i o n s   A t t a c h e d   P r o p e r t y  
  
                 / / /   & l t ; s u m m a r y & g t ;    
                 / / /   I d e n t i f i e s   t h e   C o l u m n D e f i n i t i o n s   a t t a c h t e d   p r o p e r t y .   T h i s   e n a b l e s   a n i m a t i o n ,   s t y l i n g ,   b i n d i n g ,   e t c . . .  
                 / / /   & l t ; / s u m m a r y & g t ;  
                 p u b l i c   s t a t i c   r e a d o n l y   D e p e n d e n c y P r o p e r t y   C o l u m n D e f i n i t i o n s P r o p e r t y   =  
                         D e p e n d e n c y P r o p e r t y . R e g i s t e r A t t a c h e d ( & q u o t ; C o l u m n D e f i n i t i o n s & q u o t ; ,  
                                                                                                 t y p e o f ( s t r i n g ) ,  
                                                                                                 t y p e o f ( G r i d ) ,  
                                                                                                 n e w   P r o p e r t y M e t a d a t a ( d e f a u l t ( s t r i n g ) ,   O n C o l u m n D e f i n i t i o n s C h a n g e d ) ) ;  
  
                 / / /   & l t ; s u m m a r y & g t ;  
                 / / /   C o l u m n D e f i n i t i o n s   c h a n g e d   h a n d l e r .    
                 / / /   & l t ; / s u m m a r y & g t ;  
                 / / /   & l t ; p a r a m   n a m e = & q u o t ; d & q u o t ; & g t ; G r i d   t h a t   c h a n g e d   i t s   C o l u m n D e f i n i t i o n s   a t t a c h e d   p r o p e r t y . & l t ; / p a r a m & g t ;  
                 / / /   & l t ; p a r a m   n a m e = & q u o t ; e & q u o t ; & g t ; D e p e n d e n c y P r o p e r t y C h a n g e d E v e n t A r g s   w i t h   t h e   n e w   a n d   o l d   v a l u e . & l t ; / p a r a m & g t ;    
                 p r i v a t e   s t a t i c   v o i d   O n C o l u m n D e f i n i t i o n s C h a n g e d ( D e p e n d e n c y O b j e c t   d ,   D e p e n d e n c y P r o p e r t y C h a n g e d E v e n t A r g s   e )   {  
                         i f   ( d   i s   W i n d o w s . U I . X a m l . C o n t r o l s . G r i d   s o u r c e )   {  
                                 i f   ( s o u r c e . C o l u m n D e f i n i t i o n s ? . C o u n t   = =   0 )   {  
                                         v a r   v a l u e   =   ( s t r i n g ) e . N e w V a l u e ;  
                                         v a r   a   =   v a l u e . S p l i t ( & a p o s ; , & a p o s ; ) ;  
                                         f o r e a c h   ( v a r   t e x t   i n   a )   {  
                                                 s o u r c e . C o l u m n D e f i n i t i o n s . A d d ( n e w   W i n d o w s . U I . X a m l . C o n t r o l s . C o l u m n D e f i n i t i o n   {  
                                                         W i d t h   =   C r e a t e G r i d L e n g t h ( t e x t ) ,  
                                                 } ) ;  
                                         }  
                                 }  
                         }  
                 }  
  
                 / / /   & l t ; s u m m a r y & g t ;  
                 / / /   G e t s   t h e   v a l u e   o f   t h e   C o l u m n D e f i n i t i o n s   a t t a c h e d   p r o p e r t y   f r o m   t h e   s p e c i f i e d   W i n d o w s . U I . X a m l . C o n t r o l s . G r i d .  
                 / / /   & l t ; / s u m m a r y & g t ;  
                 p u b l i c   s t a t i c   s t r i n g   G e t C o l u m n D e f i n i t i o n s ( D e p e n d e n c y O b j e c t   o b j )   {  
                         r e t u r n   ( s t r i n g ) o b j . G e t V a l u e ( C o l u m n D e f i n i t i o n s P r o p e r t y ) ;  
                 }  
  
  
                 / / /   & l t ; s u m m a r y & g t ;  
                 / / /   S e t s   t h e   v a l u e   o f   t h e   C o l u m n D e f i n i t i o n s   a t t a c h e d   p r o p e r t y   t o   t h e   s p e c i f i e d   W i n d o w s . U I . X a m l . C o n t r o l s . G r i d .  
                 / / /   & l t ; / s u m m a r y & g t ;  
                 / / /   & l t ; p a r a m   n a m e = & q u o t ; o b j & q u o t ; & g t ; T h e   o b j e c t   o n   w h i c h   t o   s e t   t h e   C o l u m n D e f i n i t i o n s   a t t a c h e d   p r o p e r t y . & l t ; / p a r a m & g t ;  
                 / / /   & l t ; p a r a m   n a m e = & q u o t ; v a l u e & q u o t ; & g t ; T h e   p r o p e r t y   v a l u e   t o   s e t . & l t ; / p a r a m & g t ;  
                 p u b l i c   s t a t i c   v o i d   S e t C o l u m n D e f i n i t i o n s ( D e p e n d e n c y O b j e c t   o b j ,   s t r i n g   v a l u e )   {  
                         o b j . S e t V a l u e ( C o l u m n D e f i n i t i o n s P r o p e r t y ,   v a l u e ) ;  
                 }  
  
                 # e n d r e g i o n   C o l u m n D e f i n i t i o n s   A t t a c h e d   P r o p e r t y  
  
                 # r e g i o n   R o w D e f i n i t i o n s   A t t a c h e d   P r o p e r t y  
  
                 / / /   & l t ; s u m m a r y & g t ;    
                 / / /   I d e n t i f i e s   t h e   R o w D e f i n i t i o n s   a t t a c h t e d   p r o p e r t y .   T h i s   e n a b l e s   a n i m a t i o n ,   s t y l i n g ,   b i n d i n g ,   e t c . . .  
                 / / /   & l t ; / s u m m a r y & g t ;  
                 p u b l i c   s t a t i c   r e a d o n l y   D e p e n d e n c y P r o p e r t y   R o w D e f i n i t i o n s P r o p e r t y   =  
                         D e p e n d e n c y P r o p e r t y . R e g i s t e r A t t a c h e d ( & q u o t ; R o w D e f i n i t i o n s & q u o t ; ,  
                                                                                                 t y p e o f ( s t r i n g ) ,  
                                                                                                 t y p e o f ( G r i d ) ,  
                                                                                                 n e w   P r o p e r t y M e t a d a t a ( d e f a u l t ( s t r i n g ) ,   O n R o w D e f i n i t i o n s C h a n g e d ) ) ;  
  
                 / / /   & l t ; s u m m a r y & g t ;  
                 / / /   R o w D e f i n i t i o n s   c h a n g e d   h a n d l e r .    
                 / / /   & l t ; / s u m m a r y & g t ;  
                 / / /   & l t ; p a r a m   n a m e = & q u o t ; d & q u o t ; & g t ; G r i d   t h a t   c h a n g e d   i t s   R o w D e f i n i t i o n s   a t t a c h e d   p r o p e r t y . & l t ; / p a r a m & g t ;  
                 / / /   & l t ; p a r a m   n a m e = & q u o t ; e & q u o t ; & g t ; D e p e n d e n c y P r o p e r t y C h a n g e d E v e n t A r g s   w i t h   t h e   n e w   a n d   o l d   v a l u e . & l t ; / p a r a m & g t ;    
                 p r i v a t e   s t a t i c   v o i d   O n R o w D e f i n i t i o n s C h a n g e d ( D e p e n d e n c y O b j e c t   d ,   D e p e n d e n c y P r o p e r t y C h a n g e d E v e n t A r g s   e )   {  
                         i f   ( d   i s   W i n d o w s . U I . X a m l . C o n t r o l s . G r i d   s o u r c e )   {  
                                 i f   ( s o u r c e . R o w D e f i n i t i o n s ? . C o u n t   = =   0 )   {  
                                         v a r   v a l u e   =   ( s t r i n g ) e . N e w V a l u e ;  
                                         v a r   a   =   v a l u e . S p l i t ( & a p o s ; , & a p o s ; ) ;  
                                         f o r e a c h   ( v a r   i t e m   i n   a )   {  
                                                 s o u r c e . R o w D e f i n i t i o n s . A d d ( n e w   W i n d o w s . U I . X a m l . C o n t r o l s . R o w D e f i n i t i o n   {  
                                                         H e i g h t   =   C r e a t e G r i d L e n g t h ( i t e m ) ,  
                                                 } ) ;  
                                         }  
                                 }  
                         }  
                 }  
  
                 / / /   & l t ; s u m m a r y & g t ;  
                 / / /   G e t s   t h e   v a l u e   o f   t h e   R o w D e f i n i t i o n s   a t t a c h e d   p r o p e r t y   f r o m   t h e   s p e c i f i e d   G r i d   .  
                 / / /   & l t ; / s u m m a r y & g t ;  
                 p u b l i c   s t a t i c   s t r i n g   G e t R o w D e f i n i t i o n s ( D e p e n d e n c y O b j e c t   o b j )   {  
                         r e t u r n   ( s t r i n g ) o b j . G e t V a l u e ( R o w D e f i n i t i o n s P r o p e r t y ) ;  
                 }  
  
                 / / /   & l t ; s u m m a r y & g t ;  
                 / / /   S e t s   t h e   v a l u e   o f   t h e   R o w D e f i n i t i o n s   a t t a c h e d   p r o p e r t y   t o   t h e   s p e c i f i e d   G r i d   .  
                 / / /   & l t ; / s u m m a r y & g t ;  
                 / / /   & l t ; p a r a m   n a m e = & q u o t ; o b j & q u o t ; & g t ; T h e   o b j e c t   o n   w h i c h   t o   s e t   t h e   R o w D e f i n i t i o n s   a t t a c h e d   p r o p e r t y . & l t ; / p a r a m & g t ;  
                 / / /   & l t ; p a r a m   n a m e = & q u o t ; v a l u e & q u o t ; & g t ; T h e   p r o p e r t y   v a l u e   t o   s e t . & l t ; / p a r a m & g t ;  
                 p u b l i c   s t a t i c   v o i d   S e t R o w D e f i n i t i o n s ( D e p e n d e n c y O b j e c t   o b j ,   s t r i n g   v a l u e )   {  
                         o b j . S e t V a l u e ( R o w D e f i n i t i o n s P r o p e r t y ,   v a l u e ) ;  
                 }  
  
                 # e n d r e g i o n   R o w D e f i n i t i o n s   A t t a c h e d   P r o p e r t y  
  
                 p r i v a t e   s t a t i c   G r i d L e n g t h   C r e a t e G r i d L e n g t h ( s t r i n g   t e x t )   {  
                         t e x t   =   t e x t . T r i m ( ) ;  
                         r e t u r n   t e x t . L e n g t h = = 0  
                                 ?   t h r o w   n e w   X a m l P a r s e E x c e p t i o n ( & q u o t ; X A M L   p a r s i n g   f a i l e d :   E m p t y   G r i d L e n g t h   i s   n o t   a l l o w e d & q u o t ; )  
                                 :   t e x t . E n d s W i t h ( & a p o s ; * & a p o s ; )  
                                 ?   n e w   G r i d L e n g t h ( t e x t . L e n g t h   & g t ;   1   ?   d o u b l e . P a r s e ( t e x t . S u b s t r i n g ( 0 ,   t e x t . L e n g t h   -   1 ) )   :   1 ,   G r i d U n i t T y p e . S t a r )  
                                 :   t e x t . E q u a l s ( & q u o t ; a u t o & q u o t ; ,   S t r i n g C o m p a r i s o n . O r d i n a l I g n o r e C a s e )  
                                         ?   n e w   G r i d L e n g t h ( 0 D ,   G r i d U n i t T y p e . A u t o )  
                                         :   n e w   G r i d L e n g t h ( d o u b l e . P a r s e ( t e x t ) ,   G r i d U n i t T y p e . P i x e l ) ;  
                 }  
  
         }  
 }  
 < / p r e >  
 < p > Y o u   c a n   u s e   t h e s e   p r o p e r t i e s   b y   f i r s t   r e g i s t e r i n g   t h e   x m l   n a m e s p a c e   i n s i d e   y o u   X A M L .   I n   t h i s   c a s e   I   n a m e d   i t   h e l p e r s .   I n s i d e   t h e   G r i d   e l e m e n t   t h e   h e l p e r s : G r i d . C o l u m n D e f i n i t i o n s   a n d   h e l p e r s : G r i d . R o w D e f i n i t i o n s   a t t r i b u t e s   g e t   t h e   & q u o t ; 1 * , 1 * & q u o t ;   v a l u e .   Y o u   c a n   o f f   c o u r s e   n o t   o n l y   u s e   t h e   S t a r   s i z e s .   P i x e l   a n d   A u t o   a r e   a l s o   s u p p o r t e d .   F o r   e x a m p l e   t h e   v a l u e   & q u o t ; 4 0 , A u t o , * & q u o t ; .   T h e   f i r s t   o n e   i s   P i x e l   s i z e   4 0 ,   t h e   s e c o n d   o n e   i s   A u t o   a n d   t h e   l a s t   o n e   i s   1   S t a r . < / p >  
 < p r e   c l a s s = " b r u s h :   h t m l " > & l t ; P a g e  
         x : C l a s s = & q u o t ; A p p 4 4 . M a i n P a g e & q u o t ;  
         x m l n s = & q u o t ; h t t p : / / s c h e m a s . m i c r o s o f t . c o m / w i n f x / 2 0 0 6 / x a m l / p r e s e n t a t i o n & q u o t ;  
         x m l n s : x = & q u o t ; h t t p : / / s c h e m a s . m i c r o s o f t . c o m / w i n f x / 2 0 0 6 / x a m l & q u o t ;  
         x m l n s : d = & q u o t ; h t t p : / / s c h e m a s . m i c r o s o f t . c o m / e x p r e s s i o n / b l e n d / 2 0 0 8 & q u o t ;  
         x m l n s : h e l p e r s = & q u o t ; u s i n g : R e f l e c t i o n I T . U n i v e r s a l . H e l p e r s & q u o t ;  
         x m l n s : m c = & q u o t ; h t t p : / / s c h e m a s . o p e n x m l f o r m a t s . o r g / m a r k u p - c o m p a t i b i l i t y / 2 0 0 6 & q u o t ;  
         B a c k g r o u n d = & q u o t ; { T h e m e R e s o u r c e   A p p l i c a t i o n P a g e B a c k g r o u n d T h e m e B r u s h } & q u o t ;  
         m c : I g n o r a b l e = & q u o t ; d & q u o t ; & g t ;  
         & l t ; G r i d  
                 M a r g i n = & q u o t ; 8 & q u o t ;   C o l u m n S p a c i n g = & q u o t ; 8 & q u o t ;   R o w S p a c i n g = & q u o t ; 8 & q u o t ;  
                 h e l p e r s : G r i d . C o l u m n D e f i n i t i o n s = & q u o t ; 1 * , 1 * & q u o t ;  
                 h e l p e r s : G r i d . R o w D e f i n i t i o n s = & q u o t ; 1 * , 1 * & q u o t ; & g t ;  
                 & l t ; R e c t a n g l e   F i l l = & q u o t ; # F 2 5 0 2 2 & q u o t ;   / & g t ;  
                 & l t ; R e c t a n g l e   G r i d . C o l u m n = & q u o t ; 1 & q u o t ;   F i l l = & q u o t ; # 7 F B A 0 0 & q u o t ;   / & g t ;  
                 & l t ; R e c t a n g l e   G r i d . R o w = & q u o t ; 1 & q u o t ;   F i l l = & q u o t ; # 0 0 A 4 E F & q u o t ;   / & g t ;  
                 & l t ; R e c t a n g l e   G r i d . R o w = & q u o t ; 1 & q u o t ;   G r i d . C o l u m n = & q u o t ; 1 & q u o t ;   F i l l = & q u o t ; # F F B 9 0 0 & q u o t ;   / & g t ;  
         & l t ; / G r i d & g t ;  
 & l t ; / P a g e & g t ;  
 < / p r e >  
 < p > & # 1 6 0 ; < / p >  
 < h 3 > W P F   S u p p o r t < / h 3 >  
 < p > T h e   s a m e   s o l u t i o n   c a n   a l s o   b e   u s e d   i n   W P F .   T h e   G r i d   c l a s s   i s   s i m i l a r   a s   t h e   U W P   v e r s i o n ,   i t   d i f f e r s   o n l y   f o r   s o m e   d i f f e r e n t   n a m e s p a c e s . < / p >  
 < p r e   c l a s s = " b r u s h :   c s h a r p " > u s i n g   S y s t e m ;  
 u s i n g   S y s t e m . W i n d o w s ;  
 u s i n g   S y s t e m . X a m l ;  
  
 n a m e s p a c e   R e f l e c t i o n I T . W p f . H e l p e r s   {  
  
         / / /   & l t ; s u m m a r y & g t ;  
         / / /   & l t ; G r i d   h e l p e r s : G r i d . R o w D e f i n i t i o n s = & q u o t ; 1 * ,   5 0 ,   A u t o , 2 * & q u o t ;  
         / / /               h e l p e r s : G r i d . C o l u m n D e f i n i t i o n s = & q u o t ; 1 . 5 * , 5 0 , A u t o , 2 . 5 * & q u o t ;   . . .  
         / / /   & l t ; / s u m m a r y & g t ;  
         p u b l i c   c l a s s   G r i d   {  
  
                 # r e g i o n   C o l u m n D e f i n i t i o n s   A t t a c h e d   P r o p e r t y  
  
                 / / /   & l t ; s u m m a r y & g t ;    
                 / / /   I d e n t i f i e s   t h e   C o l u m n D e f i n i t i o n s   a t t a c h t e d   p r o p e r t y .   T h i s   e n a b l e s   a n i m a t i o n ,   s t y l i n g ,   b i n d i n g ,   e t c . . .  
                 / / /   & l t ; / s u m m a r y & g t ;  
                 p u b l i c   s t a t i c   r e a d o n l y   D e p e n d e n c y P r o p e r t y   C o l u m n D e f i n i t i o n s P r o p e r t y   =  
                         D e p e n d e n c y P r o p e r t y . R e g i s t e r A t t a c h e d ( & q u o t ; C o l u m n D e f i n i t i o n s & q u o t ; ,  
                                                                                                 t y p e o f ( s t r i n g ) ,  
                                                                                                 t y p e o f ( G r i d ) ,  
                                                                                                 n e w   P r o p e r t y M e t a d a t a ( d e f a u l t ( s t r i n g ) ,   O n C o l u m n D e f i n i t i o n s C h a n g e d ) ) ;  
  
                 / / /   & l t ; s u m m a r y & g t ;  
                 / / /   C o l u m n D e f i n i t i o n s   c h a n g e d   h a n d l e r .    
                 / / /   & l t ; / s u m m a r y & g t ;  
                 / / /   & l t ; p a r a m   n a m e = & q u o t ; d & q u o t ; & g t ; G r i d   t h a t   c h a n g e d   i t s   C o l u m n D e f i n i t i o n s   a t t a c h e d   p r o p e r t y . & l t ; / p a r a m & g t ;  
                 / / /   & l t ; p a r a m   n a m e = & q u o t ; e & q u o t ; & g t ; D e p e n d e n c y P r o p e r t y C h a n g e d E v e n t A r g s   w i t h   t h e   n e w   a n d   o l d   v a l u e . & l t ; / p a r a m & g t ;    
                 p r i v a t e   s t a t i c   v o i d   O n C o l u m n D e f i n i t i o n s C h a n g e d ( D e p e n d e n c y O b j e c t   d ,   D e p e n d e n c y P r o p e r t y C h a n g e d E v e n t A r g s   e )   {  
                         i f   ( d   i s   S y s t e m . W i n d o w s . C o n t r o l s . G r i d   s o u r c e )   {  
                                 i f   ( s o u r c e . C o l u m n D e f i n i t i o n s ? . C o u n t   = =   0 )   {  
                                         v a r   v a l u e   =   ( s t r i n g ) e . N e w V a l u e ;  
                                         v a r   a   =   v a l u e . S p l i t ( & a p o s ; , & a p o s ; ) ;  
                                         f o r e a c h   ( v a r   t e x t   i n   a )   {  
                                                 s o u r c e . C o l u m n D e f i n i t i o n s . A d d ( n e w   S y s t e m . W i n d o w s . C o n t r o l s . C o l u m n D e f i n i t i o n   {  
                                                         W i d t h   =   C r e a t e G r i d L e n g t h ( t e x t ) ,  
                                                 } ) ;  
                                         }  
                                 }  
                         }  
                 }  
  
                 / / /   & l t ; s u m m a r y & g t ;  
                 / / /   G e t s   t h e   v a l u e   o f   t h e   C o l u m n D e f i n i t i o n s   a t t a c h e d   p r o p e r t y   f r o m   t h e   s p e c i f i e d   W i n d o w s . U I . X a m l . C o n t r o l s . G r i d .  
                 / / /   & l t ; / s u m m a r y & g t ;  
                 p u b l i c   s t a t i c   s t r i n g   G e t C o l u m n D e f i n i t i o n s ( D e p e n d e n c y O b j e c t   o b j )   {  
                         r e t u r n   ( s t r i n g ) o b j . G e t V a l u e ( C o l u m n D e f i n i t i o n s P r o p e r t y ) ;  
                 }  
  
  
                 / / /   & l t ; s u m m a r y & g t ;  
                 / / /   S e t s   t h e   v a l u e   o f   t h e   C o l u m n D e f i n i t i o n s   a t t a c h e d   p r o p e r t y   t o   t h e   s p e c i f i e d   W i n d o w s . U I . X a m l . C o n t r o l s . G r i d .  
                 / / /   & l t ; / s u m m a r y & g t ;  
                 / / /   & l t ; p a r a m   n a m e = & q u o t ; o b j & q u o t ; & g t ; T h e   o b j e c t   o n   w h i c h   t o   s e t   t h e   C o l u m n D e f i n i t i o n s   a t t a c h e d   p r o p e r t y . & l t ; / p a r a m & g t ;  
                 / / /   & l t ; p a r a m   n a m e = & q u o t ; v a l u e & q u o t ; & g t ; T h e   p r o p e r t y   v a l u e   t o   s e t . & l t ; / p a r a m & g t ;  
                 p u b l i c   s t a t i c   v o i d   S e t C o l u m n D e f i n i t i o n s ( D e p e n d e n c y O b j e c t   o b j ,   s t r i n g   v a l u e )   {  
                         o b j . S e t V a l u e ( C o l u m n D e f i n i t i o n s P r o p e r t y ,   v a l u e ) ;  
                 }  
  
                 # e n d r e g i o n   C o l u m n D e f i n i t i o n s   A t t a c h e d   P r o p e r t y  
  
                 # r e g i o n   R o w D e f i n i t i o n s   A t t a c h e d   P r o p e r t y  
  
                 / / /   & l t ; s u m m a r y & g t ;    
                 / / /   I d e n t i f i e s   t h e   R o w D e f i n i t i o n s   a t t a c h t e d   p r o p e r t y .   T h i s   e n a b l e s   a n i m a t i o n ,   s t y l i n g ,   b i n d i n g ,   e t c . . .  
                 / / /   & l t ; / s u m m a r y & g t ;  
                 p u b l i c   s t a t i c   r e a d o n l y   D e p e n d e n c y P r o p e r t y   R o w D e f i n i t i o n s P r o p e r t y   =  
                         D e p e n d e n c y P r o p e r t y . R e g i s t e r A t t a c h e d ( & q u o t ; R o w D e f i n i t i o n s & q u o t ; ,  
                                                                                                 t y p e o f ( s t r i n g ) ,  
                                                                                                 t y p e o f ( G r i d ) ,  
                                                                                                 n e w   P r o p e r t y M e t a d a t a ( d e f a u l t ( s t r i n g ) ,   O n R o w D e f i n i t i o n s C h a n g e d ) ) ;  
  
                 / / /   & l t ; s u m m a r y & g t ;  
                 / / /   R o w D e f i n i t i o n s   c h a n g e d   h a n d l e r .    
                 / / /   & l t ; / s u m m a r y & g t ;  
                 / / /   & l t ; p a r a m   n a m e = & q u o t ; d & q u o t ; & g t ; G r i d   t h a t   c h a n g e d   i t s   R o w D e f i n i t i o n s   a t t a c h e d   p r o p e r t y . & l t ; / p a r a m & g t ;  
                 / / /   & l t ; p a r a m   n a m e = & q u o t ; e & q u o t ; & g t ; D e p e n d e n c y P r o p e r t y C h a n g e d E v e n t A r g s   w i t h   t h e   n e w   a n d   o l d   v a l u e . & l t ; / p a r a m & g t ;    
                 p r i v a t e   s t a t i c   v o i d   O n R o w D e f i n i t i o n s C h a n g e d ( D e p e n d e n c y O b j e c t   d ,   D e p e n d e n c y P r o p e r t y C h a n g e d E v e n t A r g s   e )   {  
                         i f   ( d   i s   S y s t e m . W i n d o w s . C o n t r o l s . G r i d   s o u r c e )   {  
                                 i f   ( s o u r c e . R o w D e f i n i t i o n s ? . C o u n t   = =   0 )   {  
                                         v a r   v a l u e   =   ( s t r i n g ) e . N e w V a l u e ;  
                                         v a r   a   =   v a l u e . S p l i t ( & a p o s ; , & a p o s ; ) ;  
                                         f o r e a c h   ( v a r   i t e m   i n   a )   {  
                                                 s o u r c e . R o w D e f i n i t i o n s . A d d ( n e w   S y s t e m . W i n d o w s . C o n t r o l s . R o w D e f i n i t i o n   {  
                                                         H e i g h t   =   C r e a t e G r i d L e n g t h ( i t e m ) ,  
                                                 } ) ;  
                                         }  
                                 }  
                         }  
                 }  
  
                 / / /   & l t ; s u m m a r y & g t ;  
                 / / /   G e t s   t h e   v a l u e   o f   t h e   R o w D e f i n i t i o n s   a t t a c h e d   p r o p e r t y   f r o m   t h e   s p e c i f i e d   G r i d   .  
                 / / /   & l t ; / s u m m a r y & g t ;  
                 p u b l i c   s t a t i c   s t r i n g   G e t R o w D e f i n i t i o n s ( D e p e n d e n c y O b j e c t   o b j )   {  
                         r e t u r n   ( s t r i n g ) o b j . G e t V a l u e ( R o w D e f i n i t i o n s P r o p e r t y ) ;  
                 }  
  
                 / / /   & l t ; s u m m a r y & g t ;  
                 / / /   S e t s   t h e   v a l u e   o f   t h e   R o w D e f i n i t i o n s   a t t a c h e d   p r o p e r t y   t o   t h e   s p e c i f i e d   G r i d   .  
                 / / /   & l t ; / s u m m a r y & g t ;  
                 / / /   & l t ; p a r a m   n a m e = & q u o t ; o b j & q u o t ; & g t ; T h e   o b j e c t   o n   w h i c h   t o   s e t   t h e   R o w D e f i n i t i o n s   a t t a c h e d   p r o p e r t y . & l t ; / p a r a m & g t ;  
                 / / /   & l t ; p a r a m   n a m e = & q u o t ; v a l u e & q u o t ; & g t ; T h e   p r o p e r t y   v a l u e   t o   s e t . & l t ; / p a r a m & g t ;  
                 p u b l i c   s t a t i c   v o i d   S e t R o w D e f i n i t i o n s ( D e p e n d e n c y O b j e c t   o b j ,   s t r i n g   v a l u e )   {  
                         o b j . S e t V a l u e ( R o w D e f i n i t i o n s P r o p e r t y ,   v a l u e ) ;  
                 }  
  
                 # e n d r e g i o n   R o w D e f i n i t i o n s   A t t a c h e d   P r o p e r t y  
  
                 p r i v a t e   s t a t i c   G r i d L e n g t h   C r e a t e G r i d L e n g t h ( s t r i n g   t e x t )   {  
                         t e x t   =   t e x t . T r i m ( ) ;  
                         r e t u r n   t e x t . L e n g t h   = =   0  
                                 ?   t h r o w   n e w   X a m l P a r s e E x c e p t i o n ( & q u o t ; X A M L   p a r s i n g   f a i l e d :   E m p t y   G r i d L e n g t h   i s   n o t   a l l o w e d & q u o t ; )  
                                 :   t e x t . E n d s W i t h ( & a p o s ; * & a p o s ; )  
                                 ?   n e w   G r i d L e n g t h ( t e x t . L e n g t h   & g t ;   1   ?   d o u b l e . P a r s e ( t e x t . S u b s t r i n g ( 0 ,   t e x t . L e n g t h   -   1 ) )   :   1 ,   G r i d U n i t T y p e . S t a r )  
                                 :   t e x t . E q u a l s ( & q u o t ; a u t o & q u o t ; ,   S t r i n g C o m p a r i s o n . O r d i n a l I g n o r e C a s e )  
                                         ?   n e w   G r i d L e n g t h ( 0 D ,   G r i d U n i t T y p e . A u t o )  
                                         :   n e w   G r i d L e n g t h ( d o u b l e . P a r s e ( t e x t ) ,   G r i d U n i t T y p e . P i x e l ) ;  
                 }  
  
         }  
 }  
 < / p r e >  
 < p > T h e   u s a g e   i s   t h e   s a m e   a s   i n   U W P .   I   h a d   t o   a d d   M a r g i n   t o   t h e   R e c t a n g l e   e l e m e n t s   d u e   t o   t h e   l a c k   o f   R o w S p a c i n g   a n d   C o l u m n S p a c i n g   o n   t h e   G r i d .   L e t & a p o s ; s   h o p e   t h a t   w i l l   b e   a d d e d   t o   W P F   s o o n . & # 1 6 0 ; < / p >  
 < p > < i m g   s r c = " h t t p s : / / w w w . r e f l e c t i o n i t . n l / I m a g e s / B l o g / X A M L / I n l i n e R o w C o l u m n D e f i n i t i o n s / W P F I n l i n e R o w C o l u m n D e f i n i t i o n s . p n g "   a l t = " W P F   X A M L   w i t h   n o r m a l   R o w   a n d   C o l u m n   D e f i n i t i o n s "   w i d t h = " 6 0 0 "   / > < / p >  
 < h 3 > D e s i g n e r   s u p p o r t < / h 3 >  
 < p > T h e   W P F   a n d   U W P   D e s i g n e r s   s u p p o r t   t h e   u s e   o f   t h e s e   A t t a c h e d   P r o p e r t i e s .   L e t & a p o s ; s   a l s o   h o p e   t h a t   a   D e s i g n e r   w i l l   b e   a d d e d   t o   W i n U I 3   s o o n .   U n t i l l   t h e n   w e   c a n   u s e   X A M L   H o t   R e l o a d   a n d   X A M L   L i v e   P r e v i e w   a s   a   p o o r   m a n & a p o s ; s   a l t e r n a t i v e   f o r   a   D e s i g n e r .   U n f o r t n a t l y   i t   d o e s n & a p o s ; t   s u p p o r t   t h e   i n l i n e   s y n t a x   y e t .   S o m e t h i n g   w h i c h   i s   < a   h r e f = " h t t p s : / / g i t h u b . c o m / m i c r o s o f t / m i c r o s o f t - u i - x a m l / i s s u e s / 6 3 7 1 " > r e p o r t e d < / a >   a n d   w i l l   h o p e f u l l y   b e   f i x e d   s o o n < / p >  
 < p > < i m g   s r c = " h t t p s : / / w w w . r e f l e c t i o n i t . n l / I m a g e s / B l o g / X A M L / I n l i n e R o w C o l u m n D e f i n i t i o n s / X a m l L i v e P r e v i e w . p n g "   a l t = " W P F   X A M L   w i t h   n o r m a l   R o w   a n d   C o l u m n   D e f i n i t i o n s "   w i d t h = " 6 0 0 "   / > < / p > < / b o d y > < / h t m l > ] ] > < / c o n t e n t : e n c o d e d >  
         < / i t e m >  
         < i t e m >  
             < t i t l e > X A M L   L i g h t w e i g h t   s t y l i n g   d o n e   r i g h t < / t i t l e >  
             < l i n k > h t t p s : / / w w w . r e f l e c t i o n i t . n l / b l o g / 2 0 2 1 / x a m l - l i g h t w e i g h t - s t y l i n g - d o n e - r i g h t < / l i n k >  
             < d e s c r i p t i o n   / >  
             < a u t h o r > f o n s . s o n n e m a n s @ r e f l e c t i o n i t . n l   ( F o n s   S o n n e m a n s ) < / a u t h o r >  
             < c a t e g o r y > A p p s < / c a t e g o r y >  
             < c a t e g o r y > X A M L < / c a t e g o r y >  
             < c a t e g o r y > U W P < / c a t e g o r y >  
             < c a t e g o r y > W i n d o w s   1 0 < / c a t e g o r y >  
             < c a t e g o r y > B l e n d < / c a t e g o r y >  
             < g u i d > h t t p s : / / w w w . r e f l e c t i o n i t . n l / b l o g / 2 0 2 1 / x a m l - l i g h t w e i g h t - s t y l i n g - d o n e - r i g h t < / g u i d >  
             < p u b D a t e > M o n ,   1 1   J a n   2 0 2 1   0 0 : 0 0 : 0 0   G M T < / p u b D a t e >  
             < c o n t e n t : e n c o d e d > < ! [ C D A T A [ < h t m l > < b o d y > < p > Y o u   c a n   c u s t o m i z e   t h e   a p p e a r a n c e   o f   y o u r   a p p s   i n   m a n y   w a y s   b y   u s i n g   t h e   X A M L   f r a m e w o r k .   S t y l e s   l e t   y o u   s e t   c o n t r o l   p r o p e r t i e s   a n d   r e u s e   t h o s e   s e t t i n g s   f o r   a   c o n s i s t e n t   a p p e a r a n c e   a c r o s s   m u l t i p l e   c o n t r o l s . < / p >  
 < p > W i t h & # 1 6 0 ; < a   h r e f = " h t t p s : / / d o c s . m i c r o s o f t . c o m / e n - u s / w i n d o w s / u w p / d e s i g n / c o n t r o l s - a n d - p a t t e r n s / x a m l - s t y l e s # l i g h t w e i g h t - s t y l i n g " > L i g h t w e i g h t   s t y l i n g < / a > & # 1 6 0 ; y o u   o v e r r i d e   t h e   s y s t e m   b r u s h e s ,   a n d   t h e   c o l o r   o v e r r i d e   w i l l   a f f e c t   a l l   c o n t r o l s   t h a t   r e f e r e n c e   t h a t   b r u s h .   A l t h o u g h   t h i s   i s   c a l l e d   s t y l i n g   y o u   a r e   n o t   d e f i n i n g   a   s t y l e .   Y o u   j u s t   c r e a t e   a   R e s o u r c e D i c t i o n a r y   w i t h   a   T h e m e D i c t i o n a r y   i n   w h i c h   y o u   o v e r r i d e   t h e   s y s t e m   b r u s h e s . < / p >  
 < p r e   c l a s s = " b r u s h :   h t m l " > & l t ; P a g e . R e s o u r c e s & g t ;  
         & l t ; R e s o u r c e D i c t i o n a r y & g t ;  
                 & l t ; R e s o u r c e D i c t i o n a r y . T h e m e D i c t i o n a r i e s & g t ;  
                         & l t ; R e s o u r c e D i c t i o n a r y   x : K e y = & q u o t ; L i g h t & q u o t ; & g t ;  
                                   & l t ; S o l i d C o l o r B r u s h   x : K e y = & q u o t ; B u t t o n B a c k g r o u n d & q u o t ;                                                                        
                                                                     C o l o r = & q u o t ; T r a n s p a r e n t & q u o t ; / & g t ;  
                                   & l t ; S o l i d C o l o r B r u s h   x : K e y = & q u o t ; B u t t o n F o r e g r o u n d & q u o t ;    
                                                                     C o l o r = & q u o t ; M e d i u m S l a t e B l u e & q u o t ; / & g t ;  
                                   & l t ; S o l i d C o l o r B r u s h   x : K e y = & q u o t ; B u t t o n B o r d e r B r u s h & q u o t ;  
                                                                     C o l o r = & q u o t ; M e d i u m S l a t e B l u e & q u o t ; / & g t ;  
                         & l t ; / R e s o u r c e D i c t i o n a r y & g t ;  
                 & l t ; / R e s o u r c e D i c t i o n a r y . T h e m e D i c t i o n a r i e s & g t ;  
         & l t ; / R e s o u r c e D i c t i o n a r y & g t ;  
 & l t ; / P a g e . R e s o u r c e s & g t ; / & g t ;  
 < / p r e >  
 < p > T h e s e   o v e r r i d e n   s y s t e m   b r u s h e s   m a k e   a   n o r m a l   B u t t o n   c o n t r o l   t r a n s p a r e n t   w i t h   a   p u r p l e   b o r d e r   a n d   t e x t   ( c o n t e n t ) . < / p >  
 < p > < i m g   s r c = " h t t p s : / / d o c s . m i c r o s o f t . c o m / e n - u s / w i n d o w s / u w p / d e s i g n / c o n t r o l s - a n d - p a t t e r n s / i m a g e s / l i g h t w e i g h t s t y l i n g _ b u t t o n s t a t e s e x a m p l e . p n g "   a l t = " "   w i d t h = " 7 2 0 "   / > < / p >  
 < p > F o r   s t a t e s   l i k e   P o i n t e r O v e r   ( m o u s e   i s   h o v e r e d   o v e r   t h e   b u t t o n ) , < s t r o n g > P o i n t e r P r e s s e d < / s t r o n g >   ( b u t t o n   h a s   b e e n   i n v o k e d ) ,   o r   D i s a b l e d   ( b u t t o n   i s   n o t   i n t e r a c t a b l e ) .   T h e s e   e n d i n g s   a r e   a p p e n d e d   o n t o   t h e   o r i g i n a l   L i g h t w e i g h t   s t y l i n g   n a m e s : < s t r o n g > B u t t o n B a c k g r o u n d P o i n t e r O v e r ,   B u t t o n F o r e g r o u n d P o i n t e r P r e s s e d ,   B u t t o n B o r d e r B r u s h D i s a b l e d ,   e t c < / s t r o n g > .   M o d i f y i n g   t h o s e   b r u s h e s   a s   w e l l ,   w i l l   m a k e   s u r e   t h a t   y o u r   c o n t r o l s   a r e   c o l o r e d   c o n s i s t e n t l y   t o   y o u r   a p p & a p o s ; s   t h e m e . < / p >  
 < p > Y o u   s h o u l d   a l s o   d e f i n e   t h e s e   b r u s h e s   i n   t h e   D e f a u l t   ( r e a d   & a p o s ; D a r k & a p o s ; )   t h e m e .   I f   y o u   a r e   n o t   f a m i l i a r   w i t h   t h i s   y o u   s h o u l d   r e a d   t h e   < a   h r e f = " h t t p s : / / d o c s . m i c r o s o f t . c o m / e n - u s / w i n d o w s / u w p / d e s i g n / c o n t r o l s - a n d - p a t t e r n s / x a m l - t h e m e - r e s o u r c e s " > X A M L   t h e m e   r e s o u r c e s < / a >   d o c s . < / p >  
 < h 3 > P e r - c o n t r o l   S t y l i n g < / h 3 >  
 < p > T h e s e   o v e r r i d e s   o f   t h e   s y s t e m   b r u s h e s   a r e   g e n e r a l l y   d o n e   a t   t h e   A p p   o r   P a g e   l e v e l .   I n   t h e   d o c s   y o u   c a n   a l s o   r e a d   t h a t   t h e r e   i s   a   w a y   y o u   c a n   d o   t h i s   < a   h r e f = " h t t p s : / / d o c s . m i c r o s o f t . c o m / e n - u s / w i n d o w s / u w p / d e s i g n / c o n t r o l s - a n d - p a t t e r n s / x a m l - s t y l e s # p e r - c o n t r o l - s t y l i n g " > p e r - c o n t r o l < / a > .   C h a n g i n g   a   s i n g l e   c o n t r o l   o n   o n e   p a g e   o n l y   t o   l o o k   a   c e r t a i n   w a y ,   w i t h o u t   a l t e r i n g   a n y   o t h e r   v e r s i o n s   o f   t h a t   c o n t r o l ,   i s   d e s i r e d : < / p >  
 < p > < i m g   s r c = " h t t p s : / / d o c s . m i c r o s o f t . c o m / e n - u s / w i n d o w s / u w p / d e s i g n / c o n t r o l s - a n d - p a t t e r n s / i m a g e s / l i g h t w e i g h t s t y l i n g _ c h e c k b o x e x a m p l e . p n g "   a l t = " "   w i d t h = " 2 0 3 "   h e i g h t = " 1 3 7 "   / > < / p >  
 < p r e   c l a s s = " b r u s h :   h t m l " > & l t ; C h e c k B o x   C o n t e n t = & q u o t ; N o r m a l   C h e c k B o x & q u o t ;   M a r g i n = & q u o t ; 5 & q u o t ; / & g t ;  
 & l t ; C h e c k B o x   C o n t e n t = & q u o t ; S p e c i a l   C h e c k B o x & q u o t ;   M a r g i n = & q u o t ; 5 & q u o t ; & g t ;  
         & l t ; C h e c k B o x . R e s o u r c e s & g t ;  
                 & l t ; R e s o u r c e D i c t i o n a r y & g t ;  
                         & l t ; R e s o u r c e D i c t i o n a r y . T h e m e D i c t i o n a r i e s & g t ;  
                                 & l t ; R e s o u r c e D i c t i o n a r y   x : K e y = & q u o t ; L i g h t & q u o t ; & g t ;  
                                         & l t ; S o l i d C o l o r B r u s h   x : K e y = & q u o t ; C h e c k B o x F o r e g r o u n d U n c h e c k e d & q u o t ;  
                                                 C o l o r = & q u o t ; P u r p l e & q u o t ; / & g t ;  
                                         & l t ; S o l i d C o l o r B r u s h   x : K e y = & q u o t ; C h e c k B o x F o r e g r o u n d C h e c k e d & q u o t ;  
                                                 C o l o r = & q u o t ; P u r p l e & q u o t ; / & g t ;  
                                         & l t ; S o l i d C o l o r B r u s h   x : K e y = & q u o t ; C h e c k B o x C h e c k G l y p h F o r e g r o u n d C h e c k e d & q u o t ;  
                                                 C o l o r = & q u o t ; W h i t e & q u o t ; / & g t ;  
                                         & l t ; S o l i d C o l o r B r u s h   x : K e y = & q u o t ; C h e c k B o x C h e c k B a c k g r o u n d S t r o k e C h e c k e d & q u o t ;      
                                                 C o l o r = & q u o t ; P u r p l e & q u o t ; / & g t ;  
                                         & l t ; S o l i d C o l o r B r u s h   x : K e y = & q u o t ; C h e c k B o x C h e c k B a c k g r o u n d F i l l C h e c k e d & q u o t ;  
                                                 C o l o r = & q u o t ; P u r p l e & q u o t ; / & g t ;  
                                 & l t ; / R e s o u r c e D i c t i o n a r y & g t ;  
                         & l t ; / R e s o u r c e D i c t i o n a r y . T h e m e D i c t i o n a r i e s & g t ;  
                 & l t ; / R e s o u r c e D i c t i o n a r y & g t ;  
         & l t ; / C h e c k B o x . R e s o u r c e s & g t ;  
 & l t ; / C h e c k B o x & g t ;  
 & l t ; C h e c k B o x   C o n t e n t = & q u o t ; N o r m a l   C h e c k B o x & q u o t ;   M a r g i n = & q u o t ; 5 & q u o t ; / & g t ;  
 < / p r e >  
 < p > I f   y o u   w a n t   t o   d o   t h i s   f o r   t w o   c o n t r o l s   y o u   h a v e   t o   o v e r r i d e   t h e   s y s t e m   b r u s h e s   f o r   b o t h   c o n t r o l s .   E a c h   c o n t r o l   w i l l   h a v e   t h e   s a m e   R e s o u r c e D i c t i o n a r y   c o n t a i n i n g   t h e   T h e m e s   w i t h   t h e   o v e r r i d e n   s y s t e m   b r u s h e s . < / p >  
 < p r e   c l a s s = " b r u s h :   h t m l " > & l t ; C h e c k B o x   C o n t e n t = & q u o t ; N o r m a l   C h e c k B o x & q u o t ;   M a r g i n = & q u o t ; 5 & q u o t ; / & g t ;  
 & l t ; C h e c k B o x   C o n t e n t = & q u o t ; S p e c i a l   C h e c k B o x & q u o t ;   M a r g i n = & q u o t ; 5 & q u o t ; & g t ;  
         & l t ; C h e c k B o x . R e s o u r c e s & g t ;  
                 & l t ; R e s o u r c e D i c t i o n a r y & g t ;  
                         & l t ; R e s o u r c e D i c t i o n a r y . T h e m e D i c t i o n a r i e s & g t ;  
                                 & l t ; R e s o u r c e D i c t i o n a r y   x : K e y = & q u o t ; L i g h t & q u o t ; & g t ;  
                                         & l t ; S o l i d C o l o r B r u s h   x : K e y = & q u o t ; C h e c k B o x F o r e g r o u n d U n c h e c k e d & q u o t ;  
                                                 C o l o r = & q u o t ; P u r p l e & q u o t ; / & g t ;  
                                         & l t ; S o l i d C o l o r B r u s h   x : K e y = & q u o t ; C h e c k B o x F o r e g r o u n d C h e c k e d & q u o t ;  
                                                 C o l o r = & q u o t ; P u r p l e & q u o t ; / & g t ;  
                                         & l t ; S o l i d C o l o r B r u s h   x : K e y = & q u o t ; C h e c k B o x C h e c k G l y p h F o r e g r o u n d C h e c k e d & q u o t ;  
                                                 C o l o r = & q u o t ; W h i t e & q u o t ; / & g t ;  
                                         & l t ; S o l i d C o l o r B r u s h   x : K e y = & q u o t ; C h e c k B o x C h e c k B a c k g r o u n d S t r o k e C h e c k e d & q u o t ;      
                                                 C o l o r = & q u o t ; P u r p l e & q u o t ; / & g t ;  
                                         & l t ; S o l i d C o l o r B r u s h   x : K e y = & q u o t ; C h e c k B o x C h e c k B a c k g r o u n d F i l l C h e c k e d & q u o t ;  
                                                 C o l o r = & q u o t ; P u r p l e & q u o t ; / & g t ;  
                                 & l t ; / R e s o u r c e D i c t i o n a r y & g t ;  
                         & l t ; / R e s o u r c e D i c t i o n a r y . T h e m e D i c t i o n a r i e s & g t ;  
                 & l t ; / R e s o u r c e D i c t i o n a r y & g t ;  
         & l t ; / C h e c k B o x . R e s o u r c e s & g t ;  
 & l t ; / C h e c k B o x & g t ;  
 & l t ; C h e c k B o x   C o n t e n t = & q u o t ; S p e c i a l   C h e c k B o x & q u o t ;   M a r g i n = & q u o t ; 5 & q u o t ; & g t ;  
         & l t ; C h e c k B o x . R e s o u r c e s & g t ;  
                 & l t ; R e s o u r c e D i c t i o n a r y & g t ;  
                         & l t ; R e s o u r c e D i c t i o n a r y . T h e m e D i c t i o n a r i e s & g t ;  
                                 & l t ; R e s o u r c e D i c t i o n a r y   x : K e y = & q u o t ; L i g h t & q u o t ; & g t ;  
                                         & l t ; S o l i d C o l o r B r u s h   x : K e y = & q u o t ; C h e c k B o x F o r e g r o u n d U n c h e c k e d & q u o t ;  
                                                 C o l o r = & q u o t ; P u r p l e & q u o t ; / & g t ;  
                                         & l t ; S o l i d C o l o r B r u s h   x : K e y = & q u o t ; C h e c k B o x F o r e g r o u n d C h e c k e d & q u o t ;  
                                                 C o l o r = & q u o t ; P u r p l e & q u o t ; / & g t ;  
                                         & l t ; S o l i d C o l o r B r u s h   x : K e y = & q u o t ; C h e c k B o x C h e c k G l y p h F o r e g r o u n d C h e c k e d & q u o t ;  
                                                 C o l o r = & q u o t ; W h i t e & q u o t ; / & g t ;  
                                         & l t ; S o l i d C o l o r B r u s h   x : K e y = & q u o t ; C h e c k B o x C h e c k B a c k g r o u n d S t r o k e C h e c k e d & q u o t ;      
                                                 C o l o r = & q u o t ; P u r p l e & q u o t ; / & g t ;  
                                         & l t ; S o l i d C o l o r B r u s h   x : K e y = & q u o t ; C h e c k B o x C h e c k B a c k g r o u n d F i l l C h e c k e d & q u o t ;  
                                                 C o l o r = & q u o t ; P u r p l e & q u o t ; / & g t ;  
                                 & l t ; / R e s o u r c e D i c t i o n a r y & g t ;  
                         & l t ; / R e s o u r c e D i c t i o n a r y . T h e m e D i c t i o n a r i e s & g t ;  
                 & l t ; / R e s o u r c e D i c t i o n a r y & g t ;  
         & l t ; / C h e c k B o x . R e s o u r c e s & g t ;  
 & l t ; / C h e c k B o x & g t ; < / p r e >  
 < p > T h i s   i s   n o t   t h e   r i g h t   s o l u t i o n   b e c a u s e   y o u   n o w   h a v e   d u p l i c a t e   x a m l   c o d e .   T h i s   w i l l   c a u s e   m a i n t e n a n c e   i s s u e s .   A   b e t t e r   s o l u t i o n   i s   a v a i l a b l e .   Y o u   c a n d e f i n e   t h e   R e s o u r c e D i c t i o n a r y   i n s i d e   a   s e p a r a t e   R e s o u r c e D i c t i o n a r y   f i l e   a n d   u s e   a   M e r g e d   D i c t i o n a r y R e s o u r c e   i n s i d e   t h e   c o n t r o l s . < / p >  
 < h 4 > P u r p l e C h e c k b o x T h e m e . x a m l < / h 4 >  
 < p r e   c l a s s = " b r u s h :   h t m l " > & l t ; R e s o u r c e D i c t i o n a r y   x m l n s = & q u o t ; h t t p : / / s c h e m a s . m i c r o s o f t . c o m / w i n f x / 2 0 0 6 / x a m l / p r e s e n t a t i o n & q u o t ;  
                                         x m l n s : x = & q u o t ; h t t p : / / s c h e m a s . m i c r o s o f t . c o m / w i n f x / 2 0 0 6 / x a m l & q u o t ; & g t ;  
         & l t ; R e s o u r c e D i c t i o n a r y . T h e m e D i c t i o n a r i e s & g t ;  
                 & l t ; R e s o u r c e D i c t i o n a r y   x : K e y = & q u o t ; L i g h t & q u o t ; & g t ;  
                         & l t ; S o l i d C o l o r B r u s h   x : K e y = & q u o t ; C h e c k B o x F o r e g r o u n d U n c h e c k e d & q u o t ;  
                                                           C o l o r = & q u o t ; P u r p l e & q u o t ;   / & g t ;  
                         & l t ; S o l i d C o l o r B r u s h   x : K e y = & q u o t ; C h e c k B o x F o r e g r o u n d C h e c k e d & q u o t ;  
                                                           C o l o r = & q u o t ; P u r p l e & q u o t ;   / & g t ;  
                         & l t ; S o l i d C o l o r B r u s h   x : K e y = & q u o t ; C h e c k B o x C h e c k G l y p h F o r e g r o u n d C h e c k e d & q u o t ;  
                                                           C o l o r = & q u o t ; W h i t e & q u o t ;   / & g t ;  
                         & l t ; S o l i d C o l o r B r u s h   x : K e y = & q u o t ; C h e c k B o x C h e c k B a c k g r o u n d S t r o k e C h e c k e d & q u o t ;  
                                                           C o l o r = & q u o t ; P u r p l e & q u o t ;   / & g t ;  
                         & l t ; S o l i d C o l o r B r u s h   x : K e y = & q u o t ; C h e c k B o x C h e c k B a c k g r o u n d F i l l C h e c k e d & q u o t ;  
                                                           C o l o r = & q u o t ; P u r p l e & q u o t ;   / & g t ;  
                 & l t ; / R e s o u r c e D i c t i o n a r y & g t ;  
         & l t ; / R e s o u r c e D i c t i o n a r y . T h e m e D i c t i o n a r i e s & g t ;  
 & l t ; / R e s o u r c e D i c t i o n a r y & g t ; < / p r e >  
 < p > I n s i d e   t h e   C h e c k b o x   c o n t r o l s   y o u   u s e d   t h e   M e r g e d D i c t i o n a r i e s   t o   r e f e r e n c e   t h e   P u r p l e C h e c k b o x T h e m e . x a m l   f i l e < / p >  
 < p r e   c l a s s = " b r u s h :   h t m l " > & l t ; C h e c k B o x   C o n t e n t = & q u o t ; S p e c i a l   C h e c k B o x & q u o t ; & g t ;  
         & l t ; C h e c k B o x . R e s o u r c e s & g t ;  
                 & l t ; R e s o u r c e D i c t i o n a r y & g t ;  
                         & l t ; R e s o u r c e D i c t i o n a r y . M e r g e d D i c t i o n a r i e s & g t ;  
                                 & l t ; R e s o u r c e D i c t i o n a r y   S o u r c e = & q u o t ; / P u r p l e C h e c k b o x T h e m e . x a m l & q u o t ;   / & g t ;  
                         & l t ; / R e s o u r c e D i c t i o n a r y . M e r g e d D i c t i o n a r i e s & g t ;  
                 & l t ; / R e s o u r c e D i c t i o n a r y & g t ;  
         & l t ; / C h e c k B o x . R e s o u r c e s & g t ;  
 & l t ; / C h e c k B o x & g t ;  
 & l t ; C h e c k B o x   C o n t e n t = & q u o t ; S p e c i a l   C h e c k B o x & q u o t ; & g t ;  
         & l t ; C h e c k B o x . R e s o u r c e s & g t ;  
                 & l t ; R e s o u r c e D i c t i o n a r y & g t ;  
                         & l t ; R e s o u r c e D i c t i o n a r y . M e r g e d D i c t i o n a r i e s & g t ;  
                                 & l t ; R e s o u r c e D i c t i o n a r y   S o u r c e = & q u o t ; / P u r p l e C h e c k b o x T h e m e . x a m l & q u o t ;   / & g t ;  
                         & l t ; / R e s o u r c e D i c t i o n a r y . M e r g e d D i c t i o n a r i e s & g t ;  
                 & l t ; / R e s o u r c e D i c t i o n a r y & g t ;  
         & l t ; / C h e c k B o x . R e s o u r c e s & g t ;  
 & l t ; / C h e c k B o x & g t ; < / p r e >  
 < p > T h i s   s o l u t i o n   w o r k   p e r f e c t   b u t   i s   i t   t h e   r i g h t   o n e ?   T h e   v a l u e s   o f   t h e   s y s t e m   b r u s h e s   h a v e   n o   d u p l i c a t e s .   S t i l l ,   I   d o n & a p o s ; t   l i k e   t h i s   s o l u t i o n .   I   f i n d   i t   w a y   t o o   v e r b o s e . < / p >  
 < h 3 > T h e   r i g h t   s o l u t i o n < / h 3 >  
 < p > T o   g e t   r i d   o f   t h e   v e r b o s e n e s s   I   t r i e d   t o   p l a c e   t h e   R e s o u r c e D i c t i o n a r y   i n s i d e   a   S t y l e .   T h i s   w o u l d   m a k e   L i g h t w e i g h t   s t y l i n g   r e a l   s t y l i n g .   U n f o r t u n a t e l y   t h i s   d o e s n & a p o s ; t   w o r k   ( c o m p i l e )   a s   t h i s   s c r e e n s h o t   w i l l   s h o w   y o u . < / p >  
 < p > < i m g   s r c = " h t t p s : / / r e f l e c t i o n i t . n l / I m a g e s / B l o g / W i n d o w s 1 0 / L i g h t w e i g h t S t y l i n g / E r r o r . p n g "   a l t = " "   w i d t h = " 7 2 0 "   / > < / p >  
 < p > T h e   R e s o u r c e   p r o p e r t y   i s   n o t   a   D e p e n d e n c y   P r o p e r t y   s o   i t   c a n & a p o s ; t   b e   s e t   i n s i d e   a   ( S t y l e )   S e t t e r .   L u c k i l y   t h e   e r r o r   m e s s a g e   a l s o   h i n t s   t o w a r d s   t h e   s o l u t i o n .   A n   a t t a c h e d   p r o p e r t y   c a n   b e   u s e d   i n s t e a d .   S o ,   I   c r e a t e d   a   R e s o u r c e s S e r v i c e s   c l a s s   w i t h   a   R e s o u r c e s   a t t a c h e d   p r o p e r t y   i n   i t .   T h e   O n R e s o u r c e s C h a n g e d ( )   m e t h o d   s e t s   t h e   R e s o u r c e s   p r o p e r t y   o f   t h e   F r a m e w o r k E l e m e n t .   I t   u s e s   a & # 1 6 0 ; R e s o u r c e D i c t i o n a r y C l o n e r   h e l p e r   c l a s s   t o   c l o n e   t h e   R e s o u r c e D i c t i o n a r y . < / p >  
 < p r e   c l a s s = " b r u s h :   c s h a r p " > p u b l i c   c l a s s   R e s o u r c e s S e r v i c e s   {  
  
         / / /   & l t ; s u m m a r y & g t ;    
         / / /   I d e n t i f i e s   t h e   R e s o u r c e s   a t t a c h t e d   p r o p e r t y .   T h i s   e n a b l e s   a n i m a t i o n ,   s t y l i n g ,   b i n d i n g ,   e t c . . .  
         / / /   & l t ; / s u m m a r y & g t ;  
         p u b l i c   s t a t i c   r e a d o n l y   D e p e n d e n c y P r o p e r t y   R e s o u r c e s P r o p e r t y   =  
                 D e p e n d e n c y P r o p e r t y . R e g i s t e r A t t a c h e d ( & q u o t ; R e s o u r c e s & q u o t ; ,  
                               t y p e o f ( R e s o u r c e D i c t i o n a r y ) ,  
                               t y p e o f ( R e s o u r c e s S e r v i c e s ) ,  
                               n e w   P r o p e r t y M e t a d a t a ( d e f a u l t ( R e s o u r c e D i c t i o n a r y ) ,   O n R e s o u r c e s C h a n g e d ) ) ;  
  
         / / /   & l t ; s u m m a r y & g t ;  
         / / /   R e s o u r c e s   c h a n g e d   h a n d l e r .    
         / / /   & l t ; / s u m m a r y & g t ;  
         / / /   & l t ; p a r a m   n a m e = & q u o t ; d & q u o t ; & g t ; F r a m e w o r k E l e m e n t   t h a t   c h a n g e d   i t s   R e s o u r c e s   a t t a c h e d   p r o p e r t y . & l t ; / p a r a m & g t ;  
         / / /   & l t ; p a r a m   n a m e = & q u o t ; e & q u o t ; & g t ; D e p e n d e n c y P r o p e r t y C h a n g e d E v e n t A r g s   w i t h   t h e   n e w   a n d   o l d   v a l u e . & l t ; / p a r a m & g t ;    
         p r i v a t e   s t a t i c   v o i d   O n R e s o u r c e s C h a n g e d ( D e p e n d e n c y O b j e c t   d ,   D e p e n d e n c y P r o p e r t y C h a n g e d E v e n t A r g s   e )   {  
                 i f   ( d   i s   F r a m e w o r k E l e m e n t   s o u r c e )   {  
                         v a r   v a l u e   =   ( R e s o u r c e D i c t i o n a r y ) e . N e w V a l u e ;  
                         R e s o u r c e D i c t i o n a r y C l o n e r . C l o n e ( v a l u e ,   s o u r c e . R e s o u r c e s ) ;  
                 }  
         }  
  
         / / /   & l t ; s u m m a r y & g t ;  
         / / /   G e t s   t h e   v a l u e   o f   t h e   R e s o u r c e s   a t t a c h e d   p r o p e r t y   f r o m   t h e   s p e c i f i e d   F r a m e w o r k E l e m e n t .  
         / / /   & l t ; / s u m m a r y & g t ;  
         p u b l i c   s t a t i c   R e s o u r c e D i c t i o n a r y   G e t R e s o u r c e s ( D e p e n d e n c y O b j e c t   o b j )   {  
                 r e t u r n   ( R e s o u r c e D i c t i o n a r y ) o b j . G e t V a l u e ( R e s o u r c e s P r o p e r t y ) ;  
         }  
  
  
         / / /   & l t ; s u m m a r y & g t ;  
         / / /   S e t s   t h e   v a l u e   o f   t h e   R e s o u r c e s   a t t a c h e d   p r o p e r t y   t o   t h e   s p e c i f i e d   F r a m e w o r k E l e m e n t .  
         / / /   & l t ; / s u m m a r y & g t ;  
         / / /   & l t ; p a r a m   n a m e = & q u o t ; o b j & q u o t ; & g t ; T h e   o b j e c t   o n   w h i c h   t o   s e t   t h e   R e s o u r c e s   a t t a c h e d   p r o p e r t y . & l t ; / p a r a m & g t ;  
         / / /   & l t ; p a r a m   n a m e = & q u o t ; v a l u e & q u o t ; & g t ; T h e   p r o p e r t y   v a l u e   t o   s e t . & l t ; / p a r a m & g t ;  
         p u b l i c   s t a t i c   v o i d   S e t R e s o u r c e s ( D e p e n d e n c y O b j e c t   o b j ,   R e s o u r c e D i c t i o n a r y   v a l u e )   {  
                 o b j . S e t V a l u e ( R e s o u r c e s P r o p e r t y ,   v a l u e ) ;  
         }  
 }  
  
 i n t e r n a l   s t a t i c   c l a s s   R e s o u r c e D i c t i o n a r y C l o n e r   {  
  
         i n t e r n a l   s t a t i c   R e s o u r c e D i c t i o n a r y   C l o n e ( R e s o u r c e D i c t i o n a r y   r e s o u r c e ,   R e s o u r c e D i c t i o n a r y   d e s t i n a t i o n )   {  
                 i f   ( r e s o u r c e   = =   n u l l )   r e t u r n   n u l l ;  
  
                 i f   ( r e s o u r c e . S o u r c e   ! =   n u l l )   {  
                         d e s t i n a t i o n . S o u r c e   =   r e s o u r c e . S o u r c e ;  
                 }   e l s e   {  
                         / /   C l o n e   t h e m e   d i c t i o n a r i e s  
                         i f   ( r e s o u r c e . T h e m e D i c t i o n a r i e s   ! =   n u l l )   {  
                                 f o r e a c h   ( v a r   t h e m e   i n   r e s o u r c e . T h e m e D i c t i o n a r i e s )   {  
                                         i f   ( t h e m e . V a l u e   i s   R e s o u r c e D i c t i o n a r y   t h e m e d R e s o u r c e )   {  
                                                 v a r   t h e m e D i c t i o n a r y   =   n e w   R e s o u r c e D i c t i o n a r y ( ) ;  
                                                 C l o n e ( t h e m e d R e s o u r c e ,   t h e m e D i c t i o n a r y ) ;  
                                                 d e s t i n a t i o n . T h e m e D i c t i o n a r i e s [ t h e m e . K e y ]   =   t h e m e D i c t i o n a r y ;  
                                         }   e l s e   {  
                                                 d e s t i n a t i o n . T h e m e D i c t i o n a r i e s [ t h e m e . K e y ]   =   t h e m e . V a l u e ;  
                                         }  
                                 }  
                         }  
  
                         / /   C l o n e   m e r g e d   d i c t i o n a r i e s  
                         i f   ( r e s o u r c e . M e r g e d D i c t i o n a r i e s   ! =   n u l l )   {  
                                 f o r e a c h   ( v a r   m e r g e d R e s o u r c e   i n   r e s o u r c e . M e r g e d D i c t i o n a r i e s )   {  
                                         v a r   t h e m e D i c t i o n a r y   =   n e w   R e s o u r c e D i c t i o n a r y ( ) ;  
                                         C l o n e ( m e r g e d R e s o u r c e ,   t h e m e D i c t i o n a r y ) ;  
                                         d e s t i n a t i o n . M e r g e d D i c t i o n a r i e s . A d d ( t h e m e D i c t i o n a r y ) ;  
                                 }  
                         }  
  
                         / /   C l o n e   a l l   c o n t e n t s  
                         f o r e a c h   ( v a r   i t e m   i n   r e s o u r c e )   {  
                                 d e s t i n a t i o n [ i t e m . K e y ]   =   i t e m . V a l u e ;  
                         }  
                 }  
  
                 r e t u r n   d e s t i n a t i o n ;  
         }  
 }  
 < / p r e >  
 < p > < s p a n   s t y l e = " f o n t - s i z e :   1 e m ; " > T h e   P r o p e r t y   a t t r i b u t e   o f   t h e   S e t t e r   e l e m e n t   n o w   u s e s   t h i s   A t t a c h e d   P r o p e r t y .   T h e   & a p o s ; l o c a l & a p o s ;   n a m e s p a c e   i s   f o r   t h i s   e x a m p l e   s e t   t o   S a m p l e A p p .   T h i s   i s   t h e   n a m e s p a c e   o f   t h e   R e s o u r c e s S e r v i c e s   c l a s s . < / s p a n > < / p >  
 < p r e   c l a s s = " b r u s h :   h t m l " > & l t ; P a g e . R e s o u r c e s & g t ;  
         & l t ; S t y l e   x : K e y = & q u o t ; P u r l p l e C h e c k b o x & q u o t ;  
                         x m l n s : l o c a l = & q u o t ; u s i n g : S a m p l e A p p & q u o t ;  
                         T a r g e t T y p e = & q u o t ; C h e c k B o x & q u o t ; & g t ;  
                 & l t ; S t y l e . S e t t e r s & g t ;  
                         & l t ; S e t t e r   P r o p e r t y = & q u o t ; l o c a l : R e s o u r c e s S e r v i c e s . R e s o u r c e s & q u o t ; & g t ;  
                                 & l t ; S e t t e r . V a l u e & g t ;  
                                         & l t ; R e s o u r c e D i c t i o n a r y & g t ;  
                                                 & l t ; R e s o u r c e D i c t i o n a r y . T h e m e D i c t i o n a r i e s & g t ;  
                                                         & l t ; R e s o u r c e D i c t i o n a r y   x : K e y = & q u o t ; L i g h t & q u o t ; & g t ;  
                                                                 & l t ; S o l i d C o l o r B r u s h   x : K e y = & q u o t ; C h e c k B o x F o r e g r o u n d U n c h e c k e d & q u o t ;  
                                                                                                   C o l o r = & q u o t ; P u r p l e & q u o t ;   / & g t ;  
                                                                 & l t ; S o l i d C o l o r B r u s h   x : K e y = & q u o t ; C h e c k B o x F o r e g r o u n d C h e c k e d & q u o t ;  
                                                                                                   C o l o r = & q u o t ; P u r p l e & q u o t ;   / & g t ;  
                                                                 & l t ; S o l i d C o l o r B r u s h   x : K e y = & q u o t ; C h e c k B o x C h e c k G l y p h F o r e g r o u n d C h e c k e d & q u o t ;  
                                                                                                   C o l o r = & q u o t ; W h i t e & q u o t ;   / & g t ;  
                                                                 & l t ; S o l i d C o l o r B r u s h   x : K e y = & q u o t ; C h e c k B o x C h e c k B a c k g r o u n d S t r o k e C h e c k e d & q u o t ;  
                                                                                                   C o l o r = & q u o t ; P u r p l e & q u o t ;   / & g t ;  
                                                                 & l t ; S o l i d C o l o r B r u s h   x : K e y = & q u o t ; C h e c k B o x C h e c k B a c k g r o u n d F i l l C h e c k e d & q u o t ;  
                                                                                                   C o l o r = & q u o t ; P u r p l e & q u o t ;   / & g t ;  
                                                         & l t ; / R e s o u r c e D i c t i o n a r y & g t ;  
                                                 & l t ; / R e s o u r c e D i c t i o n a r y . T h e m e D i c t i o n a r i e s & g t ;  
                                         & l t ; / R e s o u r c e D i c t i o n a r y & g t ;  
                                 & l t ; / S e t t e r . V a l u e & g t ;  
                         & l t ; / S e t t e r & g t ;  
                 & l t ; / S t y l e . S e t t e r s & g t ;  
         & l t ; / S t y l e & g t ;  
 & l t ; / P a g e . R e s o u r c e s & g t ; < / p r e >  
 < p > S o ,   i f   y o u   w a n t   t w o   C h e c k B o x e s   w i t h   t h i s   l i g h t w e i g h t   s t y l e   y o u   c a n   j u s t   a s s i g n   t h e   P u r p l e C h e c k b o x   t o   t h e   S t y l e   p r o p e r t y   o f   t h o s e   t w o   c o n t r o l s .   T h i s   i s   v e r y   c o m p a c t   c o d e   w h i c h   m a k e s   i t   p e r f e c t . < / p >  
 < p r e   c l a s s = " b r u s h :   h t m l " > & l t ; C h e c k B o x   C o n t e n t = & q u o t ; N o r m a l   C h e c k B o x & q u o t ;   / & g t ;  
 & l t ; C h e c k B o x   C o n t e n t = & q u o t ; S p e c i a l   C h e c k B o x & q u o t ;  
                     S t y l e = & q u o t ; { S t a t i c R e s o u r c e   P u r l p l e C h e c k b o x } & q u o t ;   / & g t ;  
 & l t ; C h e c k B o x   C o n t e n t = & q u o t ; S p e c i a l   C h e c k B o x & q u o t ;  
                     S t y l e = & q u o t ; { S t a t i c R e s o u r c e   P u r l p l e C h e c k b o x } & q u o t ;   / & g t ; < / p r e >  
 < h 3 > C l o s u r e < / h 3 >  
 < p > I   t h i n k   t h a t   L i g h t w e i g h t   s t y l i n g   i s   g r e a t   a n d   w i t h   t h i s   R e s o u r c e s   a t t a c h e d   p r o p e r t y   i s   s u p e r   c l e a n .   N o   d u p l i c a t e   c o d e   a n d   v e r y   c o m p a c t .   J u s t   t h e   w a y   I   l i k e   i t .   I   h o p e   y o u   l i k e   i t   t o o . < / p >  
 < p > F o n s < / p >  
 < p > < s t r o n g > U p d a t e   1 2 - 1 - 2 0 2 1 < / s t r o n g > :   M y   o r i g i n a l   c o d e   w a s   n o t   t e s t e d   c o r r e c t l y . & # 1 6 0 ; < a   h r e f = " h t t p s : / / g i t h u b . c o m / r u d y h u y n " > R u d y   H y u n < / a > & # 1 6 0 ; m e n t i o n e d   t h i s   i n   t h i s & # 1 6 0 ; < a   h r e f = " h t t p s : / / t w i t t e r . c o m / R u d y H u y n / s t a t u s / 1 3 4 8 7 9 1 1 4 5 6 5 7 0 6 1 3 7 6 " > t w e e t < / a > ,   t h a n k s .   H e   h a s   a   s o l u t i o n   f o r   m y   p r o b l e m   w h i c h   h e   a l r e a d y   i m p l e m e n t e d   i n   t h e & # 1 6 0 ; < a   h r e f = " h t t p s : / / g i t h u b . c o m / r u d y h u y n / X a m l P l u s " > X a m l P l u s < / a > & # 1 6 0 ; p r o j e c t .   I   t o o k   ( s t o l e )   h i s & # 1 6 0 ; < a   h r e f = " h t t p s : / / g i t h u b . c o m / r u d y h u y n / X a m l P l u s / b l o b / m a s t e r / S t y l e E x t e n s i o n / R e s o u r c e D i c t i o n a r y C l o n e r . c s " > R e s o u r c e D i c t i o n a r y C l o n e r < / a > & # 1 6 0 ; a n d   a d d e d   t h i s   t o   t h i s   b l o g .   Y o u   m i g h t   a l s o   d e c i d e   t o   u s e   t h e   X a m l P l u s   s t y l e   p r o j e c t   i n s t e a d .   I t   h a s   a   S t y l e   c l a s s   w i t h   a   R e s o u r c e s   a t t a c h e d   p r o p e r t y .   I   t h i n k   i t   e v e n   f u n c t i o n s   b e t t e r   t h a n   m i n e   w h e n   y o u   c h a n g e   t h e   R e q u e s t e d T h e m e   o n   r u n t i m e . < / p > < / b o d y > < / h t m l > ] ] > < / c o n t e n t : e n c o d e d >  
         < / i t e m >  
         < i t e m >  
             < t i t l e > W i n U I   N u m b e r B o x   C o n t r o l < / t i t l e >  
             < l i n k > h t t p s : / / w w w . r e f l e c t i o n i t . n l / b l o g / 2 0 2 0 / w i n u i - n u m b e r b o x - c o n t r o l < / l i n k >  
             < d e s c r i p t i o n   / >  
             < a u t h o r > f o n s . s o n n e m a n s @ r e f l e c t i o n i t . n l   ( F o n s   S o n n e m a n s ) < / a u t h o r >  
             < c a t e g o r y > A p p s < / c a t e g o r y >  
             < c a t e g o r y > X A M L < / c a t e g o r y >  
             < c a t e g o r y > U W P < / c a t e g o r y >  
             < c a t e g o r y > W i n U I < / c a t e g o r y >  
             < c a t e g o r y > W i n d o w s   1 0 < / c a t e g o r y >  
             < c a t e g o r y > B l e n d < / c a t e g o r y >  
             < g u i d > h t t p s : / / w w w . r e f l e c t i o n i t . n l / b l o g / 2 0 2 0 / w i n u i - n u m b e r b o x - c o n t r o l < / g u i d >  
             < p u b D a t e > F r i ,   2 7   M a r   2 0 2 0   0 0 : 0 0 : 0 0   G M T < / p u b D a t e >  
             < c o n t e n t : e n c o d e d > < ! [ C D A T A [ < h t m l > < b o d y > < p > I f   y o u   w r i t e   b u s i n e s s   a p p s ,   t h e r e   a r e   a   l o t   o f   c o n t r o l s   f o r   d a t a   i n p u t :   T e x t B o x ,   C h e c k B o x ,   C o m b o B o x ,   D a t e P i c k e r ,   T o g g l e S w i t c h ,   T i m e P i c k e r ,   R a d i o B u t t o n ,   S l i d e r ,   e t c .   I   a l w a y s   w o n d e r e d   w h y   t h e r e   w a s   n o   N u m b e r B o x .   N u m e r i c   i n p u t   i s   v e r y   c o m m o n   s o   i t   n e e d s   i t s   o w n   c o n t r o l   f o r   i t .   L u c k i l y   t h e r e   i s   t h e & # 1 6 0 ; < a   h r e f = " h t t p s : / / m i c r o s o f t . g i t h u b . i o / m i c r o s o f t - u i - x a m l / " > W i n d o w s   U I   L i b r a r y   ( W i n U I ) < / a > ,   a n & # 1 6 0 ; o p e n   s o u r c e   p r o j e c t   f r o m   M i c r o s o f t .   I   < a   h r e f = " h t t p s : / / g i t h u b . c o m / m i c r o s o f t / m i c r o s o f t - u i - x a m l / i s s u e s / 4 8 3 " > p r o p o s e d < / a >   t h e   N u m b e r B o x   l a s t   y e a r   a n d   t h e   t e a m   d i d   a   g r e a t   j o b   i m p l e m e n t i n g   i t .   I t   i s   r e l e a s e d   i n   v e r s i o n   < a   h r e f = " h t t p s : / / w w w . n u g e t . o r g / p a c k a g e s / M i c r o s o f t . U I . X a m l / 2 . 3 . 2 0 0 2 1 3 0 0 1 " > 2 . 3 < / a >   a n d   m o s t   o f   t h e   i s s u e s   a r e   n o w   s o l v e d .   T i m e   f o r   a   b l o g   p o s t   s h o w i n g   o f   i t s   f e a t u r e s . < / p >  
 < p > T h i s   a n i m a t e d   G I F   d e m o n s t r a t e s   a   f e w   o f   t h e   f e a t u r e s   l i k e   A c c e p t s E x p r e s s i o n ,   P l a c e h o l d e r T e x t ,   S p i n B u t t o n s   a n d   N u m b e r F o r m a t t e r .   I   & a p o s ; s t o l e & a p o s ;   i t   f r o m   t h i s   < a   h r e f = " h t t p s : / / t w i t t e r . c o m / W i n d o w s D o c s / s t a t u s / 1 2 4 2 8 4 7 7 3 8 8 1 7 0 5 6 7 7 3 " > t w e e t < / a > . < / p >  
 < p > < i m g   s r c = " h t t p s : / / w w w . r e f l e c t i o n i t . n l / I m a g e s / B l o g / W i n d o w s 1 0 / N u m b e r B o x / N u m b e r B o x . g i f "   a l t = " N u m b e r B o x   i n   a c t i o n "   / > < / p >  
 < h 3 > D e m o   P r o j e c t < / h 3 >  
 < p > T h e   n e x t   s c r e e n s h o t   i s   t a k e n   f r o m   m y   N u m b e r B o x T e s t   a p p / p r o j e c t .   T h e   p r o j e c t   c a n   b e   f o u n d   i n   t h i s   < a   h r e f = " h t t p s : / / g i t h u b . c o m / s o n n e m a f / N u m b e r B o x T e s t " > G i t H u b   r e p o s i t o r y < / a > . < / p >  
 < p > < i m g   s r c = " h t t p s : / / w w w . r e f l e c t i o n i t . n l / I m a g e s / B l o g / W i n d o w s 1 0 / N u m b e r B o x / N u m b e r B o x T e s t . p n g "   a l t = " M a i n P a g e   w i t h   5   N u m b e r B o x   c o n t r o l s "   w i d t h = " 6 0 0 "   / > < / p >  
 < p > O n   t h e   M a i n P a g e   t h e r e   a r e   f i v e   N u m b e r B o x   c o n t r o l s .   T h e y   a r e   d a t a b o u n d   t o   t h e   p r o p e r t i e s   o f   a   P r o d u c t   a n d   a n   E m p l o y e e   o b j e c t   w h i c h   a r e   c r e a t e d   i n   t h e   c o d e b e h i n d   o f   t h e   M a i n P a g e . < / p >  
 < p r e   c l a s s = " b r u s h :   h t m l " > & l t ; P a g e   x : C l a s s = & q u o t ; N u m b e r B o x T e s t . M a i n P a g e & q u o t ;  
             x m l n s = & q u o t ; h t t p : / / s c h e m a s . m i c r o s o f t . c o m / w i n f x / 2 0 0 6 / x a m l / p r e s e n t a t i o n & q u o t ;  
             x m l n s : x = & q u o t ; h t t p : / / s c h e m a s . m i c r o s o f t . c o m / w i n f x / 2 0 0 6 / x a m l & q u o t ;  
             x m l n s : b e h a v i o r s = & q u o t ; u s i n g : N u m b e r B o x T e s t . B e h a v i o r s & q u o t ;  
             x m l n s : c o n v e r t e r s = & q u o t ; u s i n g : N u m b e r B o x T e s t . C o n v e r t e r s & q u o t ;  
             x m l n s : d = & q u o t ; h t t p : / / s c h e m a s . m i c r o s o f t . c o m / e x p r e s s i o n / b l e n d / 2 0 0 8 & q u o t ;  
             x m l n s : i n t e r a c t i v i t y = & q u o t ; u s i n g : M i c r o s o f t . X a m l . I n t e r a c t i v i t y & q u o t ;  
             x m l n s : m c = & q u o t ; h t t p : / / s c h e m a s . o p e n x m l f o r m a t s . o r g / m a r k u p - c o m p a t i b i l i t y / 2 0 0 6 & q u o t ;  
             x m l n s : w i n u i = & q u o t ; u s i n g : M i c r o s o f t . U I . X a m l . C o n t r o l s & q u o t ;  
             B a c k g r o u n d = & q u o t ; { T h e m e R e s o u r c e   A p p l i c a t i o n P a g e B a c k g r o u n d T h e m e B r u s h } & q u o t ;  
             m c : I g n o r a b l e = & q u o t ; d & q u o t ; & g t ;  
  
         & l t ; P a g e . R e s o u r c e s & g t ;  
                 & l t ; c o n v e r t e r s : D e c i m a l T o D o u b l e C o n v e r t e r   x : K e y = & q u o t ; D e c i m a l 2 D o u b l e & q u o t ;   / & g t ;  
                 & l t ; c o n v e r t e r s : I n t T o D o u b l e C o n v e r t e r   x : K e y = & q u o t ; I n t 2 D o u b l e & q u o t ;   / & g t ;  
                 & l t ; c o n v e r t e r s : N u l l a b l e D o u b l e T o S t r i n g C o n v e r t e r   x : K e y = & q u o t ; N u l l a b l e D o u b l e 2 S t r i n g & q u o t ;   / & g t ;  
         & l t ; / P a g e . R e s o u r c e s & g t ;  
  
         & l t ; G r i d & g t ;  
                 & l t ; G r i d . C o l u m n D e f i n i t i o n s & g t ;  
                         & l t ; C o l u m n D e f i n i t i o n   W i d t h = & q u o t ; 1 * & q u o t ;   / & g t ;  
                         & l t ; C o l u m n D e f i n i t i o n   W i d t h = & q u o t ; 1 * & q u o t ;   / & g t ;  
                 & l t ; / G r i d . C o l u m n D e f i n i t i o n s & g t ;  
                 & l t ; S t a c k P a n e l   W i d t h = & q u o t ; 3 0 0 & q u o t ;  
                                         M a r g i n = & q u o t ; 8 & q u o t ;  
                                         x : D e f a u l t B i n d M o d e = & q u o t ; T w o W a y & q u o t ;  
                                         S p a c i n g = & q u o t ; 8 & q u o t ; & g t ;  
  
                         & l t ; T e x t B l o c k   S t y l e = & q u o t ; { T h e m e R e s o u r c e   T i t l e T e x t B l o c k S t y l e } & q u o t ;  
                                               T e x t = & q u o t ; P r o d u c t & q u o t ;   / & g t ;  
  
                         & l t ; T e x t B o x   H e a d e r = & q u o t ; P r o d u c t   N a m e & q u o t ;  
                                           M a x L e n g t h = & q u o t ; 1 0 & q u o t ;  
                                           T e x t = & q u o t ; { x : B i n d   P r o d u c t . P r o d u c t N a m e } & q u o t ;  
                                           T e x t W r a p p i n g = & q u o t ; W r a p & q u o t ;   / & g t ;  
  
                         & l t ; w i n u i : N u m b e r B o x   A c c e p t s E x p r e s s i o n = & q u o t ; T r u e & q u o t ;  
                                                           H e a d e r = & q u o t ; U n i t   P r i c e & q u o t ;  
                                                           M i n i m u m = & q u o t ; 0 & q u o t ;  
                                                           N u m b e r F o r m a t t e r = & q u o t ; { x : B i n d   P a t h = D u t c h D e c i m a l F o r m a t t e r ,   M o d e = O n e T i m e } & q u o t ;  
                                                           P l a c e h o l d e r T e x t = & q u o t ; Y o u   c a n   a l s o   u s e   e x p r e s s i o n s   l i k e   & a p o s ; 5   +   7 & a p o s ; & q u o t ;  
                                                           V a l u e C h a n g e d = & q u o t ; N u m b e r B o x _ V a l u e C h a n g e d & q u o t ;  
                                                           V a l u e = & q u o t ; { x : B i n d   P r o d u c t . U n i t P r i c e } & q u o t ;   / & g t ;  
  
                         & l t ; w i n u i : N u m b e r B o x   H e a d e r = & q u o t ; U n i t s   i n   S t o c k & q u o t ;  
                                                           M a x i m u m = & q u o t ; 1 0 0 0 0 & q u o t ;  
                                                           M i n i m u m = & q u o t ; 0 & q u o t ;  
                                                           N u m b e r F o r m a t t e r = & q u o t ; { x : B i n d   P a t h = I n t F o r m a t t e r ,   M o d e = O n e T i m e } & q u o t ;  
                                                           S p i n B u t t o n P l a c e m e n t M o d e = & q u o t ; I n l i n e & q u o t ;  
                                                           V a l u e C h a n g e d = & q u o t ; N u m b e r B o x _ V a l u e C h a n g e d & q u o t ;  
                                                           V a l u e = & q u o t ; { x : B i n d   P r o d u c t . U n i t s I n S t o c k ,   C o n v e r t e r = { S t a t i c R e s o u r c e   I n t 2 D o u b l e } } & q u o t ;   / & g t ;  
  
                         & l t ; S t a c k P a n e l   M a r g i n = & q u o t ; 0 , 8 & q u o t ;  
                                                 P a d d i n g = & q u o t ; 8 & q u o t ;  
                                                 x : D e f a u l t B i n d M o d e = & q u o t ; O n e W a y & q u o t ;  
                                                 B o r d e r B r u s h = & q u o t ; { T h e m e R e s o u r c e   S y s t e m E r r o r T e x t C o l o r } & q u o t ;  
                                                 B o r d e r T h i c k n e s s = & q u o t ; 2 & q u o t ;  
                                                 S p a c i n g = & q u o t ; 8 & q u o t ; & g t ;  
                                 & l t ; T e x t B l o c k   T e x t = & q u o t ; { x : B i n d   P r o d u c t . P r o d u c t N a m e } & q u o t ;   / & g t ;  
                                 & l t ; T e x t B l o c k   T e x t = & q u o t ; { x : B i n d   P r o d u c t . U n i t P r i c e } & q u o t ;   / & g t ;  
                                 & l t ; T e x t B l o c k   T e x t = & q u o t ; { x : B i n d   P r o d u c t . U n i t s I n S t o c k } & q u o t ;   / & g t ;  
                         & l t ; / S t a c k P a n e l & g t ;  
  
                 & l t ; / S t a c k P a n e l & g t ;  
  
                 & l t ; S t a c k P a n e l   G r i d . C o l u m n = & q u o t ; 1 & q u o t ;  
                                         W i d t h = & q u o t ; 3 0 0 & q u o t ;  
                                         M a r g i n = & q u o t ; 8 & q u o t ;  
                                         x : D e f a u l t B i n d M o d e = & q u o t ; T w o W a y & q u o t ;  
                                         S p a c i n g = & q u o t ; 8 & q u o t ; & g t ;  
  
                         & l t ; T e x t B l o c k   S t y l e = & q u o t ; { T h e m e R e s o u r c e   T i t l e T e x t B l o c k S t y l e } & q u o t ;  
                                               T e x t = & q u o t ; E m p l o y e e & q u o t ;   / & g t ;  
  
                         & l t ; T e x t B o x   H e a d e r = & q u o t ; N a m e & q u o t ;  
                                           M a x L e n g t h = & q u o t ; 1 0 & q u o t ;  
                                           T e x t = & q u o t ; { x : B i n d   E m p l o y e e . N a m e } & q u o t ;  
                                           T e x t W r a p p i n g = & q u o t ; W r a p & q u o t ;   / & g t ;  
  
                         & l t ; w i n u i : N u m b e r B o x   A c c e p t s E x p r e s s i o n = & q u o t ; T r u e & q u o t ;  
                                                           H e a d e r = & q u o t ; S a l a r y & q u o t ;  
                                                           I s W r a p E n a b l e d = & q u o t ; t r u e & q u o t ;  
                                                           M i n i m u m = & q u o t ; 1 0 0 & q u o t ;  
                                                           N u m b e r F o r m a t t e r = & q u o t ; { x : B i n d   P a t h = D u t c h D e c i m a l F o r m a t t e r ,   M o d e = O n e T i m e } & q u o t ;  
                                                           S p i n B u t t o n P l a c e m e n t M o d e = & q u o t ; H i d d e n & q u o t ;  
                                                           V a l u e = & q u o t ; { x : B i n d   E m p l o y e e . S a l a r y ,   C o n v e r t e r = { S t a t i c R e s o u r c e   D e c i m a l 2 D o u b l e } } & q u o t ; & g t ;  
                                 & l t ; i n t e r a c t i v i t y : I n t e r a c t i o n . B e h a v i o r s & g t ;  
                                         & l t ; b e h a v i o r s : N a n T o M i n i m u m B e h a v i o r   / & g t ;  
                                 & l t ; / i n t e r a c t i v i t y : I n t e r a c t i o n . B e h a v i o r s & g t ;  
                         & l t ; / w i n u i : N u m b e r B o x & g t ;  
  
                         & l t ; w i n u i : N u m b e r B o x   H e a d e r = & q u o t ; B o n u s & q u o t ;  
                                                           M i n i m u m = & q u o t ; 0 & q u o t ;  
                                                           N u m b e r F o r m a t t e r = & q u o t ; { x : B i n d   P a t h = D u t c h D e c i m a l F o r m a t t e r ,   M o d e = O n e T i m e } & q u o t ;  
                                                           S m a l l C h a n g e = & q u o t ; 1 0 0 & q u o t ;  
                                                           S p i n B u t t o n P l a c e m e n t M o d e = & q u o t ; C o m p a c t & q u o t ;  
                                                           T e x t = & q u o t ; { x : B i n d   E m p l o y e e . B o n u s ,   C o n v e r t e r L a n g u a g e = n l - N L ,   C o n v e r t e r = { S t a t i c R e s o u r c e   N u l l a b l e D o u b l e 2 S t r i n g } } & q u o t ;   / & g t ;  
  
                         & l t ; w i n u i : N u m b e r B o x   H e a d e r = & q u o t ; A g e & q u o t ;  
                                                           M a x i m u m = & q u o t ; 1 0 0 & q u o t ;  
                                                           M i n i m u m = & q u o t ; 1 6 & q u o t ;  
                                                           S p i n B u t t o n P l a c e m e n t M o d e = & q u o t ; I n l i n e & q u o t ;  
                                                           V a l u e = & q u o t ; { x : B i n d   E m p l o y e e . A g e ,   C o n v e r t e r = { S t a t i c R e s o u r c e   I n t 2 D o u b l e } } & q u o t ; & g t ;  
                                 & l t ; i n t e r a c t i v i t y : I n t e r a c t i o n . B e h a v i o r s & g t ;  
                                         & l t ; b e h a v i o r s : N a n T o M i n i m u m B e h a v i o r   / & g t ;  
                                         & l t ; b e h a v i o r s : I n t N u m b e r F o r m a t t e r B e h a v i o r   / & g t ;  
                                 & l t ; / i n t e r a c t i v i t y : I n t e r a c t i o n . B e h a v i o r s & g t ;  
                         & l t ; / w i n u i : N u m b e r B o x & g t ;  
  
                         & l t ; S t a c k P a n e l   M a r g i n = & q u o t ; 0 , 8 & q u o t ;  
                                                 P a d d i n g = & q u o t ; 8 & q u o t ;  
                                                 x : D e f a u l t B i n d M o d e = & q u o t ; O n e W a y & q u o t ;  
                                                 B o r d e r B r u s h = & q u o t ; { T h e m e R e s o u r c e   S y s t e m E r r o r T e x t C o l o r } & q u o t ;  
                                                 B o r d e r T h i c k n e s s = & q u o t ; 2 & q u o t ;  
                                                 S p a c i n g = & q u o t ; 8 & q u o t ; & g t ;  
                                 & l t ; T e x t B l o c k   T e x t = & q u o t ; { x : B i n d   E m p l o y e e . N a m e } & q u o t ;   / & g t ;  
                                 & l t ; T e x t B l o c k   T e x t = & q u o t ; { x : B i n d   E m p l o y e e . S a l a r y } & q u o t ;   / & g t ;  
                                 & l t ; T e x t B l o c k   T e x t = & q u o t ; { x : B i n d   E m p l o y e e . B o n u s } & q u o t ;   / & g t ;  
                                 & l t ; T e x t B l o c k   T e x t = & q u o t ; { x : B i n d   E m p l o y e e . A g e } & q u o t ;   / & g t ;  
                         & l t ; / S t a c k P a n e l & g t ;  
  
                 & l t ; / S t a c k P a n e l & g t ;  
         & l t ; / G r i d & g t ;  
 & l t ; / P a g e & g t ;  
 < / p r e >  
 < p > I n   t h e   c o d e b e h i n d   o f   t h e   M a i n P a g e   ( M a i n P a g e . x a m l . c s )   t h e   P r o d u c t   a n d   E m p l o y e e   o b j e c t s   a r e   c r e a t e d .   I t   a l s o   c o n t a i n s   t w o   D e c i m a l F o r m a t t e r   p r o p e r t i e s   a n d   a   N u m b e r B o x _ V a l u e C h a n g e d   e v e n t h a n d l e r . < / p >  
 < p r e   c l a s s = " b r u s h :   c s h a r p " > u s i n g   M i c r o s o f t . U I . X a m l . C o n t r o l s ;  
 u s i n g   N u m b e r B o x T e s t . M o d e l s ;  
 u s i n g   W i n d o w s . G l o b a l i z a t i o n . N u m b e r F o r m a t t i n g ;  
 u s i n g   W i n d o w s . U I . X a m l . C o n t r o l s ;  
  
 n a m e s p a c e   N u m b e r B o x T e s t   {  
         p u b l i c   s e a l e d   p a r t i a l   c l a s s   M a i n P a g e   :   P a g e   {  
  
                 p u b l i c   M a i n P a g e ( )   {  
                         t h i s . I n i t i a l i z e C o m p o n e n t ( ) ;  
                 }  
  
                 p r i v a t e   D e c i m a l F o r m a t t e r   D u t c h D e c i m a l F o r m a t t e r   {   g e t ;   }   =  
                         n e w   D e c i m a l F o r m a t t e r ( n e w [ ]   {   & q u o t ; n l - N L & q u o t ;   } ,   & q u o t ; N L & q u o t ; )   {  
                                 I s G r o u p e d   =   t r u e ,  
                                 F r a c t i o n D i g i t s   =   2 ,  
                                 N u m b e r R o u n d e r   =   n e w   I n c r e m e n t N u m b e r R o u n d e r   {  
                                         I n c r e m e n t   =   0 . 0 1 ,  
                                         R o u n d i n g A l g o r i t h m   =   R o u n d i n g A l g o r i t h m . R o u n d H a l f U p ,  
                                 }  
                         } ;  
  
                 p r i v a t e   D e c i m a l F o r m a t t e r   I n t F o r m a t t e r   {   g e t ;   }   =  
                         n e w   D e c i m a l F o r m a t t e r ( n e w [ ]   {   & q u o t ; n l - N L & q u o t ;   } ,   & q u o t ; N L & q u o t ; )   {  
                                 I s G r o u p e d   =   f a l s e ,  
                                 F r a c t i o n D i g i t s   =   0 ,  
                                 N u m b e r R o u n d e r   =   n e w   I n c r e m e n t N u m b e r R o u n d e r ( ) ,  
                         } ;  
  
                 i n t e r n a l   E m p l o y e e   E m p l o y e e   {   g e t ;   }   =   n e w   E m p l o y e e   {  
                         N a m e   =   & q u o t ; F o n s & q u o t ; ,  
                         S a l a r y   =   2 0 0 0 ,  
                         B o n u s   =   1 0 0 ,  
                         A g e   =   5 0  
                 } ;  
  
                 i n t e r n a l   P r o d u c t   P r o d u c t   {   g e t ;   }   =   n e w   P r o d u c t   {  
                         P r o d u c t N a m e   =   & q u o t ; S u r f a c e   P r o & q u o t ; ,  
                         U n i t P r i c e   =   1 2 9 9 ,  
                         U n i t s I n S t o c k   =   5 0  
                 } ;  
  
                 p r i v a t e   v o i d   N u m b e r B o x _ V a l u e C h a n g e d ( N u m b e r B o x   s e n d e r ,    
                                                                                         N u m b e r B o x V a l u e C h a n g e d E v e n t A r g s   a r g s )   {  
                         i f   ( d o u b l e . I s N a N ( a r g s . N e w V a l u e ) )   {  
                                 s e n d e r . V a l u e   =   s e n d e r . M i n i m u m ;  
                         }  
                 }  
  
         }  
 }  
 < / p r e >  
 < h 3 > N u m b e r F o r m a t t e r < / h 3 >  
 < p > T h e   D u t c h D e c i m a l F o r m a t t e r   a n d   I n t F o r m a t t e r   p r o p e r t i e s   i n   t h e   M a i n P a g e . x a m l . c s   a r e   u s e d   t o   f o r m a t   t h e   & a p o s ; m o n e y & a p o s ;   N u m b e r B o x e s   ( U n i t P r i c e ,   S a l a r y   a n d   B o n u s )   a n d   t h e   & a p o s ; i n t & a p o s ;   N u m b e r B o x e s   ( U n i t s I n S t o c k   a n d   A g e ) .   T h e   N u m b e r F o r m a t t e r   p r o p e r t y   o f   e a c h   N u m b e r B o x   i s   s e t   t o   t h e s e   p r o p e r t i e s   u s i n g   x : B i n d   o r   a   B e h a v i o r .   T h e   D u t c h D e c i m a l F o r m a t t e r   w i l l   f o r m a t   t h e   & a p o s ; m o n e y & a p o s ;   u s i n g   t h e   & a p o s ; n l & a p o s ;   r e g i o n .   T h i s   r e g i o n   u s e s   a   c o m m a   f o r   f r a c t i o n s   a n d   a   d o t   f o r   g r o u p i n g .   I t   h a s   F r a c t i o n D i g i t s   w i c h   i s   s e t   t o   2   a n d   t h e   N u m b e r R o u n d e r   i s   s e t   t o   0 . 0 1 .   S o   i f   t h e   u s e r s   e n t e r s   t h e   v a l u e   1 , 0 0 6   i t   i s   c o n v e r t e d   t o   1 , 0 1 .   A   v a l u e   o f   1 , 0 0 4   i s   c o n v e r t e d   t o   1 , 0 0 .   T h e   I n t F o r m a t t e r   h a s   a   F r a c t i o n D i g i t s   o f   0   b e c a u s e   i t   i s   a n   i n t .   I   t h i n k   y o u   s h o u l d   a l w a y s   s e t   t h e   N u m b e r F o r m a t t e r   p r o p e r t y   o f   e v e r y   N u m b e r B o x .   I   l i k e   b e h a v i o r s   s o   I   c r e a t e d   t h i s   I n t N u m b e r F o r m a t t e r B e h a v i o r   t o   s e t   t h e   N u m b e r F o r m m a t e r .   Y o u   h a v e   t o   r e f e r e n c e   t h e & # 1 6 0 ; < a   h r e f = " h t t p s : / / w w w . n u g e t . o r g / p a c k a g e s / M i c r o s o f t . X a m l . B e h a v i o r s . U w p . M a n a g e d / " > M i c r o s o f t . X a m l . B e h a v i o r s . U w p . M a n a g e d < / a > & # 1 6 0 ; N u G e t   p a c k a g e   t o   m a k e   i t   w o r k .   Y o u   c a n   e a s i l y   a s s i g n   i t   t o   a   N u m b e r B o x   i n   B l e n d   f o r   V i s u a l S t u d i o .   J u s t   D r a g   & a m p ;   D r o p   i t   f r o m   t h e   A s s e t s   p a n e l   o n t o   a   N u m b e r B o x . < / p >  
 < p r e   c l a s s = " b r u s h :   c s h a r p " > c l a s s   I n t N u m b e r F o r m a t t e r B e h a v i o r   :   B e h a v i o r & l t ; N u m b e r B o x & g t ;   {  
  
         p r i v a t e   s t a t i c   D e c i m a l F o r m a t t e r   I n t F o r m a t t e r   {   g e t ;   }   =  
                 n e w   D e c i m a l F o r m a t t e r ( n e w [ ]   {   & q u o t ; n l - N L & q u o t ;   } ,   & q u o t ; N L & q u o t ; )   {  
                         I s G r o u p e d   =   f a l s e ,  
                         F r a c t i o n D i g i t s   =   0 ,  
                         N u m b e r R o u n d e r   =   n e w   I n c r e m e n t N u m b e r R o u n d e r ( ) ,  
                 } ;  
  
         p r o t e c t e d   o v e r r i d e   v o i d   O n A t t a c h e d ( )   {  
                 b a s e . O n A t t a c h e d ( ) ;  
                 t h i s . A s s o c i a t e d O b j e c t . N u m b e r F o r m a t t e r   =   I n t F o r m a t t e r ;  
         }  
 }  
 < / p r e >  
 < p > & # 1 6 0 ; < / p >  
 < h 3 > S p i n B u t t o n s < / h 3 >  
 < p > < i m g   s r c = " h t t p s : / / w w w . r e f l e c t i o n i t . n l / I m a g e s / B l o g / W i n d o w s 1 0 / N u m b e r B o x / S p i n B u t t o n s . p n g "   a l t = " "   w i d t h = " 4 2 3 "   / > < / p >  
 < p > T h e   N u m b e r B o x   s u p p o r t s   s p i n   b u t t o n s   t o   i n c r e a s e   o r   d e c r e a s e   t h e   v a l u e .   T h e y   c a n   b e   p l a c e d   & a p o s ; C o m p a c t & a p o s ;   o r   & a p o s ; I n l i n e & a p o s ; .   Y o u   c a n   a l s o   u s e   t h e   U p / D o w n   c u r s o r   k e y s   f o r   a   s m a l l   c h a n g e   a n d   t h e   P a g e U p / P a g e D o w n   f o r   a   l a r g e   c h a n g e . < / p >  
 < p r e   c l a s s = " b r u s h :   h t m l " > & l t ; w i n u i : N u m b e r B o x   H e a d e r = & q u o t ; B o n u s & q u o t ;  
                                   M i n i m u m = & q u o t ; 0 & q u o t ;  
                                   N u m b e r F o r m a t t e r = & q u o t ; { x : B i n d   P a t h = D u t c h D e c i m a l F o r m a t t e r ,   M o d e = O n e T i m e } & q u o t ;  
                                   S m a l l C h a n g e = & q u o t ; 1 0 & q u o t ;  
                                   L a r g e C h a n g e = & q u o t ; 1 0 0 & q u o t ;  
                                   S p i n B u t t o n P l a c e m e n t M o d e = & q u o t ; C o m p a c t & q u o t ;  
                                   T e x t = & q u o t ; { x : B i n d   E m p l o y e e . B o n u s ,   C o n v e r t e r L a n g u a g e = n l - N L ,   C o n v e r t e r = { S t a t i c R e s o u r c e   N u l l a b l e D o u b l e 2 S t r i n g } } & q u o t ;   / & g t ;  
 < / p r e >  
 < p > & # 1 6 0 ; < / p >  
 < h 3 > A c c e p t s E x p r e s s i o n   & a m p ; & # 1 6 0 ; P l a c e h o l d e r T e x t < / h 3 >  
 < p > < i m g   s r c = " h t t p s : / / w w w . r e f l e c t i o n i t . n l / I m a g e s / B l o g / W i n d o w s 1 0 / N u m b e r B o x / E x p r e s s i o n . p n g "   a l t = " A c c e p t s E x p r e s s i o n "   w i d t h = " 4 0 9 "   / > < / p >  
 < p > I f   t h e   A c c e p t s E x p r e s s i o n   p r o p e r t y   i s   s e t   t o   T r u e   y o u   c a n   u s e   t h e   N u m b e r B o x   a s   a   c a l c u l a t o r .   Y o u   c a n   t y p e   a n   e x p r e s s i o n   f o r   e x a m p l e   & a p o s ; 5   +   7 & a p o s ; .   T h e   v a l u e   ( 1 2 )   i s   c a l c u l a t e d   w h e n   y o u   h i t   E n t e r   o r   l e a v e   t h e   N u m b e r B o x .   T h e   P l a c e h o l d e r T e x t   c a n   b e   u s e d   t o   e x p l a i n   t h i s   f e a t u r e   t o   t h e   u s e r . < / p >  
 < p r e   c l a s s = " b r u s h :   h t m l " > & l t ; w i n u i : N u m b e r B o x   A c c e p t s E x p r e s s i o n = & q u o t ; T r u e & q u o t ;  
                                   H e a d e r = & q u o t ; U n i t   P r i c e & q u o t ;  
                                   M i n i m u m = & q u o t ; 0 & q u o t ;  
                                   N u m b e r F o r m a t t e r = & q u o t ; { x : B i n d   P a t h = D u t c h D e c i m a l F o r m a t t e r ,   M o d e = O n e T i m e } & q u o t ;  
                                   P l a c e h o l d e r T e x t = & q u o t ; Y o u   c a n   a l s o   u s e   e x p r e s s i o n s   l i k e   & a p o s ; 5   +   7 & a p o s ; & q u o t ;  
                                   V a l u e C h a n g e d = & q u o t ; N u m b e r B o x _ V a l u e C h a n g e d & q u o t ;  
                                   V a l u e = & q u o t ; { x : B i n d   P r o d u c t . U n i t P r i c e } & q u o t ;   / & g t ;  
 < / p r e >  
 < p > & # 1 6 0 ; < / p >  
 < h 3 > M i n i m u m   a n d   M a x i m u m < / h 3 >  
 < p > < i m g   s r c = " h t t p s : / / w w w . r e f l e c t i o n i t . n l / I m a g e s / B l o g / W i n d o w s 1 0 / N u m b e r B o x / M i n i m u m . p n g "   a l t = " M i n i m u m   a n d   M a x i m u m "   w i d t h = " 4 1 4 "   / > < / p >  
 < p > T h e   N u m b e r B o x   h a s   M i n i m u m   a n d   M a x i m u m   p r o p e r t i e s   t h a t   e n s u r e   t h e   u s e r   c a n n o t   s e t   a   V a l u e   b e l o w   t h e   M i n i m u m   o r   a b o v e   t h e   M a x i m u m .   Y o u   c a n ,   a l t h o u g h ,   c l e a r   t h e   c o n t e n t   o f   a   N u m b e r B o x .   T h e   ( d o u b l e )   V a l u e   p r o p e r t y   w i l l   g e t   t h e   v a l u e   N A N   ( n o t   a   n u m b e r ) .   T h i s   i s   c o r r e c t   b e c a u s e   N A N   i s   n o t   a b o v e   o r   b e l o w   a n y t h i n g .   I   d o n & a p o s ; t   l i k e   t h i s   s o   I   c a m e   u p   w i t h   a   s o l u t i o n   w h e r e   t h e   V a l u e   o f   a n   e m p t y   N u m b e r B o x   i s   s e t   t o   t h e   M i n i m u m .   I   u s e d   t w o   s o l u t i o n s   f o r   t h i s .   T h e   f i r s t   i s   u s i n g   t h e   V a l u e C h a n g e d   e v e n t   o f   t h e   N u m b e r B o x .   I n   t h e   N u m b e r B o x _ V a l u e C h a n g e d   m e t h o d   t h e   N e w V a l u e   i s   t e s t e d   f o r   N A N   a n d   t h e n   t h e   V a l u e   i s   s e t   t o   t h e   M i n i m u m .   T h e   s e c o n d   s o l u t i o n   i s   u s i n g   m y   N a n T o M i n i m u m B e h a v i o r .   Y o u   c a n   e a s i l y   a s s i g n   i t   t o   a   N u m b e r B o x   i n   B l e n d   f o r   V i s u a l S t u d i o .   J u s t   D r a g   & a m p ;   D r o p   i t   f r o m   t h e   A s s e t s   p a n e l   o n t o   a   N u m b e r B o x . < / p >  
 < p r e   c l a s s = " b r u s h :   c s h a r p " > c l a s s   N a n T o M i n i m u m B e h a v i o r   :   B e h a v i o r & l t ; N u m b e r B o x & g t ;   {  
  
         p r o t e c t e d   o v e r r i d e   v o i d   O n A t t a c h e d ( )   {  
                 b a s e . O n A t t a c h e d ( ) ;  
                 t h i s . A s s o c i a t e d O b j e c t . V a l u e C h a n g e d   + =   A s s o c i a t e d O b j e c t _ V a l u e C h a n g e d ;  
         }  
  
         p r o t e c t e d   o v e r r i d e   v o i d   O n D e t a c h i n g ( )   {  
                 b a s e . O n D e t a c h i n g ( ) ;  
                 t h i s . A s s o c i a t e d O b j e c t . V a l u e C h a n g e d   - =   A s s o c i a t e d O b j e c t _ V a l u e C h a n g e d ;  
         }  
  
         p r i v a t e   v o i d   A s s o c i a t e d O b j e c t _ V a l u e C h a n g e d ( N u m b e r B o x   s e n d e r ,   N u m b e r B o x V a l u e C h a n g e d E v e n t A r g s   a r g s )   {  
                 i f   ( d o u b l e . I s N a N ( a r g s . N e w V a l u e ) )   {  
                         s e n d e r . V a l u e   =   s e n d e r . M i n i m u m ;  
                 }  
         }  
 }  
 < / p r e >  
 < p > & # 1 6 0 ; < / p >  
 < h 3 > V a l u e   & a m p ;   B i n d i n g < / h 3 >  
 < p > T h e   V a l u e   o f   t h e   N u m b e r B o x   c o n t r o l s   a r e   d a t a b o u n d   t o   t h e   p r o p e r t i e s   o f   a   P r o d u c t   o r   E m p l o y e e .   I   h a v e   c h o s e n   a l l   k i n d   o f   d a t a t y p e s   f o r   t h e s e   p r o p e r t i e s :   d o u b l e ,   d o u b l e ? ,   d e c i m a l   a n d   i n t .   B i n d i n g   t o   a   d o u b l e   i s   s i m p l e   b e c a u s e   t h e   V a l u e   p r o p e r t y   i s   a l s o   o f   t h e   t y p e   d o u b l e . < / p >  
 < p > < i m g   s r c = " h t t p s : / / w w w . r e f l e c t i o n i t . n l / I m a g e s / B l o g / W i n d o w s 1 0 / N u m b e r B o x / C l a s s D i a g r a m . p n g "   a l t = " C l a s s D i a g r a m "   w i d t h = " 6 0 0 "   / > < / p >  
 < p > I   h a v e   c r e a t e d   a   f e w   V a l u e C o n v e r t e r   c l a s s e s   t o   b i n d   t o   t h e   d e c i m a l ,   i n t   a n d   n u l l a b l e   d o u b l e   ( d o u b l e ? ) . < / p >  
 < p r e   c l a s s = " b r u s h :   c s h a r p " > c l a s s   D e c i m a l T o D o u b l e C o n v e r t e r   :   I V a l u e C o n v e r t e r   {  
  
         p u b l i c   o b j e c t   C o n v e r t ( o b j e c t   v a l u e ,   T y p e   t a r g e t T y p e ,   o b j e c t   p a r a m e t e r ,   s t r i n g   l a n g u a g e )   {  
                 r e t u r n   S y s t e m . C o n v e r t . T o D o u b l e ( v a l u e ) ;  
         }  
  
         p u b l i c   o b j e c t   C o n v e r t B a c k ( o b j e c t   v a l u e ,   T y p e   t a r g e t T y p e ,   o b j e c t   p a r a m e t e r ,   s t r i n g   l a n g u a g e )   {  
                 r e t u r n   d o u b l e . I s N a N ( ( d o u b l e ) v a l u e )  
                         ?   ( p a r a m e t e r   i s   o b j e c t   ?   S y s t e m . C o n v e r t . T o D e c i m a l ( p a r a m e t e r )   :   0 )  
                         :   S y s t e m . C o n v e r t . T o D e c i m a l ( v a l u e ) ;  
         }  
 }  
  
 c l a s s   I n t T o D o u b l e C o n v e r t e r   :   I V a l u e C o n v e r t e r   {  
  
         p u b l i c   o b j e c t   C o n v e r t ( o b j e c t   v a l u e ,   T y p e   t a r g e t T y p e ,   o b j e c t   p a r a m e t e r ,   s t r i n g   l a n g u a g e )   {  
                 r e t u r n   S y s t e m . C o n v e r t . T o D o u b l e ( v a l u e ) ;  
         }  
  
         p u b l i c   o b j e c t   C o n v e r t B a c k ( o b j e c t   v a l u e ,   T y p e   t a r g e t T y p e ,   o b j e c t   p a r a m e t e r ,   s t r i n g   l a n g u a g e )   {  
                 r e t u r n   d o u b l e . I s N a N ( ( d o u b l e ) v a l u e )    
                         ?   ( p a r a m e t e r   i s   o b j e c t   ?   S y s t e m . C o n v e r t . T o I n t 3 2 ( p a r a m e t e r )   :   0 )    
                         :   S y s t e m . C o n v e r t . T o I n t 3 2 ( v a l u e ) ;  
         }  
 }  
  
 c l a s s   N u l l a b l e D o u b l e T o S t r i n g C o n v e r t e r   :   I V a l u e C o n v e r t e r   {  
  
         p u b l i c   o b j e c t   C o n v e r t ( o b j e c t   v a l u e ,   T y p e   t a r g e t T y p e ,   o b j e c t   p a r a m e t e r ,   s t r i n g   l a n g u a g e )   {  
                 r e t u r n   v a l u e   i s   o b j e c t   ?   v a l u e . T o S t r i n g ( )   :   s t r i n g . E m p t y ;  
         }  
  
         p u b l i c   o b j e c t   C o n v e r t B a c k ( o b j e c t   v a l u e ,   T y p e   t a r g e t T y p e ,   o b j e c t   p a r a m e t e r ,   s t r i n g   l a n g u a g e )   {  
                 r e t u r n   s t r i n g . I s N u l l O r W h i t e S p a c e ( ( s t r i n g ) v a l u e )   ?    
                         ( d o u b l e ? ) n u l l   :    
                         d o u b l e . P a r s e ( ( s t r i n g ) v a l u e ,   C u l t u r e I n f o . G e t C u l t u r e I n f o ( l a n g u a g e ) ) ;  
         }  
 }  
 < / p r e >  
 < p > T h e   B o n u s   p r o p e r t y   o f   t h e   E m p l o y e e   c l a s s   i s   a   d o u b l e ? .   T h e   V a l u e   p r o p e r t y   o f   t h e   N u m b e r B o x   i s   a   n o r m a l   d o u b l e .   Y o u   c a n & a p o s ; t   u s e   x : B i n d   f o r   t h i s   a n d   I   d o n & a p o s ; t   l i k e   o l d - s c h o o l   b i n d i n g .   T h e   s o l u t i o n   I   c a m e   u p   w i t h   i s   t o   u s e   t h e   T e x t   p r o p e r t y   o f   t h e   N u m b e r B o x   i n   c o m b i n a t i o n   w i t h   t h e   N u l l a b l e D o u b l e T o S t r i n g C o n v e r t e r   c o n v e r t e r .   T h e   c o n v e r t e r   w i l l   c o n v e r t   a n   s t r i n g   t o / f r o m   a   d o u b l e ? .   I f   t h e   t e x t   i s   e m p t y   t h e   v a l u e   w i l l   b e   n u l l . < / p >  
 < h 3 > C l o s u r e < / h 3 >  
 < p > W r i t i n g   t h e   N u m b e r B o x   p r o p o s a l   a n d   w o r k i n g   w i t h   t h e   W i n U I   t e a m   t o   g e t   s p e c s   r i g h t   w a s   a   g r e a t   e x p e r i e n c e .   I   c a n   r e c o m m e n d   e v e r y o n e   t o   g e t   i n v o l v e d   a n d   s u g g e s t   n e w   c o n t r o l s   o r   f e a t u r e s . < / p >  
 < p > H e r e   a r e   s o m e   o t h e r   l i n k s   y o u   m i g h t   b e   i n t e r e s t i n g : < / p >  
 < u l >  
 < l i > < a   h r e f = " h t t p s : / / d o c s . m i c r o s o f t . c o m / e n - u s / w i n d o w s / u w p / d e s i g n / c o n t r o l s - a n d - p a t t e r n s / n u m b e r - b o x " > N u m b e r B o x   G u i d e l i n e s   D o c u m e n t a t i o n < / a > < / l i >  
 < l i > < a   h r e f = " h t t p s : / / d o c s . m i c r o s o f t . c o m / e n - u s / u w p / a p i / m i c r o s o f t . u i . x a m l . c o n t r o l s . n u m b e r b o x ? v i e w = w i n u i - 2 . 3 " > N u m b e r B o x   A P I   D o c u m e n t a t i o n < / a > < / l i >  
 < l i > < a   h r e f = " h t t p s : / / w w w . m i c r o s o f t . c o m / s t o r e / p r o d u c t I d / 9 M S V H 1 2 8 X 2 Z T " > X a m l   C o n t r o l s   G a l l e r y   A p p < / a >   w h e r e   N u m b e r B o x   c a n   b e   s e e n   i n   a c t i o n   a l o n g s i d e   m o r e   s a m p l e   c o d e < / l i >  
 < l i > < a   h r e f = " h t t p s : / / g i t h u b . c o m / m i c r o s o f t / m i c r o s o f t - u i - x a m l / i s s u e s / 1 7 3 6 " > N u m b e r B o x   V 2   P r o p o s a l < / a > < / l i >  
 < / u l >  
 < p > L a s t ,   i t   m a y   a l s o   b e   i n t e r e s t i n g   f o r   y o u   t o   n o t e   t h a t   < a   h r e f = " h t t p s : / / g i t h u b . c o m / m i c r o s o f t / m i c r o s o f t - u i - x a m l - s p e c s / b l o b / u s e r / s a v o y s c h u l e r / n u m b e r b o x / a c t i v e / N u m b e r B o x / N u m b e r B o x . m d # r e q u i r e d " > i n t e g r a t e d   i n p u t   v a l i d a t i o n   i s   p l a n n e d   f o r   N u m b e r B o x < / a >   a n d   s h o u l d   b e   u n b l o c k e d   w i t h   t h e   r e l e a s e   o f   W i n U I   3 .   =Ø
Þ< / p >  
 < p > & # 1 6 0 ; F o n s < / p > < / b o d y > < / h t m l > ] ] > < / c o n t e n t : e n c o d e d >  
         < / i t e m >  
     < / c h a n n e l >  
 < / r s s > 