Skip to content

Commit

Permalink
Merge branch 'PrismLibrary:master' into master_/feature/gobackto-with…
Browse files Browse the repository at this point in the history
…out-popping-each-page
  • Loading branch information
niimima authored Jan 21, 2024
2 parents 35302bd + 1402128 commit 4a22857
Show file tree
Hide file tree
Showing 37 changed files with 573 additions and 208 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build_forms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ jobs:
with:
name: Build Prism.Forms
solution-path: PrismLibrary_Forms.slnf
jdk-version: 13
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
solution-path: PrismLibrary_Forms.slnf
code-sign: true
artifact-name: Forms
jdk-version: 13
secrets:
codeSignKeyVault: ${{ secrets.CodeSignKeyVault }}
codeSignClientId: ${{ secrets.CodeSignClientId }}
Expand Down
23 changes: 0 additions & 23 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,4 @@
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>

<!-- Generate the NotTrimmable.cs file -->
<Target Name="AddNotTrimmableFile" BeforeTargets="BeforeCompile" Condition=" $(IsPackable) ">
<PropertyGroup>
<!-- Define the file path -->
<NotTrimmableFilePath>$(IntermediateOutputPath)NotTrimmable.g.cs</NotTrimmableFilePath>
</PropertyGroup>

<!-- Ensure the intermediate output directory exists -->
<MakeDir Directories="$(IntermediateOutputPath)" />

<!-- Write the contents to the file -->
<WriteLinesToFile
File="$(NotTrimmableFilePath)"
Lines="[assembly: System.Reflection.AssemblyMetadata(&quot;IsTrimmable&quot;, &quot;False&quot;)]"
Overwrite="true"
Encoding="UTF-8" />

<!-- Include the generated file in the compilation -->
<ItemGroup>
<Compile Include="$(NotTrimmableFilePath)" />
</ItemGroup>
</Target>

</Project>
111 changes: 39 additions & 72 deletions README.md

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions src/Forms/Prism.DryIoc.Forms/Prism.DryIoc.Forms.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="Sdk.props" Sdk="MSBuild.Sdk.Extras" Version="$(MSBuildSdkExtrasVersion)" Condition="'$(MSBuildRuntimeType)' != 'Core'" />
<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<TargetFrameworks Condition="$(MSBuildRuntimeType) != 'Core'">$(TargetFrameworks);Xamarin.iOS10</TargetFrameworks>
<Title>DryIoc for Prism for Xamarin.Forms</Title>
<!-- Summary is not actually supported at this time. Including the summary for future support. -->
<!--<Summary>DryIoc extensions for Prism for Xamarin.Forms.</Summary>-->
Expand All @@ -17,5 +15,4 @@
<ItemGroup>
<ProjectReference Include="../Prism.Forms/Prism.Forms.csproj" />
</ItemGroup>
<Import Project="Sdk.targets" Sdk="MSBuild.Sdk.Extras" Version="$(MSBuildSdkExtrasVersion)" Condition="'$(MSBuildRuntimeType)' != 'Core'" />
</Project>
2 changes: 1 addition & 1 deletion src/Forms/Prism.Forms/Prism.Forms.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<RootNamespace>Prism</RootNamespace>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<TargetFrameworks Condition="$(MSBuildRuntimeType) != 'Core'">$(TargetFrameworks);MonoAndroid10.0</TargetFrameworks>
<TargetFrameworks Condition="$(MSBuildRuntimeType) != 'Core'">$(TargetFrameworks);MonoAndroid13.0</TargetFrameworks>
<Title>Prism for Xamarin.Forms</Title>
<!-- Summary is not actually supported at this time. Including the summary for future support. -->
<!--<Summary>Prism for Xamarin.Forms helps you more easily design and build rich, flexible, and easy to maintain Xamarin.Forms applications.</Summary>-->
Expand Down
6 changes: 3 additions & 3 deletions src/Maui/Prism.Maui/Dialogs/DialogContainerPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ public DialogContainerPage()

public ICommand Dismiss { get; private set; }

public async Task ConfigureLayout(Page currentPage, View dialogView, bool hideOnBackgroundTapped, ICommand dismissCommand)
public async Task ConfigureLayout(Page currentPage, View dialogView, bool hideOnBackgroundTapped, ICommand dismissCommand, IDialogParameters parameters)
{
Dismiss = dismissCommand;
DialogView = dialogView;
Content = GetContentLayout(currentPage, dialogView, hideOnBackgroundTapped, dismissCommand);
Content = GetContentLayout(currentPage, dialogView, hideOnBackgroundTapped, dismissCommand, parameters);

await DoPush(currentPage);
}
Expand All @@ -44,7 +44,7 @@ public virtual async Task DoPop(Page currentPage)
await currentPage.Navigation.PopModalAsync(false);
}

protected virtual View GetContentLayout(Page currentPage, View dialogView, bool hideOnBackgroundTapped, ICommand dismissCommand)
protected virtual View GetContentLayout(Page currentPage, View dialogView, bool hideOnBackgroundTapped, ICommand dismissCommand, IDialogParameters parameters)
{
var overlay = new AbsoluteLayout();
var popupContainer = new DialogContainerView
Expand Down
2 changes: 1 addition & 1 deletion src/Maui/Prism.Maui/Dialogs/DialogService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ async Task DialogAware_RequestClose(IDialogResult outResult)
var dismissCommand = new DelegateCommand(() => dialogAware.RequestClose.Invoke(), dialogAware.CanCloseDialog);

PageNavigationService.NavigationSource = PageNavigationSource.DialogService;
dialogModal.ConfigureLayout(_pageAccessor.Page, view, closeOnBackgroundTapped, dismissCommand);
dialogModal.ConfigureLayout(_pageAccessor.Page, view, closeOnBackgroundTapped, dismissCommand, parameters);
PageNavigationService.NavigationSource = PageNavigationSource.Device;

MvvmHelpers.InvokeViewAndViewModelAction<IActiveAware>(currentPage, aa => aa.IsActive = false);
Expand Down
2 changes: 1 addition & 1 deletion src/Maui/Prism.Maui/Dialogs/IDialogContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ public interface IDialogContainer
{
View DialogView { get; }
ICommand Dismiss { get; }
Task ConfigureLayout(Page currentPage, View dialogView, bool hideOnBackgroundTapped, ICommand dismissCommand);
Task ConfigureLayout(Page currentPage, View dialogView, bool hideOnBackgroundTapped, ICommand dismissCommand, IDialogParameters parameters);
Task DoPop(Page currentPage);
}
12 changes: 10 additions & 2 deletions src/Maui/Prism.Maui/Mvvm/ViewModelLocator.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Prism.Mvvm;
namespace Prism.Mvvm;

/// <summary>
/// This class defines the attached property and related change handler that calls the <see cref="ViewModelLocationProvider"/>.
Expand All @@ -9,7 +9,15 @@ public static class ViewModelLocator
/// Instructs Prism whether or not to automatically create an instance of a ViewModel using a convention, and assign the associated View's <see cref="BindableObject.BindingContext"/> to that instance.
/// </summary>
public static readonly BindableProperty AutowireViewModelProperty =
BindableProperty.CreateAttached("AutowireViewModel", typeof(ViewModelLocatorBehavior), typeof(ViewModelLocator), ViewModelLocatorBehavior.Automatic);
BindableProperty.CreateAttached("AutowireViewModel", typeof(ViewModelLocatorBehavior), typeof(ViewModelLocator), ViewModelLocatorBehavior.Automatic, propertyChanged: OnViewModelLocatorBehaviorChanged);

private static void OnViewModelLocatorBehaviorChanged(BindableObject bindable, object oldValue, object newValue)
{
if (newValue is ViewModelLocatorBehavior behavior && behavior == ViewModelLocatorBehavior.Forced)
{
Autowire(bindable);
}
}

internal static readonly BindableProperty ViewModelProperty =
BindableProperty.CreateAttached("ViewModelType",
Expand Down
28 changes: 27 additions & 1 deletion src/Maui/Prism.Maui/Mvvm/ViewModelLocatorBehavior.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,33 @@
namespace Prism.Mvvm;

/// <summary>
/// Defines the behavior that the <see cref="ViewModelLocator"/> should use.
/// </summary>
public enum ViewModelLocatorBehavior
{
/// <summary>
/// The ViewModel will be lazily loaded by the Page/Region Navigation Services
/// or the DialogService.
/// </summary>
/// <remarks>
/// This is the default and recommended value for the ViewModelLocator. This will
/// allow the View to be fully initialized and ensure that the proper ViewModel is
/// resolved based on the route name.
/// </remarks>
Automatic,
Disabled

/// <summary>
/// This will disable Prism's automatic ViewModel Location
/// </summary>
Disabled,

/// <summary>
/// This is not recommended for most situations
/// </summary>
/// <remarks>
/// This is likely to cause breaks in the Container Scoping. It is recommended that
/// you allow Prism Page/Region Navigation Services or the Dialog Service properly
/// resolve the ViewModel.
/// </remarks>
Forced
}
Loading

0 comments on commit 4a22857

Please sign in to comment.