-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bfd3a81
commit 8d75c38
Showing
1 changed file
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,77 @@ | ||
# how-to-bind-data-using-freshMvvm-in-.net-maui-listview | ||
|
||
This demo explains about how to bind the data using FreshMVVM in .NET MAUI ListView | ||
|
||
## C# | ||
|
||
//Model.cs | ||
public class Contacts : FreshBasePageModel | ||
{ | ||
private string contactName; | ||
private string contactNumber; | ||
private ImageSource image; | ||
|
||
public Contacts(string name, string number) | ||
{ | ||
contactName = name; | ||
contactNumber = number; | ||
} | ||
|
||
public Contacts() | ||
{ | ||
|
||
} | ||
|
||
public string ContactName | ||
{ | ||
get { return contactName; } | ||
set | ||
{ | ||
if (contactName != value) | ||
{ | ||
contactName = value; | ||
this.RaisePropertyChanged(); | ||
} | ||
} | ||
} | ||
|
||
public string ContactNumber | ||
{ | ||
get { return contactNumber; } | ||
set | ||
{ | ||
if (contactNumber != value) | ||
{ | ||
contactNumber = value; | ||
this.RaisePropertyChanged(); | ||
} | ||
} | ||
} | ||
|
||
public ImageSource ContactImage | ||
{ | ||
get { return this.image; } | ||
set | ||
{ | ||
this.image = value; | ||
this.RaisePropertyChanged(); | ||
} | ||
} | ||
} | ||
|
||
// ViewModel.cs | ||
public class ListViewPageModel : FreshBasePageModel | ||
{ | ||
--- | ||
} | ||
|
||
## Requirements to run the demo | ||
|
||
* [Visual Studio 2017](https://visualstudio.microsoft.com/downloads/) or [Visual Studio for Mac](https://visualstudio.microsoft.com/vs/mac/) | ||
* Xamarin add-ons for Visual Studio (available via the Visual Studio installer). | ||
|
||
## Troubleshooting | ||
|
||
### Path too long exception | ||
|
||
If you are facing path too long exception when building this example project, close Visual Studio and rename the repository to short and build the project. |