نمایش نتایج 1 تا 4 از 4

نام تاپیک: کاربرد Template ها و تفاوت اونها با Style؟

  1. #1
    کاربر دائمی آواتار sajad_3dmax
    تاریخ عضویت
    مرداد 1388
    محل زندگی
    قزوین _ زیباشهر
    پست
    296

    Red face کاربرد Template ها و تفاوت اونها با Style؟

    با سلام. من یه سری مطلب تو فایلهای PDF راجع به Template خوندم ولی چیزی درباره دلیل استفاده از Template هانفهمیدم . لطفا راهنماییم کنید.

  2. #2
    VIP آواتار رضا عربلو
    تاریخ عضویت
    اردیبهشت 1403
    محل زندگی
    تهران
    پست
    1,597

    نقل قول: کاربرد Template ها و تفاوت اونها با Style؟

    Style is used to set the properties of an object to particular values. In addition, a Style allows Triggers based on styled object events, styled object property values, and data values. In turn, triggers allow the animation of the object's properties.

    In contrast, a Template is used to define the Visual Tree of a Control (ControlTemplate) or the Visual Tree of the representation of an object (DataTemplate). While templates also have Triggers, it is to be noted that Style triggers cannot interract with particular items of the Visual Tree for the object.

    One common distinction of Styles and Templates states that a Style can contain one/many Setters/Triggers to change the ControlTemplate or DataTemplate of controls/objects.
    اگر Net. نمی دانید وارد نشوید.

  3. #3
    کاربر دائمی آواتار sajad_3dmax
    تاریخ عضویت
    مرداد 1388
    محل زندگی
    قزوین _ زیباشهر
    پست
    296

    نقل قول: کاربرد Template ها و تفاوت اونها با Style؟

    نقل قول نوشته شده توسط رضا عربلو مشاهده تاپیک
    Style is used to set the properties of an object to particular values. In addition, a Style allows Triggers based on styled object events, styled object property values, and data values. In turn, triggers allow the animation of the object's properties.

    In contrast, a Template is used to define the Visual Tree of a Control (ControlTemplate) or the Visual Tree of the representation of an object (DataTemplate). While templates also have Triggers, it is to be noted that Style triggers cannot interract with particular items of the Visual Tree for the object.

    One common distinction of Styles and Templates states that a Style can contain one/many Setters/Triggers to change the ControlTemplate or DataTemplate of controls/objects.
    عرض کردم که از رو مرجع لاتین چیزی درباره templateها متوجه نشده بودم .لطفا با زبان شیرین فارسی راهنماییم کنین...

  4. #4
    VIP آواتار Amir Oveisi
    تاریخ عضویت
    اسفند 1384
    محل زندگی
    هر جا که حال کنم - فعلا یزد
    پست
    2,604

    نقل قول: کاربرد Template ها و تفاوت اونها با Style؟

    با style ها میشه به property ها مقدار دهی کرد و یا trigger کرد. اما نمیشه در Visual Tree اون تغییر ایجاد کرد مثلا نمیشه به یک Button با استفاده از Style خالی یک Image اضافه کرد. برای این کار از Template استفاده میشه.
    حالا Template یکی از Property های کنترل هاست و چون با Style میشه به Property ها مقدار داد پس در هر Style میشه Template رو هم تغییر داد.

    موفق باشید

قوانین ایجاد تاپیک در تالار

  • شما نمی توانید تاپیک جدید ایجاد کنید
  • شما نمی توانید به تاپیک ها پاسخ دهید
  • شما نمی توانید ضمیمه ارسال کنید
  • شما نمی توانید پاسخ هایتان را ویرایش کنید
  •