Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. WPF
  4. Binding a Text Box to Data Context

Binding a Text Box to Data Context

Scheduled Pinned Locked Moved WPF
wpfcsharphelpwcfdata-structures
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    StyleGuide
    wrote on last edited by
    #1

    Hi there, I'm new to WPF, so bear with me.. I have a Main View, and a view within it. I set the DataContext in my 'OnStartup' C# method: Views.MainView view = new Views.MainView(); view.AssignmentView.DataContext = new ViewModels.MainViewModel(_assignmentDataSource); I have previous / next button in my 'AssignmentView', that are linked to commands. This Moves focus from record to record as expected in my ListView, in my XAML : I think its a problem with the 'DataContext' - I don't think I should be wiring it up in the Stack Panel, but when I remove it, there is no data in the Stack Panel text box.. Where am I going wrong? Any help greatly appreciated. Thanks. Jon bgfbgf

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups