Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit618bac4

Browse files
committed
Lint
1 parent3f14026 commit618bac4

File tree

3 files changed

+70
-67
lines changed

3 files changed

+70
-67
lines changed

‎MvvmCross.Tests/MvxUnitTestCommandHelper.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public class MvxUnitTestCommandHelper : IMvxCommandHelper
99
{
1010
publiceventEventHandlerCanExecuteChanged;
1111

12-
privateDictionary<object,int>items=newDictionary<object,int>();
12+
privatereadonlyDictionary<object,int>items=newDictionary<object,int>();
1313

1414
publicvoidWillCallRaisePropertyChangedFor(objectitem)
1515
{

‎Projects/Playground/Playground.Droid/Fragments/MultiBackStackView.cs‎

Lines changed: 63 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -26,48 +26,51 @@ public class MultiBackStackView : MvxFragment<MultiBackStackViewModel>
2626
{
2727
privateNavigationBarView_navigationView;
2828
privatebool_navigatedToTab2;
29-
29+
3030
publicoverrideViewOnCreateView(LayoutInflaterinflater,ViewGroupcontainer,BundlesavedInstanceState)
3131
{
32-
base.OnCreateView(inflater,container,savedInstanceState);
32+
base.OnCreateView(inflater,container,savedInstanceState);
33+
34+
varview=this.BindingInflate(Resource.Layout.MultiBackStackView,container,false);
3335

34-
varview=this.BindingInflate(Resource.Layout.MultiBackStackView,container,false);
35-
36-
_navigationView=view.FindViewById<NavigationBarView>(Resource.Id.navigationview);
37-
_navigationView.ItemSelected+=NavigationViewOnItemSelected;
36+
_navigationView=view.FindViewById<NavigationBarView>(Resource.Id.navigationview);
37+
_navigationView.ItemSelected+=NavigationViewOnItemSelected;
3838

39-
returnview;
39+
returnview;
4040
}
4141

4242
publicoverridevoidOnDestroy()
4343
{
44-
base.OnDestroy();
45-
46-
if(_navigationView!=null)
47-
{
48-
_navigationView.ItemSelected-=NavigationViewOnItemSelected;
49-
}
44+
base.OnDestroy();
45+
46+
if(_navigationView!=null)
47+
{
48+
_navigationView.ItemSelected-=NavigationViewOnItemSelected;
49+
}
5050
}
5151

52-
privatevoidNavigationViewOnItemSelected(objectsender,NavigationBarView.ItemSelectedEventArgsev)
53-
{
54-
switch(ev.Item.ItemId)
55-
{
56-
caseResource.Id.tab1:
57-
ChildFragmentManager.SaveBackStack(typeof(MultiBackStackTab2View).FragmentJavaName());
58-
ChildFragmentManager.RestoreBackStack(typeof(MultiBackStackTab1View).FragmentJavaName());
59-
break;
60-
caseResource.Id.tab2:
61-
ChildFragmentManager.SaveBackStack(typeof(MultiBackStackTab1View).FragmentJavaName());
62-
if(!_navigatedToTab2){
63-
_navigatedToTab2=true;
64-
Mvx.IoCProvider.Resolve<IMvxNavigationService>().Navigate(typeof(MultiBackStackTab2ViewModel));
65-
}else{
66-
ChildFragmentManager.RestoreBackStack(typeof(MultiBackStackTab2View).FragmentJavaName());
67-
}
68-
break;
69-
}
70-
}
52+
privatevoidNavigationViewOnItemSelected(objectsender,NavigationBarView.ItemSelectedEventArgsev)
53+
{
54+
switch(ev.Item.ItemId)
55+
{
56+
caseResource.Id.tab1:
57+
ChildFragmentManager.SaveBackStack(typeof(MultiBackStackTab2View).FragmentJavaName());
58+
ChildFragmentManager.RestoreBackStack(typeof(MultiBackStackTab1View).FragmentJavaName());
59+
break;
60+
caseResource.Id.tab2:
61+
ChildFragmentManager.SaveBackStack(typeof(MultiBackStackTab1View).FragmentJavaName());
62+
if(!_navigatedToTab2)
63+
{
64+
_navigatedToTab2=true;
65+
Mvx.IoCProvider.Resolve<IMvxNavigationService>().Navigate(typeof(MultiBackStackTab2ViewModel));
66+
}
67+
else
68+
{
69+
ChildFragmentManager.RestoreBackStack(typeof(MultiBackStackTab2View).FragmentJavaName());
70+
}
71+
break;
72+
}
73+
}
7174
}
7275

7376
[MvxFragmentPresentation(typeof(RootViewModel),Resource.Id.content_frame,true,
@@ -78,11 +81,11 @@ public class MultiBackStackTab1View : MvxFragment<MultiBackStackTab1ViewModel>
7881
{
7982
publicoverrideViewOnCreateView(LayoutInflaterinflater,ViewGroupcontainer,BundlesavedInstanceState)
8083
{
81-
base.OnCreateView(inflater,container,savedInstanceState);
84+
base.OnCreateView(inflater,container,savedInstanceState);
8285

83-
varview=this.BindingInflate(Resource.Layout.MultiBackStackTab1View,container,false);
86+
varview=this.BindingInflate(Resource.Layout.MultiBackStackTab1View,container,false);
8487

85-
returnview;
88+
returnview;
8689
}
8790

8891
}
@@ -95,44 +98,44 @@ public class MultiBackStackTab2View : MvxFragment<MultiBackStackTab2ViewModel>
9598
{
9699
publicoverrideViewOnCreateView(LayoutInflaterinflater,ViewGroupcontainer,BundlesavedInstanceState)
97100
{
98-
base.OnCreateView(inflater,container,savedInstanceState);
101+
base.OnCreateView(inflater,container,savedInstanceState);
99102

100-
varview=this.BindingInflate(Resource.Layout.MultiBackStackTab2View,container,false);
103+
varview=this.BindingInflate(Resource.Layout.MultiBackStackTab2View,container,false);
101104

102-
returnview;
105+
returnview;
103106
}
104107
}
105108

106109
publicclassMultiBackStackInnerView:MvxFragment<MultiBackStackInnerViewModel>,IMvxOverridePresentationAttribute
107110
{
108111
publicoverrideViewOnCreateView(LayoutInflaterinflater,ViewGroupcontainer,BundlesavedInstanceState)
109112
{
110-
base.OnCreateView(inflater,container,savedInstanceState);
113+
base.OnCreateView(inflater,container,savedInstanceState);
111114

112-
varview=this.BindingInflate(Resource.Layout.MultiBackStackInnerView,container,false);
115+
varview=this.BindingInflate(Resource.Layout.MultiBackStackInnerView,container,false);
113116

114-
varf=ParentFragmentManager.PrimaryNavigationFragment;
115-
returnview;
117+
varf=ParentFragmentManager.PrimaryNavigationFragment;
118+
returnview;
116119
}
117120

118121
publicMvxBasePresentationAttributePresentationAttribute(MvxViewModelRequestrequest)
119122
{
120-
if(requestisMvxViewModelInstanceRequest{ViewModelInstance:MultiBackStackInnerViewModelviewModel,ViewModelType:{}viewModelType})
121-
{
122-
returnnewMvxFragmentPresentationAttribute()
123-
{
124-
ViewModelType=typeof(MultiBackStackInnerViewModel),
125-
ActivityHostViewModelType=typeof(RootViewModel),
126-
FragmentHostViewType=typeof(MultiBackStackView),
127-
FragmentContentId=Resource.Id.content_frame,
128-
AddToBackStack=true,
129-
AllowReordering=true,
130-
Tag=viewModelType.Name+viewModel.Depth// unique tag so the restoration restores all of them
131-
};
132-
}
133-
else
134-
{
135-
returnnull;
136-
}
123+
if(requestisMvxViewModelInstanceRequest{ViewModelInstance:MultiBackStackInnerViewModelviewModel,ViewModelType:{}viewModelType})
124+
{
125+
returnnewMvxFragmentPresentationAttribute()
126+
{
127+
ViewModelType=typeof(MultiBackStackInnerViewModel),
128+
ActivityHostViewModelType=typeof(RootViewModel),
129+
FragmentHostViewType=typeof(MultiBackStackView),
130+
FragmentContentId=Resource.Id.content_frame,
131+
AddToBackStack=true,
132+
AllowReordering=true,
133+
Tag=viewModelType.Name+viewModel.Depth// unique tag so the restoration restores all of them
134+
};
135+
}
136+
else
137+
{
138+
returnnull;
139+
}
137140
}
138-
}
141+
}

‎build/Program.cs‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
usingCake.Common;
2+
usingCake.Common.Build;
23
usingCake.Common.Diagnostics;
34
usingCake.Common.IO;
45
usingCake.Common.Tools.DotNet;
56
usingCake.Common.Tools.DotNet.Build;
6-
usingCake.GitVersioning;
7+
usingCake.Common.Tools.DotNet.MSBuild;
8+
usingCake.Common.Tools.DotNet.Run;
9+
usingCake.Common.Tools.DotNet.Tool;
710
usingCake.Core;
11+
usingCake.Core.Diagnostics;
812
usingCake.Core.IO;
913
usingCake.Frosting;
14+
usingCake.GitVersioning;
1015
usingNerdbank.GitVersioning;
1116
usingSpectre.Console;
12-
usingCake.Common.Tools.DotNet.MSBuild;
13-
usingCake.Common.Build;
14-
usingCake.Core.Diagnostics;
15-
usingCake.Common.Tools.DotNet.Tool;
16-
usingCake.Common.Tools.DotNet.Run;
1717

1818
namespaceBuild;
1919

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp