DCSIMG
July 2010 - Posts - I Love C#
Sign in | Join | Help

I Love C#

Eyal Vardi

July 2010 - Posts

Command is Out Behavior is In

פורסם בתאריך Jul 19 2010, 06:01 PM על ידי Vardi

Command is Out Behavior is In

אף פעם לא אהבתי את הרעיון של Delegate Command הרגשתי שאני כותב קוד "צנרת" בתוך VM שאין בו היגיון, אך זה לא החיסרון היחיד שיש ל-Command.

1. יש רק פרמטר אחד בשם CommandParmeter שהוא מסוג אוביקט.

2. אני לא שולט על ה-Trigger או ה-Event שמפעיל את ה-Command.

פתרון ותחליף ל- Command שעובד גם ב-WPF ו- Silverlight זה שימוש ב-Trigger ו- Action. ( ראו פוסט ראשון בנושא ). הצוות של Blend 4 כתב בשבילנו מספר Behaviors שעושים לנו את החיים מאוד נוחים.

לינק לרשימת ה- Behaviors שקיימים ב-Blend 4 SDK. ה-Behaviors שיכולים להחליף את ה- Command הם:

 CallMethodAction - Use the CallMethodAction action to call a method on the DataContext of an element when an event occurs. For more information about this action, see CallMethodAction.

 InvokeCommandAction - Use the InvokeCommandAction action to invoke a command exposed by the data source.

היתרונות:

1. אפשר לעבוד איתם עם Blend ע"י Drag&Drop וחלון ה-Properties. ( פשוט וקל בלי קוד )

2. אני קובע איזה Trigger יפעיל את ה- Action.

3. אני תמיד יכול לכתוב Action משלי שיש לו מספר רב של DP כך שאני מקבל ריבוי של פרמטרים ולא אחד כמו ב-Command.

לסיכום:

עבודה עם TAB ( Triggers, Actions & Behaviors ) מקטינה את כמות הקוד ב-VM ונותנת ל-XAMLליסת יותר כוח ליצור מסכים אינטראקטיבים + מידע.

הקוד והמצגות מסדנת הארכיטקטורה

פורסם בתאריך Jul 11 2010, 02:59 AM על ידי Vardi

ב-15-6 העברתי שתי מצגות בסדנת הארכיטקטורה של מיקרוסופט. לחצו כאן להוריד את החומרים.

Things that every architect should know about WPF & Silverlight

Ever asked yourself what are the core capabilities that make WPF & Silverlight so different than other UI technology and how can it help me to create a compelling and differentiated user experience LOB apps in a productive manner. In this session we will cover the core concepts in WPF and Silverlight programing models and understand their values.

Overview of the new WCF Services

WCF 4 provides a coherent and unified services strategy for .NET. In this session we’ll go thru the newest WPC services capabilities and usage pattern which includes the WCF Data Services, WCF RIA Services and WCF Workflow Services.

נשבר האיפון, מה עושים?

פורסם בתאריך Jul 10 2010, 02:50 AM על ידי Vardi

lab לפני כמה ימים התרסק האיפון שלי, הזכוכית נשברה. הלכתי לפרטנר והם רצו על תיקון
הזכוכית 1,300 ש"ח והתיקון יכול לקחת מספר ימים. 

אז חיפשתי פתרון אחר ומצאתי באינטרנט את האתר http://www.johnnyphone.com/.
הם תיקנו לי את האיפון ב-350 ש"ח תוך 20 דקות.

לסיכום מה שאני רוצה להגיד שפרטנר הם פשוט …

Data Bindings in a WPF or Silverlight Application

פורסם בתאריך Jul 03 2010, 05:07 AM על ידי Vardi

אחת השאלות שתמיד חוזרת, איך מדבגים XAML ובפרט DataBinding. הפוסט הבא סוקר מספר פתרונות.

Debugging Data Bindings in a WPF or Silverlight Application.

מספר לינקים טובים בנושא Data Binding:

לפוסטים נוספים שאני אוהב לחצו כאן. ( http://www.google.com/reader/shared/evardi )