1 / 5

MVVM

Model View ViewModel. MVVM. Model – objektová reprezentácia dát. Obsahuje jednotlivé properties, validácie, error hlášky ViewModel – logická časť medzi Modelom a Viewom. Obsahuje presentation properties, commandy, a property changed eventy

dysis
Download Presentation

MVVM

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Model View ViewModel MVVM

  2. Model – objektová reprezentácia dát. Obsahuje jednotlivé properties, validácie, error hlášky ViewModel – logická časť medzi Modelom a Viewom. Obsahuje presentation properties, commandy, a property changed eventy View –komponenta (WPF) ktorá pomocou data bindingu zobrazuje dáta a spúšta Commandy z ViewModelu mVVM Design PATTERN

  3. Schéma

  4. Výborná podpora vo WPF ViewModel ako DataContext pre View Binding object properties na komponenty WPF Command Bindings Validácie, error messages UpdateSourceTriggers DataBINDING

  5. Ukážka <TextBox x:Name="textBox_LeaderPhone" Grid.Row="2" Grid.Column="1" > <TextBox.Text> <Binding Path="Leader_Phone" ValidatesOnDataErrors="True" UpdateSourceTrigger="PropertyChanged"> </Binding> </TextBox.Text> </TextBox> <MenuItem Header="_File" > <MenuItem Header="Import dát" Command="{BindingPath=CommandImport}"/> <MenuItem Header="Exit" Command="{Binding Path=CommandExit}" /> </MenuItem>

More Related