I do not get anything from Thare. If I have a profile.xaml page for example and I have a user example I have a profileview with a demo How can I tell ProfileViewModel to load the user with the user's ID?
I mean: When I click on a page to click on a button, how do I give profilevidual to the user? Page?
For example
Userlist.xaml has a list of users. One is clicked and an example of Profile.Xaml is loaded, but how can I pass userId to the void? I do not need any dependency anticipation in profile.xaml and then pass it?
Please let me know that you understand it :)
. You should consider compiling your list of userlists in the collection of the ProfileViewloaded instances in XML, then you can only provide specific profileview models for profile.xaml.
In this example, your Userlist.xaml will be included in:
& lt; UserControl Name = "User View" & gt; & Lt ;! - Other accessories - & gt; & Lt; ItemsControl ItemSource = {Binding User} & gt; & Lt; ItemsControl.ItemTemplate & gt; & Lt; DataTemplate & gt; & Lt; StackPanel Orientation = "Horizontal" & gt; & Lt; Text block text = "{binding user name}" /> & Lt; Button content = "see user profile" command = "{binding element name = user view, path = data content. Visible_userprofile commm}" commandpamator = "{binding}" /> & Lt; / StackPanel & gt; & Lt; / DataTemplate & gt; & Lt; /ItemsControl.ItemTemplate> & Lt; / ItemsControl> & Lt ;! - Other accessories - & gt; & Lt; / UserControl & gt;
and your userview models will include:
#region user property public combined string UsersPropertyName = "user"; Personal observable collection & lt; IProfileViewModelViewModel & gt; _users; Public Supervision Collection & lt; IProfileViewModelViewModel & gt; User {get {return_user; } Set {if (_users == value) returns; _users = value; RaisePropertyChanged (UsersPropertyName); }} #Andrean Public Relay Commands & Lt; IPR File ViewModel & gt; ViewUserProfileCommand = New Relevance & lt; IProfileViewModel & gt; (ViewUserProfileCommandExecute); Private Wide ViewerProfile Commands (IUserProfileViewModel userProfileViewModel) {// see your profile here}
As mentioned above, there will be a way to pass user profile view model on your other page .
Comments
Post a Comment