I am writing an application in WPF using the MVVM Toolkit and there is a problem connecting and viewing View Module.
The model is built with ado.net unit framework.
Videodal:
Public class customer visibility model {Private model. client customer; // Constructor Personal Observe Collection & lt; Model Customers & gt; _customer = new reviewable selection & lt; Model Customers & gt; (); Public Supervision Collection & lt; Model Customers & gt; All Customers ({Return __ Customer;}} Personal Model. Customer Selected I Public Model. Customer Selected Items {return {return_selectedItem;}} Public Zero Load Client () {List & Model; Customer & gt; List = DataAccessLayer .getcustomers (); foreign currency (customer in customer list) {this._customer.Add (customer);}}}
More views (no code at the moment):
& lt; UserControl x: class = "customer. Customer" xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns: x = "http : //schemas.microsoft.com/winfx/2006/xaml "xmlns: mc =" http: // schema .o Penxmlformats.org / markup-compatibility / 2006 "xmlns: d =" http://schemas.microsoft.com/expression/blend/2008 "mc: Ignorable =" d "xmlns: vm =" clr- namespace: Customer ViewModels " D: DesignHeight = "300" D: DesignWid = "300" xmlns: Toolkit = "http://schemas.microsoft.com/wpf/2008/toolkit"> gt; & gt; Grid & gt; Toolkit: DataGrade ItemsSource = "{All types of binding}" selected items = "{Binding selected etam, mode = two}" Autogrentech column = "true" & gt; & Lt; / Toolkit: Data Grid & gt; & Lt; Toolkit: DataGrade ItemsSource = "{Binding Selected Entom Order}" & gt; & Lt; / Toolkit: Data Grid & gt; & Lt; / Grid & gt; & Lt; / UserControl & gt;
and Datacus Player class:
class data access layer {public list & lt; Customers & gt; Customers = new list & lt; Customers & gt; (); Public static list & lt; Customers & gt; Recipient () {Institutions DB = new organizations (); Var customer = c from db.Customer.Include ("order") Select C; Return customer }}
The problem is that no data is displayed because the data reference is not set. I tried to put it behind the code but did not work backwards. I like to do this any way in any xaml file. Another problem is with the selected item binding - the code is never used.
Since it is using MVVM paradigm, I will give your ViewModel an example in the constructor for the view . My View / View Models generally follow this sequence of events:
- See instanced
- see the manufacturer example
- View the start date < / Li>
- ViewModel runs data received processes (separate thread)
- See Model call on change ("") to alert you that something has changed; Check everything
My view model has started with XML code (sorry that it is in VB.Net), to believe in yourself with C as well as C # Not enough to learn):
Public Sub-New () MySQL () mine. Datacentext = New Attitration View Model (m) "Pass the view to set as a visual variable. Initial element () end subs >>
I initially expected
But it did not work as I want.
Hope is a bit of help.
Comments
Post a Comment