File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11using System ;
2- using System . ComponentModel ;
3- using System . Threading . Tasks ;
42using Xamarin . Forms ;
5- using System . Runtime . CompilerServices ;
63
74namespace FreshMvvm
85{
9- public abstract class FreshBasePageModel : INotifyPropertyChanged
10- {
11- public event PropertyChangedEventHandler PropertyChanged ;
12-
6+ public abstract class FreshBasePageModel : FreshNotifyPropertyChanged
7+ {
138 /// <summary>
149 /// The previous page model, that's automatically filled, on push
1510 /// </summary>
@@ -41,14 +36,6 @@ public virtual void Init (object initData)
4136 {
4237 }
4338
44- protected void RaisePropertyChanged ( [ CallerMemberName ] string propertyName = null )
45- {
46- var handler = PropertyChanged ;
47- if ( handler != null ) {
48- handler ( this , new PropertyChangedEventArgs ( propertyName ) ) ;
49- }
50- }
51-
5239 internal void WireEvents ( Page page )
5340 {
5441 page . Appearing += ViewIsAppearing ;
Original file line number Diff line number Diff line change 1- <?xml version =" 1.0" encoding =" utf-8" ?>
1+ <?xml version =" 1.0" encoding =" utf-8" ?>
22<Project DefaultTargets =" Build" ToolsVersion =" 4.0" xmlns =" http://schemas.microsoft.com/developer/msbuild/2003" >
33 <PropertyGroup >
44 <Configuration Condition =" '$(Configuration)' == '' " >Debug</Configuration >
3131 <ConsolePause >false</ConsolePause >
3232 </PropertyGroup >
3333 <ItemGroup >
34+ <Compile Include =" FreshNotifyPropertyChanged.cs" />
3435 <Compile Include =" Properties\AssemblyInfo.cs" />
3536 <Compile Include =" FreshBasePageModel.cs" />
3637 <Compile Include =" FreshIOC.cs" />
Original file line number Diff line number Diff line change 1+ using System . ComponentModel ;
2+ using System . Runtime . CompilerServices ;
3+
4+ namespace FreshMvvm
5+ {
6+ public abstract class FreshNotifyPropertyChanged : INotifyPropertyChanged
7+ {
8+ public event PropertyChangedEventHandler PropertyChanged ;
9+
10+ protected void RaisePropertyChanged ( [ CallerMemberName ] string propertyName = null )
11+ {
12+ var handler = PropertyChanged ;
13+ if ( handler != null )
14+ {
15+ handler ( this , new PropertyChangedEventArgs ( propertyName ) ) ;
16+ }
17+ }
18+ }
19+ }
You can’t perform that action at this time.
0 commit comments