6 Tips of Separation: Listing 4.

The XAML and data binding for PersonViewModel with ViewModelField<T>.

<StackPanel>
  <controls:TextboxField
    DataContext="{Binding Id}"
    LabelText="Salary"/>
  <controls:TextboxField
    DataContext="{BindingFirstName}"
    LabelText="First Name"/>
  <controls:TextboxField
    DataContext="{BindingLastName}"
    LabelText="Last Name"/>
  <controls:TextboxField
    DataContext="{BindingEmailAddress}"
    LabelText="Email Address"/>
  <controls:TextboxField
    DataContext="{Binding Salary}"
    LabelText="Salary"/>
</StackPanel>

About the Author

Benjamin Day is a consultant and trainer specializing in software best practices using Microsoft tools. Ben’s main areas of emphasis include Team Foundation Server, Scrum, software testing, and software architecture. He is a Microsoft Visual Studio ALM MVP, a certified Scrum trainer via Scrum.org, and a speaker at conferences such as TechEd and Visual Studio Live! When not developing software, Ben’s been known to go running and sea kayaking in order to balance out his love of cheese, cured meats, and champagne. He can be contacted via www.benday.com.

comments powered by Disqus

Featured

  • Java on Visual Studio Code Going Cloud Native

    Cloud-native development figures prominently in a new roadmap published by Microsoft's Java on Visual Studio Code dev team.

  • Speed Lines Graphic

    Quantum-Inspired Annealing Using C# or Python

    Dr. James McCaffrey of Microsoft Research explains a new idea that slightly modifies standard simulated annealing by borrowing ideas from quantum mechanics.

  • Visual Studio 2022 v17.1 Preview 3 Improves Web Tools

    Microsoft quietly shipped Visual Studio 2022 v17.1 Preview 3 with enhancements to web tools.

  • Progress Telerik Adds 20-Plus Components for Blazor, .NET MAUI and WinUI

    The R1 2022 release of Progress Telerik development tooling adds more than 20 new components to the Blazor, .NET MAUI and WinUI offerings.

Upcoming Events