File tree 13 files changed +109
-5
lines changed
MaterialMvvmSample.Android
13 files changed +109
-5
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ protected override void OnCreate(Bundle savedInstanceState)
14
14
ToolbarResource = Resource . Layout . Toolbar ;
15
15
16
16
base . OnCreate ( savedInstanceState ) ;
17
+ Rg . Plugins . Popup . Popup . Init ( this , savedInstanceState ) ;
17
18
Xamarin . Forms . Forms . Init ( this , savedInstanceState ) ;
18
19
Material . Init ( this , savedInstanceState ) ;
19
20
Original file line number Diff line number Diff line change 62
62
<PackageReference Include =" Xamarin.Forms" >
63
63
<Version >4.2.0.815419</Version >
64
64
</PackageReference >
65
+ <PackageReference Include =" Rg.Plugins.Popup" >
66
+ <Version >1.2.0.223</Version >
67
+ </PackageReference >
65
68
</ItemGroup >
66
69
<ItemGroup >
67
70
<Compile Include =" Core\PlatformContainer.cs" />
Original file line number Diff line number Diff line change 6
6
using MaterialMvvmSample . ViewModels ;
7
7
using MaterialMvvmSample . Views ;
8
8
using Xamarin . Forms ;
9
+ using XF . Material . Forms . UI ;
9
10
10
11
namespace MaterialMvvmSample . Core
11
12
{
@@ -36,6 +37,10 @@ protected virtual void RegisterServices(ContainerBuilder containerBuilder)
36
37
containerBuilder . RegisterType < SecondView > ( ) . Named < Page > ( ViewNames . SecondView ) . As < SecondView > ( ) . InstancePerDependency ( ) ;
37
38
38
39
containerBuilder . RegisterType < LandingView > ( ) . Named < Page > ( ViewNames . LandingView ) . As < LandingView > ( ) . InstancePerDependency ( ) ;
40
+ containerBuilder . RegisterType < MaterialDialogsView > ( ) . Named < Page > ( ViewNames . MaterialDialogsView ) . As < MaterialDialogsView > ( ) . InstancePerDependency ( ) ;
41
+ containerBuilder . RegisterType < CheckboxesView > ( ) . Named < Page > ( ViewNames . CheckboxesView ) . As < CheckboxesView > ( ) . InstancePerDependency ( ) ;
42
+
43
+
39
44
40
45
containerBuilder . RegisterType < MainViewModel > ( ) . InstancePerDependency ( ) ;
41
46
containerBuilder . RegisterType < SecondViewModel > ( ) . InstancePerDependency ( ) ;
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ public partial class AppDelegate : Xamarin.Forms.Platform.iOS.FormsApplicationDe
9
9
{
10
10
public override bool FinishedLaunching ( UIApplication uiApplication , NSDictionary launchOptions )
11
11
{
12
+ Rg . Plugins . Popup . Popup . Init ( ) ;
12
13
Xamarin . Forms . Forms . Init ( ) ;
13
14
XF . Material . iOS . Material . Init ( ) ;
14
15
Original file line number Diff line number Diff line change 171
171
<PackageReference Include =" Xamarin.Forms" >
172
172
<Version >4.2.0.815419</Version >
173
173
</PackageReference >
174
+ <PackageReference Include =" Rg.Plugins.Popup" >
175
+ <Version >1.2.0.223</Version >
176
+ </PackageReference >
174
177
</ItemGroup >
175
178
<Import Project =" $(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
176
179
<ItemGroup >
Original file line number Diff line number Diff line change 13
13
<PackageReference Include =" Autofac" Version =" 4.9.4" />
14
14
<PackageReference Include =" Autofac.Extras.CommonServiceLocator" Version =" 5.0.0" />
15
15
<PackageReference Include =" Xamarin.Forms" Version =" 4.2.0.815419" />
16
+ <PackageReference Include =" Rg.Plugins.Popup" Version =" 1.2.0.223" />
16
17
</ItemGroup >
17
18
18
19
<ItemGroup >
19
20
<ProjectReference Include =" ..\..\XF.Material\XF.Material.csproj" />
20
21
</ItemGroup >
21
22
22
23
<ItemGroup >
23
- <Compile Update =" **\*.xaml.cs" DependentUpon =" %(Filename)" />
24
+ <Compile Update =" **\*.xaml.cs" DependentUpon =" %(Filename)" />
24
25
</ItemGroup >
25
26
26
27
</Project >
Original file line number Diff line number Diff line change @@ -7,11 +7,13 @@ namespace MaterialMvvmSample.ViewModels
7
7
{
8
8
public class LandingViewModel : BaseViewModel
9
9
{
10
- public LandingViewModel ( )
11
- {
10
+ public ICommand GoToMaterialDialogsCommand => this . GoToCommand ( ViewNames . MaterialDialogsView ) ;
12
11
13
- }
12
+ public ICommand GoToChipFontSizeViewCommand => this . GoToCommand ( ViewNames . ChipFontSizeView ) ;
14
13
15
- public ICommand GoToChipFontSizeViewCommand => new Command ( ( ) => this . Navigation . PushAsync ( ViewNames . ChipFontSizeView ) ) ;
14
+ public ICommand GoToCheckboxesSampleCommand => this . GoToCommand ( ViewNames . CheckboxesView ) ;
15
+
16
+
17
+ private ICommand GoToCommand ( string name ) => new Command ( ( ) => this . Navigation . PushAsync ( name ) ) ;
16
18
}
17
19
}
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <ContentPage xmlns =" http://xamarin.com/schemas/2014/forms"
3
+ xmlns : x =" http://schemas.microsoft.com/winfx/2009/xaml"
4
+ xmlns : local =" clr-namespace:MaterialMvvmSample.Views"
5
+ xmlns : material =" clr-namespace:XF.Material.Forms.UI;assembly=XF.Material"
6
+ x : Class =" MaterialMvvmSample.Views.CheckboxesView" >
7
+ <ContentPage .Content>
8
+ <StackLayout Orientation =" Vertical" >
9
+ <material : MaterialCheckbox Text =" My Material Checkbox" />
10
+ </StackLayout >
11
+ </ContentPage .Content>
12
+ </ContentPage >
Original file line number Diff line number Diff line change
1
+ using System ;
2
+ using System . Collections . Generic ;
3
+
4
+ using Xamarin . Forms ;
5
+
6
+ namespace MaterialMvvmSample . Views
7
+ {
8
+ public partial class CheckboxesView : ContentPage
9
+ {
10
+ public CheckboxesView ( )
11
+ {
12
+ InitializeComponent ( ) ;
13
+ }
14
+ }
15
+ }
Original file line number Diff line number Diff line change 11
11
Command =" {Binding GoToChipFontSizeViewCommand}"
12
12
Margin =" 10" />
13
13
14
+ <material : MaterialButton Text =" Go To Material Dialogs sample"
15
+ Command =" {Binding GoToMaterialDialogsCommand}"
16
+ Margin =" 10" />
17
+
18
+ <material : MaterialButton Text =" Go To Checkboxes sample"
19
+ Command =" {Binding GoToCheckboxesSampleCommand}"
20
+ Margin =" 10" />
21
+
14
22
<!-- New sample shortcuts should be added here (Button + Associated command in the LandingViewModel) -->
15
23
</StackLayout >
16
24
</ContentPage .Content>
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <local : BaseMainView xmlns =" http://xamarin.com/schemas/2014/forms"
3
+ xmlns : x =" http://schemas.microsoft.com/winfx/2009/xaml"
4
+ xmlns : local =" clr-namespace:MaterialMvvmSample.Views"
5
+ xmlns : material =" clr-namespace:XF.Material.Forms.UI;assembly=XF.Material"
6
+ x : Class =" MaterialMvvmSample.Views.MaterialDialogsView" >
7
+ <ContentPage .Content>
8
+ <StackLayout Orientation =" Vertical" >
9
+ <material : MaterialButton Text =" Open Dialog"
10
+ x : Name =" Opendialog" />
11
+
12
+ <material : MaterialLabel x : Name =" DialogResult" />
13
+
14
+ </StackLayout >
15
+ </ContentPage .Content>
16
+ </local : BaseMainView >
Original file line number Diff line number Diff line change
1
+ using System ;
2
+ using System . Collections . Generic ;
3
+ using Xamarin . Forms ;
4
+ using Xamarin . Forms . Xaml ;
5
+ using XF . Material . Forms . UI . Dialogs ;
6
+
7
+ namespace MaterialMvvmSample . Views
8
+ {
9
+ [ XamlCompilation ( XamlCompilationOptions . Compile ) ]
10
+ public partial class MaterialDialogsView : BaseMainView
11
+ {
12
+ public MaterialDialogsView ( )
13
+ {
14
+ InitializeComponent ( ) ;
15
+
16
+ this . Opendialog . Clicked += Opendialog_Clicked ;
17
+ }
18
+
19
+ private async void Opendialog_Clicked ( object sender , EventArgs e )
20
+ {
21
+ var choices = new List < string >
22
+ {
23
+ "choice 1" ,
24
+ "choice 2" ,
25
+ "choice 3" ,
26
+ } ;
27
+
28
+ var choice = await MaterialDialog . Instance . SelectChoiceAsync ( "Select choices" , choices ) ;
29
+
30
+ this . DialogResult . Text = choices [ choice ] ;
31
+ }
32
+ }
33
+ }
Original file line number Diff line number Diff line change @@ -10,5 +10,9 @@ public static class ViewNames
10
10
11
11
public const string LandingView = nameof ( Views . LandingView ) ;
12
12
13
+ public const string MaterialDialogsView = nameof ( Views . MaterialDialogsView ) ;
14
+
15
+ public const string CheckboxesView = nameof ( Views . CheckboxesView ) ;
16
+
13
17
}
14
18
}
You can’t perform that action at this time.
0 commit comments