: data binding[1]GUIModel-View-ViewModel (MVVM) [2]

概要

編集

GUIUION/OFFUIUI

UISQLXML[3][4][5]

Microsoft Windows.NET Framework/.NET CoreXMLExtensible Application Markup Language (XAML) UIXAMLUIXAMLXAMLUI

単方向バインディングと双方向バインディング

編集

データバインディングには変更反映の方向性によって以下の2種類が存在する[6][7]

  • 単方向バインディング (one-way): 「ソース ⇒ ターゲット」あるいは「ターゲット ⇒ ソース」のみの一方向の暗黙的反映
  • 双方向バインディング (two-way): ソース ⇔ ターゲット間の双方向の暗黙的反映

データバインディングの実装例

編集

Reacthook

React hookuseXUIhooksetXUIhookhookReact[8][9]
function MyComp(){
  const [count, setCount] = useState(0);
  return (
    <div>
      <p>You clicked {count} times</p>
      <button onClick={() => setCount(count + 1)}>hello, myComp {count}</button>
    </div>
  );
}
ReactDOM.render(<MyComp />, document.getElementById('root'));

その他

編集

脚注

編集


(一)^   - WPF .NET Framework. Microsoft Docs (2020123). 2021929  UI 

(二)^ Xamarin.Forms   - Xamarin. Microsoft Docs (2020521). 2021929  2 Model-View-ViewModel (MVVM)  

(三)^ Custom Element()DOM() . Polymer Japan

(四)^  JavaScript   - Vue.js

(五)^ reactive UIs using the React framework View integrations - Apollo

(六)^ :  - WPF .NET Framework | Microsoft Docs

(七)^ Xamarin.Forms   - Xamarin | Microsoft Docs

(八)^ state  React  - React

(九)^ React ... useState()   - React

(十)^    | Android  | Android Developers

(11)^   - ADO.NET | Microsoft Docs

(12)^   - Windows Forms .NET Framework | Microsoft Docs

関連項目

編集