不負責任講座 Silverlight 3.0 #4,Binding(何謂One-Time / One-Way / Two-Way)

摘要:不負責任講座 Silverlight 3.0 #4,Binding(何謂One-Time / One_Way / Two-Way)

上一篇文章(不負責任講座 Silverlight 3.0 #3,Binding(DataBinding?資料繫結?資料綁定?) )裡面有提到 Binding的三種型態。

說真的,光從字面上來看,還是有點小模糊。尤其是 One-Time與 One-Way很難區分。

 

微軟的官方網站,有下列解釋:

[[ 資料流程的方向 ]]
每個繫結都有 Mode 屬性,這會決定資料流動的方式和時機。Silverlight 啟用三種類型的繫結:

  • 當建立繫結時, OneTime 繫結會使用來源資料更新目標。
  • 當建立繫結和任何時候變更資料時, OneWay 繫結會使用來源資料更新目標。這是 "預設" 模式。
  • 當目標或來源其中一項變更時, TwoWay 繫結會同時更新兩者。   

==================================================================================== 

 

我會建議各位下載 Visual Studio 2010 and .NET Framework 4 Training Kit來看看,裡面有好多簡報檔。

(註:這份Training Kit不是最終版本,是2009/5月份的PreView版,因為VS 2010與 .NET 4.0都還是Beta 1而已)

其中一份簡報,名為「Whats New In ASP.NET AJAX 4」裡面有一頁,做了很棒的解釋:

以下是這頁簡報的解釋: 

The default binding type is one-time, in which the source object will synchronize a property value with the target only at the time that the binding occurred. Any subsequent changes to either the source or the target won’t affect the binding .

 

The one-way binding allows you to keep the target object constantly up-to-date with the source whenever it changes .

 

Finally, two-way binding forms a tight-coupling between the source and target objects such that a change on either end automatically reflects the other.

 

小弟個人的看法(不敢擔保正確性)

  • One-Time ---- 單向地把資料呈現在畫面上,以後也不會改變了。
  • One-Way ---- 只是負責把資料呈現在畫面上,無法回寫(修改)。但資料內容一改,畫面上也會隨之修改。
  • 這應該跟AJAX 4.0版有關,觀念也跟AJAX有關。

 

 

 

我將思想傳授他人, 他人之所得,亦無損於我之所有;

猶如一人以我的燭火點燭,光亮與他同在,我卻不因此身處黑暗。----Thomas Jefferson

線上課程教學,遠距教學 (Web Form 約 51hr)  https://dotblogs.com.tw/mis2000lab/2016/02/01/aspnet_online_learning_distance_education_VS2015

線上課程教學,遠距教學 (ASP.NET MVC 約 135hr)  https://dotblogs.com.tw/mis2000lab/2018/08/14/ASPnet_MVC_Online_Learning_MIS2000Lab

 

寫信給我,不要私訊 --  mis2000lab (at) yahoo.com.tw  或  school (at) mis2000lab.net

 (1) 第一天 ASP.NET MVC5 完整影片(5.5小時 / .NET 4.x版)免費試聽。影片 https://youtu.be/9spaHik87-A 

 (2) 第一天 ASP.NET Core MVC 完整影片(3小時 / .NET Core 6.0~8.0)免費試聽。影片 https://youtu.be/TSmwpT-Bx4I 

[學員感言] mis2000lab課程評價 - ASP.NET MVC , WebForm  。 https://mis2000lab.medium.com/%E5%AD%B8%E5%93%A1%E6%84%9F%E8%A8%80-mis2000lab%E8%AA%B2%E7%A8%8B%E8%A9%95%E5%83%B9-asp-net-mvc-webform-77903ce9680b  


ASP.NET遠距教學、線上課程(Web Form + MVC)。 第一天課程, "完整" 試聽。 

.........   facebook社團   https://www.facebook.com/mis2000lab   ......................

.........  YouTube (ASP.NET) 線上教學影片  https://www.youtube.com/channel/UC6IPPf6tvsNG8zX3u1LddvA/

 

Blog文章 "附的範例" 無法下載,請看 https://dotblogs.com.tw/mis2000lab/2016/03/14/2008_2015_mis2000lab_sample_download

請看我們的「售後服務」範圍(嚴格認定)。

...................................................................................................................................................... 

ASP.NET MVC  => .NET Core MVC 線上教學  ...... 第一天課程 完整內容 "免費"讓您評估 / 試聽

[遠距教學、教學影片] ASP.NET (Web Form) 課程 上線了!MIS2000Lab.主講   事先錄好的影片,並非上課側錄!   觀看時,有如「一對一」面對面講課