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
Showing
28 changed files
with
394 additions
and
58 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
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
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
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
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
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
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
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
37 changes: 37 additions & 0 deletions
37
MvvmCross/Platforms/Android/Views/MvxChildViewModelOwnerAdapter.cs
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MS-PL license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System; | ||
using MvvmCross.Exceptions; | ||
using MvvmCross.Platforms.Android.Views.Base; | ||
|
||
namespace MvvmCross.Platforms.Android.Views | ||
{ | ||
public class MvxChildViewModelOwnerAdapter : MvxBaseActivityAdapter | ||
{ | ||
protected IMvxChildViewModelOwner ChildOwner => (IMvxChildViewModelOwner)Activity; | ||
|
||
public MvxChildViewModelOwnerAdapter(IMvxEventSourceActivity eventSource) | ||
: base(eventSource) | ||
{ | ||
if (!(eventSource is IMvxChildViewModelOwner)) | ||
{ | ||
throw new MvxException("You cannot use a MvxChildViewModelOwnerAdapter on {0}", | ||
eventSource.GetType().Name); | ||
} | ||
} | ||
|
||
protected override void EventSourceOnDestroyCalled(object sender, EventArgs eventArgs) | ||
{ | ||
ChildOwner.ClearOwnedSubIndicies(); | ||
base.EventSourceOnDestroyCalled(sender, eventArgs); | ||
} | ||
|
||
protected override void EventSourceOnDisposeCalled(object sender, EventArgs eventArgs) | ||
{ | ||
ChildOwner.ClearOwnedSubIndicies(); | ||
base.EventSourceOnDisposeCalled(sender, eventArgs); | ||
} | ||
} | ||
} |
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
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
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
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
Oops, something went wrong.