[
  {
    "path": ".dependabot/config.yml",
    "content": "version: 1\nupdate_configs:\n  - package_manager: \"dotnet:nuget\"\n    directory: \"/\"\n    update_schedule: \"weekly\"\n    default_labels:\n      - \"dependencies\"\n    target_branch: \"master\""
  },
  {
    "path": ".editorconfig",
    "content": "; This file is for unifying the coding style for different editors and IDEs.\n; More information at http://editorconfig.org\n\n# This file is the top-most EditorConfig file\nroot = true\n\n##########################################\n# Common Settings\n##########################################\n\n[*]\nindent_style = space\nend_of_line = crlf\ntrim_trailing_whitespace = true\ninsert_final_newline = true\ncharset = utf-8\n\n##########################################\n# File Extension Settings\n##########################################\n\n[*.{yml,yaml}]\nindent_size = 2\n\n[.vsconfig]\nindent_size = 2\nend_of_line = lf\n\n[*.sln]\nindent_style = tab\nindent_size = 2\n\n[*.{csproj,proj,projitems,shproj}]\nindent_size = 2\n\n[*.{json,slnf}]\nindent_size = 2\nend_of_line = lf\n\n[*.{props,targets}]\nindent_size = 2\n\n[*.{xaml,axml}]\nindent_size = 2\ncharset = utf-8-bom\n\n[*.xml]\nindent_size = 2\nend_of_line = lf\n\n[*.plist]\nindent_size = 2\nindent_style = tab\nend_of_line = lf\n\n[*.manifest]\nindent_size = 2\n\n[*.appxmanifest]\nindent_size = 2\n\n[*.{json,css,webmanifest}]\nindent_size = 2\nend_of_line = lf\n\n[web.config]\nindent_size = 2\nend_of_line = lf\n\n[*.sh]\nindent_size = 2\nend_of_line = lf\n\n[*.cs]\n# EOL should be normalized by Git. See https://github.com/dotnet/format/issues/1099\nend_of_line = unset\n\n# See https://github.com/dotnet/roslyn/issues/20356#issuecomment-310143926\ntrim_trailing_whitespace = false\n\ntab_width = 4\nindent_size = 4\n\n# Sort using and Import directives with System.* appearing first\ndotnet_sort_system_directives_first = true\n\n# Avoid \"this.\" and \"Me.\" if not necessary\ndotnet_style_qualification_for_field = false:suggestion\ndotnet_style_qualification_for_property = false:suggestion\ndotnet_style_qualification_for_method = false:suggestion\ndotnet_style_qualification_for_event = false:suggestion\n\n#### Naming styles ####\n\n# Naming rules\n\ndotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion\ndotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface\ndotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i\n\ndotnet_naming_rule.types_should_be_pascal_case.severity = suggestion\ndotnet_naming_rule.types_should_be_pascal_case.symbols = types\ndotnet_naming_rule.types_should_be_pascal_case.style = pascal_case\n\ndotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion\ndotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members\ndotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case\n\n# Symbol specifications\n\ndotnet_naming_symbols.interface.applicable_kinds = interface\ndotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected\ndotnet_naming_symbols.interface.required_modifiers =\n\ndotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum\ndotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected\ndotnet_naming_symbols.types.required_modifiers =\n\ndotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method\ndotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected\ndotnet_naming_symbols.non_field_members.required_modifiers =\n\n# Naming styles\n\ndotnet_naming_style.begins_with_i.required_prefix = I\ndotnet_naming_style.begins_with_i.required_suffix =\ndotnet_naming_style.begins_with_i.word_separator =\ndotnet_naming_style.begins_with_i.capitalization = pascal_case\n\ndotnet_naming_style.pascal_case.required_prefix =\ndotnet_naming_style.pascal_case.required_suffix =\ndotnet_naming_style.pascal_case.word_separator =\ndotnet_naming_style.pascal_case.capitalization = pascal_case\n\ndotnet_naming_style.pascal_case.required_prefix =\ndotnet_naming_style.pascal_case.required_suffix =\ndotnet_naming_style.pascal_case.word_separator =\ndotnet_naming_style.pascal_case.capitalization = pascal_case\ndotnet_style_operator_placement_when_wrapping = beginning_of_line\ndotnet_style_coalesce_expression = true:suggestion\ndotnet_style_null_propagation = true:suggestion\ndotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion\ndotnet_style_prefer_auto_properties = true:silent\ndotnet_style_object_initializer = true:suggestion\ndotnet_style_collection_initializer = true:suggestion\ndotnet_style_prefer_simplified_boolean_expressions = true:suggestion\ndotnet_style_prefer_conditional_expression_over_assignment = true:silent\ndotnet_style_prefer_conditional_expression_over_return = true:silent\ndotnet_style_explicit_tuple_names = true:suggestion\ndotnet_style_prefer_inferred_tuple_names = true:suggestion\n\ncsharp_indent_labels = one_less_than_current\ncsharp_using_directive_placement = outside_namespace:silent\ncsharp_prefer_simple_using_statement = true:suggestion\ncsharp_prefer_braces = true:silent\ncsharp_style_namespace_declarations = file_scoped:silent\ncsharp_style_prefer_method_group_conversion = true:silent\ncsharp_style_prefer_top_level_statements = true:silent\ncsharp_style_prefer_primary_constructors = true:suggestion\ncsharp_style_expression_bodied_methods = false:silent\ncsharp_style_expression_bodied_constructors = false:silent\ncsharp_style_expression_bodied_operators = false:silent\ncsharp_style_expression_bodied_properties = true:silent\ncsharp_style_expression_bodied_indexers = true:silent\ncsharp_style_expression_bodied_accessors = true:silent\ncsharp_style_expression_bodied_lambdas = true:silent\ncsharp_style_expression_bodied_local_functions = false:silent\n"
  },
  {
    "path": ".gitattributes",
    "content": "###############################################################################\n# Set default behavior to automatically normalize line endings.\n###############################################################################\n* text=auto\n\n###############################################################################\n# Set default behavior for command prompt diff.\n#\n# This is need for earlier builds of msysgit that does not have it on by\n# default for csharp files.\n# Note: This is only used by command line\n###############################################################################\n#*.cs     diff=csharp\n\n###############################################################################\n# Set the merge driver for project and solution files\n#\n# Merging from the command prompt will add diff markers to the files if there\n# are conflicts (Merging from VS is not affected by the settings below, in VS\n# the diff markers are never inserted). Diff markers may cause the following \n# file extensions to fail to load in VS. An alternative would be to treat\n# these files as binary and thus will always conflict and require user\n# intervention with every merge. To do so, just uncomment the entries below\n###############################################################################\n#*.sln       merge=binary\n#*.csproj    merge=binary\n#*.vbproj    merge=binary\n#*.vcxproj   merge=binary\n#*.vcproj    merge=binary\n#*.dbproj    merge=binary\n#*.fsproj    merge=binary\n#*.lsproj    merge=binary\n#*.wixproj   merge=binary\n#*.modelproj merge=binary\n#*.sqlproj   merge=binary\n#*.wwaproj   merge=binary\n\n###############################################################################\n# behavior for image files\n#\n# image files are treated as binary by default.\n###############################################################################\n#*.jpg   binary\n#*.png   binary\n#*.gif   binary\n\n###############################################################################\n# diff behavior for common document formats\n# \n# Convert binary document formats to text before diffing them. This feature\n# is only available from the command line. Turn it on by uncommenting the \n# entries below.\n###############################################################################\n#*.doc   diff=astextplain\n#*.DOC   diff=astextplain\n#*.docx  diff=astextplain\n#*.DOCX  diff=astextplain\n#*.dot   diff=astextplain\n#*.DOT   diff=astextplain\n#*.pdf   diff=astextplain\n#*.PDF   diff=astextplain\n#*.rtf   diff=astextplain\n#*.RTF   diff=astextplain\n"
  },
  {
    "path": ".github/CODEOWNERS",
    "content": "# CI & Build\nglobal.json @dansiegel\n*.targets @dansiegel\n*.props @dansiegel\n/build/ @dansiegel\n/e2e/ @dansiegel\n\n# Prism.Core\n/src/Prism.Core/ @brianlagunas @dansiegel\n/tests/Prism.Core.Tests/ @brianlagunas @dansiegel\n\n# WPF\n/src/Wpf/ @brianlagunas\n/tests/Wpf/ @brianlagunas\n/e2e/Wpf/ @brianlagunas\n"
  },
  {
    "path": ".github/CONTRIBUTING.md",
    "content": "# Contributing to Prism\n\nWelcome! We would love to have you contribute bug fixes or new functionality to Prism. \n\nThe best starting point is to enter an __issue__ [here](https://github.com/PrismLibrary/Prism/issues). We can then have a brief discussion on what you want to do and where it fits with our milestones and goals for the library. As long as it sounds like something we would want to add to Prism, we will give you a thumbs up and ask for a pull request. If no issue is submitted, your PR may be closed immediately.\n\nWhen you submit a __pull request__, there are a few things we would like you to comply with:\n\n- New functionality must have accompanying unit tests with \"good\" code coverage if it is logic code that can be unit tested (i.e. not view stuff touching UI or platform APIs)\n- Changes to existing functionality needs to be checked that it does not break any existing unit tests. If it does, then fixes to the unit test may be appropriate, but only if those changes maintain the original intent of the test.\n- Some basic coding standard guidelines to start with:\n  - no leading \"this.\"\n  - single type per file\n  - interface-based design to preserve testability and extensibility\n  - due consideration for inheritance (i.e. consider carefully whether something should be protected or virtual)\n  - member variables have leading underscore and are _camelCased\n  - local variables are camelCased with no prefix\n  - types, properties, methods, events are PascalCased\n  - use new C# features (e.g nameof) where possible, but keep the code readable (e.g. don't var everything)\n"
  },
  {
    "path": ".github/FUNDING.yml",
    "content": "github: [brianlagunas, dansiegel]\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug_report.yml",
    "content": "name: 🐞 Bug\ntitle: '[BUG] <title>'\ndescription: File a bug report\nlabels: [\"bug\", \"to verify\"]\nassignees: []\nbody:\n  - type: markdown\n    attributes:\n      value: |\n        Thanks for taking the time to fill out this bug report! Please make sure to add as much detail as you can, Bug reports without a [reproduction](https://github.com/prismlibrary/prism/blob/master/.github/repro.md) will be closed. This will help us diagnose the issue faster and thus resolve it quicker.\n  - type: textarea\n    id: description\n    attributes:\n      label: Description\n      description: Please give us a detailed description of the issue that you're seeing. You can add screenshots and videos as well. We require [reproduction projects](https://github.com/prismlibrary/prism/blob/master/.github/repro.md), please provide them through a GitHub repo and link that here.\n      placeholder: Tell us what you see!\n    validations:\n      required: true\n  - type: textarea\n    id: repro-steps\n    attributes:\n      label: Steps to Reproduce\n      description: Describe all the steps we need to take to show the behavior that you have observed. Also, include what you expected to happen and what did actually happen.\n      placeholder: |\n        1. Create a File > New App\n        2. Add a `Button` like so: `<Button Text=\"this is a bug\" />`\n        3. Click the added button and observe the bug 🐞\n\n        Expected outcome: a bug was added\n        Actual outcome: a ladybug appeared\n    validations:\n      required: true\n  - type: dropdown\n    id: platform-with-bug\n    attributes:\n      label: Platform with bug\n      description: What Platform is this bug affecting?\n      options:\n        - WPF\n        - Xamarin.Forms\n        - Uno Platform - UWP\n        - Uno Platform - WinUI\n        - .NET MAUI\n        - Prism Core\n    validations:\n      required: true\n\n  - type: dropdown\n    id: platforms-affected\n    attributes:\n      label: Affected platforms\n      description: Select all or any platform that you see this issue on. This helps us determine if it's something platform-specific or in the core. If you were only able to test on 1 platform, please check the last option to inform us about that.\n      multiple: true\n      options:\n        - iOS\n        - Android\n        - Windows\n        - macOS\n        - Other (Tizen, Linux, etc.)\n        - I was *not* able test on other platforms\n    validations:\n      required: true\n\n  - type: textarea\n    id: workaround\n    attributes:\n      label: Did you find any workaround?\n      description: Did you find any workaround for this issue? This can unblock other people while waiting for this issue to be resolved or even give us a hint on how to fix this.\n\n  - type: textarea\n    id: logs\n    attributes:\n      label: Relevant log output\n      description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for back ticks.\n      render: shell\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/config.yml",
    "content": "blank_issues_enabled: false\ncontact_links:\n    - name: File a bug with the Prism Templates\n      url: https://github.com/PrismLibrary/Prism.Templates/issues/new/choose\n      about: Issues related to the Prism Templates should be filed in the Prism.Templates repo\n    - name: Ask a Question\n      url: https://github.com/PrismLibrary/Prism/discussions/category_choices\n      about: Please ask and answer questions for Prism here.\n    - name: Read the Docs\n      url: https://prismlibrary.com/docs\n      about: Be sure you've read the docs!\n    - name: Report missing docs\n      url: https://github.com/PrismLibrary/Prism-Documentation/issues/new\n      about: Did we miss docs on something? Let us know here!\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/feature_request.md",
    "content": "---\nname: Feature request\nabout: Suggest an idea for this project\ntitle: \"[Enhancement] YOUR IDEA!\"\nlabels: enhancement\nassignees: ''\n\n---\n\n## Summary\n\nPlease provide a brief summary of your proposal. Two to three sentences is best here.\n\n## API Changes\n\nInclude a list of all API changes, additions, subtractions as would be required by your proposal. These APIs should be considered placeholders, so the naming is not as important as getting the concepts correct. If possible you should include some \"example\" code of usage of your new API.\n\ne.g.\n\nIn order to facilitate the new Shiny Button api, a bool is added to the Button class. This is done as a bool because it is simpler to data bind and other reasons...\n\n    var button = new Button ();\n    button.MakeShiny = true; // new API\n\nThe MakeShiny API works even if the button is already visible.\n\n## Intended Use Case\n\nProvide a detailed example of where your proposal would be used and for what purpose.\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE.md",
    "content": "### Description\n\n<!-- REQUIRED -->\n<!-- Issues reporting a bug, but lacking a Reproduction will be closed!\n     Please ask questions on StackOverflow or on Slack. Issues opened\n     that are questions will be closed without comment.  -->\n\n### Steps to Reproduce\n\n1. \n2. \n3. \n\n### Expected Behavior\n\n### Actual Behavior\n\n### Basic Information\n\n- Version with issue:\n- Last known good version:\n- Xamarin.Forms version:\n- IDE:\n\n### Screenshots\n\n<!-- If the issue is a visual issue, please include screenshots showing the problem if possible -->\n\n### Reproduction Link\n\n<!-- REQUIRED - Please upload or provide a link to a reproduction case. If no reproduction sample is included, this issue may be closed or ignored until a sample has been provided -->\n\n"
  },
  {
    "path": ".github/PULL_REQUEST_TEMPLATE.md",
    "content": "﻿## Description of Change\n\nDescribe your changes here.\n\n### Bugs Fixed\n\n- Provide links to bugs here\n\n### API Changes\n\nList all API changes here (or just put None), example:\n\nAdded:\n\n- void INavigationService.GoBackToRootAsync();\n\nChanged:\n\n- void INavigationService.GoBackAsync => bool INavigationService.GoBackAsync\n\n### Behavioral Changes\n\nDescribe any non-bug related behavioral changes that may change how users app behaves when upgrading to this version of the codebase.\n\n### PR Checklist\n\n- [ ] Has tests (if omitted, state reason in description)\n- [ ] Rebased on top of master at time of PR\n- [ ] Changes adhere to coding standard"
  },
  {
    "path": ".github/lock.yml",
    "content": "# Configuration for Lock Threads - https://github.com/dessant/lock-threads\n\n# Number of days of inactivity before a closed issue or pull request is locked\ndaysUntilLock: 14\n\n# Skip issues and pull requests created before a given timestamp. Timestamp must\n# follow ISO 8601 (`YYYY-MM-DD`). Set to `false` to disable\nskipCreatedBefore: false\n\n# Issues and pull requests with these labels will be ignored. Set to `[]` to disable\nexemptLabels: []\n\n# Label to add before locking, such as `outdated`. Set to `false` to disable\nlockLabel: false\n\n# Comment to post before locking. Set to `false` to disable\nlockComment: >\n  This thread has been automatically locked since there has not been\n  any recent activity after it was closed. Please open a new issue for\n  related bugs.\n\n# Assign `resolved` as the reason for locking. Set to `false` to disable\nsetLockReason: true\n\n# Limit to only `issues` or `pulls`\n# only: issues\n\n# Optionally, specify configuration settings just for `issues` or `pulls`\n# issues:\n#   exemptLabels:\n#     - help-wanted\n#   lockLabel: outdated\n\n# pulls:\n#   daysUntilLock: 30\n\n# Repository to extend settings from\n# _extends: repo\n"
  },
  {
    "path": ".github/repo.md",
    "content": "# Prism Library Bug Report Reproduction Guide\n\nFirst or all, thank you for reporting this potential bug. Here you will find more information about why we ask you for a reproducible example of the problem, and how to provide it.\n\n## What is a reproduction?\nA reproduction, reproducible example or just repro for short is the most basic code to demonstrate the issue that you're seeing. It's the simplest way to reproduce the issue.\nIdeally, you should be able to reproduce the issue by just running the code in the project you have provided and see the problem. If any reproduction steps are needed, either note them in the issue or include them in the project somehow.\n\n## Why do we ask for a reproducible example?\nDepending on your project a codebase can be pretty big. The bigger your project, the more factors that can be of influence on a bug or issue that you might be seeing.\nIn order to be sure that this is something that is happening in Prism and not something in your code (or a combination of these things), it is super helpful to have a small sample that reproduces the issue. This way we can:\n\n* better pinpoint the source of the issue;\n* therefore, we can fix the issue faster;\n* and we can make sure that the issue is not a false positive.\n\nIt also acts as a double-edged sword. When you take your code apart piece-by-piece in a new project, adding things back one by one, it will become very clear what different factors are at play here and you might discover that the issue might be something in your code. At the very least you will be able to provide a very detailed description of what you're seeing. That helps us get to the cause faster and resolve the issue quicker.\n\n### I just want to report a bug, why do you want a reproduction?\nWe hear this a lot. We understand you're busy, we're all busy! A reproduction is not just about pleasing us or you doing our work. As already mentioned above, it will help you get a better understanding of where the issue is exactly. We've seen lots of cases where people realized, through a reproduction, that the solution was right within their reach. Regardless of it being a bug in Prism or not.\n\nWe like to see this as a team effort.\n\n#### But I don't have time for this!\nPlease help us, help you! The Prism team works on Prism in their spare time, and for free, we cannot make time to try to reproduce your issues. This is an open-source project under the MIT license. Provided as-is, without any support or guarantees. We care about our project and therefore by extension also about your project. But realize that when you come onto our repo, maybe frustrated because things are not working and you just drop a one-liner, no reproduction, mentioning that you don't have the time, that's also not very motivating for us. On the other end of these GitHub issues are still people. People that are doing their best to move this project forward, people that do not enjoying seeing you being blocked.\n\nAlso consider how that comes across. If you don't have the time to report in detail what is going on, then really how important is the issue? If this is really important and blocking you, it would seem to make sense to prioritize getting us all the details to help resolve this faster. We are all here to help you. But remember that we don't know your project and we don't know any details, please help us understand and be nice.\n\n## How to provide a reproduction project?\nWith a reproduction we want to rule out a couple of things:\n\n* The issue is not in your code, but in the Prism Library;\n* The issue has not been already resolved in the latest version of Prism which may not be the latest version available on NuGet.org;\n\nTherefore we would like to propose the following steps to create a reproduction sample:\n\n* Check if you are using the latest version of Prism and you can still reproduce the issue;\n* If yes, please check any available preview versions of Prism and see if you can reproduce the issue;\n* If you still can, please check to see if there are is an issue already opened on the repository for it;\n  * If there is, see if you can add any more detail about your specific case, that might help to resolve it quicker. If you don't have any additional information, add an emoji to the first post of the issue so we know how many people are impacted by this.\n* If there is no issue for it yet, please open one and provide detailed answers to everything in the New Issue form.\n\nAt this point we would love for you to include the reproduction.\n\n* Start with a File > New project, in other words, a clean, new Prism project. Make sure that you are using the last version of Prism.\n* Start extracting the code from your project, piece-by-piece, until you have reach the issue.\n* Try to remove some code or make small changes to see how that influences the issue you're seeing. Remove any code that is not needed to reproduce the issue. This is noise and will interfere with getting to a cause and solution.\n* Put the code on a GitHub repository and include that link in the issue that you're opening.\n\n**Note: we can't accept any zip files attached to the issue.** If we need the code in a zip, we can get that from the GitHub repository. This will also make it easier to collaborate. If we think we spot something that doesn't look right, we can open a PR on your repro repo (😬) and you can easily see the differences.\n\n## Big don'ts!\n- Never put any sensitive information in your code. No API keys, credentials, personal information, etc.\n- Never put any proprietary code in your reproduction. We are contractually not allowed to look at code that you do not own without bit legal hassles and NDA's.\n- Never submit binaries (mostly covered by putting it on a GitHub repo)\n- Do not reference external data-sources, this should rarely be needed.\n- Always refer to concrete version numbers. Avoid saying \"this happens in the latest version\". We don't know if you're using a preview version or maybe you _think_ you're using the latest version but actually aren't. To avoid any confusion, always refer to exact version numbers.\n- Do not confuse an open issue with paid support. If you require actual Enterprise Support please see Monthly or Yearly Support options with [AvantiPoint](https://avantipoint.com/developer/support)\n"
  },
  {
    "path": ".github/stale.yml",
    "content": "# Number of days of inactivity before an issue becomes stale\ndaysUntilStale: 60\n\n# Number of days of inactivity before a stale issue is closed\ndaysUntilClose: 7\n\n# Issues with these labels will never be considered stale\nexemptLabels:\n  - 'blocked by platform'\n  - 'to verify'\n  - 'roadmap'\n\n# Label to use when marking an issue as stale\nstaleLabel: wontfix\n\n# Comment to post when marking an issue as stale. Set to `false` to disable\nmarkComment: >\n  This issue has been automatically marked as stale because it has not had\n  recent activity. It will be closed if no further activity occurs. Thank you\n  for your contributions.\n\n# Comment to post when closing a stale issue. Set to `false` to disable\ncloseComment: false\n\n# Limit the number of actions per hour, from 1-30. Default is 30\nlimitPerRun: 4\n\npulls:\n  exemptLabels:\n    - 'DO-NOT-MERGE-!!! :stop_sign:'\n"
  },
  {
    "path": ".github/workflows/build_avalonia.yml",
    "content": "name: build_avalonia\n\non:\n  workflow_dispatch:\n  pull_request:\n    branches:\n      - master\n    paths:\n      - .github/workflows/build_forms.yml\n      - Directory.Build.props\n      - Directory.Build.targets\n      - Directory.Packages.props\n      - xunit.runner.json\n      - 'src/Prism.Core/**'\n      - 'src/Prism.Events/**'\n      - 'tests/Prism.Core.Tests/**'\n      - 'src/Avalonia/**'\n      - 'tests/Avalonia/**'\n\njobs:\n  build-prism-avalonia:\n    uses: avantipoint/workflow-templates/.github/workflows/dotnet-build.yml@v1\n    with:\n      name: Build Prism.Avalonia\n      solution-path: PrismLibrary_Avalonia.slnf\n      dotnet-version: 10.0.100\n"
  },
  {
    "path": ".github/workflows/build_core.yml",
    "content": "name: build_core\n\non:\n  workflow_dispatch:\n  pull_request:\n    branches:\n      - master\n    paths:\n      - .github/workflows/build_core.yml\n      - Directory.Build.props\n      - Directory.Build.targets\n      - Directory.Packages.props\n      - xunit.runner.json\n      - 'src/Prism.Core/**'\n      - 'src/Prism.Events/**'\n      - 'tests/Prism.Core.Tests/**'\n\njobs:\n  build-prism-core:\n    uses: avantipoint/workflow-templates/.github/workflows/dotnet-build.yml@v1\n    with:\n      name: Build Prism.Core\n      solution-path: PrismLibrary_Core.slnf\n      dotnet-version: 10.0.100\n"
  },
  {
    "path": ".github/workflows/build_maui.yml",
    "content": "name: build_maui\n\non:\n  workflow_dispatch:\n  pull_request:\n    branches:\n      - master\n    paths:\n      - .github/workflows/build_maui.yml\n      - Directory.Build.props\n      - Directory.Build.targets\n      - Directory.Packages.props\n      - xunit.runner.json\n      - 'src/Prism.Core/**'\n      - 'src/Prism.Events/**'\n      - 'tests/Prism.Core.Tests/**'\n      - 'src/Maui/**'\n      - 'tests/Containers/**'\n      - 'tests/Maui/**'\n\njobs:\n  build-prism-maui:\n    uses: avantipoint/workflow-templates/.github/workflows/dotnet-build.yml@v1\n    with:\n      name: Build Prism.Maui\n      solution-path: PrismLibrary_Maui.slnf\n      install-workload: maui maui-tizen\n      dotnet-version: 10.0.100\n"
  },
  {
    "path": ".github/workflows/build_uno.yml",
    "content": "name: build_uno\n\non:\n  workflow_dispatch:\n  pull_request:\n    branches:\n      - master\n    paths:\n      - .github/workflows/build_forms.yml\n      - Directory.Build.props\n      - Directory.Build.targets\n      - Directory.Packages.props\n      - xunit.runner.json\n      - 'src/Prism.Core/**'\n      - 'src/Prism.Events/**'\n      - 'tests/Prism.Core.Tests/**'\n      - 'src/Wpf/**'\n      - 'tests/Wpf/**'\n      - 'src/Uno/**'\n      - 'tests/Uno/**'\n\njobs:\n  build-prism-uno:\n    uses: avantipoint/workflow-templates/.github/workflows/msbuild-build.yml@v1\n    with:\n      name: Build Prism.Uno\n      solution-path: PrismLibrary_Uno.slnf\n      windows-sdk-version: 18362\n      dotnet-version: 10.0.100\n      install-workload: ios android macos maccatalyst wasm-tools tvos\n      uno-check: false\n      uno-check-version: 1.33.1\n      uno-check-parameters: '--skip xcode --skip gtk3 --skip vswin --skip androidemulator --skip androidsdk --skip vsmac --skip dotnetnewunotemplates'\n      run-tests: false\n"
  },
  {
    "path": ".github/workflows/build_wpf.yml",
    "content": "name: build_wpf\n\non:\n  workflow_dispatch:\n  pull_request:\n    branches:\n      - master\n    paths:\n      - .github/workflows/build_forms.yml\n      - Directory.Build.props\n      - Directory.Build.targets\n      - Directory.Packages.props\n      - xunit.runner.json\n      - 'src/Prism.Core/**'\n      - 'src/Prism.Events/**'\n      - 'tests/Prism.Core.Tests/**'\n      - 'src/Wpf/**'\n      - 'tests/Wpf/**'\n\njobs:\n  build-prism-wpf:\n    uses: avantipoint/workflow-templates/.github/workflows/dotnet-build.yml@v1\n    with:\n      name: Build Prism.Wpf\n      solution-path: PrismLibrary_Wpf.slnf\n      dotnet-version: 10.0.100\n"
  },
  {
    "path": ".github/workflows/ci.yml",
    "content": "name: Prism CI\n\non:\n  push:\n    branches:\n      - master\n      - 'releases/**'\n    paths:\n      - .github/workflows/ci.yml\n      - Directory.Build.props\n      - Directory.Build.targets\n      - Directory.Packages.props\n      - xunit.runner.json\n      - version.json\n      - LICENSE\n      - global.json\n      - 'src/**'\n  pull_request:\n    branches:\n      - master\n      - 'releases/**'\n    paths:\n      - .github/workflows/ci.yml\n  workflow_dispatch:\n\njobs:\n  build-prism-core:\n    uses: avantipoint/workflow-templates/.github/workflows/dotnet-build.yml@v1\n    with:\n      name: Build Prism.Core\n      solution-path: PrismLibrary_Core.slnf\n      code-sign: false\n      artifact-name: Core\n      dotnet-version: 10.0.100\n    secrets:\n      codeSignKeyVault: ${{ secrets.CodeSignKeyVault }}\n      codeSignClientId: ${{ secrets.CodeSignClientId }}\n      codeSignTenantId: ${{ secrets.CodeSignTenantId }}\n      codeSignClientSecret: ${{ secrets.CodeSignClientSecret }}\n      codeSignCertificate: ${{ secrets.CodeSignCertificate }}\n\n  build-prism-wpf:\n    uses: avantipoint/workflow-templates/.github/workflows/dotnet-build.yml@v1\n    with:\n      name: Build Prism.Wpf\n      solution-path: PrismLibrary_Wpf.slnf\n      code-sign: false\n      artifact-name: Wpf\n      dotnet-version: 10.0.100\n    secrets:\n      codeSignKeyVault: ${{ secrets.CodeSignKeyVault }}\n      codeSignClientId: ${{ secrets.CodeSignClientId }}\n      codeSignTenantId: ${{ secrets.CodeSignTenantId }}\n      codeSignClientSecret: ${{ secrets.CodeSignClientSecret }}\n      codeSignCertificate: ${{ secrets.CodeSignCertificate }}\n\n  build-prism-uno:\n    uses: avantipoint/workflow-templates/.github/workflows/msbuild-build.yml@v1\n    with:\n      name: Build Prism.Uno\n      solution-path: PrismLibrary_Uno.slnf\n      windows-sdk-version: 18362\n      dotnet-version: 10.0.100\n      install-workload: ios android macos maccatalyst wasm-tools tvos\n      uno-check: false\n      uno-check-version: 1.33.1\n      uno-check-parameters: '--skip xcode --skip gtk3 --skip vswin --skip androidemulator --skip androidsdk --skip vsmac --skip dotnetnewunotemplates'\n      run-tests: false\n      code-sign: false\n      artifact-name: Uno\n    secrets:\n      codeSignKeyVault: ${{ secrets.CodeSignKeyVault }}\n      codeSignClientId: ${{ secrets.CodeSignClientId }}\n      codeSignTenantId: ${{ secrets.CodeSignTenantId }}\n      codeSignClientSecret: ${{ secrets.CodeSignClientSecret }}\n      codeSignCertificate: ${{ secrets.CodeSignCertificate }}\n\n  build-prism-maui:\n    uses: avantipoint/workflow-templates/.github/workflows/dotnet-build.yml@v1\n    with:\n      name: Build Prism.Maui\n      solution-path: PrismLibrary_Maui.slnf\n      install-workload: maui maui-tizen\n      code-sign: false\n      artifact-name: Maui\n      dotnet-version: 10.0.100\n    secrets:\n      codeSignKeyVault: ${{ secrets.CodeSignKeyVault }}\n      codeSignClientId: ${{ secrets.CodeSignClientId }}\n      codeSignTenantId: ${{ secrets.CodeSignTenantId }}\n      codeSignClientSecret: ${{ secrets.CodeSignClientSecret }}\n      codeSignCertificate: ${{ secrets.CodeSignCertificate }}\n\n  build-prism-avalonia:\n    uses: avantipoint/workflow-templates/.github/workflows/dotnet-build.yml@v1\n    with:\n      name: Build Prism.Avalonia\n      solution-path: PrismLibrary_Avalonia.slnf\n      code-sign: false\n      artifact-name: Avalonia\n      dotnet-version: 10.0.100\n    secrets:\n      codeSignKeyVault: ${{ secrets.CodeSignKeyVault }}\n      codeSignClientId: ${{ secrets.CodeSignClientId }}\n      codeSignTenantId: ${{ secrets.CodeSignTenantId }}\n      codeSignClientSecret: ${{ secrets.CodeSignClientSecret }}\n      codeSignCertificate: ${{ secrets.CodeSignCertificate }}\n\n  generate-consolidated-artifacts:\n    needs: [build-prism-core, build-prism-wpf, build-prism-uno, build-prism-maui, build-prism-avalonia]\n    runs-on: windows-latest\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v3\n\n      - name: Download Core\n        uses: actions/download-artifact@v4\n        with:\n          name: Core\n          path: artifacts\\Core\n\n      - name: Download Wpf\n        uses: actions/download-artifact@v4\n        with:\n          name: Wpf\n          path: artifacts\\Wpf\n\n      - name: Download Uno\n        uses: actions/download-artifact@v4\n        with:\n          name: Uno\n          path: artifacts\\Uno\n\n      - name: Download Maui\n        uses: actions/download-artifact@v4\n        with:\n          name: Maui\n          path: artifacts\\Maui\n\n      - name: Download Avalonia\n        uses: actions/download-artifact@v4\n        with:\n          name: Avalonia\n          path: artifacts\\Avalonia\n\n      - name: Consolidate Artifacts\n        run: build\\consolidate-artifacts.ps1\n        shell: powershell\n\n      - name: Upload Consolidated NuGets\n        uses: actions/upload-artifact@v4\n        with:\n          name: NuGet\n          path: .\\artifacts\\nuget\n\n  deploy-internal:\n    uses: avantipoint/workflow-templates/.github/workflows/deploy-nuget.yml@v1\n    needs: generate-consolidated-artifacts\n    if: ${{ github.event_name == 'push' }}\n    with:\n      name: Deploy Internal\n    secrets:\n      feedUrl: ${{ secrets.IN_HOUSE_NUGET_FEED }}\n      apiKey: ${{ secrets.IN_HOUSE_API_KEY }}\n\n  deploy-commercial-plus:\n    uses: avantipoint/workflow-templates/.github/workflows/deploy-nuget.yml@v1\n    needs: generate-consolidated-artifacts\n    if: ${{ github.event_name == 'push' }}\n    with:\n      name: Deploy Commercial Plus\n    secrets:\n      feedUrl: ${{ secrets.PRISM_NUGET_FEED }}\n      apiKey: ${{ secrets.PRISM_NUGET_TOKEN }}\n"
  },
  {
    "path": ".github/workflows/publish-release.yml",
    "content": "name: Publish Prism Release\n\non:\n  release:\n    types: [published]\n\njobs:\n  publish-internal:\n    uses: avantipoint/workflow-templates/.github/workflows/deploy-nuget-from-release.yml@v1\n    secrets:\n      feedUrl: ${{ secrets.IN_HOUSE_NUGET_FEED }}\n      apiKey: ${{ secrets.IN_HOUSE_API_KEY }}\n\n  publish-commercial-plus:\n    uses: avantipoint/workflow-templates/.github/workflows/deploy-nuget-from-release.yml@v1\n    secrets:\n      feedUrl: ${{ secrets.PRISM_NUGET_FEED }}\n      apiKey: ${{ secrets.PRISM_NUGET_TOKEN }}\n"
  },
  {
    "path": ".github/workflows/sponsor-actions.yml",
    "content": "on: \n  issues:\n    types: [opened]\n  pull_request:\n    types: [opened]\n\njobs:\n  sponsor_job:\n    runs-on: ubuntu-latest\n    name: Add Sponsor Labels\n    steps:\n    - name: Add Sponsor Labels\n      id: sponsor-labels\n      uses: brianlagunas/sponsor-action@v1.0\n      with:\n        maintainers: 'brianlagunas,dansiegel'\n        github_token: ${{ secrets.GITHUB_TOKEN }}"
  },
  {
    "path": ".github/workflows/start-release.yml",
    "content": "name: Start NuGet Release\n\non:\n  workflow_dispatch:\n\njobs:\n  build-prism-core:\n    uses: avantipoint/workflow-templates/.github/workflows/dotnet-build.yml@v1\n    with:\n      name: Build Prism.Core\n      solution-path: PrismLibrary_Core.slnf\n      code-sign: true\n      artifact-name: Core\n      build-args: /p:OfficialRelease=true\n    secrets:\n      codeSignKeyVault: ${{ secrets.CodeSignKeyVault }}\n      codeSignClientId: ${{ secrets.CodeSignClientId }}\n      codeSignTenantId: ${{ secrets.CodeSignTenantId }}\n      codeSignClientSecret: ${{ secrets.CodeSignClientSecret }}\n      codeSignCertificate: ${{ secrets.CodeSignCertificate }}\n\n  build-prism-wpf:\n    uses: avantipoint/workflow-templates/.github/workflows/dotnet-build.yml@v1\n    with:\n      name: Build Prism.Wpf\n      solution-path: PrismLibrary_Wpf.slnf\n      code-sign: true\n      artifact-name: Wpf\n      build-args: /p:OfficialRelease=true\n    secrets:\n      codeSignKeyVault: ${{ secrets.CodeSignKeyVault }}\n      codeSignClientId: ${{ secrets.CodeSignClientId }}\n      codeSignTenantId: ${{ secrets.CodeSignTenantId }}\n      codeSignClientSecret: ${{ secrets.CodeSignClientSecret }}\n      codeSignCertificate: ${{ secrets.CodeSignCertificate }}\n\n  build-prism-uno:\n    uses: avantipoint/workflow-templates/.github/workflows/msbuild-build.yml@v1\n    with:\n      name: Build Prism.Uno\n      solution-path: PrismLibrary_Uno.slnf\n      windows-sdk-version: 18362\n      dotnet-version: 8.0.300\n      install-workload: ios android macos maccatalyst wasm-tools\n      uno-check: false\n      uno-check-version: 1.25.1\n      uno-check-parameters: '--skip xcode --skip gtk3 --skip vswin --skip androidemulator --skip androidsdk --skip vsmac --skip dotnetnewunotemplates'\n      run-tests: false\n      code-sign: true\n      artifact-name: Uno\n      build-args: /p:OfficialRelease=true\n    secrets:\n      codeSignKeyVault: ${{ secrets.CodeSignKeyVault }}\n      codeSignClientId: ${{ secrets.CodeSignClientId }}\n      codeSignTenantId: ${{ secrets.CodeSignTenantId }}\n      codeSignClientSecret: ${{ secrets.CodeSignClientSecret }}\n      codeSignCertificate: ${{ secrets.CodeSignCertificate }}\n\n  build-prism-maui:\n    uses: avantipoint/workflow-templates/.github/workflows/dotnet-build.yml@v1\n    with:\n      name: Build Prism.Maui\n      solution-path: PrismLibrary_Maui.slnf\n      dotnet-version: 8.0.x\n      install-workload: maui maui-tizen\n      code-sign: true\n      artifact-name: Maui\n      build-args: /p:OfficialRelease=true\n    secrets:\n      codeSignKeyVault: ${{ secrets.CodeSignKeyVault }}\n      codeSignClientId: ${{ secrets.CodeSignClientId }}\n      codeSignTenantId: ${{ secrets.CodeSignTenantId }}\n      codeSignClientSecret: ${{ secrets.CodeSignClientSecret }}\n      codeSignCertificate: ${{ secrets.CodeSignCertificate }}\n\n  generate-consolidated-artifacts:\n    needs: [build-prism-core, build-prism-wpf, build-prism-uno]\n    runs-on: windows-latest\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v3\n\n      - name: Download Core\n        uses: actions/download-artifact@v3\n        with:\n          name: Core\n          path: artifacts\\Core\n\n      - name: Download Wpf\n        uses: actions/download-artifact@v3\n        with:\n          name: Wpf\n          path: artifacts\\Wpf\n\n      - name: Download Uno\n        uses: actions/download-artifact@v3\n        with:\n          name: Uno\n          path: artifacts\\Uno\n\n      - name: Download Maui\n        uses: actions/download-artifact@v3\n        with:\n          name: Maui\n          path: artifacts\\Maui\n\n      - name: Consolidate Artifacts\n        run: build\\consolidate-artifacts.ps1\n        shell: powershell\n\n      - name: Upload Consolidated NuGets\n        uses: actions/upload-artifact@v3\n        with:\n          name: NuGet\n          path: .\\artifacts\\nuget\n\n  release:\n    uses: avantipoint/workflow-templates/.github/workflows/generate-release.yml@v1\n    needs: [generate-consolidated-artifacts]\n    permissions:\n      contents: write\n    with:\n      package-name: Prism.Core\n"
  },
  {
    "path": ".gitignore",
    "content": "## Ignore Visual Studio temporary files, build results, and\n## files generated by popular Visual Studio add-ons.\n\n# User-specific files\n*.suo\n*.user\n*.sln.docstates\n\n# Build results\n[Dd]ebug/\n[Dd]ebugPublic/\n[Rr]elease/\n[Rr]eleases/\nx64/\nx86/\n# build/\nbld/\n[Bb]in/\n[Oo]bj/\n\n# Visual Studio cache/options directory\n.vs/\n.droidres/\n\n# DNX\nartifacts/\n\n# Roslyn cache directories\n*.ide/\n\n# MSTest test Results\n[Tt]est[Rr]esult*/\n[Bb]uild[Ll]og.*\n\n#NUNIT\n*.VisualState.xml\nTestResult.xml\n\n# Build Results of an ATL Project\n[Dd]ebugPS/\n[Rr]eleasePS/\ndlldata.c\n\n*_i.c\n*_p.c\n*_i.h\n*.ilk\n*.meta\n*.obj\n*.pch\n*.pdb\n*.pgc\n*.pgd\n*.rsp\n*.sbr\n*.tlb\n*.tli\n*.tlh\n*.tmp\n*.tmp_proj\n*.log\n*.vspscc\n*.vssscc\n.builds\n*.pidb\n*.svclog\n*.scc\n\n# Chutzpah Test files\n_Chutzpah*\n\n# Visual C++ cache files\nipch/\n*.aps\n*.ncb\n*.opensdf\n*.sdf\n*.cachefile\n\n# Visual Studio profiler\n*.psess\n*.vsp\n*.vspx\n\n# TFS 2012 Local Workspace\n$tf/\n\n# Guidance Automation Toolkit\n*.gpState\n\n# ReSharper is a .NET coding add-in\n_ReSharper*/\n*.[Rr]e[Ss]harper\n*.DotSettings.user\n\n# JustCode is a .NET coding addin-in\n.JustCode\n\n# TeamCity is a build add-in\n_TeamCity*\n\n# DotCover is a Code Coverage Tool\n*.dotCover\n\n# NCrunch\n_NCrunch_*\n.*crunch*.local.xml\n\n# MightyMoose\n*.mm.*\nAutoTest.Net/\n\n# Web workbench (sass)\n.sass-cache/\n\n# Installshield output folder\n[Ee]xpress/\n\n# DocProject is a documentation generator add-in\nDocProject/buildhelp/\nDocProject/Help/*.HxT\nDocProject/Help/*.HxC\nDocProject/Help/*.hhc\nDocProject/Help/*.hhk\nDocProject/Help/*.hhp\nDocProject/Help/Html2\nDocProject/Help/html\n\n# Click-Once directory\npublish/\n\n# Publish Web Output\n*.[Pp]ublish.xml\n*.azurePubxml\n# TODO: Comment the next line if you want to checkin your web deploy settings\n# but database connection strings (with potential passwords) will be unencrypted\n*.pubxml\n*.publishproj\n\n# NuGet\n.nuget/\nnuget.exe\n*.nuget.props\n*.nuget.targets\n*.lock.json\n\n# NuGet Packages\n*.nupkg\n# The packages folder can be ignored because of Package Restore\n**/packages/*\n# except build/, which is used as an MSBuild target.\n!**/packages/build/\n# If using the old MSBuild-Integrated Package Restore, uncomment this:\n#!**/packages/repositories.config\n\n# Windows Azure Build Output\ncsx/\n*.build.csdef\n\n# Windows Store app package directory\nAppPackages/\nBundleArtifacts/\n\n# Others\nsql/\n*.Cache\nClientBin/\n[Ss]tyle[Cc]op.*\n~$*\n*~\n*.dbmdl\n*.dbproj.schemaview\n# *.pfx\n*.publishsettings\nnode_modules/\n\n# RIA/Silverlight projects\nGenerated_Code/\n\n# Backup & report files from converting an old project file\n# to a newer Visual Studio version. Backup files are not needed,\n# because we have git ;-)\n_UpgradeReport_Files/\nBackup*/\nUpgradeLog*.XML\nUpgradeLog*.htm\n\n# SQL Server files\n*.mdf\n*.ldf\n\n# Business Intelligence projects\n*.rdl.data\n*.bim.layout\n*.bim_*.settings\n\n# Microsoft Fakes\nFakesAssemblies/\n\n# DotNet Tools\n**/build/.store/*\n\n# MFractor\n.mfractor/\n\n# Jetbrains files\n.idea*\n\n# Binlog\n*.binlog\n\n# macOS\n.DS_Store\n\n# VSCode\n.mono\n"
  },
  {
    "path": ".vscode/extensions.json",
    "content": "{\n  \"recommendations\": [\n    \"ms-dotnettools.csharp\",\n    \"ms-vscode.powershell\",\n    \"editorconfig.editorconfig\",\n    \"shd101wyy.markdown-preview-enhanced\",\n    \"streetsidesoftware.code-spell-checker\",\n    \"unoplatform.vscode\"\n  ]\n}\n"
  },
  {
    "path": ".vscode/launch.json",
    "content": "{\n  // Use IntelliSense to find out which attributes exist for C# debugging\n  // Use hover for the description of the existing attributes\n  // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md\n  \"version\": \"0.2.0\",\n  \"configurations\": [\n    {\n      \"name\": \"Uno Platform Mobile\",\n      \"type\": \"Uno\",\n      \"request\": \"launch\",\n      // any Uno* task will do, this is simply to satisfy vscode requirement when a launch.json is present\n      \"preLaunchTask\": \"Uno: android | Debug | android-x64\"\n    },\n    {\n      // Use IntelliSense to find out which attributes exist for C# debugging\n      // Use hover for the description of the existing attributes\n      // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md\n      \"name\": \"Debug (Chrome, WebAssembly)\",\n      \"type\": \"chrome\",\n      \"request\": \"launch\",\n      \"url\": \"http://localhost:5001\",\n      \"webRoot\": \"${workspaceFolder}/e2e/Uno/HelloWorld.Wasm\",\n      \"inspectUri\": \"{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}\",\n      \"timeout\": 30000,\n      \"server\": {\n        \"runtimeExecutable\": \"dotnet\",\n        \"program\": \"run\",\n        \"args\": [\"--no-build\"],\n        \"outputCapture\": \"std\",\n        \"timeout\": 30000,\n        \"cwd\": \"${workspaceFolder}/e2e/Uno/HelloWorld.Wasm\"\n      }\n    },\n    {\n      // Use IntelliSense to find out which attributes exist for C# debugging\n      // Use hover for the description of the existing attributes\n      // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md\n      \"name\": \"Skia.GTK (Debug)\",\n      \"type\": \"coreclr\",\n      \"request\": \"launch\",\n      \"preLaunchTask\": \"build-skia-gtk\",\n      // If you have changed target frameworks, make sure to update the program path.\n      \"program\": \"${workspaceFolder}/e2e/Uno/HelloWorld.Skia.Gtk/bin/Debug/net8.0/HelloWorld.Skia.Gtk.dll\",\n      \"args\": [],\n      \"env\": {\n        \"DOTNET_MODIFIABLE_ASSEMBLIES\": \"debug\"\n      },\n      \"cwd\": \"${workspaceFolder}/e2e/Uno/HelloWorld.Skia.Gtk\",\n      // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console\n      \"console\": \"internalConsole\",\n      \"stopAtEntry\": false\n    }\n  ]\n}\n"
  },
  {
    "path": ".vscode/settings.json",
    "content": "{\n  \"explorer.fileNesting.enabled\": true,\n  \"explorer.fileNesting.expand\": false,\n  \"explorer.fileNesting.patterns\": {\n    \"*.xaml\": \"$(capture).xaml.cs\",\n    \"*.ts\": \"${capture}.js\",\n    \"*.js\": \"${capture}.js.map, ${capture}.min.js, ${capture}.d.ts\",\n    \"*.jsx\": \"${capture}.js\",\n    \"*.tsx\": \"${capture}.ts\",\n    \"tsconfig.json\": \"tsconfig.*.json\",\n    \"package.json\": \"package-lock.json, yarn.lock, pnpm-lock.yaml\"\n  },\n  \"[azure-pipelines]\": {\n    \"editor.insertSpaces\": true,\n    \"editor.tabSize\": 2,\n    \"editor.quickSuggestions\": {\n      \"other\": true,\n      \"comments\": false,\n      \"strings\": true\n    },\n    \"editor.autoIndent\": \"full\"\n  },\n  \"[cschleiden.vscode-github-actions]\": {\n    \"editor.insertSpaces\": true,\n    \"editor.tabSize\": 2,\n    \"editor.quickSuggestions\": {\n      \"other\": true,\n      \"comments\": false,\n      \"strings\": true\n    },\n    \"editor.autoIndent\": \"full\"\n  },\n  \"files.associations\": {\n    \".github/**/*.yml\": \"cschleiden.vscode-github-actions\"\n  }\n}\n"
  },
  {
    "path": ".vscode/tasks.json",
    "content": "{\n  \"version\": \"2.0.0\",\n  \"tasks\": [\n    {\n      \"label\": \"build-wasm\",\n      \"command\": \"dotnet\",\n      \"type\": \"process\",\n      \"args\": [\n        \"build\",\n        \"${workspaceFolder}/e2e/Uno/HelloWorld.Wasm/HelloWorld.Wasm.csproj\",\n        \"/property:GenerateFullPaths=true\",\n        \"/consoleloggerparameters:NoSummary\"\n      ],\n      \"problemMatcher\": \"$msCompile\"\n    },\n    {\n      \"label\": \"publish-wasm\",\n      \"command\": \"dotnet\",\n      \"type\": \"process\",\n      \"args\": [\n        \"publish\",\n        \"${workspaceFolder}/e2e/Uno/HelloWorld.Wasm/HelloWorld.Wasm.csproj\",\n        \"/property:GenerateFullPaths=true\",\n        \"/consoleloggerparameters:NoSummary\"\n      ],\n      \"problemMatcher\": \"$msCompile\"\n    },\n    {\n      \"label\": \"build-skia-gtk\",\n      \"command\": \"dotnet\",\n      \"type\": \"process\",\n      \"args\": [\n        \"build\",\n        \"${workspaceFolder}/e2e/Uno/HelloWorld.Skia.Gtk/HelloWorld.Skia.Gtk.csproj\",\n        \"/property:GenerateFullPaths=true\",\n        \"/consoleloggerparameters:NoSummary\"\n      ],\n      \"problemMatcher\": \"$msCompile\"\n    },\n    {\n      \"label\": \"publish-skia-gtk\",\n      \"command\": \"dotnet\",\n      \"type\": \"process\",\n      \"args\": [\n        \"publish\",\n        \"${workspaceFolder}/e2e/Uno/HelloWorld.Skia.Gtk/HelloWorld.Skia.Gtk.csproj\",\n        \"/property:GenerateFullPaths=true\",\n        \"/consoleloggerparameters:NoSummary\"\n      ],\n      \"problemMatcher\": \"$msCompile\"\n    }\n  ]\n}\n"
  },
  {
    "path": "Clean-Outputs.ps1",
    "content": "Get-ChildItem .\\ -include bin,obj -Recurse | foreach ($_) { remove-item $_.fullname -Force -Recurse }\nGet-ChildItem .\\ -include .mfractor -Attributes Hidden -Recurse | foreach ($_) { remove-item $_.fullname -Force -Recurse }\nGet-ChildItem .\\ -include .vs -Attributes Hidden -Recurse | foreach ($_) { remove-item $_.fullname -Force -Recurse }\nGet-ChildItem .\\ -include *.csproj.user -Recurse | foreach ($_) { remove-item $_.fullname -Force -Recurse }"
  },
  {
    "path": "CodeCoverage.runsettings",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- File name extension must be .runsettings -->\n<RunSettings>\n  <DataCollectionRunSettings>\n    <DataCollectors>\n      <DataCollector friendlyName=\"Code Coverage\" uri=\"datacollector://Microsoft/CodeCoverage/2.0\" assemblyQualifiedName=\"Microsoft.VisualStudio.Coverage.DynamicCoverageDataCollector, Microsoft.VisualStudio.TraceCollector, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\">\n        <Configuration>\n          <CodeCoverage>\n\n            <!--\nAbout include/exclude lists:\nEmpty \"Include\" clauses imply all; empty \"Exclude\" clauses imply none.\nEach element in the list is a regular expression (ECMAScript syntax). See http://msdn.microsoft.com/library/2k3te2cs.aspx.\nAn item must first match at least one entry in the include list to be included.\nIncluded items must then not match any entries in the exclude list to remain included.\n-->\n\n            <!-- Match assembly file paths: -->\n            <ModulePaths>\n              <Include>\n                <ModulePath>.*Prism.*\\.dll$</ModulePath>\n              </Include>\n              <Exclude>\n                <ModulePath>.*Tests.*</ModulePath>\n              </Exclude>\n            </ModulePaths>\n\n          </CodeCoverage>\n        </Configuration>\n      </DataCollector>\n    </DataCollectors>\n  </DataCollectionRunSettings>\n</RunSettings>"
  },
  {
    "path": "Directory.Build.props",
    "content": "<Project>\n\n  <PropertyGroup>\n    <NeutralLanguage>en</NeutralLanguage>\n    <Authors>Brian Lagunas;Dan Siegel</Authors>\n    <PackageProjectUrl>https://github.com/PrismLibrary/Prism</PackageProjectUrl>\n    <PackageLicenseFile>LICENSE</PackageLicenseFile>\n    <PackageIcon>prism-logo.png</PackageIcon>\n    <PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>\n    <RepositoryType>git</RepositoryType>\n    <RepositoryUrl>https://github.com/PrismLibrary/Prism</RepositoryUrl>\n    <IncludeSymbols>True</IncludeSymbols>\n    <IncludeSource>True</IncludeSource>\n    <PackageOutputPath>$(MSBuildThisFileDirectory)Artifacts</PackageOutputPath>\n    <EscapedCurrentDirectory>$([System.Text.RegularExpressions.Regex]::Escape('$(MSBuildThisFileDirectory)'))</EscapedCurrentDirectory>\n    <RelativeProjectPath>$([System.Text.RegularExpressions.Regex]::Replace('$(MSBuildProjectFullPath)', '$(EscapedCurrentDirectory)', ''))</RelativeProjectPath>\n    <PrismPackageIcon>$(MSBuildThisFileDirectory)images/prism-logo.png</PrismPackageIcon>\n    <PrismLicenseFile>$(MSBuildThisFileDirectory)LICENSE</PrismLicenseFile>\n    <LangVersion>latest</LangVersion>\n    <PolySharpIncludeGeneratedTypes>\n      System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute;\n      System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes;\n      System.Diagnostics.CodeAnalysis.MaybeNullWhenAttribute;\n      System.Runtime.CompilerServices.IsExternalInit;\n    </PolySharpIncludeGeneratedTypes>\n    <WarningsAsErrors>$(WarningsAsErrors);IDE0003</WarningsAsErrors>\n    <ImplicitUsings>enable</ImplicitUsings>\n  </PropertyGroup>\n\n  <PropertyGroup>\n    <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>\n    <NoWarn>$(NoWarn);NU5104;NU5100;NU5118;NU5123;NU1603;CS1701;CS1702;XA0101;MSB3277;CS8785;CS8669;CS1998;NU1507</NoWarn>\n    <IsCoreProject>false</IsCoreProject>\n    <IsCoreProject Condition=\" $(MSBuildProjectName.Equals('Prism.Core')) OR $(MSBuildProjectName.Equals('Prism.Events'))\">true</IsCoreProject>\n    <IsTestProject>$(MSBuildProjectName.Contains('Test'))</IsTestProject>\n    <IsWpfProject>$(MSBuildProjectName.Contains('Wpf'))</IsWpfProject>\n    <IsUnoProject>$(MSBuildProjectName.Contains('Uno'))</IsUnoProject>\n    <IsFormsProject>$(MSBuildProjectName.Contains('Forms'))</IsFormsProject>\n    <IsMauiProject>$(MSBuildProjectName.Contains('Maui'))</IsMauiProject>\n    <IsAvaloniaProject>$(MSBuildProjectName.Contains('Avalonia'))</IsAvaloniaProject>\n    <SignAssembly Condition=\" ('$(IsCoreProject)' Or '$(IsWpfProject)') \">True</SignAssembly>\n    <AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)prism.snk</AssemblyOriginatorKeyFile>\n    <DelaySign>False</DelaySign>\n    <DisableCorePublish Condition=\" '$(DisableCorePublish)' == '' \">false</DisableCorePublish>\n    <DisableWpfPublish Condition=\" '$(DisableWpfPublish)' == '' \">false</DisableWpfPublish>\n    <DisableFormsPublish Condition=\" '$(DisableFormsPublish)' == '' \">false</DisableFormsPublish>\n    <DisableUnoPublish Condition=\" '$(DisableUnoPublish)' == '' \">false</DisableUnoPublish>\n    <IsPackable>false</IsPackable>\n    <PackageTags Condition=\" '$(IsCoreProject)' == 'True' \">prism;wpf;xamarin;xaml</PackageTags>\n    <PackageTags Condition=\" '$(IsWpfProject)' == 'True' \">prism;mvvm;wpf;dependency injection;di</PackageTags>\n    <PackageTags Condition=\" '$(IsUnoProject)' == 'True' \">prism;mvvm;winui;uno-platform;xamarin;webassembly;android;ios;macos;dependency injection;di</PackageTags>\n    <PackageTags Condition=\" '$(IsFormsProject)' == 'True' \">prism;mvvm;uwp;android;ios;xamarin;xamarin.forms;dependency injection;di</PackageTags>\n    <PackageTags Condition=\" '$(IsAvaloniaProject)' == 'True' \">prism;mvvm;axaml;xaml;desktop;navigation;prismavalonia;dialog;linux;macos;avalonia;dependency injection;di</PackageTags>\n    <IS_PREVIEW Condition=\" '$(IS_PREVIEW)' == '' \">false</IS_PREVIEW>\n    <IS_RELEASE Condition=\" '$(IS_RELEASE)' == '' \">false</IS_RELEASE>\n    <UseWpf>$(IsWpfProject)</UseWpf>\n    <UseMaui>$(IsMauiProject)</UseMaui>\n    <MSBuildSdkExtrasVersion>3.0.44</MSBuildSdkExtrasVersion>\n  </PropertyGroup>\n\n  <!--\n    -->\n  <Choose>\n    <When Condition=\"$(IsWpfProject)\">\n      <PropertyGroup>\n        <DefineConstants>$(DefineConstants);WPF</DefineConstants>\n      </PropertyGroup>\n      <ItemGroup>\n        <Using Include=\"System.Windows\" />\n        <Using Include=\"System.Windows.Controls\" />\n        <Using Include=\"System.Windows.Controls.Primitives\" />\n        <Using Include=\"System.Windows.Data\" />\n      </ItemGroup>\n    </When>\n    <When Condition=\"$(IsUnoProject)\">\n      <PropertyGroup>\n        <DefineConstants>$(DefineConstants);UNO_WINUI</DefineConstants>\n        <DefineConstants Condition=\"!$(TargetFramework.Contains('-')) OR $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'browser'\">$(DefineConstants);UNO_WASM</DefineConstants>\n      </PropertyGroup>\n      <ItemGroup>\n        <Using Include=\"Microsoft.UI.Xaml\" />\n        <Using Include=\"Microsoft.UI.Xaml.Controls\" />\n        <Using Include=\"Microsoft.UI.Xaml.Controls.Primitives\" />\n        <Using Include=\"Microsoft.UI.Xaml.Data\" />\n        <Using Include=\"Microsoft.UI.Xaml.Media\" />\n      </ItemGroup>\n    </When>\n    <When Condition=\"$(IsAvaloniaProject)\">\n      <PropertyGroup>\n        <DefineConstants>$(DefineConstants);AVALONIA</DefineConstants>\n      </PropertyGroup>\n      <ItemGroup>\n        <Using Include=\"Avalonia\" />\n        <Using Include=\"Avalonia.Controls\" />\n        <Using Include=\"Avalonia.Controls.ApplicationLifetimes\" />\n        <Using Include=\"Avalonia.Controls.Primitives\" />\n        <Using Include=\"Avalonia.Interactivity\" />\n        <Using Include=\"Avalonia.Markup.Xaml\" />\n        <Using Include=\"Avalonia.Controls.Control\" Alias=\"FrameworkElement\" />\n        <Using Include=\"Avalonia.AvaloniaObject\" Alias=\"DependencyObject\" />\n        <Using Include=\"Avalonia.AvaloniaPropertyChangedEventArgs\" Alias=\"DependencyPropertyChangedEventArgs\" />\n      </ItemGroup>\n    </When>\n  </Choose>\n\n  <!-- Versioning -->\n  <PropertyGroup>\n    <PackageReleaseNotes Condition=\"$(OfficialRelease) == 'true'\">https://github.com/PrismLibrary/Prism/releases/tag/$(Version)</PackageReleaseNotes>\n  </PropertyGroup>\n\n  <PropertyGroup Condition=\" $(TargetFramework.StartsWith('MonoAndroid')) \">\n    <DefineConstants>$(DefineConstants);__ANDROID__</DefineConstants>\n  </PropertyGroup>\n\n  <Choose>\n    <When Condition=\"$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'\">\n      <PropertyGroup>\n        <SupportedOSPlatformVersion>21.0</SupportedOSPlatformVersion>\n      </PropertyGroup>\n    </When>\n    <When Condition=\"$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'\">\n      <PropertyGroup>\n        <SupportedOSPlatformVersion>14.2</SupportedOSPlatformVersion>\n      </PropertyGroup>\n    </When>\n    <When Condition=\"$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'macos'\">\n      <PropertyGroup>\n        <SupportedOSPlatformVersion>10.14</SupportedOSPlatformVersion>\n      </PropertyGroup>\n    </When>\n    <When Condition=\"$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'\">\n      <PropertyGroup>\n        <SupportedOSPlatformVersion>14.0</SupportedOSPlatformVersion>\n      </PropertyGroup>\n    </When>\n    <When Condition=\"$(TargetFramework.Contains('windows10'))\">\n      <PropertyGroup>\n        <UseRidGraph>true</UseRidGraph>\n        <SupportedOSPlatformVersion>10.0.18362.0</SupportedOSPlatformVersion>\n        <TargetPlatformMinVersion>10.0.18362.0</TargetPlatformMinVersion>\n      </PropertyGroup>\n    </When>\n  </Choose>\n\n  <ItemGroup>\n    <None Include=\"build\\Package.props\" Pack=\"true\" PackagePath=\"buildTransitive\\$(PackageId).props\" Condition=\"exists('build\\Package.props')\"/>\n    <None Include=\"build\\Package.targets\" Pack=\"true\" PackagePath=\"buildTransitive\\$(PackageId).targets\" Condition=\"exists('build\\Package.targets')\"/>\n  </ItemGroup>\n\n  <ItemGroup Condition=\" $(IsTestProject) \">\n    <None Include=\"$(MSBuildThisFileDirectory)xunit.runner.json\"\n          CopyToOutputDirectory=\"PreserveNewest\" />\n  </ItemGroup>\n\n  <ItemGroup Condition=\" $(UseMaui) != 'true' \">\n    <PackageReference Include=\"Microsoft.NETFramework.ReferenceAssemblies\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>\n    </PackageReference>\n  </ItemGroup>\n\n  <ItemGroup Condition=\" $(DISABLE_GITVERSIONING) != 'true' \">\n    <PackageReference Include=\"Nerdbank.GitVersioning\"\n                      Condition=\" !$(MSBuildProjectDirectory.Contains('e2e')) \">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>\n    </PackageReference>\n  </ItemGroup>\n\n  <ItemGroup Condition=\" $(IsPackable) \">\n    <PackageReference Include=\"Microsoft.SourceLink.GitHub\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>\n    </PackageReference>\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "Directory.Build.targets",
    "content": "<Project>\n  <Import Project=\"winappsdk-workarounds.targets\" Condition=\" $(IsUnoProject) == 'true' \" />\n  <PropertyGroup>\n    <Product>$(AssemblyName) ($(TargetFramework))</Product>\n  </PropertyGroup>\n\n  <PropertyGroup Condition=\" $(IsPackable) \">\n    <!-- Nuget source link -->\n    <SymbolPackageFormat>snupkg</SymbolPackageFormat>\n    <PublishRepositoryUrl>true</PublishRepositoryUrl>\n    <EmbedUntrackedSources>true</EmbedUntrackedSources>\n    <AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>\n  </PropertyGroup>\n\n</Project>\n"
  },
  {
    "path": "Directory.Packages.props",
    "content": "<Project>\n  <ItemGroup>\n    <PackageVersion Include=\"PolySharp\" Version=\"1.14.1\" />\n    <PackageVersion Include=\"Prism.Container.Abstractions\" Version=\"9.0.114\" />\n    <PackageVersion Include=\"Prism.Container.DryIoc\" Version=\"9.0.114\" />\n    <PackageVersion Include=\"Prism.Container.Unity\" Version=\"9.0.114\" />\n    <PackageVersion Include=\"System.ValueTuple\" Version=\"4.5.0\" />\n    <PackageVersion Include=\"System.Reactive\" Version=\"6.0.1\" />\n    <PackageVersion Include=\"Xamarin.Forms\" Version=\"5.0.0.2401\" />\n    <PackageVersion Include=\"Microsoft.Xaml.Behaviors.Wpf\" Version=\"1.1.122\" />\n  </ItemGroup>\n  <!-- Maui -->\n  <!--<ItemGroup Condition=\" $(UseMaui) == 'true' \">\n    <PackageVersion Include=\"Microsoft.Maui.Controls\" Version=\"9.0.110\"\n                    Condition=\"$(MSBuildProjectName.StartsWith('Prism.')) AND $(TargetFramework.StartsWith('net9.0'))\" />\n    <PackageVersion Include=\"Microsoft.Maui.Controls\" Version=\"10.0.10\"\n                    Condition=\"$(MSBuildProjectName.StartsWith('Prism.')) AND $(TargetFramework.StartsWith('net10.0'))\" />\n    <PackageVersion Include=\"Microsoft.Maui.Controls\" Version=\"$(MauiVersion)\" Condition=\"!$(MSBuildProjectName.StartsWith('Prism.'))\" />\n  </ItemGroup>-->\n  <!-- Uno\n    Note that the $(UnoVersion) comes from the Uno.Sdk. You should not update it manually. To update the version of Uno,\n    you should instead update the Sdk version in the global.json file.\n\n    See https://aka.platform.uno/upgrade-uno-packages for more information.\n  -->\n  <ItemGroup Condition=\" $(IsUnoProject) == 'true' \">\n    <PackageVersion Include=\"Uno.Extensions.Markup.Generators\" Version=\"6.4.11\" />\n    <PackageVersion Include=\"Uno.WinUI.Markup\" Version=\"6.4.11\" />\n    <PackageVersion Include=\"Uno.WinUI\" Version=\"$(UnoVersion)\" />\n    <PackageVersion Include=\"Uno.WinUI.Lottie\" Version=\"$(UnoVersion)\" />\n    <PackageVersion Include=\"Uno.WinUI.Skia.Gtk\" Version=\"$(UnoVersion)\" />\n    <PackageVersion Include=\"Uno.WinUI.Skia.Linux.FrameBuffer\" Version=\"$(UnoVersion)\" />\n    <PackageVersion Include=\"Uno.WinUI.Skia.Wpf\" Version=\"$(UnoVersion)\" />\n    <PackageVersion Include=\"Uno.Wasm.Bootstrap\" Version=\"9.0.20\" />\n    <PackageVersion Include=\"Uno.Wasm.Bootstrap.DevServer\" Version=\"9.0.20\" />\n    <PackageVersion Include=\"Uno.WinUI.WebAssembly\" Version=\"$(UnoVersion)\" />\n    <PackageVersion Include=\"Uno.WinUI.DevServer\" Version=\"$(UnoVersion)\" />\n    <PackageVersion Include=\"Uno.UI.Adapter.Microsoft.Extensions.Logging\" Version=\"$(UnoVersion)\" />\n    <PackageVersion Include=\"Uno.Core.Extensions.Logging.Singleton\" Version=\"4.1.1\" />\n    <PackageVersion Include=\"Uno.Microsoft.Xaml.Behaviors.WinUI.Managed\" Version=\"2.4.2\" />\n    <PackageVersion Include=\"Microsoft.Xaml.Behaviors.WinUI.Managed\" Version=\"2.0.9\" />\n    <PackageVersion Include=\"Microsoft.WindowsAppSDK\" Version=\"1.2.221109.1\" Condition=\"$(MSBuildProjectName.Contains('Prism'))\" />\n    <PackageVersion Include=\"Microsoft.WindowsAppSDK\" Version=\"1.7.250909003\" Condition=\"!$(MSBuildProjectName.Contains('Prism'))\" />\n    <PackageVersion Include=\"Microsoft.Windows.SDK.BuildTools\" Version=\"10.0.26100.6901\" />\n    <PackageVersion Include=\"SkiaSharp.Views.Uno.WinUI\" Version=\"3.119.1\" />\n    <PackageVersion Include=\"SkiaSharp.Skottie\" Version=\"3.119.1\" />\n    <PackageVersion Include=\"Uno.Resizetizer\" Version=\"1.12.1\" />\n    <PackageVersion Include=\"Uno.Extensions.Logging.OSLog\" Version=\"1.7.0\" />\n    <PackageVersion Include=\"Uno.Extensions.Logging.WinUI\" Version=\"7.0.4\" />\n    <PackageVersion Include=\"Uno.Extensions.Logging.Serilog\" Version=\"7.0.4\" />\n    <PackageVersion Include=\"Uno.Extensions.Logging.WebAssembly.Console\" Version=\"1.7.0\" />\n    <PackageVersion Include=\"Uno.Material.WinUI\" Version=\"6.0.2\" />\n    <PackageVersion Include=\"Uno.Toolkit.WinUI.Material\" Version=\"8.3.2\" />\n    <PackageVersion Include=\"Uno.Toolkit.WinUI\" Version=\"8.3.2\" />\n    <PackageVersion Include=\"Uno.Extensions.Hosting.WinUI\" Version=\"7.0.4\" />\n    <PackageVersion Include=\"Microsoft.Extensions.Logging.Console\" Version=\"8.0.0\" />\n    <PackageVersion Include=\"Xamarin.Google.Android.Material\" Version=\"1.12.0.4\" />\n    <PackageVersion Include=\"Xamarin.Google.Android.Material\" Version=\"1.12.0.5\" Condition=\"$(TargetFramework.StartsWith('net10.0'))\" />\n    <PackageVersion Include=\"Uno.UniversalImageLoader\" Version=\"1.9.37\" />\n    <PackageVersion Include=\"Microsoft.Windows.Compatibility\" Version=\"8.0.0\" />\n  </ItemGroup>\n  <!-- Avalonia -->\n  <ItemGroup Condition=\" $(IsAvaloniaProject) == 'true' \">\n    <PackageVersion Include=\"Avalonia\" Version=\"11.3.8\" />\n    <PackageVersion Include=\"Avalonia.Desktop\" Version=\"11.3.8\" />\n    <PackageVersion Include=\"Avalonia.Diagnostics\" Version=\"11.3.8\" />\n    <PackageVersion Include=\"Avalonia.LinuxFramebuffer\" Version=\"11.3.8\" />\n    <PackageVersion Include=\"Avalonia.Markup.Xaml.Loader\" Version=\"11.3.8\" />\n    <PackageVersion Include=\"Avalonia.Themes.Simple\" Version=\"11.3.8\" />\n    <PackageVersion Include=\"Avalonia.Themes.Fluent\" Version=\"11.3.8\" />\n    <PackageVersion Include=\"Avalonia.Fonts.Inter\" Version=\"11.3.8\" />\n    <PackageVersion Include=\"System.Configuration.ConfigurationManager\" Version=\"10.0.0\" />\n    <PackageVersion Include=\"System.CodeDom\" Version=\"8.0.0\" />\n  </ItemGroup>\n    <!-- Tests -->\n  <ItemGroup>\n    <PackageVersion Include=\"coverlet.collector\" Version=\"6.0.2\" />\n    <PackageVersion Include=\"GitHubActionsTestLogger\" Version=\"2.4.1\" />\n    <PackageVersion Include=\"Xamarin.Forms.Mocks\" Version=\"4.7.0.1\" />\n    <PackageVersion Include=\"Humanizer.Core\" Version=\"2.14.1\" />\n    <PackageVersion Include=\"Newtonsoft.Json\" Version=\"13.0.1\" />\n    <PackageVersion Include=\"Microsoft.NET.Test.Sdk\" Version=\"17.10.0\" />\n    <PackageVersion Include=\"Moq\" Version=\"4.20.70\" />\n    <PackageVersion Include=\"xunit\" Version=\"2.9.0\" />\n    <PackageVersion Include=\"xunit.runner.visualstudio\" Version=\"2.8.2\" />\n    <PackageVersion Include=\"Xunit.StaFact\" Version=\"1.1.11\" />\n  </ItemGroup>\n  <ItemGroup Condition=\" $(UseMaui) != 'true' \">\n    <PackageVersion Include=\"Microsoft.Extensions.DependencyInjection\" Version=\"7.0.0\" />\n    <PackageVersion Include=\"Microsoft.Extensions.Logging\" Version=\"7.0.0\" />\n  </ItemGroup>\n  <!-- UI Tests -->\n  <ItemGroup>\n    <PackageVersion Include=\"Uno.UITest.Helpers\" Version=\"1.0.0\" />\n    <PackageVersion Include=\"Xamarin.TestCloud.Agent\" Version=\"0.22.2\" />\n    <PackageVersion Include=\"NUnit\" Version=\"3.13.2\" />\n    <PackageVersion Include=\"NUnit3TestAdapter\" Version=\"3.17.0\" />\n    <PackageVersion Include=\"Xamarin.UITest\" Version=\"3.0.12\" />\n  </ItemGroup>\n  <ItemGroup>\n    <!-- Global Packages -->\n    <PackageVersion Include=\"Microsoft.NETFramework.ReferenceAssemblies\" Version=\"1.0.3\" />\n    <PackageVersion Include=\"Nerdbank.GitVersioning\" Version=\"3.9.50\" />\n    <PackageVersion Include=\"Microsoft.SourceLink.GitHub\" Version=\"8.0.0\" />\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": "LICENSE",
    "content": "Prism can be licensed either under the Prism Community License or the Prism Commercial license.\n\nTo be qualified for the Prism Community License you must have an annual gross revenue of less than one (1) million U.S. dollars ($1,000,000.00 USD) per year or have never received more than $3 million USD in capital from an outside source, such as private equity or venture capital, and agree to be bound by Prism's terms and conditions.\n\nCustomers who do not qualify for the community license can visit the Prism Library website (https://prismlibrary.com/) for commercial licensing options.\n\nUnder no circumstances can you use this product without (1) either a Community License or a Commercial License and (2) without agreeing and abiding by Prism's license containing all terms and conditions. \n\nThe Prism license that contains the terms and conditions can be found at\nhttps://cdn.prismlibrary.com/downloads/prism_license.pdf"
  },
  {
    "path": "PrismLibrary.sln",
    "content": "Microsoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio Version 17\nVisualStudioVersion = 17.4.33213.308\nMinimumVisualStudioVersion = 15.0.26124.0\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"src\", \"src\", \"{F3664D7A-6FF5-4D1F-9F5F-26EE87F032D3}\"\n\tProjectSection(SolutionItems) = preProject\n\t\tsrc\\Directory.Build.props = src\\Directory.Build.props\n\t\tsrc\\Directory.Build.targets = src\\Directory.Build.targets\n\tEndProjectSection\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Prism.Core\", \"src\\Prism.Core\\Prism.Core.csproj\", \"{F634CA1E-9237-4E69-B23C-91AA6FBCABFF}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"tests\", \"tests\", \"{00FFDC13-7397-46F1-897E-A62A7575D28A}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Prism.Core.Tests\", \"tests\\Prism.Core.Tests\\Prism.Core.Tests.csproj\", \"{8D85E3BC-6DD8-4F71-93DA-ABE51252CA2A}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"Wpf\", \"Wpf\", \"{C2BA93F6-D2E1-455F-B9FA-6221D087295E}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Prism.Wpf\", \"src\\Wpf\\Prism.Wpf\\Prism.Wpf.csproj\", \"{CE80554B-E37B-4B52-AA80-1F96DA1AC3EF}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Prism.DryIoc.Wpf\", \"src\\Wpf\\Prism.DryIoc.Wpf\\Prism.DryIoc.Wpf.csproj\", \"{0C8AAB85-387C-41D2-ABCE-BAFAF74B62B2}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Prism.Unity.Wpf\", \"src\\Wpf\\Prism.Unity.Wpf\\Prism.Unity.Wpf.csproj\", \"{E9A2458B-999D-4D36-822F-663D3830575A}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"Wpf\", \"Wpf\", \"{F1F91777-01EA-43A3-A3ED-D473B382F46C}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Prism.Wpf.Tests\", \"tests\\Wpf\\Prism.Wpf.Tests\\Prism.Wpf.Tests.csproj\", \"{C4D210AF-C91E-4310-ADE5-881A7DFE8AAA}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Prism.DryIoc.Wpf.Tests\", \"tests\\Wpf\\Prism.DryIoc.Wpf.Tests\\Prism.DryIoc.Wpf.Tests.csproj\", \"{BA05687E-2317-4A65-805B-C596F52F7203}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Prism.Unity.Wpf.Tests\", \"tests\\Wpf\\Prism.Unity.Wpf.Tests\\Prism.Unity.Wpf.Tests.csproj\", \"{367BE810-5B34-4894-BE47-1C8DCC67DE81}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Prism.IocContainer.Wpf.Tests.Support\", \"tests\\Wpf\\Prism.IocContainer.Wpf.Tests.Support\\Prism.IocContainer.Wpf.Tests.Support.csproj\", \"{2E8F565D-9D13-424E-BD86-C5A362F9AAE7}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"Solution Items\", \"Solution Items\", \"{10DFE0CA-4F29-4859-B60F-94073D43FB51}\"\n\tProjectSection(SolutionItems) = preProject\n\t\t.editorconfig = .editorconfig\n\t\t.gitignore = .gitignore\n\t\tCodeCoverage.runsettings = CodeCoverage.runsettings\n\t\tDirectory.Build.props = Directory.Build.props\n\t\tDirectory.build.targets = Directory.build.targets\n\t\tDirectory.Packages.props = Directory.Packages.props\n\t\tglobal.json = global.json\n\t\txunit.runner.json = xunit.runner.json\n\tEndProjectSection\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"Uno\", \"Uno\", \"{8F959801-D494-4CAF-9437-90F30472E169}\"\nEndProject\nProject(\"{D954291E-2A0B-460D-934E-DC6B0785DB48}\") = \"Prism.Container.Wpf.Shared\", \"tests\\Wpf\\Prism.Container.Wpf.Shared\\Prism.Container.Wpf.Shared.shproj\", \"{BD42A7D6-A84D-4D27-9C28-7F6A2EC477F1}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Prism.Uno.WinUI\", \"src\\Uno\\Prism.Uno\\Prism.Uno.WinUI.csproj\", \"{E74664C1-1BB1-4920-8099-2C9125CFD00B}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Prism.DryIoc.Uno.WinUI\", \"src\\Uno\\Prism.DryIoc.Uno\\Prism.DryIoc.Uno.WinUI.csproj\", \"{DB530D15-0556-4B6F-96B2-1497C8DF08D6}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"Maui\", \"Maui\", \"{24639CEB-266D-40E1-B0A8-B78BB6F8CEF8}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Prism.Maui\", \"src\\Maui\\Prism.Maui\\Prism.Maui.csproj\", \"{BC84ABD6-A230-4367-8E6A-85B6BA1D851A}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Prism.Maui.Rx\", \"src\\Maui\\Prism.Maui.Rx\\Prism.Maui.Rx.csproj\", \"{D7B41D0E-CBE4-4846-992F-C955CE45DC08}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Prism.DryIoc.Maui\", \"src\\Maui\\Prism.DryIoc.Maui\\Prism.DryIoc.Maui.csproj\", \"{60D92138-66AC-4DC9-973D-FDD917F87112}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"Maui\", \"Maui\", \"{540CEEC1-D541-4614-BF0B-18056A83E434}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Prism.Maui.Tests\", \"tests\\Maui\\Prism.Maui.Tests\\Prism.Maui.Tests.csproj\", \"{7A1E157F-D4CD-4E6B-9CE3-1894EB2A15A7}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Prism.DryIoc.Maui.Tests\", \"tests\\Maui\\Prism.DryIoc.Maui.Tests\\Prism.DryIoc.Maui.Tests.csproj\", \"{8711D306-1118-4A11-9399-EF14AA13015E}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Prism.Events\", \"src\\Prism.Events\\Prism.Events.csproj\", \"{8610485A-BE9F-4938-86D4-E9F1FA1739A0}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Prism.Uno.WinUI.Markup\", \"src\\Uno\\Prism.Uno.Markup\\Prism.Uno.WinUI.Markup.csproj\", \"{0EA416B6-0AB6-464B-9F4D-206FFCFB262D}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"Avalonia\", \"Avalonia\", \"{8AE1015F-4D62-47EF-A576-2F7411EC20D5}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Prism.Avalonia\", \"src\\Avalonia\\Prism.Avalonia\\Prism.Avalonia.csproj\", \"{C505C63F-99E6-464F-8C83-1AE4239C19B1}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Prism.DryIoc.Avalonia\", \"src\\Avalonia\\Prism.DryIoc.Avalonia\\Prism.DryIoc.Avalonia.csproj\", \"{A6B7B19C-3288-4CD2-A737-527BEB1ED807}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Prism.Avalonia.Tests\", \"tests\\Avalonia\\Prism.Avalonia.Tests\\Prism.Avalonia.Tests.csproj\", \"{AB501F63-8E8C-4333-8A15-81BA02F3C703}\"\nEndProject\nProject(\"{D954291E-2A0B-460D-934E-DC6B0785DB48}\") = \"Prism.Container.Avalonia.Shared\", \"tests\\Avalonia\\Prism.Container.Avalonia.Shared\\Prism.Container.Avalonia.Shared.shproj\", \"{6FDA7D49-DF44-4E8F-A182-0EB73DD3C452}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Prism.DryIoc.Avalonia.Tests\", \"tests\\Avalonia\\Prism.DryIoc.Avalonia.Tests\\Prism.DryIoc.Avalonia.Tests.csproj\", \"{03B9C775-9582-409F-B67F-6B8A0CE0C7AF}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Prism.IocContainer.Avalonia.Tests.Support\", \"tests\\Avalonia\\Prism.IocContainer.Avalonia.Tests.Support\\Prism.IocContainer.Avalonia.Tests.Support.csproj\", \"{887E0794-798D-4127-847E-6F68D5C9B334}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"Avalonia\", \"Avalonia\", \"{904D5094-55F9-4581-90AC-D6C1131F8152}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Any CPU = Debug|Any CPU\n\t\tDebug|x64 = Debug|x64\n\t\tDebug|x86 = Debug|x86\n\t\tRelease|Any CPU = Release|Any CPU\n\t\tRelease|x64 = Release|x64\n\t\tRelease|x86 = Release|x86\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{F634CA1E-9237-4E69-B23C-91AA6FBCABFF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{F634CA1E-9237-4E69-B23C-91AA6FBCABFF}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{F634CA1E-9237-4E69-B23C-91AA6FBCABFF}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{F634CA1E-9237-4E69-B23C-91AA6FBCABFF}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{F634CA1E-9237-4E69-B23C-91AA6FBCABFF}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{F634CA1E-9237-4E69-B23C-91AA6FBCABFF}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{F634CA1E-9237-4E69-B23C-91AA6FBCABFF}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{F634CA1E-9237-4E69-B23C-91AA6FBCABFF}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{F634CA1E-9237-4E69-B23C-91AA6FBCABFF}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{F634CA1E-9237-4E69-B23C-91AA6FBCABFF}.Release|x64.Build.0 = Release|Any CPU\n\t\t{F634CA1E-9237-4E69-B23C-91AA6FBCABFF}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{F634CA1E-9237-4E69-B23C-91AA6FBCABFF}.Release|x86.Build.0 = Release|Any CPU\n\t\t{8D85E3BC-6DD8-4F71-93DA-ABE51252CA2A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{8D85E3BC-6DD8-4F71-93DA-ABE51252CA2A}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{8D85E3BC-6DD8-4F71-93DA-ABE51252CA2A}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{8D85E3BC-6DD8-4F71-93DA-ABE51252CA2A}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{8D85E3BC-6DD8-4F71-93DA-ABE51252CA2A}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{8D85E3BC-6DD8-4F71-93DA-ABE51252CA2A}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{8D85E3BC-6DD8-4F71-93DA-ABE51252CA2A}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{8D85E3BC-6DD8-4F71-93DA-ABE51252CA2A}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{8D85E3BC-6DD8-4F71-93DA-ABE51252CA2A}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{8D85E3BC-6DD8-4F71-93DA-ABE51252CA2A}.Release|x64.Build.0 = Release|Any CPU\n\t\t{8D85E3BC-6DD8-4F71-93DA-ABE51252CA2A}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{8D85E3BC-6DD8-4F71-93DA-ABE51252CA2A}.Release|x86.Build.0 = Release|Any CPU\n\t\t{CE80554B-E37B-4B52-AA80-1F96DA1AC3EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{CE80554B-E37B-4B52-AA80-1F96DA1AC3EF}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{CE80554B-E37B-4B52-AA80-1F96DA1AC3EF}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{CE80554B-E37B-4B52-AA80-1F96DA1AC3EF}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{CE80554B-E37B-4B52-AA80-1F96DA1AC3EF}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{CE80554B-E37B-4B52-AA80-1F96DA1AC3EF}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{CE80554B-E37B-4B52-AA80-1F96DA1AC3EF}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{CE80554B-E37B-4B52-AA80-1F96DA1AC3EF}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{CE80554B-E37B-4B52-AA80-1F96DA1AC3EF}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{CE80554B-E37B-4B52-AA80-1F96DA1AC3EF}.Release|x64.Build.0 = Release|Any CPU\n\t\t{CE80554B-E37B-4B52-AA80-1F96DA1AC3EF}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{CE80554B-E37B-4B52-AA80-1F96DA1AC3EF}.Release|x86.Build.0 = Release|Any CPU\n\t\t{0C8AAB85-387C-41D2-ABCE-BAFAF74B62B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{0C8AAB85-387C-41D2-ABCE-BAFAF74B62B2}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{0C8AAB85-387C-41D2-ABCE-BAFAF74B62B2}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{0C8AAB85-387C-41D2-ABCE-BAFAF74B62B2}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{0C8AAB85-387C-41D2-ABCE-BAFAF74B62B2}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{0C8AAB85-387C-41D2-ABCE-BAFAF74B62B2}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{0C8AAB85-387C-41D2-ABCE-BAFAF74B62B2}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{0C8AAB85-387C-41D2-ABCE-BAFAF74B62B2}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{0C8AAB85-387C-41D2-ABCE-BAFAF74B62B2}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{0C8AAB85-387C-41D2-ABCE-BAFAF74B62B2}.Release|x64.Build.0 = Release|Any CPU\n\t\t{0C8AAB85-387C-41D2-ABCE-BAFAF74B62B2}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{0C8AAB85-387C-41D2-ABCE-BAFAF74B62B2}.Release|x86.Build.0 = Release|Any CPU\n\t\t{E9A2458B-999D-4D36-822F-663D3830575A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{E9A2458B-999D-4D36-822F-663D3830575A}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{E9A2458B-999D-4D36-822F-663D3830575A}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{E9A2458B-999D-4D36-822F-663D3830575A}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{E9A2458B-999D-4D36-822F-663D3830575A}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{E9A2458B-999D-4D36-822F-663D3830575A}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{E9A2458B-999D-4D36-822F-663D3830575A}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{E9A2458B-999D-4D36-822F-663D3830575A}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{E9A2458B-999D-4D36-822F-663D3830575A}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{E9A2458B-999D-4D36-822F-663D3830575A}.Release|x64.Build.0 = Release|Any CPU\n\t\t{E9A2458B-999D-4D36-822F-663D3830575A}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{E9A2458B-999D-4D36-822F-663D3830575A}.Release|x86.Build.0 = Release|Any CPU\n\t\t{C4D210AF-C91E-4310-ADE5-881A7DFE8AAA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{C4D210AF-C91E-4310-ADE5-881A7DFE8AAA}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{C4D210AF-C91E-4310-ADE5-881A7DFE8AAA}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{C4D210AF-C91E-4310-ADE5-881A7DFE8AAA}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{C4D210AF-C91E-4310-ADE5-881A7DFE8AAA}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{C4D210AF-C91E-4310-ADE5-881A7DFE8AAA}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{C4D210AF-C91E-4310-ADE5-881A7DFE8AAA}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{C4D210AF-C91E-4310-ADE5-881A7DFE8AAA}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{C4D210AF-C91E-4310-ADE5-881A7DFE8AAA}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{C4D210AF-C91E-4310-ADE5-881A7DFE8AAA}.Release|x64.Build.0 = Release|Any CPU\n\t\t{C4D210AF-C91E-4310-ADE5-881A7DFE8AAA}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{C4D210AF-C91E-4310-ADE5-881A7DFE8AAA}.Release|x86.Build.0 = Release|Any CPU\n\t\t{BA05687E-2317-4A65-805B-C596F52F7203}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{BA05687E-2317-4A65-805B-C596F52F7203}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{BA05687E-2317-4A65-805B-C596F52F7203}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{BA05687E-2317-4A65-805B-C596F52F7203}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{BA05687E-2317-4A65-805B-C596F52F7203}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{BA05687E-2317-4A65-805B-C596F52F7203}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{BA05687E-2317-4A65-805B-C596F52F7203}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{BA05687E-2317-4A65-805B-C596F52F7203}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{BA05687E-2317-4A65-805B-C596F52F7203}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{BA05687E-2317-4A65-805B-C596F52F7203}.Release|x64.Build.0 = Release|Any CPU\n\t\t{BA05687E-2317-4A65-805B-C596F52F7203}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{BA05687E-2317-4A65-805B-C596F52F7203}.Release|x86.Build.0 = Release|Any CPU\n\t\t{367BE810-5B34-4894-BE47-1C8DCC67DE81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{367BE810-5B34-4894-BE47-1C8DCC67DE81}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{367BE810-5B34-4894-BE47-1C8DCC67DE81}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{367BE810-5B34-4894-BE47-1C8DCC67DE81}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{367BE810-5B34-4894-BE47-1C8DCC67DE81}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{367BE810-5B34-4894-BE47-1C8DCC67DE81}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{367BE810-5B34-4894-BE47-1C8DCC67DE81}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{367BE810-5B34-4894-BE47-1C8DCC67DE81}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{367BE810-5B34-4894-BE47-1C8DCC67DE81}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{367BE810-5B34-4894-BE47-1C8DCC67DE81}.Release|x64.Build.0 = Release|Any CPU\n\t\t{367BE810-5B34-4894-BE47-1C8DCC67DE81}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{367BE810-5B34-4894-BE47-1C8DCC67DE81}.Release|x86.Build.0 = Release|Any CPU\n\t\t{2E8F565D-9D13-424E-BD86-C5A362F9AAE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{2E8F565D-9D13-424E-BD86-C5A362F9AAE7}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{2E8F565D-9D13-424E-BD86-C5A362F9AAE7}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{2E8F565D-9D13-424E-BD86-C5A362F9AAE7}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{2E8F565D-9D13-424E-BD86-C5A362F9AAE7}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{2E8F565D-9D13-424E-BD86-C5A362F9AAE7}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{2E8F565D-9D13-424E-BD86-C5A362F9AAE7}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{2E8F565D-9D13-424E-BD86-C5A362F9AAE7}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{2E8F565D-9D13-424E-BD86-C5A362F9AAE7}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{2E8F565D-9D13-424E-BD86-C5A362F9AAE7}.Release|x64.Build.0 = Release|Any CPU\n\t\t{2E8F565D-9D13-424E-BD86-C5A362F9AAE7}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{2E8F565D-9D13-424E-BD86-C5A362F9AAE7}.Release|x86.Build.0 = Release|Any CPU\n\t\t{E74664C1-1BB1-4920-8099-2C9125CFD00B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{E74664C1-1BB1-4920-8099-2C9125CFD00B}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{E74664C1-1BB1-4920-8099-2C9125CFD00B}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{E74664C1-1BB1-4920-8099-2C9125CFD00B}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{E74664C1-1BB1-4920-8099-2C9125CFD00B}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{E74664C1-1BB1-4920-8099-2C9125CFD00B}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{E74664C1-1BB1-4920-8099-2C9125CFD00B}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{E74664C1-1BB1-4920-8099-2C9125CFD00B}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{E74664C1-1BB1-4920-8099-2C9125CFD00B}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{E74664C1-1BB1-4920-8099-2C9125CFD00B}.Release|x64.Build.0 = Release|Any CPU\n\t\t{E74664C1-1BB1-4920-8099-2C9125CFD00B}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{E74664C1-1BB1-4920-8099-2C9125CFD00B}.Release|x86.Build.0 = Release|Any CPU\n\t\t{DB530D15-0556-4B6F-96B2-1497C8DF08D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{DB530D15-0556-4B6F-96B2-1497C8DF08D6}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{DB530D15-0556-4B6F-96B2-1497C8DF08D6}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{DB530D15-0556-4B6F-96B2-1497C8DF08D6}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{DB530D15-0556-4B6F-96B2-1497C8DF08D6}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{DB530D15-0556-4B6F-96B2-1497C8DF08D6}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{DB530D15-0556-4B6F-96B2-1497C8DF08D6}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{DB530D15-0556-4B6F-96B2-1497C8DF08D6}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{DB530D15-0556-4B6F-96B2-1497C8DF08D6}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{DB530D15-0556-4B6F-96B2-1497C8DF08D6}.Release|x64.Build.0 = Release|Any CPU\n\t\t{DB530D15-0556-4B6F-96B2-1497C8DF08D6}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{DB530D15-0556-4B6F-96B2-1497C8DF08D6}.Release|x86.Build.0 = Release|Any CPU\n\t\t{BC84ABD6-A230-4367-8E6A-85B6BA1D851A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{BC84ABD6-A230-4367-8E6A-85B6BA1D851A}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{BC84ABD6-A230-4367-8E6A-85B6BA1D851A}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{BC84ABD6-A230-4367-8E6A-85B6BA1D851A}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{BC84ABD6-A230-4367-8E6A-85B6BA1D851A}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{BC84ABD6-A230-4367-8E6A-85B6BA1D851A}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{BC84ABD6-A230-4367-8E6A-85B6BA1D851A}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{BC84ABD6-A230-4367-8E6A-85B6BA1D851A}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{BC84ABD6-A230-4367-8E6A-85B6BA1D851A}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{BC84ABD6-A230-4367-8E6A-85B6BA1D851A}.Release|x64.Build.0 = Release|Any CPU\n\t\t{BC84ABD6-A230-4367-8E6A-85B6BA1D851A}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{BC84ABD6-A230-4367-8E6A-85B6BA1D851A}.Release|x86.Build.0 = Release|Any CPU\n\t\t{D7B41D0E-CBE4-4846-992F-C955CE45DC08}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{D7B41D0E-CBE4-4846-992F-C955CE45DC08}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{D7B41D0E-CBE4-4846-992F-C955CE45DC08}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{D7B41D0E-CBE4-4846-992F-C955CE45DC08}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{D7B41D0E-CBE4-4846-992F-C955CE45DC08}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{D7B41D0E-CBE4-4846-992F-C955CE45DC08}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{D7B41D0E-CBE4-4846-992F-C955CE45DC08}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{D7B41D0E-CBE4-4846-992F-C955CE45DC08}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{D7B41D0E-CBE4-4846-992F-C955CE45DC08}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{D7B41D0E-CBE4-4846-992F-C955CE45DC08}.Release|x64.Build.0 = Release|Any CPU\n\t\t{D7B41D0E-CBE4-4846-992F-C955CE45DC08}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{D7B41D0E-CBE4-4846-992F-C955CE45DC08}.Release|x86.Build.0 = Release|Any CPU\n\t\t{60D92138-66AC-4DC9-973D-FDD917F87112}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{60D92138-66AC-4DC9-973D-FDD917F87112}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{60D92138-66AC-4DC9-973D-FDD917F87112}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{60D92138-66AC-4DC9-973D-FDD917F87112}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{60D92138-66AC-4DC9-973D-FDD917F87112}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{60D92138-66AC-4DC9-973D-FDD917F87112}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{60D92138-66AC-4DC9-973D-FDD917F87112}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{60D92138-66AC-4DC9-973D-FDD917F87112}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{60D92138-66AC-4DC9-973D-FDD917F87112}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{60D92138-66AC-4DC9-973D-FDD917F87112}.Release|x64.Build.0 = Release|Any CPU\n\t\t{60D92138-66AC-4DC9-973D-FDD917F87112}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{60D92138-66AC-4DC9-973D-FDD917F87112}.Release|x86.Build.0 = Release|Any CPU\n\t\t{7A1E157F-D4CD-4E6B-9CE3-1894EB2A15A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{7A1E157F-D4CD-4E6B-9CE3-1894EB2A15A7}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{7A1E157F-D4CD-4E6B-9CE3-1894EB2A15A7}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{7A1E157F-D4CD-4E6B-9CE3-1894EB2A15A7}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{7A1E157F-D4CD-4E6B-9CE3-1894EB2A15A7}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{7A1E157F-D4CD-4E6B-9CE3-1894EB2A15A7}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{7A1E157F-D4CD-4E6B-9CE3-1894EB2A15A7}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{7A1E157F-D4CD-4E6B-9CE3-1894EB2A15A7}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{7A1E157F-D4CD-4E6B-9CE3-1894EB2A15A7}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{7A1E157F-D4CD-4E6B-9CE3-1894EB2A15A7}.Release|x64.Build.0 = Release|Any CPU\n\t\t{7A1E157F-D4CD-4E6B-9CE3-1894EB2A15A7}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{7A1E157F-D4CD-4E6B-9CE3-1894EB2A15A7}.Release|x86.Build.0 = Release|Any CPU\n\t\t{8711D306-1118-4A11-9399-EF14AA13015E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{8711D306-1118-4A11-9399-EF14AA13015E}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{8711D306-1118-4A11-9399-EF14AA13015E}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{8711D306-1118-4A11-9399-EF14AA13015E}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{8711D306-1118-4A11-9399-EF14AA13015E}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{8711D306-1118-4A11-9399-EF14AA13015E}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{8711D306-1118-4A11-9399-EF14AA13015E}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{8711D306-1118-4A11-9399-EF14AA13015E}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{8711D306-1118-4A11-9399-EF14AA13015E}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{8711D306-1118-4A11-9399-EF14AA13015E}.Release|x64.Build.0 = Release|Any CPU\n\t\t{8711D306-1118-4A11-9399-EF14AA13015E}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{8711D306-1118-4A11-9399-EF14AA13015E}.Release|x86.Build.0 = Release|Any CPU\n\t\t{8610485A-BE9F-4938-86D4-E9F1FA1739A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{8610485A-BE9F-4938-86D4-E9F1FA1739A0}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{8610485A-BE9F-4938-86D4-E9F1FA1739A0}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{8610485A-BE9F-4938-86D4-E9F1FA1739A0}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{8610485A-BE9F-4938-86D4-E9F1FA1739A0}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{8610485A-BE9F-4938-86D4-E9F1FA1739A0}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{8610485A-BE9F-4938-86D4-E9F1FA1739A0}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{8610485A-BE9F-4938-86D4-E9F1FA1739A0}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{8610485A-BE9F-4938-86D4-E9F1FA1739A0}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{8610485A-BE9F-4938-86D4-E9F1FA1739A0}.Release|x64.Build.0 = Release|Any CPU\n\t\t{8610485A-BE9F-4938-86D4-E9F1FA1739A0}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{8610485A-BE9F-4938-86D4-E9F1FA1739A0}.Release|x86.Build.0 = Release|Any CPU\n\t\t{0EA416B6-0AB6-464B-9F4D-206FFCFB262D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{0EA416B6-0AB6-464B-9F4D-206FFCFB262D}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{0EA416B6-0AB6-464B-9F4D-206FFCFB262D}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{0EA416B6-0AB6-464B-9F4D-206FFCFB262D}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{0EA416B6-0AB6-464B-9F4D-206FFCFB262D}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{0EA416B6-0AB6-464B-9F4D-206FFCFB262D}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{0EA416B6-0AB6-464B-9F4D-206FFCFB262D}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{0EA416B6-0AB6-464B-9F4D-206FFCFB262D}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{0EA416B6-0AB6-464B-9F4D-206FFCFB262D}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{0EA416B6-0AB6-464B-9F4D-206FFCFB262D}.Release|x64.Build.0 = Release|Any CPU\n\t\t{0EA416B6-0AB6-464B-9F4D-206FFCFB262D}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{0EA416B6-0AB6-464B-9F4D-206FFCFB262D}.Release|x86.Build.0 = Release|Any CPU\n\t\t{C505C63F-99E6-464F-8C83-1AE4239C19B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{C505C63F-99E6-464F-8C83-1AE4239C19B1}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{C505C63F-99E6-464F-8C83-1AE4239C19B1}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{C505C63F-99E6-464F-8C83-1AE4239C19B1}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{C505C63F-99E6-464F-8C83-1AE4239C19B1}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{C505C63F-99E6-464F-8C83-1AE4239C19B1}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{C505C63F-99E6-464F-8C83-1AE4239C19B1}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{C505C63F-99E6-464F-8C83-1AE4239C19B1}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{C505C63F-99E6-464F-8C83-1AE4239C19B1}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{C505C63F-99E6-464F-8C83-1AE4239C19B1}.Release|x64.Build.0 = Release|Any CPU\n\t\t{C505C63F-99E6-464F-8C83-1AE4239C19B1}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{C505C63F-99E6-464F-8C83-1AE4239C19B1}.Release|x86.Build.0 = Release|Any CPU\n\t\t{A6B7B19C-3288-4CD2-A737-527BEB1ED807}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{A6B7B19C-3288-4CD2-A737-527BEB1ED807}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{A6B7B19C-3288-4CD2-A737-527BEB1ED807}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{A6B7B19C-3288-4CD2-A737-527BEB1ED807}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{A6B7B19C-3288-4CD2-A737-527BEB1ED807}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{A6B7B19C-3288-4CD2-A737-527BEB1ED807}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{A6B7B19C-3288-4CD2-A737-527BEB1ED807}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{A6B7B19C-3288-4CD2-A737-527BEB1ED807}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{A6B7B19C-3288-4CD2-A737-527BEB1ED807}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{A6B7B19C-3288-4CD2-A737-527BEB1ED807}.Release|x64.Build.0 = Release|Any CPU\n\t\t{A6B7B19C-3288-4CD2-A737-527BEB1ED807}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{A6B7B19C-3288-4CD2-A737-527BEB1ED807}.Release|x86.Build.0 = Release|Any CPU\n\t\t{AB501F63-8E8C-4333-8A15-81BA02F3C703}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{AB501F63-8E8C-4333-8A15-81BA02F3C703}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{AB501F63-8E8C-4333-8A15-81BA02F3C703}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{AB501F63-8E8C-4333-8A15-81BA02F3C703}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{AB501F63-8E8C-4333-8A15-81BA02F3C703}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{AB501F63-8E8C-4333-8A15-81BA02F3C703}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{AB501F63-8E8C-4333-8A15-81BA02F3C703}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{AB501F63-8E8C-4333-8A15-81BA02F3C703}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{AB501F63-8E8C-4333-8A15-81BA02F3C703}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{AB501F63-8E8C-4333-8A15-81BA02F3C703}.Release|x64.Build.0 = Release|Any CPU\n\t\t{AB501F63-8E8C-4333-8A15-81BA02F3C703}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{AB501F63-8E8C-4333-8A15-81BA02F3C703}.Release|x86.Build.0 = Release|Any CPU\n\t\t{03B9C775-9582-409F-B67F-6B8A0CE0C7AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{03B9C775-9582-409F-B67F-6B8A0CE0C7AF}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{03B9C775-9582-409F-B67F-6B8A0CE0C7AF}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{03B9C775-9582-409F-B67F-6B8A0CE0C7AF}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{03B9C775-9582-409F-B67F-6B8A0CE0C7AF}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{03B9C775-9582-409F-B67F-6B8A0CE0C7AF}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{03B9C775-9582-409F-B67F-6B8A0CE0C7AF}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{03B9C775-9582-409F-B67F-6B8A0CE0C7AF}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{03B9C775-9582-409F-B67F-6B8A0CE0C7AF}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{03B9C775-9582-409F-B67F-6B8A0CE0C7AF}.Release|x64.Build.0 = Release|Any CPU\n\t\t{03B9C775-9582-409F-B67F-6B8A0CE0C7AF}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{03B9C775-9582-409F-B67F-6B8A0CE0C7AF}.Release|x86.Build.0 = Release|Any CPU\n\t\t{887E0794-798D-4127-847E-6F68D5C9B334}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{887E0794-798D-4127-847E-6F68D5C9B334}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{887E0794-798D-4127-847E-6F68D5C9B334}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{887E0794-798D-4127-847E-6F68D5C9B334}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{887E0794-798D-4127-847E-6F68D5C9B334}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{887E0794-798D-4127-847E-6F68D5C9B334}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{887E0794-798D-4127-847E-6F68D5C9B334}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{887E0794-798D-4127-847E-6F68D5C9B334}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{887E0794-798D-4127-847E-6F68D5C9B334}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{887E0794-798D-4127-847E-6F68D5C9B334}.Release|x64.Build.0 = Release|Any CPU\n\t\t{887E0794-798D-4127-847E-6F68D5C9B334}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{887E0794-798D-4127-847E-6F68D5C9B334}.Release|x86.Build.0 = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\n\tGlobalSection(NestedProjects) = preSolution\n\t\t{F634CA1E-9237-4E69-B23C-91AA6FBCABFF} = {F3664D7A-6FF5-4D1F-9F5F-26EE87F032D3}\n\t\t{8D85E3BC-6DD8-4F71-93DA-ABE51252CA2A} = {00FFDC13-7397-46F1-897E-A62A7575D28A}\n\t\t{C2BA93F6-D2E1-455F-B9FA-6221D087295E} = {F3664D7A-6FF5-4D1F-9F5F-26EE87F032D3}\n\t\t{CE80554B-E37B-4B52-AA80-1F96DA1AC3EF} = {C2BA93F6-D2E1-455F-B9FA-6221D087295E}\n\t\t{0C8AAB85-387C-41D2-ABCE-BAFAF74B62B2} = {C2BA93F6-D2E1-455F-B9FA-6221D087295E}\n\t\t{E9A2458B-999D-4D36-822F-663D3830575A} = {C2BA93F6-D2E1-455F-B9FA-6221D087295E}\n\t\t{F1F91777-01EA-43A3-A3ED-D473B382F46C} = {00FFDC13-7397-46F1-897E-A62A7575D28A}\n\t\t{C4D210AF-C91E-4310-ADE5-881A7DFE8AAA} = {F1F91777-01EA-43A3-A3ED-D473B382F46C}\n\t\t{BA05687E-2317-4A65-805B-C596F52F7203} = {F1F91777-01EA-43A3-A3ED-D473B382F46C}\n\t\t{367BE810-5B34-4894-BE47-1C8DCC67DE81} = {F1F91777-01EA-43A3-A3ED-D473B382F46C}\n\t\t{2E8F565D-9D13-424E-BD86-C5A362F9AAE7} = {F1F91777-01EA-43A3-A3ED-D473B382F46C}\n\t\t{8F959801-D494-4CAF-9437-90F30472E169} = {F3664D7A-6FF5-4D1F-9F5F-26EE87F032D3}\n\t\t{BD42A7D6-A84D-4D27-9C28-7F6A2EC477F1} = {F1F91777-01EA-43A3-A3ED-D473B382F46C}\n\t\t{E74664C1-1BB1-4920-8099-2C9125CFD00B} = {8F959801-D494-4CAF-9437-90F30472E169}\n\t\t{DB530D15-0556-4B6F-96B2-1497C8DF08D6} = {8F959801-D494-4CAF-9437-90F30472E169}\n\t\t{24639CEB-266D-40E1-B0A8-B78BB6F8CEF8} = {F3664D7A-6FF5-4D1F-9F5F-26EE87F032D3}\n\t\t{BC84ABD6-A230-4367-8E6A-85B6BA1D851A} = {24639CEB-266D-40E1-B0A8-B78BB6F8CEF8}\n\t\t{D7B41D0E-CBE4-4846-992F-C955CE45DC08} = {24639CEB-266D-40E1-B0A8-B78BB6F8CEF8}\n\t\t{60D92138-66AC-4DC9-973D-FDD917F87112} = {24639CEB-266D-40E1-B0A8-B78BB6F8CEF8}\n\t\t{540CEEC1-D541-4614-BF0B-18056A83E434} = {00FFDC13-7397-46F1-897E-A62A7575D28A}\n\t\t{7A1E157F-D4CD-4E6B-9CE3-1894EB2A15A7} = {540CEEC1-D541-4614-BF0B-18056A83E434}\n\t\t{8711D306-1118-4A11-9399-EF14AA13015E} = {540CEEC1-D541-4614-BF0B-18056A83E434}\n\t\t{8610485A-BE9F-4938-86D4-E9F1FA1739A0} = {F3664D7A-6FF5-4D1F-9F5F-26EE87F032D3}\n\t\t{0EA416B6-0AB6-464B-9F4D-206FFCFB262D} = {8F959801-D494-4CAF-9437-90F30472E169}\n\t\t{8AE1015F-4D62-47EF-A576-2F7411EC20D5} = {F3664D7A-6FF5-4D1F-9F5F-26EE87F032D3}\n\t\t{C505C63F-99E6-464F-8C83-1AE4239C19B1} = {8AE1015F-4D62-47EF-A576-2F7411EC20D5}\n\t\t{A6B7B19C-3288-4CD2-A737-527BEB1ED807} = {8AE1015F-4D62-47EF-A576-2F7411EC20D5}\n\t\t{AB501F63-8E8C-4333-8A15-81BA02F3C703} = {904D5094-55F9-4581-90AC-D6C1131F8152}\n\t\t{6FDA7D49-DF44-4E8F-A182-0EB73DD3C452} = {904D5094-55F9-4581-90AC-D6C1131F8152}\n\t\t{03B9C775-9582-409F-B67F-6B8A0CE0C7AF} = {904D5094-55F9-4581-90AC-D6C1131F8152}\n\t\t{887E0794-798D-4127-847E-6F68D5C9B334} = {904D5094-55F9-4581-90AC-D6C1131F8152}\n\t\t{904D5094-55F9-4581-90AC-D6C1131F8152} = {00FFDC13-7397-46F1-897E-A62A7575D28A}\n\tEndGlobalSection\n\tGlobalSection(ExtensibilityGlobals) = postSolution\n\t\tSolutionGuid = {C7433AE2-B1A0-4C1A-887E-5CAA7AAF67A6}\n\tEndGlobalSection\n\tGlobalSection(SharedMSBuildProjectFiles) = preSolution\n\t\ttests\\Avalonia\\Prism.Container.Avalonia.Shared\\Prism.Container.Avalonia.Shared.projitems*{03b9c775-9582-409f-b67f-6b8a0ce0c7af}*SharedItemsImports = 5\n\t\ttests\\Wpf\\Prism.Container.Wpf.Shared\\Prism.Container.Wpf.Shared.projitems*{367be810-5b34-4894-be47-1c8dcc67de81}*SharedItemsImports = 5\n\t\ttests\\Avalonia\\Prism.Container.Avalonia.Shared\\Prism.Container.Avalonia.Shared.projitems*{6fda7d49-df44-4e8f-a182-0eb73dd3c452}*SharedItemsImports = 13\n\t\ttests\\Wpf\\Prism.Container.Wpf.Shared\\Prism.Container.Wpf.Shared.projitems*{ba05687e-2317-4a65-805b-c596f52f7203}*SharedItemsImports = 5\n\t\ttests\\Wpf\\Prism.Container.Wpf.Shared\\Prism.Container.Wpf.Shared.projitems*{bd42a7d6-a84d-4d27-9c28-7f6a2ec477f1}*SharedItemsImports = 13\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "PrismLibrary_Avalonia.slnf",
    "content": "{\n  \"solution\": {\n    \"path\": \"PrismLibrary.sln\",\n    \"projects\": [\n      \"src\\\\Avalonia\\\\Prism.Avalonia\\\\Prism.Avalonia.csproj\",\n      \"src\\\\Avalonia\\\\Prism.DryIoc.Avalonia\\\\Prism.DryIoc.Avalonia.csproj\",\n      \"src\\\\Prism.Core\\\\Prism.Core.csproj\",\n      \"src\\\\Prism.Events\\\\Prism.Events.csproj\",\n      \"tests\\\\Avalonia\\\\Prism.Avalonia.Tests\\\\Prism.Avalonia.Tests.csproj\",\n      \"tests\\\\Avalonia\\\\Prism.Container.Avalonia.Shared\\\\Prism.Container.Avalonia.Shared.shproj\",\n      \"tests\\\\Avalonia\\\\Prism.DryIoc.Avalonia.Tests\\\\Prism.DryIoc.Avalonia.Tests.csproj\",\n      \"tests\\\\Avalonia\\\\Prism.IocContainer.Avalonia.Tests.Support\\\\Prism.IocContainer.Avalonia.Tests.Support.csproj\",\n      \"tests\\\\Prism.Core.Tests\\\\Prism.Core.Tests.csproj\"\n    ]\n  }\n}"
  },
  {
    "path": "PrismLibrary_Core.slnf",
    "content": "{\n  \"solution\": {\n    \"path\": \"PrismLibrary.sln\",\n    \"projects\": [\n      \"src\\\\Prism.Core\\\\Prism.Core.csproj\",\n      \"src\\\\Prism.Events\\\\Prism.Events.csproj\",\n      \"tests\\\\Prism.Core.Tests\\\\Prism.Core.Tests.csproj\"\n    ]\n  }\n}\n"
  },
  {
    "path": "PrismLibrary_Maui.slnf",
    "content": "{\n  \"solution\": {\n    \"path\": \"PrismLibrary.sln\",\n    \"projects\": [\n      \"src\\\\Maui\\\\Prism.DryIoc.Maui\\\\Prism.DryIoc.Maui.csproj\",\n      \"src\\\\Maui\\\\Prism.Maui.Rx\\\\Prism.Maui.Rx.csproj\",\n      \"src\\\\Maui\\\\Prism.Maui\\\\Prism.Maui.csproj\",\n      \"src\\\\Prism.Core\\\\Prism.Core.csproj\",\n      \"src\\\\Prism.Events\\\\Prism.Events.csproj\",\n      \"tests\\\\Maui\\\\Prism.DryIoc.Maui.Tests\\\\Prism.DryIoc.Maui.Tests.csproj\",\n      \"tests\\\\Maui\\\\Prism.Maui.Tests\\\\Prism.Maui.Tests.csproj\",\n      \"tests\\\\Prism.Core.Tests\\\\Prism.Core.Tests.csproj\"\n    ]\n  }\n}\n"
  },
  {
    "path": "PrismLibrary_Uno.slnf",
    "content": "{\n  \"solution\": {\n    \"path\": \"PrismLibrary.sln\",\n    \"projects\": [\n      \"src\\\\Prism.Core\\\\Prism.Core.csproj\",\n      \"src\\\\Prism.Events\\\\Prism.Events.csproj\",\n      \"src\\\\Uno\\\\Prism.DryIoc.Uno\\\\Prism.DryIoc.Uno.WinUI.csproj\",\n      \"src\\\\Uno\\\\Prism.Uno\\\\Prism.Uno.WinUI.csproj\",\n      \"src\\\\Uno\\\\Prism.Uno.Markup\\\\Prism.Uno.WinUI.Markup.csproj\",\n      \"tests\\\\Prism.Core.Tests\\\\Prism.Core.Tests.csproj\"\n    ]\n  }\n}\n"
  },
  {
    "path": "PrismLibrary_Wpf.slnf",
    "content": "{\n  \"solution\": {\n    \"path\": \"PrismLibrary.sln\",\n    \"projects\": [\n      \"src\\\\Prism.Core\\\\Prism.Core.csproj\",\n      \"src\\\\Prism.Events\\\\Prism.Events.csproj\",\n      \"src\\\\Wpf\\\\Prism.DryIoc.Wpf\\\\Prism.DryIoc.Wpf.csproj\",\n      \"src\\\\Wpf\\\\Prism.Unity.Wpf\\\\Prism.Unity.Wpf.csproj\",\n      \"src\\\\Wpf\\\\Prism.Wpf\\\\Prism.Wpf.csproj\",\n      \"tests\\\\Prism.Core.Tests\\\\Prism.Core.Tests.csproj\",\n      \"tests\\\\Wpf\\\\Prism.Container.Wpf.Shared\\\\Prism.Container.Wpf.Shared.shproj\",\n      \"tests\\\\Wpf\\\\Prism.DryIoc.Wpf.Tests\\\\Prism.DryIoc.Wpf.Tests.csproj\",\n      \"tests\\\\Wpf\\\\Prism.IocContainer.Wpf.Tests.Support\\\\Prism.IocContainer.Wpf.Tests.Support.csproj\",\n      \"tests\\\\Wpf\\\\Prism.Unity.Wpf.Tests\\\\Prism.Unity.Wpf.Tests.csproj\",\n      \"tests\\\\Wpf\\\\Prism.Wpf.Tests\\\\Prism.Wpf.Tests.csproj\"\n    ]\n  }\n}"
  },
  {
    "path": "README.md",
    "content": "# Prism\n\nPrism is a framework for building loosely coupled, maintainable, and testable XAML applications in WPF, Avalonia, MAUI, Uno Platform and WinUI. Separate releases are available for each platform and those will be developed on independent timelines. Prism provides an implementation of a collection of design patterns that are helpful in writing well-structured and maintainable XAML applications, including MVVM, dependency injection, commands, EventAggregator, and others. Prism's core functionality is a shared code base supported in .NET Standard 2.0, .NET Framework 4.6 / 4.7, and .NET6.0/.NET8.0. Those things that need to be platform specific are implemented in the respective libraries for the target platform. Prism also provides great integration of these patterns with the target platform.\n\n## Licensing\n\nThe Prism Team would first and foremost like to thank all of those developers who have stepped up over the past 4 years with GitHub Sponsors. We are committed to ensuring the longevity and success of the Prism Library. As a result Prism 9.0 is now [Dual License](LICENSE). We continue to offer a FREE Community License for the vast majority of our community, while the Commercial License will now be required by larger organizations to help fund and support the development of Prism. We additionally have the Commercial Plus License which grants access to a number of additional support libraries that build on top of Prism as well as a private Discord channel where you can ask questions and interact with the Prism Team.\n\n## Build Status\n\n|          | Status |\n| -------- | ------ |\n| Full Build | [![Prism CI](https://github.com/PrismLibrary/Prism/actions/workflows/ci.yml/badge.svg)](https://github.com/PrismLibrary/Prism/actions/workflows/ci.yml) |\n| Prism.Core | [![build_core](https://github.com/PrismLibrary/Prism/actions/workflows/build_core.yml/badge.svg)](https://github.com/PrismLibrary/Prism/actions/workflows/build_core.yml) |\n| Prism.Wpf | [![build_wpf](https://github.com/PrismLibrary/Prism/actions/workflows/build_wpf.yml/badge.svg)](https://github.com/PrismLibrary/Prism/actions/workflows/build_wpf.yml) |\n| Prism.Avalonia | [![build_avalonia](https://github.com/PrismLibrary/Prism/actions/workflows/build_avalonia.yml/badge.svg)](https://github.com/PrismLibrary/Prism/actions/workflows/build_avalonia.yml) |\n| Prism.Uno | [![build_uno](https://github.com/PrismLibrary/Prism/actions/workflows/build_uno.yml/badge.svg)](https://github.com/PrismLibrary/Prism/actions/workflows/build_uno.yml) |\n| Prism.Maui | [![build_maui](https://github.com/PrismLibrary/Prism/actions/workflows/build_maui.yml/badge.svg)](https://github.com/PrismLibrary/Prism/actions/workflows/build_maui.yml) |\n\n## Support\n\n- Documentation is maintained in [the Prism-Documentation repo](https://github.com/PrismLibrary/Prism-Documentation) under /docs and can be found in a readable format on [the website](https://docs.prismlibrary.com/).\n- StackOverflow: **NOTE** The Prism Team no longer supports or engages with questions posted on StackOverflow. Questions posted there may or may not receive correct answers.\n- For general questions and support, post your questions in [GitHub Discussions](https://github.com/PrismLibrary/Prism/discussions).\n- You can enter bugs and feature requests in our [Issues](https://github.com/PrismLibrary/Prism/issues/new/choose).\n- Enterprise Support: If you are interested in Enterprise Support please email the Prism Team at <support@prismlibrary.com>\n\n## Videos &amp; Training\n\nBy watching our courses, not only do you help support the project financially, but you might also learn something along the way.  We believe this is a win-win for everyone.\n\n- [Introduction to Prism for WPF (NEW)](https://pluralsight.pxf.io/bE3rB)\n- [Introduction to Prism (Legacy)](https://pluralsight.pxf.io/W1Dz3)\n- [What's New in Prism 5.0](https://pluralsight.pxf.io/z7avm)\n- [Prism Problems & Solutions: Showing Multiple Shells](https://pluralsight.pxf.io/XVxR5)\n- [Prism Problems & Solutions: Mastering TabControl](https://pluralsight.pxf.io/B6X99)\n- [Prism Problems & Solutions: Loading Modules Based on User Roles](https://pluralsight.pxf.io/GvjkE)\n- [Prism Problems & Solutions: Loading Dependent Views](https://pluralsight.pxf.io/a01zj)\n\nWe appreciate your support.\n\n## NuGet Packages\n\nOfficial Prism releases are available on NuGet. Prism packages are also available on the private Commercial Plus Feed which will be updated with each merged PR. If you want to take advantage of a new feature as soon as it's merged into the code base, or if there is a critical bug you need fixed we invite you to purchase the Commercial Plus License to take advantage of these packages.\n\n### Core Packages\n\nThese are the base packages for each platform, together with the Prism's Core assembly as a cross-platform PCL.\n\n| Platform | Package | NuGet | Commercial Plus Feed |\n| -------- | ------- | ------- | ----- |\n| Cross Platform | [Prism.Core][CoreNuGet] | [![CoreNuGetShield]][CoreNuGet] | [![CorePrismNuGetShield]][CorePrismNuGet] |\n| Cross Platform | [Prism.Events][EventsNuGet] | [![EventsNuGetShield]][EventsNuGet] | [![EventsPrismNuGetShield]][CorePrismNuGet] |\n| Cross Platform | [Prism.Container.Abstractions][ContainerAbstractionsNuGet] | [![ContainerAbstractionsNuGetShield]][ContainerAbstractionsNuGet] | [![ContainerAbstractionsPrismNuGetShield]][CorePrismNuGet] |\n| Cross Platform | [Prism.Container.DryIoc][ContainerDryIocNuGet] | [![ContainerDryIocNuGetShield]][ContainerDryIocNuGet] | [![ContainerDryIocPrismNuGetShield]][CorePrismNuGet] |\n| Cross Platform | [Prism.Container.Unity][ContainerUnityNuGet] | [![ContainerUnityNuGetShield]][ContainerUnityNuGet] | [![ContainerUnityPrismNuGetShield]][CorePrismNuGet] |\n| WPF | [Prism.Wpf][WpfNuGet] | [![WpfNuGetShield]][WpfNuGet] | [![WpfPrismNuGetShield]][WpfPrismNuGet] |\n| Avalonia | [Prism.Avalonia][AvaloniaNuGet] | [![AvaloniaNuGetShield]][AvaloniaNuGet] | [![AvaloniaPrismNuGetShield]][AvaloniaPrismNuGet] |\n| Xamarin.Forms | [Prism.Forms][FormsNuGet] | [![FormsNuGetShield]][FormsNuGet] | [![FormsPrismNuGetShield]][FormsPrismNuGet] |\n| Uno Platform and WinUI | [Prism.Uno][UnoNuGet] | [![UnoNuGetShield]][UnoNuGet] | [![UnoPrismNuGetShield]][UnoPrismNuGet] |\n\n### Container-specific packages\n\nEach supported IoC container has its own package assisting in the setup and usage of that container together with Prism. The assembly is named using this convention: Prism.*Container.Platform*.dll, e.g. **Prism.Unity.Wpf.dll**. Starting with version 7.0, Prism is moving to separate packages for each platform. Be sure to install the package for the Container and the Platform of your choice.\n\n#### WPF\n\n| Package | NuGet | Commercial Plus Feed |\n|---------|-------|-------|\n| [Prism.DryIoc][DryIocWpfNuGet] | [![DryIocWpfNuGetShield]][DryIocWpfNuGet] | [![DryIocWpfPrismNuGetShield]][DryIocWpfPrismNuGet] |\n| [Prism.Unity][UnityWpfNuGet] | [![UnityWpfNuGetShield]][UnityWpfNuGet] | [![UnityWpfPrismNuGetShield]][UnityWpfPrismNuGet] |\n\n#### Avalonia\n\n| Package | NuGet | Commercial Plus Feed |\n|---------|-------|-------|\n| [Prism.DryIoc.Avalonia][DryIocAvaloniaNuGet] | [![DryIocAvaloniaNuGetShield]][DryIocAvaloniaNuGet] | [![DryIocAvaloniaPrismNuGetShield]][DryIocAvaloniaPrismNuGet] |\n\n#### Xamarin Forms\n\n| Package | NuGet | Commercial Plus Feed |\n|---------|-------|-------|\n| [Prism.DryIoc.Forms][DryIocFormsNuGet] | [![DryIocFormsNuGetShield]][DryIocFormsNuGet] | [![DryIocFormsPrismNuGetShield]][DryIocFormsPrismNuGet] |\n| [Prism.Unity.Forms][UnityFormsNuGet] | [![UnityFormsNuGetShield]][UnityFormsNuGet] | [![UnityFormsPrismNuGetShield]][UnityFormsPrismNuGet] |\n| [Prism.Forms.Regions][PrismFormsRegionsNuget] | [![PrismFormsRegionsNuGetShield]][PrismFormsRegionsNuGet] | [![PrismFormsRegionsPrismNuGetShield]][PrismFormsRegionsPrismNuGet] |\n\n#### Uno Platform\n\n| Package | NuGet | Commercial Plus Feed |\n|---------|-------|-------|\n| [Prism.DryIoc.Uno][DryIocUnoPlatformNuGet] | [![DryIocUnoPlatformNuGetShield]][DryIocUnoPlatformNuGet] | [![DryIocUnoPlatformPrismNuGetShield]][DryIocUnoPlatformPrismNuGet] |\n\n![NuGet package tree](images/NuGetPackageTree.png)\n\nA detailed overview of each assembly per package is available [here](http://prismlibrary.github.io/docs/getting-started/NuGet-Packages.html).\n\n## Samples\n\nFor stable samples be sure to check out the samples repo for the platform you are most interested in.\n\n- [Prism for WPF Samples](https://github.com/PrismLibrary/Prism-Samples-Wpf)\n- [Prism for Xamarim.Forms](https://github.com/PrismLibrary/Prism-Samples-Forms)\n- [Prism for Uno Platform](#) (Coming soon)\n- [Prism for .NET MAUI](#) (Coming soon)\n- [Prism for Avalonia](https://github.com/AvaloniaCommunity/Prism.Avalonia/tree/develop/e2e)\n\n## Contributing\n\nWe strongly encourage you to get involved and help us evolve the code base.\n\n- You can see what our expectations are for pull requests [here](https://github.com/PrismLibrary/Prism/blob/master/.github/CONTRIBUTING.md).\n\n[CoreNuGet]: https://www.nuget.org/packages/Prism.Core/\n[EventsNuGet]: https://www.nuget.org/packages/Prism.Events/\n[ContainerAbstractionsNuGet]: https://www.nuget.org/packages/Prism.Container.Abstractions/\n[ContainerDryIocNuGet]: https://www.nuget.org/packages/Prism.Container.DryIoc/\n[ContainerUnityNuGet]: https://www.nuget.org/packages/Prism.Container.Unity/\n[WpfNuGet]: https://www.nuget.org/packages/Prism.Wpf/\n[UnoNuGet]: https://www.nuget.org/packages/Prism.Uno.WinUI/\n[AvaloniaNuGet]: https://www.nuget.org/packages/Prism.Avalonia/\n[FormsNuget]: https://www.nuget.org/packages/Prism.Forms/\n\n[PrismFormsRegionsNuGet]: https://www.nuget.org/packages/Prism.Forms.Regions/\n[PrismFormsRegionsPrismNuGet]: #\n[PrismFormsRegionsNuGetShield]: https://img.shields.io/nuget/vpre/Prism.Forms.Regions.svg\n[PrismFormsRegionsPrismNuGetShield]: https://nuget.prismlibrary.com/shield/Prism.Forms.Regions/vpre\n\n[DryIocWpfNuGet]: https://www.nuget.org/packages/Prism.DryIoc/\n[UnityWpfNuGet]: https://www.nuget.org/packages/Prism.Unity/\n\n[DryIocUnoPlatformNuGet]: https://www.nuget.org/packages/Prism.DryIoc.Uno.WinUI/\n[DryIocAvaloniaNuGet]: https://www.nuget.org/packages/Prism.DryIoc.Avalonia/\n\n[CoreNuGetShield]: https://img.shields.io/nuget/vpre/Prism.Core.svg\n[EventsNuGetShield]: https://img.shields.io/nuget/vpre/Prism.Events.svg\n[ContainerAbstractionsNuGetShield]: https://img.shields.io/nuget/vpre/Prism.Container.Abstractions.svg\n[ContainerDryIocNuGetShield]: https://img.shields.io/nuget/vpre/Prism.Container.DryIoc.svg\n[ContainerUnityNuGetShield]: https://img.shields.io/nuget/vpre/Prism.Container.Unity.svg\n[WpfNuGetShield]: https://img.shields.io/nuget/vpre/Prism.Wpf.svg\n[FormsNuGetShield]: https://img.shields.io/nuget/vpre/Prism.Forms.svg\n[UnoNuGetShield]: https://img.shields.io/nuget/vpre/Prism.Uno.WinUI.svg\n\n[DryIocWpfNuGetShield]: https://img.shields.io/nuget/vpre/Prism.DryIoc.svg\n[UnityWpfNuGetShield]: https://img.shields.io/nuget/vpre/Prism.Unity.svg\n\n[AvaloniaNuGetShield]: https://img.shields.io/nuget/vpre/Prism.Avalonia.svg\n[DryIocAvaloniaNuGetShield]: https://img.shields.io/nuget/vpre/Prism.DryIoc.Avalonia.svg\n\n[DryIocFormsNuGetShield]: https://img.shields.io/nuget/vpre/Prism.DryIoc.Forms.svg\n[UnityFormsNuGetShield]: https://img.shields.io/nuget/vpre/Prism.Unity.Forms.svg\n\n[DryIocUnoPlatformNuGetShield]: https://img.shields.io/nuget/vpre/Prism.DryIoc.Uno.WinUI.svg\n\n[CorePrismNuGet]: #\n[WpfPrismNuGet]: #\n[FormsPrismNuGet]: #\n[UnoPrismNuGet]: #\n[AvaloniaPrismNuGet]: #\n\n[DryIocWpfPrismNuGet]: #\n[UnityWpfPrismNuGet]: #\n\n[UnityFormsPrismNuGet]: #\n[DryIocFormsPrismNuGet]: #\n\n[DryIocAvaloniaPrismNuGet]: #\n\n[DryIocUnoPlatformPrismNuGet]: #\n\n[CorePrismNuGetShield]: https://nuget.prismlibrary.com/shield/Prism.Core/vpre\n[EventsPrismNuGetShield]: https://nuget.prismlibrary.com/shield/Prism.Events/vpre\n[ContainerAbstractionsPrismNuGetShield]: https://nuget.prismlibrary.com/shield/Prism.Container.Abstractions/vpre\n[ContainerDryIocPrismNuGetShield]: https://nuget.prismlibrary.com/shield/Prism.Container.DryIoc/vpre\n[ContainerUnityPrismNuGetShield]: https://nuget.prismlibrary.com/shield/Prism.Container.Unity/vpre\n[WpfPrismNuGetShield]: https://nuget.prismlibrary.com/shield/Prism.Wpf/vpre\n[AvaloniaPrismNuGetShield]: https://nuget.prismlibrary.com/shield/Prism.Avalonia/vpre\n[UnoPrismNuGetShield]: https://nuget.prismlibrary.com/shield/Prism.Uno.WinUI/vpre\n[FormsPrismNuGetShield]: https://nuget.prismlibrary.com/shield/Prism.Forms/vpre\n\n[DryIocWpfPrismNuGetShield]: https://nuget.prismlibrary.com/shield/Prism.DryIoc/vpre\n[UnityWpfPrismNuGetShield]: https://nuget.prismlibrary.com/shield/Prism.Unity/vpre\n\n[DryIocAvaloniaPrismNuGetShield]: https://nuget.prismlibrary.com/shield/Prism.DryIoc.Avalonia/vpre\n\n[DryIocUnoPlatformPrismNuGetShield]: https://nuget.prismlibrary.com/shield/Prism.DryIoc.Uno.WinUI/vpre\n\n[TwitterLogo]: https://dansiegelgithubsponsors.blob.core.windows.net/images/twitter.png\n[TwitchLogo]: https://dansiegelgithubsponsors.blob.core.windows.net/images/twitch.png\n[YouTubeLogo]: https://dansiegelgithubsponsors.blob.core.windows.net/images/youtube.png\n[OctoSponsor]: https://dansiegelgithubsponsors.blob.core.windows.net/images/octosponsor.png\n"
  },
  {
    "path": "build/consolidate-artifacts.ps1",
    "content": "# Ensure artifacts directory is clean\n\n$executionRoot = Get-Location\n$artifactsRoot = $executionRoot, 'artifacts' -join '\\'\n$nugetRoot = $executionRoot, 'artifacts', 'nuget' -join '\\'\nGet-ChildItem .\\ -Include $nugetRoot -Recurse | ForEach-Object ($_) { Remove-Item $_.Fullname -Force -Recurse }\nNew-Item -Path $nugetRoot -ItemType Directory -Force > $null\n$platforms = @('Forms', 'Wpf', 'Uno', 'Maui')\n\n$core = @(\"Prism.Core\", \"Prism.Events\", \"Prism.dll\", \"Prism.pdb\", \"Prism.xml\")\n$allowedExtensions = @('.dll', '.pdb', '.xml', '.pri', '.nupkg', '.snupkg')\n$files = Get-ChildItem -Path $artifactsRoot -Filter \"*\" -Recurse | Where-Object { (Test-Path -Path $_.FullName -PathType Leaf) -and $_.FullName.StartsWith($nugetRoot) -eq $false -and ($allowedExtensions -contains [System.IO.Path]::GetExtension($_.FullName)) }\n\nif ($files.Count -eq 0)\n{\n    $stringBuilder = New-Object System.Text.StringBuilder\n    $stringBuilder.AppendLine(\"Execution Root: $executionRoot\")\n    $stringBuilder.AppendLine(\"Artifacts:\")\n    Get-ChildItem $artifactsRoot | ForEach-Object { $stringBuilder.AppendLine($_.FullName) }\n    $stringBuilder.AppendLine(\"No files found to copy\")\n    Write-Error -Message $stringBuilder.ToString()\n    exit 1\n}\n\nforeach($file in $files)\n{\n    Write-Output \"Processing $($file)\"\n    if ($file -match ($platforms -join '|') -and $file -match ($core -join '|'))\n    {\n        # Ignore Prism.Core / Prism.Events built with platforms\n        continue\n    }\n    elseif ($file -like \"*.nupkg\" -or $file -like \"*.snupkg\")\n    {\n        Write-Output \"Copying $($file.FullName) to $nugetRoot\"\n        Copy-Item $file.FullName $nugetRoot\n    }\n    elseif ($file -like \"*.dll\" -or $file -like \"*.pdb\" -or $file -like \"*.xml\" -or $file -like \"*.pri\")\n    {\n        if($file.FullName-like ($platforms -join '|') -or $file.FullName -like 'Core')\n        {\n            continue\n        }\n\n        Write-Output \"Getting TFM Directory Name for $($file.FullName)\"\n        $parentDirName = Split-Path -Path (Split-Path -Path $file.FullName -Parent) -Leaf\n\n        Write-Output \"Determining Copy Path for $parentDirName\"\n        if ((Test-Path -Path $copyPath -PathType Container) -eq $false)\n        {\n            Write-Output \"Creating $copyPath\"\n            New-Item -Path $copyPath -ItemType Directory -Force > $null\n        }\n        Write-Output \"Copying $($file.FullName) to $copyPath\"\n        Copy-Item $file.FullName $copyPath\n    }\n}\n\nGet-ChildItem $artifactsRoot | Where-Object { $_.Name -ne 'nuget' } | ForEach-Object { Remove-Item $_.FullName -Force -Recurse }\n"
  },
  {
    "path": "e2e/Avalonia/PrismAvaloniaDemo/.editorconfig",
    "content": "# Copyright 2024 Xeno Innovations, Inc.\n#\n# This EditorConfig file provides consistent coding styles and formatting structure based on\n# C# standards by Xeno Innovations for your team's projects while preserving your personal defaults.\n#\n# For more info:\n# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options\n#\n\n# Remove the line below if you want to inherit .editorconfig settings from higher directories\nroot = true\n\n[*]\n# All generic files should use MSDOS style endings, not Unix (lf)\n# end_of_line = crlf\nindent_style = space\n\n[*.{cs,csx}]\nindent_style = space\nindent_size = 4\ntab_width = 4\ncharset = utf-8\ntrim_trailing_whitespace = true\ninsert_final_newline = true\n\n[*.{xml,xaml,axml,axaml}]\nindent_style = space\nindent_size = 2\ncharset = utf-8-bom\ntrim_trailing_whitespace = true\n\n[*.json]\nindent_style = space\nindent_size = 2\ntrim_trailing_whitespace = true\n\n[*.sln]\nindent_size = 2\n\n# Xml project files\n[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]\nindent_style = space\nindent_size = 2\ntrim_trailing_whitespace = true\n\n# Xml config files\n[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]\nindent_style = space\nindent_size = 2\ntrim_trailing_whitespace = true\n\n[*.svg]\nindent_style = space\nindent_size = 2\ntrim_trailing_whitespace = true\n\n# PList Files\n[*.plist]\nindent_style = space\nindent_size = 2\ntrim_trailing_whitespace = true\n\n# YAML files\n[*.{yaml,yml}]\nindent_style = space\nindent_size = 2\ntrim_trailing_whitespace = true\n\n# Shell script files\n[*.sh]\nend_of_line = lf\nindent_style = space\nindent_size = 2\n\n# Powershell\n[*.{ps1,psd1,psm1}]\nindent_style = space\nindent_size = 2\ntrim_trailing_whitespace = true\n\n[*.md]\nindent_style = space\nindent_size = 2\ninsert_final_newline = true\ntrim_trailing_whitespace = true\n\n# C# Ruleset\n[*.{cs,csx}]\n# Indentation preferences\ncsharp_indent_block_contents = true\ncsharp_indent_braces = false\ncsharp_indent_case_contents = true\ncsharp_indent_case_contents_when_block = false\ncsharp_indent_labels = one_less_than_current\ncsharp_indent_switch_labels = true\n\n## Formatting - new line options\n### Require braces to be on a new line for (also known as \"Allman\" style)\n### accessors, methods, object_collection, control_blocks, types, properties, lambdas\ncsharp_new_line_before_open_brace = all\ncsharp_new_line_before_catch = true\ncsharp_new_line_before_else = true\ncsharp_new_line_before_finally = true\ncsharp_new_line_before_members_in_object_initializers = true\ncsharp_new_line_before_members_in_anonymous_types = true\ncsharp_new_line_between_query_expression_clauses = true\n\n## Spaces\ncsharp_space_after_cast = false\ncsharp_space_after_colon_in_inheritance_clause = true\ncsharp_space_after_keywords_in_control_flow_statements = true\ncsharp_space_before_colon_in_inheritance_clause = true\ncsharp_space_before_comma = false\ncsharp_space_before_dot = false\ncsharp_space_before_open_square_brackets = false\ncsharp_space_before_semicolon_in_for_statement = false\ncsharp_space_between_method_call_empty_parameter_list_parentheses = false\ncsharp_space_between_method_call_name_and_opening_parenthesis = false\ncsharp_space_between_method_call_parameter_list_parentheses = false\ncsharp_space_between_method_declaration_empty_parameter_list_parentheses = false\ncsharp_space_between_method_declaration_parameter_list_parentheses = false\n\n# Modifier preferences\ncsharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion\n\n# Organize Usings\ndotnet_separate_import_directive_groups = false\ndotnet_sort_system_directives_first = true\nfile_header_template = unset\n# file_header_template = Copyright Xeno Innovations, Inc. 2022\\nSee the LICENSE file in the project root for more information.\n\n# this. and Me. preferences\ndotnet_style_qualification_for_event = false\ndotnet_style_qualification_for_field = false\ndotnet_style_qualification_for_method = false\ndotnet_style_qualification_for_property = false\n\n# Language keywords vs BCL types preferences\ndotnet_style_predefined_type_for_locals_parameters_members = true\ndotnet_style_predefined_type_for_member_access = true\n\n# Parentheses preferences\ndotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity\ndotnet_style_parentheses_in_other_binary_operators = always_for_clarity\ndotnet_style_parentheses_in_other_operators = never_if_unnecessary\ndotnet_style_parentheses_in_relational_binary_operators = always_for_clarity\n\n# Modifier preferences\ndotnet_style_predefined_type_for_locals_parameters_members = true\ndotnet_style_require_accessibility_modifiers = for_non_interface_members\ndotnet_style_readonly_field = true\n\n# Expression-level preferences\ndotnet_style_coalesce_expression = true\ndotnet_style_collection_initializer = true\ndotnet_style_explicit_tuple_names = true\ndotnet_style_namespace_match_folder = true\ndotnet_style_null_propagation = true\ndotnet_style_object_initializer = true\ndotnet_style_operator_placement_when_wrapping = beginning_of_line\ndotnet_style_prefer_auto_properties = true\ndotnet_style_prefer_compound_assignment = true\ndotnet_style_prefer_conditional_expression_over_assignment = true\ndotnet_style_prefer_conditional_expression_over_return = true\ndotnet_style_prefer_inferred_anonymous_type_member_names = true\ndotnet_style_prefer_inferred_tuple_names = true\ndotnet_style_prefer_is_null_check_over_reference_equality_method = true\ndotnet_style_prefer_simplified_boolean_expressions = true\ndotnet_style_prefer_simplified_interpolation = true\n\n# Parameter preferences\ndotnet_code_quality_unused_parameters = all\n\n# Suppression preferences\ndotnet_remove_unnecessary_suppression_exclusions = none\n\n# New line preferences\n#dotnet_diagnostic.IDE2000.severity = warning\ndotnet_style_allow_multiple_blank_lines_experimental = false:error\n\n# dotnet_diagnostic.IDE2001.severity = none\ncsharp_style_allow_embedded_statements_on_same_line_experimental = false\n\n# dotnet_diagnostic.IDE2002.severity = warning\ncsharp_style_allow_blank_lines_between_consecutive_braces_experimental = false\n\n# dotnet_diagnostic.IDE2003.severity = error\ndotnet_style_allow_statement_immediately_after_block_experimental = false:error\n\n# Naming Conventions\n## Async methods must use \"Async\" suffix\ndotnet_naming_rule.async_methods_end_in_async.symbols = any_async_methods\ndotnet_naming_rule.async_methods_end_in_async.style = end_in_async\ndotnet_naming_rule.async_methods_end_in_async.severity = error\ndotnet_naming_symbols.any_async_methods.applicable_kinds = method\ndotnet_naming_symbols.any_async_methods.applicable_accessibilities = *\ndotnet_naming_symbols.any_async_methods.required_modifiers = async\ndotnet_naming_style.end_in_async.capitalization = pascal_case\ndotnet_naming_style.end_in_async.required_prefix =\ndotnet_naming_style.end_in_async.required_suffix = Async\ndotnet_naming_style.end_in_async.word_separator =\n\n## private fields must prefix with an underscore\ndotnet_naming_rule.private_members_with_underscore.symbols  = private_fields\ndotnet_naming_rule.private_members_with_underscore.style    = prefix_underscore\ndotnet_naming_rule.private_members_with_underscore.severity = error\ndotnet_naming_symbols.private_fields.applicable_kinds       = field\ndotnet_naming_symbols.private_fields.applicable_accessibilities = private\ndotnet_naming_style.prefix_underscore.capitalization = camel_case\ndotnet_naming_style.prefix_underscore.required_prefix = _\n\n## private static fields must use PascalCase (overrides '_' based on SA1311)\ndotnet_naming_rule.private_static_field_naming.symbols  = private_static_field_naming\ndotnet_naming_rule.private_static_field_naming.style    = pascal_case_style\ndotnet_naming_rule.private_static_field_naming.severity = error\ndotnet_naming_symbols.private_static_field_naming.applicable_kinds   = field\ndotnet_naming_symbols.private_static_field_naming.applicable_accessibilities = private\ndotnet_naming_symbols.private_static_field_naming.required_modifiers = static, readonly\ndotnet_naming_style.pascal_case_style.capitalization = pascal_case\n\n## Constant fields must use PascalCase\ndotnet_naming_rule.constant_fields_should_be_pascal_case.symbols  = constant_fields\ndotnet_naming_rule.constant_fields_should_be_pascal_case.severity = error\ndotnet_naming_rule.constant_fields_should_be_pascal_case.style    = pascal_case_style\ndotnet_naming_symbols.constant_fields.applicable_kinds            = field\ndotnet_naming_symbols.constant_fields.applicable_accessibilities  = *\ndotnet_naming_symbols.constant_fields.required_modifiers          = const\ndotnet_naming_style.pascal_case_style.capitalization              = pascal_case\n\n## Interfaces must have an I suffix\ndotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface\ndotnet_naming_rule.interface_should_be_begins_with_i.severity = error\ndotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i\ndotnet_naming_symbols.interface.applicable_kinds = interface\ndotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected\ndotnet_naming_symbols.interface.required_modifiers =\ndotnet_naming_style.begins_with_i.capitalization = pascal_case\ndotnet_naming_style.begins_with_i.required_prefix = I\ndotnet_naming_style.begins_with_i.required_suffix =\ndotnet_naming_style.begins_with_i.word_separator =\n\n## Types and Non-Field Members must be PascalCase\ndotnet_naming_rule.types_should_be_pascal_case.severity = error\ndotnet_naming_rule.types_should_be_pascal_case.symbols = types\ndotnet_naming_rule.types_should_be_pascal_case.style = pascal_case\ndotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum\ndotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected\ndotnet_naming_symbols.types.required_modifiers =\n\ndotnet_naming_rule.non_field_members_should_be_pascal_case.severity = error\ndotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members\ndotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case\ndotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method\ndotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected\ndotnet_naming_symbols.non_field_members.required_modifiers =\n\n## Code Style Rules\n# IDE1005: Use conditional delegate call\ncsharp_style_conditional_delegate_call = true\n# IDE1005: Delegate invocation can be simplified.\ndotnet_diagnostic.IDE1005.severity = warning\n# IDE1006: Naming Styles\ndotnet_diagnostic.IDE1006.severity = error\n# IDEOOO8: Use of var\ndotnet_diagnostic.IDE0008.severity = none\n# IDE0010: Add missing cases\ndotnet_diagnostic.IDE0010.severity = none\n# IDE0011: Add braces\ncsharp_prefer_braces = when_multiline\n# IDE0025: Use expression body for properties\ncsharp_style_expression_bodied_properties = true\n# IDE0026: Use expression body for indexers\ncsharp_style_expression_bodied_indexers = true\n# IDE0027: Use expression body for accessors\ncsharp_style_expression_bodied_accessors = true\n# IDE0046: Convert to conditional expression\ndotnet_diagnostic.IDE0046.severity = none\n# IDE0058: Expression value is never used\n# csharp_style_unused_value_expression_statement_preference = discard_variable\ndotnet_diagnostic.IDE0058.severity = none\n\n## Code Quality Rules\n# CA1031: Do not catch general exception types\ndotnet_diagnostic.CA1031.severity = none\n# CA1822: Mark members as static\n##dotnet_diagnostic.CA1822.severity = none\n# CA1507: Use nameof to express symbol names\ndotnet_diagnostic.CA1507.severity = error\n\n## Compiler\n# CS0618: Type or member is obsolete\n##dotnet_diagnostic.CS0618.severity = error\ndotnet_diagnostic.CS0618.severity = warning\n# CS1591: Missing XML comment for publicly visible type or member\ndotnet_diagnostic.CS1591.severity = none\n\n## StyleCop.Analyzers\n# SA1000: Keywords should be spaced correctly\ndotnet_diagnostic.SA1000.severity = error\n# SA1005: Single line comments should begin with single space\ndotnet_diagnostic.SA1005.severity = error\n# SA1008\n# SA1025: Spacing??\n# SA1101: PrefixLocalCallsWithThis\ndotnet_diagnostic.SA1101.severity = none\n# SA1116: Split parameters should start on line after declaration\ndotnet_diagnostic.SA1116.severity = none\n# SA1118: Parameter should not span multiple lines\ndotnet_diagnostic.SA1118.severity = warning\n# SA1137: Elements should have the same indentation\ndotnet_diagnostic.SA1137.severity = error\n# SA1124: Do not use regions\ndotnet_diagnostic.SA1124.severity = error\n# SA1200: UsingDirectivesMustBePlacedWithinNamespace\ndotnet_diagnostic.SA1200.severity = none\n# SA1201: Elements should appear in the correct order\ndotnet_diagnostic.SA1201.severity = error\n# SA1202: Elements should be ordered by access\ndotnet_diagnostic.SA1202.severity = error\n# SA1203: Constants should appear before fields\ndotnet_diagnostic.SA1203.severity = error\n# SA1204: Static elements should appear before instance elements\ndotnet_diagnostic.SA1204.severity = error\n# SA1214: Readonly fields should appear before non-readonly fields\ndotnet_diagnostic.SA1214.severity = error\n# SA1306: Field names should begin with lower-case letter\ndotnet_diagnostic.SA1306.severity = error\n# SA1309: FieldNamesMustNotBeginWithUnderscore\ndotnet_diagnostic.SA1309.severity = none\n# SA1313: Parameter names should begin with lower-case letter\ndotnet_diagnostic.SA1313.severity = error\n# SA1414: Tuple types in signatures should have element names\ndotnet_diagnostic.SA1414.severity = silent\n# SA1503: Braces should not be omitted\ndotnet_diagnostic.SA1503.severity = none\n# SA1505: Opening braces should not be floowed by a blank line\ndotnet_diagnostic.SA1505.severity= error\n# SA1507: Code should not contain multiple blank lines in a row\ndotnet_diagnostic.SA1507.severity = error\n# SA1508: Closing brac should not be preceded by a blank line\ndotnet_diagnostic.SA1508.severity= error\n# SA1513: Closing brace should be followed by blank line\ndotnet_diagnostic.SA1513.severity = error\n# SA1514: Element documentation header should be preceded by blank line\ndotnet_diagnostic.SA1514.severity = error\n# SA1515: Single-line comment should be preceded by blank line\ndotnet_diagnostic.SA1515.severity = warning\n# SA1516: Elements should be separated by blank line\ndotnet_diagnostic.SA1516.severity = error\n# SA1600: Elements should be documented\ndotnet_diagnostic.SA1600.severity = none\n# SA1602: Enumeration items should not be documented\ndotnet_diagnostic.SA1602.severity = none\n# SA1623: Property summary documentation should match accessors\ndotnet_diagnostic.SA1623.severity = warning\n# SA1633: FileMustHaveHeader\ndotnet_diagnostic.SA1633.severity = silent\n# SA1636: File header copyright text should match\ndotnet_diagnostic.SA1636.severity = none\n\n# Default severity for analyzer diagnostics with category 'StyleCop.CSharp.SpacingRules' SA1028: Code should not contain trailing whitespace\ndotnet_analyzer_diagnostic.category-StyleCop.CSharp.SpacingRules.severity = error\n\ndotnet_diagnostic.VSSpell001.severity = suggestion\ndotnet_diagnostic.VSSpell002.severity = none\n\n# SA0001: XML comment analysis is disabled due to project configuration\ndotnet_diagnostic.SA0001.severity = none\n\n# Ignore Generated XAML\n[*.sg.cs]\n# CS1591: Missing XML comment for publicly visible type or member\ndotnet_diagnostic.CS1591.severity = none\ndotnet_analyzer_diagnostic.CS1591.severity = none\n# generated_code = true\n\n[WindowsAppSDK-VersionInfo.cs]\ndotnet_diagnostic.CS1591.severity = none\n"
  },
  {
    "path": "e2e/Avalonia/PrismAvaloniaDemo/.gitignore",
    "content": "# Copyright CURRENT_YEAR COMPANY_NAME\n# Template for C#\n\n# Generic Visual Studio files\n*.bak\n*.csproj.user\n*.suo\n*.vshost.exe\n*.vshost.exe.manifest\n*.exe.config\n*.exp\n*.lib\n*.pdb\n*.pfx\n*.user\n*.vbw\n*.scc\n*.oca\n*.userprefs\n*.userosscache\n*.sln.docstates\n*.autorecover\n*.coverage\n\n# VS Code\n.vscode/*\n!.vscode/extensions.json\n!.vscode/launch.json\n!.vscode/settings.json\n\n# SQLite datbases\n*.db3\n\n# Xamarin.Android Resource.Designer.cs files\n**/*.Android/**/[Rr]esource.[Dd]esigner.cs\n**/*.Droid/**/[Rr]esource.[Dd]esigner.cs\n**/Android/**/[Rr]esource.[Dd]esigner.cs\n**/Droid/**/[Rr]esource.[Dd]esigner.cs\n\n# Build results\n[Oo]utput/\n[Dd]ebug/\n[Dd]ebugPublic/\n[Rr]elease/\nx64/\nx86/\nbuild/\nbld/\n[Bb]in/\n[Oo]bj/\n[Ll]og/\n.vs/\n\n# NuGet Packages\n*.nupkg\n## The packages folder can be ignored because of Package Restore\n**/packages/*\n## Except build/, which is used as an MSBuild target.\n!**/packages/build/\n## Uncomment if necessary however generally it will be regenerated when needed\n!**/packages/repositories.config\n## NuGet v3's project.json files produces more ignorable files\n*.nuget.props\n*.nuget.targets\n\n# NUnit\n*.VisualState.xml\nTestResult.xml\n\n# Installer Folder\n/installer/*.exe\n!/installer/autorun.exe\n\n# Lib folder\n/lib/*\n!/lib/readme.txt\n!/lib/readme.md\n\n# Output\n!/[Oo]utput/readme.txt\n!/[Oo]utput/readme.md\n\n## USER DEFINED\n/[Dd]ocs/*.csv\n/[Dd]ocs/backup\n/[Tt]ools\n"
  },
  {
    "path": "e2e/Avalonia/PrismAvaloniaDemo/App.axaml",
    "content": "﻿<Application xmlns=\"https://github.com/avaloniaui\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n             x:Class=\"SampleApp.App\"\n             RequestedThemeVariant=\"Default\">\n  <!-- \"Default\" ThemeVariant follows system theme variant. \"Dark\" or \"Light\" are other available options. -->\n  <Application.Styles>\n    <FluentTheme />\n\n    <!-- Custom SVG glyphs -->\n    <!-- NOTE: The namespace may be 'SampleApp' but Assembly name is, 'PrismAvaloniaDemo' -->\n    <StyleInclude Source=\"avares://PrismAvaloniaDemo/Styles/Icons.axaml\" />\n  </Application.Styles>\n</Application>\n"
  },
  {
    "path": "e2e/Avalonia/PrismAvaloniaDemo/App.axaml.cs",
    "content": "using Avalonia;\nusing Avalonia.Controls.ApplicationLifetimes;\nusing Avalonia.Data.Core;\nusing Avalonia.Data.Core.Plugins;\nusing Avalonia.Markup.Xaml;\nusing Prism.DryIoc;\nusing Prism.Ioc;\nusing Prism.Navigation.Regions;\nusing SampleApp.Services;\nusing SampleApp.ViewModels;\nusing SampleApp.Views;\n\nnamespace SampleApp;\n\npublic partial class App : PrismApplication\n{\n    public override void Initialize()\n    {\n        AvaloniaXamlLoader.Load(this);\n\n        // Required when overriding Initialize\n        base.Initialize();\n    }\n\n    protected override AvaloniaObject CreateShell()\n    {\n        return Container.Resolve<MainWindow>();\n    }\n\n    protected override void RegisterTypes(IContainerRegistry containerRegistry)\n    {\n        // Register your Services, Views, Dialogs, etc. here\n\n        // Services\n        containerRegistry.RegisterSingleton<INotificationService, NotificationService>();\n\n        // Views - Region Navigation\n        containerRegistry.RegisterForNavigation<DashboardView, DashboardViewModel>();\n        containerRegistry.RegisterForNavigation<SettingsView, SettingsViewModel>();\n        containerRegistry.RegisterForNavigation<SubSettingsView, SubSettingsViewModel>();\n    }\n\n    /// <summary>Called after Initialize.</summary>\n    protected override void OnInitialized()\n    {\n        // Register Views to the Region it will appear in. Don't register them in the ViewModel.\n        var regionManager = Container.Resolve<IRegionManager>();\n\n        // WARNING: Prism v11.0.0\n        // - DataTemplates MUST define a DataType or else an XAML error will be thrown\n        // - Error: DataTemplate inside of DataTemplates must have a DataType set\n        regionManager.RegisterViewWithRegion(RegionNames.ContentRegion, typeof(DashboardView));\n    }\n}\n"
  },
  {
    "path": "e2e/Avalonia/PrismAvaloniaDemo/PrismAvaloniaDemo.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n  <PropertyGroup>\n    <OutputType>WinExe</OutputType>\n    <TargetFramework>net10.0</TargetFramework>\n    <LangVersion>latest</LangVersion>\n    <Nullable>enable</Nullable>\n    <BuiltInComInteropSupport>true</BuiltInComInteropSupport>\n    <ApplicationManifest>app.manifest</ApplicationManifest>\n    <AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>\n    <ImplicitUsings>false</ImplicitUsings>\n    <Title>Sample Prism.Avalonia App</Title>\n    <Authors>Damian Suess</Authors>\n    <Description>Prism.Avalonia end-to-end demonstration application.</Description>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <Folder Include=\"Models\\\" />\n    <AvaloniaResource Include=\"Assets\\**\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Avalonia\" />\n    <PackageReference Include=\"Avalonia.Desktop\" />\n    <PackageReference Include=\"Avalonia.Themes.Fluent\" />\n    <PackageReference Include=\"Avalonia.Fonts.Inter\" />\n    <!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->\n    <PackageReference Condition=\"'$(Configuration)' == 'Debug'\" Include=\"Avalonia.Diagnostics\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\..\\src\\Avalonia\\Prism.Avalonia\\Prism.Avalonia.csproj\" />\n    <ProjectReference Include=\"..\\..\\..\\src\\Avalonia\\Prism.DryIoc.Avalonia\\Prism.DryIoc.Avalonia.csproj\" />\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": "e2e/Avalonia/PrismAvaloniaDemo/Program.cs",
    "content": "using System;\nusing Avalonia;\n\nnamespace SampleApp;\n\ninternal sealed class Program\n{\n    // Initialization code. Don't use any Avalonia, third-party APIs or any\n    // SynchronizationContext-reliant code before AppMain is called: things aren't initialized\n    // yet and stuff might break.\n    [STAThread]\n    public static void Main(string[] args) => BuildAvaloniaApp()\n        .StartWithClassicDesktopLifetime(args);\n\n    // Avalonia configuration, don't remove; also used by visual designer.\n    public static AppBuilder BuildAvaloniaApp() => AppBuilder\n        .Configure<App>()\n        .UsePlatformDetect()\n        .WithInterFont()\n        .LogToTrace();\n}\n"
  },
  {
    "path": "e2e/Avalonia/PrismAvaloniaDemo/RegionNames.cs",
    "content": "namespace SampleApp;\n\npublic static class RegionNames\n{\n    public const string ContentRegion = \"ContentRegion\";\n    public const string FooterRegion = \"FooterRegion\";\n    public const string SidebarRegion = \"SidebarRegion\";\n}\n"
  },
  {
    "path": "e2e/Avalonia/PrismAvaloniaDemo/Services/INotificationService.cs",
    "content": "using System;\nusing Avalonia.Controls;\nusing Avalonia.Controls.Notifications;\n\nnamespace SampleApp.Services;\n\n/// <summary>In-application Notification Service Interface.</summary>\npublic interface INotificationService\n{\n  /// <summary>Defines the maximum number of notifications visible at once.</summary>\n  int MaxItems { get; set; }\n\n  /// <summary>The expiry time in seconds at which the notification will close (default 5 seconds).</summary>\n  int NotificationTimeout { get; set; }\n\n  // <summary>Set the host window.</summary>\n  // <param name=\"hostWindow\">Parent window.</param>\n  void SetHostWindow(TopLevel window);\n\n  /// <summary>Display the notification.</summary>\n  /// <param name=\"title\">Title.</param>\n  /// <param name=\"message\">Message.</param>\n  /// <param name=\"notificationType\">The <see cref=\"NotificationType\"/> of the notification.</param>\n  /// <param name=\"onClick\">An optional action to call when the notification is clicked.</param>\n  /// <param name=\"onClose\">An optional action to call when the notification is closed.</param>\n  void Show(string title,\n            string message,\n            NotificationType notificationType = NotificationType.Information,\n            Action? onClick = null,\n            Action? onClose = null);\n}\n"
  },
  {
    "path": "e2e/Avalonia/PrismAvaloniaDemo/Services/NotificationService.cs",
    "content": "using System;\nusing Avalonia.Controls.Notifications;\n\nnamespace SampleApp.Services;\n\npublic class NotificationService : INotificationService\n{\n  private int _notificationTimeout = 5;\n  private WindowNotificationManager? _notificationManager;\n\n  /// <inheritdoc/>\n  public int MaxItems { get; set; } = 4;\n\n  /// <inheritdoc/>\n  public int NotificationTimeout { get => _notificationTimeout; set => _notificationTimeout = (value < 0) ? 0 : value; }\n\n  /// <inheritdoc/>\n  public void SetHostWindow(TopLevel hostWindow)\n  {\n    var notificationManager = new WindowNotificationManager(hostWindow)\n    {\n        Position = NotificationPosition.BottomRight,\n        MaxItems = MaxItems,\n        Margin = new Thickness(0, 0, 15, 40)\n    };\n\n    _notificationManager = notificationManager;\n  }\n\n  /// <inheritdoc/>\n  public void Show(string title,\n                   string message,\n                   NotificationType notificationType = NotificationType.Information,\n                   Action? onClick = null,\n                   Action? onClose = null)\n  {\n    if (_notificationManager is { } nm)\n    {\n        nm.Show(\n            new Notification(\n            title,\n            message,\n            notificationType,\n            TimeSpan.FromSeconds(_notificationTimeout),\n            onClick,\n            onClose));\n    }\n  }\n}\n"
  },
  {
    "path": "e2e/Avalonia/PrismAvaloniaDemo/Styles/Icons.axaml",
    "content": "﻿<Styles xmlns=\"https://github.com/avaloniaui\"\n        xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\">\n  <Design.PreviewWith>\n    <Border Padding=\"20\">\n      <!-- Add Controls for Previewer Here -->\n      <PathIcon Data=\"{StaticResource Menu}\" />\n    </Border>\n  </Design.PreviewWith>\n\n  <!--\n    Add Styles Here\n    References\n    - https://avaloniaui.github.io/icons.html\n    - https://docs.avaloniaui.net/tutorials/music-store-app/add-and-layout-controls\n    - https://github.com/SKProCH/Material.Icons/blob/master/Material.Icons/MaterialIconDataProvider.PathData.cs\n  -->\n  <Style>\n    <Style.Resources>\n      <!-- Back button -->\n      <StreamGeometry x:Key=\"arrow_reply_regular\">M13.015,22.5 L20.0762716,29.5608928 C20.564427,30.0490482 20.564427,30.8405044 20.0762716,31.3286598 C19.62066,31.7842715 18.9008395,31.8146456 18.41,31.4197821 L18.3085047,31.3286598 L9.11611652,22.1362716 C8.66050485,21.68066 8.63013074,20.9608395 9.02499419,20.47 L9.11611652,20.3685047 L18.3085047,11.1761165 C18.79666,10.6879612 19.5881163,10.6879612 20.0762716,11.1761165 C20.5318833,11.6317282 20.5622574,12.3515486 20.167394,12.8423881 L20.0762716,12.9438835 L13.019,20 L22,20 C25.2536812,20 28.2794612,20.720575 30.9036216,22.0988501 L31.3145999,22.3219289 C33.9967941,23.8257725 36.1742275,26.0032059 37.6780711,28.6854001 C39.201579,31.4026669 40,34.5750724 40,38 C40,38.6903559 39.4403559,39.25 38.75,39.25 C38.0596441,39.25 37.5,38.6903559 37.5,38 C37.5,34.9958129 36.8076557,32.2448875 35.4974353,29.9080316 C34.2186616,27.6272628 32.3727372,25.7813384 30.0919684,24.5025647 C27.8849378,23.2651343 25.3085674,22.5788342 22.4983253,22.5063978 L22,22.5 L13.015,22.5 L20.0762716,29.5608928 L13.015,22.5 Z</StreamGeometry>\n\n      <!-- Hamburger -->\n      <StreamGeometry x:Key=\"Menu\">M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z</StreamGeometry>\n      <StreamGeometry x:Key=\"MenuClose\">M3 6H13V8H3V6M3 16H13V18H3V16M3 11H15V13H3V11M16 7L14.58 8.39L18.14 12L14.58 15.61L16 17L21 12L16 7Z</StreamGeometry>\n      <StreamGeometry x:Key=\"MenuDown\">M7,10L12,15L17,10H7Z</StreamGeometry>\n      <StreamGeometry x:Key=\"MenuDownOutline\">M18,9V10.5L12,16.5L6,10.5V9H18M12,13.67L14.67,11H9.33L12,13.67Z</StreamGeometry>\n      <StreamGeometry x:Key=\"MenuLeft\">M14,7L9,12L14,17V7Z</StreamGeometry>\n      <StreamGeometry x:Key=\"MenuLeftOutline\">M15,18H13.5L7.5,12L13.5,6H15V18M10.33,12L13,14.67V9.33L10.33,12Z</StreamGeometry>\n      <StreamGeometry x:Key=\"MenuOpen\">M21,15.61L19.59,17L14.58,12L19.59,7L21,8.39L17.44,12L21,15.61M3,6H16V8H3V6M3,13V11H13V13H3M3,18V16H16V18H3Z</StreamGeometry>\n      <StreamGeometry x:Key=\"MenuRight\">M10,17L15,12L10,7V17Z</StreamGeometry>\n      <StreamGeometry x:Key=\"MenuRightOutline\">M9,6H10.5L16.5,12L10.5,18H9V6M13.67,12L11,9.33V14.67L13.67,12Z</StreamGeometry>\n      <StreamGeometry x:Key=\"MenuSwap\">M12,6L7,11H17L12,6M7,13L12,18L17,13H7Z</StreamGeometry>\n      <StreamGeometry x:Key=\"MenuSwapOutline\">M12,3.5L6,9.5V11H18V9.5L12,3.5M12,6.33L14.67,9H9.33L12,6.33M6,13V14.5L12,20.5L18,14.5V13H6M9.33,15H14.67L12,17.67L9.33,15Z</StreamGeometry>\n      <StreamGeometry x:Key=\"MenuUp\">M7,15L12,10L17,15H7Z</StreamGeometry>\n      <StreamGeometry x:Key=\"MenuUpOutline\">M18,16V14.5L12,8.5L6,14.5V16H18M12,11.33L14.67,14H9.33L12,11.33Z</StreamGeometry>\n\n      <!--\n      <StreamGeometry x:Key=\"Hamburger\">M22 13C22 14.11 21.11 15 20 15H4C2.9 15 2 14.11 2 13S2.9 11 4 11H13L15.5 13L18 11H20C21.11 11 22 11.9 22 13M12 3C3 3 3 9 3 9H21C21 9 21 3 12 3M3 18C3 19.66 4.34 21 6 21H18C19.66 21 21 19.66 21 18V17H3V18Z</StreamGeometry>\n      <StreamGeometry x:Key=\"HamburgerCheck\">M21 9H3C3 9 3 3 12 3S21 9 21 9M13.35 17H3V18C3 19.66 4.34 21 6 21H13.35C13.13 20.37 13 19.7 13 19C13 18.3 13.13 17.63 13.35 17M21.86 13.73C21.95 13.5 22 13.26 22 13C22 11.9 21.11 11 20 11H11L8.5 13L6 11H4C2.9 11 2 11.9 2 13S2.9 15 4 15H14.54C15.64 13.78 17.23 13 19 13C20.04 13 21 13.26 21.86 13.73M21.34 15.84L17.75 19.43L16.16 17.84L15 19L17.75 22L22.5 17.25L21.34 15.84Z</StreamGeometry>\n      <StreamGeometry x:Key=\"HamburgerMinus\">M21 9H3C3 9 3 3 12 3S21 9 21 9M13.35 17H3V18C3 19.66 4.34 21 6 21H13.35C13.13 20.37 13 19.7 13 19C13 18.3 13.13 17.63 13.35 17M21.86 13.73C21.95 13.5 22 13.26 22 13C22 11.9 21.11 11 20 11H11L8.5 13L6 11H4C2.9 11 2 11.9 2 13S2.9 15 4 15H14.54C15.64 13.78 17.23 13 19 13C20.04 13 21 13.26 21.86 13.73M15 18V20H23V18H15Z</StreamGeometry>\n      <StreamGeometry x:Key=\"HamburgerOff\">M20 11C21.11 11 22 11.9 22 13S21.11 15 20 15H18.2L14.2 11H20M20.42 19.77L20.42 19.76L17.66 17H17.65L15.65 15H15.66L11.66 11H11.66L9.66 9H9.66L2.39 1.73L1.11 3L4.12 6C3 7.5 3 9 3 9H7.11L9.11 11H4C2.9 11 2 11.9 2 13S2.9 15 4 15H13.11L15.11 17H3V18C3 19.66 4.34 21 6 21H18C18.33 21 18.65 20.93 18.94 20.83L20.84 22.73L22.11 21.46L20.42 19.77M21 9C21 9 21 3 12 3C9.88 3 8.28 3.34 7.05 3.85L12.2 9H21Z</StreamGeometry>\n      <StreamGeometry x:Key=\"HamburgerPlus\">M21 9H3C3 9 3 3 12 3S21 9 21 9M13.35 17H3V18C3 19.66 4.34 21 6 21H13.35C13.13 20.37 13 19.7 13 19C13 18.3 13.13 17.63 13.35 17M21.86 13.73C21.95 13.5 22 13.26 22 13C22 11.9 21.11 11 20 11H11L8.5 13L6 11H4C2.9 11 2 11.9 2 13S2.9 15 4 15H14.54C15.64 13.78 17.23 13 19 13C20.04 13 21 13.26 21.86 13.73M20 18V15H18V18H15V20H18V23H20V20H23V18H20Z</StreamGeometry>\n      <StreamGeometry x:Key=\"HamburgerRemove\">M21 9H3C3 9 3 3 12 3S21 9 21 9M13.35 17H3V18C3 19.66 4.34 21 6 21H13.35C13.13 20.37 13 19.7 13 19C13 18.3 13.13 17.63 13.35 17M21.86 13.73C21.95 13.5 22 13.26 22 13C22 11.9 21.11 11 20 11H11L8.5 13L6 11H4C2.9 11 2 11.9 2 13S2.9 15 4 15H14.54C15.64 13.78 17.23 13 19 13C20.04 13 21 13.26 21.86 13.73M22.54 16.88L21.12 15.47L19 17.59L16.88 15.47L15.47 16.88L17.59 19L15.47 21.12L16.88 22.54L19 20.41L21.12 22.54L22.54 21.12L20.41 19L22.54 16.88Z</StreamGeometry>\n      -->\n      \n      <!-- Dashboard -->\n      <StreamGeometry x:Key=\"home_regular\">M21.6062 5.85517C23.0048 4.71494 24.9952 4.71494 26.3938 5.85517L39.5688 16.5966C40.4736 17.3342 41 18.4492 41 19.628V39.1134C41 41.2599 39.2875 43 37.175 43H32.075C29.9625 43 28.25 41.2599 28.25 39.1134V29.7492C28.25 29.0337 27.6792 28.4536 26.975 28.4536H21.025C20.3208 28.4536 19.75 29.0337 19.75 29.7492V39.1134C19.75 41.2599 18.0375 43 15.925 43H10.825C8.71251 43 7 41.2599 7 39.1134V19.628C7 18.4493 7.52645 17.3342 8.43124 16.5966L21.6062 5.85517ZM24.7979 7.87612C24.3317 7.49604 23.6683 7.49604 23.2021 7.87612L10.0271 18.6175C9.72548 18.8634 9.55 19.2351 9.55 19.628V39.1134C9.55 39.8289 10.1208 40.4089 10.825 40.4089H15.925C16.6292 40.4089 17.2 39.8289 17.2 39.1134V29.7492C17.2 27.6027 18.9125 25.8626 21.025 25.8626H26.975C29.0875 25.8626 30.8 27.6027 30.8 29.7492V39.1134C30.8 39.8289 31.3708 40.4089 32.075 40.4089H37.175C37.8792 40.4089 38.45 39.8289 38.45 39.1134V19.628C38.45 19.2351 38.2745 18.8634 37.9729 18.6175L24.7979 7.87612Z</StreamGeometry>\n\n      <!-- Lock -->\n      <StreamGeometry x:Key=\"lock_regular\">M12,2 C14.209139,2 16,3.790861 16,6 L16,8 L17.75,8 C18.9926407,8 20,9.00735931 20,10.25 L20,19.75 C20,20.9926407 18.9926407,22 17.75,22 L6.25,22 C5.00735931,22 4,20.9926407 4,19.75 L4,10.25 C4,9.00735931 5.00735931,8 6.25,8 L8,8 L8,6 C8,3.790861 9.790861,2 12,2 Z M17.75,9.5 L6.25,9.5 C5.83578644,9.5 5.5,9.83578644 5.5,10.25 L5.5,19.75 C5.5,20.1642136 5.83578644,20.5 6.25,20.5 L17.75,20.5 C18.1642136,20.5 18.5,20.1642136 18.5,19.75 L18.5,10.25 C18.5,9.83578644 18.1642136,9.5 17.75,9.5 Z M12.000125,13.5 C12.8285521,13.5 13.500125,14.1715729 13.500125,15 C13.500125,15.8284271 12.8285521,16.5 12.000125,16.5 C11.1716979,16.5 10.500125,15.8284271 10.500125,15 C10.500125,14.1715729 11.1716979,13.5 12.000125,13.5 Z M12,3.5 C10.6192881,3.5 9.5,4.61928813 9.5,6 L9.5,8 L14.5,8 L14.5,6 C14.5,4.61928813 13.3807119,3.5 12,3.5 Z</StreamGeometry>\n\n      <!-- Settings -->\n      <StreamGeometry x:Key=\"settings_regular\">M14 9.50006C11.5147 9.50006 9.5 11.5148 9.5 14.0001C9.5 16.4853 11.5147 18.5001 14 18.5001C15.3488 18.5001 16.559 17.9066 17.3838 16.9666C18.0787 16.1746 18.5 15.1365 18.5 14.0001C18.5 13.5401 18.431 13.0963 18.3028 12.6784C17.7382 10.8381 16.0253 9.50006 14 9.50006ZM11 14.0001C11 12.3432 12.3431 11.0001 14 11.0001C15.6569 11.0001 17 12.3432 17 14.0001C17 15.6569 15.6569 17.0001 14 17.0001C12.3431 17.0001 11 15.6569 11 14.0001Z M21.7093 22.3948L19.9818 21.6364C19.4876 21.4197 18.9071 21.4515 18.44 21.7219C17.9729 21.9924 17.675 22.4693 17.6157 23.0066L17.408 24.8855C17.3651 25.273 17.084 25.5917 16.7055 25.682C14.9263 26.1061 13.0725 26.1061 11.2933 25.682C10.9148 25.5917 10.6336 25.273 10.5908 24.8855L10.3834 23.0093C10.3225 22.4731 10.0112 21.9976 9.54452 21.7281C9.07783 21.4586 8.51117 21.4269 8.01859 21.6424L6.29071 22.4009C5.93281 22.558 5.51493 22.4718 5.24806 22.1859C4.00474 20.8536 3.07924 19.2561 2.54122 17.5137C2.42533 17.1384 2.55922 16.7307 2.8749 16.4977L4.40219 15.3703C4.83721 15.0501 5.09414 14.5415 5.09414 14.0007C5.09414 13.4598 4.83721 12.9512 4.40162 12.6306L2.87529 11.5051C2.55914 11.272 2.42513 10.8638 2.54142 10.4882C3.08038 8.74734 4.00637 7.15163 5.24971 5.82114C5.51684 5.53528 5.93492 5.44941 6.29276 5.60691L8.01296 6.36404C8.50793 6.58168 9.07696 6.54881 9.54617 6.27415C10.0133 6.00264 10.3244 5.52527 10.3844 4.98794L10.5933 3.11017C10.637 2.71803 10.9245 2.39704 11.3089 2.31138C12.19 2.11504 13.0891 2.01071 14.0131 2.00006C14.9147 2.01047 15.8128 2.11485 16.6928 2.31149C17.077 2.39734 17.3643 2.71823 17.4079 3.11017L17.617 4.98937C17.7116 5.85221 18.4387 6.50572 19.3055 6.50663C19.5385 6.507 19.769 6.45838 19.9843 6.36294L21.7048 5.60568C22.0626 5.44818 22.4807 5.53405 22.7478 5.81991C23.9912 7.1504 24.9172 8.74611 25.4561 10.487C25.5723 10.8623 25.4386 11.2703 25.1228 11.5035L23.5978 12.6297C23.1628 12.95 22.9 13.4586 22.9 13.9994C22.9 14.5403 23.1628 15.0489 23.5988 15.3698L25.1251 16.4965C25.441 16.7296 25.5748 17.1376 25.4586 17.5131C24.9198 19.2536 23.9944 20.8492 22.7517 22.1799C22.4849 22.4657 22.0671 22.5518 21.7093 22.3948ZM16.263 22.1966C16.4982 21.4685 16.9889 20.8288 17.6884 20.4238C18.5702 19.9132 19.6536 19.8547 20.5841 20.2627L21.9281 20.8526C22.791 19.8538 23.4593 18.7013 23.8981 17.4552L22.7095 16.5778L22.7086 16.5771C21.898 15.98 21.4 15.0277 21.4 13.9994C21.4 12.9719 21.8974 12.0195 22.7073 11.4227L22.7085 11.4218L23.8957 10.545C23.4567 9.2988 22.7881 8.14636 21.9248 7.1477L20.5922 7.73425L20.5899 7.73527C20.1844 7.91463 19.7472 8.00722 19.3039 8.00663C17.6715 8.00453 16.3046 6.77431 16.1261 5.15465L16.1259 5.15291L15.9635 3.69304C15.3202 3.57328 14.6677 3.50872 14.013 3.50017C13.3389 3.50891 12.6821 3.57367 12.0377 3.69328L11.8751 5.15452C11.7625 6.16272 11.1793 7.05909 10.3019 7.56986C9.41937 8.0856 8.34453 8.14844 7.40869 7.73694L6.07273 7.14893C5.20949 8.14751 4.54092 9.29983 4.10196 10.5459L5.29181 11.4233C6.11115 12.0269 6.59414 12.9837 6.59414 14.0007C6.59414 15.0173 6.11142 15.9742 5.29237 16.5776L4.10161 17.4566C4.54002 18.7044 5.2085 19.8585 6.07205 20.8587L7.41742 20.2682C8.34745 19.8613 9.41573 19.9215 10.2947 20.4292C11.174 20.937 11.7593 21.832 11.8738 22.84L11.8744 22.8445L12.0362 24.3088C13.3326 24.5638 14.6662 24.5638 15.9626 24.3088L16.1247 22.8418C16.1491 22.6217 16.1955 22.4055 16.263 22.1966Z</StreamGeometry>\n    </Style.Resources>\n  </Style>\n</Styles>\n"
  },
  {
    "path": "e2e/Avalonia/PrismAvaloniaDemo/ViewModels/DashboardViewModel.cs",
    "content": "using System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing Avalonia;\nusing Avalonia.Styling;\nusing Prism.Commands;\nusing SampleApp.Services;\n\nnamespace SampleApp.ViewModels;\n\npublic class DashboardViewModel : ViewModelBase\n{\n  private readonly INotificationService _notification;\n  private int _counter = 0;\n  private ObservableCollection<string> _listItems = new();\n  private int _listItemSelected = -1;\n  private string _listItemText = string.Empty;\n  private ThemeVariant? _themeSelected;\n\n  public DashboardViewModel(INotificationService notifyService)\n  {\n    _notification = notifyService;\n\n    ThemeSelected = Application.Current!.RequestedThemeVariant;\n  }\n\n  public DelegateCommand CmdAddItem => new(() =>\n  {\n    _counter++;\n    ListItems.Add($\"Item Number: {_counter}\");\n\n    // Optionally use, `Insert(0, ..)` to insert items at the top\n    //ListItems.Insert(0, entry);\n  });\n\n  public DelegateCommand CmdClearItems => new(() =>\n  {\n    ListItems.Clear();\n  });\n\n  public DelegateCommand CmdNotification => new(() =>\n  {\n    _notification.Show(\"Hello Prism!\", \"Notification Pop-up Message.\");\n\n    // Alternate OnClick action\n    ////_notification.Show(\"Hello Prism!\", \"Notification Pop-up Message.\", () =>\n    ////{\n    ////    // Action to perform\n    ////});\n  });\n\n  public ObservableCollection<string> ListItems { get => _listItems; set => SetProperty(ref _listItems, value); }\n\n  public int ListItemSelected\n  {\n    get => _listItemSelected;\n    set\n    {\n      SetProperty(ref _listItemSelected, value);\n\n      if (value == -1)\n        return;\n\n      ListItemText = ListItems[ListItemSelected];\n    }\n  }\n\n  public string ListItemText { get => _listItemText; set => SetProperty(ref _listItemText, value); }\n\n  public ThemeVariant? ThemeSelected\n  {\n    get => _themeSelected;\n    set\n    {\n      SetProperty(ref _themeSelected, value);\n      Application.Current!.RequestedThemeVariant = _themeSelected;\n    }\n  }\n\n  public List<ThemeVariant> ThemeStyles => new()\n  {\n      ThemeVariant.Default,\n      ThemeVariant.Dark,\n      ThemeVariant.Light,\n  };\n}\n"
  },
  {
    "path": "e2e/Avalonia/PrismAvaloniaDemo/ViewModels/MainWindowViewModel.cs",
    "content": "using Prism.Commands;\nusing Prism.Navigation.Regions;\n\nusing SampleApp.Views;\n\nnamespace SampleApp.ViewModels;\n\npublic class MainWindowViewModel : ViewModelBase\n{\n    private readonly IRegionManager _regionManager;\n    private bool _isPaneOpened;\n\n    public MainWindowViewModel(IRegionManager regionManager)\n    {\n        // Since this is a basic ShellWindow, there's not much to do here.\n        // For enterprise apps, you could register up subscriptions\n        // or other startup background tasks so that they get triggered\n        // on startup, rather than putting them in the DashboardViewModel.\n        //\n        // For example, initiate the pulling of News Feeds, etc.\n\n        _regionManager = regionManager;\n        Title = \"Sample Prism.Avalonia\";\n        IsPaneOpened = true;\n    }\n\n    public DelegateCommand CmdDashboard => new(() =>\n    {\n        // _journal.Clear();\n        _regionManager.RequestNavigate(RegionNames.ContentRegion, nameof(DashboardView));\n    });\n\n    public DelegateCommand CmdFlyoutMenu => new(() =>\n    {\n        IsPaneOpened = !IsPaneOpened;\n    });\n\n    public DelegateCommand CmdSettings => new(() => _regionManager.RequestNavigate(RegionNames.ContentRegion, nameof(SettingsView)));\n\n    public bool IsPaneOpened { get => _isPaneOpened; set => SetProperty(ref _isPaneOpened, value); }\n}\n"
  },
  {
    "path": "e2e/Avalonia/PrismAvaloniaDemo/ViewModels/SettingsViewModel.cs",
    "content": "using SampleApp.Views;\nusing Prism.Commands;\nusing Prism.Navigation;\nusing Prism.Navigation.Regions;\n\nnamespace SampleApp.ViewModels;\n\npublic class SettingsViewModel : ViewModelBase\n{\n    private readonly IRegionManager _regionManager;\n\n    public SettingsViewModel(IRegionManager regionManager)\n    {\n        _regionManager = regionManager;\n        Title = \"Settings\";\n    }\n\n    public DelegateCommand CmdNavigateToChild => new(() =>\n    {\n        var navParams = new NavigationParameters\n        {\n            { \"key1\", \"Some text\" },\n            { \"key2\", 999 }\n        };\n\n        _regionManager.RequestNavigate(\n            RegionNames.ContentRegion,\n            nameof(SubSettingsView),\n            navParams);\n    });\n\n    public override void OnNavigatedFrom(NavigationContext navigationContext)\n    {\n        base.OnNavigatedFrom(navigationContext);\n    }\n}\n"
  },
  {
    "path": "e2e/Avalonia/PrismAvaloniaDemo/ViewModels/SubSettingsViewModel.cs",
    "content": "using Prism.Commands;\nusing Prism.Navigation.Regions;\nusing SampleApp.Views;\n\nnamespace SampleApp.ViewModels;\n\npublic class SubSettingsViewModel : ViewModelBase\n{\n  private readonly IRegionManager _regionManager;\n  private IRegionNavigationJournal? _journal;\n  private string _messageNumber = string.Empty;\n  private string _messageText = string.Empty;\n\n  public SubSettingsViewModel(IRegionManager regionManager)\n  {\n    _regionManager = regionManager;\n\n    Title = \"Settings - SubView\";\n  }\n\n  public DelegateCommand CmdNavigateBack => new DelegateCommand(() =>\n  {\n    // Go back to the previous calling page, otherwise, Dashboard.\n    if (_journal != null && _journal.CanGoBack)\n      _journal.GoBack();\n    else\n      _regionManager.RequestNavigate(RegionNames.ContentRegion, nameof(DashboardView));\n  });\n\n  public string MessageNumber { get => _messageNumber; set => SetProperty(ref _messageNumber, value); }\n\n  public string MessageText { get => _messageText; set => SetProperty(ref _messageText, value); }\n\n  /// <summary>Navigation completed successfully.</summary>\n  /// <param name=\"navigationContext\">Navigation context.</param>\n  public override void OnNavigatedTo(NavigationContext navigationContext)\n  {\n    // Used to \"Go Back\" to parent\n    _journal = navigationContext.NavigationService.Journal;\n\n    // Display our parameters\n    MessageText = navigationContext.Parameters[\"key1\"].ToString() ?? \"\";\n    MessageNumber = navigationContext.Parameters[\"key2\"].ToString() ?? \"\";\n  }\n\n  public override bool OnNavigatingTo(NavigationContext navigationContext)\n  {\n    // Navigation permission sample:\n    // Don't allow navigation if our keys are missing\n    return navigationContext.Parameters.ContainsKey(\"key1\") &&\n           navigationContext.Parameters.ContainsKey(\"key2\");\n  }\n}\n"
  },
  {
    "path": "e2e/Avalonia/PrismAvaloniaDemo/ViewModels/ViewModelBase.cs",
    "content": "using Prism.Mvvm;\nusing Prism.Navigation.Regions;\n\nnamespace SampleApp.ViewModels;\n\npublic class ViewModelBase : BindableBase, INavigationAware\n{\n    private string _title = string.Empty;\n\n    /// <summary>Gets or sets the title of the View.</summary>\n    public string Title { get => _title; set => SetProperty(ref _title, value); }\n\n    /// <summary>\n    ///   Called to determine if this instance can handle the navigation request.\n    ///   Don't call this directly, use <seealso cref=\"OnNavigatingTo(NavigationContext)\"/>.\n    /// </summary>\n    /// <param name=\"navigationContext\">The navigation context.</param>\n    /// <returns><see langword=\"true\"/> if this instance accepts the navigation request; otherwise, <see langword=\"false\"/>.</returns>\n    public virtual bool IsNavigationTarget(NavigationContext navigationContext)\n    {\n        // Auto-allow navigation\n        return OnNavigatingTo(navigationContext);\n    }\n\n    /// <summary>Called when the implementer is being navigated away from.</summary>\n    /// <param name=\"navigationContext\">The navigation context.</param>\n    public virtual void OnNavigatedFrom(NavigationContext navigationContext)\n    {\n    }\n\n    /// <summary>Called when the implementer has been navigated to.</summary>\n    /// <param name=\"navigationContext\">The navigation context.</param>\n    public virtual void OnNavigatedTo(NavigationContext navigationContext)\n    {\n    }\n\n    /// <summary>Navigation validation checker.</summary>\n    /// <remarks>Override for Prism 7.2's IsNavigationTarget.</remarks>\n    /// <param name=\"navigationContext\">The navigation context.</param>\n    /// <returns><see langword=\"true\"/> if this instance accepts the navigation request; otherwise, <see langword=\"false\"/>.</returns>\n    public virtual bool OnNavigatingTo(NavigationContext navigationContext)\n    {\n        return true;\n    }\n}\n"
  },
  {
    "path": "e2e/Avalonia/PrismAvaloniaDemo/Views/DashboardView.axaml",
    "content": "﻿<UserControl xmlns=\"https://github.com/avaloniaui\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n             xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n             xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n             xmlns:prism=\"http://prismlibrary.com/\"\n             xmlns:system=\"clr-namespace:System;assembly=mscorlib\"\n             xmlns:vm=\"using:SampleApp.ViewModels\"\n             x:Class=\"SampleApp.Views.DashboardView\"\n             x:CompileBindings=\"True\"\n             x:DataType=\"vm:DashboardViewModel\"\n             d:DesignHeight=\"350\" d:DesignWidth=\"500\" mc:Ignorable=\"d\">\n  <UserControl.Styles>\n    <Style Selector=\"Button\">\n      <Setter Property=\"Padding\" Value=\"10\" />\n      <Setter Property=\"Margin\" Value=\"5\" />\n      <Setter Property=\"VerticalContentAlignment\" Value=\"Center\" />\n    </Style>\n\n    <Style Selector=\"StackPanel\">\n      <Setter Property=\"Margin\" Value=\"10\" />\n    </Style>\n  </UserControl.Styles>\n  <Grid RowDefinitions=\"auto,auto,auto,*\">\n    <Label Content=\"Welcome to the Dashboard!\" FontSize=\"32\" />\n\n    <StackPanel Grid.Row=\"1\" HorizontalAlignment=\"Center\" Orientation=\"Horizontal\">\n      <Button Content=\"Add Item\" Command=\"{Binding CmdAddItem}\" />\n      <Button Content=\"Clear\" Command=\"{Binding CmdClearItems}\" />\n      <Button Content=\"Notification Pop-up\" Command=\"{Binding CmdNotification}\" />\n\n      <ComboBox VerticalAlignment=\"Center\"\n                HorizontalAlignment=\"Stretch\"\n                ItemsSource=\"{Binding ThemeStyles}\"\n                SelectedItem=\"{Binding ThemeSelected}\">\n        <!--SelectedIndex=\"{Binding ThemeSelectedIndex}\" >-->\n        <ComboBox.ItemTemplate>\n          <DataTemplate x:DataType=\"x:String\">\n            <TextBlock Text=\"{Binding TargetNullValue=Unset}\" />\n          </DataTemplate>\n        </ComboBox.ItemTemplate>\n      </ComboBox>\n    </StackPanel>\n\n    <StackPanel Grid.Row=\"2\" Orientation=\"Horizontal\">\n      <Label Content=\"Selected Index:\" FontWeight=\"Bold\" />\n      <Label Content=\"{Binding ListItemSelected}\" />\n      <StackPanel Orientation=\"Horizontal\" />\n      <Label Content=\"Selected Text:\" FontWeight=\"Bold\" />\n      <Label Content=\"{Binding ListItemText}\" />\n    </StackPanel>\n\n    <ListBox Grid.Row=\"3\"\n             Margin=\"2\"\n             ItemsSource=\"{Binding ListItems}\"\n             ScrollViewer.HorizontalScrollBarVisibility=\"Visible\"\n             ScrollViewer.VerticalScrollBarVisibility=\"Visible\"\n             SelectedIndex=\"{Binding ListItemSelected}\"\n             SelectionMode=\"Single\">\n      <ListBox.ItemTemplate>\n        <!--\n          OLD: <DataTemplate>\n          NEW: <DataTemplate DataType=\"{x:Type system:String}\">\n          https://github.com/AvaloniaUI/Avalonia/pull/8221\n          -->\n        <DataTemplate DataType=\"{x:Type system:String}\">\n          <TextBlock Text=\"{Binding .}\"\n                     FontSize=\"10\"\n                     TextWrapping=\"NoWrap\" />\n        </DataTemplate>\n      </ListBox.ItemTemplate>\n    </ListBox>\n  </Grid>\n</UserControl>\n"
  },
  {
    "path": "e2e/Avalonia/PrismAvaloniaDemo/Views/DashboardView.axaml.cs",
    "content": "using Avalonia;\nusing Avalonia.Controls;\nusing Prism.Ioc;\nusing SampleApp.Services;\n\nnamespace SampleApp.Views;\n\n/// <summary>DashboardView.</summary>\npublic partial class DashboardView : UserControl\n{\n  public DashboardView()\n  {\n    InitializeComponent();\n  }\n\n  protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)\n  {\n    base.OnAttachedToVisualTree(e);\n\n    // Initialize the WindowNotificationManager with the \"TopLevel\". Previously (v0.10), MainWindow\n    var notifyService = ContainerLocator.Current.Resolve<INotificationService>();\n    notifyService.SetHostWindow(TopLevel.GetTopLevel(this));\n  }\n}\n"
  },
  {
    "path": "e2e/Avalonia/PrismAvaloniaDemo/Views/MainWindow.axaml",
    "content": "﻿<Window xmlns=\"https://github.com/avaloniaui\"\n        xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n        xmlns:core=\"clr-namespace:SampleApp;assembly=PrismAvaloniaDemo\"\n        xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n        xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n        xmlns:prism=\"http://prismlibrary.com/\"\n        xmlns:vm=\"clr-namespace:SampleApp.ViewModels\"\n        x:Class=\"SampleApp.Views.MainWindow\"\n        x:DataType=\"vm:MainWindowViewModel\"\n        prism:ViewModelLocator.AutoWireViewModel=\"True\"\n        Title=\"{Binding Title}\"\n        Width=\"800\"\n        Height=\"500\"\n        Background=\"Transparent\"\n        TransparencyLevelHint=\"AcrylicBlur\">\n  <Window.Styles>\n    <Style Selector=\"Button\">\n      <Setter Property=\"HorizontalAlignment\" Value=\"Stretch\" />\n    </Style>\n\n    <!-- Center the icons so that it is centered in the SplitView when it is collapsed. -->\n    <Style Selector=\"PathIcon\">\n      <Setter Property=\"Margin\" Value=\"5,0,15,0\" />\n    </Style>\n  </Window.Styles>\n\n  <Panel>\n    <ExperimentalAcrylicBorder IsHitTestVisible=\"true\">\n      <ExperimentalAcrylicBorder.Material>\n        <ExperimentalAcrylicMaterial BackgroundSource=\"Digger\"\n                                     MaterialOpacity=\"0.65\"\n                                     TintColor=\"LightGray\"\n                                     TintOpacity=\"1\" />\n      </ExperimentalAcrylicBorder.Material>\n    </ExperimentalAcrylicBorder>\n\n    <SplitView DisplayMode=\"CompactInline\"\n               IsPaneOpen=\"{Binding IsPaneOpened}\"\n               OpenPaneLength=\"200\">\n      <SplitView.Pane>\n        <!--\n          You may directly reference the user control when there is only one View, like so.\n          EX: `<views:SidebarView />`\n\n          Or, you can implement Prism RegionManager if the sidebar pane requires dynamic content.\n          EX: `<ContentControl prism:RegionManager.RegionName={x:Static core:RegionNames.ContentSidebar}\" />`\n\n          In this example, we are using the MainWindow's ViewModel to handle the SplitView collasping\n        -->\n\n        <DockPanel>\n\n          <!-- Dock the hamburger menu button to the top with no text -->\n          <Button Height=\"25\"\n                  HorizontalContentAlignment=\"Left\"\n                  Command=\"{Binding CmdFlyoutMenu}\"\n                  DockPanel.Dock=\"Top\"\n                  ToolTip.Tip=\"Expand/Collapse\">\n            <Button.Content>\n              <StackPanel Orientation=\"Horizontal\">\n                <PathIcon Data=\"{StaticResource Menu}\" />\n              </StackPanel>\n            </Button.Content>\n          </Button>\n\n          <!--\n          <Button DockPanel.Dock=\"Top\"\n                  Command=\"{Binding CmdFlyoutMenu}\"\n                  ToolTip.Tip=\"Expand/Collapse\"\n                  Height=\"25\">\n            <StackPanel Orientation=\"Horizontal\">\n              <PathIcon Data=\"{StaticResource MenuClose}\" />\n              <TextBlock Text=\"\" />\n            </StackPanel>\n          </Button>\n          -->\n\n          <!-- Dock the Settings button to the bottom -->\n          <Button Command=\"{Binding CmdSettings}\"\n                  DockPanel.Dock=\"Bottom\"\n                  ToolTip.Tip=\"Settings\">\n            <StackPanel Orientation=\"Horizontal\">\n              <PathIcon Data=\"{StaticResource settings_regular}\" />\n              <TextBlock Text=\"Navigation Sample\" />\n            </StackPanel>\n          </Button>\n\n          <ScrollViewer>\n            <StackPanel>\n              <Button Command=\"{Binding CmdDashboard}\" ToolTip.Tip=\"Dashboard\">\n                <StackPanel Orientation=\"Horizontal\">\n                  <PathIcon Data=\"{StaticResource home_regular}\" />\n                  <TextBlock Text=\"Dashboard\" />\n                </StackPanel>\n              </Button>\n\n              <!-- Place additional buttons here... -->\n              <Button Command=\"{Binding .}\" ToolTip.Tip=\"Dashboard\">\n                <StackPanel Orientation=\"Horizontal\">\n                  <PathIcon Data=\"{StaticResource lock_regular}\" />\n                  <TextBlock Text=\"Something Else\" />\n                </StackPanel>\n              </Button>\n            </StackPanel>\n          </ScrollViewer>\n        </DockPanel>\n      </SplitView.Pane>\n\n      <!-- Prism Region for page navigation and back/forward journaling -->\n      <ContentControl prism:RegionManager.RegionName=\"{x:Static core:RegionNames.ContentRegion}\" />\n    </SplitView>\n  </Panel>\n</Window>\n"
  },
  {
    "path": "e2e/Avalonia/PrismAvaloniaDemo/Views/MainWindow.axaml.cs",
    "content": "using Avalonia.Controls;\n\nnamespace SampleApp.Views;\n\n/// <summary>Main window view.</summary>\npublic partial class MainWindow : Window\n{\n    public MainWindow()\n    {\n        InitializeComponent();\n    }\n}\n"
  },
  {
    "path": "e2e/Avalonia/PrismAvaloniaDemo/Views/SettingsView.axaml",
    "content": "﻿<UserControl xmlns=\"https://github.com/avaloniaui\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n             xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n             xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n             xmlns:prism=\"http://prismlibrary.com/\"\n             xmlns:vm=\"clr-namespace:SampleApp.ViewModels\"\n             x:Class=\"SampleApp.Views.SettingsView\"\n             x:DataType=\"vm:SettingsViewModel\"\n             d:DesignHeight=\"350\"\n             d:DesignWidth=\"500\"\n             prism:ViewModelLocator.AutoWireViewModel=\"True\"\n             mc:Ignorable=\"d\">\n  <DockPanel>\n    <StackPanel DockPanel.Dock=\"Top\" Spacing=\"5\">\n      <Grid Background=\"LightGray\" ColumnDefinitions=\"Auto, *\">\n        <!--\n        <Button Content=\"Back\" Command=\"{Binding CmdNavigateBack}\" CornerRadius=\"10\">\n          <PathIcon Data=\"{StaticResource arrow_reply_regular}\" />\n        </Button>\n        -->\n        <TextBlock Text=\"{Binding Title}\"\n                   Grid.Column=\"1\"\n                   Margin=\"5\"\n                   VerticalAlignment=\"Center\"\n                   FontWeight=\"Bold\" />\n      </Grid>\n    </StackPanel>\n\n    <ScrollViewer Margin=\"5\">\n      <StackPanel>\n\n        <Label Content=\"Some content here for SettingsView\" FontSize=\"18\" />\n        <Button Command=\"{Binding CmdNavigateToChild}\" Content=\"Navigate using Journaling\" />\n      </StackPanel>\n    </ScrollViewer>\n  </DockPanel>\n</UserControl>\n"
  },
  {
    "path": "e2e/Avalonia/PrismAvaloniaDemo/Views/SettingsView.axaml.cs",
    "content": "using Avalonia.Controls;\n\nnamespace SampleApp.Views;\n\n/// <summary>Sample Settings View.</summary>\npublic partial class SettingsView : UserControl\n{\n    public SettingsView()\n    {\n        InitializeComponent();\n    }\n}\n"
  },
  {
    "path": "e2e/Avalonia/PrismAvaloniaDemo/Views/SubSettingsView.axaml",
    "content": "﻿<UserControl xmlns=\"https://github.com/avaloniaui\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n             xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n             xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n             xmlns:prism=\"http://prismlibrary.com/\"\n             xmlns:vm=\"clr-namespace:SampleApp.ViewModels\"\n             x:Class=\"SampleApp.Views.SubSettingsView\"\n             x:DataType=\"vm:SubSettingsViewModel\"\n             d:DesignHeight=\"350\"\n             d:DesignWidth=\"500\"\n             prism:ViewModelLocator.AutoWireViewModel=\"True\"\n             mc:Ignorable=\"d\">\n  <DockPanel>\n    <StackPanel DockPanel.Dock=\"Top\" Spacing=\"5\">\n      <Grid Background=\"LightGray\" ColumnDefinitions=\"Auto, *\">\n        <Button Command=\"{Binding CmdNavigateBack}\" CornerRadius=\"10\">\n          <PathIcon Data=\"{StaticResource arrow_reply_regular}\" />\n        </Button>\n        <TextBlock Text=\"{Binding Title}\"\n                   Grid.Column=\"1\"\n                   Margin=\"5\"\n                   VerticalAlignment=\"Center\"\n                   FontWeight=\"Bold\" />\n      </Grid>\n    </StackPanel>\n\n    <ScrollViewer Margin=\"5\">\n      <StackPanel>\n        <Label Content=\"Our passed-in parameters\" FontWeight=\"Bold\" />\n        <StackPanel Orientation=\"Horizontal\">\n          <Label Content=\"Key 1 - Text:\" />\n          <Label Content=\"{Binding MessageText}\" />\n        </StackPanel>\n\n        <StackPanel Orientation=\"Horizontal\">\n          <Label Content=\"Key 2 - Number:\" />\n          <Label Content=\"{Binding MessageNumber}\" />\n        </StackPanel>\n      </StackPanel>\n    </ScrollViewer>\n  </DockPanel>\n</UserControl>\n"
  },
  {
    "path": "e2e/Avalonia/PrismAvaloniaDemo/Views/SubSettingsView.axaml.cs",
    "content": "using Avalonia.Controls;\n\nnamespace SampleApp.Views;\n\npublic partial class SubSettingsView : UserControl\n{\n  public SubSettingsView()\n  {\n    InitializeComponent();\n  }\n}\n"
  },
  {
    "path": "e2e/Avalonia/PrismAvaloniaDemo/app.manifest",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<assembly manifestVersion=\"1.0\" xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n  <!-- This manifest is used on Windows only.\n       Don't remove it as it might cause problems with window transparency and embedded controls.\n       For more details visit https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests -->\n  <assemblyIdentity version=\"1.0.0.0\" name=\"SampleApp.Desktop\"/>\n\n  <compatibility xmlns=\"urn:schemas-microsoft-com:compatibility.v1\">\n    <application>\n      <!-- A list of the Windows versions that this application has been tested on\n           and is designed to work with. Uncomment the appropriate elements\n           and Windows will automatically select the most compatible environment. -->\n\n      <!-- Windows 10 -->\n      <supportedOS Id=\"{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}\" />\n    </application>\n  </compatibility>\n</assembly>\n"
  },
  {
    "path": "e2e/Avalonia/PrismAvaloniaDemo/settings.XamlStyler",
    "content": "﻿{\n  \"AttributesTolerance\": 2,\n  \"KeepFirstAttributeOnSameLine\": true,\n  \"MaxAttributeCharactersPerLine\": 0,\n  \"MaxAttributesPerLine\": 1,\n  \"NewlineExemptionElements\": \"RadialGradientBrush, GradientStop, LinearGradientBrush, ScaleTransfom, SkewTransform, RotateTransform, TranslateTransform, Trigger, Condition, Setter\",\n  \"SeparateByGroups\": false,\n  \"AttributeIndentation\": 0,\n  \"AttributeIndentationStyle\": 1,\n  \"RemoveDesignTimeReferences\": false,\n  \"EnableAttributeReordering\": true,\n  \"AttributeOrderingRuleGroups\": [\n    \"xmlns, xmlns:x\",\n    \"xmlns:*\",\n    \"x:Class\",\n    \"x:*\",\n    \"*:*\",\n    \"Key, Name, Uid, Title, Text\",\n    \"Grid.Row, Grid.RowSpan, Grid.Column, Grid.ColumnSpan, Canvas.Left, Canvas.Top, Canvas.Right, Canvas.Bottom\",\n    \"Width, Height, MinWidth, MinHeight, MaxWidth, MaxHeight\",\n    \"Margin, Padding, HorizontalAlignment, VerticalAlignment, HorizontalContentAlignment, VerticalContentAlignment, Panel.ZIndex\",\n    \"Source\",\n    \"*\",\n    \"PageSource, PageIndex, Offset, Color, TargetName, Property, Value, StartPoint, EndPoint\",\n    \"mc:Ignorable, d:IsDataSource, d:LayoutOverrides, d:IsStaticText\",\n    \"Storyboard.*, From, To, Duration\"\n  ],\n  \"FirstLineAttributes\": \"Text\",\n  \"OrderAttributesByName\": true,\n  \"PutEndingBracketOnNewLine\": false,\n  \"RemoveEndingTagOfEmptyElement\": true,\n  \"SpaceBeforeClosingSlash\": true,\n  \"RootElementLineBreakRule\": 0,\n  \"ReorderVSM\": 2,\n  \"ReorderGridChildren\": false,\n  \"ReorderCanvasChildren\": false,\n  \"ReorderSetters\": 0,\n  \"FormatMarkupExtension\": true,\n  \"NoNewLineMarkupExtensions\": \"x:Bind, Binding\",\n  \"ThicknessSeparator\": 2,\n  \"ThicknessAttributes\": \"Margin, Padding, BorderThickness, ThumbnailClipMargin\",\n  \"FormatOnSave\": true,\n  \"CommentPadding\": 1\n}"
  },
  {
    "path": "e2e/Avalonia/PrismAvaloniaDemo.sln",
    "content": "﻿\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio Version 17\nVisualStudioVersion = 17.10.35122.118\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"PrismAvaloniaDemo\", \"PrismAvaloniaDemo\\PrismAvaloniaDemo.csproj\", \"{89EF9B20-B80E-4B4C-A202-170CC0C0B62A}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"Prism Library\", \"Prism Library\", \"{7EEF2BF7-98F5-432B-B36D-DB4915CF4A3D}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Prism.Avalonia\", \"..\\..\\src\\Avalonia\\Prism.Avalonia\\Prism.Avalonia.csproj\", \"{CD50461C-B394-433A-86CA-3DBCD13E8B22}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Prism.DryIoc.Avalonia\", \"..\\..\\src\\Avalonia\\Prism.DryIoc.Avalonia\\Prism.DryIoc.Avalonia.csproj\", \"{FF15E73E-5D71-48DD-80D5-DDCA6A59A6B2}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Prism.Core\", \"..\\..\\src\\Prism.Core\\Prism.Core.csproj\", \"{62ADE0CF-751D-4AC6-9C2C-21DC12CBD338}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Prism.Events\", \"..\\..\\src\\Prism.Events\\Prism.Events.csproj\", \"{FE27B57B-F986-44B7-90CE-421034A891B9}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Any CPU = Debug|Any CPU\n\t\tRelease|Any CPU = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{89EF9B20-B80E-4B4C-A202-170CC0C0B62A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{89EF9B20-B80E-4B4C-A202-170CC0C0B62A}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{89EF9B20-B80E-4B4C-A202-170CC0C0B62A}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{89EF9B20-B80E-4B4C-A202-170CC0C0B62A}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{CD50461C-B394-433A-86CA-3DBCD13E8B22}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{CD50461C-B394-433A-86CA-3DBCD13E8B22}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{CD50461C-B394-433A-86CA-3DBCD13E8B22}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{CD50461C-B394-433A-86CA-3DBCD13E8B22}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{FF15E73E-5D71-48DD-80D5-DDCA6A59A6B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{FF15E73E-5D71-48DD-80D5-DDCA6A59A6B2}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{FF15E73E-5D71-48DD-80D5-DDCA6A59A6B2}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{FF15E73E-5D71-48DD-80D5-DDCA6A59A6B2}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{62ADE0CF-751D-4AC6-9C2C-21DC12CBD338}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{62ADE0CF-751D-4AC6-9C2C-21DC12CBD338}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{62ADE0CF-751D-4AC6-9C2C-21DC12CBD338}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{62ADE0CF-751D-4AC6-9C2C-21DC12CBD338}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{FE27B57B-F986-44B7-90CE-421034A891B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{FE27B57B-F986-44B7-90CE-421034A891B9}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{FE27B57B-F986-44B7-90CE-421034A891B9}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{FE27B57B-F986-44B7-90CE-421034A891B9}.Release|Any CPU.Build.0 = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\n\tGlobalSection(NestedProjects) = preSolution\n\t\t{CD50461C-B394-433A-86CA-3DBCD13E8B22} = {7EEF2BF7-98F5-432B-B36D-DB4915CF4A3D}\n\t\t{FF15E73E-5D71-48DD-80D5-DDCA6A59A6B2} = {7EEF2BF7-98F5-432B-B36D-DB4915CF4A3D}\n\t\t{62ADE0CF-751D-4AC6-9C2C-21DC12CBD338} = {7EEF2BF7-98F5-432B-B36D-DB4915CF4A3D}\n\t\t{FE27B57B-F986-44B7-90CE-421034A891B9} = {7EEF2BF7-98F5-432B-B36D-DB4915CF4A3D}\n\tEndGlobalSection\n\tGlobalSection(ExtensibilityGlobals) = postSolution\n\t\tSolutionGuid = {2E70249F-C31B-4FB3-A901-E3767E3A9FF5}\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "e2e/Maui/Directory.Build.props",
    "content": "<Project>\n  <PropertyGroup>\n    <ImplicitUsings>enable</ImplicitUsings>\n    <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>\n  </PropertyGroup>\n</Project>\n"
  },
  {
    "path": "e2e/Maui/Directory.Build.targets",
    "content": "<Project>\n  <Import Project=\"..\\..\\src\\Prism.Core\\build\\Package.targets\" />\n  <Import Project=\"..\\..\\src\\Prism.Events\\build\\Package.targets\" />\n  <Import Project=\"..\\..\\src\\Maui\\Prism.Maui\\build\\Package.targets\" />\n</Project>\n"
  },
  {
    "path": "e2e/Maui/MauiModule/Dialogs/LoginDialog.xaml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<Grid xmlns=\"http://schemas.microsoft.com/dotnet/2021/maui\"\n      xmlns:x=\"http://schemas.microsoft.com/winfx/2009/xaml\"\n      xmlns:vm=\"clr-namespace:MauiModule.ViewModels\"\n      xmlns:prism=\"http://prismlibrary.com\"\n      prism:DialogLayout.RelativeHeightRequest=\"0.5\"\n      prism:DialogLayout.RelativeWidthRequest=\"0.8\"\n      x:DataType=\"vm:LoginViewModel\"\n      BackgroundColor=\"White\"\n      RowDefinitions=\"Auto,*\"\n      x:Class=\"MauiModule.Dialogs.LoginDialog\">\n  <BoxView Color=\"Black\" />\n  <Label Text=\"{Binding Title}\"\n         HorizontalTextAlignment=\"Center\"\n         TextColor=\"White\"\n         Margin=\"0,8\" />\n  <VerticalStackLayout Grid.Row=\"1\"\n                       Padding=\"10,3,10,10\">\n    <Label Text=\"Enter your name\" />\n    <Entry Text=\"{Binding Name}\"\n           Placeholder=\"John Doe\"\n           WidthRequest=\"200\"\n           PlaceholderColor=\"LightGray\" />\n    <Button Text=\"Submit\"\n            HorizontalOptions=\"Center\"\n            Command=\"{Binding LoginCommand}\" />\n  </VerticalStackLayout>\n</Grid>\n"
  },
  {
    "path": "e2e/Maui/MauiModule/Dialogs/LoginDialog.xaml.cs",
    "content": "namespace MauiModule.Dialogs;\n\npublic partial class LoginDialog : Grid\n{\n    public LoginDialog()\n    {\n        InitializeComponent();\n    }\n}"
  },
  {
    "path": "e2e/Maui/MauiModule/MauiAppModule.cs",
    "content": "﻿using MauiModule.Dialogs;\nusing MauiModule.ViewModels;\nusing MauiModule.Views;\n\nnamespace MauiModule\n{\n    // All the code in this file is included in all platforms.\n    public class MauiAppModule : IModule\n    {\n        public void OnInitialized(IContainerProvider containerProvider)\n        {\n\n        }\n\n        public void RegisterTypes(IContainerRegistry containerRegistry)\n        {\n            containerRegistry.RegisterDialog<LoginDialog, LoginViewModel>();\n            containerRegistry.RegisterForNavigation<ViewA, ViewAViewModel>();\n            containerRegistry.RegisterForNavigation<ViewB, ViewBViewModel>();\n            containerRegistry.RegisterForNavigation<ViewC, ViewCViewModel>();\n            containerRegistry.RegisterForNavigation<ViewD, ViewDViewModel>();\n        }\n    }\n}"
  },
  {
    "path": "e2e/Maui/MauiModule/MauiModule.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFramework>net10.0</TargetFramework>\n    <GeneratePackageOnBuild>false</GeneratePackageOnBuild>\n    <UseMaui>true</UseMaui>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Microsoft.Maui.Controls\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\..\\src\\Maui\\Prism.Maui\\Prism.Maui.csproj\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "e2e/Maui/MauiModule/ViewModels/BaseServices.cs",
    "content": "﻿namespace MauiModule.ViewModels;\n\npublic class BaseServices\n{\n    public BaseServices(\n        INavigationService navigationService,\n        IPageDialogService pageDialogs,\n        IDialogService dialogService,\n        IDialogViewRegistry dialogRegistry)\n    {\n        NavigationService = navigationService;\n        PageDialogs = pageDialogs;\n        Dialogs = dialogService;\n        DialogRegistry = dialogRegistry;\n    }\n\n    public INavigationService NavigationService { get; }\n    public IPageDialogService PageDialogs { get; }\n    public IDialogService Dialogs { get; }\n    public IDialogViewRegistry DialogRegistry { get; }\n}\n"
  },
  {
    "path": "e2e/Maui/MauiModule/ViewModels/LoginViewModel.cs",
    "content": "﻿namespace MauiModule.ViewModels;\n\npublic class LoginViewModel : BindableBase, IDialogAware\n{\n    private bool _canClose;\n\n    public LoginViewModel()\n    {\n        LoginCommand = new DelegateCommand(OnLoginCommandExecuted);\n    }\n\n    public string Title => \"What's your name?\";\n\n    private string _name;\n    public string Name\n    {\n        get => _name;\n        set => SetProperty(ref _name, value);\n    }\n\n    public DelegateCommand LoginCommand { get; }\n\n    public DialogCloseListener RequestClose { get; }\n\n    public bool CanCloseDialog() => _canClose;\n\n    public void OnDialogClosed()\n    {\n    }\n\n    public void OnDialogOpened(IDialogParameters parameters)\n    {\n    }\n\n    private void OnLoginCommandExecuted()\n    {\n        _canClose = true;\n        RequestClose.Invoke();\n    }\n}\n"
  },
  {
    "path": "e2e/Maui/MauiModule/ViewModels/ViewAViewModel.cs",
    "content": "\nnamespace MauiModule.ViewModels;\n\npublic class ViewAViewModel : ViewModelBase\n{\n    public ViewAViewModel(BaseServices baseServices) \n        : base(baseServices)\n    {\n    }\n\n    public bool CanNavigateResult { get; set; }\n\n    public override bool CanNavigate(INavigationParameters parameters)\n    {\n        return CanNavigateResult;\n    }\n}\n"
  },
  {
    "path": "e2e/Maui/MauiModule/ViewModels/ViewBViewModel.cs",
    "content": "﻿namespace MauiModule.ViewModels;\n\npublic class ViewBViewModel : ViewModelBase\n{\n    public ViewBViewModel(BaseServices baseServices) \n        : base(baseServices)\n    {\n    }\n}\n"
  },
  {
    "path": "e2e/Maui/MauiModule/ViewModels/ViewCViewModel.cs",
    "content": "﻿namespace MauiModule.ViewModels;\n\npublic class ViewCViewModel : ViewModelBase\n{\n    public ViewCViewModel(BaseServices baseServices) \n        : base(baseServices)\n    {\n    }\n}\n"
  },
  {
    "path": "e2e/Maui/MauiModule/ViewModels/ViewDViewModel.cs",
    "content": "﻿namespace MauiModule.ViewModels;\n\npublic class ViewDViewModel : ViewModelBase\n{\n    public ViewDViewModel(BaseServices baseServices) \n        : base(baseServices)\n    {\n    }\n}\n"
  },
  {
    "path": "e2e/Maui/MauiModule/ViewModels/ViewModelBase.cs",
    "content": "using System.Collections.ObjectModel;\nusing System.Text.RegularExpressions;\n\nnamespace MauiModule.ViewModels;\n\npublic abstract class ViewModelBase : BindableBase, IInitialize, INavigatedAware, IPageLifecycleAware, IConfirmNavigation\n{\n    protected INavigationService _navigationService { get; }\n    protected IPageDialogService _pageDialogs { get; }\n    protected IDialogService _dialogs { get; }\n\n    protected ViewModelBase(BaseServices baseServices)\n    {\n        _navigationService = baseServices.NavigationService;\n        _pageDialogs = baseServices.PageDialogs;\n        _dialogs = baseServices.Dialogs;\n        Title = Regex.Replace(GetType().Name, \"ViewModel\", string.Empty);\n        Id = Guid.NewGuid().ToString();\n        NavigateCommand = new DelegateCommand<string>(OnNavigateCommandExecuted);\n        ShowPageDialog = new DelegateCommand(OnShowPageDialog);\n        Messages = new ObservableCollection<string>();\n        Messages.CollectionChanged += (sender, args) =>\n        {\n            foreach (string message in args.NewItems)\n                Console.WriteLine($\"{Title} - {message}\");\n        };\n\n        AvailableDialogs = baseServices.DialogRegistry.Registrations.Select(x => x.Name).ToList();\n        SelectedDialog = AvailableDialogs.FirstOrDefault();\n        ShowDialog = new DelegateCommand(OnShowDialogCommand, () => !string.IsNullOrEmpty(SelectedDialog))\n            .ObservesProperty(() => SelectedDialog);\n        GoBack = new DelegateCommand<string>(OnGoToBack);\n    }\n\n    public IEnumerable<string> AvailableDialogs { get; }\n\n    public string Title { get; }\n\n    public string Id { get; }\n\n    private string _selectedDialog;\n    public string SelectedDialog\n    {\n        get => _selectedDialog;\n        set => SetProperty(ref _selectedDialog, value);\n    }\n\n    public ObservableCollection<string> Messages { get; }\n\n    public DelegateCommand<string> NavigateCommand { get; }\n\n    public DelegateCommand ShowPageDialog { get; }\n\n    public DelegateCommand ShowDialog { get; }\n\n    public DelegateCommand<string> GoBack { get; }\n\n    private void OnNavigateCommandExecuted(string uri)\n    {\n        Messages.Add($\"OnNavigateCommandExecuted: {uri}\");\n        _navigationService.NavigateAsync(uri)\n            .OnNavigationError(ex => Console.WriteLine(ex));\n    }\n\n    private void OnShowPageDialog()\n    {\n        Messages.Add(\"OnShowPageDialog\");\n        _pageDialogs.DisplayAlertAsync(\"Message\", $\"Hello from {Title}. This is a Page Dialog Service Alert!\", \"Ok\");\n    }\n\n    private void OnShowDialogCommand()\n    {\n        Messages.Add(\"OnShowDialog\");\n        _dialogs.ShowDialog(SelectedDialog, null, DialogCallback);\n    }\n\n    private void DialogCallback(IDialogResult result) =>\n        Messages.Add(\"Dialog Closed\");\n\n    private void OnGoToBack(string viewName)\n    {\n        Messages.Add($\"On Go Back {viewName}\");\n        _navigationService.GoBackToAsync(viewName);\n    }\n\n    public void Initialize(INavigationParameters parameters)\n    {\n        Messages.Add(\"ViewModel Initialized\");\n        foreach (var parameter in parameters.Where(x => x.Key.Contains(\"message\")))\n            Messages.Add(parameter.Value.ToString());\n    }\n\n    public virtual void OnNavigatedFrom(INavigationParameters parameters)\n    {\n        Messages.Add(\"ViewModel NavigatedFrom\");\n    }\n\n    public void OnNavigatedTo(INavigationParameters parameters)\n    {\n        Messages.Add(\"ViewModel NavigatedTo\");\n    }\n\n    public void OnAppearing()\n    {\n        Messages.Add(\"View Appearing\");\n    }\n\n    public void OnDisappearing()\n    {\n        Messages.Add(\"View Disappearing\");\n    }\n\n    public virtual bool CanNavigate(INavigationParameters parameters)\n    {\n        Messages.Add(\"Can Navigate\");\n        return true;\n    }\n}\n"
  },
  {
    "path": "e2e/Maui/MauiModule/Views/ViewA.xaml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<ContentPage xmlns=\"http://schemas.microsoft.com/dotnet/2021/maui\"\n             xmlns:prism=\"http://prismlibrary.com\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2009/xaml\"\n             x:Class=\"MauiModule.Views.ViewA\"\n             Title=\"{Binding Title}\"\n             IconImageSource=\"home.png\"\n             BackgroundColor=\"White\">\n  <Grid RowDefinitions=\"*,Auto\"\n        ColumnDefinitions=\"*,*\">\n    \n    <CollectionView ItemsSource=\"{Binding Messages}\"\n                    Grid.ColumnSpan=\"2\">\n      <CollectionView.Header>\n        <StackLayout Padding=\"0,20,0,0\">\n          <Label Text=\"{Binding Title, StringFormat='Page: {0}'}\"\n                 FontSize=\"Large\"\n                 FontAttributes=\"Bold\"\n                 HorizontalTextAlignment=\"Center\"/>\n          <Label Text=\"Prism for .NET MAUI!\"\n                   HorizontalTextAlignment=\"Center\"\n                   Padding=\"0,0,0,20\"/>\n          <StackLayout Orientation=\"Horizontal\" >\n            <Label Text=\"Can Navigate Result:\"/>\n            <CheckBox IsChecked=\"{Binding CanNavigateResult}\" />\n          </StackLayout>\n          \n          <Label Text=\"Navigation Events:\"\n                 FontAttributes=\"Bold\"\n                 Padding=\"10,0\"/>\n        </StackLayout>\n      </CollectionView.Header>\n      <CollectionView.ItemTemplate>\n        <DataTemplate>\n          <Label Text=\"{Binding .}\"\n                 Padding=\"20,5\"/>\n        </DataTemplate>\n      </CollectionView.ItemTemplate>\n    </CollectionView>\n\n    <Button Text=\"ViewB\"\n            Command=\"{prism:NavigateTo 'ViewB'}\"\n            Margin=\"10\"\n            Grid.Row=\"1\">\n      <Button.CommandParameter>\n        <prism:Parameter Key=\"Message\" Value=\"Hi from View A!\"/>\n      </Button.CommandParameter>\n    </Button>\n    <Button Text=\"Show Alert Dialog\"\n            Command=\"{Binding ShowPageDialog}\"\n            Margin=\"10\"\n            Grid.Row=\"1\"\n            Grid.Column=\"1\"/>\n  </Grid>\n</ContentPage>\n"
  },
  {
    "path": "e2e/Maui/MauiModule/Views/ViewA.xaml.cs",
    "content": "namespace MauiModule.Views;\n\npublic partial class ViewA : ContentPage\n{\n    public ViewA()\n    {\n        InitializeComponent();\n    }\n}"
  },
  {
    "path": "e2e/Maui/MauiModule/Views/ViewB.xaml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<ContentPage xmlns=\"http://schemas.microsoft.com/dotnet/2021/maui\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2009/xaml\"\n             xmlns:prism=\"http://prismlibrary.com\"\n             prism:DynamicTab.Title=\"Tab B\"\n             prism:DynamicTab.IconImageSource=\"profile.png\"\n             x:Class=\"MauiModule.Views.ViewB\"\n             Title=\"{Binding Title}\"\n             IconImageSource=\"home.png\"\n             BackgroundColor=\"White\">\n  <Grid RowDefinitions=\"*,Auto\"\n        ColumnDefinitions=\"*,*\">\n    <CollectionView ItemsSource=\"{Binding Messages}\"\n                    Grid.ColumnSpan=\"2\">\n      <CollectionView.Header>\n        <StackLayout Padding=\"0,20,0,0\">\n          <Label Text=\"{Binding Title, StringFormat='Page: {0}'}\"\n                 FontSize=\"Large\"\n                 FontAttributes=\"Bold\"\n                 HorizontalTextAlignment=\"Center\"/>\n          <Label Text=\"Prism for .NET MAUI!\"\n                   HorizontalTextAlignment=\"Center\"\n                   Padding=\"0,0,0,20\"/>\n          <Label Text=\"Navigation Events:\"\n                 FontAttributes=\"Bold\"\n                 Padding=\"10,0\"/>\n        </StackLayout>\n      </CollectionView.Header>\n      <CollectionView.ItemTemplate>\n        <DataTemplate>\n          <Label Text=\"{Binding .}\"\n                 Padding=\"20,5\"/>\n        </DataTemplate>\n      </CollectionView.ItemTemplate>\n    </CollectionView>\n\n    <Button Text=\"ViewC\"\n            Command=\"{Binding NavigateCommand}\"\n            CommandParameter=\"ViewC\"\n            Margin=\"10\"\n            Grid.Row=\"1\" />\n    <Button Text=\"Show Alert Dialog\"\n            Command=\"{Binding ShowPageDialog}\"\n            Margin=\"10\"\n            Grid.Row=\"1\"\n            Grid.Column=\"1\"/>\n  </Grid>\n</ContentPage>\n"
  },
  {
    "path": "e2e/Maui/MauiModule/Views/ViewB.xaml.cs",
    "content": "namespace MauiModule.Views;\n\npublic partial class ViewB : ContentPage\n{\n    public ViewB()\n    {\n        InitializeComponent();\n    }\n}"
  },
  {
    "path": "e2e/Maui/MauiModule/Views/ViewC.xaml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<ContentPage xmlns=\"http://schemas.microsoft.com/dotnet/2021/maui\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2009/xaml\"\n             x:Class=\"MauiModule.Views.ViewC\"\n             Title=\"{Binding Title}\"\n             IconImageSource=\"setting.png\"\n             BackgroundColor=\"White\">\n  <Grid RowDefinitions=\"*,Auto\"\n        ColumnDefinitions=\"*,*\">\n    <CollectionView ItemsSource=\"{Binding Messages}\"\n                    Grid.ColumnSpan=\"2\">\n      <CollectionView.Header>\n        <StackLayout Padding=\"0,20,0,0\">\n          <Label Text=\"{Binding Title, StringFormat='Page: {0}'}\"\n                 FontSize=\"Large\"\n                 FontAttributes=\"Bold\"\n                 HorizontalTextAlignment=\"Center\"/>\n          <Label Text=\"Prism for .NET MAUI!\"\n                   HorizontalTextAlignment=\"Center\"\n                   Padding=\"0,0,0,20\"/>\n          <Label Text=\"Navigation Events:\"\n                 FontAttributes=\"Bold\"\n                 Padding=\"10,0\"/>\n        </StackLayout>\n      </CollectionView.Header>\n      <CollectionView.ItemTemplate>\n        <DataTemplate>\n          <Label Text=\"{Binding .}\"\n                 Padding=\"20,5\"/>\n        </DataTemplate>\n      </CollectionView.ItemTemplate>\n    </CollectionView>\n\n    <Button Text=\"ViewD\"\n            Command=\"{Binding NavigateCommand}\"\n            CommandParameter=\"ViewD\"\n            Margin=\"10\"\n            Grid.Row=\"1\" />\n    <Button Text=\"Show Alert Dialog\"\n            Command=\"{Binding ShowPageDialog}\"\n            Margin=\"10\"\n            Grid.Row=\"1\"\n            Grid.Column=\"1\"/>\n  </Grid>\n</ContentPage>\n"
  },
  {
    "path": "e2e/Maui/MauiModule/Views/ViewC.xaml.cs",
    "content": "namespace MauiModule.Views;\n\npublic partial class ViewC : ContentPage\n{\n    public ViewC()\n    {\n        InitializeComponent();\n    }\n}"
  },
  {
    "path": "e2e/Maui/MauiModule/Views/ViewD.xaml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<ContentPage xmlns=\"http://schemas.microsoft.com/dotnet/2021/maui\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2009/xaml\"\n             xmlns:loc=\"clr-namespace:MauiModule.ViewModels\"\n             xmlns:prism=\"http://prismlibrary.com\"\n             x:Class=\"MauiModule.Views.ViewD\"\n             x:DataType=\"loc:ViewModelBase\"\n             Title=\"{Binding Title}\"\n             BackgroundColor=\"White\">\n  <Grid RowDefinitions=\"*,Auto,Auto,Auto,Auto\"\n        ColumnDefinitions=\"*,*\">\n    <CollectionView ItemsSource=\"{Binding Messages}\"\n                    Grid.ColumnSpan=\"2\">\n      <CollectionView.Header>\n        <StackLayout Padding=\"0,20,0,0\">\n          <Label Text=\"{Binding Title, StringFormat='Page: {0}'}\"\n                 FontSize=\"Large\"\n                 FontAttributes=\"Bold\"\n                 HorizontalTextAlignment=\"Center\"/>\n          <Label Text=\"Prism for .NET MAUI!\"\n                   HorizontalTextAlignment=\"Center\"\n                   Padding=\"0,0,0,20\"/>\n          <Label Text=\"Navigation Events:\"\n                 FontAttributes=\"Bold\"\n                 Padding=\"10,0\"/>\n        </StackLayout>\n      </CollectionView.Header>\n      <CollectionView.ItemTemplate>\n        <DataTemplate>\n          <Label Text=\"{Binding .}\"\n                 Padding=\"20,5\"/>\n        </DataTemplate>\n      </CollectionView.ItemTemplate>\n    </CollectionView>\n\n    <Picker ItemsSource=\"{Binding AvailableDialogs}\"\n            SelectedItem=\"{Binding SelectedDialog}\"\n            BackgroundColor=\"White\"\n            Margin=\"10\"\n            Grid.Row=\"1\"\n            Grid.ColumnSpan=\"2\" />\n    <Button Text=\"Go Back\"\n            Command=\"{prism:GoBack}\"\n            Margin=\"10\"\n            Grid.Row=\"2\" />\n    <Button Text=\"Show Dialog\"\n            Command=\"{Binding ShowDialog}\"\n            Margin=\"10\"\n            Grid.Row=\"2\"\n            Grid.Column=\"1\"/>\n    <Button Text=\"Go Back To Root\"\n            Command=\"{prism:GoBack GoBackType=ToRoot}\"\n            Margin=\"10\"\n            Grid.Row=\"3\"/>\n    <Button Text=\"Show Alert Dialog\"\n            Command=\"{Binding ShowPageDialog}\"\n            Margin=\"10\"\n            Grid.Row=\"3\"\n            Grid.Column=\"1\"/>\n    <Button Text=\"Go Back View B\"\n            Command=\"{Binding GoBack}\"\n            CommandParameter=\"ViewB\"\n            Margin=\"10\"\n            Grid.Row=\"4\"\n            Grid.Column=\"0\"/>\n  </Grid>\n</ContentPage>\n"
  },
  {
    "path": "e2e/Maui/MauiModule/Views/ViewD.xaml.cs",
    "content": "namespace MauiModule.Views;\n\npublic partial class ViewD : ContentPage\n{\n    public ViewD()\n    {\n        InitializeComponent();\n    }\n}"
  },
  {
    "path": "e2e/Maui/MauiRegionsModule/MauiRegionsModule.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFramework>net10.0</TargetFramework>\n    <GeneratePackageOnBuild>false</GeneratePackageOnBuild>\n    <UseMaui>true</UseMaui>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Microsoft.Maui.Controls\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\..\\src\\Maui\\Prism.Maui\\Prism.Maui.csproj\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "e2e/Maui/MauiRegionsModule/MauiTestRegionsModule.cs",
    "content": "﻿using MauiRegionsModule.ViewModels;\nusing MauiRegionsModule.Views;\n\nnamespace MauiRegionsModule;\n\npublic class MauiTestRegionsModule : IModule\n{\n    public void OnInitialized(IContainerProvider containerProvider)\n    {\n        var regionManager = containerProvider.Resolve<IRegionManager>();\n        regionManager.RegisterViewWithRegion<RegionViewA>(\"ContentRegion\");\n    }\n\n    public void RegisterTypes(IContainerRegistry containerRegistry)\n    {\n        containerRegistry\n            .RegisterForNavigation<ContentRegionPage>()\n            .RegisterForNavigation<RegionHome, RegionHomeViewModel>()\n            .RegisterForNavigation<DefaultViewNamedPage>()\n            .RegisterForNavigation<DefaultViewInstancePage>()\n            .RegisterForNavigation<DefaultViewTypePage>()\n            .RegisterForRegionNavigation<RegionViewA, RegionViewAViewModel>()\n            .RegisterForRegionNavigation<RegionViewB, RegionViewBViewModel>()\n            .RegisterForRegionNavigation<RegionViewC, RegionViewCViewModel>();\n    }\n}\n"
  },
  {
    "path": "e2e/Maui/MauiRegionsModule/ViewModels/ContentRegionPageViewModel.cs",
    "content": "﻿namespace MauiRegionsModule.ViewModels;\n\npublic class ContentRegionPageViewModel : IInitialize\n{\n    private IRegionManager _regionManager { get; }\n    private int _count;\n\n    public ContentRegionPageViewModel(IRegionManager regionManager)\n    {\n        _regionManager = regionManager;\n        NavigateCommand = new DelegateCommand<string>(OnNavigateCommandExecuted);\n    }\n\n    public void Initialize(INavigationParameters parameters)\n    {\n        //_regionManager.RequestNavigate(\"ContentRegion\", \"RegionViewA\");\n    }\n\n    public DelegateCommand<string> NavigateCommand { get; }\n\n    private void OnNavigateCommandExecuted(string uri)\n    {\n        var message = $\"Hello from Content Region Page ({_count++})\";\n        _regionManager.RequestNavigate(\"ContentRegion\", uri, new NavigationParameters { { \"Message\", message } });\n    }\n}\n"
  },
  {
    "path": "e2e/Maui/MauiRegionsModule/ViewModels/RegionHomeViewModel.cs",
    "content": "﻿namespace MauiRegionsModule.ViewModels;\n\ninternal class RegionHomeViewModel\n{\n    private INavigationService _navigationService { get; }\n\n    public RegionHomeViewModel(INavigationService navigationService)\n    {\n        _navigationService = navigationService;\n        NavigateCommand = new DelegateCommand<string>(OnNavigateCommandExecuted);\n    }\n\n    public DelegateCommand<string> NavigateCommand { get; }\n\n    private void OnNavigateCommandExecuted(string uri)\n    {\n        _navigationService.NavigateAsync(uri);\n    }\n}\n"
  },
  {
    "path": "e2e/Maui/MauiRegionsModule/ViewModels/RegionViewAViewModel.cs",
    "content": "﻿using Prism.Common;\n\nnamespace MauiRegionsModule.ViewModels;\n\npublic class RegionViewAViewModel : RegionViewModelBase, IInitialize\n{\n    public RegionViewAViewModel(INavigationService navigationService, IPageAccessor pageAccessor) \n        : base(navigationService, pageAccessor)\n    {\n    }\n\n    public void Initialize(INavigationParameters parameters)\n    {\n        if (parameters.TryGetValue<string>(\"Message\", out var message))\n            Message = message;\n    }\n}\n\n"
  },
  {
    "path": "e2e/Maui/MauiRegionsModule/ViewModels/RegionViewBViewModel.cs",
    "content": "﻿using Prism.Common;\n\nnamespace MauiRegionsModule.ViewModels;\n\npublic class RegionViewBViewModel : RegionViewModelBase\n{\n    public RegionViewBViewModel(INavigationService navigationService, IPageAccessor pageAccessor)\n        : base(navigationService, pageAccessor)\n    {\n    }\n}\n\n"
  },
  {
    "path": "e2e/Maui/MauiRegionsModule/ViewModels/RegionViewCViewModel.cs",
    "content": "﻿using Prism.Common;\n\nnamespace MauiRegionsModule.ViewModels;\n\npublic class RegionViewCViewModel : RegionViewModelBase\n{\n    public RegionViewCViewModel(INavigationService navigationService, IPageAccessor pageAccessor)\n        : base(navigationService, pageAccessor)\n    {\n    }\n}\n\n"
  },
  {
    "path": "e2e/Maui/MauiRegionsModule/ViewModels/RegionViewModelBase.cs",
    "content": "﻿using Prism.Common;\n\nnamespace MauiRegionsModule.ViewModels;\n\npublic abstract class RegionViewModelBase : BindableBase, IRegionAware, IPageLifecycleAware\n{\n    protected string Name => GetType().Name.Replace(\"ViewModel\", string.Empty);\n    protected INavigationService _navigationService { get; }\n    private IPageAccessor _pageAccessor { get; }\n    protected IRegionNavigationService? _regionNavigation { get; private set; }\n\n    protected RegionViewModelBase(INavigationService navigationService, IPageAccessor pageAccessor)\n    {\n        _navigationService = navigationService;\n        _pageAccessor = pageAccessor;\n    }\n\n    public bool IsNavigationTarget(NavigationContext navigationContext) =>\n        navigationContext.NavigatedName() == Name;\n\n    private string? _message;\n    public string? Message\n    {\n        get => _message;\n        set => SetProperty(ref _message, value);\n    }\n\n    private int _viewCount;\n    public int ViewCount\n    {\n        get => _viewCount;\n        set => SetProperty(ref _viewCount, value);\n    }\n\n    public string? PageName => _pageAccessor.Page?.GetType()?.Name;\n\n    public void OnNavigatedFrom(NavigationContext navigationContext)\n    {\n\n    }\n\n    public void OnNavigatedTo(NavigationContext navigationContext)\n    {\n        if (navigationContext.Parameters.ContainsKey(nameof(Message)))\n            Message = navigationContext.Parameters.GetValue<string>(nameof(Message));\n\n        _regionNavigation = navigationContext.NavigationService;\n        ViewCount = navigationContext.NavigationService.Region.Views.Count();\n    }\n\n    public void OnAppearing()\n    {\n        RaisePropertyChanged(nameof(PageName));\n    }\n\n    public void OnDisappearing()\n    {\n    }\n}\n"
  },
  {
    "path": "e2e/Maui/MauiRegionsModule/Views/ContentRegionPage.xaml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<ContentPage xmlns=\"http://schemas.microsoft.com/dotnet/2021/maui\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2009/xaml\"\n             xmlns:prism=\"http://prismlibrary.com\"\n             x:Class=\"MauiRegionsModule.Views.ContentRegionPage\"\n             Title=\"Content Region\"\n             Padding=\"20\">\n  <ContentPage.Resources>\n    <ResourceDictionary>\n      <Style TargetType=\"Button\">\n        <Setter Property=\"Margin\" Value=\"0,10\" />\n      </Style>\n    </ResourceDictionary>\n  </ContentPage.Resources>\n  <Grid RowDefinitions=\"*,Auto,Auto,Auto\">\n    <ContentView prism:RegionManager.RegionName=\"ContentRegion\" />\n\n    <Button Text=\"View A\"\n            Command=\"{Binding NavigateCommand}\"\n            CommandParameter=\"RegionViewA\"\n            Grid.Row=\"1\" />\n    <Button Text=\"View B\"\n            Command=\"{Binding NavigateCommand}\"\n            CommandParameter=\"RegionViewB\"\n            Grid.Row=\"2\" />\n    <Button Text=\"View C\"\n            Command=\"{Binding NavigateCommand}\"\n            CommandParameter=\"RegionViewC\"\n            Grid.Row=\"3\" />\n  </Grid>\n</ContentPage>\n"
  },
  {
    "path": "e2e/Maui/MauiRegionsModule/Views/ContentRegionPage.xaml.cs",
    "content": "namespace MauiRegionsModule.Views;\n\npublic partial class ContentRegionPage : ContentPage\n{\n    public ContentRegionPage()\n    {\n        InitializeComponent();\n    }\n}"
  },
  {
    "path": "e2e/Maui/MauiRegionsModule/Views/DefaultViewInstancePage.xaml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<ContentPage xmlns=\"http://schemas.microsoft.com/dotnet/2021/maui\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2009/xaml\"\n             xmlns:prism=\"http://prismlibrary.com\"\n             xmlns:local=\"clr-namespace:MauiRegionsModule.Views\"\n             x:Class=\"MauiRegionsModule.Views.DefaultViewInstancePage\"\n             Title=\"DefaultViewInstancePage\">\n  <ContentPage.Resources>\n    <ResourceDictionary>\n      <ContentView x:Key=\"InstanceView\">\n        <StackLayout>\n          <Label Text=\"This is an instance of a View\" />\n          <Label Text=\"This has no View Model and is simply an instance we add by default.\" />\n        </StackLayout>\n      </ContentView>\n    </ResourceDictionary>\n  </ContentPage.Resources>\n\n  <ContentView prism:RegionManager.RegionName=\"DefaultViewInstance\"\n               prism:RegionManager.DefaultView=\"{StaticResource InstanceView}\" />\n</ContentPage>\n"
  },
  {
    "path": "e2e/Maui/MauiRegionsModule/Views/DefaultViewInstancePage.xaml.cs",
    "content": "namespace MauiRegionsModule.Views;\n\npublic partial class DefaultViewInstancePage : ContentPage\n{\n    public DefaultViewInstancePage()\n    {\n        InitializeComponent();\n    }\n}"
  },
  {
    "path": "e2e/Maui/MauiRegionsModule/Views/DefaultViewNamedPage.xaml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<ContentPage xmlns=\"http://schemas.microsoft.com/dotnet/2021/maui\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2009/xaml\"\n             xmlns:prism=\"http://prismlibrary.com\"\n             x:Class=\"MauiRegionsModule.Views.DefaultViewNamedPage\"\n             Title=\"Default View Named\">\n  <ContentView prism:RegionManager.RegionName=\"DefaultViewNamed\"\n               prism:RegionManager.DefaultView=\"RegionViewA\" />\n</ContentPage>\n"
  },
  {
    "path": "e2e/Maui/MauiRegionsModule/Views/DefaultViewNamedPage.xaml.cs",
    "content": "namespace MauiRegionsModule.Views;\n\npublic partial class DefaultViewNamedPage : ContentPage\n{\n    public DefaultViewNamedPage()\n    {\n        InitializeComponent();\n    }\n}"
  },
  {
    "path": "e2e/Maui/MauiRegionsModule/Views/DefaultViewTypePage.xaml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<ContentPage xmlns=\"http://schemas.microsoft.com/dotnet/2021/maui\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2009/xaml\"\n             xmlns:prism=\"http://prismlibrary.com\"\n             xmlns:local=\"clr-namespace:MauiRegionsModule.Views\"\n             x:Class=\"MauiRegionsModule.Views.DefaultViewTypePage\"\n             Title=\"DefaultViewTypePage\">\n  <ContentView prism:RegionManager.RegionName=\"DefaultViewType\"\n               prism:RegionManager.DefaultView=\"{x:Type local:RegionViewA}\"/>\n</ContentPage>\n"
  },
  {
    "path": "e2e/Maui/MauiRegionsModule/Views/DefaultViewTypePage.xaml.cs",
    "content": "namespace MauiRegionsModule.Views;\n\npublic partial class DefaultViewTypePage : ContentPage\n{\n    public DefaultViewTypePage()\n    {\n        InitializeComponent();\n    }\n}"
  },
  {
    "path": "e2e/Maui/MauiRegionsModule/Views/RegionHome.xaml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<FlyoutPage xmlns=\"http://schemas.microsoft.com/dotnet/2021/maui\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2009/xaml\"\n             x:Class=\"MauiRegionsModule.Views.RegionHome\"\n             Title=\"RegionHome\">\n  <FlyoutPage.Flyout>\n    <ContentPage Title=\"Menu\">\n      <StackLayout Spacing=\"15\">\n        <Button Text=\"Content Region\"\n                Command=\"{Binding NavigateCommand}\"\n                CommandParameter=\"NavigationPage/ContentRegionPage\" />\n        <Button Text=\"Default View by Name\"\n                Command=\"{Binding NavigateCommand}\"\n                CommandParameter=\"NavigationPage/DefaultViewNamedPage?Message=Initialized%20by%20NavigationParameters\" />\n        <Button Text=\"Default View by Type\"\n                Command=\"{Binding NavigateCommand}\"\n                CommandParameter=\"NavigationPage/DefaultViewTypePage\" />\n        <Button Text=\"Default View by Instance\"\n                Command=\"{Binding NavigateCommand}\"\n                CommandParameter=\"NavigationPage/DefaultViewInstancePage\" />\n        <Button Text=\"Root Page\"\n                Command=\"{Binding NavigateCommand}\"\n                CommandParameter=\"/RootPage\" />\n      </StackLayout>\n    </ContentPage>\n  </FlyoutPage.Flyout>\n</FlyoutPage>\n"
  },
  {
    "path": "e2e/Maui/MauiRegionsModule/Views/RegionHome.xaml.cs",
    "content": "namespace MauiRegionsModule.Views;\n\npublic partial class RegionHome : FlyoutPage\n{\n    public RegionHome()\n    {\n        InitializeComponent();\n    }\n}"
  },
  {
    "path": "e2e/Maui/MauiRegionsModule/Views/RegionViewA.xaml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<ContentView xmlns=\"http://schemas.microsoft.com/dotnet/2021/maui\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2009/xaml\"\n             x:Class=\"MauiRegionsModule.Views.RegionViewA\">\n  <StackLayout Margin=\"20\">\n    <Label Text=\"Region View A\"\n           FontAttributes=\"Bold\" />\n    <Label Text=\"{Binding PageName, StringFormat='Navigation Service Page: {0}'}\" />\n    <Label Text=\"{Binding ViewCount, StringFormat='Region Views: {0} view(s)'}\" />\n    <Label Text=\"{Binding Message, StringFormat='Message: {0}'}\" />\n  </StackLayout>\n</ContentView>\n"
  },
  {
    "path": "e2e/Maui/MauiRegionsModule/Views/RegionViewA.xaml.cs",
    "content": "namespace MauiRegionsModule.Views;\n\npublic partial class RegionViewA : ContentView\n{\n    public RegionViewA()\n    {\n        InitializeComponent();\n    }\n}"
  },
  {
    "path": "e2e/Maui/MauiRegionsModule/Views/RegionViewB.xaml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<ContentView xmlns=\"http://schemas.microsoft.com/dotnet/2021/maui\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2009/xaml\"\n             x:Class=\"MauiRegionsModule.Views.RegionViewB\">\n  <StackLayout Margin=\"20\">\n    <Label Text=\"Region View B\"\n           FontAttributes=\"Bold\" />\n    <Label Text=\"{Binding PageName, StringFormat='Navigation Service Page: {0}'}\" />\n    <Label Text=\"{Binding ViewCount, StringFormat='Region Views: {0} view(s)'}\" />\n    <Label Text=\"{Binding Message, StringFormat='Message: {0}'}\" />\n  </StackLayout>\n</ContentView>\n"
  },
  {
    "path": "e2e/Maui/MauiRegionsModule/Views/RegionViewB.xaml.cs",
    "content": "namespace MauiRegionsModule.Views;\n\npublic partial class RegionViewB : ContentView\n{\n    public RegionViewB()\n    {\n        InitializeComponent();\n    }\n}"
  },
  {
    "path": "e2e/Maui/MauiRegionsModule/Views/RegionViewC.xaml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<ContentView xmlns=\"http://schemas.microsoft.com/dotnet/2021/maui\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2009/xaml\"\n             x:Class=\"MauiRegionsModule.Views.RegionViewC\">\n  <StackLayout Margin=\"20\">\n    <Label Text=\"Region View C\"\n           FontAttributes=\"Bold\" />\n    <Label Text=\"{Binding PageName, StringFormat='Navigation Service Page: {0}'}\" />\n    <Label Text=\"{Binding ViewCount, StringFormat='Region Views: {0} view(s)'}\" />\n    <Label Text=\"{Binding Message, StringFormat='Message: {0}'}\" />\n  </StackLayout>\n</ContentView>\n"
  },
  {
    "path": "e2e/Maui/MauiRegionsModule/Views/RegionViewC.xaml.cs",
    "content": "namespace MauiRegionsModule.Views;\n\npublic partial class RegionViewC : ContentView\n{\n    public RegionViewC()\n    {\n        InitializeComponent();\n    }\n}"
  },
  {
    "path": "e2e/Maui/PrismMauiDemo/App.xaml",
    "content": "﻿<Application xmlns=\"http://schemas.microsoft.com/dotnet/2021/maui\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2009/xaml\"\n             xmlns:windows=\"clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;assembly=Microsoft.Maui.Controls\"\n             xmlns:local=\"clr-namespace:PrismMauiDemo\"\n             x:Class=\"PrismMauiDemo.App\"\n             windows:Application.ImageDirectory=\"Assets\">\n  <Application.Resources>\n    <ResourceDictionary>\n      <ResourceDictionary.MergedDictionaries>\n        <ResourceDictionary Source=\"Resources/Styles/Colors.xaml\" />\n        <ResourceDictionary Source=\"Resources/Styles/Styles.xaml\" />\n      </ResourceDictionary.MergedDictionaries>\n    </ResourceDictionary>\n  </Application.Resources>\n</Application>\n"
  },
  {
    "path": "e2e/Maui/PrismMauiDemo/App.xaml.cs",
    "content": "namespace PrismMauiDemo;\n\npublic partial class App\n{\n    public App()\n    {\n        InitializeComponent();\n    }\n}\n"
  },
  {
    "path": "e2e/Maui/PrismMauiDemo/MauiProgram.cs",
    "content": "using MauiModule;\nusing MauiModule.ViewModels;\nusing MauiRegionsModule;\nusing PrismMauiDemo.ViewModels;\nusing PrismMauiDemo.Views;\n\nnamespace PrismMauiDemo;\n\npublic static class MauiProgram\n{\n    public static MauiApp CreateMauiApp()\n    {\n        return MauiApp.CreateBuilder()\n            .UseMauiApp<App>()\n            .UsePrism(prism => \n                prism.ConfigureModuleCatalog(moduleCatalog =>\n                {\n                    moduleCatalog.AddModule<MauiAppModule>();\n                    moduleCatalog.AddModule<MauiTestRegionsModule>();\n                })\n                .RegisterTypes(containerRegistry =>\n                {\n                    containerRegistry.RegisterForNavigation<MainPage>();\n                    containerRegistry.RegisterForNavigation<RootPage>();\n                    containerRegistry.RegisterForNavigation<SamplePage>();\n                    containerRegistry.RegisterForNavigation<SplashPage>();\n                })\n                .AddGlobalNavigationObserver(context => context.Subscribe(x =>\n                {\n                    if (x.Type == NavigationRequestType.Navigate)\n                        Console.WriteLine($\"Navigation: {x.Uri}\");\n                    else\n                        Console.WriteLine($\"Navigation: {x.Type}\");\n\n                    var status = x.Cancelled ? \"Cancelled\" : x.Result.Success ? \"Success\" : \"Failed\";\n                    Console.WriteLine($\"Result: {status}\");\n\n                    if (status == \"Failed\" && !string.IsNullOrEmpty(x.Result?.Exception?.Message))\n                        Console.Error.WriteLine(x.Result.Exception.Message);\n                }))\n            //.CreateWindow(nav => nav.CreateBuilder()\n            //    .AddTabbedSegment(page =>\n            //        page.CreateTab(\"ViewC\")\n            //            .CreateTab(t =>\n            //                t.AddNavigationPage()\n            //                 .AddSegment(\"ViewA\", s => s.AddParameter(\"message\", \"Hello Tab - ViewA\"))\n            //                 .AddSegment(\"ViewB\", s => s.AddParameter(\"message\", \"Hello Tab - ViewB\")))\n            //            //.CreateTab(\"ViewC\", s => s.AddParameter(\"message\", \"Hello Tab - ViewC\"))\n            //            .SelectedTab(\"NavigationPage|ViewB\"))\n            //    .AddParameter(\"message_global\", \"This is a Global Message\")\n            //    .Navigate())\n            .CreateWindow(navigationService => navigationService.CreateBuilder()\n                .AddSegment<SplashPageViewModel>()\n                .NavigateAsync(HandleNavigationError))\n            )\n            .ConfigureFonts(fonts =>\n            {\n                fonts.AddFont(\"OpenSans-Regular.ttf\", \"OpenSansRegular\");\n                fonts.AddFont(\"OpenSans-Semibold.ttf\", \"OpenSansSemibold\");\n            })\n            .Build();\n    }\n\n    private static void HandleNavigationError(Exception ex)\n    {\n        Console.WriteLine(ex);\n        System.Diagnostics.Debugger.Break();\n    }\n}\n"
  },
  {
    "path": "e2e/Maui/PrismMauiDemo/Platforms/Android/AndroidManifest.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\">\n  <application android:allowBackup=\"true\" android:icon=\"@mipmap/appicon\" android:roundIcon=\"@mipmap/appicon_round\" android:supportsRtl=\"true\"></application>\n  <uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\" />\n</manifest>"
  },
  {
    "path": "e2e/Maui/PrismMauiDemo/Platforms/Android/MainActivity.cs",
    "content": "﻿using Android.App;\nusing Android.Content.PM;\nusing Android.OS;\n\nnamespace PrismMauiDemo;\n\n[Activity(Theme = \"@style/Maui.SplashTheme\", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize)]\npublic class MainActivity : MauiAppCompatActivity\n{\n    protected override void OnCreate(Bundle savedInstanceState)\n    {\n        base.OnCreate(savedInstanceState);\n        Platform.Init(this, savedInstanceState);\n    }\n\n    public override void OnRequestPermissionsResult(int requestCode, string[] permissions, Permission[] grantResults)\n    {\n        Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);\n\n        base.OnRequestPermissionsResult(requestCode, permissions, grantResults);\n    }\n}\n"
  },
  {
    "path": "e2e/Maui/PrismMauiDemo/Platforms/Android/MainApplication.cs",
    "content": "﻿using Android.App;\nusing Android.Runtime;\n\nnamespace PrismMauiDemo;\n\n[Application]\npublic class MainApplication : MauiApplication\n{\n    public MainApplication(IntPtr handle, JniHandleOwnership ownership)\n        : base(handle, ownership)\n    {\n    }\n\n    protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();\n}\n"
  },
  {
    "path": "e2e/Maui/PrismMauiDemo/Platforms/Android/Resources/values/colors.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"colorPrimary\">#00A5F2</color>\n    <color name=\"colorPrimaryDark\">#7E7D81</color>\n    <color name=\"colorAccent\">#7E7D81</color>\n</resources>"
  },
  {
    "path": "e2e/Maui/PrismMauiDemo/Platforms/MacCatalyst/AppDelegate.cs",
    "content": "﻿using Foundation;\n\nnamespace PrismMauiDemo;\n\n[Register(\"AppDelegate\")]\npublic class AppDelegate : MauiUIApplicationDelegate\n{\n    protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();\n}\n"
  },
  {
    "path": "e2e/Maui/PrismMauiDemo/Platforms/MacCatalyst/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n  <key>UIDeviceFamily</key>\n  <array>\n    <integer>1</integer>\n    <integer>2</integer>\n  </array>\n  <key>UIRequiredDeviceCapabilities</key>\n  <array>\n    <string>arm64</string>\n  </array>\n  <key>UISupportedInterfaceOrientations</key>\n  <array>\n    <string>UIInterfaceOrientationPortrait</string>\n    <string>UIInterfaceOrientationLandscapeLeft</string>\n    <string>UIInterfaceOrientationLandscapeRight</string>\n  </array>\n  <key>UISupportedInterfaceOrientations~ipad</key>\n  <array>\n    <string>UIInterfaceOrientationPortrait</string>\n    <string>UIInterfaceOrientationPortraitUpsideDown</string>\n    <string>UIInterfaceOrientationLandscapeLeft</string>\n    <string>UIInterfaceOrientationLandscapeRight</string>\n  </array>\n  <key>XSAppIconAssets</key>\n  <string>Assets.xcassets/appicon.appiconset</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "e2e/Maui/PrismMauiDemo/Platforms/MacCatalyst/Program.cs",
    "content": "﻿using ObjCRuntime;\nusing UIKit;\n\nnamespace PrismMauiDemo;\n\npublic class Program\n{\n    // This is the main entry point of the application.\n    static void Main(string[] args)\n    {\n        // if you want to use a different Application Delegate class from \"AppDelegate\"\n        // you can specify it here.\n        UIApplication.Main(args, null, typeof(AppDelegate));\n    }\n}\n"
  },
  {
    "path": "e2e/Maui/PrismMauiDemo/Platforms/Windows/App.xaml",
    "content": "﻿<maui:MauiWinUIApplication\n    x:Class=\"PrismMauiDemo.WinUI.App\"\n    xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n    xmlns:maui=\"using:Microsoft.Maui\"\n    xmlns:local=\"using:PrismMauiDemo.WinUI\">\n\n</maui:MauiWinUIApplication>\n"
  },
  {
    "path": "e2e/Maui/PrismMauiDemo/Platforms/Windows/App.xaml.cs",
    "content": "﻿using Microsoft.UI.Xaml;\n\n// To learn more about WinUI, the WinUI project structure,\n// and more about our project templates, see: http://aka.ms/winui-project-info.\n\nnamespace PrismMauiDemo.WinUI;\n\n/// <summary>\n/// Provides application-specific behavior to supplement the default Application class.\n/// </summary>\npublic partial class App : MauiWinUIApplication\n{\n    /// <summary>\n    /// Initializes the singleton application object.  This is the first line of authored code\n    /// executed, and as such is the logical equivalent of main() or WinMain().\n    /// </summary>\n    public App()\n    {\n        this.InitializeComponent();\n    }\n\n    protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();\n\n    protected override void OnLaunched(LaunchActivatedEventArgs args)\n    {\n        base.OnLaunched(args);\n\n        Platform.OnLaunched(args);\n    }\n}\n\n"
  },
  {
    "path": "e2e/Maui/PrismMauiDemo/Platforms/Windows/Package.appxmanifest",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<Package\n  xmlns=\"http://schemas.microsoft.com/appx/manifest/foundation/windows10\"\n  xmlns:uap=\"http://schemas.microsoft.com/appx/manifest/uap/windows10\"\n  xmlns:rescap=\"http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities\"\n  IgnorableNamespaces=\"uap rescap\">\n\n  <Identity Publisher=\"CN=Prism Library\" />\n\n  <Properties>\n    <DisplayName>Prism Maui Demo</DisplayName>\n    <PublisherDisplayName>Prism Library</PublisherDisplayName>\n  </Properties>\n\n  <Dependencies>\n    <TargetDeviceFamily Name=\"Windows.Universal\" MinVersion=\"10.0.17763.0\" MaxVersionTested=\"10.0.19041.0\" />\n    <TargetDeviceFamily Name=\"Windows.Desktop\" MinVersion=\"10.0.17763.0\" MaxVersionTested=\"10.0.19041.0\" />\n    <PackageDependency Name=\"Microsoft.VCLibs.140.00\" MinVersion=\"14.0.24217.0\" Publisher=\"CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US\" />\n    <PackageDependency Name=\"Microsoft.VCLibs.140.00.UWPDesktop\" MinVersion=\"14.0.24217.0\" Publisher=\"CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US\" />\n  </Dependencies>\n\n  <Resources>\n    <Resource Language=\"x-generate\"/>\n  </Resources>\n\n  <Applications>\n    <Application Id=\"App\"\n      Executable=\"$targetnametoken$.exe\"\n      EntryPoint=\"$targetentrypoint$\">\n      <uap:VisualElements />\n    </Application>\n  </Applications>\n\n  <Capabilities>\n    <rescap:Capability Name=\"runFullTrust\" />\n  </Capabilities>\n\n</Package>\n"
  },
  {
    "path": "e2e/Maui/PrismMauiDemo/Platforms/Windows/app.manifest",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<assembly manifestVersion=\"1.0\" xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n  <assemblyIdentity version=\"1.0.0.0\" name=\"PrismMauiDemo.WinUI.app\"/>\n\n  <application xmlns=\"urn:schemas-microsoft-com:asm.v3\">\n    <windowsSettings>\n      <!-- The combination of below two tags have the following effect:\n           1) Per-Monitor for >= Windows 10 Anniversary Update\n           2) System < Windows 10 Anniversary Update\n      -->\n      <dpiAware xmlns=\"http://schemas.microsoft.com/SMI/2005/WindowsSettings\">true/PM</dpiAware>\n      <dpiAwareness xmlns=\"http://schemas.microsoft.com/SMI/2016/WindowsSettings\">PerMonitorV2, PerMonitor</dpiAwareness>\n    </windowsSettings>\n  </application>\n</assembly>\n"
  },
  {
    "path": "e2e/Maui/PrismMauiDemo/Platforms/iOS/AppDelegate.cs",
    "content": "﻿using Foundation;\n\nnamespace PrismMauiDemo;\n\n[Register(\"AppDelegate\")]\npublic class AppDelegate : MauiUIApplicationDelegate\n{\n    protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();\n}\n"
  },
  {
    "path": "e2e/Maui/PrismMauiDemo/Platforms/iOS/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n  <key>LSRequiresIPhoneOS</key>\n  <true/>\n  <key>UIDeviceFamily</key>\n  <array>\n    <integer>1</integer>\n    <integer>2</integer>\n  </array>\n  <key>UIRequiredDeviceCapabilities</key>\n  <array>\n    <string>arm64</string>\n  </array>\n  <key>UISupportedInterfaceOrientations</key>\n  <array>\n    <string>UIInterfaceOrientationPortrait</string>\n    <string>UIInterfaceOrientationLandscapeLeft</string>\n    <string>UIInterfaceOrientationLandscapeRight</string>\n  </array>\n  <key>UISupportedInterfaceOrientations~ipad</key>\n  <array>\n    <string>UIInterfaceOrientationPortrait</string>\n    <string>UIInterfaceOrientationPortraitUpsideDown</string>\n    <string>UIInterfaceOrientationLandscapeLeft</string>\n    <string>UIInterfaceOrientationLandscapeRight</string>\n  </array>\n  <key>XSAppIconAssets</key>\n  <string>Assets.xcassets/appicon.appiconset</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "e2e/Maui/PrismMauiDemo/Platforms/iOS/Program.cs",
    "content": "﻿using ObjCRuntime;\nusing UIKit;\n\nnamespace PrismMauiDemo;\n\npublic class Program\n{\n    // This is the main entry point of the application.\n    static void Main(string[] args)\n    {\n        // if you want to use a different Application Delegate class from \"AppDelegate\"\n        // you can specify it here.\n        UIApplication.Main(args, null, typeof(AppDelegate));\n    }\n}\n"
  },
  {
    "path": "e2e/Maui/PrismMauiDemo/Platforms/iOS/Resources/LaunchScreen.xib",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.XIB\" version=\"3.0\" toolsVersion=\"6214\" systemVersion=\"14A314h\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\" launchScreen=\"YES\" useTraitCollections=\"YES\">\n    <dependencies>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"6207\" />\n        <capability name=\"Constraints with non-1.0 multipliers\" minToolsVersion=\"5.1\" />\n    </dependencies>\n    <objects>\n        <placeholder placeholderIdentifier=\"IBFilesOwner\" id=\"-1\" userLabel=\"File's Owner\" />\n        <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"-2\" customClass=\"UIResponder\" />\n        <view contentMode=\"scaleToFill\" id=\"iN0-l3-epB\">\n            <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"480\" height=\"480\" />\n            <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\" />\n            <subviews>\n                <label opaque=\"NO\" clipsSubviews=\"YES\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" text=\"  Copyright (c) 2017 \" textAlignment=\"center\" lineBreakMode=\"tailTruncation\" baselineAdjustment=\"alignBaselines\"\n                    minimumFontSize=\"9\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"8ie-xW-0ye\">\n                    <rect key=\"frame\" x=\"20\" y=\"439\" width=\"441\" height=\"21\" />\n                    <fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"17\" />\n                    <color key=\"textColor\" cocoaTouchSystemColor=\"darkTextColor\" />\n                    <nil key=\"highlightedColor\" />\n                </label>\n                <label opaque=\"NO\" clipsSubviews=\"YES\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" text=\"Sample.iOS\" textAlignment=\"center\" lineBreakMode=\"middleTruncation\" baselineAdjustment=\"alignBaselines\"\n                    minimumFontSize=\"18\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"kId-c2-rCX\">\n                    <rect key=\"frame\" x=\"20\" y=\"140\" width=\"441\" height=\"43\" />\n                    <fontDescription key=\"fontDescription\" type=\"boldSystem\" pointSize=\"36\" />\n                    <color key=\"textColor\" cocoaTouchSystemColor=\"darkTextColor\" />\n                    <nil key=\"highlightedColor\" />\n                </label>\n            </subviews>\n            <color key=\"backgroundColor\" white=\"1\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"calibratedWhite\" />\n            <constraints>\n                <constraint firstItem=\"kId-c2-rCX\" firstAttribute=\"centerY\" secondItem=\"iN0-l3-epB\" secondAttribute=\"bottom\" multiplier=\"1/3\" constant=\"1\" id=\"5cJ-9S-tgC\" />\n                <constraint firstAttribute=\"centerX\" secondItem=\"kId-c2-rCX\" secondAttribute=\"centerX\" id=\"Koa-jz-hwk\" />\n                <constraint firstAttribute=\"bottom\" secondItem=\"8ie-xW-0ye\" secondAttribute=\"bottom\" constant=\"20\" id=\"Kzo-t9-V3l\" />\n                <constraint firstItem=\"8ie-xW-0ye\" firstAttribute=\"leading\" secondItem=\"iN0-l3-epB\" secondAttribute=\"leading\" constant=\"20\" symbolic=\"YES\" id=\"MfP-vx-nX0\" />\n                <constraint firstAttribute=\"centerX\" secondItem=\"8ie-xW-0ye\" secondAttribute=\"centerX\" id=\"ZEH-qu-HZ9\" />\n                <constraint firstItem=\"kId-c2-rCX\" firstAttribute=\"leading\" secondItem=\"iN0-l3-epB\" secondAttribute=\"leading\" constant=\"20\" symbolic=\"YES\" id=\"fvb-Df-36g\" />\n            </constraints>\n            <nil key=\"simulatedStatusBarMetrics\" />\n            <freeformSimulatedSizeMetrics key=\"simulatedDestinationMetrics\" />\n            <point key=\"canvasLocation\" x=\"548\" y=\"455\" />\n        </view>\n    </objects>\n</document>\n"
  },
  {
    "path": "e2e/Maui/PrismMauiDemo/PrismMauiDemo.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFrameworks>net10.0-android;net10.0-ios;net10.0-maccatalyst</TargetFrameworks>\n    <TargetFrameworks Condition=\"$([MSBuild]::IsOSPlatform('windows')) and '$(MSBuildRuntimeType)' == 'Full'\">$(TargetFrameworks);net10.0-windows10.0.19041</TargetFrameworks>\n    <OutputType>Exe</OutputType>\n    <RootNamespace>PrismMauiDemo</RootNamespace>\n    <UseMaui>true</UseMaui>\n    <SingleProject>true</SingleProject>\n    <EnablePreviewMsixTooling>true</EnablePreviewMsixTooling>\n    <AndroidManifest>Platforms/Android/AndroidManifest.xml</AndroidManifest>\n\n    <!-- Display name -->\n    <ApplicationTitle>Prism Maui</ApplicationTitle>\n\n    <!-- App Identifier -->\n    <ApplicationId>com.prismlibrary.prismmauidemo</ApplicationId>\n    <ApplicationIdGuid>9420c397-cc28-4029-a4d5-2d780345b109</ApplicationIdGuid>\n\n    <!-- Versions -->\n    <ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>\n    <ApplicationVersion>1</ApplicationVersion>\n\n    <!-- Required for C# Hot Reload -->\n    <UseInterpreter Condition=\"'$(Configuration)' == 'Debug'\">True</UseInterpreter>\n\n    <SupportedOSPlatformVersion Condition=\"$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'\">14.2</SupportedOSPlatformVersion>\n    <SupportedOSPlatformVersion Condition=\"$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'\">14.0</SupportedOSPlatformVersion>\n    <SupportedOSPlatformVersion Condition=\"$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'\">21.0</SupportedOSPlatformVersion>\n    <SupportedOSPlatformVersion Condition=\"$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'\">10.0.17763.0</SupportedOSPlatformVersion>\n    <TargetPlatformMinVersion Condition=\"$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'\">10.0.17763.0</TargetPlatformMinVersion>\n    <SupportedOSPlatformVersion Condition=\"$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'\">6.5</SupportedOSPlatformVersion>\n    <EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <!-- App Icon -->\n    <MauiIcon Include=\"Resources\\AppIcon\\appicon.svg\" ForegroundFile=\"Resources\\AppIcon\\appiconfg.svg\" Color=\"#FFFFFF\" />\n\n    <!-- Splash Screen -->\n    <MauiSplashScreen Include=\"Resources\\Splash\\splash.png\" Color=\"#FFFFFF\" />\n\n    <!-- Images -->\n    <MauiImage Include=\"Resources\\Images\\*\" />\n\n    <!-- Custom Fonts -->\n    <MauiFont Include=\"Resources\\Fonts\\*\" />\n\n    <!-- Raw Assets (also remove the \"Resources\\Raw\" prefix) -->\n    <MauiAsset Include=\"Resources\\Raw\\**\" LogicalName=\"%(RecursiveDir)%(Filename)%(Extension)\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Microsoft.Maui.Controls\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\..\\src\\Maui\\Prism.DryIoc.Maui\\Prism.DryIoc.Maui.csproj\" />\n    <ProjectReference Include=\"..\\..\\..\\src\\Maui\\Prism.Maui.Rx\\Prism.Maui.Rx.csproj\" />\n    <ProjectReference Include=\"..\\..\\..\\src\\Maui\\Prism.Maui\\Prism.Maui.csproj\" />\n    <ProjectReference Include=\"..\\MauiModule\\MauiModule.csproj\" />\n    <ProjectReference Include=\"..\\MauiRegionsModule\\MauiRegionsModule.csproj\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "e2e/Maui/PrismMauiDemo/Properties/launchSettings.json",
    "content": "{\n  \"profiles\": {\n    \"Windows Machine\": {\n      \"commandName\": \"MsixPackage\",\n      \"nativeDebugging\": false\n    }\n  }\n}"
  },
  {
    "path": "e2e/Maui/PrismMauiDemo/Resources/Raw/AboutAssets.txt",
    "content": "﻿Any raw assets you want to be deployed with your application can be placed in\nthis directory (and child directories). Deployment of the asset to your application\nis automatically handled by the following `MauiAsset` Build Action within your `.csproj`.\n\n\t<MauiAsset Include=\"Resources\\Raw\\**\" LogicalName=\"%(RecursiveDir)%(Filename)%(Extension)\" />\n\nThese files will be deployed with you package and will be accessible using Essentials:\n\n\tasync Task LoadMauiAsset()\n\t{\n\t\tusing var stream = await FileSystem.OpenAppPackageFileAsync(\"AboutAssets.txt\");\n\t\tusing var reader = new StreamReader(stream);\n\n\t\tvar contents = reader.ReadToEnd();\n\t}\n"
  },
  {
    "path": "e2e/Maui/PrismMauiDemo/Resources/Styles/Colors.xaml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<?xaml-comp compile=\"true\" ?>\n<ResourceDictionary \n    xmlns=\"http://schemas.microsoft.com/dotnet/2021/maui\"\n    xmlns:x=\"http://schemas.microsoft.com/winfx/2009/xaml\">\n\n  <Color x:Key=\"Primary\">#00A5F2</Color>\n  <Color x:Key=\"Secondary\">#DFD8F7</Color>\n  <Color x:Key=\"Tertiary\">#7E7D81</Color>\n  <Color x:Key=\"White\">White</Color>\n  <Color x:Key=\"Black\">Black</Color>\n  <Color x:Key=\"Gray100\">#E1E1E1</Color>\n  <Color x:Key=\"Gray200\">#C8C8C8</Color>\n  <Color x:Key=\"Gray300\">#ACACAC</Color>\n  <Color x:Key=\"Gray400\">#919191</Color>\n  <Color x:Key=\"Gray500\">#6E6E6E</Color>\n  <Color x:Key=\"Gray600\">#404040</Color>\n  <Color x:Key=\"Gray900\">#212121</Color>\n  <Color x:Key=\"Gray950\">#141414</Color>\n  <SolidColorBrush x:Key=\"PrimaryBrush\" Color=\"{StaticResource Primary}\"/>\n  <SolidColorBrush x:Key=\"SecondaryBrush\" Color=\"{StaticResource Secondary}\"/>\n  <SolidColorBrush x:Key=\"TertiaryBrush\" Color=\"{StaticResource Tertiary}\"/>\n  <SolidColorBrush x:Key=\"WhiteBrush\" Color=\"{StaticResource White}\"/>\n  <SolidColorBrush x:Key=\"BlackBrush\" Color=\"{StaticResource Black}\"/>\n  <SolidColorBrush x:Key=\"Gray100Brush\" Color=\"{StaticResource Gray100}\"/>\n  <SolidColorBrush x:Key=\"Gray200Brush\" Color=\"{StaticResource Gray200}\"/>\n  <SolidColorBrush x:Key=\"Gray300Brush\" Color=\"{StaticResource Gray300}\"/>\n  <SolidColorBrush x:Key=\"Gray400Brush\" Color=\"{StaticResource Gray400}\"/>\n  <SolidColorBrush x:Key=\"Gray500Brush\" Color=\"{StaticResource Gray500}\"/>\n  <SolidColorBrush x:Key=\"Gray600Brush\" Color=\"{StaticResource Gray600}\"/>\n  <SolidColorBrush x:Key=\"Gray900Brush\" Color=\"{StaticResource Gray900}\"/>\n  <SolidColorBrush x:Key=\"Gray950Brush\" Color=\"{StaticResource Gray950}\"/>\n\n  <Color x:Key=\"Yellow100Accent\">#F7B548</Color>\n  <Color x:Key=\"Yellow200Accent\">#FFD590</Color>\n  <Color x:Key=\"Yellow300Accent\">#FFE5B9</Color>\n  <Color x:Key=\"Cyan100Accent\">#28C2D1</Color>\n  <Color x:Key=\"Cyan200Accent\">#7BDDEF</Color>\n  <Color x:Key=\"Cyan300Accent\">#C3F2F4</Color>\n  <Color x:Key=\"Blue100Accent\">#3E8EED</Color>\n  <Color x:Key=\"Blue200Accent\">#72ACF1</Color>\n  <Color x:Key=\"Blue300Accent\">#A7CBF6</Color>\n\n</ResourceDictionary>"
  },
  {
    "path": "e2e/Maui/PrismMauiDemo/Resources/Styles/Styles.xaml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<?xaml-comp compile=\"true\" ?>\n<ResourceDictionary \n    xmlns=\"http://schemas.microsoft.com/dotnet/2021/maui\"\n    xmlns:x=\"http://schemas.microsoft.com/winfx/2009/xaml\"\n    xmlns:android=\"clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific;assembly=Microsoft.Maui.Controls\">\n\n  <Style TargetType=\"ActivityIndicator\">\n    <Setter Property=\"Color\" Value=\"{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource White}}\" />\n  </Style>\n\n  <Style TargetType=\"IndicatorView\">\n    <Setter Property=\"IndicatorColor\" Value=\"{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray500}}\"/>\n    <Setter Property=\"SelectedIndicatorColor\" Value=\"{AppThemeBinding Light={StaticResource Gray950}, Dark={StaticResource Gray100}}\"/>\n  </Style>\n\n  <Style TargetType=\"Border\">\n    <Setter Property=\"Stroke\" Value=\"{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray500}}\" />\n    <Setter Property=\"StrokeShape\" Value=\"Rectangle\"/>\n    <Setter Property=\"StrokeThickness\" Value=\"1\"/>\n  </Style>\n\n  <Style TargetType=\"BoxView\">\n    <Setter Property=\"Color\" Value=\"{AppThemeBinding Light={StaticResource Gray950}, Dark={StaticResource Gray200}}\" />\n  </Style>\n\n  <Style TargetType=\"Button\">\n    <Setter Property=\"TextColor\" Value=\"{AppThemeBinding Light={StaticResource White}, Dark={StaticResource Primary}}\" />\n    <Setter Property=\"BackgroundColor\" Value=\"{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource White}}\" />\n    <Setter Property=\"FontFamily\" Value=\"OpenSansRegular\"/>\n    <Setter Property=\"FontSize\" Value=\"14\"/>\n    <Setter Property=\"CornerRadius\" Value=\"8\"/>\n    <Setter Property=\"Padding\" Value=\"14,10\"/>\n    <Setter Property=\"VisualStateManager.VisualStateGroups\">\n      <VisualStateGroupList>\n        <VisualStateGroup x:Name=\"CommonStates\">\n          <VisualState x:Name=\"Normal\" />\n          <VisualState x:Name=\"Disabled\">\n            <VisualState.Setters>\n              <Setter Property=\"TextColor\" Value=\"{AppThemeBinding Light={StaticResource Gray950}, Dark={StaticResource Gray200}}\" />\n              <Setter Property=\"BackgroundColor\" Value=\"{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray600}}\" />\n            </VisualState.Setters>\n          </VisualState>\n        </VisualStateGroup>\n      </VisualStateGroupList>\n    </Setter>\n  </Style>\n\n  <Style TargetType=\"CheckBox\">\n    <Setter Property=\"Color\" Value=\"{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource White}}\" />\n    <Setter Property=\"VisualStateManager.VisualStateGroups\">\n      <VisualStateGroupList>\n        <VisualStateGroup x:Name=\"CommonStates\">\n          <VisualState x:Name=\"Normal\" />\n          <VisualState x:Name=\"Disabled\">\n            <VisualState.Setters>\n              <Setter Property=\"Color\" Value=\"{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}\" />\n            </VisualState.Setters>\n          </VisualState>\n        </VisualStateGroup>\n      </VisualStateGroupList>\n    </Setter>\n  </Style>\n\n  <Style TargetType=\"DatePicker\">\n    <Setter Property=\"TextColor\" Value=\"{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource White}}\" />\n    <Setter Property=\"BackgroundColor\" Value=\"Transparent\" />\n    <Setter Property=\"FontFamily\" Value=\"OpenSansRegular\"/>\n    <Setter Property=\"FontSize\" Value=\"14\"/>\n    <Setter Property=\"VisualStateManager.VisualStateGroups\">\n      <VisualStateGroupList>\n        <VisualStateGroup x:Name=\"CommonStates\">\n          <VisualState x:Name=\"Normal\" />\n          <VisualState x:Name=\"Disabled\">\n            <VisualState.Setters>\n              <Setter Property=\"TextColor\" Value=\"{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray500}}\" />\n            </VisualState.Setters>\n          </VisualState>\n        </VisualStateGroup>\n      </VisualStateGroupList>\n    </Setter>\n  </Style>\n\n  <Style TargetType=\"Editor\">\n    <Setter Property=\"TextColor\" Value=\"{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource White}}\" />\n    <Setter Property=\"BackgroundColor\" Value=\"Transparent\" />\n    <Setter Property=\"FontFamily\" Value=\"OpenSansRegular\"/>\n    <Setter Property=\"FontSize\" Value=\"14\" />\n    <Setter Property=\"PlaceholderColor\" Value=\"{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray500}}\" />\n    <Setter Property=\"VisualStateManager.VisualStateGroups\">\n      <VisualStateGroupList>\n        <VisualStateGroup x:Name=\"CommonStates\">\n          <VisualState x:Name=\"Normal\" />\n          <VisualState x:Name=\"Disabled\">\n            <VisualState.Setters>\n              <Setter Property=\"TextColor\" Value=\"{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}\" />\n            </VisualState.Setters>\n          </VisualState>\n        </VisualStateGroup>\n      </VisualStateGroupList>\n    </Setter>\n  </Style>\n\n  <Style TargetType=\"Entry\">\n    <Setter Property=\"TextColor\" Value=\"{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource White}}\" />\n    <Setter Property=\"BackgroundColor\" Value=\"Transparent\" />\n    <Setter Property=\"FontFamily\" Value=\"OpenSansRegular\"/>\n    <Setter Property=\"FontSize\" Value=\"14\" />\n    <Setter Property=\"PlaceholderColor\" Value=\"{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray500}}\" />\n    <Setter Property=\"VisualStateManager.VisualStateGroups\">\n      <VisualStateGroupList>\n        <VisualStateGroup x:Name=\"CommonStates\">\n          <VisualState x:Name=\"Normal\" />\n          <VisualState x:Name=\"Disabled\">\n            <VisualState.Setters>\n              <Setter Property=\"TextColor\" Value=\"{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}\" />\n            </VisualState.Setters>\n          </VisualState>\n        </VisualStateGroup>\n      </VisualStateGroupList>\n    </Setter>\n  </Style>\n\n  <Style TargetType=\"Frame\">\n    <Setter Property=\"HasShadow\" Value=\"False\" />\n    <Setter Property=\"BorderColor\" Value=\"{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray950}}\" />\n    <Setter Property=\"CornerRadius\" Value=\"8\" />\n  </Style>\n\n  <Style TargetType=\"ImageButton\">\n    <Setter Property=\"Opacity\" Value=\"1\" />\n    <Setter Property=\"BorderColor\" Value=\"Transparent\"/>\n    <Setter Property=\"BorderWidth\" Value=\"0\"/>\n    <Setter Property=\"CornerRadius\" Value=\"0\"/>\n    <Setter Property=\"VisualStateManager.VisualStateGroups\">\n      <VisualStateGroupList>\n        <VisualStateGroup x:Name=\"CommonStates\">\n          <VisualState x:Name=\"Normal\" />\n          <VisualState x:Name=\"Disabled\">\n            <VisualState.Setters>\n              <Setter Property=\"Opacity\" Value=\"0.5\" />\n            </VisualState.Setters>\n          </VisualState>\n        </VisualStateGroup>\n      </VisualStateGroupList>\n    </Setter>\n  </Style>\n\n  <Style TargetType=\"Label\">\n    <Setter Property=\"TextColor\" Value=\"{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource White}}\" />\n    <Setter Property=\"FontFamily\" Value=\"OpenSansRegular\" />\n    <Setter Property=\"FontSize\" Value=\"14\" />\n    <Setter Property=\"VisualStateManager.VisualStateGroups\">\n      <VisualStateGroupList>\n        <VisualStateGroup x:Name=\"CommonStates\">\n          <VisualState x:Name=\"Normal\" />\n          <VisualState x:Name=\"Disabled\">\n            <VisualState.Setters>\n              <Setter Property=\"TextColor\" Value=\"{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}\" />\n            </VisualState.Setters>\n          </VisualState>\n        </VisualStateGroup>\n      </VisualStateGroupList>\n    </Setter>\n  </Style>\n\n  <Style TargetType=\"ListView\">\n    <Setter Property=\"SeparatorColor\" Value=\"{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray500}}\" />\n    <Setter Property=\"RefreshControlColor\" Value=\"{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource Gray200}}\" />\n  </Style>\n\n  <Style TargetType=\"Picker\">\n    <Setter Property=\"TextColor\" Value=\"{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource White}}\" />\n    <Setter Property=\"TitleColor\" Value=\"{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource Gray200}}\" />\n    <Setter Property=\"BackgroundColor\" Value=\"Transparent\" />\n    <Setter Property=\"FontFamily\" Value=\"OpenSansRegular\"/>\n    <Setter Property=\"FontSize\" Value=\"14\"/>\n    <Setter Property=\"VisualStateManager.VisualStateGroups\">\n      <VisualStateGroupList>\n        <VisualStateGroup x:Name=\"CommonStates\">\n          <VisualState x:Name=\"Normal\" />\n          <VisualState x:Name=\"Disabled\">\n            <VisualState.Setters>\n              <Setter Property=\"TextColor\" Value=\"{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}\" />\n              <Setter Property=\"TitleColor\" Value=\"{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}\" />\n            </VisualState.Setters>\n          </VisualState>\n        </VisualStateGroup>\n      </VisualStateGroupList>\n    </Setter>\n  </Style>\n\n  <Style TargetType=\"ProgressBar\">\n    <Setter Property=\"ProgressColor\" Value=\"{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource White}}\" />\n    <Setter Property=\"VisualStateManager.VisualStateGroups\">\n      <VisualStateGroupList>\n        <VisualStateGroup x:Name=\"CommonStates\">\n          <VisualState x:Name=\"Normal\" />\n          <VisualState x:Name=\"Disabled\">\n            <VisualState.Setters>\n              <Setter Property=\"ProgressColor\" Value=\"{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}\" />\n            </VisualState.Setters>\n          </VisualState>\n        </VisualStateGroup>\n      </VisualStateGroupList>\n    </Setter>\n  </Style>\n\n  <Style TargetType=\"RadioButton\">\n    <Setter Property=\"Background\" Value=\"Transparent\"/>\n    <Setter Property=\"TextColor\" Value=\"{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource White}}\" />\n    <Setter Property=\"FontFamily\" Value=\"OpenSansRegular\"/>\n    <Setter Property=\"FontSize\" Value=\"14\"/>\n    <Setter Property=\"VisualStateManager.VisualStateGroups\">\n      <VisualStateGroupList>\n        <VisualStateGroup x:Name=\"CommonStates\">\n          <VisualState x:Name=\"Normal\" />\n          <VisualState x:Name=\"Disabled\">\n            <VisualState.Setters>\n              <Setter Property=\"TextColor\" Value=\"{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}\" />\n            </VisualState.Setters>\n          </VisualState>\n        </VisualStateGroup>\n      </VisualStateGroupList>\n    </Setter>\n  </Style>\n\n  <Style TargetType=\"RefreshView\">\n    <Setter Property=\"RefreshColor\" Value=\"{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource Gray200}}\" />\n  </Style>\n\n  <Style TargetType=\"SearchBar\">\n    <Setter Property=\"TextColor\" Value=\"{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource White}}\" />\n    <Setter Property=\"PlaceholderColor\" Value=\"{StaticResource Gray500}\" />\n    <Setter Property=\"CancelButtonColor\" Value=\"{StaticResource Gray500}\" />\n    <Setter Property=\"BackgroundColor\" Value=\"Transparent\" />\n    <Setter Property=\"FontFamily\" Value=\"OpenSansRegular\" />\n    <Setter Property=\"FontSize\" Value=\"14\" />\n    <Setter Property=\"VisualStateManager.VisualStateGroups\">\n      <VisualStateGroupList>\n        <VisualStateGroup x:Name=\"CommonStates\">\n          <VisualState x:Name=\"Normal\" />\n          <VisualState x:Name=\"Disabled\">\n            <VisualState.Setters>\n              <Setter Property=\"TextColor\" Value=\"{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}\" />\n              <Setter Property=\"PlaceholderColor\" Value=\"{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}\" />\n            </VisualState.Setters>\n          </VisualState>\n        </VisualStateGroup>\n      </VisualStateGroupList>\n    </Setter>\n  </Style>\n\n  <Style TargetType=\"SearchHandler\">\n    <Setter Property=\"TextColor\" Value=\"{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource White}}\" />\n    <Setter Property=\"PlaceholderColor\" Value=\"{StaticResource Gray500}\" />\n    <Setter Property=\"BackgroundColor\" Value=\"Transparent\" />\n    <Setter Property=\"FontFamily\" Value=\"OpenSansRegular\" />\n    <Setter Property=\"FontSize\" Value=\"14\" />\n    <Setter Property=\"VisualStateManager.VisualStateGroups\">\n      <VisualStateGroupList>\n        <VisualStateGroup x:Name=\"CommonStates\">\n          <VisualState x:Name=\"Normal\" />\n          <VisualState x:Name=\"Disabled\">\n            <VisualState.Setters>\n              <Setter Property=\"TextColor\" Value=\"{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}\" />\n              <Setter Property=\"PlaceholderColor\" Value=\"{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}\" />\n            </VisualState.Setters>\n          </VisualState>\n        </VisualStateGroup>\n      </VisualStateGroupList>\n    </Setter>\n  </Style>\n\n  <Style TargetType=\"Shadow\">\n    <Setter Property=\"Radius\" Value=\"15\" />\n    <Setter Property=\"Opacity\" Value=\"0.5\" />\n    <Setter Property=\"Brush\" Value=\"{AppThemeBinding Light={StaticResource White}, Dark={StaticResource White}}\" />\n    <Setter Property=\"Offset\" Value=\"10,10\" />\n  </Style>\n\n  <Style TargetType=\"Slider\">\n    <Setter Property=\"MinimumTrackColor\" Value=\"{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource White}}\" />\n    <Setter Property=\"MaximumTrackColor\" Value=\"{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray600}}\" />\n    <Setter Property=\"ThumbColor\" Value=\"{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource White}}\" />\n    <Setter Property=\"VisualStateManager.VisualStateGroups\">\n      <VisualStateGroupList>\n        <VisualStateGroup x:Name=\"CommonStates\">\n          <VisualState x:Name=\"Normal\" />\n          <VisualState x:Name=\"Disabled\">\n            <VisualState.Setters>\n              <Setter Property=\"MinimumTrackColor\" Value=\"{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}\"/>\n              <Setter Property=\"MaximumTrackColor\" Value=\"{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}\"/>\n              <Setter Property=\"ThumbColor\" Value=\"{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}\"/>\n            </VisualState.Setters>\n          </VisualState>\n        </VisualStateGroup>\n      </VisualStateGroupList>\n    </Setter>\n  </Style>\n\n  <Style TargetType=\"SwipeItem\">\n    <Setter Property=\"BackgroundColor\" Value=\"{AppThemeBinding Light={StaticResource White}, Dark={StaticResource Black}}\" />\n  </Style>\n\n  <Style TargetType=\"Switch\">\n    <Setter Property=\"OnColor\" Value=\"{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource White}}\" />\n    <Setter Property=\"ThumbColor\" Value=\"{StaticResource White}\" />\n    <Setter Property=\"VisualStateManager.VisualStateGroups\">\n      <VisualStateGroupList>\n        <VisualStateGroup x:Name=\"CommonStates\">\n          <VisualState x:Name=\"Normal\" />\n          <VisualState x:Name=\"Disabled\">\n            <VisualState.Setters>\n              <Setter Property=\"OnColor\" Value=\"{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}\" />\n              <Setter Property=\"ThumbColor\" Value=\"{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}\" />\n            </VisualState.Setters>\n          </VisualState>\n          <VisualState x:Name=\"On\">\n            <VisualState.Setters>\n              <Setter Property=\"OnColor\" Value=\"{AppThemeBinding Light={StaticResource Secondary}, Dark={StaticResource Gray200}}\" />\n              <Setter Property=\"ThumbColor\" Value=\"{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource White}}\" />\n            </VisualState.Setters>\n          </VisualState>\n          <VisualState x:Name=\"Off\">\n            <VisualState.Setters>\n              <Setter Property=\"ThumbColor\" Value=\"{AppThemeBinding Light={StaticResource Gray400}, Dark={StaticResource Gray500}}\" />\n            </VisualState.Setters>\n          </VisualState>\n        </VisualStateGroup>\n      </VisualStateGroupList>\n    </Setter>\n  </Style>\n\n  <Style TargetType=\"TimePicker\">\n    <Setter Property=\"TextColor\" Value=\"{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource White}}\" />\n    <Setter Property=\"Background\" Value=\"Transparent\"/>\n    <Setter Property=\"FontFamily\" Value=\"OpenSansRegular\"/>\n    <Setter Property=\"FontSize\" Value=\"14\"/>\n    <Setter Property=\"VisualStateManager.VisualStateGroups\">\n      <VisualStateGroupList>\n        <VisualStateGroup x:Name=\"CommonStates\">\n          <VisualState x:Name=\"Normal\" />\n          <VisualState x:Name=\"Disabled\">\n            <VisualState.Setters>\n              <Setter Property=\"TextColor\" Value=\"{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}\" />\n            </VisualState.Setters>\n          </VisualState>\n        </VisualStateGroup>\n      </VisualStateGroupList>\n    </Setter>\n  </Style>\n\n  <Style TargetType=\"Page\" ApplyToDerivedTypes=\"True\">\n    <Setter Property=\"Padding\" Value=\"0\"/>\n    <Setter Property=\"BackgroundColor\" Value=\"{AppThemeBinding Light={StaticResource White}, Dark={StaticResource Black}}\" />\n  </Style>\n\n  <Style TargetType=\"Shell\" ApplyToDerivedTypes=\"True\">\n    <Setter Property=\"Shell.BackgroundColor\" Value=\"{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource Gray950}}\" />\n    <Setter Property=\"Shell.ForegroundColor\" Value=\"{OnPlatform WinUI={StaticResource Primary}, Default={StaticResource White}}\"></Setter>\n    <Setter Property=\"Shell.TitleColor\" Value=\"{AppThemeBinding Light={StaticResource White}, Dark={StaticResource White}}\" />\n    <Setter Property=\"Shell.DisabledColor\" Value=\"{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray950}}\" />\n    <Setter Property=\"Shell.UnselectedColor\" Value=\"{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray200}}\" />\n    <Setter Property=\"Shell.NavBarHasShadow\" Value=\"False\" />\n    <Setter Property=\"Shell.TabBarBackgroundColor\" Value=\"{AppThemeBinding Light={StaticResource White}, Dark={StaticResource Black}}\" />\n    <Setter Property=\"Shell.TabBarForegroundColor\" Value=\"{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource White}}\" />\n    <Setter Property=\"Shell.TabBarTitleColor\" Value=\"{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource White}}\" />\n    <Setter Property=\"Shell.TabBarUnselectedColor\" Value=\"{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource Gray200}}\" />\n  </Style>\n\n  <Style TargetType=\"NavigationPage\">\n    <Setter Property=\"BarBackgroundColor\" Value=\"{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource Gray950}}\" />\n    <Setter Property=\"BarTextColor\" Value=\"{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource White}}\" />\n    <Setter Property=\"IconColor\" Value=\"{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource White}}\" />\n  </Style>\n\n  <Style TargetType=\"TabbedPage\">\n    <Setter Property=\"BarBackgroundColor\" Value=\"{AppThemeBinding Light={StaticResource White}, Dark={StaticResource Gray950}}\" />\n    <Setter Property=\"BarTextColor\" Value=\"{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource White}}\" />\n    <Setter Property=\"UnselectedTabColor\" Value=\"{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray950}}\" />\n    <Setter Property=\"SelectedTabColor\" Value=\"{AppThemeBinding Light={StaticResource Gray950}, Dark={StaticResource Gray200}}\" />\n    <Setter Property=\"android:TabbedPage.ToolbarPlacement\" Value=\"Bottom\" />\n  </Style>\n\n</ResourceDictionary>\n"
  },
  {
    "path": "e2e/Maui/PrismMauiDemo/ViewModels/MainPageViewModel.cs",
    "content": "﻿namespace PrismMauiDemo.ViewModels;\n\ninternal class MainPageViewModel\n{\n    private INavigationService _navigationService { get; }\n\n    public MainPageViewModel(INavigationService navigationService)\n    {\n        _navigationService = navigationService;\n        NavigateCommand = new DelegateCommand<string>(OnNavigateCommandExecuted);\n    }\n\n    public DelegateCommand<string> NavigateCommand { get; }\n\n    private void OnNavigateCommandExecuted(string uri)\n    {\n        _navigationService.NavigateAsync(uri)\n            .OnNavigationError(ex => Console.WriteLine(ex));\n    }\n}\n"
  },
  {
    "path": "e2e/Maui/PrismMauiDemo/ViewModels/RootPageViewModel.cs",
    "content": "using MauiModule.ViewModels;\n\nnamespace PrismMauiDemo.ViewModels;\n\npublic class RootPageViewModel\n{\n    private INavigationService _navigationService { get; }\n\n    public RootPageViewModel(INavigationService navigationService)\n    {\n        _navigationService = navigationService;\n        NavigateCommand = new AsyncDelegateCommand<string>(OnNavigateCommandExecuted);\n    }\n\n    public AsyncDelegateCommand<string> NavigateCommand { get; }\n\n    private async Task OnNavigateCommandExecuted(string uri)\n    {\n        if (uri == \"TabbedPage\")\n        {\n            var result = await _navigationService.CreateBuilder()\n                .AddTabbedSegment(s => s.CreateTab<ViewAViewModel>()\n                    .CreateTab(t => t.AddNavigationPage().AddSegment<ViewBViewModel>())\n                    .CreateTab(\"ViewC\")\n                    .CreateTab(\"ViewD\"))\n                .NavigateAsync();\n            if (result.Exception is not null)\n            {\n                Console.WriteLine(result.Exception);\n                System.Diagnostics.Debugger.Break();\n            }\n        }\n        else\n        {\n            _navigationService.NavigateAsync(uri)\n                .OnNavigationError(ex => Console.WriteLine(ex));\n        }\n    }\n}\n"
  },
  {
    "path": "e2e/Maui/PrismMauiDemo/ViewModels/SplashPageViewModel.cs",
    "content": "namespace PrismMauiDemo.ViewModels;\n\ninternal class SplashPageViewModel : IPageLifecycleAware\n{\n    private INavigationService _navigationService { get; }\n\n    public SplashPageViewModel(INavigationService navigationService)\n    {\n        _navigationService = navigationService;\n    }\n\n    public void OnAppearing()\n    {\n        _navigationService.CreateBuilder()\n            .UseAbsoluteNavigation()\n            .AddSegment<RootPageViewModel>()\n            .Navigate();\n    }\n\n    public void OnDisappearing()\n    {\n\n    }\n}\n"
  },
  {
    "path": "e2e/Maui/PrismMauiDemo/Views/MainPage.xaml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<FlyoutPage xmlns=\"http://schemas.microsoft.com/dotnet/2021/maui\"\n            xmlns:x=\"http://schemas.microsoft.com/winfx/2009/xaml\"\n            xmlns:prism=\"http://prismlibrary.com\"\n            x:Class=\"PrismMauiDemo.Views.MainPage\"\n            Title=\"MainPage\"\n            BackgroundColor=\"White\">\n  <FlyoutPage.Flyout>\n    <ContentPage Title=\"Menu\">\n      <StackLayout Margin=\"20\"\n                   Spacing=\"15\">\n        <Button Text=\"ViewA\"\n                Command=\"{Binding NavigateCommand}\"\n                CommandParameter=\"NavigationPage/ViewA\" />\n        <Button Text=\"ViewB\"\n                Command=\"{Binding NavigateCommand}\"\n                CommandParameter=\"NavigationPage/ViewB\" />\n        <Button Text=\"ViewC\"\n                Command=\"{Binding NavigateCommand}\"\n                CommandParameter=\"NavigationPage/ViewC\" />\n        <Button Text=\"ViewD\"\n                Command=\"{Binding NavigateCommand}\"\n                CommandParameter=\"NavigationPage/ViewD\" />\n        <Button Text=\"SamplePage\"\n                Command=\"{Binding NavigateCommand}\"\n                CommandParameter=\"NavigationPage/SamplePage\" />\n        <Button Text=\"Root Page\"\n                Command=\"{Binding NavigateCommand}\"\n                CommandParameter=\"/RootPage\" />\n      </StackLayout>\n    </ContentPage>\n  </FlyoutPage.Flyout>\n</FlyoutPage>"
  },
  {
    "path": "e2e/Maui/PrismMauiDemo/Views/MainPage.xaml.cs",
    "content": "namespace PrismMauiDemo.Views;\n\npublic partial class MainPage : FlyoutPage\n{\n    public MainPage()\n    {\n        InitializeComponent();\n    }\n}"
  },
  {
    "path": "e2e/Maui/PrismMauiDemo/Views/RootPage.xaml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<ContentPage xmlns=\"http://schemas.microsoft.com/dotnet/2021/maui\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2009/xaml\"\n             x:Class=\"PrismMauiDemo.Views.RootPage\"\n             Title=\"RootPage\">\n  <Grid RowDefinitions=\"*,2*\">\n    <Image Source=\"logo.png\" HeightRequest=\"100\" />\n    <StackLayout HorizontalOptions=\"Center\"\n               Spacing=\"15\"\n                 Grid.Row=\"1\">\n      <Button Text=\"Flyout Page\"\n            Command=\"{Binding NavigateCommand}\"\n            CommandParameter=\"/MainPage/NavigationPage/ViewA/ViewB/ViewC/ViewD\" />\n      <Button Text=\"Tabbed Page\"\n            Command=\"{Binding NavigateCommand}\"\n            CommandParameter=\"TabbedPage\" />\n      <Button Text=\"Regions\"\n            Command=\"{Binding NavigateCommand}\"\n            CommandParameter=\"/RegionHome/NavigationPage/ContentRegionPage\" />\n    </StackLayout>\n  </Grid>\n</ContentPage>\n"
  },
  {
    "path": "e2e/Maui/PrismMauiDemo/Views/RootPage.xaml.cs",
    "content": "namespace PrismMauiDemo.Views;\n\npublic partial class RootPage : ContentPage\n{\n    public RootPage()\n    {\n        InitializeComponent();\n    }\n}"
  },
  {
    "path": "e2e/Maui/PrismMauiDemo/Views/SamplePage.xaml",
    "content": "<ContentPage xmlns=\"http://schemas.microsoft.com/dotnet/2021/maui\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2009/xaml\"\n             x:Class=\"PrismMauiDemo.Views.SamplePage\"\n             BackgroundColor=\"{DynamicResource SecondaryColor}\">\n\n  <ScrollView>\n    <Grid RowSpacing=\"25\" RowDefinitions=\"Auto,Auto,Auto,Auto,*\"\n          Padding=\"{OnPlatform iOS='30,60,30,30', Default='30'}\">\n\n      <Label Text=\"Hello, World!\"\n             Grid.Row=\"0\"\n             SemanticProperties.HeadingLevel=\"Level1\"\n             FontSize=\"32\"\n             HorizontalOptions=\"Center\" />\n\n      <Label Text=\"Welcome to .NET Multi-platform App UI\"\n             Grid.Row=\"1\"\n             SemanticProperties.HeadingLevel=\"Level1\"\n             SemanticProperties.Description=\"Welcome to dot net Multi platform App U I\"\n             FontSize=\"18\"\n             HorizontalOptions=\"Center\" />\n\n      <Label Text=\"Current count: 0\"\n             Grid.Row=\"2\"\n             FontSize=\"18\"\n             FontAttributes=\"Bold\"\n             x:Name=\"CounterLabel\"\n             HorizontalOptions=\"Center\" />\n\n      <Button Text=\"Click me\"\n              FontAttributes=\"Bold\"\n              Grid.Row=\"3\"\n              SemanticProperties.Hint=\"Counts the number of times you click\"\n              Clicked=\"OnCounterClicked\"\n              HorizontalOptions=\"Center\" />\n\n      <Image Grid.Row=\"4\"\n             Source=\"dotnet_bot.png\"\n             SemanticProperties.Description=\"Cute dot net bot waving hi to you!\"\n             WidthRequest=\"250\"\n             HeightRequest=\"310\"\n             HorizontalOptions=\"Center\" />\n\n    </Grid>\n  </ScrollView>\n</ContentPage>\n"
  },
  {
    "path": "e2e/Maui/PrismMauiDemo/Views/SamplePage.xaml.cs",
    "content": "﻿namespace PrismMauiDemo.Views;\n\npublic partial class SamplePage : ContentPage\n{\n    int count = 0;\n\n    public SamplePage()\n    {\n        InitializeComponent();\n    }\n\n    private void OnCounterClicked(object sender, EventArgs e)\n    {\n        count++;\n        CounterLabel.Text = $\"Current count: {count}\";\n\n        SemanticScreenReader.Announce(CounterLabel.Text);\n    }\n}\n\n"
  },
  {
    "path": "e2e/Maui/PrismMauiDemo/Views/SplashPage.xaml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<ContentPage xmlns=\"http://schemas.microsoft.com/dotnet/2021/maui\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2009/xaml\"\n             x:Class=\"PrismMauiDemo.Views.SplashPage\"\n             Title=\"Splash Page\">\n  <StackLayout>\n    <Label Text=\"Loading...\"\n           VerticalOptions=\"Center\" \n           HorizontalOptions=\"Center\" />\n  </StackLayout>\n</ContentPage>\n"
  },
  {
    "path": "e2e/Maui/PrismMauiDemo/Views/SplashPage.xaml.cs",
    "content": "namespace PrismMauiDemo.Views;\n\npublic partial class SplashPage : ContentPage\n{\n    public SplashPage()\n    {\n        InitializeComponent();\n    }\n}"
  },
  {
    "path": "e2e/Maui/PrismMauiDemo.sln",
    "content": "﻿\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio Version 17\nVisualStudioVersion = 17.0.31903.59\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"MauiModule\", \"MauiModule\\MauiModule.csproj\", \"{3B47AE8B-3773-4920-A012-B42182742ACA}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"MauiRegionsModule\", \"MauiRegionsModule\\MauiRegionsModule.csproj\", \"{2FF1C748-EA4C-45B1-80BA-A7D9E9E2C8F9}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"PrismMauiDemo\", \"PrismMauiDemo\\PrismMauiDemo.csproj\", \"{BB949746-5591-41FB-80B1-65BE609F6A0E}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Prism.Core\", \"..\\..\\src\\Prism.Core\\Prism.Core.csproj\", \"{2323BE09-7036-4FA7-B5B5-63046BE825E8}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Prism.Maui\", \"..\\..\\src\\Maui\\Prism.Maui\\Prism.Maui.csproj\", \"{2B756425-AB8D-4A78-80C5-13EA97C1AC73}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Prism.Maui.Rx\", \"..\\..\\src\\Maui\\Prism.Maui.Rx\\Prism.Maui.Rx.csproj\", \"{CC05A6F0-D8FF-498C-80F0-59DC9AAEB08E}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"src\", \"src\", \"{8202B92A-A573-4365-8A15-E246504A7CBD}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Prism.DryIoc.Maui\", \"..\\..\\src\\Maui\\Prism.DryIoc.Maui\\Prism.DryIoc.Maui.csproj\", \"{2CE09D7A-B67C-4586-8432-64EA2D1A3CE4}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"tests\", \"tests\", \"{E91F80AA-3D61-4C28-B876-3EDFB5921E7D}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Prism.DryIoc.Maui.Tests\", \"..\\..\\tests\\Maui\\Prism.DryIoc.Maui.Tests\\Prism.DryIoc.Maui.Tests.csproj\", \"{EE6F0C99-61D1-4E2E-8185-FBA0D246D5C7}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Prism.Maui.Tests\", \"..\\..\\tests\\Maui\\Prism.Maui.Tests\\Prism.Maui.Tests.csproj\", \"{F3D2DFDB-95FB-4CBB-A624-35EB6550854D}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Prism.Core.Tests\", \"..\\..\\tests\\Prism.Core.Tests\\Prism.Core.Tests.csproj\", \"{E0F13AA9-8083-47CA-B10D-93C5285D1505}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Prism.Events\", \"..\\..\\src\\Prism.Events\\Prism.Events.csproj\", \"{5623CB62-59C1-49BC-BB16-4C5D63D82DAC}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"Solution Items\", \"Solution Items\", \"{16C4C33B-CC0F-4FA4-A117-B9EF161CB7B8}\"\n\tProjectSection(SolutionItems) = preProject\n\t\t..\\..\\Directory.Packages.props = ..\\..\\Directory.Packages.props\n\tEndProjectSection\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Any CPU = Debug|Any CPU\n\t\tRelease|Any CPU = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{3B47AE8B-3773-4920-A012-B42182742ACA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{3B47AE8B-3773-4920-A012-B42182742ACA}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{3B47AE8B-3773-4920-A012-B42182742ACA}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{3B47AE8B-3773-4920-A012-B42182742ACA}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{2FF1C748-EA4C-45B1-80BA-A7D9E9E2C8F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{2FF1C748-EA4C-45B1-80BA-A7D9E9E2C8F9}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{2FF1C748-EA4C-45B1-80BA-A7D9E9E2C8F9}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{2FF1C748-EA4C-45B1-80BA-A7D9E9E2C8F9}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{BB949746-5591-41FB-80B1-65BE609F6A0E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{BB949746-5591-41FB-80B1-65BE609F6A0E}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{BB949746-5591-41FB-80B1-65BE609F6A0E}.Debug|Any CPU.Deploy.0 = Debug|Any CPU\n\t\t{BB949746-5591-41FB-80B1-65BE609F6A0E}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{BB949746-5591-41FB-80B1-65BE609F6A0E}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{2323BE09-7036-4FA7-B5B5-63046BE825E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{2323BE09-7036-4FA7-B5B5-63046BE825E8}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{2323BE09-7036-4FA7-B5B5-63046BE825E8}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{2323BE09-7036-4FA7-B5B5-63046BE825E8}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{2B756425-AB8D-4A78-80C5-13EA97C1AC73}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{2B756425-AB8D-4A78-80C5-13EA97C1AC73}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{2B756425-AB8D-4A78-80C5-13EA97C1AC73}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{2B756425-AB8D-4A78-80C5-13EA97C1AC73}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{CC05A6F0-D8FF-498C-80F0-59DC9AAEB08E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{CC05A6F0-D8FF-498C-80F0-59DC9AAEB08E}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{CC05A6F0-D8FF-498C-80F0-59DC9AAEB08E}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{CC05A6F0-D8FF-498C-80F0-59DC9AAEB08E}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{2CE09D7A-B67C-4586-8432-64EA2D1A3CE4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{2CE09D7A-B67C-4586-8432-64EA2D1A3CE4}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{2CE09D7A-B67C-4586-8432-64EA2D1A3CE4}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{2CE09D7A-B67C-4586-8432-64EA2D1A3CE4}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{EE6F0C99-61D1-4E2E-8185-FBA0D246D5C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{EE6F0C99-61D1-4E2E-8185-FBA0D246D5C7}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{EE6F0C99-61D1-4E2E-8185-FBA0D246D5C7}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{EE6F0C99-61D1-4E2E-8185-FBA0D246D5C7}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{F3D2DFDB-95FB-4CBB-A624-35EB6550854D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{F3D2DFDB-95FB-4CBB-A624-35EB6550854D}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{F3D2DFDB-95FB-4CBB-A624-35EB6550854D}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{F3D2DFDB-95FB-4CBB-A624-35EB6550854D}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{E0F13AA9-8083-47CA-B10D-93C5285D1505}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{E0F13AA9-8083-47CA-B10D-93C5285D1505}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{E0F13AA9-8083-47CA-B10D-93C5285D1505}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{E0F13AA9-8083-47CA-B10D-93C5285D1505}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{5623CB62-59C1-49BC-BB16-4C5D63D82DAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{5623CB62-59C1-49BC-BB16-4C5D63D82DAC}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{5623CB62-59C1-49BC-BB16-4C5D63D82DAC}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{5623CB62-59C1-49BC-BB16-4C5D63D82DAC}.Release|Any CPU.Build.0 = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\n\tGlobalSection(NestedProjects) = preSolution\n\t\t{2323BE09-7036-4FA7-B5B5-63046BE825E8} = {8202B92A-A573-4365-8A15-E246504A7CBD}\n\t\t{2B756425-AB8D-4A78-80C5-13EA97C1AC73} = {8202B92A-A573-4365-8A15-E246504A7CBD}\n\t\t{CC05A6F0-D8FF-498C-80F0-59DC9AAEB08E} = {8202B92A-A573-4365-8A15-E246504A7CBD}\n\t\t{2CE09D7A-B67C-4586-8432-64EA2D1A3CE4} = {8202B92A-A573-4365-8A15-E246504A7CBD}\n\t\t{EE6F0C99-61D1-4E2E-8185-FBA0D246D5C7} = {E91F80AA-3D61-4C28-B876-3EDFB5921E7D}\n\t\t{F3D2DFDB-95FB-4CBB-A624-35EB6550854D} = {E91F80AA-3D61-4C28-B876-3EDFB5921E7D}\n\t\t{E0F13AA9-8083-47CA-B10D-93C5285D1505} = {E91F80AA-3D61-4C28-B876-3EDFB5921E7D}\n\t\t{5623CB62-59C1-49BC-BB16-4C5D63D82DAC} = {8202B92A-A573-4365-8A15-E246504A7CBD}\n\tEndGlobalSection\n\tGlobalSection(ExtensibilityGlobals) = postSolution\n\t\tSolutionGuid = {50B0D1F3-D832-4C6C-858E-24F5F3B33632}\n\tEndGlobalSection\n\tGlobalSection(SharedMSBuildProjectFiles) = preSolution\n\t\t..\\..\\src\\Containers\\Prism.DryIoc.Shared\\Prism.DryIoc.Shared.projitems*{2ce09d7a-b67c-4586-8432-64ea2d1a3ce4}*SharedItemsImports = 5\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "e2e/README.md",
    "content": "# End to End Apps\n\nThe End to End apps here are used for both local testing and development and in some cases for full UI Testing integrations in the Build Pipeline. These are not necessarily examples meant to demonstrate best practices. They are however meant to provide the team the ability to validate functionality.\n\n# Stable samples\n\nMore complete and stable samples showing how to use Prism for your application development will be posted in separate repositories under the [PrismLibrary GitHub organization](https://github.com/PrismLibrary). These samples are based on public released NuGet packages and are thus more stable than the sandbox samples. Guidance on specific scenarios can be found in these stable samples.\n\n* [WPF](https://github.com/PrismLibrary/Prism-Samples-Wpf)\n* [Xamarin Forms](https://github.com/PrismLibrary/Prism-Samples-Forms)\n"
  },
  {
    "path": "e2e/Uno/.gitignore",
    "content": "!*.pubxml\n"
  },
  {
    "path": "e2e/Uno/Directory.Build.props",
    "content": "<Project>\n  <PropertyGroup>\n    <DotNetVersion>net10.0</DotNetVersion>\n    <ImplicitUsings>enable</ImplicitUsings>\n    <Nullable>enable</Nullable>\n    <IsUnoProject>true</IsUnoProject>\n    <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>\n\n    <!--\n      Adding NoWarn to remove build warnings\n      NU1507: Warning when there are multiple package sources when using CPM with no source mapping\n      NETSDK1201: Warning that specifying RID won't create self containing app\n      PRI257: Ignore default language (en) not being one of the included resources (eg en-us, en-uk)\n    -->\n    <NoWarn>$(NoWarn);NU1507;NETSDK1201;PRI257</NoWarn>\n\n    <!-- Required for Hot Reload (See https://github.com/dotnet/sdk/issues/36666) -->\n    <IncludeSourceRevisionInInformationalVersion Condition=\"'$(Configuration)'=='Debug'\">false</IncludeSourceRevisionInInformationalVersion>\n  </PropertyGroup>\n</Project>\n"
  },
  {
    "path": "e2e/Uno/Directory.Build.targets",
    "content": "<Project ToolsVersion=\"15.0\">\n  <Import Project=\"..\\..\\src\\Prism.Core\\build\\Package.targets\" />\n  <Import Project=\"..\\..\\src\\Prism.Events\\build\\Package.targets\" />\n</Project>\n"
  },
  {
    "path": "e2e/Uno/HelloWorld/App.cs",
    "content": "using HelloWorld.Views;\nusing ModuleA;\nusing Uno.UI;\n\nnamespace HelloWorld;\n\npublic class App : PrismApplication\n{\n    protected override UIElement CreateShell()\n    {\n        return Container.Resolve<Shell>();\n    }\n\n    protected override void ConfigureHost(IHostBuilder builder)\n    {\n        builder\n#if DEBUG\n                // Switch to Development environment when running in DEBUG\n                .UseEnvironment(Environments.Development)\n#endif\n                .UseLogging(configure: (context, logBuilder) =>\n                {\n                    // Configure log levels for different categories of logging\n                    logBuilder.SetMinimumLevel(\n                        context.HostingEnvironment.IsDevelopment() ?\n                            LogLevel.Information :\n                            LogLevel.Warning);\n                }, enableUnoLogging: true)\n                .UseSerilog(consoleLoggingEnabled: true, fileLoggingEnabled: true)\n                // Register Json serializers (ISerializer and ISerializer)\n                .UseSerialization()\n                .ConfigureServices((context, services) =>\n                {\n                    // TODO: Register your services\n                    //services.AddSingleton<IMyService, MyService>();\n                });\n    }\n\n    protected override void ConfigureWindow(Window window)\n    {\n#if DEBUG\n        window.EnableHotReload();\n#endif\n    }\n\n    protected override void RegisterTypes(IContainerRegistry containerRegistry)\n    {\n        // Register types with the container or for Navigation\n    }\n\n    protected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog)\n    {\n        moduleCatalog.AddModule<ModuleAModule>();\n    }\n}\n"
  },
  {
    "path": "e2e/Uno/HelloWorld/AppResources.xaml",
    "content": "﻿<ResourceDictionary xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n                    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\">\n\n  <ResourceDictionary.MergedDictionaries>\n    <!-- Load WinUI resources -->\n    <XamlControlsResources xmlns=\"using:Microsoft.UI.Xaml.Controls\" />\n    <MaterialTheme xmlns=\"using:Uno.Material\"\n      ColorOverrideSource=\"ms-appx:///HelloWorld/Styles/ColorPaletteOverride.xaml\"\n      FontOverrideSource=\"ms-appx:///HelloWorld/Styles/MaterialFontsOverride.xaml\" />\n\n    <!-- Load Uno.UI.Toolkit resources -->\n    <ToolkitResources xmlns=\"using:Uno.Toolkit.UI\" />\n    <MaterialToolkitResources xmlns=\"using:Uno.Toolkit.UI.Material\" />\n  </ResourceDictionary.MergedDictionaries>\n  <!-- Add resources here -->\n\n</ResourceDictionary>\n"
  },
  {
    "path": "e2e/Uno/HelloWorld/Assets/SharedAssets.md",
    "content": "# Shared Assets\n\nSee documentation about assets here: https://github.com/unoplatform/uno/blob/master/doc/articles/features/working-with-assets.md\n\n## Here is a cheat sheet\n\n1. Add the image file to the `Assets` directory of a shared project.\n2. Set the build action to `Content`.\n3. (Recommended) Provide an asset for various scales/dpi\n\n### Examples\n\n```text\n\\Assets\\Images\\logo.scale-100.png\n\\Assets\\Images\\logo.scale-200.png\n\\Assets\\Images\\logo.scale-400.png\n\n\\Assets\\Images\\scale-100\\logo.png\n\\Assets\\Images\\scale-200\\logo.png\n\\Assets\\Images\\scale-400\\logo.png\n```\n\n### Table of scales\n\n| Scale | WinUI       | iOS/MacCatalyst | Android |\n|-------|:-----------:|:---------------:|:-------:|\n| `100` | scale-100   | @1x             | mdpi    |\n| `125` | scale-125   | N/A             | N/A     |\n| `150` | scale-150   | N/A             | hdpi    |\n| `200` | scale-200   | @2x             | xhdpi   |\n| `300` | scale-300   | @3x             | xxhdpi  |\n| `400` | scale-400   | N/A             | xxxhdpi |\n"
  },
  {
    "path": "e2e/Uno/HelloWorld/GlobalUsings.cs",
    "content": "﻿global using System.Collections.Immutable;\nglobal using System.Windows.Input;\nglobal using Microsoft.Extensions.DependencyInjection;\nglobal using Microsoft.Extensions.Hosting;\nglobal using Microsoft.Extensions.Logging;\nglobal using Microsoft.UI.Xaml;\nglobal using Microsoft.UI.Xaml.Controls;\nglobal using Microsoft.UI.Xaml.Media;\nglobal using Microsoft.UI.Xaml.Navigation;\nglobal using Uno.Extensions;\nglobal using Uno.Extensions.Hosting;\nglobal using Uno.Extensions.Logging;\nglobal using Uno.Toolkit.UI;\nglobal using Windows.ApplicationModel;\nglobal using Windows.Networking.Connectivity;\nglobal using Windows.Storage;\nglobal using Prism.DryIoc;\nglobal using Application = Microsoft.UI.Xaml.Application;\nglobal using ApplicationExecutionState = Windows.ApplicationModel.Activation.ApplicationExecutionState;\n"
  },
  {
    "path": "e2e/Uno/HelloWorld/HelloWorld.csproj",
    "content": "<Project Sdk=\"Uno.Sdk\">\n  <PropertyGroup>\n    <TargetFrameworks Condition=\"$([MSBuild]::IsOSPlatform('windows')) or '$(EnableWindowsTargeting)' == 'true'\">$(TargetFrameworks);$(DotNetVersion)-windows10.0.22621</TargetFrameworks>\n    <TargetFrameworks>$(TargetFrameworks);$(DotNetVersion);$(DotNetVersion)-android;$(DotNetVersion)-ios;$(DotNetVersion)-maccatalyst</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(OverrideTargetFramework)'!=''\">$(OverrideTargetFramework)</TargetFrameworks>\n\n    <!-- Ensures the .xr.xml files are generated in a proper layout folder -->\n    <GenerateLibraryLayout>true</GenerateLibraryLayout>\n    <!--\n      If you encounter this error message:\n\n        error NETSDK1148: A referenced assembly was compiled using a newer version of Microsoft.Windows.SDK.NET.dll.\n        Please update to a newer .NET SDK in order to reference this assembly.\n\n      This means that the two packages below must be aligned with the \"build\" version number of\n      the \"Microsoft.Windows.SDK.BuildTools\" package above, and the \"revision\" version number\n      must be the highest found in https://www.nuget.org/packages/Microsoft.Windows.SDK.NET.Ref.\n    -->\n    <!-- <WindowsSdkPackageVersion>10.0.22621.28</WindowsSdkPackageVersion> -->\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Uno.WinUI\" />\n    <PackageReference Include=\"Uno.WinUI.Lottie\" Condition=\"!$(TargetFramework.Contains('windows10'))\" />\n    <PackageReference Include=\"Uno.WinUI.DevServer\" Condition=\"'$(Configuration)'=='Debug' AND !$(TargetFramework.Contains('windows10'))\" />\n    <PackageReference Include=\"Uno.Resizetizer\" />\n    <PackageReference Include=\"Uno.Extensions.Logging.WinUI\" />\n    <PackageReference Include=\"Uno.Extensions.Logging.Serilog\" />\n    <PackageReference Include=\"Uno.Material.WinUI\" />\n    <PackageReference Include=\"Uno.Toolkit.WinUI.Material\" />\n    <PackageReference Include=\"Uno.Toolkit.WinUI\" />\n    <PackageReference Include=\"Uno.Extensions.Hosting.WinUI\" />\n    <PackageReference Include=\"Microsoft.Extensions.Logging.Console\" />\n    <PackageReference Include=\"Microsoft.WindowsAppSDK\" Condition=\"$(TargetFramework.Contains('windows10'))\" />\n    <PackageReference Include=\"Microsoft.Windows.SDK.BuildTools\" Condition=\"$(TargetFramework.Contains('windows10'))\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\..\\src\\Prism.Core\\Prism.Core.csproj\" />\n    <ProjectReference Include=\"..\\..\\..\\src\\Uno\\Prism.DryIoc.Uno\\Prism.DryIoc.Uno.WinUI.csproj\" />\n    <ProjectReference Include=\"..\\..\\..\\src\\Uno\\Prism.Uno\\Prism.Uno.WinUI.csproj\" />\n    <ProjectReference Include=\"..\\ModuleA\\ModuleA.csproj\" />\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": "e2e/Uno/HelloWorld/Strings/en/Resources.resw",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!--\n    Microsoft ResX Schema\n\n    Version 2.0\n\n    The primary goals of this format is to allow a simple XML format\n    that is mostly human readable. The generation and parsing of the\n    various data types are done through the TypeConverter classes\n    associated with the data types.\n\n    Example:\n\n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n\n    There are any number of \"resheader\" rows that contain simple\n    name/value pairs.\n\n    Each data row contains a name, and value. The row also contains a\n    type or mimetype. Type corresponds to a .NET class that support\n    text/value conversion through the TypeConverter architecture.\n    Classes that don't support this are serialized and stored with the\n    mimetype set.\n\n    The mimetype is used for serialized objects, and tells the\n    ResXResourceReader how to depersist the object. This is currently not\n    extensible. For a given mimetype the value must be set accordingly:\n\n    Note - application/x-microsoft.net.object.binary.base64 is the format\n    that the ResXResourceWriter will generate, however the reader can\n    read any of the formats listed below.\n\n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with\n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with\n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array\n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <data name=\"ApplicationName\" xml:space=\"preserve\">\n    <value>HelloWorld-en</value>\n  </data>\n</root>\n"
  },
  {
    "path": "e2e/Uno/HelloWorld/Styles/ColorPaletteOverride.xaml",
    "content": "<ResourceDictionary xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n\t\t\t\t\txmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\">\n\t<ResourceDictionary.ThemeDictionaries>\n\t\t<!-- Light Theme -->\n\t\t<ResourceDictionary x:Key=\"Light\">\n\n\t\t\t<Color x:Key=\"PrimaryColor\">#5B4CF5</Color>\n\t\t\t<Color x:Key=\"SecondaryColor\">#67E5AD</Color>\n\t\t\t<Color x:Key=\"BackgroundColor\">#F4F4F4</Color>\n\t\t\t<Color x:Key=\"SurfaceColor\">#FFFFFF</Color>\n\t\t\t<Color x:Key=\"OnSurfaceColor\">#000000</Color>\n\t\t\t<Color x:Key=\"ErrorColor\">#F85977</Color>\n\n\t\t\t<!-- OnPrimary -->\n\t\t\t<Color x:Key=\"OnPrimaryColor\">#FFFFFF</Color>\n\n\t\t\t<!-- OnSecondary -->\n\t\t\t<Color x:Key=\"OnSecondaryColor\">#000000</Color>\n\n\t\t\t<!-- OnBackground -->\n\t\t\t<Color x:Key=\"OnBackgroundColor\">#000000</Color>\n\n\t\t\t<!-- OnError -->\n\t\t\t<Color x:Key=\"OnErrorColor\">#FFFFFF</Color>\n\t\t</ResourceDictionary>\n\n\t\t<!-- Dark Theme -->\n\t\t<ResourceDictionary x:Key=\"Dark\">\n\t\t\t<!-- Primary -->\n\t\t\t<Color x:Key=\"PrimaryColor\">#2F81D8</Color>\n\n\t\t\t<!-- OnPrimary -->\n\t\t\t<Color x:Key=\"OnPrimaryColor\">#FFFFFF</Color>\n\n\t\t\t<!-- Secondary -->\n\t\t\t<Color x:Key=\"SecondaryColor\">#FEB839</Color>\n\n\t\t\t<!-- OnSecondary -->\n\t\t\t<Color x:Key=\"OnSecondaryColor\">#000000</Color>\n\n\t\t\t<!-- Background -->\n\t\t\t<Color x:Key=\"BackgroundColor\">#000000</Color>\n\n\t\t\t<!-- OnBackground -->\n\t\t\t<Color x:Key=\"OnBackgroundColor\">#FFFFFF</Color>\n\n\t\t\t<!-- Surface -->\n\t\t\t<Color x:Key=\"SurfaceColor\">#0F0F0F</Color>\n\n\t\t\t<!-- OnSurface -->\n\t\t\t<Color x:Key=\"OnSurfaceColor\">#FFFFFF</Color>\n\n\t\t\t<!-- Error -->\n\t\t\t<Color x:Key=\"ErrorColor\">#B2213C</Color>\n\n\t\t\t<!-- OnError -->\n\t\t\t<Color x:Key=\"OnErrorColor\">#FFFFFF</Color>\n\t\t</ResourceDictionary>\n\n\t</ResourceDictionary.ThemeDictionaries>\n\n</ResourceDictionary>\n"
  },
  {
    "path": "e2e/Uno/HelloWorld/ViewModels/ShellViewModel.cs",
    "content": "namespace HelloWorld.ViewModels;\n\npublic class ShellViewModel : BindableBase\n{\n    public string Title { get; set; } = \"Hello Prism for Uno.WinUI\";\n\n    private readonly IRegionManager _regionManager;\n\n    public DelegateCommand<string> NavigateCommand { get; }\n\n    public ShellViewModel(IRegionManager regionManager)\n    {\n        _regionManager = regionManager;\n        NavigateCommand = new DelegateCommand<string>(ExecuteNavigateCommand);\n    }\n\n    private void ExecuteNavigateCommand(string viewName)\n    {\n        _regionManager.RequestNavigate(\"ContentRegion\", viewName);\n    }\n}\n"
  },
  {
    "path": "e2e/Uno/HelloWorld/Views/Shell.xaml",
    "content": "<Page\n    x:Class=\"HelloWorld.Views.Shell\"\n    xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n    xmlns:prism=\"using:Prism.Navigation.Regions\"\n    xmlns:toolkit=\"using:Uno.Toolkit.UI\"\n    xmlns:local=\"using:HelloWorld.Views\"\n    Background=\"{ThemeResource ApplicationPageBackgroundThemeBrush}\" >\n\n  <toolkit:ExtendedSplashScreen x:Name=\"Splash\"\n                HorizontalAlignment=\"Stretch\"\n                VerticalAlignment=\"Stretch\"\n                HorizontalContentAlignment=\"Stretch\"\n                VerticalContentAlignment=\"Stretch\">\n    <toolkit:ExtendedSplashScreen.LoadingContentTemplate>\n      <DataTemplate>\n        <Grid>\n          <Grid.RowDefinitions>\n            <RowDefinition Height=\"2*\" />\n            <RowDefinition />\n          </Grid.RowDefinitions>\n\n          <ProgressRing IsActive=\"True\"\n                  Grid.Row=\"1\"\n                  VerticalAlignment=\"Center\"\n                  HorizontalAlignment=\"Center\"\n                  Height=\"100\"\n                  Width=\"100\" />\n        </Grid>\n      </DataTemplate>\n    </toolkit:ExtendedSplashScreen.LoadingContentTemplate>\n    <Grid>\n      <!--<Grid.RowDefinitions>\n        <RowDefinition Height=\"auto\"/>\n        <RowDefinition Height=\"*\" />\n      </Grid.RowDefinitions>\n      <StackPanel Margin=\"20\"\n                HorizontalAlignment=\"Center\"\n                Spacing=\"15\">\n        <Image Source=\"ms-appx:///HelloWorld/Assets/prism.png\"\n             MaxHeight=\"80\"/>\n        <TextBlock Text=\"{Binding Title}\" FontSize=\"30\" />\n        <StackPanel Orientation=\"Horizontal\"\n                  Spacing=\"15\">\n          <Button Command=\"{Binding NavigateCommand}\" CommandParameter=\"ViewA\">Navigate to View A</Button>\n          <Button Command=\"{Binding NavigateCommand}\" CommandParameter=\"ViewB\">Navigate to View B</Button>\n        </StackPanel>\n      </StackPanel>\n      <ContentControl Grid.Row=\"1\" prism:RegionManager.RegionName=\"ContentRegion\" />-->\n      <NavigationView prism:RegionManager.RegionName=\"ContentRegion\"\n                      IsSettingsVisible=\"false\">\n        <NavigationView.MenuItems>\n          <NavigationViewItem Content=\"View A\" Tag=\"ViewA\" />\n          <NavigationViewItem Content=\"View B\" Tag=\"ViewB\" />\n        </NavigationView.MenuItems>\n      </NavigationView>\n\n    </Grid>\n  </toolkit:ExtendedSplashScreen>\n\n</Page>\n"
  },
  {
    "path": "e2e/Uno/HelloWorld/Views/Shell.xaml.cs",
    "content": "using Uno.Toolkit;\n\nnamespace HelloWorld.Views;\n\n/// <summary>\n/// An empty page that can be used on its own or navigated to within a Frame.\n/// </summary>\npublic sealed partial class Shell : Page, ILoadableShell\n{\n    private readonly CompositeLoadableSource _loadable;\n    public Shell()\n    {\n        this.InitializeComponent();\n        _loadable = new ()\n        {\n            IsExecuting = true\n        };\n        Splash.Source = _loadable;\n    }\n\n    public void FinishLoading()\n    {\n        _loadable.IsExecuting = false;\n    }\n}\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.Mobile/Android/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\">\n  <application android:allowBackup=\"true\" android:supportsRtl=\"true\"></application>\n</manifest>\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.Mobile/Android/Assets/AboutAssets.txt",
    "content": "To add cross-platform image assets for your Uno Platform app, use the Assets folder\nin the shared project instead. Assets in this folder are Android-only assets.\n\nAny raw assets you want to be deployed with your application can be placed in\nthis directory (and child directories) and given a Build Action of \"AndroidAsset\".\n\nThese files will be deployed with you package and will be accessible using Android's\nAssetManager, like this:\n\npublic class ReadAsset : Activity\n{\n\tprotected override void OnCreate (Bundle bundle)\n\t{\n\t\tbase.OnCreate (bundle);\n\n\t\tInputStream input = Assets.Open (\"my_asset.txt\");\n\t}\n}\n\nAdditionally, some Android functions will automatically load asset files:\n\nTypeface tf = Typeface.CreateFromAsset (Context.Assets, \"fonts/samplefont.ttf\");\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.Mobile/Android/Main.Android.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Android.App;\nusing Android.Content;\nusing Android.OS;\nusing Android.Runtime;\nusing Android.Views;\nusing Android.Widget;\nusing Com.Nostra13.Universalimageloader.Core;\nusing Microsoft.UI.Xaml.Media;\n\nnamespace HelloWorld.Droid;\n\n[global::Android.App.ApplicationAttribute(\n    Label = \"@string/ApplicationName\",\n    Icon = \"@mipmap/icon\",\n    LargeHeap = true,\n    HardwareAccelerated = true,\n    Theme = \"@style/AppTheme\"\n)]\npublic class Application : Microsoft.UI.Xaml.NativeApplication\n{\n    public Application(IntPtr javaReference, JniHandleOwnership transfer)\n        : base(() => new AppHead(), javaReference, transfer)\n    {\n        ConfigureUniversalImageLoader();\n    }\n\n    private static void ConfigureUniversalImageLoader()\n    {\n        // Create global configuration and initialize ImageLoader with this config\n        ImageLoaderConfiguration config = new ImageLoaderConfiguration\n            .Builder(Context)\n            .Build();\n\n        ImageLoader.Instance.Init(config);\n\n        ImageSource.DefaultImageLoader = ImageLoader.Instance.LoadImageAsync;\n    }\n}\n\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.Mobile/Android/MainActivity.Android.cs",
    "content": "using Android.App;\nusing Android.Content.PM;\nusing Android.OS;\nusing Android.Views;\nusing Android.Widget;\n\nnamespace HelloWorld.Droid;\n\n[Activity(\n    MainLauncher = true,\n    ConfigurationChanges = global::Uno.UI.ActivityHelper.AllConfigChanges,\n    WindowSoftInputMode = SoftInput.AdjustNothing | SoftInput.StateHidden\n)]\npublic class MainActivity : Microsoft.UI.Xaml.ApplicationActivity\n{\n}\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.Mobile/Android/Resources/AboutResources.txt",
    "content": "To add cross-platform image assets for your Uno Platform app, use the Assets folder\nin the shared project instead. Resources in this folder are Android-only.\n\nImages, layout descriptions, binary blobs and string dictionaries can be included \nin your application as resource files.  Various Android APIs are designed to \noperate on the resource IDs instead of dealing with images, strings or binary blobs \ndirectly.\n\nFor example, a sample Android app that contains a user interface layout (main.axml),\nan internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png) \nwould keep its resources in the \"Resources\" directory of the application:\n\nResources/\n    drawable/\n        icon.png\n\n    layout/\n        main.axml\n\n    values/\n        strings.xml\n\nIn order to get the build system to recognize Android resources, set the build action to\n\"AndroidResource\".  The native Android APIs do not operate directly with filenames, but \ninstead operate on resource IDs.  When you compile an Android application that uses resources, \nthe build system will package the resources for distribution and generate a class called \"R\" \n(this is an Android convention) that contains the tokens for each one of the resources \nincluded. For example, for the above Resources layout, this is what the R class would expose:\n\npublic class R {\n    public class drawable {\n        public const int icon = 0x123;\n    }\n\n    public class layout {\n        public const int main = 0x456;\n    }\n\n    public class strings {\n        public const int first_string = 0xabc;\n        public const int second_string = 0xbcd;\n    }\n}\n\nYou would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main \nto reference the layout/main.axml file, or R.strings.first_string to reference the first \nstring in the dictionary file values/strings.xml.\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.Mobile/Android/Resources/values/Strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\t<string name=\"Hello\">Hello World, Click Me!</string>\n\t<string name=\"ApplicationName\">HelloWorld</string>\n</resources>\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.Mobile/Android/Resources/values/Styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<resources>\n\t<style name=\"AppTheme\" parent=\"Theme.MaterialComponents.Light\">\n\n\t\t<!-- This removes the ActionBar -->\n\t\t<item name=\"windowActionBar\">false</item>\n\t\t<item name=\"android:windowActionBar\">false</item>\n\t\t<item name=\"windowNoTitle\">true</item>\n\t\t<item name=\"android:windowNoTitle\">true</item>\n\n\t\t<!-- uno_splash_color and uno_splash_image are generated by Uno.Resizetizer -->\n\t\t<!-- This property is used for the splash screen -->\n\t\t<item name=\"android:windowSplashScreenBackground\">@color/uno_splash_color</item>\n\t\t<item name=\"android:windowBackground\">@drawable/uno_splash_image</item>\n\t\t<item name=\"android:windowSplashScreenAnimatedIcon\">@drawable/uno_splash_image</item>\n\t</style>\n\t<style name=\"Theme.AppCompat.Translucent\">\n\t\t<item name=\"android:windowIsTranslucent\">true</item>\n\t\t<item name=\"android:windowAnimationStyle\">@android:style/Animation</item>\n\t</style>\n\n</resources>\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.Mobile/Android/environment.conf",
    "content": "# See this for more details: http://developer.xamarin.com/guides/android/advanced_topics/garbage_collection/\nMONO_GC_PARAMS=bridge-implementation=tarjan,nursery-size=32m,soft-heap-limit=256m"
  },
  {
    "path": "e2e/Uno/HelloWorld.Mobile/HelloWorld.Mobile.csproj",
    "content": "<Project Sdk=\"Uno.Sdk\">\n  <PropertyGroup>\n    <TargetFrameworks>$(DotNetVersion)-android;$(DotNetVersion)-ios;$(DotNetVersion)-maccatalyst</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(OverrideTargetFramework)'!=''\">$(OverrideTargetFramework)</TargetFrameworks>\n    <SingleProject>true</SingleProject>\n    <OutputType>Exe</OutputType>\n    <!-- Display name -->\n    <ApplicationTitle>HelloWorld</ApplicationTitle>\n    <!-- App Identifier -->\n    <ApplicationId>com.prismlibrary.unoe2e</ApplicationId>\n    <ApplicationIdGuid>99E7FC0B-E6B5-4000-B84D-21FBA59E0E45</ApplicationIdGuid>\n    <!-- Versions -->\n    <ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>\n    <ApplicationVersion>1</ApplicationVersion>\n\n    <!-- Debugger workaround https://github.com/dotnet/maui-samples/blob/8aa6b8780b12e97b157514c3bdc54bb4a13001cd/HelloMacCatalyst/HelloMacCatalyst.csproj#L7 -->\n    <!-- <MtouchExtraArgs Condition=\"$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'\">$(MtouchExtraArgs) -setenv:MONO_THREADS_SUSPEND=preemptive</MtouchExtraArgs> -->\n    <!-- Required for C# Hot Reload -->\n    <UseInterpreter Condition=\"'$(Configuration)' == 'Debug' and $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) != 'maccatalyst'\">True</UseInterpreter>\n    <IsUnoHead>true</IsUnoHead>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Uno.WinUI\" />\n    <PackageReference Include=\"Uno.WinUI.DevServer\" Condition=\"'$(Configuration)'=='Debug'\" />\n    <PackageReference Include=\"Uno.UI.Adapter.Microsoft.Extensions.Logging\" />\n    <PackageReference Include=\"Uno.Material.WinUI\" />\n    <PackageReference Include=\"Uno.Toolkit.WinUI.Material\" />\n    <PackageReference Include=\"Uno.Toolkit.WinUI\" />\n    <PackageReference Include=\"Uno.Extensions.Hosting.WinUI\" />\n    <PackageReference Include=\"Uno.Extensions.Logging.OSLog\" />\n    <PackageReference Include=\"Uno.Extensions.Logging.WinUI\" />\n    <PackageReference Include=\"Uno.Extensions.Logging.Serilog\" />\n  </ItemGroup>\n  <Choose>\n    <When Condition=\"$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'\">\n      <ItemGroup>\n        <PackageReference Include=\"Xamarin.Google.Android.Material\" />\n        <PackageReference Include=\"Uno.UniversalImageLoader\" />\n      </ItemGroup>\n    </When>\n    <When Condition=\"$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'\">\n      <PropertyGroup>\n        <MtouchExtraArgs>$(MtouchExtraArgs) --setenv=MONO_GC_PARAMS=soft-heap-limit=512m,nursery-size=64m,evacuation-threshold=66,major=marksweep,concurrent-sweep</MtouchExtraArgs>\n        <!-- See https://github.com/unoplatform/uno/issues/9430 for more details. -->\n        <MtouchExtraArgs>$(MtouchExtraArgs) --registrar:static</MtouchExtraArgs>\n      </PropertyGroup>\n      <PropertyGroup Condition=\"'$(Configuration)'=='Release'\">\n        <!-- https://github.com/xamarin/xamarin-macios/issues/14812 -->\n        <MtouchExtraArgs>$(MtouchExtraArgs) --marshal-objectivec-exceptions:disable</MtouchExtraArgs>\n      </PropertyGroup>\n    </When>\n    <When Condition=\"$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'\">\n      <PropertyGroup>\n        <!-- Configure the GC -->\n        <MtouchExtraArgs>$(MtouchExtraArgs) --setenv=MONO_GC_PARAMS=soft-heap-limit=512m,nursery-size=64m,evacuation-threshold=66,major=marksweep,concurrent-sweep</MtouchExtraArgs>\n        <!-- Required for unknown crash as of .NET 6 Mobile Preview 13 -->\n        <MtouchExtraArgs>$(MtouchExtraArgs) --registrar:static</MtouchExtraArgs>\n        <!-- Full globalization is required for Uno -->\n        <InvariantGlobalization>false</InvariantGlobalization>\n      </PropertyGroup>\n      <PropertyGroup Condition=\"'$(Configuration)'=='Release'\">\n        <!-- https://github.com/xamarin/xamarin-macios/issues/14812 -->\n        <MtouchExtraArgs>$(MtouchExtraArgs) --marshal-objectivec-exceptions:disable</MtouchExtraArgs>\n      </PropertyGroup>\n    </When>\n  </Choose>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\HelloWorld\\HelloWorld.csproj\" />\n  </ItemGroup>\n  <Import Project=\"..\\HelloWorld.Shared\\base.props\" />\n\n  <Target Name=\"ValidateOverrides\" BeforeTargets=\"Restore;_CheckForUnsupportedTargetFramework\" Condition=\"'$(OverrideTargetFramework)' != ''\">\n    <Error\n        Text=\"OverrideTargetFramework set to '$(OverrideTargetFramework)' is missing valid target. Set OverrideTargetFramework to one of the TargetFrameworks for this project or skip building this project (eg unload the project in Visual Studio)\"\n        Condition=\"$(OverrideTargetFramework.Contains('windows10')) or !$(OverrideTargetFramework.Contains('-'))\" />\n  </Target>\n</Project>\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.Mobile/MacCatalyst/Entitlements.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n\t<dict>\n\t</dict>\n</plist>\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.Mobile/MacCatalyst/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n\t<dict>\n\t\t<key>UIDeviceFamily</key>\n\t\t<array>\n\t\t\t<integer>2</integer>\n\t\t</array>\n\t\t<key>LSApplicationCategoryType</key>\n\t\t<string>public.app-category.utilities</string>\n\t\t<key>UISupportedInterfaceOrientations</key>\n\t\t<array>\n\t\t\t<string>UIInterfaceOrientationPortrait</string>\n\t\t\t<string>UIInterfaceOrientationLandscapeLeft</string>\n\t\t\t<string>UIInterfaceOrientationLandscapeRight</string>\n\t\t</array>\n\t\t<key>XSAppIconAssets</key>\n\t\t<string>Assets.xcassets/icon.appiconset</string>\n\n\t\t<!--\n\t\tAdjust this to your application's encryption usage.\n\t\t<key>ITSAppUsesNonExemptEncryption</key>\n\t\t<false/>\n\t\t-->\n\t</dict>\n</plist>\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.Mobile/MacCatalyst/Main.maccatalyst.cs",
    "content": "using UIKit;\n\nnamespace HelloWorld.MacCatalyst;\n\npublic class EntryPoint\n{\n    // This is the main entry point of the application.\n    public static void Main(string[] args)\n    {\n        // if you want to use a different Application Delegate class from \"AppDelegate\"\n        // you can specify it here.\n        UIApplication.Main(args, null, typeof(AppHead));\n    }\n}\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.Mobile/MacCatalyst/Media.xcassets/LaunchImages.launchimage/Contents.json",
    "content": "{\n  \"images\": [\n    {\n      \"orientation\": \"portrait\",\n      \"extent\": \"full-screen\",\n      \"minimum-system-version\": \"7.0\",\n      \"scale\": \"2x\",\n      \"size\": \"640x960\",\n      \"idiom\": \"iphone\"\n    },\n    {\n      \"orientation\": \"portrait\",\n      \"extent\": \"full-screen\",\n      \"minimum-system-version\": \"7.0\",\n      \"subtype\": \"retina4\",\n      \"scale\": \"2x\",\n      \"size\": \"640x1136\",\n      \"idiom\": \"iphone\"\n    },\n    {\n      \"orientation\": \"portrait\",\n      \"extent\": \"full-screen\",\n      \"minimum-system-version\": \"7.0\",\n      \"scale\": \"1x\",\n      \"size\": \"768x1024\",\n      \"idiom\": \"ipad\"\n    },\n    {\n      \"orientation\": \"landscape\",\n      \"extent\": \"full-screen\",\n      \"minimum-system-version\": \"7.0\",\n      \"scale\": \"1x\",\n      \"size\": \"1024x768\",\n      \"idiom\": \"ipad\"\n    },\n    {\n      \"orientation\": \"portrait\",\n      \"extent\": \"full-screen\",\n      \"minimum-system-version\": \"7.0\",\n      \"scale\": \"2x\",\n      \"size\": \"1536x2048\",\n      \"idiom\": \"ipad\"\n    },\n    {\n      \"orientation\": \"landscape\",\n      \"extent\": \"full-screen\",\n      \"minimum-system-version\": \"7.0\",\n      \"scale\": \"2x\",\n      \"size\": \"2048x1536\",\n      \"idiom\": \"ipad\"\n    }\n  ],\n  \"properties\": {},\n  \"info\": {\n    \"version\": 1,\n    \"author\": \"\"\n  }\n}"
  },
  {
    "path": "e2e/Uno/HelloWorld.Mobile/iOS/Entitlements.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n\t<dict>\n\t</dict>\n</plist>\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.Mobile/iOS/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n\t<dict>\n\t\t<key>LSRequiresIPhoneOS</key>\n\t\t<true/>\n\t\t<key>UIDeviceFamily</key>\n\t\t<array>\n\t\t\t<integer>1</integer>\n\t\t\t<integer>2</integer>\n\t\t</array>\n\t\t<key>UIRequiredDeviceCapabilities</key>\n\t\t<array>\n\t\t\t<string>armv7</string>\n\t\t\t<string>arm64</string>\n\t\t</array>\n\t\t<key>UISupportedInterfaceOrientations</key>\n\t\t<array>\n\t\t\t<string>UIInterfaceOrientationPortrait</string>\n\t\t\t<string>UIInterfaceOrientationLandscapeLeft</string>\n\t\t\t<string>UIInterfaceOrientationLandscapeRight</string>\n\t\t</array>\n\t\t<key>UISupportedInterfaceOrientations~ipad</key>\n\t\t<array>\n\t\t\t<string>UIInterfaceOrientationPortrait</string>\n\t\t\t<string>UIInterfaceOrientationPortraitUpsideDown</string>\n\t\t\t<string>UIInterfaceOrientationLandscapeLeft</string>\n\t\t\t<string>UIInterfaceOrientationLandscapeRight</string>\n\t\t</array>\n\t\t<key>UIViewControllerBasedStatusBarAppearance</key>\n\t\t<false/>\n\t\t<key>XSAppIconAssets</key>\n\t\t<string>Assets.xcassets/icon.appiconset</string>\n\t\t<key>UIApplicationSupportsIndirectInputEvents</key>\n\t\t<true/>\n\n\t\t<!--\n\t\tAdjust this to your application's encryption usage.\n\t\t<key>ITSAppUsesNonExemptEncryption</key>\n\t\t<false/>\n\t\t-->\n\t</dict>\n</plist>\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.Mobile/iOS/Main.iOS.cs",
    "content": "using UIKit;\n\nnamespace HelloWorld.iOS;\n\npublic class EntryPoint\n{\n    // This is the main entry point of the application.\n    public static void Main(string[] args)\n    {\n        // if you want to use a different Application Delegate class from \"AppDelegate\"\n        // you can specify it here.\n        UIApplication.Main(args, null, typeof(AppHead));\n    }\n}\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.Mobile/iOS/Media.xcassets/LaunchImages.launchimage/Contents.json",
    "content": "{\n  \"images\": [\n    {\n      \"orientation\": \"portrait\",\n      \"extent\": \"full-screen\",\n      \"minimum-system-version\": \"7.0\",\n      \"scale\": \"2x\",\n      \"size\": \"640x960\",\n      \"idiom\": \"iphone\"\n    },\n    {\n      \"orientation\": \"portrait\",\n      \"extent\": \"full-screen\",\n      \"minimum-system-version\": \"7.0\",\n      \"subtype\": \"retina4\",\n      \"scale\": \"2x\",\n      \"size\": \"640x1136\",\n      \"idiom\": \"iphone\"\n    },\n    {\n      \"orientation\": \"portrait\",\n      \"extent\": \"full-screen\",\n      \"minimum-system-version\": \"7.0\",\n      \"scale\": \"1x\",\n      \"size\": \"768x1024\",\n      \"idiom\": \"ipad\"\n    },\n    {\n      \"orientation\": \"landscape\",\n      \"extent\": \"full-screen\",\n      \"minimum-system-version\": \"7.0\",\n      \"scale\": \"1x\",\n      \"size\": \"1024x768\",\n      \"idiom\": \"ipad\"\n    },\n    {\n      \"orientation\": \"portrait\",\n      \"extent\": \"full-screen\",\n      \"minimum-system-version\": \"7.0\",\n      \"scale\": \"2x\",\n      \"size\": \"1536x2048\",\n      \"idiom\": \"ipad\"\n    },\n    {\n      \"orientation\": \"landscape\",\n      \"extent\": \"full-screen\",\n      \"minimum-system-version\": \"7.0\",\n      \"scale\": \"2x\",\n      \"size\": \"2048x1536\",\n      \"idiom\": \"ipad\"\n    }\n  ],\n  \"properties\": {},\n  \"info\": {\n    \"version\": 1,\n    \"author\": \"\"\n  }\n}"
  },
  {
    "path": "e2e/Uno/HelloWorld.Shared/AppHead.xaml",
    "content": "﻿<local:App x:Class=\"HelloWorld.AppHead\"\n       xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n       xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n       xmlns:wasm=\"http://platform.uno/wasm\"\n       xmlns:local=\"using:HelloWorld\"\n       xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n       mc:Ignorable=\"wasm\">\n\n  <local:App.Resources>\n    <ResourceDictionary>\n      <ResourceDictionary.MergedDictionaries>\n        <ResourceDictionary Source=\"ms-appx:///HelloWorld/AppResources.xaml\" />\n      </ResourceDictionary.MergedDictionaries>\n    </ResourceDictionary>\n  </local:App.Resources>\n\n</local:App>\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.Shared/AppHead.xaml.cs",
    "content": "using System;\nusing Microsoft.UI.Xaml;\nusing Uno.Resizetizer;\n\nnamespace HelloWorld;\n\npublic sealed partial class AppHead : App\n{\n    /// <summary>\n    /// Initializes the singleton application object. This is the first line of authored code\n    /// executed, and as such is the logical equivalent of main() or WinMain().\n    /// </summary>\n    public AppHead()\n    {\n        this.InitializeComponent();\n    }\n}\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.Shared/HelloWorld.Shared.csproj",
    "content": "<Project Sdk=\"Microsoft.Build.NoTargets\">\n  <PropertyGroup>\n    <!-- NOTE: The TargetFramework is required by MSBuild but not used as this project is not built. -->\n    <TargetFramework>$(DotNetVersion)</TargetFramework>\n    <EnableDefaultItems>false</EnableDefaultItems>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <None Include=\"**\\*\" Exclude=\"obj\\**;bin\\**;*.csproj\" />\n    <None Update=\"AppHead.xaml.cs\" DependentUpon=\"AppHead.xaml\" />\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.Shared/base.props",
    "content": "<Project>\n  <ItemGroup>\n    <PackageReference Include=\"Uno.Resizetizer\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <None Include=\"$(MSBuildThisFileDirectory)AppHead.xaml\" />\n    <ApplicationDefinition Include=\"$(MSBuildThisFileDirectory)AppHead.xaml\"\n                SubType=\"Designer\"\n                XamlRuntime=\"WinUI\"\n                Generator=\"MSBuild:Compile\"\n                Link=\"AppHead.xaml\" />\n    <Compile Include=\"$(MSBuildThisFileDirectory)AppHead.xaml.cs\"\n        XamlRuntime=\"WinUI\"\n        DependentUpon=\"AppHead.xaml\"\n        Link=\"AppHead.xaml.cs\" />\n    <UnoIcon Include=\"$(MSBuildThisFileDirectory)Icons\\iconapp.svg\"\n        ForegroundFile=\"$(MSBuildThisFileDirectory)Icons\\appconfig.svg\"\n        ForegroundScale=\"0.65\"\n        Color=\"#00000000\" />\n    <UnoSplashScreen\n      Include=\"$(MSBuildThisFileDirectory)Splash\\splash_screen.svg\"\n      BaseSize=\"128,128\"\n      Color=\"#FFFFFF\" />\n    <!-- NOTE: Files explicitly linked to display in the head projects for clarity. -->\n    <None Include=\"$(MSBuildThisFileDirectory)Icons\\iconapp.svg\" Link=\"Icons\\iconapp.svg\" />\n    <None Include=\"$(MSBuildThisFileDirectory)Icons\\appconfig.svg\" Link=\"Icons\\appconfig.svg\" />\n    <None Include=\"$(MSBuildThisFileDirectory)Splash\\splash_screen.svg\" Link=\"Splash\\splash_screen.svg\" />\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.Skia.Gtk/HelloWorld.Skia.Gtk.csproj",
    "content": "<Project Sdk=\"Uno.Sdk\">\n  <PropertyGroup>\n    <OutputType Condition=\"'$(Configuration)'=='Release'\">WinExe</OutputType>\n    <OutputType Condition=\"'$(Configuration)'=='Debug'\">Exe</OutputType>\n    <TargetFramework>$(DotNetVersion)</TargetFramework>\n    <ApplicationManifest>app.manifest</ApplicationManifest>\n  </PropertyGroup>\n  <ItemGroup>\n    <EmbeddedResource Include=\"Package.appxmanifest\" />\n    <Manifest Include=\"$(ApplicationManifest)\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Uno.WinUI.Skia.Gtk\" />\n    <PackageReference Include=\"SkiaSharp.Views.Uno.WinUI\" />\n    <PackageReference Include=\"SkiaSharp.Skottie\" />\n    <PackageReference Include=\"Uno.WinUI.DevServer\" Condition=\"'$(Configuration)'=='Debug'\" />\n    <PackageReference Include=\"Uno.UI.Adapter.Microsoft.Extensions.Logging\" />\n    <PackageReference Include=\"Uno.Material.WinUI\" />\n    <PackageReference Include=\"Uno.Toolkit.WinUI.Material\" />\n    <PackageReference Include=\"Uno.Toolkit.WinUI\" />\n    <PackageReference Include=\"Uno.Extensions.Hosting.WinUI\" />\n    <PackageReference Include=\"Uno.Extensions.Logging.WinUI\" />\n    <PackageReference Include=\"Uno.Extensions.Logging.Serilog\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\HelloWorld\\HelloWorld.csproj\" />\n  </ItemGroup>\n  <Import Project=\"..\\HelloWorld.Shared\\base.props\" />\n\n  <Target Name=\"ValidateOverrides\" BeforeTargets=\"Restore;_CheckForUnsupportedTargetFramework\" Condition=\"'$(OverrideTargetFramework)' != ''\">\n    <Error\n        Text=\"OverrideTargetFramework set to '$(OverrideTargetFramework)' is invalid. Set OverrideTargetFramework to $([MSBuild]::Escape('$'))(DotNetVersion) or skip building this project (eg unload the project in Visual Studio)\"\n        Condition=\"'$(OverrideTargetFramework)'!='$(DotNetVersion)'\" />\n  </Target>\n</Project>\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.Skia.Gtk/Package.appxmanifest",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<Package\n  xmlns=\"http://schemas.microsoft.com/appx/manifest/foundation/windows10\"\n  xmlns:uap=\"http://schemas.microsoft.com/appx/manifest/uap/windows10\"\n  xmlns:rescap=\"http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities\"\n  IgnorableNamespaces=\"uap rescap\">\n\n  <Identity\n    Name=\"HelloWorld\"\n    Publisher=\"O=HelloWorld\"\n    Version=\"1.0.0.0\" />\n\n  <Properties>\n    <DisplayName>HelloWorld</DisplayName>\n    <PublisherDisplayName>HelloWorld</PublisherDisplayName>\n  </Properties>\n\n  <Dependencies>\n    <TargetDeviceFamily Name=\"Windows.Universal\" MinVersion=\"10.0.17763.0\" MaxVersionTested=\"10.0.19041.0\" />\n    <TargetDeviceFamily Name=\"Windows.Desktop\" MinVersion=\"10.0.17763.0\" MaxVersionTested=\"10.0.19041.0\" />\n  </Dependencies>\n\n  <Resources>\n    <Resource Language=\"x-generate\"/>\n  </Resources>\n\n  <Applications>\n    <Application Id=\"App\"\n      Executable=\"$targetnametoken$.exe\"\n      EntryPoint=\"$targetentrypoint$\">\n      <uap:VisualElements\n        DisplayName=\"HelloWorld\"\n        Description=\"HelloWorld\">\n        <uap:SplashScreen />\n      </uap:VisualElements>\n    </Application>\n  </Applications>\n\n  <Capabilities>\n    <rescap:Capability Name=\"runFullTrust\" />\n  </Capabilities>\n</Package>\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.Skia.Gtk/Program.cs",
    "content": "using System;\nusing GLib;\nusing Uno.UI.Runtime.Skia.Gtk;\n\nnamespace HelloWorld.Skia.Gtk;\n\npublic class Program\n{\n    public static void Main(string[] args)\n    {\n        ExceptionManager.UnhandledException += delegate (UnhandledExceptionArgs expArgs)\n        {\n            Console.WriteLine(\"GLIB UNHANDLED EXCEPTION\" + expArgs.ExceptionObject.ToString());\n            expArgs.ExitApplication = true;\n        };\n\n        var host = new GtkHost(() => new AppHead());\n\n        host.Run();\n    }\n}\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.Skia.Gtk/app.manifest",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<assembly manifestVersion=\"1.0\" xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n  <assemblyIdentity version=\"1.0.0.0\" name=\"HelloWorld.Gtk\"/>\n  <trustInfo xmlns=\"urn:schemas-microsoft-com:asm.v2\">\n    <security>\n      <requestedPrivileges xmlns=\"urn:schemas-microsoft-com:asm.v3\">\n        <!-- UAC Manifest Options\n             If you want to change the Windows User Account Control level replace the\n             requestedExecutionLevel node with one of the following.\n\n        <requestedExecutionLevel  level=\"asInvoker\" uiAccess=\"false\" />\n        <requestedExecutionLevel  level=\"requireAdministrator\" uiAccess=\"false\" />\n        <requestedExecutionLevel  level=\"highestAvailable\" uiAccess=\"false\" />\n\n            Specifying requestedExecutionLevel element will disable file and registry virtualization.\n            Remove this element if your application requires this virtualization for backwards\n            compatibility.\n        -->\n        <requestedExecutionLevel level=\"asInvoker\" uiAccess=\"false\" />\n      </requestedPrivileges>\n    </security>\n  </trustInfo>\n\n  <compatibility xmlns=\"urn:schemas-microsoft-com:compatibility.v1\">\n    <application>\n      <!-- A list of the Windows versions that this application has been tested on\n           and is designed to work with. Uncomment the appropriate elements\n           and Windows will automatically select the most compatible environment. -->\n\n      <!-- Windows Vista -->\n      <!--<supportedOS Id=\"{e2011457-1546-43c5-a5fe-008deee3d3f0}\" />-->\n\n      <!-- Windows 7 -->\n      <!--<supportedOS Id=\"{35138b9a-5d96-4fbd-8e2d-a2440225f93a}\" />-->\n\n      <!-- Windows 8 -->\n      <!--<supportedOS Id=\"{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}\" />-->\n\n      <!-- Windows 8.1 -->\n      <!--<supportedOS Id=\"{1f676c76-80e1-4239-95bb-83d0f6d0da78}\" />-->\n\n      <!-- Windows 10 -->\n      <!--<supportedOS Id=\"{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}\" />-->\n\n    </application>\n  </compatibility>\n\n  <!-- Indicates that the application is DPI-aware and will not be automatically scaled by Windows at higher\n       DPIs. Windows Presentation Foundation (WPF) applications are automatically DPI-aware and do not need\n       to opt in. Windows Forms applications targeting .NET Framework 4.6 that opt into this setting, should\n       also set the 'EnableWindowsFormsHighDpiAutoResizing' setting to 'true' in their app.config. -->\n\n  <application xmlns=\"urn:schemas-microsoft-com:asm.v3\">\n    <windowsSettings>\n      <dpiAware xmlns=\"http://schemas.microsoft.com/SMI/2005/WindowsSettings\">true/PM</dpiAware>\n      <dpiAwareness xmlns=\"http://schemas.microsoft.com/SMI/2016/WindowsSettings\">PerMonitorV2, PerMonitor</dpiAwareness>\n    </windowsSettings>\n  </application>\n\n\n  <!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->\n  <!--\n  <dependency>\n    <dependentAssembly>\n      <assemblyIdentity\n          type=\"win32\"\n          name=\"Microsoft.Windows.Common-Controls\"\n          version=\"6.0.0.0\"\n          processorArchitecture=\"*\"\n          publicKeyToken=\"6595b64144ccf1df\"\n          language=\"*\"\n        />\n    </dependentAssembly>\n  </dependency>\n  -->\n\n</assembly>\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.Skia.Linux.FrameBuffer/HelloWorld.Skia.Linux.FrameBuffer.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n  <PropertyGroup>\n    <OutputType Condition=\"'$(Configuration)'=='Release'\">WinExe</OutputType>\n    <OutputType Condition=\"'$(Configuration)'=='Debug'\">Exe</OutputType>\n    <TargetFramework>$(DotNetVersion)</TargetFramework>\n  </PropertyGroup>\n  <ItemGroup Condition=\"exists('Platforms\\Windows')\">\n    <EmbeddedResource Include=\"Platforms\\Windows\\Package.appxmanifest\" LogicalName=\"Package.appxmanifest\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"SkiaSharp.Views.Uno.WinUI\" />\n    <PackageReference Include=\"SkiaSharp.Skottie\" />\n    <PackageReference Include=\"Uno.WinUI.Skia.Linux.FrameBuffer\" />\n    <PackageReference Include=\"Uno.WinUI.DevServer\" />\n    <PackageReference Include=\"Uno.UI.Adapter.Microsoft.Extensions.Logging\" />\n    <PackageReference Include=\"Uno.Material.WinUI\" />\n    <PackageReference Include=\"Uno.Toolkit.WinUI.Material\" />\n    <PackageReference Include=\"Uno.Toolkit.WinUI\" />\n    <PackageReference Include=\"Uno.Extensions.Hosting.WinUI\" />\n    <PackageReference Include=\"Uno.Extensions.Logging.WinUI\" />\n    <PackageReference Include=\"Uno.Extensions.Logging.Serilog\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\HelloWorld\\HelloWorld.csproj\" />\n  </ItemGroup>\n  <Import Project=\"..\\HelloWorld.Shared\\base.props\" />\n</Project>\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.Skia.Linux.FrameBuffer/Program.cs",
    "content": "using System;\nusing Microsoft.UI.Xaml;\nusing Uno.UI.Runtime.Skia;\nusing Windows.UI.Core;\n\nnamespace HelloWorld.Skia.Framebuffer;\n\npublic class Program\n{\n    public static void Main(string[] args)\n    {\n        try\n        {\n            Console.CursorVisible = false;\n\n            var host = new FrameBufferHost(() =>\n            {\n                if (CoreWindow.GetForCurrentThread() is { } window)\n                {\n                    // Framebuffer applications don't have a WindowManager to rely\n                    // on. To close the application, we can hook onto CoreWindow events\n                    // which dispatch keyboard input, and close the application as a result.\n                    // This block can be moved to App.xaml.cs if it does not interfere with other\n                    // platforms that may use the same keys.\n                    window.KeyDown += (s, e) =>\n                    {\n                        if (e.VirtualKey == Windows.System.VirtualKey.F12)\n                        {\n                            Application.Current.Exit();\n                        }\n                    };\n                }\n\n                return new AppHead();\n            });\n            host.Run();\n        }\n        finally\n        {\n            Console.CursorVisible = true;\n        }\n    }\n}\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.Skia.Linux.FrameBuffer/app.manifest",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<assembly manifestVersion=\"1.0\" xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n  <assemblyIdentity version=\"1.0.0.0\" name=\"HelloWorld.Windows.app\"/>\n\n  <application xmlns=\"urn:schemas-microsoft-com:asm.v3\">\n    <windowsSettings>\n      <!-- The combination of below two tags have the following effect:\n           1) Per-Monitor for >= Windows 10 Anniversary Update\n           2) System < Windows 10 Anniversary Update\n      -->\n      <dpiAware xmlns=\"http://schemas.microsoft.com/SMI/2005/WindowsSettings\">true/PM</dpiAware>\n      <dpiAwareness xmlns=\"http://schemas.microsoft.com/SMI/2016/WindowsSettings\">PerMonitorV2, PerMonitor</dpiAwareness>\n    </windowsSettings>\n  </application>\n</assembly>\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.Skia.WPF/HelloWorld.Skia.WPF.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n  <PropertyGroup>\n    <OutputType Condition=\"'$(Configuration)'=='Release'\">WinExe</OutputType>\n    <OutputType Condition=\"'$(Configuration)'=='Debug'\">Exe</OutputType>\n    <TargetFramework>$(DotNetVersion)-windows</TargetFramework>\n    <UseWPF>true</UseWPF>\n  </PropertyGroup>\n  <ItemGroup Label=\"AssemblyInfo\">\n    <AssemblyAttribute Include=\"System.Runtime.InteropServices.ComVisibleAttribute\">\n      <_Parameter1>false</_Parameter1>\n    </AssemblyAttribute>\n    <AssemblyAttribute Include=\"System.Windows.ThemeInfo\">\n      <_Parameter1>System.Windows.ResourceDictionaryLocation.None</_Parameter1>\n      <_Parameter1_IsLiteral>true</_Parameter1_IsLiteral>\n      <_Parameter2>System.Windows.ResourceDictionaryLocation.SourceAssembly</_Parameter2>\n      <_Parameter2_IsLiteral>true</_Parameter2_IsLiteral>\n    </AssemblyAttribute>\n  </ItemGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"SkiaSharp.Views.Uno.WinUI\" />\n    <PackageReference Include=\"SkiaSharp.Skottie\" />\n    <PackageReference Include=\"Uno.WinUI.Skia.Wpf\" />\n    <PackageReference Include=\"Uno.WinUI.DevServer\" />\n    <PackageReference Include=\"Uno.UI.Adapter.Microsoft.Extensions.Logging\" />\n    <PackageReference Include=\"Uno.Material.WinUI\" />\n    <PackageReference Include=\"Uno.Toolkit.WinUI.Material\" />\n    <PackageReference Include=\"Uno.Toolkit.WinUI\" />\n    <PackageReference Include=\"Uno.Extensions.Hosting.WinUI\" />\n    <PackageReference Include=\"Uno.Extensions.Logging.WinUI\" />\n    <PackageReference Include=\"Uno.Extensions.Logging.Serilog\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ApplicationDefinition Include=\"Wpf\\App.xaml\" XamlRuntime=\"Wpf\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\HelloWorld\\HelloWorld.csproj\" />\n  </ItemGroup>\n  <Import Project=\"..\\HelloWorld.Shared\\base.props\" />\n</Project>\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.Skia.WPF/Wpf/App.xaml",
    "content": "<Application x:Class=\"HelloWorld.WPF.App\"\n\t\t\t xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n\t\t\t xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n\t\t\t xmlns:local=\"clr-namespace:HelloWorld.WPF\">\n\t<Application.Resources>\n\n\t</Application.Resources>\n</Application>\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.Skia.WPF/Wpf/App.xaml.cs",
    "content": "using WpfApp = System.Windows.Application;\nusing Uno.UI.Runtime.Skia.Wpf;\n\nnamespace HelloWorld.WPF;\n\npublic partial class App : WpfApp\n{\n    public App()\n    {\n        var host = new WpfHost(Dispatcher, () => new AppHead());\n        host.Run();\n    }\n}\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.Wasm/HelloWorld.Wasm.csproj",
    "content": "<Project Sdk=\"Uno.Sdk\">\n\n  <PropertyGroup>\n    <OutputType>Exe</OutputType>\n    <TargetFramework>$(DotNetVersion)</TargetFramework>\n    <NoWarn>$(NoWarn);NU1504;NU1505;NU1701</NoWarn>\n    <!-- Disabled due to issue with Central Package Management with implicit using -->\n    <ImplicitUsings>disable</ImplicitUsings>\n    <WasmPWAManifestFile>manifest.webmanifest</WasmPWAManifestFile>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <!--\n      Supports Deep Linking Routes\n      https://aka.platform.uno/wasm-deeplink\n    -->\n    <WasmShellWebAppBasePath>/</WasmShellWebAppBasePath>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)'=='Debug'\">\n    <MonoRuntimeDebuggerEnabled>true</MonoRuntimeDebuggerEnabled>\n    <DefineConstants>$(DefineConstants);TRACE;DEBUG</DefineConstants>\n    <DebugType>portable</DebugType>\n    <DebugSymbols>true</DebugSymbols>\n    <!--\n      IL Linking is disabled in Debug configuration.\n      When building in Release, see https://platform.uno/docs/articles/features/using-il-linker-WebAssembly.html\n    -->\n    <WasmShellILLinkerEnabled>false</WasmShellILLinkerEnabled>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)'=='Release'\">\n    <!-- XAML Resource trimming https://aka.platform.uno/xaml-trimming -->\n    <!--<UnoXamlResourcesTrimming>true</UnoXamlResourcesTrimming>-->\n    <!-- Improve performance with AOT builds https://aka.platform.uno/wasm-aot -->\n    <!-- <WasmShellMonoRuntimeExecutionMode>InterpreterAndAOT</WasmShellMonoRuntimeExecutionMode> -->\n    <!-- Temporarily uncomment to generate an AOT profile https://aka.platform.uno/wasm-aot-profile -->\n    <!-- <WasmShellGenerateAOTProfile>true</WasmShellGenerateAOTProfile> -->\n  </PropertyGroup>\n  <ItemGroup>\n    <Content Include=\"manifest.webmanifest\" />\n  </ItemGroup>\n  <ItemGroup>\n    <EmbeddedResource Include=\"WasmCSS\\Fonts.css\" />\n    <EmbeddedResource Include=\"WasmScripts\\AppManifest.js\" />\n  </ItemGroup>\n  <ItemGroup>\n    <LinkerDescriptor Include=\"LinkerConfig.xml\" />\n  </ItemGroup>\n  <ItemGroup>\n    <PackageReference Include=\"Microsoft.Windows.Compatibility\" />\n    <PackageReference Include=\"Uno.Wasm.Bootstrap\" />\n    <PackageReference Include=\"Uno.Wasm.Bootstrap.DevServer\" />\n    <PackageReference Include=\"Uno.WinUI.WebAssembly\" />\n    <PackageReference Include=\"Uno.WinUI.DevServer\" Condition=\"'$(Configuration)'=='Debug'\" />\n    <PackageReference Include=\"Uno.UI.Adapter.Microsoft.Extensions.Logging\" />\n    <PackageReference Include=\"Uno.Material.WinUI\" />\n    <PackageReference Include=\"Uno.Toolkit.WinUI.Material\" />\n    <PackageReference Include=\"Uno.Toolkit.WinUI\" />\n    <PackageReference Include=\"Uno.Extensions.Hosting.WinUI\" />\n    <PackageReference Include=\"Uno.Extensions.Logging.WebAssembly.Console\" />\n    <PackageReference Include=\"Uno.Extensions.Logging.WinUI\" />\n    <PackageReference Include=\"Uno.Extensions.Logging.Serilog\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\HelloWorld\\HelloWorld.csproj\" />\n  </ItemGroup>\n  <Import Project=\"..\\HelloWorld.Shared\\base.props\" />\n\n  <Target Name=\"ValidateOverrides\" BeforeTargets=\"Restore;_CheckForUnsupportedTargetFramework\" Condition=\"'$(OverrideTargetFramework)' != ''\">\n    <Error\n        Text=\"OverrideTargetFramework set to '$(OverrideTargetFramework)' is invalid. Set OverrideTargetFramework to $([MSBuild]::Escape('$'))(DotNetVersion) or skip building this project (eg unload the project in Visual Studio)\"\n        Condition=\"'$(OverrideTargetFramework)'!='$(DotNetVersion)'\" />\n  </Target>\n</Project>\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.Wasm/LinkerConfig.xml",
    "content": "<linker>\n  <assembly fullname=\"HelloWorld\" />\n  <assembly fullname=\"HelloWorld.Wasm\" />\n\n  <!--\n  Uncomment this section when using JSON.NET\n  <assembly fullname=\"System.Core\">\n    <type fullname=\"System.Linq.Expressions*\" />\n  </assembly>\n   -->\n</linker>\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.Wasm/Program.cs",
    "content": "namespace HelloWorld.Wasm;\n\npublic class Program\n{\n    private static App? _app;\n\n    public static int Main(string[] args)\n    {\n        Microsoft.UI.Xaml.Application.Start(_ => _app = new AppHead());\n\n        return 0;\n    }\n}\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.Wasm/Properties/launchSettings.json",
    "content": "{\n  \"iisSettings\": {\n    \"windowsAuthentication\": false,\n    \"anonymousAuthentication\": true,\n    \"iisExpress\": {\n      \"applicationUrl\": \"http://localhost:8080\",\n      \"sslPort\": 0\n    }\n  },\n  \"profiles\": {\n    \"HelloWorld.Wasm\": {\n      \"commandName\": \"Project\",\n      \"dotnetRunMessages\": true,\n      \"launchBrowser\": true,\n      \"applicationUrl\": \"http://localhost:5001\",\n      \"inspectUri\": \"{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}\",\n      \"environmentVariables\": {\n        \"ASPNETCORE_ENVIRONMENT\": \"Development\"\n      }\n    },\n    \"IIS Express\": {\n      \"commandName\": \"IISExpress\",\n      \"launchBrowser\": true,\n      \"inspectUri\": \"{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}\",\n      \"environmentVariables\": {\n        \"ASPNETCORE_ENVIRONMENT\": \"Development\"\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.Wasm/WasmCSS/Fonts.css",
    "content": "/**\n  When adding fonts here, make sure to add them using a base64 data uri, otherwise\n  fonts loading are delayed, and text may get displayed incorrectly.\n*/\n\n/* https://github.com/unoplatform/uno/issues/3954 */\n@font-face {\n  font-family: 'Segoe UI';\n  src: local('Segoe UI'), local('-apple-system'), local('BlinkMacSystemFont'), local('Inter'), local('Cantarell'), local('Ubuntu'), local('Roboto'), local('Open Sans'), local('Noto Sans'), local('Helvetica Neue'), local('sans-serif');\n}\n\n@font-face {\n  font-family: 'Roboto';\n  src: url(./Uno.Fonts.Roboto/Fonts/Roboto-Light.ttf) format('truetype');\n  font-weight: 300;\n}\n\n@font-face {\n  font-family: 'Roboto';\n  src: url(./Uno.Fonts.Roboto/Fonts/Roboto-Regular.ttf) format('truetype');\n  font-weight: 400;\n}\n\n@font-face {\n  font-family: 'Roboto';\n  src: url(./Uno.Fonts.Roboto/Fonts/Roboto-Medium.ttf) format('truetype');\n  font-weight: 500;\n}\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.Wasm/WasmScripts/AppManifest.js",
    "content": "var UnoAppManifest = {\n    displayName: \"HelloWorld\"\n}\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.Wasm/manifest.webmanifest",
    "content": "{\n  \"background_color\": \"#ffffff\",\n  \"description\": \"HelloWorld\",\n  \"display\": \"standalone\",\n  \"name\": \"HelloWorld\",\n  \"short_name\": \"HelloWorld\",\n  \"start_url\": \"/index.html\",\n  \"theme_color\": \"#ffffff\",\n  \"scope\": \"/\"\n}\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.Wasm/wwwroot/staticwebapp.config.json",
    "content": "{\n  \"navigationFallback\": {\n    \"rewrite\": \"/index.html\",\n    \"exclude\": [\n      \"*.{css,js}\",\n      \"*.{png}\",\n      \"*.{c,h,wasm,clr,pdb,dat,txt}\"\n    ]\n  },\n  \"routes\": [\n    {\n      \"route\": \"/package_*\",\n      \"headers\": {\n        \"cache-control\": \"public, immutable, max-age=31536000\"\n      }\n    },\n    {\n      \"route\": \"/*.ttf\",\n      \"headers\": {\n        \"cache-control\": \"public, immutable, max-age=31536000\"\n      }\n    },\n    {\n      \"route\": \"/*\",\n      \"headers\": {\n        \"cache-control\": \"must-revalidate, max-age=3600\"\n      }\n    }\n  ]\n}\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.Wasm/wwwroot/web.config",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <system.web>\n    <customErrors mode=\"Off\"/>\n  </system.web>\n\n  <system.webServer>\n\n    <!-- Disable compression as we're doing it through pre-compressed files -->\n    <urlCompression doStaticCompression=\"false\" doDynamicCompression=\"false\" dynamicCompressionBeforeCache=\"false\" />\n\n    <staticContent>\n      <remove fileExtension=\".dll\" />\n      <remove fileExtension=\".wasm\" />\n      <remove fileExtension=\".woff\" />\n      <remove fileExtension=\".woff2\" />\n      <mimeMap fileExtension=\".wasm\" mimeType=\"application/wasm\" />\n      <mimeMap fileExtension=\".clr\" mimeType=\"application/octet-stream\" />\n      <mimeMap fileExtension=\".pdb\" mimeType=\"application/octet-stream\" />\n      <mimeMap fileExtension=\".woff\" mimeType=\"application/font-woff\" />\n      <mimeMap fileExtension=\".woff2\" mimeType=\"application/font-woff\" />\n      <mimeMap fileExtension=\".dat\" mimeType=\"application/octet-stream\" />\n      <!-- Required for PWAs -->\n      <mimeMap fileExtension=\".json\" mimeType=\"application/octet-stream\" />\n    </staticContent>\n\n    <rewrite>\n      <rules>\n        <rule name=\"Lookup for pre-compressed brotli file\" stopProcessing=\"true\">\n          <match url=\"(.*)$\"/>\n          <conditions>\n            <!-- Match brotli requests -->\n            <add input=\"{HTTP_ACCEPT_ENCODING}\" pattern=\"br\" />\n            \n            <!-- Match all but pre-compressed files -->\n            <add input=\"{REQUEST_URI}\" pattern=\"^(?!/_compressed_br/)(.*)$\" />\n\n            <!-- Check if the pre-compressed file exists on the disk -->\n            <add input=\"{DOCUMENT_ROOT}/_compressed_br/{C:0}\" matchType=\"IsFile\" negate=\"false\" />\n          </conditions>\n          <action type=\"Rewrite\" url=\"/_compressed_br{C:0}\" />\n        </rule>\n\n        <rule name=\"Lookup for pre-compressed gzip file\" stopProcessing=\"true\">\n          <match url=\"(.*)$\"/>\n          <conditions>\n            <!-- Match gzip requests -->\n            <add input=\"{HTTP_ACCEPT_ENCODING}\" pattern=\"gzip\" />\n            \n            <!-- Match all but pre-compressed files -->\n            <add input=\"{REQUEST_URI}\" pattern=\"^(?!/_compressed_gz/)(.*)$\" />\n            \n            <!-- Check if the pre-compressed file exists on the disk -->\n            <add input=\"{DOCUMENT_ROOT}/_compressed_gz/{C:0}\" matchType=\"IsFile\" negate=\"false\" />\n          </conditions>\n          <action type=\"Rewrite\" url=\"/_compressed_gz{C:0}\" />\n        </rule>\n      </rules>\n\n      <outboundRules>\n        <rule name=\"Adjust content encoding for gzip pre-compressed files\" enabled=\"true\" stopProcessing=\"true\">\n          <match serverVariable=\"RESPONSE_CONTENT_ENCODING\" pattern=\"\" />\n          <conditions>\n            <add input=\"{REQUEST_URI}\" pattern=\"/_compressed_gz/.*$\" />\n          </conditions>\n          <action type=\"Rewrite\" value=\"gzip\"/>\n        </rule>\n        <rule name=\"Adjust content encoding for brotli pre-compressed files\" enabled=\"true\" stopProcessing=\"true\">\n          <match serverVariable=\"RESPONSE_CONTENT_ENCODING\" pattern=\"\" />\n          <conditions>\n            <add input=\"{REQUEST_URI}\" pattern=\"/_compressed_br/.*$\" />\n          </conditions>\n          <action type=\"Rewrite\" value=\"br\"/>\n        </rule>\n      </outboundRules>\n    </rewrite>\n  </system.webServer>\n</configuration>\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.Windows/HelloWorld.Windows.csproj",
    "content": "<Project Sdk=\"Uno.Sdk\">\n  <PropertyGroup>\n    <OutputType>WinExe</OutputType>\n    <TargetFramework>$(DotNetVersion)-windows10.0.22621.0</TargetFramework>\n    <RootNamespace>HelloWorld.Windows</RootNamespace>\n    <Platforms>x86;x64;arm64</Platforms>\n\n    <!-- Bundles the WinAppSDK binaries -->\n    <WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>\n\n    <!-- <SelfContained>true</SelfContained> -->\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Uno.WinUI\" />\n    <PackageReference Include=\"Microsoft.WindowsAppSDK\" />\n    <PackageReference Include=\"Microsoft.Windows.SDK.BuildTools\" />\n    <PackageReference Include=\"Microsoft.Extensions.Logging.Console\" />\n    <PackageReference Include=\"Uno.Core.Extensions.Logging.Singleton\" />\n    <PackageReference Include=\"Uno.UI.Adapter.Microsoft.Extensions.Logging\" />\n    <PackageReference Include=\"Uno.Material.WinUI\" />\n    <PackageReference Include=\"Uno.Toolkit.WinUI.Material\" />\n    <PackageReference Include=\"Uno.Toolkit.WinUI\" />\n    <PackageReference Include=\"Uno.Extensions.Hosting.WinUI\" />\n    <PackageReference Include=\"Uno.Extensions.Logging.WinUI\" />\n    <PackageReference Include=\"Uno.Extensions.Logging.Serilog\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <!--\n    If you encounter this error message:\n\n      error NETSDK1148: A referenced assembly was compiled using a newer version of Microsoft.Windows.SDK.NET.dll.\n      Please update to a newer .NET SDK in order to reference this assembly.\n\n    This means that the two packages below must be aligned with the \"build\" version number of\n    the \"Microsoft.Windows.SDK.BuildTools\" package above, and the \"revision\" version number\n    must be the highest found in https://www.nuget.org/packages/Microsoft.Windows.SDK.NET.Ref.\n    -->\n    <!-- <FrameworkReference Update=\"Microsoft.Windows.SDK.NET.Ref\" RuntimeFrameworkVersion=\"10.0.22621.28\" />\n    <FrameworkReference Update=\"Microsoft.Windows.SDK.NET.Ref\" TargetingPackVersion=\"10.0.22621.28\" /> -->\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\HelloWorld\\HelloWorld.csproj\" />\n  </ItemGroup>\n\n  <Import Project=\"..\\HelloWorld.Shared\\base.props\" />\n\n  <Target Name=\"ValidateOverrides\" BeforeTargets=\"Restore;_CheckForUnsupportedTargetFramework\" Condition=\"'$(OverrideTargetFramework)' != ''\">\n    <Error\n        Text=\"OverrideTargetFramework set to '$(OverrideTargetFramework)' is missing Windows target. Set OverrideTargetFramework to $([MSBuild]::Escape('$'))(DotNetVersion)-windows10.0.19041.0 or skip building this project (eg unload the project in Visual Studio)\"\n        Condition=\"!$(OverrideTargetFramework.Contains('windows10'))\" />\n  </Target>\n</Project>\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.Windows/Package.appxmanifest",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<Package\n  xmlns=\"http://schemas.microsoft.com/appx/manifest/foundation/windows10\"\n  xmlns:uap=\"http://schemas.microsoft.com/appx/manifest/uap/windows10\"\n  xmlns:rescap=\"http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities\"\n  IgnorableNamespaces=\"uap rescap\">\n\n  <Identity\n    Name=\"HelloWorld\"\n    Publisher=\"O=HelloWorld\"\n    Version=\"1.0.0.0\" />\n\n  <Properties>\n    <DisplayName>HelloWorld</DisplayName>\n    <PublisherDisplayName>HelloWorld</PublisherDisplayName>\n  </Properties>\n\n  <Dependencies>\n    <TargetDeviceFamily Name=\"Windows.Universal\" MinVersion=\"10.0.17763.0\" MaxVersionTested=\"10.0.19041.0\" />\n    <TargetDeviceFamily Name=\"Windows.Desktop\" MinVersion=\"10.0.17763.0\" MaxVersionTested=\"10.0.19041.0\" />\n  </Dependencies>\n\n  <Resources>\n    <Resource Language=\"x-generate\"/>\n  </Resources>\n\n  <Applications>\n    <Application Id=\"App\"\n      Executable=\"$targetnametoken$.exe\"\n      EntryPoint=\"$targetentrypoint$\">\n      <uap:VisualElements\n        DisplayName=\"HelloWorld\"\n        Description=\"HelloWorld\">\n        <uap:SplashScreen />\n      </uap:VisualElements>\n    </Application>\n  </Applications>\n\n  <Capabilities>\n    <rescap:Capability Name=\"runFullTrust\" />\n  </Capabilities>\n</Package>\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.Windows/Properties/PublishProfiles/win-arm64.pubxml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\nhttps://go.microsoft.com/fwlink/?LinkID=208121.\n-->\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <PropertyGroup>\n    <PublishProtocol>FileSystem</PublishProtocol>\n    <Platform>arm64</Platform>\n    <RuntimeIdentifier>win-arm64</RuntimeIdentifier>\n    <PublishDir>bin\\$(Configuration)\\$(TargetFramework)\\$(RuntimeIdentifier)\\publish\\</PublishDir>\n    <SelfContained>true</SelfContained>\n    <PublishSingleFile>False</PublishSingleFile>\n    <PublishReadyToRun Condition=\"'$(Configuration)' == 'Debug'\">False</PublishReadyToRun>\n    <PublishReadyToRun Condition=\"'$(Configuration)' != 'Debug'\">True</PublishReadyToRun>\n    <!-- Note: Trimming disabled by default as there may still be an issues with PublishTrimmed support: https://github.com/microsoft/CsWinRT/issues/373 -->\n    <!--\n    <PublishTrimmed Condition=\"'$(Configuration)' != 'Debug'\">True</PublishTrimmed>\n    <TrimMode>partial</TrimMode>\n    <SuppressTrimAnalysisWarnings>true</SuppressTrimAnalysisWarnings>\n    -->\n  </PropertyGroup>\n</Project>\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.Windows/Properties/PublishProfiles/win-x64.pubxml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\nhttps://go.microsoft.com/fwlink/?LinkID=208121.\n-->\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <PropertyGroup>\n    <PublishProtocol>FileSystem</PublishProtocol>\n    <Platform>x64</Platform>\n    <RuntimeIdentifier>win-x64</RuntimeIdentifier>\n    <PublishDir>bin\\$(Configuration)\\$(TargetFramework)\\$(RuntimeIdentifier)\\publish\\</PublishDir>\n    <SelfContained>true</SelfContained>\n    <PublishSingleFile>False</PublishSingleFile>\n    <PublishReadyToRun Condition=\"'$(Configuration)' == 'Debug'\">False</PublishReadyToRun>\n    <PublishReadyToRun Condition=\"'$(Configuration)' != 'Debug'\">True</PublishReadyToRun>\n    <!-- Note: Trimming disabled by default as there may still be an issues with PublishTrimmed support: https://github.com/microsoft/CsWinRT/issues/373 -->\n    <!--\n    <PublishTrimmed Condition=\"'$(Configuration)' != 'Debug'\">True</PublishTrimmed>\n    <TrimMode>partial</TrimMode>\n    <SuppressTrimAnalysisWarnings>true</SuppressTrimAnalysisWarnings>\n    -->\n  </PropertyGroup>\n</Project>\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.Windows/Properties/PublishProfiles/win-x86.pubxml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\nhttps://go.microsoft.com/fwlink/?LinkID=208121.\n-->\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <PropertyGroup>\n    <PublishProtocol>FileSystem</PublishProtocol>\n    <Platform>x86</Platform>\n    <RuntimeIdentifier>win-x86</RuntimeIdentifier>\n    <PublishDir>bin\\$(Configuration)\\$(TargetFramework)\\$(RuntimeIdentifier)\\publish\\</PublishDir>\n    <SelfContained>true</SelfContained>\n    <PublishSingleFile>False</PublishSingleFile>\n    <PublishReadyToRun Condition=\"'$(Configuration)' == 'Debug'\">False</PublishReadyToRun>\n    <PublishReadyToRun Condition=\"'$(Configuration)' != 'Debug'\">True</PublishReadyToRun>\n    <!-- Note: Trimming disabled by default as there may still be an issues with PublishTrimmed support: https://github.com/microsoft/CsWinRT/issues/373 -->\n    <!--\n    <PublishTrimmed Condition=\"'$(Configuration)' != 'Debug'\">True</PublishTrimmed>\n    <TrimMode>partial</TrimMode>\n    <SuppressTrimAnalysisWarnings>true</SuppressTrimAnalysisWarnings>\n    -->\n  </PropertyGroup>\n</Project>\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.Windows/Properties/launchsettings.json",
    "content": "{\n  \"profiles\": {\n    \"HelloWorld.Windows (Unpackaged)\": {\n      \"commandName\": \"Project\"\n    },\n    \"HelloWorld.Windows (Package)\": {\n      \"commandName\": \"MsixPackage\"\n    }\n  }\n}\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.Windows/Resources.lang-en-us.resw",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <data name=\"Placeholder\" xml:space=\"preserve\">\n    <value>Hello World!</value>\n  </data>\n</root>"
  },
  {
    "path": "e2e/Uno/HelloWorld.Windows/app.manifest",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<assembly manifestVersion=\"1.0\" xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n  <assemblyIdentity version=\"1.0.0.0\" name=\"HelloWorld.Windows.app\"/>\n\n  <compatibility xmlns=\"urn:schemas-microsoft-com:compatibility.v1\">\n    <application>\n      <!--The ID below informs the system that this application is compatible with OS features first introduced in Windows 8.\n      For more info see https://docs.microsoft.com/windows/win32/sysinfo/targeting-your-application-at-windows-8-1\n\n      It is also necessary to support features in unpackaged applications, for example the custom titlebar implementation.-->\n      <supportedOS Id=\"{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}\" />\n    </application>\n  </compatibility>\n\n  <application xmlns=\"urn:schemas-microsoft-com:asm.v3\">\n    <windowsSettings>\n      <!-- The combination of below two tags have the following effect:\n           1) Per-Monitor for >= Windows 10 Anniversary Update\n           2) System < Windows 10 Anniversary Update\n      -->\n      <dpiAware xmlns=\"http://schemas.microsoft.com/SMI/2005/WindowsSettings\">true/PM</dpiAware>\n      <dpiAwareness xmlns=\"http://schemas.microsoft.com/SMI/2016/WindowsSettings\">PerMonitorV2, PerMonitor</dpiAwareness>\n    </windowsSettings>\n  </application>\n</assembly>\n"
  },
  {
    "path": "e2e/Uno/HelloWorld.sln",
    "content": "﻿\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio Version 17\nVisualStudioVersion = 17.2.32210.308\nMinimumVisualStudioVersion = 15.0.26124.0\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"sample\", \"sample\", \"{5E74EB0D-FBD3-4399-8F38-AD888DEFFC73}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"Platforms\", \"Platforms\", \"{660A1FE2-C440-402C-A5DC-6901F5FBED61}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"HelloWorld\", \"HelloWorld\\HelloWorld.csproj\", \"{09C2B6C8-E492-49E7-A598-18E8881646C8}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"HelloWorld.Mobile\", \"HelloWorld.Mobile\\HelloWorld.Mobile.csproj\", \"{980A4C78-FF3E-4D3B-8D8C-FE78ADFCC3DF}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"HelloWorld.Wasm\", \"HelloWorld.Wasm\\HelloWorld.Wasm.csproj\", \"{98201B97-26AE-4FA1-845C-AC7FE025848D}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"HelloWorld.Skia.Gtk\", \"HelloWorld.Skia.Gtk\\HelloWorld.Skia.Gtk.csproj\", \"{39B16098-4E39-49C4-9C74-BD5D809F4432}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"HelloWorld.Skia.WPF\", \"HelloWorld.Skia.WPF\\HelloWorld.Skia.WPF.csproj\", \"{7D45AF78-BEC3-44AD-9A8C-3784FB638495}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"HelloWorld.Windows\", \"HelloWorld.Windows\\HelloWorld.Windows.csproj\", \"{92F6D561-4134-444D-8E86-4AD4BF6443C7}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"HelloWorld.Skia.Linux.FrameBuffer\", \"HelloWorld.Skia.Linux.FrameBuffer\\HelloWorld.Skia.Linux.FrameBuffer.csproj\", \"{B4A1BD15-DA72-4933-BD26-01E5E43279F8}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"Solution Items\", \"Solution Items\", \"{BADA71DC-7FFD-4EDC-9F28-FB74AEADC713}\"\n\tProjectSection(SolutionItems) = preProject\n\t\tDirectory.Build.props = Directory.Build.props\n\t\tDirectory.Build.targets = Directory.Build.targets\n\t\t..\\..\\Directory.Packages.props = ..\\..\\Directory.Packages.props\n\t\t..\\..\\global.json = ..\\..\\global.json\n\tEndProjectSection\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"src\", \"src\", \"{2C5D7523-6030-4B75-ABE0-3CB8AA0953CB}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Prism.Core\", \"..\\..\\src\\Prism.Core\\Prism.Core.csproj\", \"{F6F81EE6-24C6-4D4E-A38D-8C4ECADF5882}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Prism.Uno.WinUI\", \"..\\..\\src\\Uno\\Prism.Uno\\Prism.Uno.WinUI.csproj\", \"{FDA1EB82-8ED3-4284-842D-9E7732CB328C}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Prism.DryIoc.Uno.WinUI\", \"..\\..\\src\\Uno\\Prism.DryIoc.Uno\\Prism.DryIoc.Uno.WinUI.csproj\", \"{8D59D64C-EAF1-4BF7-9E69-556114C96A95}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"modules\", \"modules\", \"{F67BA438-F236-460B-B279-A71AB8033B54}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"ModuleA\", \"ModuleA\\ModuleA.csproj\", \"{5AD22541-BC5D-45E0-9C95-87B51300FF1C}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Prism.Events\", \"..\\..\\src\\Prism.Events\\Prism.Events.csproj\", \"{ABC0F8AF-6FED-4C3E-80B3-54F1A7CC5930}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"HelloWorld.Shared\", \"HelloWorld.Shared\\HelloWorld.Shared.csproj\", \"{28A534A3-3ADA-4435-B5F5-59FA61DF23EF}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Any CPU = Debug|Any CPU\n\t\tDebug|ARM = Debug|ARM\n\t\tDebug|ARM64 = Debug|ARM64\n\t\tDebug|iPhone = Debug|iPhone\n\t\tDebug|iPhoneSimulator = Debug|iPhoneSimulator\n\t\tDebug|x64 = Debug|x64\n\t\tDebug|x86 = Debug|x86\n\t\tRelease|Any CPU = Release|Any CPU\n\t\tRelease|ARM = Release|ARM\n\t\tRelease|ARM64 = Release|ARM64\n\t\tRelease|iPhone = Release|iPhone\n\t\tRelease|iPhoneSimulator = Release|iPhoneSimulator\n\t\tRelease|x64 = Release|x64\n\t\tRelease|x86 = Release|x86\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{09C2B6C8-E492-49E7-A598-18E8881646C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{09C2B6C8-E492-49E7-A598-18E8881646C8}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{09C2B6C8-E492-49E7-A598-18E8881646C8}.Debug|ARM.ActiveCfg = Debug|Any CPU\n\t\t{09C2B6C8-E492-49E7-A598-18E8881646C8}.Debug|ARM.Build.0 = Debug|Any CPU\n\t\t{09C2B6C8-E492-49E7-A598-18E8881646C8}.Debug|ARM64.ActiveCfg = Debug|Any CPU\n\t\t{09C2B6C8-E492-49E7-A598-18E8881646C8}.Debug|ARM64.Build.0 = Debug|Any CPU\n\t\t{09C2B6C8-E492-49E7-A598-18E8881646C8}.Debug|iPhone.ActiveCfg = Debug|Any CPU\n\t\t{09C2B6C8-E492-49E7-A598-18E8881646C8}.Debug|iPhone.Build.0 = Debug|Any CPU\n\t\t{09C2B6C8-E492-49E7-A598-18E8881646C8}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU\n\t\t{09C2B6C8-E492-49E7-A598-18E8881646C8}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU\n\t\t{09C2B6C8-E492-49E7-A598-18E8881646C8}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{09C2B6C8-E492-49E7-A598-18E8881646C8}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{09C2B6C8-E492-49E7-A598-18E8881646C8}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{09C2B6C8-E492-49E7-A598-18E8881646C8}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{09C2B6C8-E492-49E7-A598-18E8881646C8}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{09C2B6C8-E492-49E7-A598-18E8881646C8}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{09C2B6C8-E492-49E7-A598-18E8881646C8}.Release|ARM.ActiveCfg = Release|Any CPU\n\t\t{09C2B6C8-E492-49E7-A598-18E8881646C8}.Release|ARM.Build.0 = Release|Any CPU\n\t\t{09C2B6C8-E492-49E7-A598-18E8881646C8}.Release|ARM64.ActiveCfg = Release|Any CPU\n\t\t{09C2B6C8-E492-49E7-A598-18E8881646C8}.Release|ARM64.Build.0 = Release|Any CPU\n\t\t{09C2B6C8-E492-49E7-A598-18E8881646C8}.Release|iPhone.ActiveCfg = Release|Any CPU\n\t\t{09C2B6C8-E492-49E7-A598-18E8881646C8}.Release|iPhone.Build.0 = Release|Any CPU\n\t\t{09C2B6C8-E492-49E7-A598-18E8881646C8}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU\n\t\t{09C2B6C8-E492-49E7-A598-18E8881646C8}.Release|iPhoneSimulator.Build.0 = Release|Any CPU\n\t\t{09C2B6C8-E492-49E7-A598-18E8881646C8}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{09C2B6C8-E492-49E7-A598-18E8881646C8}.Release|x64.Build.0 = Release|Any CPU\n\t\t{09C2B6C8-E492-49E7-A598-18E8881646C8}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{09C2B6C8-E492-49E7-A598-18E8881646C8}.Release|x86.Build.0 = Release|Any CPU\n\t\t{980A4C78-FF3E-4D3B-8D8C-FE78ADFCC3DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{980A4C78-FF3E-4D3B-8D8C-FE78ADFCC3DF}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{980A4C78-FF3E-4D3B-8D8C-FE78ADFCC3DF}.Debug|Any CPU.Deploy.0 = Debug|Any CPU\n\t\t{980A4C78-FF3E-4D3B-8D8C-FE78ADFCC3DF}.Debug|ARM.ActiveCfg = Debug|Any CPU\n\t\t{980A4C78-FF3E-4D3B-8D8C-FE78ADFCC3DF}.Debug|ARM.Build.0 = Debug|Any CPU\n\t\t{980A4C78-FF3E-4D3B-8D8C-FE78ADFCC3DF}.Debug|ARM.Deploy.0 = Debug|Any CPU\n\t\t{980A4C78-FF3E-4D3B-8D8C-FE78ADFCC3DF}.Debug|ARM64.ActiveCfg = Debug|Any CPU\n\t\t{980A4C78-FF3E-4D3B-8D8C-FE78ADFCC3DF}.Debug|ARM64.Build.0 = Debug|Any CPU\n\t\t{980A4C78-FF3E-4D3B-8D8C-FE78ADFCC3DF}.Debug|ARM64.Deploy.0 = Debug|Any CPU\n\t\t{980A4C78-FF3E-4D3B-8D8C-FE78ADFCC3DF}.Debug|iPhone.ActiveCfg = Debug|Any CPU\n\t\t{980A4C78-FF3E-4D3B-8D8C-FE78ADFCC3DF}.Debug|iPhone.Build.0 = Debug|Any CPU\n\t\t{980A4C78-FF3E-4D3B-8D8C-FE78ADFCC3DF}.Debug|iPhone.Deploy.0 = Debug|Any CPU\n\t\t{980A4C78-FF3E-4D3B-8D8C-FE78ADFCC3DF}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU\n\t\t{980A4C78-FF3E-4D3B-8D8C-FE78ADFCC3DF}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU\n\t\t{980A4C78-FF3E-4D3B-8D8C-FE78ADFCC3DF}.Debug|iPhoneSimulator.Deploy.0 = Debug|Any CPU\n\t\t{980A4C78-FF3E-4D3B-8D8C-FE78ADFCC3DF}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{980A4C78-FF3E-4D3B-8D8C-FE78ADFCC3DF}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{980A4C78-FF3E-4D3B-8D8C-FE78ADFCC3DF}.Debug|x64.Deploy.0 = Debug|Any CPU\n\t\t{980A4C78-FF3E-4D3B-8D8C-FE78ADFCC3DF}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{980A4C78-FF3E-4D3B-8D8C-FE78ADFCC3DF}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{980A4C78-FF3E-4D3B-8D8C-FE78ADFCC3DF}.Debug|x86.Deploy.0 = Debug|Any CPU\n\t\t{980A4C78-FF3E-4D3B-8D8C-FE78ADFCC3DF}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{980A4C78-FF3E-4D3B-8D8C-FE78ADFCC3DF}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{980A4C78-FF3E-4D3B-8D8C-FE78ADFCC3DF}.Release|Any CPU.Deploy.0 = Release|Any CPU\n\t\t{980A4C78-FF3E-4D3B-8D8C-FE78ADFCC3DF}.Release|ARM.ActiveCfg = Release|Any CPU\n\t\t{980A4C78-FF3E-4D3B-8D8C-FE78ADFCC3DF}.Release|ARM.Build.0 = Release|Any CPU\n\t\t{980A4C78-FF3E-4D3B-8D8C-FE78ADFCC3DF}.Release|ARM.Deploy.0 = Release|Any CPU\n\t\t{980A4C78-FF3E-4D3B-8D8C-FE78ADFCC3DF}.Release|ARM64.ActiveCfg = Release|Any CPU\n\t\t{980A4C78-FF3E-4D3B-8D8C-FE78ADFCC3DF}.Release|ARM64.Build.0 = Release|Any CPU\n\t\t{980A4C78-FF3E-4D3B-8D8C-FE78ADFCC3DF}.Release|ARM64.Deploy.0 = Release|Any CPU\n\t\t{980A4C78-FF3E-4D3B-8D8C-FE78ADFCC3DF}.Release|iPhone.ActiveCfg = Release|Any CPU\n\t\t{980A4C78-FF3E-4D3B-8D8C-FE78ADFCC3DF}.Release|iPhone.Build.0 = Release|Any CPU\n\t\t{980A4C78-FF3E-4D3B-8D8C-FE78ADFCC3DF}.Release|iPhone.Deploy.0 = Release|Any CPU\n\t\t{980A4C78-FF3E-4D3B-8D8C-FE78ADFCC3DF}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU\n\t\t{980A4C78-FF3E-4D3B-8D8C-FE78ADFCC3DF}.Release|iPhoneSimulator.Build.0 = Release|Any CPU\n\t\t{980A4C78-FF3E-4D3B-8D8C-FE78ADFCC3DF}.Release|iPhoneSimulator.Deploy.0 = Release|Any CPU\n\t\t{980A4C78-FF3E-4D3B-8D8C-FE78ADFCC3DF}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{980A4C78-FF3E-4D3B-8D8C-FE78ADFCC3DF}.Release|x64.Build.0 = Release|Any CPU\n\t\t{980A4C78-FF3E-4D3B-8D8C-FE78ADFCC3DF}.Release|x64.Deploy.0 = Release|Any CPU\n\t\t{980A4C78-FF3E-4D3B-8D8C-FE78ADFCC3DF}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{980A4C78-FF3E-4D3B-8D8C-FE78ADFCC3DF}.Release|x86.Build.0 = Release|Any CPU\n\t\t{980A4C78-FF3E-4D3B-8D8C-FE78ADFCC3DF}.Release|x86.Deploy.0 = Release|Any CPU\n\t\t{98201B97-26AE-4FA1-845C-AC7FE025848D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{98201B97-26AE-4FA1-845C-AC7FE025848D}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{98201B97-26AE-4FA1-845C-AC7FE025848D}.Debug|ARM.ActiveCfg = Debug|Any CPU\n\t\t{98201B97-26AE-4FA1-845C-AC7FE025848D}.Debug|ARM.Build.0 = Debug|Any CPU\n\t\t{98201B97-26AE-4FA1-845C-AC7FE025848D}.Debug|ARM64.ActiveCfg = Debug|Any CPU\n\t\t{98201B97-26AE-4FA1-845C-AC7FE025848D}.Debug|ARM64.Build.0 = Debug|Any CPU\n\t\t{98201B97-26AE-4FA1-845C-AC7FE025848D}.Debug|iPhone.ActiveCfg = Debug|Any CPU\n\t\t{98201B97-26AE-4FA1-845C-AC7FE025848D}.Debug|iPhone.Build.0 = Debug|Any CPU\n\t\t{98201B97-26AE-4FA1-845C-AC7FE025848D}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU\n\t\t{98201B97-26AE-4FA1-845C-AC7FE025848D}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU\n\t\t{98201B97-26AE-4FA1-845C-AC7FE025848D}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{98201B97-26AE-4FA1-845C-AC7FE025848D}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{98201B97-26AE-4FA1-845C-AC7FE025848D}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{98201B97-26AE-4FA1-845C-AC7FE025848D}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{98201B97-26AE-4FA1-845C-AC7FE025848D}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{98201B97-26AE-4FA1-845C-AC7FE025848D}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{98201B97-26AE-4FA1-845C-AC7FE025848D}.Release|ARM.ActiveCfg = Release|Any CPU\n\t\t{98201B97-26AE-4FA1-845C-AC7FE025848D}.Release|ARM.Build.0 = Release|Any CPU\n\t\t{98201B97-26AE-4FA1-845C-AC7FE025848D}.Release|ARM64.ActiveCfg = Release|Any CPU\n\t\t{98201B97-26AE-4FA1-845C-AC7FE025848D}.Release|ARM64.Build.0 = Release|Any CPU\n\t\t{98201B97-26AE-4FA1-845C-AC7FE025848D}.Release|iPhone.ActiveCfg = Release|Any CPU\n\t\t{98201B97-26AE-4FA1-845C-AC7FE025848D}.Release|iPhone.Build.0 = Release|Any CPU\n\t\t{98201B97-26AE-4FA1-845C-AC7FE025848D}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU\n\t\t{98201B97-26AE-4FA1-845C-AC7FE025848D}.Release|iPhoneSimulator.Build.0 = Release|Any CPU\n\t\t{98201B97-26AE-4FA1-845C-AC7FE025848D}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{98201B97-26AE-4FA1-845C-AC7FE025848D}.Release|x64.Build.0 = Release|Any CPU\n\t\t{98201B97-26AE-4FA1-845C-AC7FE025848D}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{98201B97-26AE-4FA1-845C-AC7FE025848D}.Release|x86.Build.0 = Release|Any CPU\n\t\t{39B16098-4E39-49C4-9C74-BD5D809F4432}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{39B16098-4E39-49C4-9C74-BD5D809F4432}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{39B16098-4E39-49C4-9C74-BD5D809F4432}.Debug|ARM.ActiveCfg = Debug|Any CPU\n\t\t{39B16098-4E39-49C4-9C74-BD5D809F4432}.Debug|ARM.Build.0 = Debug|Any CPU\n\t\t{39B16098-4E39-49C4-9C74-BD5D809F4432}.Debug|ARM64.ActiveCfg = Debug|Any CPU\n\t\t{39B16098-4E39-49C4-9C74-BD5D809F4432}.Debug|ARM64.Build.0 = Debug|Any CPU\n\t\t{39B16098-4E39-49C4-9C74-BD5D809F4432}.Debug|iPhone.ActiveCfg = Debug|Any CPU\n\t\t{39B16098-4E39-49C4-9C74-BD5D809F4432}.Debug|iPhone.Build.0 = Debug|Any CPU\n\t\t{39B16098-4E39-49C4-9C74-BD5D809F4432}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU\n\t\t{39B16098-4E39-49C4-9C74-BD5D809F4432}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU\n\t\t{39B16098-4E39-49C4-9C74-BD5D809F4432}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{39B16098-4E39-49C4-9C74-BD5D809F4432}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{39B16098-4E39-49C4-9C74-BD5D809F4432}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{39B16098-4E39-49C4-9C74-BD5D809F4432}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{39B16098-4E39-49C4-9C74-BD5D809F4432}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{39B16098-4E39-49C4-9C74-BD5D809F4432}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{39B16098-4E39-49C4-9C74-BD5D809F4432}.Release|ARM.ActiveCfg = Release|Any CPU\n\t\t{39B16098-4E39-49C4-9C74-BD5D809F4432}.Release|ARM.Build.0 = Release|Any CPU\n\t\t{39B16098-4E39-49C4-9C74-BD5D809F4432}.Release|ARM64.ActiveCfg = Release|Any CPU\n\t\t{39B16098-4E39-49C4-9C74-BD5D809F4432}.Release|ARM64.Build.0 = Release|Any CPU\n\t\t{39B16098-4E39-49C4-9C74-BD5D809F4432}.Release|iPhone.ActiveCfg = Release|Any CPU\n\t\t{39B16098-4E39-49C4-9C74-BD5D809F4432}.Release|iPhone.Build.0 = Release|Any CPU\n\t\t{39B16098-4E39-49C4-9C74-BD5D809F4432}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU\n\t\t{39B16098-4E39-49C4-9C74-BD5D809F4432}.Release|iPhoneSimulator.Build.0 = Release|Any CPU\n\t\t{39B16098-4E39-49C4-9C74-BD5D809F4432}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{39B16098-4E39-49C4-9C74-BD5D809F4432}.Release|x64.Build.0 = Release|Any CPU\n\t\t{39B16098-4E39-49C4-9C74-BD5D809F4432}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{39B16098-4E39-49C4-9C74-BD5D809F4432}.Release|x86.Build.0 = Release|Any CPU\n\t\t{7D45AF78-BEC3-44AD-9A8C-3784FB638495}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{7D45AF78-BEC3-44AD-9A8C-3784FB638495}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{7D45AF78-BEC3-44AD-9A8C-3784FB638495}.Debug|Any CPU.Deploy.0 = Debug|Any CPU\n\t\t{7D45AF78-BEC3-44AD-9A8C-3784FB638495}.Debug|ARM.ActiveCfg = Debug|Any CPU\n\t\t{7D45AF78-BEC3-44AD-9A8C-3784FB638495}.Debug|ARM.Build.0 = Debug|Any CPU\n\t\t{7D45AF78-BEC3-44AD-9A8C-3784FB638495}.Debug|ARM.Deploy.0 = Debug|Any CPU\n\t\t{7D45AF78-BEC3-44AD-9A8C-3784FB638495}.Debug|ARM64.ActiveCfg = Debug|Any CPU\n\t\t{7D45AF78-BEC3-44AD-9A8C-3784FB638495}.Debug|ARM64.Build.0 = Debug|Any CPU\n\t\t{7D45AF78-BEC3-44AD-9A8C-3784FB638495}.Debug|ARM64.Deploy.0 = Debug|Any CPU\n\t\t{7D45AF78-BEC3-44AD-9A8C-3784FB638495}.Debug|iPhone.ActiveCfg = Debug|Any CPU\n\t\t{7D45AF78-BEC3-44AD-9A8C-3784FB638495}.Debug|iPhone.Build.0 = Debug|Any CPU\n\t\t{7D45AF78-BEC3-44AD-9A8C-3784FB638495}.Debug|iPhone.Deploy.0 = Debug|Any CPU\n\t\t{7D45AF78-BEC3-44AD-9A8C-3784FB638495}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU\n\t\t{7D45AF78-BEC3-44AD-9A8C-3784FB638495}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU\n\t\t{7D45AF78-BEC3-44AD-9A8C-3784FB638495}.Debug|iPhoneSimulator.Deploy.0 = Debug|Any CPU\n\t\t{7D45AF78-BEC3-44AD-9A8C-3784FB638495}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{7D45AF78-BEC3-44AD-9A8C-3784FB638495}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{7D45AF78-BEC3-44AD-9A8C-3784FB638495}.Debug|x64.Deploy.0 = Debug|Any CPU\n\t\t{7D45AF78-BEC3-44AD-9A8C-3784FB638495}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{7D45AF78-BEC3-44AD-9A8C-3784FB638495}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{7D45AF78-BEC3-44AD-9A8C-3784FB638495}.Debug|x86.Deploy.0 = Debug|Any CPU\n\t\t{7D45AF78-BEC3-44AD-9A8C-3784FB638495}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{7D45AF78-BEC3-44AD-9A8C-3784FB638495}.Release|ARM.ActiveCfg = Release|Any CPU\n\t\t{7D45AF78-BEC3-44AD-9A8C-3784FB638495}.Release|ARM.Build.0 = Release|Any CPU\n\t\t{7D45AF78-BEC3-44AD-9A8C-3784FB638495}.Release|ARM.Deploy.0 = Release|Any CPU\n\t\t{7D45AF78-BEC3-44AD-9A8C-3784FB638495}.Release|ARM64.ActiveCfg = Release|Any CPU\n\t\t{7D45AF78-BEC3-44AD-9A8C-3784FB638495}.Release|ARM64.Build.0 = Release|Any CPU\n\t\t{7D45AF78-BEC3-44AD-9A8C-3784FB638495}.Release|ARM64.Deploy.0 = Release|Any CPU\n\t\t{7D45AF78-BEC3-44AD-9A8C-3784FB638495}.Release|iPhone.ActiveCfg = Release|Any CPU\n\t\t{7D45AF78-BEC3-44AD-9A8C-3784FB638495}.Release|iPhone.Build.0 = Release|Any CPU\n\t\t{7D45AF78-BEC3-44AD-9A8C-3784FB638495}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU\n\t\t{7D45AF78-BEC3-44AD-9A8C-3784FB638495}.Release|iPhoneSimulator.Build.0 = Release|Any CPU\n\t\t{7D45AF78-BEC3-44AD-9A8C-3784FB638495}.Release|iPhoneSimulator.Deploy.0 = Release|Any CPU\n\t\t{7D45AF78-BEC3-44AD-9A8C-3784FB638495}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{7D45AF78-BEC3-44AD-9A8C-3784FB638495}.Release|x64.Build.0 = Release|Any CPU\n\t\t{7D45AF78-BEC3-44AD-9A8C-3784FB638495}.Release|x64.Deploy.0 = Release|Any CPU\n\t\t{7D45AF78-BEC3-44AD-9A8C-3784FB638495}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{7D45AF78-BEC3-44AD-9A8C-3784FB638495}.Release|x86.Build.0 = Release|Any CPU\n\t\t{7D45AF78-BEC3-44AD-9A8C-3784FB638495}.Release|x86.Deploy.0 = Release|Any CPU\n\t\t{92F6D561-4134-444D-8E86-4AD4BF6443C7}.Debug|Any CPU.ActiveCfg = Debug|x64\n\t\t{92F6D561-4134-444D-8E86-4AD4BF6443C7}.Debug|Any CPU.Build.0 = Debug|x64\n\t\t{92F6D561-4134-444D-8E86-4AD4BF6443C7}.Debug|Any CPU.Deploy.0 = Debug|x64\n\t\t{92F6D561-4134-444D-8E86-4AD4BF6443C7}.Debug|ARM.ActiveCfg = Debug|x64\n\t\t{92F6D561-4134-444D-8E86-4AD4BF6443C7}.Debug|ARM.Build.0 = Debug|x64\n\t\t{92F6D561-4134-444D-8E86-4AD4BF6443C7}.Debug|ARM.Deploy.0 = Debug|x64\n\t\t{92F6D561-4134-444D-8E86-4AD4BF6443C7}.Debug|ARM64.ActiveCfg = Debug|arm64\n\t\t{92F6D561-4134-444D-8E86-4AD4BF6443C7}.Debug|ARM64.Build.0 = Debug|arm64\n\t\t{92F6D561-4134-444D-8E86-4AD4BF6443C7}.Debug|ARM64.Deploy.0 = Debug|arm64\n\t\t{92F6D561-4134-444D-8E86-4AD4BF6443C7}.Debug|iPhone.ActiveCfg = Debug|x64\n\t\t{92F6D561-4134-444D-8E86-4AD4BF6443C7}.Debug|iPhone.Build.0 = Debug|x64\n\t\t{92F6D561-4134-444D-8E86-4AD4BF6443C7}.Debug|iPhone.Deploy.0 = Debug|x64\n\t\t{92F6D561-4134-444D-8E86-4AD4BF6443C7}.Debug|iPhoneSimulator.ActiveCfg = Debug|x64\n\t\t{92F6D561-4134-444D-8E86-4AD4BF6443C7}.Debug|iPhoneSimulator.Build.0 = Debug|x64\n\t\t{92F6D561-4134-444D-8E86-4AD4BF6443C7}.Debug|iPhoneSimulator.Deploy.0 = Debug|x64\n\t\t{92F6D561-4134-444D-8E86-4AD4BF6443C7}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{92F6D561-4134-444D-8E86-4AD4BF6443C7}.Debug|x64.Build.0 = Debug|x64\n\t\t{92F6D561-4134-444D-8E86-4AD4BF6443C7}.Debug|x86.ActiveCfg = Debug|x86\n\t\t{92F6D561-4134-444D-8E86-4AD4BF6443C7}.Debug|x86.Build.0 = Debug|x86\n\t\t{92F6D561-4134-444D-8E86-4AD4BF6443C7}.Release|Any CPU.ActiveCfg = Release|x64\n\t\t{92F6D561-4134-444D-8E86-4AD4BF6443C7}.Release|Any CPU.Build.0 = Release|x64\n\t\t{92F6D561-4134-444D-8E86-4AD4BF6443C7}.Release|Any CPU.Deploy.0 = Release|x64\n\t\t{92F6D561-4134-444D-8E86-4AD4BF6443C7}.Release|ARM.ActiveCfg = Release|x64\n\t\t{92F6D561-4134-444D-8E86-4AD4BF6443C7}.Release|ARM.Build.0 = Release|x64\n\t\t{92F6D561-4134-444D-8E86-4AD4BF6443C7}.Release|ARM64.ActiveCfg = Release|arm64\n\t\t{92F6D561-4134-444D-8E86-4AD4BF6443C7}.Release|ARM64.Build.0 = Release|arm64\n\t\t{92F6D561-4134-444D-8E86-4AD4BF6443C7}.Release|iPhone.ActiveCfg = Release|x64\n\t\t{92F6D561-4134-444D-8E86-4AD4BF6443C7}.Release|iPhone.Build.0 = Release|x64\n\t\t{92F6D561-4134-444D-8E86-4AD4BF6443C7}.Release|iPhoneSimulator.ActiveCfg = Release|x64\n\t\t{92F6D561-4134-444D-8E86-4AD4BF6443C7}.Release|iPhoneSimulator.Build.0 = Release|x64\n\t\t{92F6D561-4134-444D-8E86-4AD4BF6443C7}.Release|x64.ActiveCfg = Release|x64\n\t\t{92F6D561-4134-444D-8E86-4AD4BF6443C7}.Release|x64.Build.0 = Release|x64\n\t\t{92F6D561-4134-444D-8E86-4AD4BF6443C7}.Release|x86.ActiveCfg = Release|x86\n\t\t{92F6D561-4134-444D-8E86-4AD4BF6443C7}.Release|x86.Build.0 = Release|x86\n\t\t{B4A1BD15-DA72-4933-BD26-01E5E43279F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{B4A1BD15-DA72-4933-BD26-01E5E43279F8}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{B4A1BD15-DA72-4933-BD26-01E5E43279F8}.Debug|ARM.ActiveCfg = Debug|Any CPU\n\t\t{B4A1BD15-DA72-4933-BD26-01E5E43279F8}.Debug|ARM.Build.0 = Debug|Any CPU\n\t\t{B4A1BD15-DA72-4933-BD26-01E5E43279F8}.Debug|ARM64.ActiveCfg = Debug|Any CPU\n\t\t{B4A1BD15-DA72-4933-BD26-01E5E43279F8}.Debug|ARM64.Build.0 = Debug|Any CPU\n\t\t{B4A1BD15-DA72-4933-BD26-01E5E43279F8}.Debug|iPhone.ActiveCfg = Debug|Any CPU\n\t\t{B4A1BD15-DA72-4933-BD26-01E5E43279F8}.Debug|iPhone.Build.0 = Debug|Any CPU\n\t\t{B4A1BD15-DA72-4933-BD26-01E5E43279F8}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU\n\t\t{B4A1BD15-DA72-4933-BD26-01E5E43279F8}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU\n\t\t{B4A1BD15-DA72-4933-BD26-01E5E43279F8}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{B4A1BD15-DA72-4933-BD26-01E5E43279F8}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{B4A1BD15-DA72-4933-BD26-01E5E43279F8}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{B4A1BD15-DA72-4933-BD26-01E5E43279F8}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{B4A1BD15-DA72-4933-BD26-01E5E43279F8}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{B4A1BD15-DA72-4933-BD26-01E5E43279F8}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{B4A1BD15-DA72-4933-BD26-01E5E43279F8}.Release|ARM.ActiveCfg = Release|Any CPU\n\t\t{B4A1BD15-DA72-4933-BD26-01E5E43279F8}.Release|ARM.Build.0 = Release|Any CPU\n\t\t{B4A1BD15-DA72-4933-BD26-01E5E43279F8}.Release|ARM64.ActiveCfg = Release|Any CPU\n\t\t{B4A1BD15-DA72-4933-BD26-01E5E43279F8}.Release|ARM64.Build.0 = Release|Any CPU\n\t\t{B4A1BD15-DA72-4933-BD26-01E5E43279F8}.Release|iPhone.ActiveCfg = Release|Any CPU\n\t\t{B4A1BD15-DA72-4933-BD26-01E5E43279F8}.Release|iPhone.Build.0 = Release|Any CPU\n\t\t{B4A1BD15-DA72-4933-BD26-01E5E43279F8}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU\n\t\t{B4A1BD15-DA72-4933-BD26-01E5E43279F8}.Release|iPhoneSimulator.Build.0 = Release|Any CPU\n\t\t{B4A1BD15-DA72-4933-BD26-01E5E43279F8}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{B4A1BD15-DA72-4933-BD26-01E5E43279F8}.Release|x64.Build.0 = Release|Any CPU\n\t\t{B4A1BD15-DA72-4933-BD26-01E5E43279F8}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{B4A1BD15-DA72-4933-BD26-01E5E43279F8}.Release|x86.Build.0 = Release|Any CPU\n\t\t{F6F81EE6-24C6-4D4E-A38D-8C4ECADF5882}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{F6F81EE6-24C6-4D4E-A38D-8C4ECADF5882}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{F6F81EE6-24C6-4D4E-A38D-8C4ECADF5882}.Debug|ARM.ActiveCfg = Debug|Any CPU\n\t\t{F6F81EE6-24C6-4D4E-A38D-8C4ECADF5882}.Debug|ARM.Build.0 = Debug|Any CPU\n\t\t{F6F81EE6-24C6-4D4E-A38D-8C4ECADF5882}.Debug|ARM64.ActiveCfg = Debug|Any CPU\n\t\t{F6F81EE6-24C6-4D4E-A38D-8C4ECADF5882}.Debug|ARM64.Build.0 = Debug|Any CPU\n\t\t{F6F81EE6-24C6-4D4E-A38D-8C4ECADF5882}.Debug|iPhone.ActiveCfg = Debug|Any CPU\n\t\t{F6F81EE6-24C6-4D4E-A38D-8C4ECADF5882}.Debug|iPhone.Build.0 = Debug|Any CPU\n\t\t{F6F81EE6-24C6-4D4E-A38D-8C4ECADF5882}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU\n\t\t{F6F81EE6-24C6-4D4E-A38D-8C4ECADF5882}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU\n\t\t{F6F81EE6-24C6-4D4E-A38D-8C4ECADF5882}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{F6F81EE6-24C6-4D4E-A38D-8C4ECADF5882}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{F6F81EE6-24C6-4D4E-A38D-8C4ECADF5882}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{F6F81EE6-24C6-4D4E-A38D-8C4ECADF5882}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{F6F81EE6-24C6-4D4E-A38D-8C4ECADF5882}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{F6F81EE6-24C6-4D4E-A38D-8C4ECADF5882}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{F6F81EE6-24C6-4D4E-A38D-8C4ECADF5882}.Release|ARM.ActiveCfg = Release|Any CPU\n\t\t{F6F81EE6-24C6-4D4E-A38D-8C4ECADF5882}.Release|ARM.Build.0 = Release|Any CPU\n\t\t{F6F81EE6-24C6-4D4E-A38D-8C4ECADF5882}.Release|ARM64.ActiveCfg = Release|Any CPU\n\t\t{F6F81EE6-24C6-4D4E-A38D-8C4ECADF5882}.Release|ARM64.Build.0 = Release|Any CPU\n\t\t{F6F81EE6-24C6-4D4E-A38D-8C4ECADF5882}.Release|iPhone.ActiveCfg = Release|Any CPU\n\t\t{F6F81EE6-24C6-4D4E-A38D-8C4ECADF5882}.Release|iPhone.Build.0 = Release|Any CPU\n\t\t{F6F81EE6-24C6-4D4E-A38D-8C4ECADF5882}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU\n\t\t{F6F81EE6-24C6-4D4E-A38D-8C4ECADF5882}.Release|iPhoneSimulator.Build.0 = Release|Any CPU\n\t\t{F6F81EE6-24C6-4D4E-A38D-8C4ECADF5882}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{F6F81EE6-24C6-4D4E-A38D-8C4ECADF5882}.Release|x64.Build.0 = Release|Any CPU\n\t\t{F6F81EE6-24C6-4D4E-A38D-8C4ECADF5882}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{F6F81EE6-24C6-4D4E-A38D-8C4ECADF5882}.Release|x86.Build.0 = Release|Any CPU\n\t\t{FDA1EB82-8ED3-4284-842D-9E7732CB328C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{FDA1EB82-8ED3-4284-842D-9E7732CB328C}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{FDA1EB82-8ED3-4284-842D-9E7732CB328C}.Debug|ARM.ActiveCfg = Debug|Any CPU\n\t\t{FDA1EB82-8ED3-4284-842D-9E7732CB328C}.Debug|ARM.Build.0 = Debug|Any CPU\n\t\t{FDA1EB82-8ED3-4284-842D-9E7732CB328C}.Debug|ARM64.ActiveCfg = Debug|Any CPU\n\t\t{FDA1EB82-8ED3-4284-842D-9E7732CB328C}.Debug|ARM64.Build.0 = Debug|Any CPU\n\t\t{FDA1EB82-8ED3-4284-842D-9E7732CB328C}.Debug|iPhone.ActiveCfg = Debug|Any CPU\n\t\t{FDA1EB82-8ED3-4284-842D-9E7732CB328C}.Debug|iPhone.Build.0 = Debug|Any CPU\n\t\t{FDA1EB82-8ED3-4284-842D-9E7732CB328C}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU\n\t\t{FDA1EB82-8ED3-4284-842D-9E7732CB328C}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU\n\t\t{FDA1EB82-8ED3-4284-842D-9E7732CB328C}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{FDA1EB82-8ED3-4284-842D-9E7732CB328C}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{FDA1EB82-8ED3-4284-842D-9E7732CB328C}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{FDA1EB82-8ED3-4284-842D-9E7732CB328C}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{FDA1EB82-8ED3-4284-842D-9E7732CB328C}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{FDA1EB82-8ED3-4284-842D-9E7732CB328C}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{FDA1EB82-8ED3-4284-842D-9E7732CB328C}.Release|ARM.ActiveCfg = Release|Any CPU\n\t\t{FDA1EB82-8ED3-4284-842D-9E7732CB328C}.Release|ARM.Build.0 = Release|Any CPU\n\t\t{FDA1EB82-8ED3-4284-842D-9E7732CB328C}.Release|ARM64.ActiveCfg = Release|Any CPU\n\t\t{FDA1EB82-8ED3-4284-842D-9E7732CB328C}.Release|ARM64.Build.0 = Release|Any CPU\n\t\t{FDA1EB82-8ED3-4284-842D-9E7732CB328C}.Release|iPhone.ActiveCfg = Release|Any CPU\n\t\t{FDA1EB82-8ED3-4284-842D-9E7732CB328C}.Release|iPhone.Build.0 = Release|Any CPU\n\t\t{FDA1EB82-8ED3-4284-842D-9E7732CB328C}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU\n\t\t{FDA1EB82-8ED3-4284-842D-9E7732CB328C}.Release|iPhoneSimulator.Build.0 = Release|Any CPU\n\t\t{FDA1EB82-8ED3-4284-842D-9E7732CB328C}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{FDA1EB82-8ED3-4284-842D-9E7732CB328C}.Release|x64.Build.0 = Release|Any CPU\n\t\t{FDA1EB82-8ED3-4284-842D-9E7732CB328C}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{FDA1EB82-8ED3-4284-842D-9E7732CB328C}.Release|x86.Build.0 = Release|Any CPU\n\t\t{8D59D64C-EAF1-4BF7-9E69-556114C96A95}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{8D59D64C-EAF1-4BF7-9E69-556114C96A95}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{8D59D64C-EAF1-4BF7-9E69-556114C96A95}.Debug|ARM.ActiveCfg = Debug|Any CPU\n\t\t{8D59D64C-EAF1-4BF7-9E69-556114C96A95}.Debug|ARM.Build.0 = Debug|Any CPU\n\t\t{8D59D64C-EAF1-4BF7-9E69-556114C96A95}.Debug|ARM64.ActiveCfg = Debug|Any CPU\n\t\t{8D59D64C-EAF1-4BF7-9E69-556114C96A95}.Debug|ARM64.Build.0 = Debug|Any CPU\n\t\t{8D59D64C-EAF1-4BF7-9E69-556114C96A95}.Debug|iPhone.ActiveCfg = Debug|Any CPU\n\t\t{8D59D64C-EAF1-4BF7-9E69-556114C96A95}.Debug|iPhone.Build.0 = Debug|Any CPU\n\t\t{8D59D64C-EAF1-4BF7-9E69-556114C96A95}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU\n\t\t{8D59D64C-EAF1-4BF7-9E69-556114C96A95}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU\n\t\t{8D59D64C-EAF1-4BF7-9E69-556114C96A95}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{8D59D64C-EAF1-4BF7-9E69-556114C96A95}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{8D59D64C-EAF1-4BF7-9E69-556114C96A95}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{8D59D64C-EAF1-4BF7-9E69-556114C96A95}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{8D59D64C-EAF1-4BF7-9E69-556114C96A95}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{8D59D64C-EAF1-4BF7-9E69-556114C96A95}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{8D59D64C-EAF1-4BF7-9E69-556114C96A95}.Release|ARM.ActiveCfg = Release|Any CPU\n\t\t{8D59D64C-EAF1-4BF7-9E69-556114C96A95}.Release|ARM.Build.0 = Release|Any CPU\n\t\t{8D59D64C-EAF1-4BF7-9E69-556114C96A95}.Release|ARM64.ActiveCfg = Release|Any CPU\n\t\t{8D59D64C-EAF1-4BF7-9E69-556114C96A95}.Release|ARM64.Build.0 = Release|Any CPU\n\t\t{8D59D64C-EAF1-4BF7-9E69-556114C96A95}.Release|iPhone.ActiveCfg = Release|Any CPU\n\t\t{8D59D64C-EAF1-4BF7-9E69-556114C96A95}.Release|iPhone.Build.0 = Release|Any CPU\n\t\t{8D59D64C-EAF1-4BF7-9E69-556114C96A95}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU\n\t\t{8D59D64C-EAF1-4BF7-9E69-556114C96A95}.Release|iPhoneSimulator.Build.0 = Release|Any CPU\n\t\t{8D59D64C-EAF1-4BF7-9E69-556114C96A95}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{8D59D64C-EAF1-4BF7-9E69-556114C96A95}.Release|x64.Build.0 = Release|Any CPU\n\t\t{8D59D64C-EAF1-4BF7-9E69-556114C96A95}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{8D59D64C-EAF1-4BF7-9E69-556114C96A95}.Release|x86.Build.0 = Release|Any CPU\n\t\t{5AD22541-BC5D-45E0-9C95-87B51300FF1C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{5AD22541-BC5D-45E0-9C95-87B51300FF1C}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{5AD22541-BC5D-45E0-9C95-87B51300FF1C}.Debug|ARM.ActiveCfg = Debug|Any CPU\n\t\t{5AD22541-BC5D-45E0-9C95-87B51300FF1C}.Debug|ARM.Build.0 = Debug|Any CPU\n\t\t{5AD22541-BC5D-45E0-9C95-87B51300FF1C}.Debug|ARM64.ActiveCfg = Debug|Any CPU\n\t\t{5AD22541-BC5D-45E0-9C95-87B51300FF1C}.Debug|ARM64.Build.0 = Debug|Any CPU\n\t\t{5AD22541-BC5D-45E0-9C95-87B51300FF1C}.Debug|iPhone.ActiveCfg = Debug|Any CPU\n\t\t{5AD22541-BC5D-45E0-9C95-87B51300FF1C}.Debug|iPhone.Build.0 = Debug|Any CPU\n\t\t{5AD22541-BC5D-45E0-9C95-87B51300FF1C}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU\n\t\t{5AD22541-BC5D-45E0-9C95-87B51300FF1C}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU\n\t\t{5AD22541-BC5D-45E0-9C95-87B51300FF1C}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{5AD22541-BC5D-45E0-9C95-87B51300FF1C}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{5AD22541-BC5D-45E0-9C95-87B51300FF1C}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{5AD22541-BC5D-45E0-9C95-87B51300FF1C}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{5AD22541-BC5D-45E0-9C95-87B51300FF1C}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{5AD22541-BC5D-45E0-9C95-87B51300FF1C}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{5AD22541-BC5D-45E0-9C95-87B51300FF1C}.Release|ARM.ActiveCfg = Release|Any CPU\n\t\t{5AD22541-BC5D-45E0-9C95-87B51300FF1C}.Release|ARM.Build.0 = Release|Any CPU\n\t\t{5AD22541-BC5D-45E0-9C95-87B51300FF1C}.Release|ARM64.ActiveCfg = Release|Any CPU\n\t\t{5AD22541-BC5D-45E0-9C95-87B51300FF1C}.Release|ARM64.Build.0 = Release|Any CPU\n\t\t{5AD22541-BC5D-45E0-9C95-87B51300FF1C}.Release|iPhone.ActiveCfg = Release|Any CPU\n\t\t{5AD22541-BC5D-45E0-9C95-87B51300FF1C}.Release|iPhone.Build.0 = Release|Any CPU\n\t\t{5AD22541-BC5D-45E0-9C95-87B51300FF1C}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU\n\t\t{5AD22541-BC5D-45E0-9C95-87B51300FF1C}.Release|iPhoneSimulator.Build.0 = Release|Any CPU\n\t\t{5AD22541-BC5D-45E0-9C95-87B51300FF1C}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{5AD22541-BC5D-45E0-9C95-87B51300FF1C}.Release|x64.Build.0 = Release|Any CPU\n\t\t{5AD22541-BC5D-45E0-9C95-87B51300FF1C}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{5AD22541-BC5D-45E0-9C95-87B51300FF1C}.Release|x86.Build.0 = Release|Any CPU\n\t\t{ABC0F8AF-6FED-4C3E-80B3-54F1A7CC5930}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{ABC0F8AF-6FED-4C3E-80B3-54F1A7CC5930}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{ABC0F8AF-6FED-4C3E-80B3-54F1A7CC5930}.Debug|ARM.ActiveCfg = Debug|Any CPU\n\t\t{ABC0F8AF-6FED-4C3E-80B3-54F1A7CC5930}.Debug|ARM.Build.0 = Debug|Any CPU\n\t\t{ABC0F8AF-6FED-4C3E-80B3-54F1A7CC5930}.Debug|ARM64.ActiveCfg = Debug|Any CPU\n\t\t{ABC0F8AF-6FED-4C3E-80B3-54F1A7CC5930}.Debug|ARM64.Build.0 = Debug|Any CPU\n\t\t{ABC0F8AF-6FED-4C3E-80B3-54F1A7CC5930}.Debug|iPhone.ActiveCfg = Debug|Any CPU\n\t\t{ABC0F8AF-6FED-4C3E-80B3-54F1A7CC5930}.Debug|iPhone.Build.0 = Debug|Any CPU\n\t\t{ABC0F8AF-6FED-4C3E-80B3-54F1A7CC5930}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU\n\t\t{ABC0F8AF-6FED-4C3E-80B3-54F1A7CC5930}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU\n\t\t{ABC0F8AF-6FED-4C3E-80B3-54F1A7CC5930}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{ABC0F8AF-6FED-4C3E-80B3-54F1A7CC5930}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{ABC0F8AF-6FED-4C3E-80B3-54F1A7CC5930}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{ABC0F8AF-6FED-4C3E-80B3-54F1A7CC5930}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{ABC0F8AF-6FED-4C3E-80B3-54F1A7CC5930}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{ABC0F8AF-6FED-4C3E-80B3-54F1A7CC5930}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{ABC0F8AF-6FED-4C3E-80B3-54F1A7CC5930}.Release|ARM.ActiveCfg = Release|Any CPU\n\t\t{ABC0F8AF-6FED-4C3E-80B3-54F1A7CC5930}.Release|ARM.Build.0 = Release|Any CPU\n\t\t{ABC0F8AF-6FED-4C3E-80B3-54F1A7CC5930}.Release|ARM64.ActiveCfg = Release|Any CPU\n\t\t{ABC0F8AF-6FED-4C3E-80B3-54F1A7CC5930}.Release|ARM64.Build.0 = Release|Any CPU\n\t\t{ABC0F8AF-6FED-4C3E-80B3-54F1A7CC5930}.Release|iPhone.ActiveCfg = Release|Any CPU\n\t\t{ABC0F8AF-6FED-4C3E-80B3-54F1A7CC5930}.Release|iPhone.Build.0 = Release|Any CPU\n\t\t{ABC0F8AF-6FED-4C3E-80B3-54F1A7CC5930}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU\n\t\t{ABC0F8AF-6FED-4C3E-80B3-54F1A7CC5930}.Release|iPhoneSimulator.Build.0 = Release|Any CPU\n\t\t{ABC0F8AF-6FED-4C3E-80B3-54F1A7CC5930}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{ABC0F8AF-6FED-4C3E-80B3-54F1A7CC5930}.Release|x64.Build.0 = Release|Any CPU\n\t\t{ABC0F8AF-6FED-4C3E-80B3-54F1A7CC5930}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{ABC0F8AF-6FED-4C3E-80B3-54F1A7CC5930}.Release|x86.Build.0 = Release|Any CPU\n\t\t{28A534A3-3ADA-4435-B5F5-59FA61DF23EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{28A534A3-3ADA-4435-B5F5-59FA61DF23EF}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{28A534A3-3ADA-4435-B5F5-59FA61DF23EF}.Debug|ARM.ActiveCfg = Debug|Any CPU\n\t\t{28A534A3-3ADA-4435-B5F5-59FA61DF23EF}.Debug|ARM.Build.0 = Debug|Any CPU\n\t\t{28A534A3-3ADA-4435-B5F5-59FA61DF23EF}.Debug|ARM64.ActiveCfg = Debug|Any CPU\n\t\t{28A534A3-3ADA-4435-B5F5-59FA61DF23EF}.Debug|ARM64.Build.0 = Debug|Any CPU\n\t\t{28A534A3-3ADA-4435-B5F5-59FA61DF23EF}.Debug|iPhone.ActiveCfg = Debug|Any CPU\n\t\t{28A534A3-3ADA-4435-B5F5-59FA61DF23EF}.Debug|iPhone.Build.0 = Debug|Any CPU\n\t\t{28A534A3-3ADA-4435-B5F5-59FA61DF23EF}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU\n\t\t{28A534A3-3ADA-4435-B5F5-59FA61DF23EF}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU\n\t\t{28A534A3-3ADA-4435-B5F5-59FA61DF23EF}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{28A534A3-3ADA-4435-B5F5-59FA61DF23EF}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{28A534A3-3ADA-4435-B5F5-59FA61DF23EF}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{28A534A3-3ADA-4435-B5F5-59FA61DF23EF}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{28A534A3-3ADA-4435-B5F5-59FA61DF23EF}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{28A534A3-3ADA-4435-B5F5-59FA61DF23EF}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{28A534A3-3ADA-4435-B5F5-59FA61DF23EF}.Release|ARM.ActiveCfg = Release|Any CPU\n\t\t{28A534A3-3ADA-4435-B5F5-59FA61DF23EF}.Release|ARM.Build.0 = Release|Any CPU\n\t\t{28A534A3-3ADA-4435-B5F5-59FA61DF23EF}.Release|ARM64.ActiveCfg = Release|Any CPU\n\t\t{28A534A3-3ADA-4435-B5F5-59FA61DF23EF}.Release|ARM64.Build.0 = Release|Any CPU\n\t\t{28A534A3-3ADA-4435-B5F5-59FA61DF23EF}.Release|iPhone.ActiveCfg = Release|Any CPU\n\t\t{28A534A3-3ADA-4435-B5F5-59FA61DF23EF}.Release|iPhone.Build.0 = Release|Any CPU\n\t\t{28A534A3-3ADA-4435-B5F5-59FA61DF23EF}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU\n\t\t{28A534A3-3ADA-4435-B5F5-59FA61DF23EF}.Release|iPhoneSimulator.Build.0 = Release|Any CPU\n\t\t{28A534A3-3ADA-4435-B5F5-59FA61DF23EF}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{28A534A3-3ADA-4435-B5F5-59FA61DF23EF}.Release|x64.Build.0 = Release|Any CPU\n\t\t{28A534A3-3ADA-4435-B5F5-59FA61DF23EF}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{28A534A3-3ADA-4435-B5F5-59FA61DF23EF}.Release|x86.Build.0 = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\n\tGlobalSection(NestedProjects) = preSolution\n\t\t{660A1FE2-C440-402C-A5DC-6901F5FBED61} = {5E74EB0D-FBD3-4399-8F38-AD888DEFFC73}\n\t\t{09C2B6C8-E492-49E7-A598-18E8881646C8} = {5E74EB0D-FBD3-4399-8F38-AD888DEFFC73}\n\t\t{980A4C78-FF3E-4D3B-8D8C-FE78ADFCC3DF} = {660A1FE2-C440-402C-A5DC-6901F5FBED61}\n\t\t{98201B97-26AE-4FA1-845C-AC7FE025848D} = {660A1FE2-C440-402C-A5DC-6901F5FBED61}\n\t\t{39B16098-4E39-49C4-9C74-BD5D809F4432} = {660A1FE2-C440-402C-A5DC-6901F5FBED61}\n\t\t{7D45AF78-BEC3-44AD-9A8C-3784FB638495} = {660A1FE2-C440-402C-A5DC-6901F5FBED61}\n\t\t{92F6D561-4134-444D-8E86-4AD4BF6443C7} = {660A1FE2-C440-402C-A5DC-6901F5FBED61}\n\t\t{B4A1BD15-DA72-4933-BD26-01E5E43279F8} = {660A1FE2-C440-402C-A5DC-6901F5FBED61}\n\t\t{F6F81EE6-24C6-4D4E-A38D-8C4ECADF5882} = {2C5D7523-6030-4B75-ABE0-3CB8AA0953CB}\n\t\t{FDA1EB82-8ED3-4284-842D-9E7732CB328C} = {2C5D7523-6030-4B75-ABE0-3CB8AA0953CB}\n\t\t{8D59D64C-EAF1-4BF7-9E69-556114C96A95} = {2C5D7523-6030-4B75-ABE0-3CB8AA0953CB}\n\t\t{F67BA438-F236-460B-B279-A71AB8033B54} = {5E74EB0D-FBD3-4399-8F38-AD888DEFFC73}\n\t\t{5AD22541-BC5D-45E0-9C95-87B51300FF1C} = {F67BA438-F236-460B-B279-A71AB8033B54}\n\t\t{ABC0F8AF-6FED-4C3E-80B3-54F1A7CC5930} = {2C5D7523-6030-4B75-ABE0-3CB8AA0953CB}\n\t\t{28A534A3-3ADA-4435-B5F5-59FA61DF23EF} = {660A1FE2-C440-402C-A5DC-6901F5FBED61}\n\tEndGlobalSection\n\tGlobalSection(ExtensibilityGlobals) = postSolution\n\t\tSolutionGuid = {757C5D89-969E-4F38-B8F1-3098C8E17307}\n\tEndGlobalSection\n\tGlobalSection(SharedMSBuildProjectFiles) = preSolution\n\t\t..\\..\\src\\Containers\\Prism.DryIoc.Shared\\Prism.DryIoc.Shared.projitems*{8d59d64c-eaf1-4bf7-9e69-556114c96a95}*SharedItemsImports = 5\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "e2e/Uno/ModuleA/Dialogs/AlertDialog.xaml",
    "content": "﻿<UserControl\n    x:Class=\"ModuleA.Dialogs.AlertDialog\"\n    xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n    xmlns:local=\"using:ModuleA\"\n    xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n    xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n    mc:Ignorable=\"d\"\n    d:DesignHeight=\"300\"\n    d:DesignWidth=\"400\">\n\n  <StackPanel>\n    <TextBlock Text=\"{Binding Message}\" />\n    <Button Content=\"OK\"\n            Command=\"{Binding CloseCommand}\"\n            Margin=\"0,15\"/>\n  </StackPanel>\n</UserControl>\n"
  },
  {
    "path": "e2e/Uno/ModuleA/Dialogs/AlertDialog.xaml.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Runtime.InteropServices.WindowsRuntime;\nusing Microsoft.UI.Xaml;\nusing Microsoft.UI.Xaml.Controls;\nusing Microsoft.UI.Xaml.Controls.Primitives;\nusing Microsoft.UI.Xaml.Data;\nusing Microsoft.UI.Xaml.Input;\nusing Microsoft.UI.Xaml.Media;\nusing Microsoft.UI.Xaml.Navigation;\nusing Windows.Foundation;\nusing Windows.Foundation.Collections;\n\n// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236\n\nnamespace ModuleA.Dialogs\n{\n    public sealed partial class AlertDialog : UserControl\n    {\n        public AlertDialog()\n        {\n            this.InitializeComponent();\n        }\n    }\n}\n"
  },
  {
    "path": "e2e/Uno/ModuleA/Dialogs/AlertDialogViewModel.cs",
    "content": "﻿namespace ModuleA.Dialogs;\n\ninternal class AlertDialogViewModel : BindableBase, IDialogAware\n{\n    public AlertDialogViewModel()\n    {\n        CloseCommand = new DelegateCommand(() => RequestClose.Invoke(new DialogResult(ButtonResult.OK)));\n    }\n\n    private string _title = string.Empty;\n    public string Title\n    {\n        get => _title;\n        set => SetProperty(ref _title, value);\n    }\n\n    private string _message = string.Empty;\n    public string Message\n    {\n        get => _message;\n        set => SetProperty(ref _message, value);\n    }\n\n    public DelegateCommand CloseCommand { get; }\n\n    public DialogCloseListener RequestClose { get; }\n\n    public bool CanCloseDialog() => true;\n\n    public void OnDialogClosed()\n    {\n\n    }\n\n    public void OnDialogOpened(IDialogParameters parameters)\n    {\n        Title = parameters.GetValue<string>(\"title\");\n        Message = parameters.GetValue<string>(\"message\");\n    }\n}\n"
  },
  {
    "path": "e2e/Uno/ModuleA/GlobalUsings.cs",
    "content": "﻿global using System;\nglobal using System.Collections.Generic;\nglobal using System.Linq;\nglobal using System.Net.Http;\nglobal using System.Threading;\nglobal using System.Threading.Tasks;\nglobal using Microsoft.UI.Xaml;\nglobal using Microsoft.UI.Xaml.Controls;\nglobal using Microsoft.UI.Xaml.Media;\nglobal using Microsoft.UI.Xaml.Navigation;\n"
  },
  {
    "path": "e2e/Uno/ModuleA/ModuleA.csproj",
    "content": "﻿<Project Sdk=\"Uno.Sdk\">\n\n  <PropertyGroup>\n    <TargetFrameworks>$(DotNetVersion);$(DotNetVersion)-ios;$(DotNetVersion)-android;$(DotNetVersion)-maccatalyst</TargetFrameworks>\n    <TargetFrameworks Condition=\"$([MSBuild]::IsOSPlatform('windows')) or '$(EnableWindowsTargeting)' == 'true'\">$(TargetFrameworks);$(DotNetVersion)-windows10.0.22621</TargetFrameworks>\n    <TargetFrameworks Condition=\"'$(OverrideTargetFramework)'!=''\">$(OverrideTargetFramework)</TargetFrameworks>\n\n    <!-- Ensures the .xr.xml files are generated in a proper layout folder -->\n    <GenerateLibraryLayout>true</GenerateLibraryLayout>\n    <ImplicitUsings>enable</ImplicitUsings>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Uno.WinUI\" />\n    <PackageReference Include=\"Microsoft.WindowsAppSDK\" Condition=\"$(TargetFramework.Contains('-windows10'))\" />\n    <PackageReference Include=\"Microsoft.Windows.SDK.BuildTools\" Condition=\"$(TargetFramework.Contains('-windows10'))\" />\n    <ProjectReference Include=\"..\\..\\..\\src\\Prism.Core\\Prism.Core.csproj\" />\n    <ProjectReference Include=\"..\\..\\..\\src\\Uno\\Prism.Uno\\Prism.Uno.WinUI.csproj\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "e2e/Uno/ModuleA/ModuleAModule.cs",
    "content": "using ModuleA.Dialogs;\nusing ModuleA.Views;\nusing AlertDialog = ModuleA.Dialogs.AlertDialog;\n\nnamespace ModuleA;\n\npublic class ModuleAModule : IModule\n{\n    private readonly IRegionManager _regionManager;\n\n    public ModuleAModule(IRegionManager regionManager)\n    {\n        _regionManager = regionManager;\n    }\n\n    public void RegisterTypes(IContainerRegistry containerRegistry)\n    {\n        containerRegistry.RegisterForNavigation<ViewA>();\n        containerRegistry.RegisterForNavigation<ViewB>();\n        containerRegistry.RegisterDialog<AlertDialog, AlertDialogViewModel>();\n    }\n\n    public void OnInitialized(IContainerProvider containerProvider)\n    {\n        //_regionManager.RegisterViewWithRegion<ViewA>(\"ContentRegion\");\n        //_regionManager.RequestNavigate(\"ContentRegion\", \"ViewA\");\n    }\n}\n"
  },
  {
    "path": "e2e/Uno/ModuleA/ViewModels/ViewAViewModel.cs",
    "content": "﻿using System.Windows.Input;\n\nnamespace ModuleA.ViewModels;\n\ninternal class ViewAViewModel : ViewModelBase\n{\n    private readonly IDialogService _dialogService;\n\n    public ViewAViewModel(IRegionManager regionManager, IDialogService dialogService)\n        : base(regionManager)\n    {\n        _dialogService = dialogService;\n        ShowAlertCommand = new DelegateCommand(ShowDialog);\n    }\n\n    public ICommand ShowAlertCommand { get; }\n\n    private void ShowDialog()\n    {\n        _dialogService.ShowDialog(\"AlertDialog\", new DialogParameters\n        {\n            { \"title\", \"Oh Snap\" },\n            { \"message\", \"You can actually create much more amazing dialogs with Prism. Hello from ViewA!\" }\n        });\n    }\n}\n"
  },
  {
    "path": "e2e/Uno/ModuleA/ViewModels/ViewBViewModel.cs",
    "content": "﻿namespace ModuleA.ViewModels;\n\ninternal class ViewBViewModel : ViewModelBase\n{\n    public ViewBViewModel(IRegionManager regionManager)\n        : base(regionManager)\n    {\n    }\n}\n"
  },
  {
    "path": "e2e/Uno/ModuleA/ViewModels/ViewModelBase.cs",
    "content": "﻿using System.Collections.ObjectModel;\n\nnamespace ModuleA.ViewModels;\n\ninternal class ViewModelBase : BindableBase, IRegionAware\n{\n    private readonly string _name;\n    protected IRegionManager RegionManager { get; }\n\n    protected ViewModelBase(IRegionManager regionManager)\n    {\n        RegionManager = regionManager;\n        Title = _name = GetType().Name.Replace(\"ViewModel\", string.Empty);\n    }\n\n    private string _title = string.Empty;\n    public string Title\n    {\n        get => _title;\n        set => SetProperty(ref _title, value);\n    }\n\n    private ObservableCollection<string> _messages = new();\n    public IEnumerable<string> Messages => _messages;\n\n\n    public bool IsNavigationTarget(NavigationContext navigationContext) =>\n        navigationContext.NavigatedName() == _name;\n\n    public void OnNavigatedFrom(NavigationContext navigationContext)\n    {\n        _messages.Add(\"OnNavigatedFrom\");\n    }\n\n    public void OnNavigatedTo(NavigationContext navigationContext)\n    {\n        if (navigationContext.Parameters.TryGetValue(\"title\", out string title))\n        {\n            Title = title;\n        }\n\n        _messages.Add(\"OnNavigatedTo\");\n    }\n}\n"
  },
  {
    "path": "e2e/Uno/ModuleA/Views/ViewA.xaml",
    "content": "<UserControl\n    x:Class=\"ModuleA.Views.ViewA\"\n    xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n    xmlns:local=\"using:ModuleA.Views\"\n    xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n    xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n    mc:Ignorable=\"d\"\n    d:DesignHeight=\"300\"\n    d:DesignWidth=\"400\">\n\n  <StackPanel>\n    <TextBlock Text=\"View A\" FontSize=\"72\" />\n    <Button Content=\"Show Dialog\" Command=\"{Binding ShowAlertCommand}\" />\n  </StackPanel>\n</UserControl>\n"
  },
  {
    "path": "e2e/Uno/ModuleA/Views/ViewA.xaml.cs",
    "content": "namespace ModuleA.Views;\n\npublic sealed partial class ViewA : UserControl\n{\n    public ViewA()\n    {\n        this.InitializeComponent();\n    }\n}\n"
  },
  {
    "path": "e2e/Uno/ModuleA/Views/ViewB.xaml",
    "content": "<UserControl\n    x:Class=\"ModuleA.Views.ViewB\"\n    xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n    xmlns:local=\"using:ModuleA.Views\"\n    xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n    xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n    mc:Ignorable=\"d\"\n    d:DesignHeight=\"300\"\n    d:DesignWidth=\"400\">\n\n  <Grid>\n    <TextBlock Text=\"View B\" FontSize=\"72\" />\n  </Grid>\n</UserControl>\n"
  },
  {
    "path": "e2e/Uno/ModuleA/Views/ViewB.xaml.cs",
    "content": "namespace ModuleA.Views;\n\npublic sealed partial class ViewB : UserControl\n{\n    public ViewB()\n    {\n        this.InitializeComponent();\n    }\n}\n"
  },
  {
    "path": "e2e/Uno/solution-config.props.sample",
    "content": "<Project>\n    <!--\n        This file is used to control the platforms compiled by Visual Studio, and allow for a faster\n        build when testing for a single platform. This will also result in better intellisense, as\n        the compiler will only load the assemblies for the platform that is being built. You do not\n        need to use this when compiling from Visual Studio Code, the command line or other IDEs.\n\n        Instructions:\n        1) Copy this file and remove the \".sample\" name\n        2) Uncomment the single property below for the target you want to build\n        3) Make sure to do a Rebuild, so that nuget restores the proper packages for the new target\n\n        Notes:\n        - You may optionally close the solution before making changes and reload the solution afterwards. This will avoid Visual Studio\n          asking you to reload any projects, it will also ensure that the changes are picked up by Visual Studio, and trigger a restore of\n          the packages.\n        - You may want to unload the platform heads that you are not going to build for. This will ensure that Visual Studio does not\n          try to build them, and will speed up the build process.\n    -->\n\n    <PropertyGroup>\n        <!-- Uncomment each line for each platform that you want to build: -->\n\n        <!-- <OverrideTargetFramework Condition=\"''!='hint: Windows App Sdk (WinUI)'\">$(DotNetVersion)-windows10.0.19041.0</OverrideTargetFramework> -->\n        <!-- <OverrideTargetFramework Condition=\"''!='hint: WASM, Skia'\">$(DotNetVersion)</OverrideTargetFramework> -->\n        <!-- <OverrideTargetFramework Condition=\"''!='hint: iOS'\">$(DotNetVersion)-ios</OverrideTargetFramework> -->\n        <!-- <OverrideTargetFramework Condition=\"''!='hint: Android'\">$(DotNetVersion)-android</OverrideTargetFramework> -->\n        <!-- <OverrideTargetFramework Condition=\"''!='hint: MacCatalyst'\">$(DotNetVersion)-maccatalyst</OverrideTargetFramework> -->\n    </PropertyGroup>\n</Project>\n"
  },
  {
    "path": "e2e/Wpf/HelloWorld/App.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<configuration>\n  <configSections>\n    <section name=\"modules\" type=\"Prism.Modularity.ModulesConfigurationSection, Prism.Wpf\" />\n  </configSections>\n  <startup>\n  </startup>\n  <modules>\n    <module assemblyFile=\"Modules/HelloWorld.Modules.ModuleA.dll\" moduleType=\"HelloWorld.Modules.ModuleA.ModuleAModule, HelloWorld.Modules.ModuleA, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null\" moduleName=\"ModuleAModule\" startupLoaded=\"True\" />\n  </modules>\n</configuration>"
  },
  {
    "path": "e2e/Wpf/HelloWorld/App.xaml",
    "content": "﻿<prism:PrismApplication x:Class=\"HelloWorld.App\"\n             xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n             xmlns:prism=\"http://prismlibrary.com/\"\n             xmlns:local=\"clr-namespace:HelloWorld\">\n    <Application.Resources>\n         \n    </Application.Resources>\n</prism:PrismApplication>\n"
  },
  {
    "path": "e2e/Wpf/HelloWorld/App.xaml.cs",
    "content": "﻿using HelloWorld.Views;\nusing Prism.Ioc;\nusing System.Windows;\nusing Prism.Modularity;\nusing HelloWorld.Modules.ModuleA;\n\nnamespace HelloWorld\n{\n    /// <summary>\n    /// Interaction logic for App.xaml\n    /// </summary>\n    public partial class App\n    {\n        protected override Window CreateShell()\n        {\n            return Container.Resolve<MainWindow>();\n        }\n\n        protected override void RegisterTypes(IContainerRegistry containerRegistry)\n        {\n            containerRegistry.RegisterSharedSamples();\n        }\n\n        protected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog)\n        {\n            moduleCatalog.AddModule<ModuleAModule>();\n        }\n\n        //to test various module catalogs:\n        //1. Comment out ConfigureModuleCatalog \n        //2. Remove the project reference to the module project \n        //3. Make sure the Modules directory exists in the output path when debugging\n        //4. Uncomment CreateModuleCatalog to test other modules catalogs\n        //5. Uncomment post build task in ModuleA.csproj\n        //protected override IModuleCatalog CreateModuleCatalog()\n        //{\n        //    return new ConfigurationModuleCatalog();\n\n        //    return new DirectoryModuleCatalog() { ModulePath = \"Modules\" };\n\n        //    return new XamlModuleCatalog(\"ModuleCatalog.xaml\");\n        //}\n    }\n}\n"
  },
  {
    "path": "e2e/Wpf/HelloWorld/Dialogs/AnotherDialogWindow.xaml",
    "content": "﻿<Window x:Class=\"HelloWorld.Dialogs.AnotherDialogWindow\"\n        xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n        xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n        xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n        xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n        xmlns:local=\"clr-namespace:HelloWorld.Dialogs\"\n        mc:Ignorable=\"d\"\n        Title=\"AnotherDialogWindow\" Height=\"450\" Width=\"800\" Background=\"Green\">\n    <Grid>\n        \n    </Grid>\n</Window>\n"
  },
  {
    "path": "e2e/Wpf/HelloWorld/Dialogs/AnotherDialogWindow.xaml.cs",
    "content": "﻿using Prism.Dialogs;\nusing System.Windows;\n\nnamespace HelloWorld.Dialogs\n{\n    /// <summary>\n    /// Interaction logic for AnotherDialogWindow.xaml\n    /// </summary>\n    public partial class AnotherDialogWindow : Window, IDialogWindow\n    {\n        public AnotherDialogWindow()\n        {\n            InitializeComponent();\n        }\n\n        public IDialogResult Result { get; set; }\n    }\n}\n"
  },
  {
    "path": "e2e/Wpf/HelloWorld/Dialogs/ConfirmationDialog.xaml",
    "content": "﻿<UserControl x:Class=\"HelloWorld.Dialogs.ConfirmationDialog\"\n             xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n             xmlns:prism=\"http://prismlibrary.com/\"\n             prism:ViewModelLocator.AutoWireViewModel=\"True\"\n             Width=\"300\" Height=\"150\">\n\n    <prism:Dialog.WindowStyle>\n        <Style TargetType=\"Window\">\n            <Setter Property=\"prism:Dialog.WindowStartupLocation\" Value=\"CenterScreen\" />\n            <Setter Property=\"ResizeMode\" Value=\"NoResize\"/>\n            <Setter Property=\"ShowInTaskbar\" Value=\"False\"/>\n            <Setter Property=\"SizeToContent\" Value=\"WidthAndHeight\"/>\n        </Style>\n    </prism:Dialog.WindowStyle>\n\n    <Grid x:Name=\"LayoutRoot\" Margin=\"5\">\n        <Grid.RowDefinitions>\n            <RowDefinition />\n            <RowDefinition Height=\"Auto\" />\n        </Grid.RowDefinitions>\n\n        <ContentControl HorizontalAlignment=\"Stretch\" VerticalAlignment=\"Stretch\" Grid.Row=\"0\" Content=\"{Binding Message}\"/>\n\n        <StackPanel Grid.Row=\"1\" Orientation=\"Horizontal\" HorizontalAlignment=\"Right\">\n            <Button Content=\"OK\" Command=\"{Binding CloseDialogCommand}\" CommandParameter=\"True\" Width=\"75\" Height=\"25\" HorizontalAlignment=\"Right\" Margin=\"0,10,0,0\" />\n            <Button Content=\"Cancel\" Command=\"{Binding CloseDialogCommand}\" CommandParameter=\"False\" Width=\"75\" Height=\"25\" HorizontalAlignment=\"Right\" Margin=\"20,10,0,0\" IsDefault=\"True\"/>\n        </StackPanel>\n    </Grid>\n</UserControl>\n"
  },
  {
    "path": "e2e/Wpf/HelloWorld/Dialogs/ConfirmationDialog.xaml.cs",
    "content": "﻿using System.Windows.Controls;\n\nnamespace HelloWorld.Dialogs\n{\n    /// <summary>\n    /// Interaction logic for ConfirmationDialog.xaml\n    /// </summary>\n    public partial class ConfirmationDialog : UserControl\n    {\n        public ConfirmationDialog()\n        {\n            InitializeComponent();\n        }\n    }\n}\n"
  },
  {
    "path": "e2e/Wpf/HelloWorld/Dialogs/ConfirmationDialogViewModel.cs",
    "content": "﻿namespace HelloWorld.Dialogs\n{\n    public class ConfirmationDialogViewModel : NotificationDialogViewModel\n    {\n        public ConfirmationDialogViewModel()\n        {\n            Title = \"Confirmation\";\n        }\n    }\n}\n"
  },
  {
    "path": "e2e/Wpf/HelloWorld/Dialogs/CustomDialogWindow.xaml",
    "content": "﻿<Window x:Class=\"HelloWorld.Dialogs.CustomDialogWindow\"\n        xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n        xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n        xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n        xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n        xmlns:local=\"clr-namespace:HelloWorld.Dialogs\"\n        mc:Ignorable=\"d\"\n        Title=\"Custom Dialog Window\" Height=\"450\" Width=\"800\" Background=\"Red\">\n\n</Window>\n"
  },
  {
    "path": "e2e/Wpf/HelloWorld/Dialogs/CustomDialogWindow.xaml.cs",
    "content": "﻿using Prism.Dialogs;\nusing System.Windows;\n\nnamespace HelloWorld.Dialogs\n{\n    /// <summary>\n    /// Interaction logic for CustomDialogWindow.xaml\n    /// </summary>\n    public partial class CustomDialogWindow : Window, IDialogWindow\n    {\n        public CustomDialogWindow()\n        {\n            InitializeComponent();\n        }\n\n        public IDialogResult Result { get; set; }\n    }\n}\n"
  },
  {
    "path": "e2e/Wpf/HelloWorld/Dialogs/DialogViewModelBase.cs",
    "content": "﻿using Prism.Commands;\nusing Prism.Mvvm;\nusing Prism.Dialogs;\nusing System;\n\nnamespace HelloWorld.Dialogs\n{\n    public class DialogViewModelBase : BindableBase, IDialogAware\n    {\n        private DelegateCommand<string> _closeDialogCommand;\n        public DelegateCommand<string> CloseDialogCommand =>\n            _closeDialogCommand ?? (_closeDialogCommand = new DelegateCommand<string>(CloseDialog));\n\n        private string _title;\n        public string Title\n        {\n            get { return _title; }\n            set { SetProperty(ref _title, value); }\n        }\n\n        public DialogCloseListener RequestClose { get; }\n\n        protected virtual void CloseDialog(string parameter)\n        {\n            var result = parameter?.ToLower() switch\n            {\n                \"true\" => ButtonResult.OK,\n                \"false\" => ButtonResult.Cancel,\n                _ => ButtonResult.None\n            };\n\n            //RequestClose.Invoke(new DialogResult(result));\n            RequestClose.Invoke(result);\n        }\n\n        public virtual bool CanCloseDialog()\n        {\n            return true;\n        }\n\n        public virtual void OnDialogClosed()\n        {\n\n        }\n\n        public virtual void OnDialogOpened(IDialogParameters parameters)\n        {\n\n        }\n    }\n}\n"
  },
  {
    "path": "e2e/Wpf/HelloWorld/Dialogs/NotificationDialog.xaml",
    "content": "﻿<UserControl x:Class=\"HelloWorld.Dialogs.NotificationDialog\"\n             xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n             xmlns:prism=\"http://prismlibrary.com/\"\n             prism:ViewModelLocator.AutoWireViewModel=\"True\"\n             Width=\"300\" Height=\"150\">\n\n    <prism:Dialog.WindowStyle>\n        <Style TargetType=\"Window\">\n            <Setter Property=\"prism:Dialog.WindowStartupLocation\" Value=\"CenterScreen\" />\n            <Setter Property=\"ResizeMode\" Value=\"NoResize\"/>\n            <Setter Property=\"ShowInTaskbar\" Value=\"False\"/>\n            <Setter Property=\"SizeToContent\" Value=\"WidthAndHeight\"/>\n        </Style>\n    </prism:Dialog.WindowStyle>\n\n    <Grid x:Name=\"LayoutRoot\" Margin=\"5\">\n        <Grid.RowDefinitions>\n            <RowDefinition />\n            <RowDefinition Height=\"Auto\" />\n        </Grid.RowDefinitions>\n\n        <TextBlock Text=\"{Binding Message}\" HorizontalAlignment=\"Stretch\" VerticalAlignment=\"Stretch\" Grid.Row=\"0\" TextWrapping=\"Wrap\" />\n        <Button Command=\"{Binding CloseDialogCommand}\" CommandParameter=\"True\" Content=\"OK\" Width=\"75\" Height=\"25\" HorizontalAlignment=\"Right\" Margin=\"0,10,0,0\" Grid.Row=\"1\" IsDefault=\"True\" />\n    </Grid>\n</UserControl>\n"
  },
  {
    "path": "e2e/Wpf/HelloWorld/Dialogs/NotificationDialog.xaml.cs",
    "content": "﻿using System.Windows.Controls;\n\nnamespace HelloWorld.Dialogs\n{\n    /// <summary>\n    /// Interaction logic for NotificationDialog.xaml\n    /// </summary>\n    public partial class NotificationDialog : UserControl\n    {\n        public NotificationDialog()\n        {\n            InitializeComponent();\n        }\n    }\n}\n"
  },
  {
    "path": "e2e/Wpf/HelloWorld/Dialogs/NotificationDialogViewModel.cs",
    "content": "﻿using Prism.Dialogs;\n\nnamespace HelloWorld.Dialogs\n{\n    public class NotificationDialogViewModel : DialogViewModelBase\n    {\n        private string _message;\n        public string Message\n        {\n            get { return _message; }\n            set { SetProperty(ref _message, value); }\n        }\n\n        public NotificationDialogViewModel()\n        {\n            Title = \"Notification\";\n        }\n\n        public override void OnDialogOpened(IDialogParameters parameters)\n        {\n            Message = parameters.GetValue<string>(\"message\");\n        }\n    }\n}\n"
  },
  {
    "path": "e2e/Wpf/HelloWorld/HelloWorld.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk.WindowsDesktop\">\n\n  <PropertyGroup>\n    <OutputType>WinExe</OutputType>\n    <TargetFrameworks>net10.0-windows;net462</TargetFrameworks>\n    <UseWPF>true</UseWPF>\n    <RootNamespace>HelloWorld</RootNamespace>\n    <AssemblyName>HelloWorld</AssemblyName>\n    <ApplicationIcon>prism-sandbox.ico</ApplicationIcon>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <Page Remove=\"ModuleCatalog.xaml\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\..\\src\\Prism.Core\\Prism.Core.csproj\" />\n    <ProjectReference Include=\"..\\..\\..\\src\\Wpf\\Prism.DryIoc.Wpf\\Prism.DryIoc.Wpf.csproj\" />\n    <ProjectReference Include=\"..\\..\\..\\src\\Wpf\\Prism.Wpf\\Prism.Wpf.csproj\" />\n    <ProjectReference Include=\"..\\HelloWorld.Core\\HelloWorld.Core.csproj\" />\n    <ProjectReference Include=\"..\\Modules\\HelloWorld.Modules.ModuleA\\HelloWorld.Modules.ModuleA.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <Resource Include=\"ModuleCatalog.xaml\">\n      <Generator>MSBuild:Compile</Generator>\n    </Resource>\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "e2e/Wpf/HelloWorld/ModuleCatalog.xaml",
    "content": "﻿<m:ModuleCatalog xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n                 xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n                 xmlns:m=\"clr-namespace:Prism.Modularity;assembly=Prism.Wpf\">\n\n  <m:ModuleInfo Ref=\"file://Modules/HelloWorld.Modules.ModuleA.dll\" \n                ModuleName=\"ModuleAModule\" \n                ModuleType=\"HelloWorld.Modules.ModuleA.ModuleAModule, HelloWorld.Modules.ModuleA, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null\" />\n\n  <!--<m:ModuleInfoGroup Ref=\"Modules/HelloWorld.Modules.ModuleA.dll\">\n    <m:ModuleInfo  \n                ModuleName=\"ModuleAModule\" \n                ModuleType=\"HelloWorld.Modules.ModuleA.ModuleAModule, HelloWorld.Modules.ModuleA, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null\" />\n  </m:ModuleInfoGroup>-->\n  \n  \n</m:ModuleCatalog>"
  },
  {
    "path": "e2e/Wpf/HelloWorld/Properties/Resources.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.42000\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace HelloWorld.Properties\n{\n\n\n    /// <summary>\n    ///   A strongly-typed resource class, for looking up localized strings, etc.\n    /// </summary>\n    // This class was auto-generated by the StronglyTypedResourceBuilder\n    // class via a tool like ResGen or Visual Studio.\n    // To add or remove a member, edit your .ResX file then rerun ResGen\n    // with the /str option, or rebuild your VS project.\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"4.0.0.0\")]\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    internal class Resources\n    {\n\n        private static global::System.Resources.ResourceManager resourceMan;\n\n        private static global::System.Globalization.CultureInfo resourceCulture;\n\n        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        internal Resources()\n        {\n        }\n\n        /// <summary>\n        ///   Returns the cached ResourceManager instance used by this class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Resources.ResourceManager ResourceManager\n        {\n            get\n            {\n                if ((resourceMan == null))\n                {\n                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"HelloWorld.Properties.Resources\", typeof(Resources).Assembly);\n                    resourceMan = temp;\n                }\n                return resourceMan;\n            }\n        }\n\n        /// <summary>\n        ///   Overrides the current thread's CurrentUICulture property for all\n        ///   resource lookups using this strongly typed resource class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Globalization.CultureInfo Culture\n        {\n            get\n            {\n                return resourceCulture;\n            }\n            set\n            {\n                resourceCulture = value;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "e2e/Wpf/HelloWorld/Properties/Resources.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n</root>"
  },
  {
    "path": "e2e/Wpf/HelloWorld/Properties/Settings.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.42000\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace HelloWorld.Properties\n{\n\n\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator\", \"11.0.0.0\")]\n    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase\n    {\n\n        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));\n\n        public static Settings Default\n        {\n            get\n            {\n                return defaultInstance;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "e2e/Wpf/HelloWorld/Properties/Settings.settings",
    "content": "﻿<?xml version='1.0' encoding='utf-8'?>\n<SettingsFile xmlns=\"uri:settings\" CurrentProfile=\"(Default)\">\n  <Profiles>\n    <Profile Name=\"(Default)\" />\n  </Profiles>\n  <Settings />\n</SettingsFile>"
  },
  {
    "path": "e2e/Wpf/HelloWorld/SharedSampleRegistrations.cs",
    "content": "﻿using HelloWorld.Dialogs;\nusing Prism.Ioc;\n\nnamespace HelloWorld\n{\n    static class SharedSampleRegistrations\n    {\n        public static void RegisterSharedSamples(this IContainerRegistry containerRegistry)\n        {\n            containerRegistry.RegisterDialog<NotificationDialog, NotificationDialogViewModel>();\n            containerRegistry.RegisterDialog<ConfirmationDialog, ConfirmationDialogViewModel>();\n\n            //register a custom window host\n            containerRegistry.RegisterDialogWindow<CustomDialogWindow>();\n            containerRegistry.RegisterDialogWindow<AnotherDialogWindow>(nameof(AnotherDialogWindow));\n        }\n    }\n}\n"
  },
  {
    "path": "e2e/Wpf/HelloWorld/ViewModels/MainWindowViewModel.cs",
    "content": "﻿using System;\nusing HelloWorld.Core;\nusing Prism.Commands;\nusing Prism.Mvvm;\nusing Prism.Navigation.Regions;\nusing Prism.Dialogs;\n\nnamespace HelloWorld.ViewModels\n{\n    public class MainWindowViewModel : BindableBase\n    {\n        private string _title = \"Prism Application\";\n        private readonly IDialogService _dialogService;\n        private readonly IRegionManager _regionManager;\n\n        public string Title\n        {\n            get { return _title; }\n            set { SetProperty(ref _title, value); }\n        }\n\n        public DelegateCommand ShowDialogCommand { get; private set; }\n\n        private DelegateCommand<string> _navigate;\n        public DelegateCommand<string> NavigateCommand =>\n            _navigate ?? (_navigate = new DelegateCommand<string>(ExecuteNavigateCommand));\n\n        void ExecuteNavigateCommand(string parameter)\n        {\n            if (!string.IsNullOrWhiteSpace(parameter))\n                _regionManager.RequestNavigate(\"ContentRegion\", parameter);\n        }\n\n        public MainWindowViewModel(IDialogService dialogService, IRegionManager regionManager)\n        {\n            _dialogService = dialogService;\n            _regionManager = regionManager;\n            ShowDialogCommand = new DelegateCommand(ShowDialog);\n        }\n\n        private void ShowDialog()\n        {\n            var message = \"This is a message that should be shown in the dialog.\";\n\n            //using the dialog service as-is\n            //_dialogService.Show(\"NotificationDialog\", new DialogParameters($\"message={message}\"), r =>\n            //{\n            //    if (r.Result == ButtonResult.None)\n            //        Title = \"Result is None\";\n            //    else if (r.Result == ButtonResult.OK)\n            //        Title = \"Result is OK\";\n            //    else if (r.Result == ButtonResult.Cancel)\n            //        Title = \"Result is Cancel\";\n            //    else\n            //        Title = \"I Don't know what you did!?\";\n            //});\n\n            //using custom extenions methods to simplify the app's dialogs\n            //_dialogService.ShowNotification(message, r =>\n            //{\n            //    if (r.Result == ButtonResult.None)\n            //        Title = \"Result is None\";\n            //    else if (r.Result == ButtonResult.OK)\n            //        Title = \"Result is OK\";\n            //    else if (r.Result == ButtonResult.Cancel)\n            //        Title = \"Result is Cancel\";\n            //    else\n            //        Title = \"I Don't know what you did!?\";\n            //});\n\n            //_dialogService.ShowConfirmation(message, r =>\n            //{\n            //    if (r.Result == ButtonResult.None)\n            //        Title = \"Result is None\";\n            //    else if (r.Result == ButtonResult.OK)\n            //        Title = \"Result is OK\";\n            //    else if (r.Result == ButtonResult.Cancel)\n            //        Title = \"Result is Cancel\";\n            //    else\n            //        Title = \"I Don't know what you did!?\";\n            //});\n\n            _dialogService.ShowNotificationInAnotherWindow(message, r =>\n            {\n                if (r.Result == ButtonResult.None)\n                    Title = \"Result is None\";\n                else if (r.Result == ButtonResult.OK)\n                    Title = \"Result is OK\";\n                else if (r.Result == ButtonResult.Cancel)\n                    Title = \"Result is Cancel\";\n                else\n                    Title = \"I Don't know what you did!?\";\n            });\n        }\n    }\n\n\n}\n"
  },
  {
    "path": "e2e/Wpf/HelloWorld/Views/MainWindow.xaml",
    "content": "﻿<Window x:Class=\"HelloWorld.Views.MainWindow\"\n        xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n        xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n        xmlns:prism=\"http://prismlibrary.com/\"\n        prism:ViewModelLocator.AutoWireViewModel=\"True\"\n        xmlns:local=\"clr-namespace:HelloWorld\"\n        Title=\"{Binding Title}\" Height=\"350\" Width=\"525\">\n\n    <Grid>\n        <Grid.RowDefinitions>\n            <RowDefinition Height=\"auto\" />\n            <RowDefinition />\n        </Grid.RowDefinitions>\n        <!--<Button Command=\"{Binding ShowDialogCommand}\" Content=\"Show Dialog\" />-->\n\n    <Button Command=\"{Binding NavigateCommand}\" CommandParameter=\"ViewA\">Navigate to ViewA</Button>\n    <ContentControl Grid.Row=\"1\" prism:RegionManager.RegionName=\"ContentRegion\" />\n\n        <!--<TabControl Grid.Row=\"1\" prism:RegionManager.RegionName=\"ContentRegion\" />-->\n        \n    </Grid>\n</Window>\n"
  },
  {
    "path": "e2e/Wpf/HelloWorld/Views/MainWindow.xaml.cs",
    "content": "﻿using System.Windows;\n\nnamespace HelloWorld.Views\n{\n    /// <summary>\n    /// Interaction logic for MainWindow.xaml\n    /// </summary>\n    public partial class MainWindow : Window\n    {\n        public MainWindow()\n        {\n            InitializeComponent();\n        }\n    }\n}\n"
  },
  {
    "path": "e2e/Wpf/HelloWorld.Bootstraper/App.xaml",
    "content": "﻿<Application x:Class=\"HelloWorld.App\"\n             xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\">\n    <Application.Resources>\n         \n    </Application.Resources>\n</Application>\n"
  },
  {
    "path": "e2e/Wpf/HelloWorld.Bootstraper/App.xaml.cs",
    "content": "﻿using System.Windows;\n\nnamespace HelloWorld\n{\n    /// <summary>\n    /// Interaction logic for App.xaml\n    /// </summary>\n    public partial class App : Application\n    {\n        protected override void OnStartup(StartupEventArgs e)\n        {\n            base.OnStartup(e);\n\n            var bs = new Bootstrapper();\n            bs.Run();\n        }\n    }\n}\n"
  },
  {
    "path": "e2e/Wpf/HelloWorld.Bootstraper/Bootstrapper.cs",
    "content": "﻿using HelloWorld.Modules.ModuleA;\nusing HelloWorld.Views;\nusing Prism.Ioc;\nusing Prism.Modularity;\nusing Prism.Unity;\nusing System.Windows;\nusing Unity;\n\nnamespace HelloWorld\n{\n    class Bootstrapper : PrismBootstrapper\n    {\n        protected override DependencyObject CreateShell()\n        {\n            return Container.Resolve<MainWindow>();\n        }\n\n        protected override void RegisterTypes(IContainerRegistry containerRegistry)\n        {\n            containerRegistry.RegisterSharedSamples();\n        }\n\n        protected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog)\n        {\n            base.ConfigureModuleCatalog(moduleCatalog);\n            moduleCatalog.AddModule<ModuleAModule>();\n        }\n    }\n}"
  },
  {
    "path": "e2e/Wpf/HelloWorld.Bootstraper/HelloWorld.Bootstrapper.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk.WindowsDesktop\">\n\n  <PropertyGroup>\n    <OutputType>WinExe</OutputType>\n    <TargetFrameworks>net10.0-windows;net462</TargetFrameworks>\n    <UseWPF>true</UseWPF>\n    <RootNamespace>HelloWorld</RootNamespace>\n    <ApplicationIcon>..\\HelloWorld\\prism-sandbox.ico</ApplicationIcon>\n  </PropertyGroup>\n\n  <PropertyGroup>\n    <DefaultItemExcludes>..\\HelloWorld\\bin\\**;..\\HelloWorld\\obj\\**;..\\HelloWorld\\App.*</DefaultItemExcludes>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <Page Include=\"..\\HelloWorld\\**\\*.xaml\" LinkBase=\"%(RecurseDir)\" Generator=\"MSBuild:Compile\" Exclude=\"$(DefaultItemExcludes)\" />\n    <Compile Include=\"..\\HelloWorld\\**\\*.cs\" LinkBase=\"%(RecurseDir)\" Exclude=\"$(DefaultItemExcludes)\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <Page Remove=\"..\\HelloWorld\\ModuleCatalog.xaml\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\..\\src\\Prism.Core\\Prism.Core.csproj\" />\n    <ProjectReference Include=\"..\\..\\..\\src\\Wpf\\Prism.Unity.Wpf\\Prism.Unity.Wpf.csproj\" />\n    <ProjectReference Include=\"..\\..\\..\\src\\Wpf\\Prism.Wpf\\Prism.Wpf.csproj\" />\n    <ProjectReference Include=\"..\\HelloWorld.Core\\HelloWorld.Core.csproj\" />\n    <ProjectReference Include=\"..\\Modules\\HelloWorld.Modules.ModuleA\\HelloWorld.Modules.ModuleA.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <Resource Include=\"..\\HelloWorld\\ModuleCatalog.xaml\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "e2e/Wpf/HelloWorld.Core/DialogServiceExtensions.cs",
    "content": "using Prism.Dialogs;\nusing System;\n\nnamespace HelloWorld.Core\n{\n    public static class DialogServiceExtensions\n    {\n        public static void ShowNotification(this IDialogService dialogService, string message, Action<IDialogResult> callBack)\n        {\n            dialogService.Show(\"NotificationDialog\", new DialogParameters($\"message={message}\"), callBack);\n        }\n\n        public static void ShowNotificationInAnotherWindow(this IDialogService dialogService, string message, Action<IDialogResult> callBack)\n        {\n            dialogService.Show(\"NotificationDialog\", new DialogParameters($\"message={message}\"), callBack, \"AnotherDialogWindow\");\n        }\n\n        public static void ShowConfirmation(this IDialogService dialogService, string message, Action<IDialogResult> callBack)\n        {\n            dialogService.ShowDialog(\"ConfirmationDialog\", new DialogParameters($\"message={message}\"), callBack);\n        }\n\n        public static void ShowConfirmationInAnotherWindow(this IDialogService dialogService, string message, Action<IDialogResult> callBack)\n        {\n            dialogService.ShowDialog(\"ConfirmationDialog\", new DialogParameters($\"message={message}\"), callBack, \"AnotherDialogWindow\");\n        }\n    }\n}\n"
  },
  {
    "path": "e2e/Wpf/HelloWorld.Core/HelloWorld.Core.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk.WindowsDesktop\">\n\n  <PropertyGroup>\n    <TargetFrameworks>net10.0-windows;net462</TargetFrameworks>\n    <UseWPF>true</UseWPF>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\..\\src\\Prism.Core\\Prism.Core.csproj\" />\n    <ProjectReference Include=\"..\\..\\..\\src\\Wpf\\Prism.Wpf\\Prism.Wpf.csproj\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "e2e/Wpf/HelloWorld.sln",
    "content": "﻿\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio Version 17\nVisualStudioVersion = 17.12.35707.178 d17.12\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"HelloWorld\", \"HelloWorld\\HelloWorld.csproj\", \"{B03C14CC-8DE9-40EE-9562-12B976E4CEE8}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Prism.Core\", \"..\\..\\src\\Prism.Core\\Prism.Core.csproj\", \"{457AA668-72BB-4701-9A4E-FA86B0C412DE}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"Prism Library\", \"Prism Library\", \"{15CF1FE1-D78E-4E3D-A9F8-FA0FCC56A83A}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Prism.Wpf\", \"..\\..\\src\\Wpf\\Prism.Wpf\\Prism.Wpf.csproj\", \"{AA8ED3D6-A708-4187-8FAC-00F56E063AD7}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Prism.DryIoc.Wpf\", \"..\\..\\src\\Wpf\\Prism.DryIoc.Wpf\\Prism.DryIoc.Wpf.csproj\", \"{A0842858-BFD5-41AE-BDE7-CBD870BC9900}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Prism.Unity.Wpf\", \"..\\..\\src\\Wpf\\Prism.Unity.Wpf\\Prism.Unity.Wpf.csproj\", \"{DEBADAAB-5C78-444E-AA77-336A43B49EC3}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"HelloWorld.Bootstrapper\", \"HelloWorld.Bootstraper\\HelloWorld.Bootstrapper.csproj\", \"{36C11381-D25A-4E40-956F-05E9C440FA86}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"HelloWorld.Modules.ModuleA\", \"Modules\\HelloWorld.Modules.ModuleA\\HelloWorld.Modules.ModuleA.csproj\", \"{D16AADD5-6EAA-446A-83F5-9DFC36DD4108}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"HelloWorld.Core\", \"HelloWorld.Core\\HelloWorld.Core.csproj\", \"{F9541A8C-42DD-4340-AB57-54C7AAAC1BCC}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"Modules\", \"Modules\", \"{63541838-3D6A-4F2E-92EF-AC4953BB9B9B}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Prism.Events\", \"..\\..\\src\\Prism.Events\\Prism.Events.csproj\", \"{E35BF062-652E-4520-8DD8-55DC80012D57}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Any CPU = Debug|Any CPU\n\t\tRelease|Any CPU = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{B03C14CC-8DE9-40EE-9562-12B976E4CEE8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{B03C14CC-8DE9-40EE-9562-12B976E4CEE8}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{B03C14CC-8DE9-40EE-9562-12B976E4CEE8}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{B03C14CC-8DE9-40EE-9562-12B976E4CEE8}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{457AA668-72BB-4701-9A4E-FA86B0C412DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{457AA668-72BB-4701-9A4E-FA86B0C412DE}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{457AA668-72BB-4701-9A4E-FA86B0C412DE}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{457AA668-72BB-4701-9A4E-FA86B0C412DE}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{AA8ED3D6-A708-4187-8FAC-00F56E063AD7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{AA8ED3D6-A708-4187-8FAC-00F56E063AD7}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{AA8ED3D6-A708-4187-8FAC-00F56E063AD7}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{AA8ED3D6-A708-4187-8FAC-00F56E063AD7}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{A0842858-BFD5-41AE-BDE7-CBD870BC9900}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{A0842858-BFD5-41AE-BDE7-CBD870BC9900}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{A0842858-BFD5-41AE-BDE7-CBD870BC9900}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{A0842858-BFD5-41AE-BDE7-CBD870BC9900}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{DEBADAAB-5C78-444E-AA77-336A43B49EC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{DEBADAAB-5C78-444E-AA77-336A43B49EC3}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{DEBADAAB-5C78-444E-AA77-336A43B49EC3}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{DEBADAAB-5C78-444E-AA77-336A43B49EC3}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{36C11381-D25A-4E40-956F-05E9C440FA86}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{36C11381-D25A-4E40-956F-05E9C440FA86}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{36C11381-D25A-4E40-956F-05E9C440FA86}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{36C11381-D25A-4E40-956F-05E9C440FA86}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{D16AADD5-6EAA-446A-83F5-9DFC36DD4108}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{D16AADD5-6EAA-446A-83F5-9DFC36DD4108}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{D16AADD5-6EAA-446A-83F5-9DFC36DD4108}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{D16AADD5-6EAA-446A-83F5-9DFC36DD4108}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{F9541A8C-42DD-4340-AB57-54C7AAAC1BCC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{F9541A8C-42DD-4340-AB57-54C7AAAC1BCC}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{F9541A8C-42DD-4340-AB57-54C7AAAC1BCC}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{F9541A8C-42DD-4340-AB57-54C7AAAC1BCC}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{E35BF062-652E-4520-8DD8-55DC80012D57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{E35BF062-652E-4520-8DD8-55DC80012D57}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{E35BF062-652E-4520-8DD8-55DC80012D57}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{E35BF062-652E-4520-8DD8-55DC80012D57}.Release|Any CPU.Build.0 = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\n\tGlobalSection(NestedProjects) = preSolution\n\t\t{457AA668-72BB-4701-9A4E-FA86B0C412DE} = {15CF1FE1-D78E-4E3D-A9F8-FA0FCC56A83A}\n\t\t{AA8ED3D6-A708-4187-8FAC-00F56E063AD7} = {15CF1FE1-D78E-4E3D-A9F8-FA0FCC56A83A}\n\t\t{A0842858-BFD5-41AE-BDE7-CBD870BC9900} = {15CF1FE1-D78E-4E3D-A9F8-FA0FCC56A83A}\n\t\t{DEBADAAB-5C78-444E-AA77-336A43B49EC3} = {15CF1FE1-D78E-4E3D-A9F8-FA0FCC56A83A}\n\t\t{D16AADD5-6EAA-446A-83F5-9DFC36DD4108} = {63541838-3D6A-4F2E-92EF-AC4953BB9B9B}\n\t\t{E35BF062-652E-4520-8DD8-55DC80012D57} = {15CF1FE1-D78E-4E3D-A9F8-FA0FCC56A83A}\n\tEndGlobalSection\n\tGlobalSection(ExtensibilityGlobals) = postSolution\n\t\tSolutionGuid = {D877B086-37FD-4AA5-8AB3-CF7E87E27425}\n\tEndGlobalSection\n\tGlobalSection(SharedMSBuildProjectFiles) = preSolution\n\t\t..\\..\\src\\Containers\\Prism.DryIoc.Shared\\Prism.DryIoc.Shared.projitems*{a0842858-bfd5-41ae-bde7-cbd870bc9900}*SharedItemsImports = 5\n\t\t..\\..\\src\\Containers\\Prism.Unity.Shared\\Prism.Unity.Shared.projitems*{debadaab-5c78-444e-aa77-336a43b49ec3}*SharedItemsImports = 5\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "e2e/Wpf/Modules/HelloWorld.Modules.ModuleA/HelloWorld.Modules.ModuleA.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk.WindowsDesktop\">\n\n  <PropertyGroup>\n    <TargetFrameworks>net10.0-windows;net462</TargetFrameworks>\n    <UseWPF>true</UseWPF>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\..\\..\\src\\Prism.Core\\Prism.Core.csproj\" />\n    <ProjectReference Include=\"..\\..\\..\\..\\src\\Wpf\\Prism.Wpf\\Prism.Wpf.csproj\" />\n    <ProjectReference Include=\"..\\..\\HelloWorld.Core\\HelloWorld.Core.csproj\" />\n  </ItemGroup>\n  <!--<Target Name=\"PostBuild\" AfterTargets=\"PostBuildEvent\">\n    <Exec Command=\"xcopy &quot;$(TargetDir)*&quot; &quot;$(SolutionDir)$(SolutionName)\\$(OutDir)Modules\\&quot; /y\" />\n  </Target>-->\n</Project>\n"
  },
  {
    "path": "e2e/Wpf/Modules/HelloWorld.Modules.ModuleA/ModuleAModule.cs",
    "content": "﻿using HelloWorld.Modules.ModuleA.Views;\nusing Prism.Ioc;\nusing Prism.Modularity;\n\nnamespace HelloWorld.Modules.ModuleA\n{\n    public class ModuleAModule : IModule\n    {\n        public void OnInitialized(IContainerProvider containerProvider)\n        {\n            \n        }\n\n        public void RegisterTypes(IContainerRegistry containerRegistry)\n        {\n            containerRegistry.RegisterForNavigation<ViewA>();\n        }\n    }\n}\n"
  },
  {
    "path": "e2e/Wpf/Modules/HelloWorld.Modules.ModuleA/ViewModels/ViewAViewModel.cs",
    "content": "﻿using Prism.Commands;\nusing Prism.Mvvm;\nusing Prism.Dialogs;\nusing HelloWorld.Core;\n\nnamespace HelloWorld.Modules.ModuleA.ViewModels\n{\n    public class ViewAViewModel : BindableBase\n    {\n        private string _message;\n        public string Message\n        {\n            get { return _message; }\n            set { SetProperty(ref _message, value); }\n        }\n\n        private DelegateCommand _showDialogCommand;\n        private readonly IDialogService _dialogService;\n\n        public DelegateCommand ShowDialogCommand =>\n            _showDialogCommand ?? (_showDialogCommand = new DelegateCommand(ExecuteShowDialogCommand));\n\n        void ExecuteShowDialogCommand()\n        {\n            _dialogService.ShowNotification(\"Hello There!\", r =>\n            {\n                if (r.Result == ButtonResult.OK)\n                    Message = \"OK was clicked\";\n                else\n                    Message = \"Something else was clicked\";\n            });\n        }\n\n        public ViewAViewModel(IDialogService dialogService)\n        {\n            Message = \"Hello from ViewA in Module A\";\n            _dialogService = dialogService;\n        }\n    }\n}\n"
  },
  {
    "path": "e2e/Wpf/Modules/HelloWorld.Modules.ModuleA/Views/ViewA.xaml",
    "content": "﻿<UserControl x:Class=\"HelloWorld.Modules.ModuleA.Views.ViewA\"\n             xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n             xmlns:prism=\"http://prismlibrary.com/\"             \n             prism:ViewModelLocator.AutoWireViewModel=\"True\">\n  <Grid>\n    <Grid.RowDefinitions>\n      <RowDefinition Height=\"*\" />\n      <RowDefinition Height=\"Auto\" />\n    </Grid.RowDefinitions>\n    <TextBlock Text=\"{Binding Message}\" FontSize=\"28\" HorizontalAlignment=\"Center\" VerticalAlignment=\"Center\" />\n    <Button Grid.Row=\"1\" Content=\"Show Dialog\" Command=\"{Binding ShowDialogCommand}\" />\n  </Grid>\n</UserControl>\n"
  },
  {
    "path": "e2e/Wpf/Modules/HelloWorld.Modules.ModuleA/Views/ViewA.xaml.cs",
    "content": "﻿using System.Windows.Controls;\n\nnamespace HelloWorld.Modules.ModuleA.Views\n{\n    /// <summary>\n    /// Interaction logic for ViewA\n    /// </summary>\n    public partial class ViewA : UserControl\n    {\n        public ViewA()\n        {\n            InitializeComponent();\n        }\n    }\n}\n"
  },
  {
    "path": "global.json",
    "content": "{\n  \"msbuild-sdks\": {\n    \"Microsoft.Build.NoTargets\": \"3.7.56\",\n    \"MSBuild.Sdk.Extras\": \"3.0.44\",\n    \"Uno.Sdk\": \"6.4.20\"\n  }\n}\n"
  },
  {
    "path": "src/Avalonia/Prism.Avalonia/Common/ObservableObject.cs",
    "content": "using System.ComponentModel;\nusing Prism.Extensions;\nusing Avalonia;\nusing Avalonia.Controls;\n\nnamespace Prism.Common\n{\n    /// <summary>\n    /// Class that wraps an object, so that other classes can notify for Change events. Typically, this class is set as \n    /// a Dependency Property on AvaloniaObjects, and allows other classes to observe any changes in the Value. \n    /// </summary>\n    /// <remarks>\n    /// This class is required, because in Silverlight, it's not possible to receive Change notifications for Dependency properties that you do not own. \n    /// </remarks>\n    /// <typeparam name=\"T\">The type of the property that's wrapped in the Observable object</typeparam>\n    public class ObservableObject<T> : Control, INotifyPropertyChanged\n    {\n        /// <summary>\n        /// Identifies the Value property of the ObservableObject\n        /// </summary>\n        [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Design\", \"CA1000:DoNotDeclareStaticMembersOnGenericTypes\", Justification = \"This is the pattern for dependency properties\")]\n        public static readonly StyledProperty<T> ValueProperty =\n            AvaloniaProperty.Register<Control, T>(name: nameof(Value));\n\n        /// <summary>\n        /// Event that gets invoked when the Value property changes. \n        /// </summary>\n        public event PropertyChangedEventHandler PropertyChanged;\n\n        /// <summary>\n        /// The value that's wrapped inside the ObservableObject.\n        /// </summary>\n        [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Naming\", \"CA1721:PropertyNamesShouldNotMatchGetMethods\")]\n        public T Value\n        {\n            get => (T)GetValue(ValueProperty);\n            set => SetValue(ValueProperty, value);\n        }\n\n        private static void ValueChangedCallback(AvaloniaObject d, AvaloniaPropertyChangedEventArgs e)\n        {\n            ObservableObject<T> thisInstance = ((ObservableObject<T>)d);\n            thisInstance.PropertyChanged?.Invoke(thisInstance, new PropertyChangedEventArgs(nameof(Value)));\n        }\n\n        static ObservableObject()\n        {\n            ValueProperty.Changed.Subscribe(args => ValueChangedCallback(args?.Sender, args));\n        }\n    }\n}\n"
  },
  {
    "path": "src/Avalonia/Prism.Avalonia/Common/Stubs.cs",
    "content": "using System;\n\nnamespace Prism.Common\n{\n    internal static class Stubs\n    {\n        public static readonly Action Nop = () => { };\n        public static readonly Action<Exception> Throw = ex => { throw ex; };\n    }\n}\n"
  },
  {
    "path": "src/Avalonia/Prism.Avalonia/Dialogs/Dialog.cs",
    "content": "using Avalonia;\nusing Avalonia.Controls;\nusing Avalonia.Styling;\nusing Prism.Extensions;\n\nnamespace Prism.Dialogs\n{\n    /// <summary>This class contains <see cref=\"IDialogWindow\"/> attached properties.</summary>\n    public class Dialog\n    {\n        /// <summary>Identifies the WindowStyle attached property.</summary>\n        /// <remarks>This attached property is used to specify the style of a <see cref=\"IDialogWindow\"/>.</remarks>\n        public static readonly AvaloniaProperty WindowStyleProperty =\n            AvaloniaProperty.RegisterAttached<AvaloniaObject, Style>(\"WindowStyle\", typeof(Dialog));\n\n        /// <summary>Identifies the WindowStartupLocation attached property.</summary>\n        /// <remarks>This attached property is used to specify the startup location of a <see cref=\"IDialogWindow\"/>.</remarks>\n        public static readonly AvaloniaProperty WindowStartupLocationProperty =\n            AvaloniaProperty.RegisterAttached<AvaloniaObject, WindowStartupLocation>(\n                name: \"WindowStartupLocation\",\n                ownerType: typeof(Dialog));\n\n        /// <summary>Creates an instance of the Dialog class.</summary>\n        public Dialog()\n        {\n            WindowStartupLocationProperty.Changed.Subscribe(args => OnWindowStartupLocationChanged(args?.Sender, args));\n        }\n\n        /// <summary>\n        /// Gets the value for the <see cref=\"WindowStyleProperty\"/> attached property.\n        /// </summary>\n        /// <param name=\"obj\">The target element.</param>\n        /// <returns>The <see cref=\"WindowStyleProperty\"/> attached to the <paramref name=\"obj\"/> element.</returns>\n        public static Style GetWindowStyle(AvaloniaObject obj)\n        {\n            return (Style)obj.GetValue(WindowStyleProperty);\n        }\n\n        /// <summary>\n        /// Sets the <see cref=\"WindowStyleProperty\"/> attached property.\n        /// </summary>\n        /// <param name=\"obj\">The target element.</param>\n        /// <param name=\"value\">The Style to attach.</param>\n        public static void SetWindowStyle(AvaloniaObject obj, Style value)\n        {\n            obj.SetValue(WindowStyleProperty, value);\n        }\n\n        /// <summary>\n        /// Gets the value for the <see cref=\"WindowStartupLocationProperty\"/> attached property.\n        /// </summary>\n        /// <param name=\"obj\">The target element.</param>\n        /// <returns>The <see cref=\"WindowStartupLocationProperty\"/> attached to the <paramref name=\"obj\"/> element.</returns>\n        public static WindowStartupLocation GetWindowStartupLocation(AvaloniaObject obj)\n        {\n            return (WindowStartupLocation)obj.GetValue(WindowStartupLocationProperty);\n        }\n\n        /// <summary>\n        /// Sets the <see cref=\"WindowStartupLocationProperty\"/> attached property.\n        /// </summary>\n        /// <param name=\"obj\">The target element.</param>\n        /// <param name=\"value\">The WindowStartupLocation to attach.</param>\n        public static void SetWindowStartupLocation(AvaloniaObject obj, WindowStartupLocation value)\n        {\n            obj.SetValue(WindowStartupLocationProperty, value);\n        }\n\n        private static void OnWindowStartupLocationChanged(AvaloniaObject sender, AvaloniaPropertyChangedEventArgs e)\n        {\n            if (sender is Window window)\n                window.WindowStartupLocation = (WindowStartupLocation)e.NewValue;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Avalonia/Prism.Avalonia/Dialogs/DialogService.cs",
    "content": "using System;\nusing Avalonia;\nusing Avalonia.Controls;\nusing Avalonia.Controls.ApplicationLifetimes;\nusing Prism.Common;\nusing Prism.Ioc;\n\nnamespace Prism.Dialogs\n{\n    /// <summary>Implements <see cref=\"IDialogService\"/> to show modal and non-modal dialogs.</summary>\n    /// <remarks>The dialog's ViewModel must implement IDialogAware.</remarks>\n    public class DialogService : IDialogService\n    {\n        private readonly IContainerExtension _containerExtension;\n\n        /// <summary>Initializes a new instance of the <see cref=\"DialogService\"/> class.</summary>\n        /// <param name=\"containerExtension\">The <see cref=\"IContainerExtension\" /></param>\n        public DialogService(IContainerExtension containerExtension)\n        {\n            _containerExtension = containerExtension;\n        }\n\n        /// <summary>Show dialog.</summary>\n        /// <param name=\"name\">Name of the dialog window to show.</param>\n        /// <param name=\"parameters\"><see cref=\"IDialogParameters\"/>.</param>\n        /// <param name=\"callback\">The action to perform when the dialog is closed.</param>\n        public void ShowDialog(string name, IDialogParameters parameters, DialogCallback callback)\n        {\n            parameters ??= new DialogParameters();\n            var isModal = parameters.TryGetValue<bool>(KnownDialogParameters.ShowNonModal, out var show) ? !show : true;\n            var windowName = parameters.TryGetValue<string>(KnownDialogParameters.WindowName, out var wName) ? wName : null;\n            var owner = parameters.TryGetValue<Window>(KnownDialogParameters.ParentWindow, out var hWnd) ? hWnd : null;\n\n            IDialogWindow dialogWindow = CreateDialogWindow(windowName);\n            ConfigureDialogWindowEvents(dialogWindow, callback);\n            ConfigureDialogWindowContent(name, dialogWindow, parameters);\n\n            ShowDialogWindow(dialogWindow, isModal, owner);\n        }\n\n        /// <summary>Shows the dialog window.</summary>\n        /// <param name=\"dialogWindow\">The dialog window to show.</param>\n        /// <param name=\"isModal\">If true; dialog is shown as a modal</param>\n        /// <param name=\"owner\">Optional host window of the dialog. Use-case, Dialog calling a dialog.</param>\n        protected virtual void ShowDialogWindow(IDialogWindow dialogWindow, bool isModal, Window owner = null)\n        {\n            if (isModal &&\n                Application.Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime deskLifetime)\n            {\n                // Ref:\n                //  - https://docs.avaloniaui.net/docs/reference/controls/window#show-a-window-as-a-dialog\n                //  - https://github.com/AvaloniaUI/Avalonia/discussions/7924\n                // (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktopLifetime)\n\n                if (owner != null)\n                    dialogWindow.ShowDialog(owner);\n                else\n                    dialogWindow.ShowDialog(deskLifetime.MainWindow);\n            }\n            else\n            {\n                dialogWindow.Show();\n            }\n        }\n\n        /// <summary>\n        /// Create a new <see cref=\"IDialogWindow\"/>.\n        /// </summary>\n        /// <param name=\"name\">The name of the hosting window registered with the IContainerRegistry.</param>\n        /// <returns>The created <see cref=\"IDialogWindow\"/>.</returns>\n        protected virtual IDialogWindow CreateDialogWindow(string name)\n        {\n            if (string.IsNullOrWhiteSpace(name))\n                return _containerExtension.Resolve<IDialogWindow>();\n            else\n                return _containerExtension.Resolve<IDialogWindow>(name);\n        }\n\n        /// <summary>\n        /// Configure <see cref=\"IDialogWindow\"/> content.\n        /// </summary>\n        /// <param name=\"dialogName\">The name of the dialog to show.</param>\n        /// <param name=\"window\">The hosting window.</param>\n        /// <param name=\"parameters\">The parameters to pass to the dialog.</param>\n        protected virtual void ConfigureDialogWindowContent(string dialogName, IDialogWindow window, IDialogParameters parameters)\n        {\n            var content = _containerExtension.Resolve<object>(dialogName);\n            if (!(content is Avalonia.Controls.Control dialogContent))\n                throw new NullReferenceException(\"A dialog's content must be an Avalonia.Controls.Control\");\n\n            MvvmHelpers.AutowireViewModel(dialogContent);\n\n            if (!(dialogContent.DataContext is IDialogAware viewModel))\n                throw new NullReferenceException(\"A dialog's ViewModel must implement the IDialogAware interface\");\n\n            ConfigureDialogWindowProperties(window, dialogContent, viewModel);\n\n            MvvmHelpers.ViewAndViewModelAction<IDialogAware>(viewModel, d => d.OnDialogOpened(parameters));\n        }\n\n        /// <summary>\n        /// Configure <see cref=\"IDialogWindow\"/> and <see cref=\"IDialogAware\"/> events.\n        /// </summary>\n        /// <param name=\"dialogWindow\">The hosting window.</param>\n        /// <param name=\"callback\">The action to perform when the dialog is closed.</param>\n        protected virtual void ConfigureDialogWindowEvents(IDialogWindow dialogWindow, DialogCallback callback)\n        {\n            Action<IDialogResult> requestCloseHandler = (result) =>\n            {\n                dialogWindow.Result = result;\n                dialogWindow.Close();\n            };\n\n            EventHandler loadedHandler = null;\n\n            loadedHandler = (o, e) =>\n            {\n                // WPF: dialogWindow.Loaded -= loadedHandler;\n                dialogWindow.Opened -= loadedHandler;\n                DialogUtilities.InitializeListener(dialogWindow.GetDialogViewModel(), requestCloseHandler);\n            };\n\n            dialogWindow.Opened += loadedHandler;\n\n            EventHandler<WindowClosingEventArgs> closingHandler = null;\n            closingHandler = (o, e) =>\n            {\n                if (!dialogWindow.GetDialogViewModel().CanCloseDialog())\n                    e.Cancel = true;\n            };\n\n            dialogWindow.Closing += closingHandler;\n\n            EventHandler closedHandler = null;\n            closedHandler = async (o, e) =>\n            {\n                dialogWindow.Closed -= closedHandler;\n                dialogWindow.Closing -= closingHandler;\n\n                dialogWindow.GetDialogViewModel().OnDialogClosed();\n\n                if (dialogWindow.Result == null)\n                    dialogWindow.Result = new DialogResult();\n\n                await callback.Invoke(dialogWindow.Result); \n\n                dialogWindow.DataContext = null;\n                dialogWindow.Content = null;\n            };\n\n            dialogWindow.Closed += closedHandler;\n        }\n\n        /// <summary>\n        /// Configure <see cref=\"IDialogWindow\"/> properties.\n        /// </summary>\n        /// <param name=\"window\">The hosting window.</param>\n        /// <param name=\"dialogContent\">The dialog to show.</param>\n        /// <param name=\"viewModel\">The dialog's ViewModel.</param>\n        protected virtual void ConfigureDialogWindowProperties(IDialogWindow window, Avalonia.Controls.Control dialogContent, IDialogAware viewModel)\n        {\n            // Avalonia returns 'null' for Dialog.GetWindowStyle(dialogContent);\n            // WPF: Window > ContentControl > FrameworkElement\n            // Ava: Window > WindowBase > TopLevel > Control > InputElement > Interactive > Layoutable > Visual > StyledElement.Styles (collection)\n\n            // WPF:\n            //// var windowStyle = Dialog.GetWindowStyle(dialogContent);\n            //// if (windowStyle != null)\n            ////     window.Style = windowStyle;\n\n            // Make the host window and the dialog window to share the same context\n            window.Content = dialogContent;\n            window.DataContext = viewModel;\n\n            // WPF:\n            //// if (window.Owner == null)\n            ////     window.Owner = Application.Current?.Windows.OfType<Window>().FirstOrDefault(x => x.IsActive);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Avalonia/Prism.Avalonia/Dialogs/DialogWindow.axaml",
    "content": "<Window xmlns=\"https://github.com/avaloniaui\"\n        xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n        xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n        xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n        x:Class=\"Prism.Dialogs.DialogWindow\"\n        Title=\"{Binding Title}\"\n        WindowStartupLocation=\"CenterOwner\">\n  <Window.Styles>\n    <Style Selector=\"Window\">\n      <Setter Property=\"SizeToContent\" Value=\"WidthAndHeight\" />\n    </Style>\n  </Window.Styles>\n</Window>\n"
  },
  {
    "path": "src/Avalonia/Prism.Avalonia/Dialogs/DialogWindow.axaml.cs",
    "content": "using System;\nusing System.ComponentModel;\nusing Avalonia.Controls;\nusing Avalonia.Markup.Xaml;\n\nnamespace Prism.Dialogs\n{\n    /// <summary>Prism's default dialog host.</summary>\n    public partial class DialogWindow : Window, IDialogWindow\n    {\n        /// <summary>The <see cref=\"IDialogResult\"/> of the dialog.</summary>\n        public IDialogResult Result { get; set; }\n\n        /// <summary>Initializes a new instance of the <see cref=\"DialogWindow\"/> class.</summary>\n        public DialogWindow()\n        {\n            InitializeComponent();\n\n#if DEBUG\n            //// this.AttachDevTools();\n#endif\n        }\n\n        private void InitializeComponent()\n        {\n            AvaloniaXamlLoader.Load(this);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Avalonia/Prism.Avalonia/Dialogs/IDialogServiceCompatExtensions.cs",
    "content": "using System;\nusing Avalonia.Controls;\n\nnamespace Prism.Dialogs\n{\n    /// <summary>Extensions for the IDialogService</summary>\n    public static class IDialogServiceCompatExtensions\n    {\n        /// <summary>Shows a non-modal dialog.</summary>\n        /// <param name=\"dialogService\">The DialogService</param>\n        /// <param name=\"name\">The name of the dialog to show.</param>\n        /// <param name=\"parameters\">Parameters that the dialog can use for custom functionality.</param>\n        /// <param name=\"callback\">The action to be invoked upon successful or failed completion of displaying the dialog.</param>\n        public static void Show(this IDialogService dialogService, string name, IDialogParameters parameters, Action<IDialogResult> callback)\n        {\n            parameters = EnsureShowNonModalParameter(parameters);\n            dialogService.ShowDialog(name, parameters, new DialogCallback().OnClose(callback));\n        }\n\n        /// <summary>Shows a non-modal dialog.</summary>\n        /// <param name=\"dialogService\">The DialogService</param>\n        /// <param name=\"name\">The name of the dialog to show.</param>\n        /// <param name=\"parameters\">The parameters to pass to the dialog.</param>\n        /// <param name=\"callback\">The action to perform when the dialog is closed.</param>\n        /// <param name=\"windowName\">The name of the hosting window registered with the IContainerRegistry.</param>\n        public static void Show(this IDialogService dialogService, string name, IDialogParameters parameters, Action<IDialogResult> callback, string windowName)\n        {\n            parameters = EnsureShowNonModalParameter(parameters);\n\n            if (!string.IsNullOrEmpty(windowName))\n                parameters.Add(KnownDialogParameters.WindowName, windowName);\n\n            dialogService.ShowDialog(name, parameters, new DialogCallback().OnClose(callback));\n        }\n\n        /// <summary>Shows a non-modal dialog.</summary>\n        /// <param name=\"dialogService\">The DialogService</param>\n        /// <param name=\"name\">The name of the dialog to show.</param>\n        public static void Show(this IDialogService dialogService, string name)\n        {\n            var parameters = EnsureShowNonModalParameter(null);\n            dialogService.Show(name, parameters, null);\n        }\n\n        /// <summary>Shows a non-modal dialog.</summary>\n        /// <param name=\"dialogService\">The DialogService</param>\n        /// <param name=\"name\">The name of the dialog to show.</param>\n        /// <param name=\"callback\">The action to perform when the dialog is closed.</param>\n        public static void Show(this IDialogService dialogService, string name, Action<IDialogResult> callback)\n        {\n            var parameters = EnsureShowNonModalParameter(null);\n            dialogService.Show(name, parameters, callback);\n        }\n\n        private static IDialogParameters EnsureShowNonModalParameter(IDialogParameters parameters)\n        {\n            parameters ??= new DialogParameters();\n\n            if (!parameters.ContainsKey(KnownDialogParameters.ShowNonModal))\n                parameters.Add(KnownDialogParameters.ShowNonModal, true);\n\n            return parameters;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Avalonia/Prism.Avalonia/Dialogs/IDialogWindow.cs",
    "content": "using System;\nusing System.ComponentModel;\nusing System.Threading.Tasks;\nusing Avalonia.Controls;\nusing Avalonia.Styling;\n\n#nullable enable\nnamespace Prism.Dialogs\n{\n    /// <summary>\n    /// Interface for a dialog hosting window.\n    /// </summary>\n    public interface IDialogWindow\n    {\n        /// <summary>Dialog content.</summary>\n        object Content { get; set; }\n\n        /// <summary>Close the window.</summary>\n        void Close();\n\n        /// <summary>The window's owner.</summary>\n        /// <remarks>Avalonia's WindowBase.Owner's property access is { get; protected set; }.</remarks>\n        WindowBase Owner { get; }\n\n        /// <summary>Show a non-modal dialog.</summary>\n        void Show();\n\n        /// <summary>Show a modal dialog.</summary>\n        /// <returns>Task.</returns>\n        Task ShowDialog(Window owner);\n\n        /// <summary>The data context of the window.</summary>\n        /// <remarks>The data context must implement <see cref=\"IDialogAware\"/>.</remarks>\n        object DataContext { get; set; }\n\n        /// <summary>Called when the window is loaded.</summary>\n        /// <remarks>\n        ///     WPF: event RoutedEventHandler Loaded;\n        ///     Avalonia currently doesn't implement the Loaded event like WPF.\n        ///     Window > WindowBase > TopLevel.Opened\n        ///     Window > WindowBase > TopLevel > Control > InputElement > Interactive > layout > Visual > StyledElement.Initialized\n        /// </remarks>\n        event EventHandler Opened;\n\n        /// <summary>\n        /// Called when the window is closed.\n        /// </summary>\n        event EventHandler Closed;\n\n        /// <summary>Called when the window is closing.</summary>\n        event EventHandler<WindowClosingEventArgs>? Closing;\n\n        /// <summary>The result of the dialog.</summary>\n        IDialogResult Result { get; set; }\n\n        /////// <summary>The window style.</summary>\n        /////// <remarks>\n        /////// WPF: Window > ContentControl > FrameworkElement\n        /////// Ava: Window > WindowBase > TopLevel > ContentControl > TemplatedControl > Control\n        /////// </remarks>\n        ////Style Style { get; set; }\n    }\n}\n"
  },
  {
    "path": "src/Avalonia/Prism.Avalonia/Dialogs/IDialogWindowExtensions.cs",
    "content": "namespace Prism.Dialogs\n{\n    /// <summary>\n    /// <see cref=\"IDialogWindow\"/> extensions.\n    /// </summary>\n    internal static class IDialogWindowExtensions\n    {\n        /// <summary>\n        /// Get the <see cref=\"IDialogAware\"/> ViewModel from a <see cref=\"IDialogWindow\"/>.\n        /// </summary>\n        /// <param name=\"dialogWindow\"><see cref=\"IDialogWindow\"/> to get ViewModel from.</param>\n        /// <returns>ViewModel as a <see cref=\"IDialogAware\"/>.</returns>\n        internal static IDialogAware GetDialogViewModel(this IDialogWindow dialogWindow)\n        {\n            return (IDialogAware)dialogWindow.DataContext;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Avalonia/Prism.Avalonia/Dialogs/KnownDialogParameters.cs",
    "content": "namespace Prism.Dialogs;\n\n/// <summary>Provides Dialog Parameter Keys for well known parameters used by the <see cref=\"IDialogService\"/></summary>\npublic static class KnownDialogParameters\n{\n    /// <summary>The name of the window.</summary>\n    public const string WindowName = \"windowName\";\n\n    /// <summary>Flag to show the Dialog Modally or Non-Modally.</summary>\n    public const string ShowNonModal = \"nonModal\";\n\n    /// <summary>Host Window; when different from default.</summary>\n    public const string ParentWindow = \"parentWindow\";\n}\n"
  },
  {
    "path": "src/Avalonia/Prism.Avalonia/Extensions/AvaloniaObjectExtensions.cs",
    "content": "using Avalonia;\nusing Avalonia.Controls;\n\nnamespace Prism\n{\n    /// <summary>AvaloniaObject Extensions.</summary>\n    /// <remarks>Equivalent to WPF's DependencyObject</remarks>\n    internal static partial class AvaloniaObjectExtensions\n    {\n        /// <summary>Determines if a <see cref=\"AvaloniaProperty\"/> has a binding set.</summary>\n        /// <param name=\"instance\">The to use to search for the property.</param>\n        /// <param name=\"property\">The property to search.</param>\n        /// <returns><c>true</c> if there is an active binding, otherwise <c>false</c>.</returns>\n        public static bool HasBinding(this Control instance, AvaloniaProperty property)\n            => instance.GetBindingObservable(property) != null;\n    }\n}\n"
  },
  {
    "path": "src/Avalonia/Prism.Avalonia/Extensions/ObservableExtensions.cs",
    "content": "using System;\nusing Avalonia.Reactive;\nusing Prism.Common;\n\nnamespace Prism.Extensions\n{\n    internal static class ObservableExtensions\n    {\n        /// <summary>\n        /// Subscribes an element handler to an observable sequence.\n        /// </summary>\n        /// <typeparam name=\"T\">The type of the elements in the source sequence.</typeparam>\n        /// <param name=\"source\">Observable sequence to subscribe to.</param>\n        /// <param name=\"onNext\">Action to invoke for each element in the observable sequence.</param>\n        /// <returns><see cref=\"IDisposable\"/> object used to unsubscribe from the observable sequence.</returns>\n        /// <exception cref=\"ArgumentNullException\"><paramref name=\"source\"/> or <paramref name=\"onNext\"/> is <c>null</c>.</exception>\n        public static IDisposable Subscribe<T>(this IObservable<T> source, Action<T> onNext)\n        {\n            if (source == null)\n            {\n                throw new ArgumentNullException(nameof(source));\n            }\n\n            if (onNext == null)\n            {\n                throw new ArgumentNullException(nameof(onNext));\n            }\n\n            //\n            // [OK] Use of unsafe Subscribe: non-pretentious constructor for an observer; this overload is not to be used internally.\n            //\n            return source.Subscribe/*Unsafe*/(new AnonymousObserver<T>(onNext, Stubs.Throw, Stubs.Nop));\n        }\n    }\n}\n"
  },
  {
    "path": "src/Avalonia/Prism.Avalonia/Interactivity/InvokeCommandAction.cs",
    "content": "//  TODO - 2022-07-12\n//  * Updated the public StyleProperty fields for Avalonia\n//  * Needs:\n//      - Methods updated and verified - OnAttached, OnDetatching, , etc.\n//\n// Reference:\n// https://github.com/wieslawsoltes/AvaloniaBehaviors/blob/master/src/Avalonia.Xaml.Interactions/Core/InvokeCommandAction.cs\n//\n/*\nusing System.Reflection;\nusing System.Windows.Input;\nusing Avalonia;\nusing Avalonia.Controls;\nusing Microsoft.Xaml.Behaviors;\n\nnamespace Prism.Interactivity\n{\n    /// <summary>\n    /// Trigger action that executes a command when invoked. \n    /// It also maintains the Enabled state of the target control based on the CanExecute method of the command.\n    /// </summary>\n    public class InvokeCommandAction : TriggerAction<Control>\n    {\n        private ExecutableCommandBehavior _commandBehavior;\n\n        /// <summary>\n        /// Dependency property identifying if the associated element should automatically be enabled or disabled based on the result of the Command's CanExecute\n        /// </summary>\n        public static readonly StyledProperty<bool> AutoEnableProperty =\n            AvaloniaProperty.Register<InvokeCommandAction, bool>(nameof(AutoEnable));\n        ////public static readonly StyledProperty AutoEnableProperty =\n        ////    StyledProperty.Register(\"AutoEnable\", typeof(bool), typeof(InvokeCommandAction),\n        ////        new PropertyMetadata(true, (d, e) => ((InvokeCommandAction)d).OnAllowDisableChanged((bool)e.NewValue)));\n\n        /// <summary>\n        /// Gets or sets whether or not the associated element will automatically be enabled or disabled based on the result of the commands CanExecute\n        /// </summary>\n        public bool AutoEnable\n        {\n            get { return (bool)this.GetValue(AutoEnableProperty); }\n            set { this.SetValue(AutoEnableProperty, value); }\n        }\n\n        private void OnAllowDisableChanged(bool newValue)\n        {\n            var behavior = GetOrCreateBehavior();\n            if (behavior != null)\n                behavior.AutoEnable = newValue;\n        }\n\n        /// <summary>\n        /// Dependency property identifying the command to execute when invoked.\n        /// </summary>\n        public static readonly StyledProperty<ICommand?> CommandProperty =\n            AvaloniaProperty.Register<InvokeCommandAction, ICommand?>(nameof(Command));\n        ////public static readonly StyledProperty CommandProperty =\n        ////    StyledProperty.Register(\"Command\", typeof(ICommand), typeof(InvokeCommandAction),\n        ////        new PropertyMetadata(null, (d, e) => ((InvokeCommandAction)d).OnCommandChanged((ICommand)e.NewValue)));\n\n        /// <summary>\n        /// Gets or sets the command to execute when invoked.\n        /// </summary>\n        public ICommand Command\n        {\n            get { return this.GetValue(CommandProperty) as ICommand; }\n            set { this.SetValue(CommandProperty, value); }\n        }\n\n        private void OnCommandChanged(ICommand newValue)\n        {\n            var behavior = GetOrCreateBehavior();\n            if (behavior != null)\n                behavior.Command = newValue;\n        }\n\n        /// <summary>\n        /// Dependency property identifying the command parameter to supply on command execution.\n        /// </summary>\n        public static readonly StyledProperty<object?> CommandParameterProperty =\n            AvaloniaProperty.Register<InvokeCommandAction, object?>(nameof(CommandParameter));\n        ////public static readonly StyledProperty CommandParameterProperty =\n        ////    StyledProperty.Register(\"CommandParameter\", typeof(object), typeof(InvokeCommandAction),\n        ////        new PropertyMetadata(null, (d, e) => ((InvokeCommandAction)d).OnCommandParameterChanged(e.NewValue)));\n\n        /// <summary>\n        /// Gets or sets the command parameter to supply on command execution.\n        /// </summary>\n        public object CommandParameter\n        {\n            get { return this.GetValue(CommandParameterProperty); }\n            set { this.SetValue(CommandParameterProperty, value); }\n        }\n\n        private void OnCommandParameterChanged(object newValue)\n        {\n            var behavior = GetOrCreateBehavior();\n            if (behavior != null)\n                behavior.CommandParameter = newValue;\n        }\n\n        /// <summary>\n        /// Dependency property identifying the TriggerParameterPath to be parsed to identify the child property of the trigger parameter to be used as the command parameter.\n        /// </summary>\n        public static readonly StyledProperty<string> TriggerParameterPathProperty =\n            AvaloniaProperty.Register<InvokeCommandAction, string>(nameof(TriggerParameterPath));\n        ////public static readonly StyledProperty TriggerParameterPathProperty =\n        ////    StyledProperty.Register(\"TriggerParameterPath\", typeof(string), typeof(InvokeCommandAction),\n        ////        new PropertyMetadata(null, (d, e) => { }));\n\n        /// <summary>\n        /// Gets or sets the TriggerParameterPath value.\n        /// </summary>\n        public string TriggerParameterPath\n        {\n            get { return this.GetValue(TriggerParameterPathProperty) as string; }\n            set { this.SetValue(TriggerParameterPathProperty, value); }\n        }\n\n        /// <summary>\n        /// Public wrapper of the Invoke method.\n        /// </summary>\n        public void InvokeAction(object parameter)\n        {\n            Invoke(parameter);\n        }\n\n        /// <summary>\n        /// Executes the command\n        /// </summary>\n        /// <param name=\"parameter\">This parameter is passed to the command; the CommandParameter specified in the CommandParameterProperty is used for command invocation if not null.</param>\n        protected override void Invoke(object parameter)\n        {\n            if (!string.IsNullOrEmpty(TriggerParameterPath))\n            {\n                //Walk the ParameterPath for nested properties.\n                var propertyPathParts = TriggerParameterPath.Split('.');\n                object propertyValue = parameter;\n                foreach (var propertyPathPart in propertyPathParts)\n                {\n                    var propInfo = propertyValue.GetType().GetTypeInfo().GetProperty(propertyPathPart);\n                    propertyValue = propInfo.GetValue(propertyValue);\n                }\n                parameter = propertyValue;\n            }\n\n            var behavior = GetOrCreateBehavior();\n\n            if (behavior != null)\n            {\n                behavior.ExecuteCommand(parameter);\n            }\n        }\n\n        /// <summary>\n        /// Sets the Command and CommandParameter properties to null.\n        /// </summary>\n        protected override void OnDetaching()\n        {\n            base.OnDetaching();\n\n            Command = null;\n            CommandParameter = null;\n\n            _commandBehavior = null;\n        }\n\n        /// <summary>\n        /// This method is called after the behavior is attached.\n        /// It updates the command behavior's Command and CommandParameter properties if necessary.\n        /// </summary>\n        protected override void OnAttached()\n        {\n            base.OnAttached();\n\n            // In case this action is attached to a target object after the Command and/or CommandParameter properties are set,\n            // the command behavior would be created without a value for these properties.\n            // To cover this scenario, the Command and CommandParameter properties of the behavior are updated here.\n            var behavior = GetOrCreateBehavior();\n\n            behavior.AutoEnable = AutoEnable;\n\n            if (behavior.Command != Command)\n                behavior.Command = Command;\n\n            if (behavior.CommandParameter != CommandParameter)\n                behavior.CommandParameter = CommandParameter;\n        }\n\n        private ExecutableCommandBehavior GetOrCreateBehavior()\n        {\n            // In case this method is called prior to this action being attached, \n            // the CommandBehavior would always keep a null target object (which isn't changeable afterwards).\n            // Therefore, in that case the behavior shouldn't be created and this method should return null.\n            if (_commandBehavior == null && AssociatedObject != null)\n            {\n                _commandBehavior = new ExecutableCommandBehavior(AssociatedObject);\n            }\n\n            return _commandBehavior;\n        }\n\n        /// <summary>\n        /// A CommandBehavior that exposes a public ExecuteCommand method. It provides the functionality to invoke commands and update Enabled state of the target control.\n        /// It is not possible to make the <see cref=\"InvokeCommandAction\"/> inherit from <see cref=\"CommandBehaviorBase{T}\"/>, since the <see cref=\"InvokeCommandAction\"/>\n        /// must already inherit from <see cref=\"TriggerAction{T}\"/>, so we chose to follow the aggregation approach.\n        /// </summary>\n        private class ExecutableCommandBehavior : CommandBehaviorBase<Control>\n        {\n            /// <summary>\n            /// Constructor specifying the target object.\n            /// </summary>\n            /// <param name=\"target\">The target object the behavior is attached to.</param>\n            public ExecutableCommandBehavior(Control target)\n                : base(target)\n            {\n            }\n\n            /// <summary>\n            /// Executes the command, if it's set.\n            /// </summary>\n            public new void ExecuteCommand(object parameter)\n            {\n                base.ExecuteCommand(parameter);\n            }\n        }\n    }\n}\n*/\n"
  },
  {
    "path": "src/Avalonia/Prism.Avalonia/Navigation/Regions/Behaviors/BindRegionContextToAvaloniaObjectBehavior.cs",
    "content": "using Avalonia;\nusing Prism.Common;\nusing System.Collections;\nusing System.Collections.Specialized;\nusing System.ComponentModel;\n\nnamespace Prism.Navigation.Regions.Behaviors\n{\n    /// <summary>\n    /// Defines a behavior that forwards the <see cref=\"RegionManager.RegionContextProperty\"/>\n    /// to the views in the region.\n    /// </summary>\n    public class BindRegionContextToAvaloniaObjectBehavior : IRegionBehavior\n    {\n\n        /// <summary>The key of this behavior.</summary>\n        /// <remarks>(2024-04-11_Suess): This SHOULD be ''ContextToAvaloniaObject'.</remarks>\n        public const string BehaviorKey = \"ContextToDependencyObject\";\n\n        /// <summary>Behavior's attached region.</summary>\n        public IRegion Region { get; set; }\n\n        /// <summary>Attaches the behavior to the specified region.</summary>\n        public void Attach()\n        {\n            Region.Views.CollectionChanged += Views_CollectionChanged;\n            Region.PropertyChanged += Region_PropertyChanged;\n            SetContextToViews(Region.Views, Region.Context);\n            AttachNotifyChangeEvent(Region.Views);\n        }\n\n        private static void SetContextToViews(IEnumerable views, object context)\n        {\n            foreach (var view in views)\n            {\n                AvaloniaObject avaloniaObjectView = view as AvaloniaObject;\n                if (avaloniaObjectView != null)\n                {\n                    ObservableObject<object> contextWrapper = RegionContext.GetObservableContext(avaloniaObjectView);\n                    contextWrapper.Value = context;\n                }\n            }\n        }\n\n        private void AttachNotifyChangeEvent(IEnumerable views)\n        {\n            foreach (var view in views)\n            {\n                var avaloniaObject = view as AvaloniaObject;\n                if (avaloniaObject != null)\n                {\n                    ObservableObject<object> viewRegionContext = RegionContext.GetObservableContext(avaloniaObject);\n                    viewRegionContext.PropertyChanged += ViewRegionContext_OnPropertyChangedEvent;\n                }\n            }\n        }\n\n        private void DetachNotifyChangeEvent(IEnumerable views)\n        {\n            foreach (var view in views)\n            {\n                var avaloniaObject = view as AvaloniaObject;\n                if (avaloniaObject != null)\n                {\n                    ObservableObject<object> viewRegionContext = RegionContext.GetObservableContext(avaloniaObject);\n                    viewRegionContext.PropertyChanged -= ViewRegionContext_OnPropertyChangedEvent;\n                }\n            }\n        }\n\n        private void ViewRegionContext_OnPropertyChangedEvent(object sender, PropertyChangedEventArgs args)\n        {\n            if (args.PropertyName == \"Value\")\n            {\n                var context = (ObservableObject<object>)sender;\n                Region.Context = context.Value;\n            }\n        }\n\n        private void Views_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)\n        {\n            if (e.Action == NotifyCollectionChangedAction.Add)\n            {\n                SetContextToViews(e.NewItems, Region.Context);\n                AttachNotifyChangeEvent(e.NewItems);\n            }\n            else if (e.Action == NotifyCollectionChangedAction.Remove && Region.Context != null)\n            {\n                DetachNotifyChangeEvent(e.OldItems);\n                SetContextToViews(e.OldItems, null);\n\n            }\n        }\n\n        private void Region_PropertyChanged(object sender, PropertyChangedEventArgs e)\n        {\n            if (e.PropertyName == \"Context\")\n            {\n                SetContextToViews(Region.Views, Region.Context);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Avalonia/Prism.Avalonia/Navigation/Regions/Behaviors/SelectorItemsSourceSyncBehavior.cs",
    "content": "// TODO: 2022-07-08 - Feature disabled until a workaround can be created\n// Consider using Avalonia.Styling.IStylable or Avalonia.Styling.Selector\n// in place of WPF's `Selector` object or AvaloniaObject.\n// This theory is untested and causes issues on code such as, `hostControl.Items`\n//      - private Selector hostControl;\n//      - public IStyleable HostControl\n// Ref:\n//  - https://github.com/AvaloniaUI/Avalonia/issues/3593\n//  - https://stackoverflow.com/questions/44241761/how-do-style-selectors-work-in-avalonia\n//  - https://stackoverflow.com/questions/72238118/avalonia-style-selector-doent-works-on-derived-classes\n/*\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.Specialized;\nusing Prism.Properties;\n\nusing Avalonia;\nusing Avalonia.Controls;\nusing Avalonia.Controls.Primitives;\nusing Avalonia.Data;\nusing Avalonia.Controls.Primitives;\n\nnamespace Prism.Navigation.Regions.Behaviors\n{\n    /// <summary>\n    /// Defines the attached behavior that keeps the items of the <see cref=\"Selector\"/> host control in synchronization with the <see cref=\"IRegion\"/>.\n    /// \n    /// This behavior also makes sure that, if you activate a view in a region, the SelectedItem is set. If you set the SelectedItem or SelectedItems (ListBox)\n    /// then this behavior will also call Activate on the selected items. \n    /// <remarks>\n    /// When calling Activate on a view, you can only select a single active view at a time. By setting the SelectedItems property of a listbox, you can set\n    /// multiple views to active. \n    /// </remarks>\n    /// </summary>\n    public class SelectorItemsSourceSyncBehavior : RegionBehavior, IHostAwareRegionBehavior\n    {\n        /// <summary>\n        /// Name that identifies the SelectorItemsSourceSyncBehavior behavior in a collection of RegionsBehaviors. \n        /// </summary>\n        public static readonly string BehaviorKey = \"SelectorItemsSourceSyncBehavior\";\n        private bool updatingActiveViewsInHostControlSelectionChanged;\n        private Selector hostControl;\n\n        /// <summary>\n        /// Gets or sets the <see cref=\"AvaloniaObject\"/> that the <see cref=\"IRegion\"/> is attached to.\n        /// </summary>\n        /// <value>\n        /// A <see cref=\"AvaloniaObject\"/> that the <see cref=\"IRegion\"/> is attached to.\n        /// </value>\n        /// <remarks>For this behavior, the host control must always be a <see cref=\"Selector\"/> or an inherited class.</remarks>\n        public AvaloniaObject HostControl\n        {\n            get\n            {\n                return this.hostControl;\n            }\n\n            set\n            {\n                this.hostControl = value as Selector;\n            }\n        }\n\n        /// <summary>\n        /// Starts to monitor the <see cref=\"IRegion\"/> to keep it in synch with the items of the <see cref=\"HostControl\"/>.\n        /// </summary>\n        protected override void OnAttach()\n        {\n            bool itemsSourceIsSet = this.hostControl.ItemsSource != null;\n            itemsSourceIsSet = itemsSourceIsSet || (hostControl.HasBinding(this.hostControl, ItemsControl.ItemsSourceProperty) != null);\n            ////itemsSourceIsSet = itemsSourceIsSet || (BindingOperations.GetBinding(this.hostControl, ItemsControl.ItemsSourceProperty) != null);\n\n            if (itemsSourceIsSet)\n            {\n                throw new InvalidOperationException(Resources.ItemsControlHasItemsSourceException);\n            }\n\n            this.SynchronizeItems();\n\n            this.hostControl.SelectionChanged += this.HostControlSelectionChanged;\n            this.Region.ActiveViews.CollectionChanged += this.ActiveViews_CollectionChanged;\n            this.Region.Views.CollectionChanged += this.Views_CollectionChanged;\n        }\n\n        private void Views_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)\n        {\n            if (e.Action == NotifyCollectionChangedAction.Add)\n            {\n                int startIndex = e.NewStartingIndex;\n                foreach (object newItem in e.NewItems)\n                {\n                    this.hostControl.Items.Insert(startIndex++, newItem);\n                }\n            }\n            else if (e.Action == NotifyCollectionChangedAction.Remove)\n            {\n                foreach (object oldItem in e.OldItems)\n                {\n                    this.hostControl.Items.Remove(oldItem);\n                }\n            }\n        }\n\n        private void SynchronizeItems()\n        {\n            List<object> existingItems = new List<object>();\n\n            // Control must be empty before \"Binding\" to a region\n            foreach (object childItem in this.hostControl.Items)\n            {\n                existingItems.Add(childItem);\n            }\n\n            foreach (object view in this.Region.Views)\n            {\n                this.hostControl.Items.Add(view);\n            }\n\n            foreach (object existingItem in existingItems)\n            {\n                this.Region.Add(existingItem);\n            }\n        }\n\n\n        private void ActiveViews_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)\n        {\n            if (this.updatingActiveViewsInHostControlSelectionChanged)\n            {\n                // If we are updating the ActiveViews collection in the HostControlSelectionChanged, that \n                // means the user has set the SelectedItem or SelectedItems himself and we don't need to do that here now\n                return;\n            }\n\n            if (e.Action == NotifyCollectionChangedAction.Add)\n            {\n                if (this.hostControl.SelectedItem != null\n                    && this.hostControl.SelectedItem != e.NewItems[0]\n                    && this.Region.ActiveViews.Contains(this.hostControl.SelectedItem))\n                {\n                    this.Region.Deactivate(this.hostControl.SelectedItem);\n                }\n\n                this.hostControl.SelectedItem = e.NewItems[0];\n            }\n            else if (e.Action == NotifyCollectionChangedAction.Remove &&\n                     e.OldItems.Contains(this.hostControl.SelectedItem))\n            {\n                this.hostControl.SelectedItem = null;\n            }\n        }\n\n        private void HostControlSelectionChanged(object sender, SelectionChangedEventArgs e)\n        {\n            try\n            {\n                // Record the fact that we are now updating active views in the HostControlSelectionChanged method. \n                // This is needed to prevent the ActiveViews_CollectionChanged() method from firing. \n                this.updatingActiveViewsInHostControlSelectionChanged = true;\n\n                object source;\n                source = e.Source;    // source = e.OriginalSource;\n\n                if (source == sender)\n                {\n                    foreach (object item in e.RemovedItems)\n                    {\n                        // check if the view is in both Views and ActiveViews collections (there may be out of sync)\n                        if (this.Region.Views.Contains(item) && this.Region.ActiveViews.Contains(item))\n                        {\n                            this.Region.Deactivate(item);\n                        }\n                    }\n\n                    foreach (object item in e.AddedItems)\n                    {\n                        if (this.Region.Views.Contains(item) && !this.Region.ActiveViews.Contains(item))\n                        {\n                            this.Region.Activate(item);\n                        }\n                    }\n                }\n            }\n            finally\n            {\n                this.updatingActiveViewsInHostControlSelectionChanged = false;\n            }\n        }\n    }\n}\n*/\n"
  },
  {
    "path": "src/Avalonia/Prism.Avalonia/Navigation/Regions/ItemMetadata.cs",
    "content": "using System;\nusing Avalonia;\nusing Prism.Extensions;\n\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Defines a class that wraps an item and adds metadata for it.\n    /// </summary>\n    public class ItemMetadata : AvaloniaObject\n    {\n        /// <summary>The name of the wrapped item.</summary>\n        public static readonly StyledProperty<string> NameProperty = AvaloniaProperty.Register<ItemMetadata, string>(nameof(Name));\n\n        /// <summary>Value indicating whether the wrapped item is considered active.</summary>\n        public static readonly StyledProperty<bool> IsActiveProperty = AvaloniaProperty.Register<ItemMetadata, bool>(nameof(IsActive));\n\n        /// <summary>Initializes a new instance of <see cref=\"ItemMetadata\"/>.</summary>\n        /// <param name=\"item\">The item to wrap.</param>\n        public ItemMetadata(object item)\n        {\n            // check for null\n            Item = item;\n        }\n\n        static ItemMetadata()\n        {\n            IsActiveProperty.Changed.Subscribe(args => StyledPropertyChanged(args?.Sender, args));\n        }\n\n        /// <summary>Gets the wrapped item.</summary>\n        /// <value>The wrapped item.</value>\n        public object Item { get; private set; }\n\n        /// <summary>Gets or sets a name for the wrapped item.</summary>\n        /// <value>The name of the wrapped item.</value>\n        public string Name\n        {\n            get => (string)GetValue(NameProperty);\n            set => SetValue(NameProperty, value);\n        }\n\n        /// <summary>Gets or sets a value indicating whether the wrapped item is considered active.</summary>\n        /// <value><see langword=\"true\" /> if the item should be considered active; otherwise <see langword=\"false\" />.</value>\n        public bool IsActive\n        {\n            get => (bool)GetValue(IsActiveProperty);\n            set => SetValue(IsActiveProperty, value);\n        }\n\n        /// <summary>Occurs when metadata on the item changes.</summary>\n        public event EventHandler MetadataChanged;\n\n        /// <summary>Explicitly invokes <see cref=\"MetadataChanged\"/> to notify listeners.</summary>\n        public void InvokeMetadataChanged()\n        {\n            MetadataChanged?.Invoke(this, EventArgs.Empty);\n        }\n\n        private static void StyledPropertyChanged(AvaloniaObject avaloniaObject, AvaloniaPropertyChangedEventArgs args)\n        {\n            var itemMetadata = avaloniaObject as ItemMetadata;\n            itemMetadata?.InvokeMetadataChanged();\n        }\n    }\n}\n"
  },
  {
    "path": "src/Avalonia/Prism.Avalonia/Prism.Avalonia.csproj",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project Sdk=\"Microsoft.NET.Sdk\">\n  <PropertyGroup>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Prism</RootNamespace>\n    <TargetFrameworks>net9.0;net10.0</TargetFrameworks>\n    <Description>Prism.Avalonia is a fully open source version of the Prism guidance originally produced by Microsoft Patterns &amp; Practices. Prism.Avalonia provides an implementation of a collection of design patterns that are helpful in writing well structured, maintainable, and testable XAML applications, including MVVM, dependency injection, commanding, event aggregation, and more. Prism's core functionality is a shared library targeting the .NET Framework and .NET Standard. Features that need to be platform specific are implemented in the respective libraries for the target platform (Avalonia, WPF, Uno Platform, and Xamarin Forms).\n\nPrism.Avalonia helps you more easily design and build rich, flexible, and easy to maintain cross-platform Avalonia desktop applications. This library provides user interface composition as well as modularity support.</Description>\n\n    <Title>Prism.Avalonia</Title>\n  </PropertyGroup>\n\n  <!--<ItemGroup Condition=\" $(TargetFramework.StartsWith('net4')) \">\n    <Compile Remove=\"**\\*.netcore.cs\" />\n    <None Include=\"**\\*.netcore.cs\" />\n    <Reference Include=\"System.Configuration\" />\n  </ItemGroup>-->\n\n  <ItemGroup>\n    <Compile Include=\"..\\..\\Wpf\\Prism.Wpf\\Common\\MvvmHelpers.cs\" LinkBase=\"Common\" />\n    <Compile Include=\"..\\..\\Wpf\\Prism.Wpf\\PrismInitializationExtensions.cs\" Link=\"PrismInitializationExtensions.cs\" />\n    <Compile Include=\"..\\..\\Wpf\\Prism.Wpf\\Extensions\\CollectionExtensions.cs\" LinkBase=\"Extensions\" />\n    <Compile Include=\"..\\..\\Wpf\\Prism.Wpf\\Interactivity\\*.cs\" LinkBase=\"Interactivity\" />\n    <Compile Include=\"..\\..\\Wpf\\Prism.Wpf\\Ioc\\*.cs\" LinkBase=\"Ioc\" />\n    <Compile Include=\"..\\..\\Wpf\\Prism.Wpf\\Modularity\\*.cs\" LinkBase=\"Modularity\" />\n    <Compile Include=\"..\\..\\Wpf\\Prism.Wpf\\Mvvm\\*.cs\" LinkBase=\"Mvvm\" />\n    <Compile Include=\"..\\..\\Wpf\\Prism.Wpf\\Navigation\\Regions\\**\\*.cs\" LinkBase=\"Navigation\\Regions\" />\n\n    <Compile Remove=\"..\\..\\Wpf\\Prism.Wpf\\Interactivity\\InvokeCommandAction.cs\" />\n    <Compile Remove=\"..\\..\\Wpf\\Prism.Wpf\\Modularity\\XamlModuleCatalog.cs\" />\n    <Compile Remove=\"..\\..\\Wpf\\Prism.Wpf\\Navigation\\Regions\\ItemMetadata.cs\" />\n    <Compile Remove=\"..\\..\\Wpf\\Prism.Wpf\\Navigation\\Regions\\Behaviors\\BindRegionContextToDependencyObjectBehavior.cs\" />\n    <Compile Remove=\"..\\..\\Wpf\\Prism.Wpf\\Navigation\\Regions\\Behaviors\\SelectorItemsSourceSyncBehavior.cs\" />\n    <Compile Remove=\"..\\..\\Wpf\\Prism.Wpf\\Navigation\\Regions\\SelectorRegionAdapter.cs\" />\n\n    <Using Include=\"Prism.Extensions\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <Compile Remove=\"**\\*.net45.cs\" />\n    <None Include=\"**\\*.net45.cs\" />\n  </ItemGroup>\n\n  <!--\n  <ItemGroup>\n    < ! - - We probably don't want to support this in Avalonia projects keeping for now - - >\n    <Compile Remove=\"PrismBootstrapperBase.cs\" />\n    <None Include=\"PrismBootstrapperBase.cs\" />\n  </ItemGroup>\n  -->\n\n  <ItemGroup>\n    <Reference Include=\"PresentationFramework\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <Compile Update=\"Properties\\Resources.Designer.cs\">\n      <DesignTime>True</DesignTime>\n      <AutoGen>True</AutoGen>\n      <DependentUpon>Resources.resx</DependentUpon>\n    </Compile>\n  </ItemGroup>\n\n  <ItemGroup>\n    <EmbeddedResource Update=\"Properties\\Resources.resx\">\n      <Generator>PublicResXFileCodeGenerator</Generator>\n      <LastGenOutput>Resources.Designer.cs</LastGenOutput>\n    </EmbeddedResource>\n  </ItemGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"System.Configuration.ConfigurationManager\" />\n    <PackageReference Include=\"Avalonia\" />\n    <PackageReference Include=\"Avalonia.Markup.Xaml.Loader\" />\n    \n    <ProjectReference Include=\"..\\..\\Prism.Core\\Prism.Core.csproj\" />\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": "src/Avalonia/Prism.Avalonia/PrismApplicationBase.cs",
    "content": "using Prism.Common;\nusing Prism.Modularity;\nusing Prism.Navigation.Regions;\n\nnamespace Prism\n{\n    /// <summary>\n    /// Base application class that provides a basic initialization sequence\n    /// </summary>\n    /// <remarks>\n    /// This class must be overridden to provide application specific configuration.\n    /// </remarks>\n    public abstract class PrismApplicationBase : Application\n    {\n        private IContainerExtension _containerExtension;\n        private IModuleCatalog _moduleCatalog;\n\n        /// <summary>Main window.</summary>\n        public AvaloniaObject MainWindow { get; private set; }\n\n        /// <summary>The dependency injection container used to resolve objects.</summary>\n        public IContainerProvider Container => _containerExtension;\n\n        /// <summary>Configures the <see cref=\"Prism.Mvvm.ViewModelLocator\"/> used by Prism.</summary>\n        protected virtual void ConfigureViewModelLocator()\n        {\n            PrismInitializationExtensions.ConfigureViewModelLocator();\n        }\n\n        /// <summary>\n        /// Runs the initialization sequence to configure the Prism application.\n        /// </summary>\n        /// <remarks>\n        ///   Though, Prism.WPF v8.1 uses, `protected virtual void Initialize()`\n        ///   Avalonia's AppBuilderBase.cs calls, `.Setup() { ... Instance.Initialize(); ... }`\n        ///   Therefore, we need this as a `public override void` in PrismApplicationBase.cs\n        /// </remarks>\n        public override void Initialize()\n        {\n            base.Initialize();\n\n            ConfigureViewModelLocator();\n\n            ContainerLocator.SetContainerExtension(CreateContainerExtension());\n            _containerExtension = ContainerLocator.Current;\n            _moduleCatalog = CreateModuleCatalog();\n            RegisterRequiredTypes(_containerExtension);\n            RegisterTypes(_containerExtension);\n\n            ConfigureModuleCatalog(_moduleCatalog);\n\n            var regionAdapterMappings = _containerExtension.Resolve<RegionAdapterMappings>();\n            ConfigureRegionAdapterMappings(regionAdapterMappings);\n\n            var defaultRegionBehaviors = _containerExtension.Resolve<IRegionBehaviorFactory>();\n            ConfigureDefaultRegionBehaviors(defaultRegionBehaviors);\n\n            RegisterFrameworkExceptionTypes();\n\n            var shell = CreateShell();\n            if (shell != null)\n            {\n                MvvmHelpers.AutowireViewModel(shell);\n                RegionManager.SetRegionManager(shell, _containerExtension.Resolve<IRegionManager>());\n                RegionManager.UpdateRegions();\n                InitializeShell(shell);\n            }\n\n            InitializeModules();\n\n            OnInitialized();\n        }\n\n        /// <summary>Framework initialization has completed.</summary>\n        public override void OnFrameworkInitializationCompleted()\n        {\n            if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktopLifetime)\n                desktopLifetime.MainWindow = MainWindow as Window;\n            else if (ApplicationLifetime is ISingleViewApplicationLifetime singleViewLifetime)\n                singleViewLifetime.MainView = MainWindow as Control;\n\n            base.OnFrameworkInitializationCompleted();\n        }\n\n        /// <summary>Creates the container used by Prism.</summary>\n        /// <returns>The container</returns>\n        protected abstract IContainerExtension CreateContainerExtension();\n\n        /// <summary>Creates the <see cref=\"IModuleCatalog\"/> used by Prism.</summary>\n        ///  <remarks>The base implementation returns a new ModuleCatalog.</remarks>\n        protected virtual IModuleCatalog CreateModuleCatalog()\n        {\n            return new ModuleCatalog();\n        }\n\n        /// <summary>Registers all types that are required by Prism to function with the container.</summary>\n        /// <param name=\"containerRegistry\"></param>\n        protected virtual void RegisterRequiredTypes(IContainerRegistry containerRegistry)\n        {\n            containerRegistry.RegisterRequiredTypes(_moduleCatalog);\n        }\n\n        /// <summary>\n        /// Used to register types with the container that will be used by your application.\n        /// </summary>\n        protected abstract void RegisterTypes(IContainerRegistry containerRegistry);\n\n        /// <summary>\n        /// Configures the <see cref=\"IRegionBehaviorFactory\"/>.\n        /// This will be the list of default behaviors that will be added to a region.\n        /// </summary>\n        protected virtual void ConfigureDefaultRegionBehaviors(IRegionBehaviorFactory regionBehaviors)\n        {\n            regionBehaviors?.RegisterDefaultRegionBehaviors();\n        }\n\n        /// <summary>\n        /// Configures the default region adapter mappings to use in the application, in order\n        /// to adapt UI controls defined in XAML to use a region and register it automatically.\n        /// May be overwritten in a derived class to add specific mappings required by the application.\n        /// </summary>\n        /// <returns>The <see cref=\"RegionAdapterMappings\"/> instance containing all the mappings.</returns>\n        protected virtual void ConfigureRegionAdapterMappings(RegionAdapterMappings regionAdapterMappings)\n        {\n            regionAdapterMappings?.RegisterDefaultRegionAdapterMappings();\n        }\n\n        /// <summary>\n        /// Registers the <see cref=\"Type\"/>s of the Exceptions that are not considered\n        /// root exceptions by the <see cref=\"ExceptionExtensions\"/>.\n        /// </summary>\n        protected virtual void RegisterFrameworkExceptionTypes()\n        {\n        }\n\n        /// <summary>\n        /// Creates the shell or main window of the application.\n        /// </summary>\n        /// <returns>The shell of the application.</returns>\n        protected abstract AvaloniaObject CreateShell();\n\n        /// <summary>\n        /// Initializes the shell.\n        /// </summary>\n        protected virtual void InitializeShell(AvaloniaObject shell)\n        {\n            MainWindow = shell;\n        }\n\n        /// <summary>\n        /// Contains actions that should occur last.\n        /// </summary>\n        protected virtual void OnInitialized()\n        {\n            (MainWindow as Window)?.Show();\n        }\n\n        /// <summary>\n        /// Configures the <see cref=\"IModuleCatalog\"/> used by Prism.\n        /// </summary>\n        protected virtual void ConfigureModuleCatalog(IModuleCatalog moduleCatalog) { }\n\n        /// <summary>\n        /// Initializes the modules.\n        /// </summary>\n        protected virtual void InitializeModules()\n        {\n            PrismInitializationExtensions.RunModuleManager(Container);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Avalonia/Prism.Avalonia/PrismBootstrapperBase.cs",
    "content": "using System;\nusing Avalonia;\nusing Avalonia.Controls;\nusing Prism.Common;\nusing Prism.Ioc;\nusing Prism.Modularity;\nusing Prism.Navigation.Regions;\n\nnamespace Prism\n{\n    /// <summary>\n    /// Base class that provides a basic bootstrapping sequence and hooks\n    /// that specific implementations can override\n    /// </summary>\n    /// <remarks>\n    /// This class must be overridden to provide application specific configuration.\n    /// </remarks>\n    public abstract class PrismBootstrapperBase\n    {\n        private IContainerExtension _containerExtension;\n        private IModuleCatalog _moduleCatalog;\n\n        /// <summary>\n        /// The dependency injection container used to resolve objects\n        /// </summary>\n        public IContainerProvider Container => _containerExtension;\n\n        /// <summary>\n        /// Gets the shell user interface\n        /// </summary>\n        /// <value>The shell user interface.</value>\n        protected AvaloniaObject Shell { get; set; }\n\n        /// <summary>\n        /// Runs the bootstrapper process.\n        /// </summary>\n        public void Run()\n        {\n            ConfigureViewModelLocator();\n            Initialize();\n            OnInitialized();\n        }\n\n        /// <summary>\n        /// Configures the <see cref=\"Prism.Mvvm.ViewModelLocator\"/> used by Prism.\n        /// </summary>\n        protected virtual void ConfigureViewModelLocator()\n        {\n            PrismInitializationExtensions.ConfigureViewModelLocator();\n        }\n\n        /// <summary>\n        /// Runs the initialization sequence to configure the Prism application.\n        /// </summary>\n        protected virtual void Initialize()\n        {\n            ContainerLocator.SetContainerExtension(CreateContainerExtension());\n            _containerExtension = ContainerLocator.Current;\n            _moduleCatalog = CreateModuleCatalog();\n            RegisterRequiredTypes(_containerExtension);\n            RegisterTypes(_containerExtension);\n\n            ConfigureModuleCatalog(_moduleCatalog);\n\n            var regionAdapterMappings = _containerExtension.Resolve<RegionAdapterMappings>();\n            ConfigureRegionAdapterMappings(regionAdapterMappings);\n\n            var defaultRegionBehaviors = _containerExtension.Resolve<IRegionBehaviorFactory>();\n            ConfigureDefaultRegionBehaviors(defaultRegionBehaviors);\n\n            RegisterFrameworkExceptionTypes();\n\n            var shell = CreateShell();\n            if (shell != null)\n            {\n                MvvmHelpers.AutowireViewModel(shell);\n                RegionManager.SetRegionManager(shell, _containerExtension.Resolve<IRegionManager>());\n                RegionManager.UpdateRegions();\n                InitializeShell(shell);\n            }\n\n            InitializeModules();\n        }\n\n        /// <summary>\n        /// Creates the container used by Prism.\n        /// </summary>\n        /// <returns>The container</returns>\n        protected abstract IContainerExtension CreateContainerExtension();\n\n        /// <summary>\n        /// Creates the <see cref=\"IModuleCatalog\"/> used by Prism.\n        /// </summary>\n        ///  <remarks>\n        /// The base implementation returns a new ModuleCatalog.\n        /// </remarks>\n        protected virtual IModuleCatalog CreateModuleCatalog()\n        {\n            return new ModuleCatalog();\n        }\n\n        /// <summary>\n        /// Registers all types that are required by Prism to function with the container.\n        /// </summary>\n        /// <param name=\"containerRegistry\"></param>\n        protected virtual void RegisterRequiredTypes(IContainerRegistry containerRegistry)\n        {\n            if (_moduleCatalog == null)\n                throw new InvalidOperationException(\"IModuleCatalog was null\");\n\n            containerRegistry.RegisterRequiredTypes(_moduleCatalog);\n        }\n\n        /// <summary>\n        /// Used to register types with the container that will be used by your application.\n        /// </summary>\n        protected abstract void RegisterTypes(IContainerRegistry containerRegistry);\n\n        /// <summary>\n        /// Configures the <see cref=\"IRegionBehaviorFactory\"/>.\n        /// This will be the list of default behaviors that will be added to a region.\n        /// </summary>\n        protected virtual void ConfigureDefaultRegionBehaviors(IRegionBehaviorFactory regionBehaviors)\n        {\n            regionBehaviors?.RegisterDefaultRegionBehaviors();\n        }\n\n        /// <summary>\n        /// Configures the default region adapter mappings to use in the application, in order\n        /// to adapt UI controls defined in XAML to use a region and register it automatically.\n        /// May be overwritten in a derived class to add specific mappings required by the application.\n        /// </summary>\n        /// <returns>The <see cref=\"RegionAdapterMappings\"/> instance containing all the mappings.</returns>\n        protected virtual void ConfigureRegionAdapterMappings(RegionAdapterMappings regionAdapterMappings)\n        {\n            regionAdapterMappings?.RegisterDefaultRegionAdapterMappings();\n        }\n\n        /// <summary>\n        /// Registers the <see cref=\"Type\"/>s of the Exceptions that are not considered\n        /// root exceptions by the <see cref=\"ExceptionExtensions\"/>.\n        /// </summary>\n        protected virtual void RegisterFrameworkExceptionTypes()\n        {\n        }\n\n        /// <summary>\n        /// Creates the shell or main window of the application.\n        /// </summary>\n        /// <returns>The shell of the application.</returns>\n        protected abstract AvaloniaObject CreateShell();\n\n        /// <summary>\n        /// Initializes the shell.\n        /// </summary>\n        protected virtual void InitializeShell(AvaloniaObject shell)\n        {\n            Shell = shell;\n        }\n\n        /// <summary>\n        /// Contains actions that should occur last.\n        /// </summary>\n        protected virtual void OnInitialized()\n        {\n            if (Shell is Window window)\n                window.Show();\n        }\n\n        /// <summary>\n        /// Configures the <see cref=\"IModuleCatalog\"/> used by Prism.\n        /// </summary>\n        protected virtual void ConfigureModuleCatalog(IModuleCatalog moduleCatalog) { }\n\n        /// <summary>\n        /// Initializes the modules.\n        /// </summary>\n        protected virtual void InitializeModules()\n        {\n            PrismInitializationExtensions.RunModuleManager(Container);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Avalonia/Prism.Avalonia/Properties/AssemblyInfo.cs",
    "content": "using System;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\nusing Avalonia.Metadata;\n\n[assembly: ComVisible(false)]\n[assembly: CLSCompliant(false)]\n\n[assembly: XmlnsDefinition(\"http://prismlibrary.com/\", \"Prism.Navigation.Regions\")]\n[assembly: XmlnsDefinition(\"http://prismlibrary.com/\", \"Prism.Navigation.Regions.Behaviors\")]\n[assembly: XmlnsDefinition(\"http://prismlibrary.com/\", \"Prism.Mvvm\")]\n[assembly: XmlnsDefinition(\"http://prismlibrary.com/\", \"Prism.Interactivity\")]\n[assembly: XmlnsDefinition(\"http://prismlibrary.com/\", \"Prism.Dialogs\")]\n[assembly: XmlnsDefinition(\"http://prismlibrary.com/\", \"Prism.Ioc\")]\n\n[assembly: InternalsVisibleTo(\"Prism.Avalonia.Tests\")]\n"
  },
  {
    "path": "src/Avalonia/Prism.Avalonia/Properties/Resources.Designer.cs",
    "content": "//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.42000\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace Prism.Properties {\n    using System;\n    \n    \n    /// <summary>\n    ///   A strongly-typed resource class, for looking up localized strings, etc.\n    /// </summary>\n    // This class was auto-generated by the StronglyTypedResourceBuilder\n    // class via a tool like ResGen or Visual Studio.\n    // To add or remove a member, edit your .ResX file then rerun ResGen\n    // with the /str option, or rebuild your VS project.\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"15.0.0.0\")]\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    internal class Resources {\n        \n        private static global::System.Resources.ResourceManager resourceMan;\n        \n        private static global::System.Globalization.CultureInfo resourceCulture;\n        \n        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        internal Resources() {\n        }\n        \n        /// <summary>\n        ///   Returns the cached ResourceManager instance used by this class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Resources.ResourceManager ResourceManager {\n            get {\n                if (object.ReferenceEquals(resourceMan, null)) {\n                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"Prism.Properties.Resources\", typeof(Resources).Assembly);\n                    resourceMan = temp;\n                }\n                return resourceMan;\n            }\n        }\n        \n        /// <summary>\n        ///   Overrides the current thread's CurrentUICulture property for all\n        ///   resource lookups using this strongly typed resource class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Globalization.CultureInfo Culture {\n            get {\n                return resourceCulture;\n            }\n            set {\n                resourceCulture = value;\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The object must be of type &apos;{0}&apos; in order to use the current region adapter..\n        /// </summary>\n        internal static string AdapterInvalidTypeException {\n            get {\n                return ResourceManager.GetString(\"AdapterInvalidTypeException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Cannot change the region name once is set. The current region name is &apos;{0}&apos;..\n        /// </summary>\n        internal static string CannotChangeRegionNameException {\n            get {\n                return ResourceManager.GetString(\"CannotChangeRegionNameException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Cannot create navigation target &apos;{0}&apos;..\n        /// </summary>\n        internal static string CannotCreateNavigationTarget {\n            get {\n                return ResourceManager.GetString(\"CannotCreateNavigationTarget\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Type &apos;{0}&apos; does not implement from IRegionBehavior..\n        /// </summary>\n        internal static string CanOnlyAddTypesThatInheritIFromRegionBehavior {\n            get {\n                return ResourceManager.GetString(\"CanOnlyAddTypesThatInheritIFromRegionBehavior\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The ConfigurationStore cannot contain a null value. .\n        /// </summary>\n        internal static string ConfigurationStoreCannotBeNull {\n            get {\n                return ResourceManager.GetString(\"ConfigurationStoreCannotBeNull\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to ContentControl&apos;s Content property is not empty. \n        ///    This control is being associated with a region, but the control is already bound to something else. \n        ///    If you did not explicitly set the control&apos;s Content property, \n        ///    this exception may be caused by a change in the value of the inherited RegionManager attached property..\n        /// </summary>\n        internal static string ContentControlHasContentException {\n            get {\n                return ResourceManager.GetString(\"ContentControlHasContentException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Deactivation is not possible in this type of region..\n        /// </summary>\n        internal static string DeactiveNotPossibleException {\n            get {\n                return ResourceManager.GetString(\"DeactiveNotPossibleException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to {1}: {2}. Priority: {3}. Timestamp:{0:u}..\n        /// </summary>\n        internal static string DefaultTextLoggerPattern {\n            get {\n                return ResourceManager.GetString(\"DefaultTextLoggerPattern\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Neither the executeMethod nor the canExecuteMethod delegates can be null..\n        /// </summary>\n        internal static string DelegateCommandDelegatesCannotBeNull {\n            get {\n                return ResourceManager.GetString(\"DelegateCommandDelegatesCannotBeNull\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to T for DelegateCommand&lt;T&gt; is not an object nor Nullable..\n        /// </summary>\n        internal static string DelegateCommandInvalidGenericPayloadType {\n            get {\n                return ResourceManager.GetString(\"DelegateCommandInvalidGenericPayloadType\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Directory {0} was not found..\n        /// </summary>\n        internal static string DirectoryNotFound {\n            get {\n                return ResourceManager.GetString(\"DirectoryNotFound\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to A duplicated module group with name {0} has been found by the loader..\n        /// </summary>\n        internal static string DuplicatedModuleGroup {\n            get {\n                return ResourceManager.GetString(\"DuplicatedModuleGroup\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Unable to retrieve the module type {0} from the loaded assemblies.  You may need to specify a more fully-qualified type name..\n        /// </summary>\n        internal static string FailedToGetType {\n            get {\n                return ResourceManager.GetString(\"FailedToGetType\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to HostControl cannot have null value when behavior attaches. .\n        /// </summary>\n        internal static string HostControlCannotBeNull {\n            get {\n                return ResourceManager.GetString(\"HostControlCannotBeNull\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The HostControl property cannot be set after Attach method has been called..\n        /// </summary>\n        internal static string HostControlCannotBeSetAfterAttach {\n            get {\n                return ResourceManager.GetString(\"HostControlCannotBeSetAfterAttach\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to HostControl type must be a TabControl..\n        /// </summary>\n        internal static string HostControlMustBeATabControl {\n            get {\n                return ResourceManager.GetString(\"HostControlMustBeATabControl\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The IModuleEnumerator interface is no longer used and has been replaced by ModuleCatalog..\n        /// </summary>\n        internal static string IEnumeratorObsolete {\n            get {\n                return ResourceManager.GetString(\"IEnumeratorObsolete\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The argument must be a valid absolute Uri to an assembly file..\n        /// </summary>\n        internal static string InvalidArgumentAssemblyUri {\n            get {\n                return ResourceManager.GetString(\"InvalidArgumentAssemblyUri\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The Target of the IDelegateReference should be of type {0}..\n        /// </summary>\n        internal static string InvalidDelegateRerefenceTypeException {\n            get {\n                return ResourceManager.GetString(\"InvalidDelegateRerefenceTypeException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to ItemsControl&apos;s ItemsSource property is not empty. \n        ///    This control is being associated with a region, but the control is already bound to something else. \n        ///    If you did not explicitly set the control&apos;s ItemSource property, \n        ///    this exception may be caused by a change in the value of the inherited RegionManager attached property..\n        /// </summary>\n        internal static string ItemsControlHasItemsSourceException {\n            get {\n                return ResourceManager.GetString(\"ItemsControlHasItemsSourceException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Mapping with the given type is already registered: {0}..\n        /// </summary>\n        internal static string MappingExistsException {\n            get {\n                return ResourceManager.GetString(\"MappingExistsException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Module {0} was not found in the catalog..\n        /// </summary>\n        internal static string ModuleNotFound {\n            get {\n                return ResourceManager.GetString(\"ModuleNotFound\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The ModulePath cannot contain a null value or be empty.\n        /// </summary>\n        internal static string ModulePathCannotBeNullOrEmpty {\n            get {\n                return ResourceManager.GetString(\"ModulePathCannotBeNullOrEmpty\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Failed to load type &apos;{0}&apos; from assembly &apos;{1}&apos;..\n        /// </summary>\n        internal static string ModuleTypeNotFound {\n            get {\n                return ResourceManager.GetString(\"ModuleTypeNotFound\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The ModuleCatalog must implement IModuleGroupCatalog to add groups.\n        /// </summary>\n        internal static string MustBeModuleGroupCatalog {\n            get {\n                return ResourceManager.GetString(\"MustBeModuleGroupCatalog\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Navigation is already in progress on region with name &apos;{0}&apos;..\n        /// </summary>\n        internal static string NavigationInProgress {\n            get {\n                return ResourceManager.GetString(\"NavigationInProgress\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Navigation cannot proceed until a region is set for the RegionNavigationService..\n        /// </summary>\n        internal static string NavigationServiceHasNoRegion {\n            get {\n                return ResourceManager.GetString(\"NavigationServiceHasNoRegion\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The IRegionAdapter for the type {0} is not registered in the region adapter mappings. You can register an IRegionAdapter for this control by overriding the ConfigureRegionAdapterMappings method in the bootstrapper..\n        /// </summary>\n        internal static string NoRegionAdapterException {\n            get {\n                return ResourceManager.GetString(\"NoRegionAdapterException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to There is currently no moduleTypeLoader in the ModuleManager that can retrieve the specified module..\n        /// </summary>\n        internal static string NoRetrieverCanRetrieveModule {\n            get {\n                return ResourceManager.GetString(\"NoRetrieverCanRetrieveModule\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to An exception has occurred while trying to add a view to region &apos;{0}&apos;. \n        ///    - The most likely causing exception was was: &apos;{1}&apos;.\n        ///    But also check the InnerExceptions for more detail or call .GetRootException(). .\n        /// </summary>\n        internal static string OnViewRegisteredException {\n            get {\n                return ResourceManager.GetString(\"OnViewRegisteredException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The member access expression does not access a property..\n        /// </summary>\n        internal static string PropertySupport_ExpressionNotProperty_Exception {\n            get {\n                return ResourceManager.GetString(\"PropertySupport_ExpressionNotProperty_Exception\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The expression is not a member access expression..\n        /// </summary>\n        internal static string PropertySupport_NotMemberAccessExpression_Exception {\n            get {\n                return ResourceManager.GetString(\"PropertySupport_NotMemberAccessExpression_Exception\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The referenced property is a static property..\n        /// </summary>\n        internal static string PropertySupport_StaticExpression_Exception {\n            get {\n                return ResourceManager.GetString(\"PropertySupport_StaticExpression_Exception\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The Attach method cannot be called when Region property is null..\n        /// </summary>\n        internal static string RegionBehaviorAttachCannotBeCallWithNullRegion {\n            get {\n                return ResourceManager.GetString(\"RegionBehaviorAttachCannotBeCallWithNullRegion\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The Region property cannot be set after Attach method has been called..\n        /// </summary>\n        internal static string RegionBehaviorRegionCannotBeSetAfterAttach {\n            get {\n                return ResourceManager.GetString(\"RegionBehaviorRegionCannotBeSetAfterAttach\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to An exception occurred while creating a region with name &apos;{0}&apos;. The exception was: {1}. .\n        /// </summary>\n        internal static string RegionCreationException {\n            get {\n                return ResourceManager.GetString(\"RegionCreationException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The region being added already has a name of &apos;{0}&apos; and cannot be added to the region manager with a different name (&apos;{1}&apos;)..\n        /// </summary>\n        internal static string RegionManagerWithDifferentNameException {\n            get {\n                return ResourceManager.GetString(\"RegionManagerWithDifferentNameException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The region name cannot be null or empty..\n        /// </summary>\n        internal static string RegionNameCannotBeEmptyException {\n            get {\n                return ResourceManager.GetString(\"RegionNameCannotBeEmptyException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Region with the given name is already registered: {0}.\n        /// </summary>\n        internal static string RegionNameExistsException {\n            get {\n                return ResourceManager.GetString(\"RegionNameExistsException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to This RegionManager does not contain a Region with the name &apos;{0}&apos;..\n        /// </summary>\n        internal static string RegionNotFound {\n            get {\n                return ResourceManager.GetString(\"RegionNotFound\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The region manager does not contain the {0} region..\n        /// </summary>\n        internal static string RegionNotInRegionManagerException {\n            get {\n                return ResourceManager.GetString(\"RegionNotInRegionManagerException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to View already exists in region..\n        /// </summary>\n        internal static string RegionViewExistsException {\n            get {\n                return ResourceManager.GetString(\"RegionViewExistsException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to View with name &apos;{0}&apos; already exists in the region..\n        /// </summary>\n        internal static string RegionViewNameExistsException {\n            get {\n                return ResourceManager.GetString(\"RegionViewNameExistsException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The provided String argument {0} must not be null or empty..\n        /// </summary>\n        internal static string StringCannotBeNullOrEmpty {\n            get {\n                return ResourceManager.GetString(\"StringCannotBeNullOrEmpty\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The provided String argument {0} must not be null or empty..\n        /// </summary>\n        internal static string StringCannotBeNullOrEmpty1 {\n            get {\n                return ResourceManager.GetString(\"StringCannotBeNullOrEmpty1\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to No BehaviorType with key &apos;{0}&apos; was registered..\n        /// </summary>\n        internal static string TypeWithKeyNotRegistered {\n            get {\n                return ResourceManager.GetString(\"TypeWithKeyNotRegistered\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to An exception occurred while trying to create region objects. \n        ///    - The most likely causing exception was: &apos;{0}&apos;.\n        ///    But also check the InnerExceptions for more detail or call .GetRootException(). .\n        /// </summary>\n        internal static string UpdateRegionException {\n            get {\n                return ResourceManager.GetString(\"UpdateRegionException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The value must be of type ModuleInfo..\n        /// </summary>\n        internal static string ValueMustBeOfTypeModuleInfo {\n            get {\n                return ResourceManager.GetString(\"ValueMustBeOfTypeModuleInfo\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to {0} not found..\n        /// </summary>\n        internal static string ValueNotFound {\n            get {\n                return ResourceManager.GetString(\"ValueNotFound\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The region does not contain the specified view..\n        /// </summary>\n        internal static string ViewNotInRegionException {\n            get {\n                return ResourceManager.GetString(\"ViewNotInRegionException\", resourceCulture);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Avalonia/Prism.Avalonia/Properties/Resources.resx",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <data name=\"AdapterInvalidTypeException\" xml:space=\"preserve\">\n    <value>The object must be of type '{0}' in order to use the current region adapter.</value>\n  </data>\n  <data name=\"CannotChangeRegionNameException\" xml:space=\"preserve\">\n    <value>Cannot change the region name once is set. The current region name is '{0}'.</value>\n  </data>\n  <data name=\"CannotCreateNavigationTarget\" xml:space=\"preserve\">\n    <value>Cannot create navigation target '{0}'.</value>\n  </data>\n  <data name=\"CanOnlyAddTypesThatInheritIFromRegionBehavior\" xml:space=\"preserve\">\n    <value>Type '{0}' does not implement from IRegionBehavior.</value>\n  </data>\n  <data name=\"ConfigurationStoreCannotBeNull\" xml:space=\"preserve\">\n    <value>The ConfigurationStore cannot contain a null value. </value>\n  </data>\n  <data name=\"ContentControlHasContentException\" xml:space=\"preserve\">\n    <value>ContentControl's Content property is not empty. \n    This control is being associated with a region, but the control is already bound to something else. \n    If you did not explicitly set the control's Content property, \n    this exception may be caused by a change in the value of the inherited RegionManager attached property.</value>\n  </data>\n  <data name=\"DeactiveNotPossibleException\" xml:space=\"preserve\">\n    <value>Deactivation is not possible in this type of region.</value>\n  </data>\n  <data name=\"DefaultTextLoggerPattern\" xml:space=\"preserve\">\n    <value>{1}: {2}. Priority: {3}. Timestamp:{0:u}.</value>\n  </data>\n  <data name=\"DelegateCommandDelegatesCannotBeNull\" xml:space=\"preserve\">\n    <value>Neither the executeMethod nor the canExecuteMethod delegates can be null.</value>\n  </data>\n  <data name=\"DelegateCommandInvalidGenericPayloadType\" xml:space=\"preserve\">\n    <value>T for DelegateCommand&lt;T&gt; is not an object nor Nullable.</value>\n  </data>\n  <data name=\"DirectoryNotFound\" xml:space=\"preserve\">\n    <value>Directory {0} was not found.</value>\n  </data>\n  <data name=\"DuplicatedModuleGroup\" xml:space=\"preserve\">\n    <value>A duplicated module group with name {0} has been found by the loader.</value>\n  </data>\n  <data name=\"FailedToGetType\" xml:space=\"preserve\">\n    <value>Unable to retrieve the module type {0} from the loaded assemblies.  You may need to specify a more fully-qualified type name.</value>\n  </data>\n  <data name=\"HostControlCannotBeNull\" xml:space=\"preserve\">\n    <value>HostControl cannot have null value when behavior attaches. </value>\n  </data>\n  <data name=\"HostControlCannotBeSetAfterAttach\" xml:space=\"preserve\">\n    <value>The HostControl property cannot be set after Attach method has been called.</value>\n  </data>\n  <data name=\"HostControlMustBeATabControl\" xml:space=\"preserve\">\n    <value>HostControl type must be a TabControl.</value>\n  </data>\n  <data name=\"IEnumeratorObsolete\" xml:space=\"preserve\">\n    <value>The IModuleEnumerator interface is no longer used and has been replaced by ModuleCatalog.</value>\n  </data>\n  <data name=\"InvalidArgumentAssemblyUri\" xml:space=\"preserve\">\n    <value>The argument must be a valid absolute Uri to an assembly file.</value>\n  </data>\n  <data name=\"InvalidDelegateRerefenceTypeException\" xml:space=\"preserve\">\n    <value>The Target of the IDelegateReference should be of type {0}.</value>\n  </data>\n  <data name=\"ItemsControlHasItemsSourceException\" xml:space=\"preserve\">\n    <value>ItemsControl's ItemsSource property is not empty. \n    This control is being associated with a region, but the control is already bound to something else. \n    If you did not explicitly set the control's ItemSource property, \n    this exception may be caused by a change in the value of the inherited RegionManager attached property.</value>\n  </data>\n  <data name=\"MappingExistsException\" xml:space=\"preserve\">\n    <value>Mapping with the given type is already registered: {0}.</value>\n  </data>\n  <data name=\"ModuleNotFound\" xml:space=\"preserve\">\n    <value>Module {0} was not found in the catalog.</value>\n  </data>\n  <data name=\"ModulePathCannotBeNullOrEmpty\" xml:space=\"preserve\">\n    <value>The ModulePath cannot contain a null value or be empty</value>\n  </data>\n  <data name=\"ModuleTypeNotFound\" xml:space=\"preserve\">\n    <value>Failed to load type '{0}' from assembly '{1}'.</value>\n  </data>\n  <data name=\"NavigationInProgress\" xml:space=\"preserve\">\n    <value>Navigation is already in progress on region with name '{0}'.</value>\n  </data>\n  <data name=\"NavigationServiceHasNoRegion\" xml:space=\"preserve\">\n    <value>Navigation cannot proceed until a region is set for the RegionNavigationService.</value>\n  </data>\n  <data name=\"NoRegionAdapterException\" xml:space=\"preserve\">\n    <value>The IRegionAdapter for the type {0} is not registered in the region adapter mappings. You can register an IRegionAdapter for this control by overriding the ConfigureRegionAdapterMappings method in the bootstrapper.</value>\n  </data>\n  <data name=\"NoRetrieverCanRetrieveModule\" xml:space=\"preserve\">\n    <value>There is currently no moduleTypeLoader in the ModuleManager that can retrieve the specified module.</value>\n  </data>\n  <data name=\"OnViewRegisteredException\" xml:space=\"preserve\">\n    <value>An exception has occurred while trying to add a view to region '{0}'. \n    - The most likely causing exception was was: '{1}'.\n    But also check the InnerExceptions for more detail or call .GetRootException(). </value>\n  </data>\n  <data name=\"PropertySupport_ExpressionNotProperty_Exception\" xml:space=\"preserve\">\n    <value>The member access expression does not access a property.</value>\n  </data>\n  <data name=\"PropertySupport_NotMemberAccessExpression_Exception\" xml:space=\"preserve\">\n    <value>The expression is not a member access expression.</value>\n  </data>\n  <data name=\"PropertySupport_StaticExpression_Exception\" xml:space=\"preserve\">\n    <value>The referenced property is a static property.</value>\n  </data>\n  <data name=\"RegionBehaviorAttachCannotBeCallWithNullRegion\" xml:space=\"preserve\">\n    <value>The Attach method cannot be called when Region property is null.</value>\n  </data>\n  <data name=\"RegionBehaviorRegionCannotBeSetAfterAttach\" xml:space=\"preserve\">\n    <value>The Region property cannot be set after Attach method has been called.</value>\n  </data>\n  <data name=\"RegionCreationException\" xml:space=\"preserve\">\n    <value>An exception occurred while creating a region with name '{0}'. The exception was: {1}. </value>\n  </data>\n  <data name=\"RegionManagerWithDifferentNameException\" xml:space=\"preserve\">\n    <value>The region being added already has a name of '{0}' and cannot be added to the region manager with a different name ('{1}').</value>\n  </data>\n  <data name=\"RegionNameCannotBeEmptyException\" xml:space=\"preserve\">\n    <value>The region name cannot be null or empty.</value>\n  </data>\n  <data name=\"RegionNameExistsException\" xml:space=\"preserve\">\n    <value>Region with the given name is already registered: {0}</value>\n  </data>\n  <data name=\"RegionNotFound\" xml:space=\"preserve\">\n    <value>This RegionManager does not contain a Region with the name '{0}'.</value>\n  </data>\n  <data name=\"RegionNotInRegionManagerException\" xml:space=\"preserve\">\n    <value>The region manager does not contain the {0} region.</value>\n  </data>\n  <data name=\"RegionViewExistsException\" xml:space=\"preserve\">\n    <value>View already exists in region.</value>\n  </data>\n  <data name=\"RegionViewNameExistsException\" xml:space=\"preserve\">\n    <value>View with name '{0}' already exists in the region.</value>\n  </data>\n  <data name=\"StringCannotBeNullOrEmpty\" xml:space=\"preserve\">\n    <value>The provided String argument {0} must not be null or empty.</value>\n  </data>\n  <data name=\"StringCannotBeNullOrEmpty1\" xml:space=\"preserve\">\n    <value>The provided String argument {0} must not be null or empty.</value>\n  </data>\n  <data name=\"TypeWithKeyNotRegistered\" xml:space=\"preserve\">\n    <value>No BehaviorType with key '{0}' was registered.</value>\n  </data>\n  <data name=\"UpdateRegionException\" xml:space=\"preserve\">\n    <value>An exception occurred while trying to create region objects. \n    - The most likely causing exception was: '{0}'.\n    But also check the InnerExceptions for more detail or call .GetRootException(). </value>\n  </data>\n  <data name=\"ValueMustBeOfTypeModuleInfo\" xml:space=\"preserve\">\n    <value>The value must be of type ModuleInfo.</value>\n  </data>\n  <data name=\"ValueNotFound\" xml:space=\"preserve\">\n    <value>{0} not found.</value>\n  </data>\n  <data name=\"ViewNotInRegionException\" xml:space=\"preserve\">\n    <value>The region does not contain the specified view.</value>\n  </data>\n  <data name=\"MustBeModuleGroupCatalog\" xml:space=\"preserve\">\n    <value>The ModuleCatalog must implement IModuleGroupCatalog to add groups</value>\n  </data>\n</root>"
  },
  {
    "path": "src/Avalonia/Prism.Avalonia/Properties/Settings.Designer.cs",
    "content": "//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.0\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace Prism.Properties {\n    \n    \n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator\", \"12.0.0.0\")]\n    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {\n        \n        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));\n        \n        public static Settings Default {\n            get {\n                return defaultInstance;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Avalonia/Prism.Avalonia/Properties/Settings.settings",
    "content": "<?xml version='1.0' encoding='utf-8'?>\n<SettingsFile xmlns=\"uri:settings\" CurrentProfile=\"(Default)\">\n  <Profiles>\n    <Profile Name=\"(Default)\" />\n  </Profiles>\n  <Settings />\n</SettingsFile>"
  },
  {
    "path": "src/Avalonia/Prism.DryIoc.Avalonia/Prism.DryIoc.Avalonia.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <RootNamespace>Prism.DryIoc</RootNamespace>\n    <TargetFrameworks>net9.0;net10.0</TargetFrameworks>\n    <Description>This extension is used to build Prism.Avalonia applications based on DryIoc. Users must install the Prism.Avalonia NuGet package as well.</Description>\n    <Title>Prism.DryIoc.Avalonia</Title>\n    <PackageReadmeFile>README.md</PackageReadmeFile>\n    <PackageTags>prism;mvvm;xaml;avalonia;dryioc;dependencyinjection;navigation;dialog;prismavalonia;</PackageTags>\n    <PackageIcon>Prism.Avalonia.png</PackageIcon>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <None Include=\"..\\..\\..\\images\\Prism.Avalonia.png\">\n      <Pack>True</Pack>\n      <PackagePath>\\</PackagePath>\n    </None>\n    <None Include=\"..\\..\\..\\README.md\">\n      <Pack>True</Pack>\n      <PackagePath>\\</PackagePath>\n    </None>\n  </ItemGroup>\n\n  <ItemGroup>\n    <Compile Update=\"Properties\\Resources.Designer.cs\">\n      <DesignTime>True</DesignTime>\n      <AutoGen>True</AutoGen>\n      <DependentUpon>Resources.resx</DependentUpon>\n    </Compile>\n  </ItemGroup>\n\n  <ItemGroup>\n    <EmbeddedResource Update=\"Properties\\Resources.resx\">\n      <Generator>PublicResXFileCodeGenerator</Generator>\n      <LastGenOutput>Resources.Designer.cs</LastGenOutput>\n    </EmbeddedResource>\n  </ItemGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Avalonia\" />\n    <PackageReference Include=\"Avalonia.Markup.Xaml.Loader\" />\n    <PackageReference Include=\"Prism.Container.DryIoc\" />\n\n    <ProjectReference Include=\"..\\..\\Prism.Core\\Prism.Core.csproj\" />\n    <ProjectReference Include=\"..\\Prism.Avalonia\\Prism.Avalonia.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <Compile Include=\"..\\..\\Wpf\\Prism.DryIoc.Wpf\\GlobalSuppressions.cs\" LinkBase=\"\" />\n    <Compile Include=\"..\\..\\Wpf\\Prism.DryIoc.Wpf\\PrismApplication.cs\" LinkBase=\"\" />\n    <Compile Include=\"..\\..\\Wpf\\Prism.DryIoc.Wpf\\PrismBootstrapper.cs\" LinkBase=\"\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "src/Avalonia/Prism.DryIoc.Avalonia/Properties/AssemblyInfo.cs",
    "content": "using System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\nusing Avalonia.Metadata;\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n[assembly: XmlnsDefinition(\"http://prismlibrary.com/\", \"Prism.DryIoc\")]\n[assembly: InternalsVisibleTo(\"Prism.DryIoc.Avalonia.Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001008f34b619d7a39e44cebe5ccbd5607eaa0784c9c124431ba336a14e4fecd874f151b57163961505e76943910c7cabea9c7229edc3553dfc33ac7b269087e5cef9404bdb491907ffd9f9b26d737fa2c359620a2cbf2802f54118471d7c0ead3b95c916783dd4b99b9b1a0cd2785e1b5d614d3d9140a60c8c64c217e1c2b0ec8296\")]\n"
  },
  {
    "path": "src/Avalonia/Prism.DryIoc.Avalonia/Properties/Resources.Designer.cs",
    "content": "//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.42000\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace Prism.DryIoc.Properties {\n    using System;\n    \n    \n    /// <summary>\n    ///   A strongly-typed resource class, for looking up localized strings, etc.\n    /// </summary>\n    // This class was auto-generated by the StronglyTypedResourceBuilder\n    // class via a tool like ResGen or Visual Studio.\n    // To add or remove a member, edit your .ResX file then rerun ResGen\n    // with the /str option, or rebuild your VS project.\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"16.0.0.0\")]\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    public class Resources {\n        \n        private static global::System.Resources.ResourceManager resourceMan;\n        \n        private static global::System.Globalization.CultureInfo resourceCulture;\n        \n        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        internal Resources() {\n        }\n        \n        /// <summary>\n        ///   Returns the cached ResourceManager instance used by this class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        public static global::System.Resources.ResourceManager ResourceManager {\n            get {\n                if (object.ReferenceEquals(resourceMan, null)) {\n                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"Prism.DryIoc.Properties.Resources\", typeof(Resources).Assembly);\n                    resourceMan = temp;\n                }\n                return resourceMan;\n            }\n        }\n        \n        /// <summary>\n        ///   Overrides the current thread's CurrentUICulture property for all\n        ///   resource lookups using this strongly typed resource class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        public static global::System.Globalization.CultureInfo Culture {\n            get {\n                return resourceCulture;\n            }\n            set {\n                resourceCulture = value;\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to a.\n        /// </summary>\n        public static string a {\n            get {\n                return ResourceManager.GetString(\"a\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Bootstrapper sequence completed..\n        /// </summary>\n        public static string BootstrapperSequenceCompleted {\n            get {\n                return ResourceManager.GetString(\"BootstrapperSequenceCompleted\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Configuring default region behaviors..\n        /// </summary>\n        public static string ConfiguringDefaultRegionBehaviors {\n            get {\n                return ResourceManager.GetString(\"ConfiguringDefaultRegionBehaviors\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Configuring the DryIoc container..\n        /// </summary>\n        public static string ConfiguringDryIocContainer {\n            get {\n                return ResourceManager.GetString(\"ConfiguringDryIocContainer\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Configuring module catalog..\n        /// </summary>\n        public static string ConfiguringModuleCatalog {\n            get {\n                return ResourceManager.GetString(\"ConfiguringModuleCatalog\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Configuring region adapters..\n        /// </summary>\n        public static string ConfiguringRegionAdapters {\n            get {\n                return ResourceManager.GetString(\"ConfiguringRegionAdapters\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Configuring ServiceLocator singleton..\n        /// </summary>\n        public static string ConfiguringServiceLocatorSingleton {\n            get {\n                return ResourceManager.GetString(\"ConfiguringServiceLocatorSingleton\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Configuring the ViewModelLocator to use DryIoc..\n        /// </summary>\n        public static string ConfiguringViewModelLocator {\n            get {\n                return ResourceManager.GetString(\"ConfiguringViewModelLocator\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Creating DryIoc container..\n        /// </summary>\n        public static string CreatingDryIocContainer {\n            get {\n                return ResourceManager.GetString(\"CreatingDryIocContainer\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Creating module catalog..\n        /// </summary>\n        public static string CreatingModuleCatalog {\n            get {\n                return ResourceManager.GetString(\"CreatingModuleCatalog\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Creating the shell..\n        /// </summary>\n        public static string CreatingShell {\n            get {\n                return ResourceManager.GetString(\"CreatingShell\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Initializing modules..\n        /// </summary>\n        public static string InitializingModules {\n            get {\n                return ResourceManager.GetString(\"InitializingModules\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Initializing the shell..\n        /// </summary>\n        public static string InitializingShell {\n            get {\n                return ResourceManager.GetString(\"InitializingShell\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Logger was created successfully..\n        /// </summary>\n        public static string LoggerCreatedSuccessfully {\n            get {\n                return ResourceManager.GetString(\"LoggerCreatedSuccessfully\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The method &apos;GetModuleEnumerator&apos; of the bootstrapper must be overwritten in order to use the default module initialization logic..\n        /// </summary>\n        public static string NotOverwrittenGetModuleEnumeratorException {\n            get {\n                return ResourceManager.GetString(\"NotOverwrittenGetModuleEnumeratorException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The ContainerBuilder is required and cannot be null..\n        /// </summary>\n        public static string NullDryIocContainerBuilderException {\n            get {\n                return ResourceManager.GetString(\"NullDryIocContainerBuilderException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The IContainer is required and cannot be null..\n        /// </summary>\n        public static string NullDryIocContainerException {\n            get {\n                return ResourceManager.GetString(\"NullDryIocContainerException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The ILoggerFacade is required and cannot be null..\n        /// </summary>\n        public static string NullLoggerFacadeException {\n            get {\n                return ResourceManager.GetString(\"NullLoggerFacadeException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The IModuleCatalog is required and cannot be null in order to initialize the modules..\n        /// </summary>\n        public static string NullModuleCatalogException {\n            get {\n                return ResourceManager.GetString(\"NullModuleCatalogException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Registering Framework Exception Types..\n        /// </summary>\n        public static string RegisteringFrameworkExceptionTypes {\n            get {\n                return ResourceManager.GetString(\"RegisteringFrameworkExceptionTypes\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Setting the RegionManager..\n        /// </summary>\n        public static string SettingTheRegionManager {\n            get {\n                return ResourceManager.GetString(\"SettingTheRegionManager\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Type &apos;{0}&apos; was already registered by the application. Skipping....\n        /// </summary>\n        public static string TypeMappingAlreadyRegistered {\n            get {\n                return ResourceManager.GetString(\"TypeMappingAlreadyRegistered\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Updating Regions..\n        /// </summary>\n        public static string UpdatingRegions {\n            get {\n                return ResourceManager.GetString(\"UpdatingRegions\", resourceCulture);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Avalonia/Prism.DryIoc.Avalonia/Properties/Resources.resx",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <data name=\"a\" xml:space=\"preserve\">\n    <value>a</value>\n  </data>\n  <data name=\"BootstrapperSequenceCompleted\" xml:space=\"preserve\">\n    <value>Bootstrapper sequence completed.</value>\n  </data>\n  <data name=\"ConfiguringDefaultRegionBehaviors\" xml:space=\"preserve\">\n    <value>Configuring default region behaviors.</value>\n  </data>\n  <data name=\"ConfiguringDryIocContainer\" xml:space=\"preserve\">\n    <value>Configuring the DryIoc container.</value>\n  </data>\n  <data name=\"ConfiguringModuleCatalog\" xml:space=\"preserve\">\n    <value>Configuring module catalog.</value>\n  </data>\n  <data name=\"ConfiguringRegionAdapters\" xml:space=\"preserve\">\n    <value>Configuring region adapters.</value>\n  </data>\n  <data name=\"ConfiguringServiceLocatorSingleton\" xml:space=\"preserve\">\n    <value>Configuring ServiceLocator singleton.</value>\n  </data>\n  <data name=\"ConfiguringViewModelLocator\" xml:space=\"preserve\">\n    <value>Configuring the ViewModelLocator to use DryIoc.</value>\n  </data>\n  <data name=\"CreatingDryIocContainer\" xml:space=\"preserve\">\n    <value>Creating DryIoc container.</value>\n  </data>\n  <data name=\"CreatingModuleCatalog\" xml:space=\"preserve\">\n    <value>Creating module catalog.</value>\n  </data>\n  <data name=\"CreatingShell\" xml:space=\"preserve\">\n    <value>Creating the shell.</value>\n  </data>\n  <data name=\"InitializingModules\" xml:space=\"preserve\">\n    <value>Initializing modules.</value>\n  </data>\n  <data name=\"InitializingShell\" xml:space=\"preserve\">\n    <value>Initializing the shell.</value>\n  </data>\n  <data name=\"LoggerCreatedSuccessfully\" xml:space=\"preserve\">\n    <value>Logger was created successfully.</value>\n  </data>\n  <data name=\"NotOverwrittenGetModuleEnumeratorException\" xml:space=\"preserve\">\n    <value>The method 'GetModuleEnumerator' of the bootstrapper must be overwritten in order to use the default module initialization logic.</value>\n  </data>\n  <data name=\"NullDryIocContainerBuilderException\" xml:space=\"preserve\">\n    <value>The ContainerBuilder is required and cannot be null.</value>\n  </data>\n  <data name=\"NullDryIocContainerException\" xml:space=\"preserve\">\n    <value>The IContainer is required and cannot be null.</value>\n  </data>\n  <data name=\"NullLoggerFacadeException\" xml:space=\"preserve\">\n    <value>The ILoggerFacade is required and cannot be null.</value>\n  </data>\n  <data name=\"NullModuleCatalogException\" xml:space=\"preserve\">\n    <value>The IModuleCatalog is required and cannot be null in order to initialize the modules.</value>\n  </data>\n  <data name=\"RegisteringFrameworkExceptionTypes\" xml:space=\"preserve\">\n    <value>Registering Framework Exception Types.</value>\n  </data>\n  <data name=\"SettingTheRegionManager\" xml:space=\"preserve\">\n    <value>Setting the RegionManager.</value>\n  </data>\n  <data name=\"TypeMappingAlreadyRegistered\" xml:space=\"preserve\">\n    <value>Type '{0}' was already registered by the application. Skipping...</value>\n  </data>\n  <data name=\"UpdatingRegions\" xml:space=\"preserve\">\n    <value>Updating Regions.</value>\n  </data>\n</root>"
  },
  {
    "path": "src/Avalonia/Prism.DryIoc.Avalonia/build/Package.targets",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<Project>\n  <ItemGroup Condition=\" '$(ImplicitUsings)' == 'true' OR '$(ImplicitUsings)' == 'enable' \">\n    <Using Include=\"DryIoc\" />\n    <Using Include=\"Prism.DryIoc\" />\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": "src/Avalonia/ReadMe.md",
    "content": "\nThank you for installing Prism.Avalonia v9.0!\n\n## Help Support Prism\n\nWhile Prism.Avalonia is, and will continue to be totally free to download, Open Source is not free. If you or your company have the resources, please consider becoming a GitHub Sponsor. GitHub Sponsorships help to make Open Source Development more sustainable.\n\n## Support & FAQ\n\n1) Support: Prism is distributed under the MIT License this means \"AS IS\", WITHOUT WARRANTY OF ANY KIND. If you require code level support, architectural guidance, or custom builds of Prism, please reach out at https://github.com/PrismLibrary/Prism to inquire about Enterprise support options.\n\n2) Community Support: GitHub issues are not the place to ask questions, these are reserved for feature requests and legitimate bug reports. You are free to ask questions on Stack Overflow however the Prism team does not monitor questions posted there. We do encourage you to post questions using GitHub Discussions on the main Prism repo. If you see a question that you know the answer to please pay it forward and help other developers that may just be starting out. https://github.com/PrismLibrary/Prism/discussions\n\n3) Reporting Bugs: If you believe you have encountered a bug, please be sure to search the open and closed issues as you may find the issue has already been fixed as and is awaiting release. If you find that you have a new issue, please create a new project that focuses on ONLY the necessary steps to reproduce the issue you are facing. Issues that are opened which do not have a sample app reproducing the issue will be closed. In addition to this being required by the Prism team, this is just good etiquette for any Open Source project. Additionally we ask that you do not try to be an Archaeologist, trying to comment on PR's, commits and issues from long ago, if there is a legitimate issue, open a new issue referencing what you need to reference. Archaeologists will be ignored.\n\n4) Samples: Currently the Prism.Avalonia team maintains a wide variety of samples for Avalonia. If you would like to help give back, and help build out a sample(s) repo please contact the Prism.Avalonia team via the GitHub Discussions forum.\n"
  },
  {
    "path": "src/Directory.Build.props",
    "content": "<Project>\n  <Import Project=\"..\\Directory.Build.props\" />\n\n  <PropertyGroup>\n    <IsPackable>true</IsPackable>\n    <IsPackable Condition=\" '$(IsCoreProject)' \">!$(DisableCorePublish)</IsPackable>\n    <IsPackable Condition=\" '$(IsWpfProject)' \">!$(DisableWpfPublish)</IsPackable>\n    <IsPackable Condition=\" '$(IsFormsProject)' \">!$(DisableFormsPublish)</IsPackable>\n    <IsPackable Condition=\" '$(IsUnoProject)' \">!$(DisableUnoPublish)</IsPackable>\n    <ContinuousIntegrationBuild Condition=\"'$(BUILD_BUILDID)' != ''\">true</ContinuousIntegrationBuild>\n    <ImplicitUsings>enable</ImplicitUsings>\n  </PropertyGroup>\n\n  <Choose>\n    <When Condition=\" $(IsUnoProject) AND '$(TargetFramework)' == 'net8.0' \">\n      <PropertyGroup>\n        <DefineConstants>$(DefineConstants);__WASM__</DefineConstants>\n      </PropertyGroup>\n      <ItemGroup>\n        <EmbeddedResource Include=\"LinkerDefinition.mono.xml\" Condition=\"Exists('LinkerDefinition.mono.xml')\">\n          <LogicalName>$(AssemblyName).xml</LogicalName>\n        </EmbeddedResource>\n      </ItemGroup>\n    </When>\n  </Choose>\n\n  <PropertyGroup Condition=\" $(IsUnoProject) \">\n    <UnoTargetFrameworks>net9.0;net9.0-android;net9.0-ios;net9.0-tvos;net9.0-desktop;net9.0-browserwasm</UnoTargetFrameworks>\n    <UnoTargetFrameworks>$(UnoTargetFrameworks);net10.0;net10.0-android;net10.0-ios;net10.0-tvos;net10.0-desktop;net10.0-browserwasm</UnoTargetFrameworks>\n    <UnoTargetFrameworks Condition=\" '$(OS)' == 'Windows_NT' \">$(UnoTargetFrameworks);net9.0-windows10.0.19041;net10.0-windows10.0.19041</UnoTargetFrameworks>\n    <RuntimeIdentifiers Condition=\"$(TargetFramework.Contains('windows10'))\">win-x64;win-x86;win-arm64</RuntimeIdentifiers>\n  </PropertyGroup>\n\n  <PropertyGroup>\n    <GenerateDocumentationFile>true</GenerateDocumentationFile>\n    <GeneratePackageOnBuild>$(IsPackable)</GeneratePackageOnBuild>\n  </PropertyGroup>\n\n  <ItemGroup Condition=\" $(IsPackable) \">\n    <None Include=\"$(PrismPackageIcon)\"\n          Visible=\"False\"\n          Pack=\"True\"\n          PackagePath=\"\" />\n    <None Include=\"$(PrismLicenseFile)\"\n          Visible=\"False\"\n          Pack=\"True\"\n          PackagePath=\"\" />\n    <SourceRoot Include=\"$(NuGetPackageRoot)\"\n                Condition=\"'$(NuGetPackageRoot)' != ''\" />\n  </ItemGroup>\n\n  <!--\n  Adjust the output paths for runtime project in order for those\n  projects to stay in the same folder as the original reference one.\n  -->\n  <PropertyGroup>\n    <_AdjustedOutputProjects>$(_AdjustedOutputProjects);Prism.Uno.csproj</_AdjustedOutputProjects>\n    <_AdjustedOutputProjects>$(_AdjustedOutputProjects);Prism.Uno.WinUI.csproj</_AdjustedOutputProjects>\n    <_AdjustedOutputProjects>$(_AdjustedOutputProjects);Prism.DryIoc.Uno.csproj</_AdjustedOutputProjects>\n    <_AdjustedOutputProjects>$(_AdjustedOutputProjects);Prism.DryIoc.Uno.WinUI.csproj</_AdjustedOutputProjects>\n    <_AdjustedOutputProjects>$(_AdjustedOutputProjects);Prism.Unity.Uno.csproj</_AdjustedOutputProjects>\n    <_AdjustedOutputProjects>$(_AdjustedOutputProjects);Prism.Unity.Uno.WinUI.csproj</_AdjustedOutputProjects>\n  </PropertyGroup>\n\n  <PropertyGroup Condition=\"$(_AdjustedOutputProjects.Contains('$(MSBuildProjectFile)'))\">\n    <BaseOutputPath>bin\\$(MSBuildProjectName)</BaseOutputPath>\n    <BaseIntermediateOutputPath>obj\\$(MSBuildProjectName)</BaseIntermediateOutputPath>\n    <DefaultItemExcludes>$(DefaultItemExcludes);obj/**;bin/**</DefaultItemExcludes>\n  </PropertyGroup>\n</Project>\n"
  },
  {
    "path": "src/Directory.Build.targets",
    "content": "<Project>\n  <Import Project=\"..\\Directory.Build.targets\" />\n\n  <Target Name=\"CopyNuGetReadme\"\n          BeforeTargets=\"Build;CoreCompile\"\n          Condition=\" $(IsPackable) == 'true' \">\n    <Exec Command=\"echo # $(PackageId) > $(IntermediateOutputPath)\\ReadMe.md\"\n          ConsoleToMsBuild=\"true\" />\n\n    <Exec Command=\"type $(MSBuildThisFileDirectory)ReadMe.md >> $(IntermediateOutputPath)\\ReadMe.md\"\n          ConsoleToMsBuild=\"true\"\n          Condition=\"$([MSBuild]::IsOSPlatform('windows'))\" />\n  </Target>\n\n  <Target Name=\"PackNuGetReadMe\"\n          AfterTargets=\"CopyNuGetReadme\"\n          Condition=\"$([MSBuild]::IsOSPlatform('windows'))\">\n    <PropertyGroup>\n      <PackageReadmeFile>ReadMe.md</PackageReadmeFile>\n    </PropertyGroup>\n    <ItemGroup>\n      <None Include=\"$(IntermediateOutputPath)\\ReadMe.md\" PackagePath=\"\\\" Pack=\"true\" />\n    </ItemGroup>\n  </Target>\n\n  <Import Project=\"$(MSBuildThisFileDirectory)winappsdk-workaround.targets\"\n          Condition=\" '$(IsUnoProject)' \" />\n</Project>\n"
  },
  {
    "path": "src/Maui/Prism.DryIoc.Maui/Prism.DryIoc.Maui.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFrameworks>net9.0;net10.0</TargetFrameworks>\n    <GeneratePackageOnBuild>true</GeneratePackageOnBuild>\n    <UseMaui>true</UseMaui>\n    <ImplicitUsings>true</ImplicitUsings>\n    <Description>Prism.DryIoc.Maui provides the implementation of Prism's IContainerExtension using the DryIoc container. This is currently the only supported container for .NET MAUI.</Description>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Prism.Container.DryIoc\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Prism.Maui\\Prism.Maui.csproj\" />\n  </ItemGroup>\n\n  <Choose>\n    <When Condition=\"$(TargetFramework.StartsWith('net9'))\">\n      <ItemGroup>\n        <PackageReference Include=\"Microsoft.Maui.Controls\" VersionOverride=\"9.0.110\" />\n      </ItemGroup>\n    </When>\n    <When Condition=\"$(TargetFramework.StartsWith('net10'))\">\n      <ItemGroup>\n        <PackageReference Include=\"Microsoft.Maui.Controls\" VersionOverride=\"10.0.10\" />\n      </ItemGroup>\n    </When>\n  </Choose>\n\n</Project>\n"
  },
  {
    "path": "src/Maui/Prism.DryIoc.Maui/PrismAppExtensions.cs",
    "content": "﻿using DryIoc;\nusing Prism;\n\nnamespace Microsoft.Maui;\n\n/// <summary>\n/// Application base class using DryIoc\n/// </summary>\npublic static class PrismAppExtensions\n{\n    public static MauiAppBuilder UsePrism(this MauiAppBuilder builder, Action<PrismAppBuilder> configurePrism)\n    {\n        return builder.UsePrism(new DryIocContainerExtension(), configurePrism);\n    }\n\n    public static MauiAppBuilder UsePrism(this MauiAppBuilder builder, Rules rules, Action<PrismAppBuilder> configurePrism)\n    {\n        rules = rules.WithTrackingDisposableTransients()\n            .With(Made.Of(FactoryMethod.ConstructorWithResolvableArguments))\n            .WithFactorySelector(Rules.SelectLastRegisteredFactory());\n        return builder.UsePrism(new DryIocContainerExtension(rules), configurePrism);\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/AppModel/FlowDirection.cs",
    "content": "﻿namespace Prism.AppModel;\n\n/// <summary>\n/// Enumerates values that control the layout direction for views. This maps to\n/// the Microsoft.Maui.Controls.FlowDirection.\n/// </summary>\n/// <remarks>\n/// The following contains a few important points from Right-to-Left Localization.\n/// Developers should consult that document for more information about limitations\n/// of right-to-left support, and for requirements to implement right-to-left support\n/// on various target platforms.\n/// The default value of Microsoft.Maui.Controls.FlowDirection for a visual element that has\n/// no parent is Microsoft.Maui.Controls.FlowDirection.LeftToRight, even on platforms where\n/// Microsoft.Maui.Controls.Device.FlowDirection is Microsoft.Maui.Controls.FlowDirection.RightToLeft.\n/// Therefore, developers must deliberately opt in to right-to-left layout. Developers\n/// can choose right-to-left layout by setting the Microsoft.Maui.Controls.VisualElement.FlowDirection\n/// property of the root element to Microsoft.Maui.Controls.FlowDirection.RightToLeft to choose\n/// right-to-left layout, or to Microsoft.Maui.Controls.FlowDirection.MatchParent to match\n/// the device layout.\n/// </remarks>\npublic enum FlowDirection\n{\n    /// <summary>\n    /// Indicates that the view's layout direction will match the parent view's layout\n    /// direction.\n    /// </summary>\n    MatchParent = 0,\n\n    /// <summary>\n    /// Indicates that view will be laid out left to right. This is the default when\n    /// the view has no parent.\n    /// </summary>\n    LeftToRight = 1,\n\n    /// <summary>\n    /// Indicates that view will be laid out right to left.\n    /// </summary>\n    RightToLeft = 2,\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/AppModel/IApplicationLifecycleAware.cs",
    "content": "﻿namespace Prism.AppModel;\n\n\n/// <summary>\n/// Defines methods for responding to application lifecycle events.\n/// </summary>\npublic interface IApplicationLifecycleAware\n{\n    /// <summary>\n    /// Called when the application resumes from a suspended state.\n    /// </summary>\n    void OnResume();\n\n    /// <summary>\n    /// Called when the application enters a sleep or suspended state.\n    /// </summary>\n    void OnSleep();\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/AppModel/IKeyboardMapper.cs",
    "content": "﻿namespace Prism.AppModel;\n\n/// <summary>\n/// An abstraction to map <see cref=\"KeyboardType\"/> to the <see cref=\"Keyboard\"/>;\n/// </summary>\npublic interface IKeyboardMapper\n{\n    /// <summary>\n    /// Maps the <see cref=\"KeyboardType\"/> to a <see cref=\"Keyboard\"/>\n    /// </summary>\n    /// <param name=\"keyboardType\">The Keyboard type.</param>\n    /// <returns>The <see cref=\"Keyboard\"/>.</returns>\n    Keyboard Map(KeyboardType keyboardType);\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/AppModel/IPageLifecycleAware.cs",
    "content": "﻿namespace Prism.AppModel;\n\n/// <summary>\n/// Interface that defines lifecycle events for pages.\n/// </summary>\npublic interface IPageLifecycleAware\n{\n    /// <summary>\n    /// Called when the page is appearing.\n    /// </summary>\n    void OnAppearing();\n\n    /// <summary>\n    /// Called when the page is disappearing.\n    /// </summary>\n    void OnDisappearing();\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/AppModel/KeyboardMapper.cs",
    "content": "﻿namespace Prism.AppModel;\n\n/// <summary>\n/// The default implementation of the <see cref=\"IKeyboardMapper\"/>.\n/// </summary>\npublic class KeyboardMapper : IKeyboardMapper\n{\n    /// <summary>\n    /// Maps the <see cref=\"KeyboardType\"/> to a <see cref=\"Keyboard\"/>\n    /// </summary>\n    /// <param name=\"keyboardType\">The Keyboard type.</param>\n    /// <returns>The <see cref=\"Keyboard\"/>.</returns>\n    public virtual Keyboard Map(KeyboardType keyboardType)\n    {\n        return keyboardType switch\n        {\n            KeyboardType.Chat => Keyboard.Chat,\n            KeyboardType.Default => Keyboard.Default,\n            KeyboardType.Email => Keyboard.Email,\n            KeyboardType.Numeric => Keyboard.Numeric,\n            KeyboardType.Plain => Keyboard.Plain,\n            KeyboardType.Telephone => Keyboard.Telephone,\n            KeyboardType.Text => Keyboard.Text,\n            KeyboardType.Url => Keyboard.Url,\n            _ => throw new NotImplementedException($\"The Keyboard Type value {keyboardType} is not supported. Please create and register an implementation of IKeyboardMapper to support this value.\")\n        };\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/AppModel/KeyboardType.cs",
    "content": "﻿namespace Prism.AppModel;\n\n/// <summary>\n/// Keyboard type\n/// </summary>\npublic enum KeyboardType\n{\n    /// <summary>\n    /// Gets an instance of type \"ChatKeyboard\".\n    /// </summary>\n    Chat,\n\n    /// <summary>\n    /// Gets an instance of type \"Keyboard\".\n    /// </summary>\n    Default,\n\n    /// <summary>\n    /// Gets an instance of type \"EmailKeyboard\".\n    /// </summary>\n    Email,\n\n    /// <summary>\n    /// Gets an instance of type \"NumericKeyboard\".\n    /// </summary>\n    Numeric,\n\n    /// <summary>\n    /// Returns a new keyboard with None Microsoft.Maui.KeyboardFlags.\n    /// </summary>\n    Plain,\n\n    /// <summary>\n    /// Gets an instance of type \"TelephoneKeyboard\".\n    /// </summary>\n    Telephone,\n\n    /// <summary>\n    /// Gets an instance of type \"TextKeyboard\".\n    /// </summary>\n    Text,\n\n    /// <summary>\n    /// Gets an instance of type \"UrlKeyboard\".\n    /// </summary>\n    Url,\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Behaviors/BehaviorBase{T}.cs",
    "content": "﻿namespace Prism.Behaviors;\n\n/// <summary>\n/// Base class that extends on Xamarin Forms Behaviors.\n/// </summary>\n/// <typeparam name=\"T\"></typeparam>\npublic class BehaviorBase<T> : Behavior<T> where T : BindableObject\n{\n    /// <summary>\n    /// The Object associated with the Behavior\n    /// </summary>\n    public T AssociatedObject { get; private set; }\n\n    /// <inheritDoc />\n    protected override void OnAttachedTo(T bindable)\n    {\n        base.OnAttachedTo(bindable);\n        AssociatedObject = bindable;\n\n        if (bindable.BindingContext != null)\n        {\n            BindingContext = bindable.BindingContext;\n        }\n\n        bindable.BindingContextChanged += OnBindingContextChanged;\n    }\n\n    /// <inheritDoc />\n    protected override void OnDetachingFrom(T bindable)\n    {\n        base.OnDetachingFrom(bindable);\n        bindable.BindingContextChanged -= OnBindingContextChanged;\n        AssociatedObject = null;\n    }\n\n    void OnBindingContextChanged(object sender, EventArgs e)\n    {\n        OnBindingContextChanged();\n    }\n\n    /// <inheritDoc />\n    protected override void OnBindingContextChanged()\n    {\n        base.OnBindingContextChanged();\n        BindingContext = AssociatedObject.BindingContext;\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Behaviors/DelegatePageBehaviorFactory.cs",
    "content": "﻿using Prism.Ioc;\n\nnamespace Prism.Behaviors;\n\ninternal class DelegatePageBehaviorFactory : IPageBehaviorFactory\n{\n    private readonly Action<Page> _applyBehaviors;\n\n    public DelegatePageBehaviorFactory(Action<Page> applyBehaviors)\n    {\n        _applyBehaviors = applyBehaviors;\n    }\n\n    public void ApplyPageBehaviors(Page page)\n    {\n        _applyBehaviors(page);\n    }\n}\n\ninternal class DelegateContainerPageBehaviorFactory : IPageBehaviorFactory\n{\n    private readonly Action<IContainerProvider, Page> _applyBehaviors;\n    private readonly IContainerProvider _container;\n\n    public DelegateContainerPageBehaviorFactory(Action<IContainerProvider, Page> applyBehaviors, IContainerProvider container)\n    {\n        _applyBehaviors = applyBehaviors;\n        _container = container;\n    }\n\n    public void ApplyPageBehaviors(Page page)\n    {\n        _applyBehaviors(_container, page);\n    }\n}"
  },
  {
    "path": "src/Maui/Prism.Maui/Behaviors/ElementParentedCallbackBehavior.cs",
    "content": "﻿using System.ComponentModel;\nusing Prism.Extensions;\nusing Prism.Navigation.Xaml;\n\nnamespace Prism.Behaviors;\n\ninternal class ElementParentedCallbackBehavior : Behavior<VisualElement>\n{\n    private Action _callback { get; }\n\n    public ElementParentedCallbackBehavior(Action callback)\n    {\n        _callback = callback;\n    }\n\n    protected override void OnAttachedTo(VisualElement view)\n    {\n        if (view.TryGetParentPage(out var page))\n        {\n            var container = page.GetContainerProvider();\n            if (container is null)\n                page.PropertyChanged += PagePropertyChanged;\n            else\n            {\n                view.SetContainerProvider(container);\n                _callback();\n            }\n        }\n        else\n        {\n            view.ParentChanged += OnParentChanged;\n        }\n    }\n\n    private void OnParentChanged(object sender, EventArgs e)\n    {\n        if (sender is not VisualElement view || view.Parent is null)\n            return;\n        else if (view.TryGetParentPage(out var page))\n        {\n            if(page.GetContainerProvider() is not null)\n            {\n                view.ParentChanged -= OnParentChanged;\n                _callback();\n                return;\n            }\n            page.PropertyChanged += PagePropertyChanged;\n        }\n        else\n            view.Parent.ParentChanged += OnParentChanged;\n\n        view.ParentChanged -= OnParentChanged;\n    }\n\n    private void PagePropertyChanged(object sender, PropertyChangedEventArgs e)\n    {\n        if (sender is not Page page || e.PropertyName != Navigation.Xaml.Navigation.PrismContainerProvider)\n            return;\n\n        var container = page.GetContainerProvider();\n\n        if(container is not null)\n        {\n            page.PropertyChanged -= PagePropertyChanged;\n            _callback();\n        }\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Behaviors/EventToCommandBehavior.cs",
    "content": "using System.Globalization;\nusing System.Linq.Expressions;\nusing System.Reflection;\nusing System.Windows.Input;\n\nnamespace Prism.Behaviors;\n\n/// <summary>\n/// Behavior class that enable using <see cref=\"ICommand\" /> to react on events raised by <see cref=\"BindableObject\" /> bindable.\n/// </summary>\n/// <para>\n/// There are multiple ways to pass a parameter to the <see cref=\"ICommand.Execute\"/> method. \n/// Setting the <see cref=\"CommandParameter\"/> will always result in that value will be sent.\n/// The <see cref=\"EventArgsParameterPath\"/> will walk the property path on the instance of <see cref=\"EventArgs\"/> for the event and, if any property found, pass that parameter.\n/// The <see cref=\"EventArgsConverter\"/> will call the <see cref=\"IValueConverter.Convert\"/> method with the <see cref=\"EventArgsConverterParameter\"/> and pass the result as parameter.\n/// </para>\n/// <para>\n/// The order of evaluation for the parameter to be sent to the <see cref=\"ICommand.Execute\"/> method is\n/// 1. <see cref=\"CommandParameter\"/>\n/// 2. <see cref=\"EventArgsParameterPath\"/>\n/// 3. <see cref=\"EventArgsConverter\"/>\n/// and as soon as a non-<c>null</c> value is found, the evaluation is stopped.\n/// </para>\n/// <example>\n/// &lt;ListView&gt;\n/// &lt;ListView.Behaviors&gt;\n/// &lt;behaviors:EventToCommandBehavior EventName=\"ItemTapped\" Command={Binding ItemTappedCommand} /&gt;\n/// &lt;/ListView.Behaviors&gt;\n/// &lt;/ListView&gt;\n/// </example>\n// This is a modified version of https://anthonysimmon.com/eventtocommand-in-xamarin-forms-apps/\npublic class EventToCommandBehavior : BehaviorBase<BindableObject>\n{\n    /// <summary>\n    /// Bindable property for Name of the event that will be forwarded to \n    /// <see cref=\"EventToCommandBehavior.Command\"/>\n    /// </summary>\n    public static readonly BindableProperty EventNameProperty =\n        BindableProperty.Create(nameof(EventName), typeof(string), typeof(EventToCommandBehavior));\n\n    /// <summary>\n    /// Bindable property for Command to execute\n    /// </summary>\n    public static readonly BindableProperty CommandProperty =\n        BindableProperty.Create(nameof(Command), typeof(ICommand), typeof(EventToCommandBehavior));\n\n    /// <summary>\n    /// Bindable property for Argument sent to <see cref=\"ICommand.Execute(object)\"/>\n    /// </summary>\n    public static readonly BindableProperty CommandParameterProperty =\n        BindableProperty.Create(nameof(CommandParameter), typeof(object), typeof(EventToCommandBehavior));\n\n    /// <summary>\n    /// Bindable property to set instance of <see cref=\"IValueConverter\" /> to convert the <see cref=\"EventArgs\" /> for <see cref=\"EventName\" />\n    /// </summary>\n    public static readonly BindableProperty EventArgsConverterProperty =\n        BindableProperty.Create(nameof(EventArgsConverter), typeof(IValueConverter), typeof(EventToCommandBehavior));\n\n    /// <summary>\n    /// Bindable property to set Argument passed as parameter to <see cref=\"IValueConverter.Convert\" />\n    /// </summary>\n    public static readonly BindableProperty EventArgsConverterParameterProperty =\n        BindableProperty.Create(nameof(EventArgsConverterParameter), typeof(object), typeof(EventToCommandBehavior));\n\n    /// <summary>\n    /// Bindable property to set Parameter path to extract property from <see cref=\"EventArgs\"/> instance to pass to <see cref=\"ICommand.Execute\"/>\n    /// </summary>\n    public static readonly BindableProperty EventArgsParameterPathProperty =\n        BindableProperty.Create(\n            nameof(EventArgsParameterPath),\n            typeof(string),\n            typeof(EventToCommandBehavior));\n\n    /// <summary>\n    /// <see cref=\"EventInfo\"/>\n    /// </summary>\n    protected EventInfo _eventInfo;\n\n    /// <summary>\n    /// Delegate to Invoke when event is raised\n    /// </summary>\n    protected Delegate _handler;\n\n    /// <summary>\n    /// Parameter path to extract property from <see cref=\"EventArgs\"/> instance to pass to <see cref=\"ICommand.Execute\"/>\n    /// </summary>\n    public string EventArgsParameterPath\n    {\n        get => (string)GetValue(EventArgsParameterPathProperty);\n        set => SetValue(EventArgsParameterPathProperty, value);\n    }\n\n    /// <summary>\n    /// Name of the event that will be forwarded to <see cref=\"Command\" />\n    /// </summary>\n    /// <remarks>\n    /// An event that is invalid for the attached <see cref=\"View\" /> will result in <see cref=\"ArgumentException\" /> thrown.\n    /// </remarks>\n    public string EventName\n    {\n        get => (string)GetValue(EventNameProperty);\n        set => SetValue(EventNameProperty, value);\n    }\n\n    /// <summary>\n    /// The command to execute\n    /// </summary>\n    public ICommand Command\n    {\n        get => (ICommand)GetValue(CommandProperty);\n        set => SetValue(CommandProperty, value);\n    }\n\n    /// <summary>\n    /// Argument sent to <see cref=\"ICommand.Execute\" />\n    /// </summary>\n    /// <para>\n    /// If <see cref=\"EventArgsConverter\" /> and <see cref=\"EventArgsConverterParameter\" /> is set then the result of the\n    /// conversion\n    /// will be sent.\n    /// </para>\n    public object CommandParameter\n    {\n        get => GetValue(CommandParameterProperty);\n        set => SetValue(CommandParameterProperty, value);\n    }\n\n    /// <summary>\n    /// Instance of <see cref=\"IValueConverter\" /> to convert the <see cref=\"EventArgs\" /> for <see cref=\"EventName\" />\n    /// </summary>\n    public IValueConverter EventArgsConverter\n    {\n        get => (IValueConverter)GetValue(EventArgsConverterProperty);\n        set => SetValue(EventArgsConverterProperty, value);\n    }\n\n    /// <summary>\n    /// Argument passed as parameter to <see cref=\"IValueConverter.Convert\" />\n    /// </summary>\n    public object EventArgsConverterParameter\n    {\n        get => GetValue(EventArgsConverterParameterProperty);\n        set => SetValue(EventArgsConverterParameterProperty, value);\n    }\n\n    /// <summary>\n    /// Subscribes to the event <see cref=\"BindableObject\"/> object\n    /// </summary>\n    /// <param name=\"bindable\">Bindable object that is source of event to Attach</param>\n    /// <exception cref=\"ArgumentException\">Thrown if no matching event exists on \n    /// <see cref=\"BindableObject\"/></exception>\n    protected override void OnAttachedTo(BindableObject bindable)\n    {\n        base.OnAttachedTo(bindable);\n\n        _eventInfo = AssociatedObject\n            .GetType()\n            .GetRuntimeEvent(EventName);\n        if (_eventInfo == null)\n        {\n            throw new ArgumentException(\n                $\"No matching event '{EventName}' on attached type '{bindable.GetType().Name}'\");\n        }\n\n        AddEventHandler(_eventInfo, AssociatedObject, OnEventRaised);\n    }\n\n    /// <summary>\n    /// Unsubscribes from the event on <paramref name=\"bindable\"/>\n    /// </summary>\n    /// <param name=\"bindable\"><see cref=\"BindableObject\"/> that is source of event</param>\n    protected override void OnDetachingFrom(BindableObject bindable)\n    {\n        if (_handler != null)\n        {\n            _eventInfo.RemoveEventHandler(AssociatedObject, _handler);\n        }\n        _handler = null;\n        _eventInfo = null;\n        base.OnDetachingFrom(bindable);\n    }\n\n    private void AddEventHandler(EventInfo eventInfo, object item, Action<object, EventArgs> action)\n    {\n        var eventParameters = eventInfo.EventHandlerType\n            .GetRuntimeMethods().First(m => m.Name == \"Invoke\")\n            .GetParameters()\n            .Select(p => Expression.Parameter(p.ParameterType))\n            .ToArray();\n\n        var actionInvoke = action.GetType()\n            .GetRuntimeMethods().First(m => m.Name == \"Invoke\");\n\n        _handler = Expression.Lambda(\n            eventInfo.EventHandlerType,\n            Expression.Call(Expression.Constant(action), actionInvoke, eventParameters[0], eventParameters[1]),\n            eventParameters)\n            .Compile();\n\n        eventInfo.AddEventHandler(item, _handler);\n    }\n\n    /// <summary>\n    /// Method called when event is raised\n    /// </summary>\n    /// <param name=\"sender\">Source of that raised the event</param>\n    /// <param name=\"eventArgs\">Arguments of the raised event</param>\n    protected virtual void OnEventRaised(object sender, EventArgs eventArgs)\n    {\n        if (Command == null)\n        {\n            return;\n        }\n\n        var parameter = CommandParameter;\n\n        if (parameter == null && !string.IsNullOrEmpty(EventArgsParameterPath))\n        {\n            //Walk the ParameterPath for nested properties.\n            var propertyPathParts = EventArgsParameterPath.Split('.');\n            object propertyValue = eventArgs;\n            foreach (var propertyPathPart in propertyPathParts)\n            {\n                var propInfo = propertyValue.GetType().GetRuntimeProperty(propertyPathPart);\n                if (propInfo == null)\n                    throw new MissingMemberException($\"Unable to find {EventArgsParameterPath}\");\n\n                propertyValue = propInfo.GetValue(propertyValue);\n                if (propertyValue == null)\n                {\n                    break;\n                }\n            }\n            parameter = propertyValue;\n        }\n\n        if (parameter == null && eventArgs != null && EventArgsConverter != null)\n        {\n            parameter = EventArgsConverter.Convert(eventArgs, typeof(object), EventArgsConverterParameter,\n                CultureInfo.CurrentUICulture);\n        }\n\n        if (Command.CanExecute(parameter))\n        {\n            Command.Execute(parameter);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Behaviors/IPageBehaviorFactory.cs",
    "content": "﻿namespace Prism.Behaviors;\n\n/// <summary>\n/// Applies behaviors to the Microsoft.Maui.Controls.Page's when they are created during navigation.\n/// </summary>\npublic interface IPageBehaviorFactory\n{\n    /// <summary>\n    /// Applies behaviors to a page based on the page type.\n    /// </summary>\n    /// <param name=\"page\">The page to apply the behaviors</param>\n    /// <remarks>The PageLifeCycleAwareBehavior is applied to all pages</remarks>\n    void ApplyPageBehaviors(Page page);\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Behaviors/MultiPageActiveAwareBehavior.cs",
    "content": "﻿using Prism.Common;\nusing Prism.Extensions;\n\nnamespace Prism.Behaviors;\n\n/// <summary>\n/// Provides behaviors for types of <see cref=\"MultiPage{T}\"/>\n/// </summary>\n/// <typeparam name=\"T\">The typeof <see cref=\"Page\"/>.</typeparam>\npublic class MultiPageActiveAwareBehavior<T> : BehaviorBase<MultiPage<T>> where T : Page\n{\n    /// <inheritDoc/>\n    protected override void OnAttachedTo(MultiPage<T> bindable)\n    {\n        bindable.CurrentPageChanged += CurrentPageChangedHandler;\n        bindable.Appearing += RootPageAppearingHandler;\n        bindable.Disappearing += RootPageDisappearingHandler;\n        base.OnAttachedTo(bindable);\n    }\n\n    /// <inheritDoc/>\n    protected override void OnDetachingFrom(MultiPage<T> bindable)\n    {\n        bindable.CurrentPageChanged -= CurrentPageChangedHandler;\n        bindable.Appearing -= RootPageAppearingHandler;\n        bindable.Disappearing -= RootPageDisappearingHandler;\n        base.OnDetachingFrom(bindable);\n    }\n\n    /// <summary>\n    /// Event Handler for the MultiPage CurrentPageChanged event\n    /// </summary>\n    /// <param name=\"sender\">The MultiPage</param>\n    /// <param name=\"e\">Event Args</param>\n    protected void CurrentPageChangedHandler(object sender, EventArgs e)\n    {\n        SetActiveAware();\n    }\n\n    /// <summary>\n    /// Event Handler for the MultiPage Appearing event\n    /// </summary>\n    /// <param name=\"sender\">The MultiPage Appearing</param>\n    /// <param name=\"e\">Event Args</param>\n    protected void RootPageAppearingHandler(object sender, EventArgs e)\n    {\n        SetActiveAware();\n    }\n\n    /// <summary>\n    /// Event Handler for the MultiPage Disappearing event\n    /// </summary>\n    /// <param name=\"sender\">The MultiPage Disappearing</param>\n    /// <param name=\"e\">Event Args</param>\n    protected void RootPageDisappearingHandler(object sender, EventArgs e)\n    {\n        SetActiveAware();\n    }\n\n    private void SetActiveAware()\n    {\n        AssociatedObject.Children.ForEach(page => SetPageIsActive(page, AssociatedObject.CurrentPage == page));\n    }\n\n    private void SetPageIsActive(Page page, bool isActive)\n    {\n        MvvmHelpers.InvokeViewAndViewModelAction<IActiveAware>(page, aa => SetIsActive(aa, isActive));\n\n        if (page is NavigationPage navPage)\n        {\n            MvvmHelpers.InvokeViewAndViewModelAction<IActiveAware>(navPage.CurrentPage, aa => SetIsActive(aa, isActive));\n        }\n    }\n\n    private static void SetIsActive(IActiveAware activeAware, bool isActive)\n    {\n        if (activeAware?.IsActive != isActive)\n            activeAware.IsActive = isActive;\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Behaviors/NavigationPageActiveAwareBehavior.cs",
    "content": "﻿using System.ComponentModel;\nusing Prism.Common;\nusing Prism.Extensions;\n\nnamespace Prism.Behaviors;\n\n/// <summary>\n/// Provides activation and deactivation for <see cref=\"IActiveAware\"/> ViewModels that may be set as the CurrentPage.\n/// </summary>\npublic class NavigationPageActiveAwareBehavior : BehaviorBase<NavigationPage>\n{\n    /// <inheritDoc/>\n    protected override void OnAttachedTo(NavigationPage bindable)\n    {\n        bindable.PropertyChanged += NavigationPage_PropertyChanged;\n        if (bindable.Parent is null)\n            bindable.ParentChanged += OnParentChanged;\n        base.OnAttachedTo(bindable);\n    }\n\n    private void OnParentChanged(object sender, EventArgs e)\n    {\n        AssociatedObject.ParentChanged -= OnParentChanged;\n        SetActiveAware();\n    }\n\n    /// <inheritDoc/>\n    protected override void OnDetachingFrom(NavigationPage bindable)\n    {\n        bindable.PropertyChanged -= NavigationPage_PropertyChanged;\n        base.OnDetachingFrom(bindable);\n    }\n\n    private void NavigationPage_PropertyChanged(object sender, PropertyChangedEventArgs e)\n    {\n        if (e.PropertyName == \"CurrentPage\")\n        {\n            SetActiveAware();\n        }\n    }\n\n    private void SetActiveAware()\n    {\n        if(AssociatedObject.Parent is TabbedPage tabbed && tabbed.CurrentPage != AssociatedObject)\n        {\n            MvvmHelpers.InvokeViewAndViewModelAction<IActiveAware>(AssociatedObject, SetNotActive);\n            AssociatedObject.Navigation.NavigationStack.ForEach(page => MvvmHelpers.InvokeViewAndViewModelAction<IActiveAware>(page, SetNotActive));\n        }\n        else\n        {\n            AssociatedObject.Navigation.NavigationStack.ForEach(page =>\n            {\n                if (page != AssociatedObject.CurrentPage)\n                    MvvmHelpers.InvokeViewAndViewModelAction<IActiveAware>(page, SetNotActive);\n                else\n                    MvvmHelpers.InvokeViewAndViewModelAction<IActiveAware>(page, SetIsActive);\n            });\n        }\n    }\n\n    private void SetNotActive(IActiveAware activeAware)\n    {\n        if (activeAware.IsActive)\n            activeAware.IsActive = false;\n    }\n\n    private void SetIsActive(IActiveAware activeAware)\n    {\n        if(!activeAware.IsActive)\n            activeAware.IsActive = true;\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Behaviors/NavigationPageSystemGoBackBehavior.cs",
    "content": "﻿using Prism.Common;\nusing Prism.Navigation;\n\nnamespace Prism.Behaviors;\n\npublic class NavigationPageSystemGoBackBehavior : BehaviorBase<NavigationPage>\n{\n    protected override void OnAttachedTo(NavigationPage bindable)\n    {\n        bindable.Popped += NavigationPage_Popped;\n        base.OnAttachedTo(bindable);\n    }\n\n    protected override void OnDetachingFrom(NavigationPage bindable)\n    {\n        bindable.Popped -= NavigationPage_Popped;\n        base.OnDetachingFrom(bindable);\n    }\n\n    private void NavigationPage_Popped(object sender, NavigationEventArgs e)\n    {\n        if (PageNavigationService.NavigationSource == PageNavigationSource.Device)\n        {\n            System.Diagnostics.Trace.WriteLine(\"NavigationPage has encountered an unhandled GoBack. Be sure to inherit from PrismNavigationPage.\");\n            MvvmHelpers.HandleSystemGoBack(e.Page, AssociatedObject.CurrentPage);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Behaviors/NavigationPageTabbedParentBehavior.cs",
    "content": "using System.ComponentModel;\nusing Prism.Xaml;\n\nnamespace Prism.Behaviors;\n\n/// <summary>\n/// Adds a behavior to use the RootPage Title and IconImageSource if they are not set on the NavigaitonPage\n/// when the NavigationPage has a TabbedPage parent.\n/// </summary>\npublic sealed class NavigationPageTabbedParentBehavior : BehaviorBase<NavigationPage>\n{\n    /// <inheritdoc />\n    protected override void OnAttachedTo(NavigationPage bindable)\n    {\n        base.OnAttachedTo(bindable);\n        bindable.PropertyChanged += OnRootPageSet;\n    }\n\n    private void OnRootPagePropertyChanged(object sender, PropertyChangedEventArgs e)\n    {\n        if (sender is not Page page || page.Parent is not NavigationPage navigationPage)\n        {\n            return;\n        }\n\n        if (e.PropertyName == DynamicTab.TitleProperty.PropertyName)\n        {\n            navigationPage.Title = DynamicTab.GetTitle(page);\n        }\n\n        if (e.PropertyName == DynamicTab.IconImageSourceProperty.PropertyName)\n        {\n            navigationPage.IconImageSource = DynamicTab.GetIconImageSource(page);\n        }\n    }\n\n    /// <inheritdoc />\n    protected override void OnDetachingFrom(NavigationPage bindable)\n    {\n        base.OnDetachingFrom(bindable);\n        // Sanity Check\n        bindable.PropertyChanged -= OnRootPageSet;\n        if (bindable.RootPage is not null)\n        {\n            bindable.RootPage.PropertyChanged -= OnRootPagePropertyChanged;\n        }\n    }\n\n    private void OnRootPageSet(object sender, PropertyChangedEventArgs e)\n    {\n        if (sender is NavigationPage navigationPage && navigationPage.RootPage is not null)\n        {\n            navigationPage.PropertyChanged -= OnRootPageSet;\n            navigationPage.RootPage.PropertyChanged += OnRootPagePropertyChanged;\n            navigationPage.Title = DynamicTab.GetTitle(navigationPage.RootPage);\n            navigationPage.IconImageSource = DynamicTab.GetIconImageSource(navigationPage.RootPage);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Behaviors/PageLifeCycleAwareBehavior.cs",
    "content": "﻿using Prism.AppModel;\nusing Prism.Common;\n\nnamespace Prism.Behaviors;\n\n/// <summary>\n/// Provides lifecycle events for <see cref=\"Page\"/> and <see cref=\"IPageLifecycleAware\"/> ViewModels.\n/// </summary>\npublic class PageLifeCycleAwareBehavior : BehaviorBase<Page>\n{\n    /// <inheritdoc />\n    protected override void OnAttachedTo(Page bindable)\n    {\n        base.OnAttachedTo(bindable);\n        bindable.Appearing += OnAppearing;\n        bindable.Disappearing += OnDisappearing;\n    }\n\n    /// <inheritdoc />\n    protected override void OnDetachingFrom(Page bindable)\n    {\n        base.OnDetachingFrom(bindable);\n        bindable.Appearing -= OnAppearing;\n        bindable.Disappearing -= OnDisappearing;\n    }\n\n    private void OnAppearing(object sender, EventArgs e)\n    {\n        MvvmHelpers.InvokeViewAndViewModelAction<IPageLifecycleAware>(AssociatedObject, aware => aware.OnAppearing());\n    }\n\n    private void OnDisappearing(object sender, EventArgs e)\n    {\n        MvvmHelpers.InvokeViewAndViewModelAction<IPageLifecycleAware>(AssociatedObject, aware => aware.OnDisappearing());\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Behaviors/PageScopeBehavior.cs",
    "content": "﻿using Prism.Navigation.Xaml;\n\nnamespace Prism.Behaviors;\n\n/// <summary>\n/// Controls the Page container Scope\n/// </summary>\npublic sealed class PageScopeBehavior : BehaviorBase<Page>\n{\n    /// <inheritdoc />\n    protected override void OnAttachedTo(Page page)\n    {\n        base.OnAttachedTo(page);\n        // Ensure the scope gets created and NavigationService is created\n        Navigation.Xaml.Navigation.GetNavigationService(page);\n    }\n\n    /// <inheritdoc />\n    protected override void OnDetachingFrom(Page page)\n    {\n        base.OnDetachingFrom(page);\n        // This forces the Attached Property to get cleaned up.\n        page.SetContainerProvider(null);\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Behaviors/RegionCleanupBehavior.cs",
    "content": "﻿using Prism.Navigation.Xaml;\n\nnamespace Prism.Behaviors;\n\ninternal class RegionCleanupBehavior : BehaviorBase<Page>\n{\n    protected override void OnDetachingFrom(Page bindable)\n    {\n        bindable.ClearChildRegions();\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Behaviors/TabbedPageActiveAwareBehavior.cs",
    "content": "﻿namespace Prism.Behaviors;\n\n/// <summary>\n/// Provides <see cref=\"IActiveAware\"/> support for the children of the <see cref=\"TabbedPage\"/>\n/// </summary>\npublic class TabbedPageActiveAwareBehavior : MultiPageActiveAwareBehavior<Page>\n{\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Common/IPageAccessor.cs",
    "content": "﻿namespace Prism.Common;\n\n/// <summary>\n/// Interface to signify that a class must have knowledge of a specific <see cref=\"Microsoft.Maui.Controls.Page\"/> instance in order to function properly.\n/// </summary>\npublic interface IPageAccessor\n{\n    /// <summary>\n    /// The <see cref=\"Microsoft.Maui.Controls.Page\"/> instance.\n    /// </summary>\n    Page Page { get; set; }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Common/MvvmHelpers.cs",
    "content": "#nullable enable\nusing System.ComponentModel;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Reflection;\nusing Prism.Dialogs;\nusing Prism.Navigation;\nusing Prism.Navigation.Regions;\nusing Prism.Navigation.Xaml;\nusing NavigationMode = Prism.Navigation.NavigationMode;\nusing TabbedPage = Microsoft.Maui.Controls.TabbedPage;\n\nnamespace Prism.Common;\n\npublic static class MvvmHelpers\n{\n    public static void InvokeViewAndViewModelAction<T>(object? view, Action<T> action) where T : class\n    {\n        if (view is T viewAsT)\n        {\n            action(viewAsT);\n        }\n\n        if (view is BindableObject { BindingContext: T viewModelAsT })\n        {\n            action(viewModelAsT);\n        }\n\n        if (view is Page page)\n        {\n            var children = page.GetChildRegions();\n            if (children is not null)\n                foreach (var child in children)\n                    InvokeViewAndViewModelAction<T>(child, action);\n        }\n    }\n\n    public static async Task InvokeViewAndViewModelActionAsync<T>(object? view, Func<T, Task> action) where T : class\n    {\n        if (view is T viewAsT)\n        {\n            await action(viewAsT);\n        }\n\n        if (view is BindableObject { BindingContext: T viewModelAsT })\n        {\n            await action(viewModelAsT);\n        }\n\n        if (view is Page page)\n        {\n            var children = page.GetChildRegions();\n            if (children is not null)\n                foreach (var child in children)\n                    await InvokeViewAndViewModelActionAsync(child, action);\n        }\n    }\n\n    public static void DestroyPage(IView? view)\n    {\n        try\n        {\n            DestroyChildren(view);\n\n            InvokeViewAndViewModelAction<IDestructible>(view, v => v.Destroy());\n\n            if (view is VisualElement visualElement)\n            {\n#if ANDROID\n                visualElement.Unloaded += VisualElementUnloaded;\n                void VisualElementUnloaded(object? sender, EventArgs e)\n                {\n                    visualElement.Unloaded -= VisualElementUnloaded;\n                    visualElement.Behaviors?.Clear();\n                    visualElement.BindingContext = null;\n                }\n#else\n                visualElement.Behaviors?.Clear();\n                visualElement.BindingContext = null;\n#endif\n            }\n        }\n        catch (Exception ex)\n        {\n            throw new Exception($\"Cannot destroy {view}.\", ex);\n        }\n    }\n\n    private static void DestroyChildren(IView? page)\n    {\n        switch (page)\n        {\n            case FlyoutPage flyout:\n                DestroyPage(flyout.Flyout);\n                DestroyPage(flyout.Detail);\n                break;\n            case TabbedPage tabbedPage:\n                foreach (var item in tabbedPage.Children.Reverse())\n                {\n                    DestroyPage(item);\n                }\n\n                break;\n            case NavigationPage navigationPage:\n                foreach (var item in navigationPage.Navigation.NavigationStack.Reverse())\n                {\n                    DestroyPage(item);\n                }\n\n                break;\n        }\n    }\n\n    public static void DestroyWithModalStack(Page? page, IList<Page?> modalStack)\n    {\n        foreach (var childPage in modalStack.Reverse())\n        {\n            DestroyPage(childPage);\n        }\n\n        DestroyPage(page);\n    }\n\n    public static T? GetImplementerFromViewOrViewModel<T>(object view)\n        where T : class\n    {\n        if (view is T viewAsT)\n        {\n            return viewAsT;\n        }\n\n        if (view is VisualElement { BindingContext: T vmAsT })\n        {\n            return vmAsT;\n        }\n\n        return null;\n    }\n\n    public static bool IsNavigationTarget(object view, NavigationContext navigationContext)\n    {\n        var implementor = GetImplementerFromViewOrViewModel<IRegionAware>(view);\n        if (implementor is not null)\n            return implementor.IsNavigationTarget(navigationContext);\n\n        var uri = navigationContext.Uri;\n        if (!uri.IsAbsoluteUri)\n            uri = new Uri(new Uri(\"app://prism.regions\"), uri);\n        var path = uri.LocalPath.Substring(1);\n        var viewType = view.GetType();\n\n        return path == viewType.Name || path == viewType.FullName;\n    }\n\n    public static void OnNavigatedFrom(object? view, NavigationContext navigationContext)\n    {\n        InvokeViewAndViewModelAction<IRegionAware>(view, x => x.OnNavigatedFrom(navigationContext));\n    }\n\n    public static void OnNavigatedTo(object? view, NavigationContext navigationContext)\n    {\n        InvokeViewAndViewModelAction<IRegionAware>(view, x => x.OnNavigatedTo(navigationContext));\n    }\n\n    public static Task<bool> CanNavigateAsync(object page, INavigationParameters parameters)\n    {\n        var implementer = GetImplementerFromViewOrViewModel<IConfirmNavigationAsync>(page);\n        if (implementer is null)\n            return Task.FromResult(CanNavigate(page, parameters));\n\n        return implementer.CanNavigateAsync(parameters);\n    }\n\n    public static bool CanNavigate(object page, INavigationParameters parameters)\n    {\n        var implementer = GetImplementerFromViewOrViewModel<IConfirmNavigation>(page);\n        return implementer?.CanNavigate(parameters) ?? true;\n    }\n\n    public static void OnNavigatedFrom(object? page, INavigationParameters parameters)\n    {\n        if (page != null)\n            InvokeViewAndViewModelAction<INavigatedAware>(page, v => v.OnNavigatedFrom(parameters));\n    }\n\n    public static async Task OnInitializedAsync(object? page, INavigationParameters parameters)\n    {\n        if (page is null) return;\n\n        InvokeViewAndViewModelAction<IInitialize>(page, v => v.Initialize(parameters));\n        await InvokeViewAndViewModelActionAsync<IInitializeAsync>(page, async v => await v.InitializeAsync(parameters));\n    }\n\n    private static bool HasKey(this IEnumerable<KeyValuePair<string, object>> parameters, string name, [MaybeNullWhen(returnValue: false)] out string key)\n    {\n        key = parameters.Select(x => x.Key).FirstOrDefault(k => k.Equals(name, StringComparison.InvariantCultureIgnoreCase));\n        return !string.IsNullOrEmpty(key);\n    }\n\n    public static void OnNavigatedTo(object? page, INavigationParameters parameters)\n    {\n        if (page != null)\n            InvokeViewAndViewModelAction<INavigatedAware>(page, v => v.OnNavigatedTo(parameters));\n    }\n\n    public static Page? GetOnNavigatedToTarget(Page page, IView? mainPage, bool useModalNavigation)\n    {\n        Page? target;\n        if (useModalNavigation)\n        {\n            var previousPage = GetPreviousPage(page, page.Navigation.ModalStack);\n\n            //MainPage is not included in the navigation stack, so if we can't find the previous page above\n            //let's assume they are going back to the MainPage\n            target = GetOnNavigatedToTargetFromChild(previousPage ?? mainPage);\n        }\n        else\n        {\n            target = GetPreviousPage(page, page.Navigation.NavigationStack);\n            if (target != null)\n                target = GetOnNavigatedToTargetFromChild(target);\n            else\n                target = GetOnNavigatedToTarget(page, mainPage, true);\n        }\n\n        return target;\n    }\n\n    public static Page? GetOnNavigatedToTargetFromChild(IView? target)\n    {\n        Page? child = null;\n\n        if (target is FlyoutPage flyout)\n            child = flyout.Detail;\n        else if (target is TabbedPage tabbed)\n            child = tabbed.CurrentPage;\n        else if (target is NavigationPage np)\n            child = np.Navigation.NavigationStack.Last();\n\n        if (child != null)\n            target = GetOnNavigatedToTargetFromChild(child);\n\n        if (target is Page page)\n            return page;\n\n        return null;\n    }\n\n    public static Page? GetPreviousPage(Page currentPage, IReadOnlyList<Page?> navStack)\n    {\n        Page? previousPage = null;\n\n        int currentPageIndex = GetCurrentPageIndex(currentPage, navStack);\n        int previousPageIndex = currentPageIndex - 1;\n        if (navStack.Count >= 0 && previousPageIndex >= 0)\n            previousPage = navStack[previousPageIndex];\n\n        return previousPage;\n    }\n\n    public static int GetCurrentPageIndex(Page currentPage, IReadOnlyList<Page?> navStack)\n    {\n        int stackCount = navStack.Count;\n        for (int x = 0; x < stackCount; x++)\n        {\n            var view = navStack[x];\n            if (view == currentPage)\n                return x;\n        }\n\n        return stackCount - 1;\n    }\n\n    public static Page? GetCurrentPage(Page mainPage) =>\n        _getCurrentPage(mainPage);\n\n    [EditorBrowsable(EditorBrowsableState.Never)]\n    public static void SetCurrentPageDelegate(Func<Page, Page?> getCurrentPageDelegate) =>\n        _getCurrentPage = getCurrentPageDelegate;\n\n    private static Func<Page, Page?> _getCurrentPage = mainPage =>\n    {\n        var page = mainPage;\n\n        var lastModal = page.Navigation.ModalStack.LastOrDefault();\n        if (lastModal != null)\n            page = lastModal;\n\n        return EvaluateCurrentPage(page);\n    };\n\n    internal static Page? GetTarget(Page? target)\n    {\n        return target switch\n        {\n            FlyoutPage flyout => GetTarget(flyout.Detail),\n            TabbedPage tabbed => GetTarget(tabbed.CurrentPage),\n            NavigationPage navigation => GetTarget(navigation.CurrentPage) ?? navigation,\n            ContentPage page => page,\n            null => null,\n            _ => throw new NotSupportedException($\"The page type '{target.GetType().FullName}' is not supported.\")\n        };\n    }\n\n    private static Page? EvaluateCurrentPage(Page? target)\n    {\n        Page? child = GetTarget(target);\n\n        if (child is not null)\n            target = GetOnNavigatedToTargetFromChild(child);\n\n        if (target is { } page)\n        {\n            if (target is IDialogContainer)\n            {\n                return page.Parent switch\n                {\n                    Page parentPage => GetTarget(parentPage),\n                    Window window => GetTarget(window.Page),\n                    _ => throw new InvalidOperationException(\"Unable to determine the current page.\")\n                };\n            }\n\n            return page.Parent switch\n            {\n                TabbedPage tab when tab.CurrentPage != target => EvaluateCurrentPage(tab.CurrentPage),\n                NavigationPage nav when nav.CurrentPage != target => EvaluateCurrentPage(nav.CurrentPage),\n                _ => target\n            };\n        }\n\n        return null;\n    }\n\n    public static async Task HandleNavigationPageGoBack(NavigationPage navigationPage)\n    {\n        var navigationService = Navigation.Xaml.Navigation.GetNavigationService(navigationPage.CurrentPage);\n        var result = await navigationService.GoBackAsync();\n        if (result.Exception is NavigationException { Message: NavigationException.CannotPopApplicationMainPage })\n        {\n            Application.Current?.Quit();\n        }\n    }\n\n    public static async Task HandleNavigationPageSwipedAway(NavigationPage navigationPage)\n    {\n        var navigationService = Navigation.Xaml.Navigation.GetNavigationService(navigationPage.CurrentPage);\n        var navParams = new NavigationParameters()\n        {\n            {\n                KnownNavigationParameters.UseModalNavigation, true\n            },\n        };\n        var result = await navigationService.GoBackAsync(navParams);\n        if (result.Exception is NavigationException { Message: NavigationException.CannotPopApplicationMainPage })\n        {\n            Application.Current?.Quit();\n        }\n    }\n\n    public static void HandleSystemGoBack(IView? previousPage, IView? currentPage)\n    {\n        var parameters = new NavigationParameters();\n        parameters.GetNavigationParametersInternal().Add(KnownInternalParameters.NavigationMode, NavigationMode.Back);\n        OnNavigatedFrom(previousPage, parameters);\n        OnNavigatedTo(GetOnNavigatedToTargetFromChild(currentPage), parameters);\n        DestroyPage(previousPage);\n    }\n\n    internal static bool HasDirectNavigationPageParent(Page page)\n    {\n        return page.Parent is NavigationPage;\n    }\n\n    internal static bool HasNavigationPageParent(Page page) =>\n        HasNavigationPageParent(page, out var _);\n\n    internal static bool HasNavigationPageParent(Page page, out NavigationPage? navigationPage)\n    {\n        if (page.Parent != null)\n        {\n            if (page.Parent is NavigationPage navParent)\n            {\n                navigationPage = navParent;\n                return true;\n            }\n            else if (page.Parent is TabbedPage && page.Parent?.Parent is NavigationPage navigationParent)\n            {\n                navigationPage = navigationParent;\n                return true;\n            }\n        }\n\n        navigationPage = null;\n        return false;\n    }\n\n    internal static bool IsSameOrSubclassOf<T>(Type potentialDescendant)\n    {\n        if (potentialDescendant == null)\n            return false;\n\n        Type potentialBase = typeof(T);\n\n        return potentialDescendant.GetTypeInfo().IsSubclassOf(potentialBase)\n               || potentialDescendant == potentialBase;\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Common/ObservableObject.cs",
    "content": "﻿using System.ComponentModel;\n\nnamespace Prism.Common;\n\n// TODO: Refactor this... we probably do not need this for Xamarin\n/// <summary>\n/// Class that wraps an object, so that other classes can notify for Change events. Typically, this class is set as\n/// a Bindable Property on BindableObjects, and allows other classes to observe any changes in the Value.\n/// </summary>\n/// <typeparam name=\"T\">The type of the property that's wrapped in the Observable object</typeparam>\npublic class ObservableObject<T> : BindableObject, INotifyPropertyChanged\n{\n    /// <summary>\n    /// Identifies the Value property of the ObservableObject\n    /// </summary>\n    public static readonly BindableProperty ValueProperty =\n            BindableProperty.Create(nameof(Value), typeof(T), typeof(ObservableObject<T>), default);\n\n    /// <summary>\n    /// The value that's wrapped inside the ObservableObject.\n    /// </summary>\n    public T Value\n    {\n        get => (T)GetValue(ValueProperty);\n        set => SetValue(ValueProperty, value);\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Common/PageAccessor.cs",
    "content": "﻿namespace Prism.Common;\n\ninternal class PageAccessor : IPageAccessor\n{\n    private WeakReference<Page> _weakPage;\n    public Page Page\n    {\n        get => _weakPage?.TryGetTarget(out var target) ?? false ? target : null;\n        set => _weakPage = value is null ? null : new(value);\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Controls/PrismNavigationPage.cs",
    "content": "using Prism.Common;\nusing Prism.Navigation;\nusing UIModalPresentationStyle = Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.UIModalPresentationStyle;\n\nnamespace Prism.Controls;\n\n/// <summary>\n/// Provides a wrapper for the NavigationPage to better handle the OnBackButtonPressed event with Prism Navigation\n/// </summary>\npublic class PrismNavigationPage : NavigationPage\n{\n    /// <summary>\n    /// Creates a new instance of the <see cref=\"PrismNavigationPage\"/>\n    /// </summary>\n    public PrismNavigationPage() { }\n\n    /// <summary>\n    /// Creates a new instance of the <see cref=\"PrismNavigationPage\"/> with a specified <see cref=\"Page\"/> at the Root\n    /// </summary>\n    /// <param name=\"page\"></param>\n    public PrismNavigationPage(Page page)\n        : base(page)\n    { }\n\n    /// <inheritdoc/>\n    protected sealed override bool OnBackButtonPressed()\n    {\n        MvvmHelpers.HandleNavigationPageGoBack(this).ConfigureAwait(false);\n        return true; //Prism will always handle the navigation\n    }\n\n#if IOS\n    /// <inheritdoc/>\n    protected override async void OnDisappearing()\n    {\n        var presentationStyle = Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.Page.GetModalPresentationStyle(this);\n\n        if (presentationStyle != UIModalPresentationStyle.FullScreen && PageNavigationService.NavigationSource == PageNavigationSource.Device)\n        {\n            await MvvmHelpers.HandleNavigationPageSwipedAway(this);\n        }\n\n        base.OnDisappearing();\n    }\n#endif\n}\n\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Dialogs/DialogContainerPage.cs",
    "content": "﻿using System.ComponentModel;\nusing System.Windows.Input;\nusing Microsoft.Maui.Controls.PlatformConfiguration;\nusing Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;\nusing Microsoft.Maui.Layouts;\nusing Prism.Dialogs.Xaml;\nusing Application = Microsoft.Maui.Controls.Application;\nusing Page = Microsoft.Maui.Controls.Page;\n\nnamespace Prism.Dialogs;\n\n/// <summary>\n/// Represents a page that serves as a container for dialogs in Prism.\n/// </summary>\n[EditorBrowsable(EditorBrowsableState.Never)]\npublic class DialogContainerPage : ContentPage, IDialogContainer\n{\n    /// <summary>\n    /// The name of the automation ID for the dialog container page.\n    /// </summary>\n    public const string AutomationIdName = \"PrismDialogModal\";\n\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"DialogContainerPage\"/> class.\n    /// </summary>\n    public DialogContainerPage()\n    {\n        AutomationId = AutomationIdName;\n        BackgroundColor = Colors.Transparent;\n        On<iOS>().SetModalPresentationStyle(UIModalPresentationStyle.OverFullScreen);\n    }\n\n    /// <summary>\n    /// Gets the dialog view displayed in the container page.\n    /// </summary>\n    public View DialogView { get; private set; }\n\n    /// <summary>\n    /// Gets the command used to dismiss the dialog.\n    /// </summary>\n    public ICommand Dismiss { get; private set; }\n\n    /// <summary>\n    /// Configures the layout of the dialog container page.\n    /// </summary>\n    /// <param name=\"currentPage\">The current page.</param>\n    /// <param name=\"dialogView\">The dialog view to be displayed.</param>\n    /// <param name=\"hideOnBackgroundTapped\">A flag indicating whether the dialog should be hidden when the background is tapped.</param>\n    /// <param name=\"dismissCommand\">The command to be executed when the dialog is dismissed.</param>\n    /// <param name=\"parameters\">The parameters passed to the dialog.</param>\n    /// <returns>A task representing the asynchronous operation.</returns>\n    public async Task ConfigureLayout(Page currentPage, View dialogView, bool hideOnBackgroundTapped, ICommand dismissCommand, IDialogParameters parameters)\n    {\n        Dismiss = dismissCommand;\n        DialogView = dialogView;\n        Content = GetContentLayout(currentPage, dialogView, hideOnBackgroundTapped, dismissCommand, parameters);\n\n        await DoPush(currentPage);\n    }\n\n    /// <summary>\n    /// Performs the push operation to display the dialog container page.\n    /// </summary>\n    /// <param name=\"currentPage\">The current page.</param>\n    /// <returns>A task representing the asynchronous operation.</returns>\n    protected virtual async Task DoPush(Page currentPage)\n    {\n        await currentPage.Navigation.PushModalAsync(this, false);\n    }\n\n    /// <summary>\n    /// Performs the pop operation to dismiss the dialog container page.\n    /// </summary>\n    /// <param name=\"currentPage\">The current page.</param>\n    /// <returns>A task representing the asynchronous operation.</returns>\n    public virtual async Task DoPop(Page currentPage)\n    {\n        await currentPage.Navigation.PopModalAsync(false);\n    }\n\n    /// <summary>\n    /// Gets the content layout for the dialog container page.\n    /// </summary>\n    /// <param name=\"currentPage\">The current page.</param>\n    /// <param name=\"dialogView\">The dialog view to be displayed.</param>\n    /// <param name=\"hideOnBackgroundTapped\">A flag indicating whether the dialog should be hidden when the background is tapped.</param>\n    /// <param name=\"dismissCommand\">The command to be executed when the dialog is dismissed.</param>\n    /// <param name=\"parameters\">The parameters passed to the dialog.</param>\n    /// <returns>The content layout for the dialog container page.</returns>\n    protected virtual View GetContentLayout(Page currentPage, View dialogView, bool hideOnBackgroundTapped, ICommand dismissCommand, IDialogParameters parameters)\n    {\n        var overlay = new AbsoluteLayout();\n        var popupContainer = new DialogContainerView\n        {\n            IsPopupContent = true,\n            HorizontalOptions = LayoutOptions.Center,\n            VerticalOptions = LayoutOptions.Center,\n            Content = dialogView,\n        };\n\n        var relativeWidth = DialogLayout.GetRelativeWidthRequest(dialogView);\n        if (relativeWidth != null)\n        {\n            popupContainer.SetBinding(WidthRequestProperty,\n                new Binding(nameof(Width),\n                            BindingMode.OneWay,\n                            new RelativeContentSizeConverter { RelativeSize = relativeWidth.Value },\n                            source: this));\n        }\n\n        var relativeHeight = DialogLayout.GetRelativeHeightRequest(dialogView);\n        if (relativeHeight != null)\n        {\n            popupContainer.SetBinding(HeightRequestProperty,\n                new Binding(nameof(Height),\n                            BindingMode.OneWay,\n                            new RelativeContentSizeConverter { RelativeSize = relativeHeight.Value },\n                            source: this));\n        }\n\n        AbsoluteLayout.SetLayoutFlags(popupContainer, AbsoluteLayoutFlags.PositionProportional);\n        var popupBounds = DialogLayout.GetLayoutBounds(dialogView);\n        AbsoluteLayout.SetLayoutBounds(popupContainer, popupBounds);\n\n        var useMask = DialogLayout.GetUseMask(popupContainer.Content) ?? true;\n        if (useMask)\n        {\n            var mask = GetMask(currentPage, dialogView, hideOnBackgroundTapped, dismissCommand);\n            AbsoluteLayout.SetLayoutFlags(mask, AbsoluteLayoutFlags.All);\n            AbsoluteLayout.SetLayoutBounds(mask, new Rect(0, 0, 1, 1));\n            overlay.Children.Add(mask);\n        }\n\n        overlay.Children.Add(popupContainer);\n        return overlay;\n    }\n\n    /// <summary>\n    /// Gets the mask view for the dialog container page.\n    /// </summary>\n    /// <param name=\"currentPage\">The current page.</param>\n    /// <param name=\"dialogView\">The dialog view to be displayed.</param>\n    /// <param name=\"hideOnBackgroundTapped\">A flag indicating whether the dialog should be hidden when the background is tapped.</param>\n    /// <param name=\"dismissCommand\">The command to be executed when the dialog is dismissed.</param>\n    /// <returns>The mask view for the dialog container page.</returns>\n    private View GetMask(Page currentPage, View dialogView, bool hideOnBackgroundTapped, ICommand dismissCommand)\n    {\n        View mask = DialogLayout.GetMask(dialogView);\n        var reference = currentPage.GetParentWindow().Page;\n        if (mask is null)\n        {\n            Style overlayStyle = GetOverlayStyle(dialogView, currentPage);\n\n            mask = new BoxView\n            {\n                Style = overlayStyle,\n                //HeightRequest = reference.Height,\n                //WidthRequest = reference.Width\n            };\n        }\n\n        mask.SetBinding(WidthRequestProperty, new Binding\n        {\n            Path = nameof(Width),\n            Source = reference\n        });\n        mask.SetBinding(HeightRequestProperty, new Binding\n        {\n            Path = nameof(Height),\n            Source = reference\n        });\n\n        if (hideOnBackgroundTapped)\n        {\n            mask.GestureRecognizers.Add(new TapGestureRecognizer\n            {\n                Command = dismissCommand\n            });\n        }\n\n        return mask;\n    }\n\n    /// <summary>\n    /// Gets the overlay style for the dialog container page.\n    /// </summary>\n    /// <param name=\"popupView\">The popup view.</param>\n    /// <param name=\"currentPage\">The current page.</param>\n    /// <returns>The overlay style for the dialog container page.</returns>\n    private Style GetOverlayStyle(View popupView, Page currentPage)\n    {\n        var style = DialogLayout.GetMaskStyle(popupView);\n        if (style != null)\n        {\n            return style;\n        }\n\n        return GetStyle(currentPage);\n    }\n\n    /// <summary>\n    /// Gets the style for the specified element.\n    /// </summary>\n    /// <param name=\"element\">The element.</param>\n    /// <returns>The style for the specified element.</returns>\n    private static Style GetStyle(Element element)\n    {\n        if (element is Page page && page.Resources.ContainsKey(DialogLayout.PopupOverlayStyle) && page.Resources[DialogLayout.PopupOverlayStyle] is Style pageStyle)\n            return pageStyle;\n        else if (element is Application app)\n        {\n            if (app.Resources.ContainsKey(DialogLayout.PopupOverlayStyle) && app.Resources[DialogLayout.PopupOverlayStyle] is Style appStyle)\n                return appStyle;\n\n            var overlayStyle = DefaultStyle();\n\n            app.Resources.Add(DialogLayout.PopupOverlayStyle, overlayStyle);\n            return overlayStyle;\n        }\n        else if (element is Window window && window.Parent is null)\n        {\n            // HACK: https://github.com/dotnet/maui/issues/8635\n            window.Parent = Application.Current;\n            return GetStyle(window.Parent);\n        }\n        else\n            return GetStyle(element.Parent);\n    }\n\n    /// <summary>\n    /// Gets the default overlay style for the dialog container page.\n    /// </summary>\n    /// <returns>The default overlay style for the dialog container page.</returns>\n    private static Style DefaultStyle()\n    {\n        var overlayStyle = new Style(typeof(BoxView));\n        overlayStyle.Setters.Add(new Setter { Property = BoxView.OpacityProperty, Value = 0.75 });\n        overlayStyle.Setters.Add(new Setter { Property = BoxView.BackgroundColorProperty, Value = new Color(0, 0, 0, 0x75) });\n        return overlayStyle;\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Dialogs/DialogContainerView.cs",
    "content": "﻿namespace Prism.Dialogs;\n\ninternal class DialogContainerView : ContentView\n{\n    public static readonly BindableProperty IsPageContentProperty =\n        BindableProperty.Create(nameof(IsPageContent), typeof(bool), typeof(DialogContainerView), false);\n\n    public static readonly BindableProperty IsPopupContentProperty =\n        BindableProperty.Create(nameof(IsPopupContent), typeof(bool), typeof(DialogContainerView), false);\n\n    public bool IsPageContent\n    {\n        get => (bool)GetValue(IsPageContentProperty);\n        set => SetValue(IsPageContentProperty, value);\n    }\n\n    public bool IsPopupContent\n    {\n        get => (bool)GetValue(IsPopupContentProperty);\n        set => SetValue(IsPopupContentProperty, value);\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Dialogs/DialogService.cs",
    "content": "using Prism.Common;\n\n#nullable enable\nnamespace Prism.Dialogs;\n\n/// <summary>\n/// Provides a default scoped implementation of the <see cref=\"IDialogService\"/>.\n/// </summary>\npublic sealed class DialogService : DialogServiceBase\n{\n    private readonly IPageAccessor _pageAccessor;\n\n    /// <summary>\n    /// Creates a new instance of the <see cref=\"DialogService\"/> for Maui Applications\n    /// </summary>\n    /// <param name=\"pageAccessor\">The <see cref=\"IPageAccessor\"/> used to determine where in the Navigation Stack we need to process the Dialog.</param>\n    /// <exception cref=\"ArgumentNullException\">Throws when any constructor arguments are null.</exception>\n    public DialogService(IPageAccessor pageAccessor) \n    {\n        ArgumentNullException.ThrowIfNull(pageAccessor);\n        _pageAccessor = pageAccessor;\n    }\n\n    /// <inheritdoc/>\n    protected override Page? GetCurrentPage() => _pageAccessor.Page;\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Dialogs/DialogServiceBase.cs",
    "content": "﻿using Prism.Commands;\nusing Prism.Common;\nusing Prism.Dialogs.Xaml;\nusing Prism.Mvvm;\nusing Prism.Navigation;\nusing Prism.Navigation.Xaml;\n\n#nullable enable\nnamespace Prism.Dialogs;\n\n/// <summary>\n/// Provides the ability to display dialogs from ViewModels.\n/// </summary>\npublic abstract class DialogServiceBase : IDialogService\n{\n    /// <inheritdoc/>\n    public void ShowDialog(string name, IDialogParameters parameters, DialogCallback callback)\n    {\n        IDialogContainer? dialogModal = null;\n        try\n        {\n            parameters = UriParsingHelper.GetSegmentParameters(name, parameters ?? new DialogParameters());\n\n            var currentPage = GetCurrentPage();\n            ArgumentNullException.ThrowIfNull(currentPage);\n            var container = currentPage.GetContainerProvider();\n            // This needs to be resolved when called as a Module could load any time\n            // and register new dialogs\n            var registry = container.Resolve<IDialogViewRegistry>();\n            var view = registry.CreateView(container, UriParsingHelper.GetSegmentName(name)) as View \n                ?? throw new ViewCreationException(name, ViewType.Dialog);\n\n            dialogModal = container.Resolve<IDialogContainer>();\n            IDialogContainer.DialogStack.Add(dialogModal);\n            var dialogAware = GetDialogController(view);\n\n            async Task DialogAware_RequestClose(IDialogResult outResult)\n            {\n                bool didCloseDialog = true;\n                try\n                {\n                    var result = await CloseDialogAsync(outResult ?? new DialogResult(), currentPage, dialogModal);\n                    if (result.Exception is DialogException de && de.Message == DialogException.CanCloseIsFalse)\n                    {\n                        didCloseDialog = false;\n                        return;\n                    }\n\n                    await callback.Invoke(result);\n                    GC.Collect();\n                }\n                catch (DialogException dex)\n                {\n                    if (dex.Message == DialogException.CanCloseIsFalse)\n                    {\n                        didCloseDialog = false;\n                        return;\n                    }\n\n                    var result = new DialogResult\n                    {\n                        Exception = dex,\n                        Parameters = parameters,\n                        Result = ButtonResult.None\n                    };\n\n                    if (dex.Message != DialogException.CanCloseIsFalse)\n                    {\n                        await InvokeError(callback, dex, parameters);\n                    }\n                }\n                catch (Exception ex)\n                {\n                    await InvokeError(callback, ex, parameters);\n                }\n                finally\n                {\n                    if (didCloseDialog && dialogModal is not null)\n                    {\n                        IDialogContainer.DialogStack.Remove(dialogModal);\n                    }\n                }\n            }\n\n            DialogUtilities.InitializeListener(dialogAware, DialogAware_RequestClose);\n\n            dialogAware.OnDialogOpened(parameters);\n\n            if (!parameters.TryGetValue<bool>(KnownDialogParameters.CloseOnBackgroundTapped, out var closeOnBackgroundTapped))\n            {\n                var dialogLayoutCloseOnBackgroundTapped = DialogLayout.GetCloseOnBackgroundTapped(view);\n                if (dialogLayoutCloseOnBackgroundTapped.HasValue)\n                {\n                    closeOnBackgroundTapped = dialogLayoutCloseOnBackgroundTapped.Value;\n                }\n            }\n\n            var dismissCommand = new DelegateCommand(() => dialogAware.RequestClose.Invoke(), dialogAware.CanCloseDialog);\n\n            PageNavigationService.NavigationSource = PageNavigationSource.DialogService;\n            dialogModal.ConfigureLayout(currentPage, view, closeOnBackgroundTapped, dismissCommand, parameters);\n            PageNavigationService.NavigationSource = PageNavigationSource.Device;\n\n            MvvmHelpers.InvokeViewAndViewModelAction<IActiveAware>(currentPage, aa => aa.IsActive = false);\n            MvvmHelpers.InvokeViewAndViewModelAction<IActiveAware>(view, aa => aa.IsActive = true);\n        }\n        catch (Exception ex)\n        {\n            callback.Invoke(ex);\n        }\n    }\n\n    /// <summary>\n    /// Gets the currently displayed page for the Application\n    /// </summary>\n    /// <returns></returns>\n    protected abstract Page? GetCurrentPage();\n\n    private static async Task InvokeError(DialogCallback callback, Exception exception, IDialogParameters parameters)\n    {\n        var result = new DialogResult \n        {\n            Parameters = parameters,\n            Exception = exception,\n            Result = ButtonResult.None\n        };\n        await callback.Invoke(result);\n    }\n\n    private static async Task<IDialogResult> CloseDialogAsync(IDialogResult result, Page currentPage, IDialogContainer dialogModal)\n    {\n        try\n        {\n            PageNavigationService.NavigationSource = PageNavigationSource.DialogService;\n\n            result ??= new DialogResult();\n            if (result.Parameters is null)\n            {\n                result = new DialogResult\n                {\n                    Exception = result.Exception,\n                    Parameters = new DialogParameters(),\n                    Result = result.Result\n                };\n            }\n\n            var view = dialogModal.DialogView;\n            var dialogAware = GetDialogController(view);\n\n            if (!dialogAware.CanCloseDialog())\n            {\n                throw new DialogException(DialogException.CanCloseIsFalse);\n            }\n\n            PageNavigationService.NavigationSource = PageNavigationSource.DialogService;\n            await dialogModal.DoPop(currentPage);\n            PageNavigationService.NavigationSource = PageNavigationSource.Device;\n\n            MvvmHelpers.InvokeViewAndViewModelAction<IActiveAware>(view, aa => aa.IsActive = false);\n            MvvmHelpers.InvokeViewAndViewModelAction<IActiveAware>(currentPage, aa => aa.IsActive = true);\n            dialogAware.OnDialogClosed();\n\n            return result;\n        }\n        catch (DialogException)\n        {\n            throw;\n        }\n        catch (Exception ex)\n        {\n            return new DialogResult\n            {\n                Exception = ex,\n                Parameters = result.Parameters,\n                Result = result.Result\n            };\n        }\n        finally\n        {\n            PageNavigationService.NavigationSource = PageNavigationSource.Device;\n        }\n    }\n\n    private static IDialogAware GetDialogController(View view)\n    {\n        if (view is IDialogAware viewAsDialogAware)\n        {\n            return viewAsDialogAware;\n        }\n        else if (view.BindingContext is null)\n        {\n            throw new DialogException(DialogException.NoViewModel);\n        }\n        else if (view.BindingContext is IDialogAware dialogAware)\n        {\n            return dialogAware;\n        }\n\n        throw new DialogException(DialogException.ImplementIDialogAware);\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Dialogs/DialogViewRegistry.cs",
    "content": "﻿using Prism.Mvvm;\n\nnamespace Prism.Dialogs;\n\n/// <summary>\n/// Implementation of a view registry specifically for dialog views.\n/// </summary>\npublic class DialogViewRegistry : ViewRegistryBase, IDialogViewRegistry\n{\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"DialogViewRegistry\"/> class with the specified view registrations.\n    /// </summary>\n    /// <param name=\"registrations\">The collection of view registrations to manage.</param>\n    public DialogViewRegistry(IEnumerable<ViewRegistration> registrations)\n        : base(ViewType.Dialog, registrations)\n    {\n    }\n\n    /// <summary>\n    /// Configures a dialog view with the specified context and container provider.\n    /// </summary>\n    /// <param name=\"bindable\">The bindable object representing the dialog view to configure.</param>\n    /// <param name=\"container\">The container provider to use for resolving dependencies.</param>\n    protected override void ConfigureView(BindableObject bindable, IContainerProvider container)\n    {\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Dialogs/IDialogContainer.cs",
    "content": "using System.Windows.Input;\n\n#nullable enable\nnamespace Prism.Dialogs;\n\n/// <summary>\n/// Interface representing a container for managing dialogs.\n/// </summary>\npublic interface IDialogContainer\n{\n    /// <summary>\n    /// Gets a stack of currently active dialog containers.\n    /// </summary>\n    /// <remarks>\n    /// This property provides access to the list of dialogs currently displayed, typically in the order they were presented.\n    /// </remarks>\n    static IList<IDialogContainer> DialogStack { get; } = [];\n\n    /// <summary>\n    /// Gets the view associated with the currently displayed dialog.\n    /// </summary>\n    View DialogView { get; }\n\n    /// <summary>\n    /// Gets a command that can be used to dismiss the currently displayed dialog.\n    /// </summary>\n    ICommand Dismiss { get; }\n\n    /// <summary>\n    /// Configures the layout and behavior of the dialog.\n    /// </summary>\n    /// <param name=\"currentPage\">The page on which the dialog is being displayed.</param>\n    /// <param name=\"dialogView\">The view representing the dialog content.</param>\n    /// <param name=\"hideOnBackgroundTapped\">True if the dialog should close when the background is tapped, false otherwise.</param>\n    /// <param name=\"dismissCommand\">The command to execute when the dialog is dismissed.</param>\n    /// <param name=\"parameters\">Optional parameters to pass to the dialog.</param>\n    /// <returns>A task representing the completion of the configuration process.</returns>\n    Task ConfigureLayout(Page currentPage, View dialogView, bool hideOnBackgroundTapped, ICommand dismissCommand, IDialogParameters parameters);\n\n    /// <summary>\n    /// Performs the internal logic to display or dismiss the dialog.\n    /// </summary>\n    /// <param name=\"currentPage\">The page on which the dialog is being displayed.</param>\n    /// <returns>A task representing the completion of the pop operation.</returns>\n    Task DoPop(Page currentPage);\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Dialogs/IDialogViewRegistry.cs",
    "content": "﻿using Prism.Mvvm;\n\nnamespace Prism.Dialogs;\n\n/// <summary>\n/// Interface that defines a registry for managing views specific to dialogs.\n/// </summary>\npublic interface IDialogViewRegistry : IViewRegistry\n{\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Dialogs/KnownDialogParameters.cs",
    "content": "﻿\nnamespace Prism.Dialogs;\n\n/// <summary>\n/// Provides well-known parameter names used for configuring dialogs.\n/// </summary>\npublic static class KnownDialogParameters\n{\n    /// <summary>\n    /// Parameter name used to control whether a dialog should close when the background is tapped.\n    /// </summary>\n    public const string CloseOnBackgroundTapped = \"closeOnBackgroundTapped\";\n\n    /// <summary>\n    /// Parameter name used to pass additional custom parameters to a dialog.\n    /// </summary>\n    public const string XamlParam = \"xamlParam\";\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Dialogs/RelativeContentSizeConverter.cs",
    "content": "using System.Globalization;\n\nnamespace Prism.Dialogs;\n\ninternal class RelativeContentSizeConverter : IValueConverter\n{\n    private double relativeSize;\n    public double RelativeSize\n    {\n        get => relativeSize;\n        set\n        {\n            if (value == 0)\n            {\n                relativeSize = -1;\n            }\n            else if (value > 1)\n            {\n                relativeSize = value / 100;\n            }\n            else\n            {\n                relativeSize = value;\n            }\n        }\n    }\n\n    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)\n    {\n        var pageSize = double.Parse(value.ToString());\n        if (pageSize < 0)\n            return pageSize;\n\n        return RelativeSize * pageSize;\n    }\n\n    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)\n    {\n        throw new NotImplementedException();\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Dialogs/SingletonDialogService.cs",
    "content": "using System.ComponentModel;\nusing Prism.Navigation;\n\n#nullable enable\nnamespace Prism.Dialogs;\n\n/// <summary>\n/// Provides an experimental implementation of the <see cref=\"IDialogService\"/> which can be used from a Singleton Context.\n/// </summary>\n/// <remarks>\n/// This is experimental and may produce undesirable outcomes.\n/// To use this register this like `container.RegisterSingleton&lt;IDialogService, SingletonDialogService&gt;();`\n/// </remarks>\n[EditorBrowsable(EditorBrowsableState.Never)]\npublic sealed class SingletonDialogService : DialogServiceBase\n{\n    private readonly IWindowManager _windowManager;\n\n    /// <summary>\n    /// Initializes a new SingletonDialogService\n    /// </summary>\n    /// <param name=\"windowManager\">An instance of the <see cref=\"IWindowManager\"/>.</param>\n    public SingletonDialogService(IWindowManager windowManager)\n    {\n        ArgumentNullException.ThrowIfNull(windowManager);\n        _windowManager = windowManager;\n    }\n\n    /// <inheritdoc/>\n    protected override Page? GetCurrentPage()\n    {\n        if (_windowManager.Current is null)\n            throw new NotSupportedException(\"There is currently no application window.\");\n        else if (_windowManager.Current is not PrismWindow prismWindow)\n            throw new NotSupportedException($\"The current window '{_windowManager.Current.GetType().FullName}' is not a PrismWindow.\");\n        else\n            return prismWindow.CurrentPage;\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Dialogs/Xaml/DialogLayout.cs",
    "content": "namespace Prism.Dialogs.Xaml;\n\n/// <summary>\n/// Provides attached properties for customizing the layout and behavior of dialogs in .NET MAUI.\n/// </summary>\npublic static class DialogLayout\n{\n    /// <summary>\n    /// Gets the key for specifying or retrieving popup overlay style from Application Resources.\n    /// </summary>\n    public const string PopupOverlayStyle = \"PrismDialogMaskStyle\";\n\n    /// <summary>\n    /// Attached property that specifies the desired relative width of the dialog.\n    /// </summary>\n    public static readonly BindableProperty RelativeWidthRequestProperty =\n        BindableProperty.CreateAttached(\"RelativeWidthRequest\", typeof(double?), typeof(DialogLayout), null);\n\n    /// <summary>\n    /// Gets the value of the RelativeWidthRequest attached property from the specified BindableObject.\n    /// </summary>\n    /// <param name=\"bindable\">The BindableObject to get the property value from.</param>\n    /// <returns>The value of the RelativeWidthRequest property, or null if not set.</returns>\n    public static double? GetRelativeWidthRequest(BindableObject bindable) =>\n        (double?)bindable.GetValue(RelativeWidthRequestProperty);\n\n    /// <summary>\n    /// Sets the value of the RelativeWidthRequest attached property on the specified BindableObject.\n    /// </summary>\n    /// <param name=\"bindable\">The BindableObject to set the property value on.</param>\n    /// <param name=\"value\">The desired relative width of the dialog.</param>\n    public static void SetRelativeWidthRequest(BindableObject bindable, double? value) =>\n        bindable.SetValue(RelativeWidthRequestProperty, value);\n\n    /// <summary>\n    /// Attached property that specifies the desired relative height of the dialog.\n    /// </summary>\n    public static readonly BindableProperty RelativeHeightRequestProperty =\n        BindableProperty.CreateAttached(\"RelativeHeightRequest\", typeof(double?), typeof(DialogLayout), null);\n\n    /// <summary>\n    /// Gets the value of the RelativeHeightRequest attached property from the specified BindableObject.\n    /// </summary>\n    /// <param name=\"bindable\">The BindableObject to get the property value from.</param>\n    /// <returns>The value of the RelativeHeightRequest property, or null if not set.</returns>\n    public static double? GetRelativeHeightRequest(BindableObject bindable) =>\n        (double?)bindable.GetValue(RelativeHeightRequestProperty);\n\n    /// <summary>\n    /// Sets the value of the RelativeHeightRequest attached property on the specified BindableObject.\n    /// </summary>\n    /// <param name=\"bindable\">The BindableObject to set the property value on.</param>\n    /// <param name=\"value\">The desired relative height of the dialog.</param>\n    public static void SetRelativeHeightRequest(BindableObject bindable, double? value) =>\n        bindable.SetValue(RelativeHeightRequestProperty, value);\n\n    /// <summary>\n    /// Attached property that specifies the layout bounds of the dialog within its parent.\n    /// </summary>\n    public static readonly BindableProperty LayoutBoundsProperty =\n        BindableProperty.CreateAttached(\"LayoutBounds\", typeof(Rect), typeof(DialogLayout), new Rect(0.5, 0.5, -1, -1));\n\n    /// <summary>\n    /// Gets the value of the LayoutBounds attached property from the specified BindableObject.\n    /// </summary>\n    /// <param name=\"bindable\">The BindableObject to get the property value from.</param>\n    /// <returns>The layout bounds of the dialog.</returns>\n    public static Rect GetLayoutBounds(BindableObject bindable) =>\n        (Rect)bindable.GetValue(LayoutBoundsProperty);\n\n    /// <summary>\n    /// Sets the value of the LayoutBounds attached property on the specified BindableObject.\n    /// </summary>\n    /// <param name=\"bindable\">The BindableObject to set the property value on.</param>\n    /// <param name=\"value\">The desired layout bounds for the dialog.</param>\n    public static void SetLayoutBounds(BindableObject bindable, Rect value) =>\n        bindable.SetValue(LayoutBoundsProperty, value);\n\n    /// <summary>\n    /// Attached property that specifies the style to apply to the dialog mask (background overlay).\n    /// </summary>\n    public static readonly BindableProperty MaskStyleProperty =\n        BindableProperty.CreateAttached(\"MaskStyle\", typeof(Style), typeof(DialogLayout), null);\n\n    /// <summary>\n    /// Gets the style applied to the dialog mask (background overlay) from the specified BindableObject.\n    /// </summary>\n    /// <param name=\"bindable\">The BindableObject to get the mask style from.</param>\n    /// <returns>The style applied to the dialog mask, or null if not set.</returns>\n    public static Style GetMaskStyle(BindableObject bindable) =>\n        (Style)bindable.GetValue(MaskStyleProperty);\n\n    /// <summary>\n    /// Sets the style to be applied to the dialog mask (background overlay) on the specified BindableObject.\n    /// </summary>\n    /// <param name=\"bindable\">The BindableObject to set the mask style on.</param>\n    /// <param name=\"value\">The style to apply to the dialog mask.</param>\n    public static void SetMaskStyle(BindableObject bindable, Style value) =>\n        bindable.SetValue(MaskStyleProperty, value);\n\n    /// <summary>\n    /// Attached property that specifies the View to be used as the dialog mask (background overlay).\n    /// </summary>\n    public static readonly BindableProperty MaskProperty =\n        BindableProperty.CreateAttached(\"Mask\", typeof(View), typeof(DialogLayout), null);\n\n    /// <summary>\n    /// Gets the View used as the dialog mask (background overlay) from the specified BindableObject.\n    /// </summary>\n    /// <param name=\"bindable\">The BindableObject to get the mask view from.</param>\n    /// <returns>The View used as the dialog mask, or null if not set.</returns>\n    public static View GetMask(BindableObject bindable) =>\n        (View)bindable.GetValue(MaskProperty);\n\n    /// <summary>\n    /// Sets the View to be used as the dialog mask (background overlay) on the specified BindableObject.\n    /// </summary>\n    /// <param name=\"bindable\">The BindableObject to set the mask view on.</param>\n    /// <param name=\"value\">The View to use as the dialog mask.</param>\n    public static void SetMask(BindableObject bindable, View value) =>\n        bindable.SetValue(MaskProperty, value);\n\n    /// <summary>\n    /// Attached property that specifies whether a dialog should use a mask (background overlay).\n    /// </summary>\n    public static readonly BindableProperty UseMaskProperty =\n        BindableProperty.CreateAttached(\"UseMask\", typeof(bool?), typeof(DialogLayout), null);\n\n    /// <summary>\n    /// Gets whether a mask is used for the dialog from the specified BindableObject.\n    /// </summary>\n    /// <param name=\"bindable\">The BindableObject to get the mask usage from.</param>\n    /// <returns>True if a mask is used for the dialog, false if not, or null if not explicitly set.</returns>\n    public static bool? GetUseMask(BindableObject bindable)\n    {\n        // Default to using a mask if not explicitly set\n        return bindable.GetValue(UseMaskProperty) is bool boolean ? boolean : true;\n    }\n\n    /// <summary>\n    /// Sets whether a mask should be used for the dialog on the specified BindableObject.\n    /// </summary>\n    /// <param name=\"bindable\">The BindableObject to set the mask usage on.</param>\n    /// <param name=\"value\">True to use a mask for the dialog, false to not use a mask, or null to use the default behavior.</param>\n    public static void SetUseMask(BindableObject bindable, bool? value) =>\n        bindable.SetValue(UseMaskProperty, value);\n\n    /// <summary>\n    /// Attached property that specifies whether the dialog should close when the background is tapped.\n    /// </summary>\n    public static readonly BindableProperty CloseOnBackgroundTappedProperty =\n        BindableProperty.CreateAttached(\"CloseOnBackgroundTapped\", typeof(bool?), typeof(DialogLayout), null);\n\n    /// <summary>\n    /// Gets whether the dialog closes when the background is tapped from the specified BindableObject.\n    /// </summary>\n    /// <param name=\"bindable\">The BindableObject to get the close-on-background-tap behavior from.</param>\n    /// <returns>True if the dialog closes on background tap, false if not, or null if not explicitly set.</returns>\n    public static bool? GetCloseOnBackgroundTapped(BindableObject bindable) =>\n        (bool?)bindable.GetValue(CloseOnBackgroundTappedProperty);\n\n    /// <summary>\n    /// Sets whether the dialog should close when the background is tapped on the specified BindableObject.\n    /// </summary>\n    /// <param name=\"bindable\">The BindableObject to set the close-on-background-tap behavior on.</param>\n    /// <param name=\"value\">True to close the dialog on background tap, false to not close on background tap, or null to use the default behavior.</param>\n    public static void SetCloseOnBackgroundTapped(BindableObject bindable, bool? value) =>\n        bindable.SetValue(CloseOnBackgroundTappedProperty, value);\n\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Dialogs/Xaml/ShowDialogExtension.cs",
    "content": "using System.Windows.Input;\nusing Microsoft.Extensions.Logging;\nusing Prism.Ioc;\nusing Prism.Navigation.Xaml;\nusing Prism.Xaml;\n\nnamespace Prism.Dialogs.Xaml;\n\n[ContentProperty(nameof(Name))]\n[RequireService([typeof(IProvideValueTarget)])]\npublic class ShowDialogExtension : TargetAwareExtensionBase<ICommand>, ICommand\n{\n    public static readonly BindableProperty NameProperty =\n        BindableProperty.Create(nameof(Name), typeof(string), typeof(ShowDialogExtension), null);\n\n    public static readonly BindableProperty IsExecutingProperty =\n        BindableProperty.Create(nameof(IsExecuting), typeof(bool), typeof(ShowDialogExtension), false);\n\n    public string Name\n    {\n        get => (string)GetValue(NameProperty);\n        set => SetValue(NameProperty, value);\n    }\n\n    public bool IsExecuting\n    {\n        get => (bool)GetValue(IsExecutingProperty);\n        set => SetValue(IsExecutingProperty, value);\n    }\n\n    public event EventHandler CanExecuteChanged;\n\n    public bool CanExecute(object parameter) =>\n        !IsExecuting;\n\n    public void Execute(object parameter)\n    {\n        IsExecuting = true;\n        CanExecuteChanged(this, EventArgs.Empty);\n\n        try\n        {\n            var parameters = parameter.ToDialogParameters(TargetElement);\n            var dialogService = Page.GetContainerProvider().Resolve<IDialogService>();\n            dialogService.ShowDialog(Name, parameters, DialogClosedCallback);\n        }\n        catch (Exception ex)\n        {\n            Logger.LogWarning($\"An unexpected error occurred while showing the Dialog '{Name}'.\\n{ex}\");\n        }\n    }\n\n    private void DialogClosedCallback(IDialogResult result)\n    {\n        OnDialogClosed(result);\n\n        IsExecuting = false;\n        CanExecuteChanged(this, EventArgs.Empty);\n    }\n\n    protected virtual void OnDialogClosed(IDialogResult result)\n    {\n        if (result.Exception != null)\n        {\n            Logger.LogWarning($\"Dialog '{Name}' closed with an error:\\n{result.Exception}\");\n        }\n    }\n\n    protected override ICommand ProvideValue(IServiceProvider serviceProvider) =>\n        this;\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Events/NavigationRequestEvent.cs",
    "content": "﻿using Prism.Navigation;\n\nnamespace Prism.Events;\n\npublic class NavigationRequestEvent : PubSubEvent<NavigationRequestContext>\n{\n}\n\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Extensions/CollectionExtensions.cs",
    "content": "﻿namespace Prism.Extensions;\n\ninternal static class CollectionExtensions\n{\n    public static void ForEach<T>(this IReadOnlyList<T> list, Action<T> action)\n    {\n        foreach (var item in list)\n            action(item);\n    }\n\n    public static void ForEach<T>(this IList<T> list, Action<T> action)\n    {\n        foreach (var item in list)\n            action(item);\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Extensions/VisualElementExtensions.cs",
    "content": "﻿namespace Prism.Extensions;\n\ninternal static class VisualElementExtensions\n{\n    public static bool TryGetParentPage(this VisualElement element, out Page page)\n    {\n        page = GetParentPage(element);\n        return page != null;\n    }\n\n    public static Element GetRoot(this Element element)\n    {\n        return element.Parent switch\n        {\n            null => element,\n            _ => GetRoot(element.Parent),\n        };\n    }\n\n    internal static Page GetParentPage(this Element visualElement)\n    {\n        return visualElement.Parent switch\n        {\n            Page page => page,\n            null => null,\n            _ => GetParentPage(visualElement.Parent),\n        };\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Ioc/BehaviorFactoryRegistrationExtensions.cs",
    "content": "﻿using System.Diagnostics.CodeAnalysis;\nusing Prism.Behaviors;\n\nnamespace Prism.Ioc;\n\n/// <summary>\n/// Provides extensions for registering Behaviors to add to pages.\n/// </summary>\npublic static class BehaviorFactoryRegistrationExtensions\n{\n    /// <summary>\n    /// Registers a provided action to apply a behavior or other logic to configure your <see cref=\"Page\"/>\n    /// </summary>\n    /// <param name=\"container\"></param>\n    /// <param name=\"pageBehaviorFactory\"></param>\n    /// <returns>The <see cref=\"IContainerRegistry\"/>.</returns>\n    public static IContainerRegistry RegisterPageBehaviorFactory(this IContainerRegistry container, Action<Page> pageBehaviorFactory) => \n        container.RegisterInstance<IPageBehaviorFactory>(new DelegatePageBehaviorFactory(pageBehaviorFactory));\n\n    /// <summary>\n    /// Registers a provided action to apply a behavior or other logic to configure your <see cref=\"Page\"/>\n    /// </summary>\n    /// <param name=\"container\"></param>\n    /// <param name=\"pageBehaviorFactory\"></param>\n    /// <returns>The <see cref=\"IContainerRegistry\"/>.</returns>\n    public static IContainerRegistry RegisterPageBehaviorFactory(this IContainerRegistry container, Action<IContainerProvider, Page> pageBehaviorFactory) =>\n        container.RegisterScoped<IPageBehaviorFactory>(c => new DelegateContainerPageBehaviorFactory(pageBehaviorFactory, c));\n\n    /// <summary>\n    /// Adds a specified <typeparamref name=\"TBehavior\"/> to all <see cref=\"Page\"/>'s that are created.\n    /// </summary>\n    /// <typeparam name=\"TBehavior\"></typeparam>\n    /// <param name=\"container\"></param>\n    /// <returns></returns>\n    public static IContainerRegistry RegisterPageBehavior<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] TBehavior>(this IContainerRegistry container)\n        where TBehavior : Behavior =>\n        container\n            .Register<TBehavior>()\n            .RegisterPageBehaviorFactory((c, p) => p.Behaviors.Add(c.Resolve<TBehavior>()));\n\n    /// <summary>\n    /// This will apply the <typeparamref name=\"TBehavior\"/> to the <see cref=\"Page\"/>, when it is a <typeparamref name=\"TPage\"/>.\n    /// </summary>\n    /// <typeparam name=\"TPage\">The type of Page</typeparam>\n    /// <typeparam name=\"TBehavior\">The type of Behavior</typeparam>\n    /// <param name=\"container\"></param>\n    /// <returns></returns>\n    public static IContainerRegistry RegisterPageBehavior<TPage, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] TBehavior>(this IContainerRegistry container)\n        where TPage : Page\n        where TBehavior : Behavior =>\n        container\n            .Register<TBehavior>()\n            .RegisterPageBehaviorFactory((c, p) =>\n            {\n                if (p is TPage)\n                    p.Behaviors.Add(c.Resolve<TBehavior>());\n            });\n\n    /// <summary>\n    /// Registers an <see cref=\"Action{Page}\"/> delegate to execute on a given Page instance. This could apply a <see cref=\"Behavior\"/>\n    /// or it could add attached properties such Platform Specifics.\n    /// </summary>\n    /// <param name=\"services\">The <see cref=\"IServiceCollection\"/>.</param>\n    /// <param name=\"pageBehaviorFactory\">The delegate action to perform on the <see cref=\"Page\"/>.</param>\n    /// <returns>The <see cref=\"IServiceCollection\"/>.</returns>\n    public static IServiceCollection RegisterPageBehaviorFactory(this IServiceCollection services, Action<Page> pageBehaviorFactory) =>\n        services.AddSingleton<IPageBehaviorFactory>(new DelegatePageBehaviorFactory(pageBehaviorFactory));\n\n    /// <summary>\n    /// Registers an <see cref=\"Action{IContainerProvider,Page}\"/> delegate to execute on a given Page instance. This could apply a <see cref=\"Behavior\"/>\n    /// or it could add attached properties such Platform Specifics.\n    /// </summary>\n    /// <param name=\"services\">The <see cref=\"IServiceCollection\"/>.</param>\n    /// <param name=\"pageBehaviorFactory\">The delegate action to perform on the <see cref=\"Page\"/>.</param>\n    /// <returns>The <see cref=\"IServiceCollection\"/>.</returns>\n    public static IServiceCollection RegisterPageBehaviorFactory(this IServiceCollection services, Action<IContainerProvider, Page> pageBehaviorFactory) =>\n        services.AddScoped<IPageBehaviorFactory>(c => new DelegateContainerPageBehaviorFactory(pageBehaviorFactory, c.GetRequiredService<IContainerProvider>()));\n\n    /// <summary>\n    /// Registers a given <see cref=\"Behavior\"/> for all Pages.\n    /// </summary>\n    /// <typeparam name=\"TBehavior\">The <see cref=\"Behavior\"/> type.</typeparam>\n    /// <param name=\"services\">The <see cref=\"IServiceCollection\"/>.</param>\n    /// <returns>The <see cref=\"IServiceCollection\"/>.</returns>\n    public static IServiceCollection RegisterPageBehavior<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] TBehavior>(this IServiceCollection services)\n        where TBehavior : Behavior =>\n        services\n            .AddTransient<TBehavior>()\n            .RegisterPageBehaviorFactory((c, p) => p.Behaviors.Add(c.Resolve<TBehavior>()));\n\n    /// <summary>\n    /// Registers a given <see cref=\"Behavior\"/> for the specified type of <see cref=\"Page\"/>\n    /// </summary>\n    /// <typeparam name=\"TPage\">The <see cref=\"Page\"/> type.</typeparam>\n    /// <typeparam name=\"TBehavior\">The <see cref=\"Behavior\"/> type.</typeparam>\n    /// <param name=\"services\">The <see cref=\"IServiceCollection\"/>.</param>\n    /// <returns>The <see cref=\"IServiceCollection\"/>.</returns>\n    public static IServiceCollection RegisterPageBehavior<TPage, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] TBehavior>(this IServiceCollection services)\n        where TPage : Page\n        where TBehavior : Behavior =>\n        services\n            .AddTransient<TBehavior>()\n            .RegisterPageBehaviorFactory((c, p) =>\n            {\n                if (p is TPage)\n                    p.Behaviors.Add(c.Resolve<TBehavior>());\n            });\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Ioc/ContainerProvider.cs",
    "content": "#nullable enable\nnamespace Prism.IoC;\n\n/// <summary>\n/// Provides Types and Services registered with the Container\n/// </summary>\n/// <typeparam name=\"T\">The type to Resolve</typeparam>\n/// <example>\n/// We can use this to build better types such as ValueConverters with full dependency injection\n/// <code>\n/// public class MyValueConverter : IValueConverter\n/// {\n///     private readonly ILogger _logger { get; }\n///     \n///     public MyValueConverter(ILogger logger)\n///     {\n///         _logger = logger;\n///     }\n///\n///     public object Convert(object value, Type targetType, object parameter, CultureInfo culture)\n///     {\n///         _logger.Log($\"Converting {value.GetType().Name} to {targetType.Name}\", Category.Debug, Priority.None);\n///         // do stuff\n///     }\n///\n///     public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)\n///     {\n///         _logger.Log($\"Converting back from {value.GetType().Name} to {targetType.Name}\", Category.Debug, Priority.None);\n///         return null;\n///     }\n/// }\n/// </code>\n/// We can then simply use our ValueConverter or other class directly in XAML\n/// <![CDATA[\n/// <ContentPage xmlns:prism=\"clr-namespace:Prism.Ioc;assembly=Prism.Maui\">\n///     <ContentPage.Resources>\n///         <ResourceDictionary>\n///             <prism:ContainerProvider x:TypeArguments=\"MyValueConverter\" x:Key=\"myValueConverter\" />\n///         <ResourceDictionary>\n///     <ContentPage.Resources>\n///     <Label Text=\"{Binding SomeProp, Converter={StaticResource myValueConverter}}\" />\n/// </ContentPage>\n/// ]]>\n/// </example>\npublic class ContainerProvider<T>\n{\n    /// <summary>\n    /// The Name used to register the type with the Container\n    /// </summary>\n    public string? Name { get; set; }\n\n    /// <summary>\n    /// Resolves the specified type from the Application's Container\n    /// </summary>\n    /// <param name=\"containerProvider\"></param>\n    public static implicit operator T(ContainerProvider<T> containerProvider)\n    {\n        var container = ContainerLocator.Container;\n        if (container == null) return default(T);\n        if (string.IsNullOrWhiteSpace(containerProvider.Name))\n        {\n            return container.Resolve<T>();\n        }\n\n        return container.Resolve<T>(containerProvider.Name);\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Ioc/DialogRegistrationExtensions.cs",
    "content": "using System.Diagnostics.CodeAnalysis;\nusing Prism.Dialogs;\nusing Prism.Mvvm;\n\nnamespace Prism.Ioc;\n\n/// <summary>\n/// Provides extension methods for registering dialogs in the Prism container.\n/// </summary>\npublic static class DialogRegistrationExtensions\n{\n    /// <summary>\n    /// Registers a dialog with the specified view type in the container.\n    /// </summary>\n    /// <typeparam name=\"TView\">The type of the dialog view.</typeparam>\n    /// <param name=\"containerRegistry\">The container registry.</param>\n    /// <param name=\"name\">The name of the dialog.</param>\n    /// <returns>The container registry.</returns>\n    /// <remarks>\n    /// The view type must inherit from <see cref=\"View\"/>.\n    /// </remarks>\n    public static IContainerRegistry RegisterDialog<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] TView>(this IContainerRegistry containerRegistry, string name = null)\n            where TView : View =>\n        containerRegistry.RegisterDialog(typeof(TView), null, name);\n\n    /// <summary>\n    /// Registers a dialog with the specified view and view model types in the container.\n    /// </summary>\n    /// <typeparam name=\"TView\">The type of the dialog view.</typeparam>\n    /// <typeparam name=\"TViewModel\">The type of the dialog view model.</typeparam>\n    /// <param name=\"containerRegistry\">The container registry.</param>\n    /// <param name=\"name\">The name of the dialog.</param>\n    /// <returns>The container registry.</returns>\n    /// <remarks>\n    /// The view type must inherit from <see cref=\"View\"/>.\n    /// </remarks>\n    public static IContainerRegistry RegisterDialog<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] TView, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] TViewModel>(this IContainerRegistry containerRegistry, string name = null)\n        where TView : View =>\n        containerRegistry.RegisterDialog(typeof(TView), typeof(TViewModel), name);\n\n    /// <summary>\n    /// Registers a dialog with the specified view and view model types in the container.\n    /// </summary>\n    /// <param name=\"container\">The container registry.</param>\n    /// <param name=\"view\">The type of the dialog view.</param>\n    /// <param name=\"viewModel\">The type of the dialog view model.</param>\n    /// <param name=\"name\">The name of the dialog.</param>\n    /// <returns>The container registry.</returns>\n    /// <remarks>\n    /// The view type must inherit from <see cref=\"View\"/>.\n    /// </remarks>\n    public static IContainerRegistry RegisterDialog(this IContainerRegistry container, Type view, Type viewModel, string name = null)\n    {\n        container.RegisterInstance(GetViewRegistration(view, viewModel, name))\n            .Register(view);\n\n        if (viewModel != null)\n            container.Register(viewModel);\n        return container;\n    }\n\n    /// <summary>\n    /// Registers a dialog container in the container.\n    /// </summary>\n    /// <typeparam name=\"T\">The type of the dialog container.</typeparam>\n    /// <param name=\"container\">The container registry.</param>\n    /// <returns>The container registry.</returns>\n    public static IContainerRegistry RegisterDialogContainer<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] T>(this IContainerRegistry container)\n        where T : class, IDialogContainer =>\n        container.Register<IDialogContainer, T>();\n\n    /// <summary>\n    /// Registers a dialog with the specified view type in the service collection.\n    /// </summary>\n    /// <typeparam name=\"TView\">The type of the dialog view.</typeparam>\n    /// <param name=\"services\">The service collection.</param>\n    /// <param name=\"name\">The name of the dialog.</param>\n    /// <returns>The service collection.</returns>\n    /// <remarks>\n    /// The view type must inherit from <see cref=\"View\"/>.\n    /// </remarks>\n    public static IServiceCollection RegisterDialog<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] TView>(this IServiceCollection services, string name = null)\n            where TView : View =>\n        services.RegisterDialog(typeof(TView), null, name);\n\n    /// <summary>\n    /// Registers a dialog with the specified view and view model types in the service collection.\n    /// </summary>\n    /// <typeparam name=\"TView\">The type of the dialog view.</typeparam>\n    /// <typeparam name=\"TViewModel\">The type of the dialog view model.</typeparam>\n    /// <param name=\"services\">The service collection.</param>\n    /// <param name=\"name\">The name of the dialog.</param>\n    /// <returns>The service collection.</returns>\n    /// <remarks>\n    /// The view type must inherit from <see cref=\"View\"/>.\n    /// </remarks>\n    public static IServiceCollection RegisterDialog<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] TView, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] TViewModel>(this IServiceCollection services, string name = null)\n        where TView : View =>\n        services.RegisterDialog(typeof(TView), typeof(TViewModel), name);\n\n    /// <summary>\n    /// Registers a dialog with the specified view and view model types in the service collection.\n    /// </summary>\n    /// <param name=\"services\">The service collection.</param>\n    /// <param name=\"view\">The type of the dialog view.</param>\n    /// <param name=\"viewModel\">The type of the dialog view model.</param>\n    /// <param name=\"name\">The name of the dialog.</param>\n    /// <returns>The service collection.</returns>\n    /// <remarks>\n    /// The view type must inherit from <see cref=\"View\"/>.\n    /// </remarks>\n    public static IServiceCollection RegisterDialog(this IServiceCollection services, Type view, Type viewModel, string name = null)\n    {\n        services.AddSingleton(GetViewRegistration(view, viewModel, name))\n            .AddTransient(view);\n\n        if (viewModel != null)\n            services.AddTransient(viewModel);\n        return services;\n    }\n\n    /// <summary>\n    /// Registers a dialog container in the service collection.\n    /// </summary>\n    /// <typeparam name=\"T\">The type of the dialog container.</typeparam>\n    /// <param name=\"services\">The service collection.</param>\n    /// <returns>The service collection.</returns>\n    public static IServiceCollection RegisterDialogContainer<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] T>(this IServiceCollection services)\n        where T : class, IDialogContainer =>\n        services.AddTransient<IDialogContainer, T>();\n\n    private static ViewRegistration GetViewRegistration(Type view, Type viewModel, string name)\n    {\n        ArgumentNullException.ThrowIfNull(view);\n\n        if (!view.IsAssignableTo(typeof(View)))\n            throw new InvalidOperationException($\"The Dialog '{view.FullName}' must inherit from Microsoft.Maui.Controls.View\");\n\n        if (string.IsNullOrEmpty(name))\n            name = view.Name;\n\n        return new ViewRegistration\n        {\n            Type = ViewType.Dialog,\n            Name = name,\n            View = view,\n            ViewModel = viewModel\n        };\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Ioc/MicrosoftDependencyInjectionExtensions.cs",
    "content": "﻿using System.Diagnostics.CodeAnalysis;\nusing Prism.Mvvm;\n\nnamespace Prism.Ioc;\n\n/// <summary>\n/// Navigation Extensions for working with the <see cref=\"IServiceCollection\"/>\n/// </summary>\npublic static class MicrosoftDependencyInjectionExtensions\n{\n#if !UNO_WINUI\n    private static readonly Type PageType = typeof(Page);\n\n    public static IServiceCollection RegisterForNavigation<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] TView>(this IServiceCollection services, string name = null)\n            where TView : Page =>\n            services.RegisterForNavigation(typeof(TView), null, name);\n\n    public static IServiceCollection RegisterForNavigation<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] TView, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] TViewModel>(this IServiceCollection services, string name = null)\n        where TView : Page =>\n        services.RegisterForNavigation(typeof(TView), typeof(TViewModel), name);\n\n    public static IServiceCollection RegisterForNavigation(this IServiceCollection services, Type view, Type viewModel, string name = null)\n    {\n        if (view is null)\n            throw new ArgumentNullException(nameof(view));\n\n        if (!view.IsAssignableTo(PageType))\n            throw new InvalidOperationException($\"The view type '{view.FullName}' is not a type of Page.\");\n\n        if (string.IsNullOrEmpty(name))\n            name = view.Name;\n\n        services.AddSingleton(new ViewRegistration\n            {\n                Type = ViewType.Page,\n                Name = name,\n                View = view,\n                ViewModel = viewModel\n            })\n            .AddTransient(view);\n\n        if (viewModel != null)\n            services.AddTransient(viewModel);\n\n        return services;\n    }\n#endif\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Ioc/NavigationRegistrationExtensions.cs",
    "content": "﻿using System.Diagnostics.CodeAnalysis;\nusing Prism.Mvvm;\n\nnamespace Prism.Ioc;\n\npublic static class NavigationRegistrationExtensions\n{\n    public static IContainerRegistry RegisterForNavigation<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] TView>(this IContainerRegistry container, string name = null)\n        where TView : Page =>\n        container.RegisterForNavigation(typeof(TView), null, name);\n\n    public static IContainerRegistry RegisterForNavigation<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] TView, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] TViewModel>(this IContainerRegistry container, string name = null)\n        where TView : Page =>\n        container.RegisterForNavigation(typeof(TView), typeof(TViewModel), name);\n\n    public static IContainerRegistry RegisterForNavigation(this IContainerRegistry container, Type view, Type viewModel, string name = null)\n    {\n        if (view is null)\n            throw new ArgumentNullException(nameof(view));\n\n        if (string.IsNullOrEmpty(name))\n            name = view.Name;\n\n        container.RegisterInstance(new ViewRegistration\n            {\n                Type = ViewType.Page,\n                Name = name,\n                View = view,\n                ViewModel = viewModel\n            })\n            .Register(view);\n\n        if (viewModel != null)\n            container.Register(viewModel);\n\n        return container;\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Ioc/RegionNavigationRegistrationExtensions.cs",
    "content": "using System.Diagnostics.CodeAnalysis;\nusing Prism.Mvvm;\nusing Prism.Navigation.Regions;\nusing Prism.Navigation.Regions.Adapters;\nusing Prism.Navigation.Regions.Behaviors;\nusing Prism.Navigation.Regions.Navigation;\n\nnamespace Prism.Ioc;\n\n/// <summary>\n/// Provides common extensions for Service Registrations for Prism.Maui\n/// </summary>\npublic static class RegionNavigationRegistrationExtensions\n{\n    /// <summary>\n    /// Registers a <see cref=\"View\"/> for region navigation.\n    /// </summary>\n    /// <typeparam name=\"TView\">The Type of <see cref=\"View\"/> to register</typeparam>\n    /// <param name=\"containerRegistry\"><see cref=\"IContainerRegistry\"/> used to register type for Navigation.</param>\n    /// <param name=\"name\">The unique name to register with the View</param>\n    public static IContainerRegistry RegisterForRegionNavigation<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] TView>(this IContainerRegistry containerRegistry, string name = null)\n        where TView : View =>\n        containerRegistry.RegisterForNavigationWithViewModel(typeof(TView), null, name);\n\n    /// <summary>\n    /// Registers a <see cref=\"View\"/> for region navigation.\n    /// </summary>\n    /// <typeparam name=\"TView\">The Type of <see cref=\"View\" />to register</typeparam>\n    /// <typeparam name=\"TViewModel\">The ViewModel to use as the BindingContext for the View</typeparam>\n    /// <param name=\"name\">The unique name to register with the View</param>\n    /// <param name=\"containerRegistry\"></param>\n    public static IContainerRegistry RegisterForRegionNavigation<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] TView, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] TViewModel>(this IContainerRegistry containerRegistry, string name = null)\n        where TView : View\n        where TViewModel : class =>\n        containerRegistry.RegisterForNavigationWithViewModel(typeof(TView), typeof(TViewModel), name);\n\n    public static IContainerRegistry RegisterForRegionNavigation(this IContainerRegistry containerRegistry, Type viewType, Type viewModelType, string name = null)\n        => containerRegistry.RegisterForNavigationWithViewModel(viewType, viewModelType, name);\n\n    private static IContainerRegistry RegisterForNavigationWithViewModel(this IContainerRegistry containerRegistry, Type viewType, Type viewModelType, string name)\n    {\n        if (string.IsNullOrWhiteSpace(name))\n            name = viewType.Name;\n\n        if (viewModelType is not null)\n            containerRegistry.Register(viewModelType);\n\n        containerRegistry.Register(viewType)\n            .RegisterInstance(new ViewRegistration\n            {\n                Name = name,\n                Type = ViewType.Region,\n                View = viewType,\n                ViewModel = viewModelType\n            });\n\n        return containerRegistry;\n    }\n\n    /// <summary>\n    /// Registers a <see cref=\"View\"/> for region navigation.\n    /// </summary>\n    /// <typeparam name=\"TView\">The Type of <see cref=\"View\"/> to register</typeparam>\n    /// <param name=\"services\"><see cref=\"IServiceCollection\"/> used to register type for Navigation.</param>\n    /// <param name=\"name\">The unique name to register with the View</param>\n    public static IServiceCollection RegisterForRegionNavigation<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] TView>(this IServiceCollection services, string name = null)\n        where TView : View =>\n        services.RegisterForNavigationWithViewModel(typeof(TView), null, name);\n\n    /// <summary>\n    /// Registers a <see cref=\"View\"/> for region navigation.\n    /// </summary>\n    /// <typeparam name=\"TView\">The Type of <see cref=\"View\" />to register</typeparam>\n    /// <typeparam name=\"TViewModel\">The ViewModel to use as the BindingContext for the View</typeparam>\n    /// <param name=\"name\">The unique name to register with the View</param>\n    /// <param name=\"services\"></param>\n    public static IServiceCollection RegisterForRegionNavigation<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] TView, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] TViewModel>(this IServiceCollection services, string name = null)\n        where TView : View\n        where TViewModel : class =>\n        services.RegisterForNavigationWithViewModel(typeof(TView), typeof(TViewModel), name);\n\n    public static IServiceCollection RegisterForRegionNavigation(this IServiceCollection services, Type viewType, Type viewModelType, string name = null)\n        => services.RegisterForNavigationWithViewModel(viewType, viewModelType, name);\n\n    private static IServiceCollection RegisterForNavigationWithViewModel(this IServiceCollection services, Type viewType, Type viewModelType, string name)\n    {\n        if (string.IsNullOrWhiteSpace(name))\n            name = viewType.Name;\n\n        if (viewModelType is not null)\n            services.AddTransient(viewModelType);\n\n        services.AddTransient(viewType)\n            .AddSingleton(new ViewRegistration\n            {\n                Name = name,\n                Type = ViewType.Region,\n                View = viewType,\n                ViewModel = viewModelType\n            });\n\n        return services;\n    }\n\n    internal static IContainerRegistry RegisterRegionServices(this IContainerRegistry containerRegistry, Action<RegionAdapterMappings> configureAdapters = null, Action<IRegionBehaviorFactory> configureBehaviors = null)\n    {\n        containerRegistry.TryRegister<IRegionNavigationRegistry, RegionNavigationRegistry>();\n        containerRegistry.RegisterSingleton<RegionAdapterMappings>(p =>\n        {\n            var regionAdapterMappings = new RegionAdapterMappings();\n            configureAdapters?.Invoke(regionAdapterMappings);\n\n            regionAdapterMappings.RegisterDefaultMapping<CarouselView, CarouselViewRegionAdapter>();\n            // TODO: CollectionView is buggy with only last View showing despite multiple Active Views\n            // BUG: iOS Crash with CollectionView https://github.com/xamarin/Xamarin.Forms/issues/9970\n            //regionAdapterMappings.RegisterDefaultMapping<CollectionView, CollectionViewRegionAdapter>();\n            regionAdapterMappings.RegisterDefaultMapping<Microsoft.Maui.Controls.Compatibility.Layout<View>, LayoutViewRegionAdapter>();\n            regionAdapterMappings.RegisterDefaultMapping<Layout, LayoutRegionAdapter>();\n            regionAdapterMappings.RegisterDefaultMapping<ScrollView, ScrollViewRegionAdapter>();\n            regionAdapterMappings.RegisterDefaultMapping<ContentView, ContentViewRegionAdapter>();\n            return regionAdapterMappings;\n        });\n\n        containerRegistry.TryRegisterSingleton<IRegionManager, RegionManager>();\n        containerRegistry.TryRegisterSingleton<IRegionNavigationContentLoader, RegionNavigationContentLoader>();\n        containerRegistry.TryRegisterSingleton<IRegionViewRegistry, RegionViewRegistry>();\n        containerRegistry.TryRegister<RegionBehaviorFactory>();\n        containerRegistry.RegisterSingleton<IRegionBehaviorFactory>(p =>\n        {\n            var regionBehaviors = p.Resolve<RegionBehaviorFactory>();\n            regionBehaviors.AddIfMissing<BindRegionContextToVisualElementBehavior>(BindRegionContextToVisualElementBehavior.BehaviorKey);\n            regionBehaviors.AddIfMissing<RegionActiveAwareBehavior>(RegionActiveAwareBehavior.BehaviorKey);\n            regionBehaviors.AddIfMissing<SyncRegionContextWithHostBehavior>(SyncRegionContextWithHostBehavior.BehaviorKey);\n            regionBehaviors.AddIfMissing<RegionManagerRegistrationBehavior>(RegionManagerRegistrationBehavior.BehaviorKey);\n            regionBehaviors.AddIfMissing<RegionMemberLifetimeBehavior>(RegionMemberLifetimeBehavior.BehaviorKey);\n            regionBehaviors.AddIfMissing<ClearChildViewsRegionBehavior>(ClearChildViewsRegionBehavior.BehaviorKey);\n            regionBehaviors.AddIfMissing<AutoPopulateRegionBehavior>(AutoPopulateRegionBehavior.BehaviorKey);\n            regionBehaviors.AddIfMissing<DestructibleRegionBehavior>(DestructibleRegionBehavior.BehaviorKey);\n            configureBehaviors?.Invoke(regionBehaviors);\n            return regionBehaviors;\n        });\n        containerRegistry.TryRegister<IRegionNavigationJournalEntry, RegionNavigationJournalEntry>();\n        containerRegistry.TryRegister<IRegionNavigationJournal, RegionNavigationJournal>();\n        containerRegistry.TryRegister<IRegionNavigationService, RegionNavigationService>();\n        //containerRegistry.RegisterManySingleton<RegionResolverOverrides>(typeof(IResolverOverridesHelper), typeof(IActiveRegionHelper));\n        return containerRegistry.TryRegisterSingleton<IRegionManager, RegionManager>();\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Modularity/IModuleCatalogExtensions.cs",
    "content": "﻿using System.Diagnostics.CodeAnalysis;\n\nnamespace Prism.Modularity;\n\n/// <summary>\n/// <see cref=\"IModuleCatalog\"/>  extensions.\n/// </summary>\npublic static class IModuleCatalogExtensions\n{\n    /// <summary>\n    /// Adds the module.\n    /// </summary>\n    /// <returns>The module.</returns>\n    /// <param name=\"catalog\">Catalog</param>\n    /// <param name=\"mode\"><see cref=\"InitializationMode\"/></param>\n    /// <typeparam name=\"T\">The <see cref=\"IModule\"/> type parameter.</typeparam>\n    public static IModuleCatalog AddModule<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] T>(this IModuleCatalog catalog, InitializationMode mode = InitializationMode.WhenAvailable)\n        where T : IModule =>\n        catalog.AddModule<T>(typeof(T).Name, mode);\n\n    /// <summary>\n    /// Adds the module.\n    /// </summary>\n    /// <returns>The module.</returns>\n    /// <param name=\"catalog\">Catalog.</param>\n    /// <param name=\"name\">Name.</param>\n    /// <typeparam name=\"T\">The <see cref=\"IModule\"/> type parameter.</typeparam>\n    public static IModuleCatalog AddModule<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] T>(this IModuleCatalog catalog, string name)\n        where T : IModule =>\n        catalog.AddModule<T>(name, InitializationMode.WhenAvailable);\n\n    /// <summary>\n    /// Adds the module.\n    /// </summary>\n    /// <returns>The module.</returns>\n    /// <param name=\"catalog\">Catalog.</param>\n    /// <param name=\"name\">Name.</param>\n    /// <param name=\"mode\"><see cref=\"IModule\"/>.</param>\n    /// <typeparam name=\"T\">The <see cref=\"IModule\"/> type parameter.</typeparam>\n    public static IModuleCatalog AddModule<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] T>(this IModuleCatalog catalog, string name, InitializationMode mode)\n        where T : IModule =>\n        catalog.AddModule(new ModuleInfo(typeof(T), name, mode));\n\n    /// <summary>\n    /// Adds the <see cref=\"IModule\"/>\n    /// </summary>\n    /// <typeparam name=\"T\">Type of <see cref=\"IModule\"/></typeparam>\n    /// <param name=\"catalog\">The <see cref=\"IModuleCatalog\"/> to add the <see cref=\"IModule\"/> to.</param>\n    /// <param name=\"dependsOn\">The names of the <see cref=\"IModule\"/>'s that should be loaded when this <see cref=\"IModule\"/> is loaded.</param>\n    /// <returns>The <see cref=\"IModuleCatalog\"/></returns>\n    public static IModuleCatalog AddModule<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] T>(this IModuleCatalog catalog, params string[] dependsOn)\n        where T : IModule => catalog.AddModule<T>(InitializationMode.WhenAvailable, dependsOn);\n\n    /// <summary>\n    /// Adds the <see cref=\"IModule\"/>\n    /// </summary>\n    /// <typeparam name=\"T\">Type of <see cref=\"IModule\"/></typeparam>\n    /// <param name=\"catalog\">The <see cref=\"IModuleCatalog\"/> to add the <see cref=\"IModule\"/> to.</param>\n    /// <param name=\"name\">The name of the <see cref=\"IModule\"/></param>\n    /// <param name=\"dependsOn\">The names of the <see cref=\"IModule\"/>'s that should be loaded when this <see cref=\"IModule\"/> is loaded.</param>\n    /// <returns>The <see cref=\"IModuleCatalog\"/></returns>\n    public static IModuleCatalog AddModule<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] T>(this IModuleCatalog catalog, string name, params string[] dependsOn)\n        where T : IModule =>\n        catalog.AddModule<T>(name, InitializationMode.WhenAvailable, dependsOn);\n\n    /// <summary>\n    /// Adds the <see cref=\"IModule\"/>\n    /// </summary>\n    /// <typeparam name=\"T\">Type of <see cref=\"IModule\"/></typeparam>\n    /// <param name=\"catalog\">The <see cref=\"IModuleCatalog\"/> to add the <see cref=\"IModule\"/> to.</param>\n    /// <param name=\"mode\"></param>\n    /// <param name=\"dependsOn\">The names of the <see cref=\"IModule\"/>'s that should be loaded when this <see cref=\"IModule\"/> is loaded.</param>\n    /// <returns>The <see cref=\"IModuleCatalog\"/></returns>\n    public static IModuleCatalog AddModule<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] T>(this IModuleCatalog catalog, InitializationMode mode, params string[] dependsOn)\n        where T : IModule =>\n        catalog.AddModule<T>(typeof(T).Name, mode, dependsOn);\n\n    /// <summary>\n    /// Adds the <see cref=\"IModule\"/>\n    /// </summary>\n    /// <typeparam name=\"T\">Type of <see cref=\"IModule\"/></typeparam>\n    /// <param name=\"catalog\">The <see cref=\"IModuleCatalog\"/> to add the <see cref=\"IModule\"/> to.</param>\n    /// <param name=\"name\">The name of the <see cref=\"IModule\"/></param>\n    /// <param name=\"mode\">The <see cref=\"InitializationMode\"/></param>\n    /// <param name=\"dependsOn\">The names of the <see cref=\"IModule\"/>'s that should be loaded when this <see cref=\"IModule\"/> is loaded.</param>\n    /// <returns>The <see cref=\"IModuleCatalog\"/></returns>\n    public static IModuleCatalog AddModule<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] T>(this IModuleCatalog catalog, string name, InitializationMode mode, params string[] dependsOn)\n        where T : IModule\n    {\n        var moduleInfo = new ModuleInfo(name, typeof(T).AssemblyQualifiedName, dependsOn)\n        {\n            InitializationMode = mode\n        };\n        return catalog.AddModule(moduleInfo);\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Modularity/ModuleCatalog.cs",
    "content": "namespace Prism.Modularity;\n\n/// <summary>\n/// The <see cref=\"ModuleCatalog\"/> holds information about the modules that can be used by the\n/// application. Each module is described in a <see cref=\"ModuleInfo\"/> class, that records the\n/// name and type of the module.\n/// </summary>\n#if UNO_WINUI\n[Microsoft.UI.Xaml.Markup.ContentProperty(Name = nameof(Items))]\n#else\n[ContentProperty(nameof(Items))]\n#endif\npublic class ModuleCatalog(IEnumerable<IModuleInfo> modules) : ModuleCatalogBase(modules)\n{\n\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Modularity/ModuleInfo.cs",
    "content": "﻿using System.Collections.ObjectModel;\nusing System.Reflection;\nusing Prism.Properties;\n\nnamespace Prism.Modularity;\n\n/// <summary>\n/// Defines the metadata that describes a module.\n/// </summary>\n#if UNO_WINUI\n[Microsoft.UI.Xaml.Markup.ContentProperty(Name = nameof(DependsOn))]\n#else\n[ContentProperty(nameof(DependsOn))]\n#endif\npublic partial class ModuleInfo : IModuleInfo\n{\n    /// <summary>\n    /// Initializes a new empty instance of <see cref=\"ModuleInfo\"/>.\n    /// </summary>\n    public ModuleInfo()\n    {\n    }\n\n    /// <summary>\n    /// Initializes a new instance of <see cref=\"ModuleInfo\"/>.\n    /// </summary>\n    /// <param name=\"name\">The module's name.</param>\n    /// <param name=\"type\">The module <see cref=\"Type\"/>'s AssemblyQualifiedName.</param>\n    /// <param name=\"dependsOn\">The modules this instance depends on.</param>\n    /// <exception cref=\"ArgumentNullException\">An <see cref=\"ArgumentNullException\"/> is thrown if <paramref name=\"dependsOn\"/> is <see langword=\"null\"/>.</exception>\n    public ModuleInfo(string name, string type, params string[] dependsOn)\n    {\n        if (string.IsNullOrWhiteSpace(name))\n            throw new ArgumentNullException(nameof(name));\n        if (dependsOn == null)\n            throw new ArgumentNullException(nameof(dependsOn));\n\n        ModuleType = Type.GetType(type) ?? throw new ArgumentNullException(nameof(type));\n        ModuleName = name;\n        foreach (string dependency in dependsOn)\n        {\n            if (!DependsOn.Contains(dependency))\n            {\n                DependsOn.Add(dependency);\n            }\n        }\n    }\n\n    /// <summary>\n    /// Initializes a new instance of <see cref=\"ModuleInfo\"/>.\n    /// </summary>\n    /// <param name=\"name\">The module's name.</param>\n    /// <param name=\"type\">The module's type.</param>\n    public ModuleInfo(string name, string type)\n        : this(name, type, Array.Empty<string>())\n    {\n    }\n\n    /// <summary>\n    /// Initializes a new instance of <see cref=\"ModuleInfo\"/>.\n    /// </summary>\n    /// <param name=\"moduleType\">The module's type.</param>\n    public ModuleInfo(Type moduleType)\n        : this(moduleType, moduleType.Name) { }\n\n    /// <summary>\n    /// Initializes a new instance of <see cref=\"ModuleInfo\"/>.\n    /// </summary>\n    /// <param name=\"moduleType\">The module's type.</param>\n    /// <param name=\"moduleName\">The module's name.</param>\n    public ModuleInfo(Type moduleType, string moduleName)\n        : this(moduleType, moduleName, InitializationMode.WhenAvailable) { }\n\n    /// <summary>\n    /// Initializes a new instance of <see cref=\"ModuleInfo\"/>.\n    /// </summary>\n    /// <param name=\"moduleType\">The module's type.</param>\n    /// <param name=\"moduleName\">The module's name.</param>\n    /// <param name=\"initializationMode\">The module's <see cref=\"InitializationMode\"/>.</param>\n    public ModuleInfo(Type moduleType, string moduleName, InitializationMode initializationMode)\n        : this(moduleName, moduleType.AssemblyQualifiedName)\n    {\n        InitializationMode = initializationMode;\n    }\n\n    private string _moduleName;\n    /// <summary>\n    /// Gets or sets the name of the module.\n    /// </summary>\n    /// <value>The name of the module.</value>\n    public string ModuleName\n    {\n        get => string.IsNullOrEmpty(_moduleName) ? ModuleType.Name : _moduleName;\n        set => _moduleName = value;\n    }\n\n    string IModuleInfo.ModuleType\n    {\n        get => ModuleType.AssemblyQualifiedName;\n        set => ModuleType = Type.GetType(value);\n    }\n\n    private Type _moduleType;\n    /// <summary>\n    /// Gets or sets the module <see cref=\"Type\"/>'s AssemblyQualifiedName.\n    /// </summary>\n    /// <value>The type of the module.</value>\n    public Type ModuleType\n    {\n        get => _moduleType;\n        set\n        {\n            _moduleType = value;\n            ModuleName = value.Name;\n            foreach (var dependencyAttribute in value.GetCustomAttributes<ModuleDependencyAttribute>())\n            {\n                var dependency = dependencyAttribute.ModuleName;\n                if (!DependsOn.Contains(dependency))\n                {\n                    DependsOn.Add(dependency);\n                }\n            }\n        }\n    }\n\n    private Collection<string> _dependsOn;\n    /// <summary>\n    /// Gets or sets the list of modules that this module depends upon.\n    /// </summary>\n    /// <value>The list of modules that this module depends upon.</value>\n    public Collection<string> DependsOn\n    {\n        get => _dependsOn ?? (_dependsOn = new Collection<string>());\n        set => _dependsOn = value;\n    }\n\n    /// <summary>\n    /// Specifies on which stage the Module will be initialized.\n    /// </summary>\n    public InitializationMode InitializationMode { get; set; }\n\n    /// <summary>\n    /// Reference to the location of the module assembly. Not Supported by Microsoft.Maui\n    /// </summary>\n    string IModuleInfo.Ref\n    {\n        get => throw new NotSupportedException(Resources.ModuleRefLocationNotSupported);\n        set { }\n    }\n\n    /// <summary>\n    /// Gets or sets the state of the <see cref=\"ModuleInfo\"/> with regards to the module loading and initialization process.\n    /// </summary>\n    public ModuleState State { get; private set; }\n\n    /// <summary>\n    /// Gets or sets the state of the <see cref=\"ModuleInfo\"/> with regards to the module loading and initialization process.\n    /// </summary>\n    ModuleState IModuleInfo.State\n    {\n        get => State;\n        set => State = value;\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Modularity/ModuleInitializer.cs",
    "content": "﻿using Prism.Ioc;\n\nnamespace Prism.Modularity;\n\npublic class ModuleInitializer : IModuleInitializer\n{\n    readonly IContainerExtension _container;\n\n    public ModuleInitializer(IContainerExtension container)\n    {\n        _container = container;\n    }\n\n    public void Initialize(IModuleInfo moduleInfo)\n    {\n        var module = CreateModule(Type.GetType(moduleInfo.ModuleType, true));\n        if (module != null)\n        {\n            module.RegisterTypes(_container);\n            module.OnInitialized(_container);\n        }\n    }\n\n    protected virtual IModule CreateModule(Type moduleType)\n    {\n        return (IModule)_container.Resolve(moduleType);\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Modularity/ModuleManager.cs",
    "content": "﻿using System.Globalization;\nusing Prism.Properties;\n\nnamespace Prism.Modularity;\n\n/// <summary>\n/// Component responsible for coordinating the modules' type loading and module initialization process. \n/// </summary>\npublic class ModuleManager : IModuleManager\n{\n    /// <summary>\n    /// The module catalog.\n    /// </summary>\n    protected IModuleCatalog ModuleCatalog { get; }\n\n    /// <summary>\n    /// Gets all the <see cref=\"IModuleInfo\"/> classes that are in the <see cref=\"IModuleCatalog\"/>.\n    /// </summary>\n    public IEnumerable<IModuleInfo> Modules => ModuleCatalog.Modules;\n\n    /// <summary>\n    /// Raised when a module is loaded or fails to load.\n    /// </summary>\n    public event EventHandler<LoadModuleCompletedEventArgs> LoadModuleCompleted;\n\n    /// <summary>\n    /// Not used by Prism.Maui\n    /// </summary>\n    public event EventHandler<ModuleDownloadProgressChangedEventArgs> ModuleDownloadProgressChanged\n    {\n        add => throw new NotSupportedException();\n        remove => throw new NotSupportedException();\n    }\n\n    /// <summary>\n    /// The module initializer.\n    /// </summary>\n    protected IModuleInitializer ModuleInitializer { get; }\n\n    /// <summary>\n    /// Initializes an instance of the <see cref=\"ModuleManager\"/> class.\n    /// </summary>\n    /// <param name=\"moduleInitializer\">Service used for initialization of modules.</param>\n    /// <param name=\"moduleCatalog\">Catalog that enumerates the modules to be loaded and initialized.</param>\n    public ModuleManager(IModuleInitializer moduleInitializer, IModuleCatalog moduleCatalog)\n    {\n        ModuleInitializer = moduleInitializer ?? throw new ArgumentNullException(nameof(moduleInitializer));\n        ModuleCatalog = moduleCatalog ?? throw new ArgumentNullException(nameof(moduleCatalog));\n    }\n\n    /// <summary>\n    /// Initializes the modules marked as <see cref=\"InitializationMode.WhenAvailable\"/> in the <see cref=\"ModuleCatalog\"/>.\n    /// </summary>\n    public void Run()\n    {\n        LoadModulesWhenAvailable();\n    }\n\n    /// <summary>\n    /// Loads and initializes the module in the <see cref=\"IModuleCatalog\"/> with the name <paramref name=\"moduleName\"/>.\n    /// </summary>\n    /// <param name=\"moduleName\">Name of the module requested for initialization.</param>\n    public void LoadModule(string moduleName)\n    {\n        var modules = ModuleCatalog.Modules.Where(m => m.ModuleName == moduleName);\n        if (modules == null || modules.Count() == 0)\n        {\n            throw new ModuleNotFoundException(moduleName, string.Format(CultureInfo.CurrentCulture, Resources.ModuleNotFound, moduleName));\n        }\n        else if (modules.Count() > 1)\n        {\n            throw new DuplicateModuleException(moduleName, string.Format(CultureInfo.CurrentCulture, Resources.DuplicatedModuleInCatalog, moduleName));\n        }\n\n        var modulesToLoad = ModuleCatalog.CompleteListWithDependencies(modules);\n\n        LoadModules(modulesToLoad);\n    }\n\n    /// <summary>\n    /// Loads the <see cref=\"IModule\"/>'s with <see cref=\"InitializationMode.WhenAvailable\"/>\n    /// </summary>\n    protected void LoadModulesWhenAvailable()\n    {\n        var whenAvailableModules = ModuleCatalog.Modules.Where(m => m.InitializationMode == InitializationMode.WhenAvailable && m.State == ModuleState.NotStarted);\n        if (whenAvailableModules != null)\n            LoadModules(whenAvailableModules);\n    }\n\n    /// <summary>\n    /// Loads the specified modules.\n    /// </summary>\n    /// <param name=\"moduleInfos\"><see cref=\"IModuleInfo\"/>.</param>\n    protected virtual void LoadModules(IEnumerable<IModuleInfo> moduleInfos)\n    {\n        foreach (var moduleInfo in moduleInfos)\n        {\n            if (moduleInfo.State == ModuleState.NotStarted)\n            {\n                try\n                {\n                    moduleInfo.State = ModuleState.Initializing;\n                    ModuleInitializer.Initialize(moduleInfo);\n                    moduleInfo.State = ModuleState.Initialized;\n                    RaiseLoadModuleCompleted(moduleInfo);\n                }\n                catch (Exception ex)\n                {\n                    RaiseLoadModuleCompleted(moduleInfo, ex);\n                }\n\n            }\n        }\n    }\n\n    /// <summary>\n    /// Raises the <see cref=\"LoadModuleCompleted\"/> event.\n    /// </summary>\n    /// <param name=\"moduleInfo\">The <see cref=\"IModuleInfo\"/> that was just loaded.</param>\n    /// <param name=\"ex\">An <see cref=\"Exception\"/> if any that was thrown during the loading of the <see cref=\"IModule\"/></param>\n    protected void RaiseLoadModuleCompleted(IModuleInfo moduleInfo, Exception ex = null)\n    {\n        LoadModuleCompleted?.Invoke(this, new LoadModuleCompletedEventArgs(moduleInfo, ex));\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Mvvm/ViewModelLocator.cs",
    "content": "namespace Prism.Mvvm;\n\n/// <summary>\n/// This class defines the attached property and related change handler that calls the <see cref=\"ViewModelLocationProvider\"/>.\n/// </summary>\npublic static class ViewModelLocator\n{\n    /// <summary>\n    /// 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.\n    /// </summary>\n    public static readonly BindableProperty AutowireViewModelProperty =\n        BindableProperty.CreateAttached(\"AutowireViewModel\", typeof(ViewModelLocatorBehavior), typeof(ViewModelLocator), ViewModelLocatorBehavior.Automatic, propertyChanged: OnViewModelLocatorBehaviorChanged);\n\n    private static void OnViewModelLocatorBehaviorChanged(BindableObject bindable, object oldValue, object newValue)\n    {\n        if (newValue is ViewModelLocatorBehavior behavior && behavior == ViewModelLocatorBehavior.Forced)\n        {\n            Autowire(bindable);\n        }\n    }\n\n    internal static readonly BindableProperty ViewModelProperty =\n        BindableProperty.CreateAttached(\"ViewModelType\",\n            typeof(Type),\n            typeof(ViewModelLocator),\n            null,\n            propertyChanged: OnViewModelPropertyChanged);\n\n    public static readonly BindableProperty NavigationNameProperty =\n        BindableProperty.CreateAttached(\"NavigationName\", typeof(string), typeof(ViewModelLocator), null, defaultValueCreator: CreateDefaultNavigationName);\n\n    private static object CreateDefaultNavigationName(BindableObject bindable) => bindable.GetType().Name;\n\n    public static string GetNavigationName(BindableObject bindable) =>\n        (string)bindable.GetValue(NavigationNameProperty);\n\n    public static void SetNavigationName(BindableObject bindable, string name) =>\n        bindable.SetValue(NavigationNameProperty, name);\n\n    /// <summary>\n    /// Gets the AutowireViewModel property value.\n    /// </summary>\n    /// <param name=\"bindable\"></param>\n    /// <returns></returns>\n    public static ViewModelLocatorBehavior GetAutowireViewModel(BindableObject bindable)\n    {\n        return (ViewModelLocatorBehavior)bindable.GetValue(AutowireViewModelProperty);\n    }\n\n    /// <summary>\n    /// Sets the AutowireViewModel property value.  If <c>true</c>, creates an instance of a ViewModel using a convention, and sets the associated View's <see cref=\"BindableObject.BindingContext\"/> to that instance.\n    /// </summary>\n    /// <param name=\"bindable\"></param>\n    /// <param name=\"value\"></param>\n    public static void SetAutowireViewModel(BindableObject bindable, ViewModelLocatorBehavior value)\n    {\n        bindable.SetValue(AutowireViewModelProperty, value);\n    }\n\n    private static void OnViewModelPropertyChanged(BindableObject bindable, object oldValue, object newValue)\n    {\n        if (newValue == null || bindable.BindingContext != null)\n            return;\n        else if(newValue is Type)\n            bindable.SetValue(AutowireViewModelProperty, ViewModelLocatorBehavior.Automatic);\n    }\n\n    internal static void Autowire(object view)\n    {\n        if (view is Element element &&\n            ((ViewModelLocatorBehavior)element.GetValue(AutowireViewModelProperty) == ViewModelLocatorBehavior.Disabled\n            || (element.BindingContext is not null && element.BindingContext != element.Parent)))\n        {\n            return;\n        }\n\n        if (view is TabbedPage tabbed)\n        {\n            foreach (var child in tabbed.Children)\n                Autowire(child);\n        }\n        else if(view is NavigationPage navigationPage && navigationPage.RootPage is not null)\n        {\n            Autowire(navigationPage.RootPage);\n        }\n\n        ViewModelLocationProvider.AutoWireViewModelChanged(view, Bind);\n\n        if (view is BindableObject bindable && bindable.BindingContext is null)\n        {\n            bindable.BindingContext = new object();\n        }\n    }\n\n    /// <summary>\n    /// Sets the <see cref=\"BindableObject.BindingContext\"/> of a View\n    /// </summary>\n    /// <param name=\"view\">The View to set the <see cref=\"BindableObject.BindingContext\"/> on</param>\n    /// <param name=\"viewModel\">The object to use as the <see cref=\"BindableObject.BindingContext\"/> for the View</param>\n    private static void Bind(object view, object viewModel)\n    {\n        if (view is BindableObject element)\n        {\n            element.BindingContext = viewModel;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Mvvm/ViewModelLocatorBehavior.cs",
    "content": "﻿namespace Prism.Mvvm;\n\n/// <summary>\n/// Defines the behavior that the <see cref=\"ViewModelLocator\"/> should use.\n/// </summary>\npublic enum ViewModelLocatorBehavior\n{\n    /// <summary>\n    /// The ViewModel will be lazily loaded by the Page/Region Navigation Services\n    /// or the DialogService.\n    /// </summary>\n    /// <remarks>\n    /// This is the default and recommended value for the ViewModelLocator. This will\n    /// allow the View to be fully initialized and ensure that the proper ViewModel is\n    /// resolved based on the route name.\n    /// </remarks>\n    Automatic,\n\n    /// <summary>\n    /// This will disable Prism's automatic ViewModel Location\n    /// </summary>\n    Disabled,\n\n    /// <summary>\n    /// This is not recommended for most situations\n    /// </summary>\n    /// <remarks>\n    /// This is likely to cause breaks in the Container Scoping. It is recommended that\n    /// you allow Prism Page/Region Navigation Services or the Dialog Service properly\n    /// resolve the ViewModel.\n    /// </remarks>\n    Forced\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Mvvm/ViewRegistryBase.cs",
    "content": "﻿using Prism.Navigation.Xaml;\n\nnamespace Prism.Mvvm;\n\n/// <summary>\n/// The Base class for .NET Maui's ViewModel Registry\n/// </summary>\npublic abstract class ViewRegistryBase : ViewRegistryBase<BindableObject>\n{\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"ViewRegistryBase\"/>\n    /// </summary>\n    /// <param name=\"registryType\">The Registry Type</param>\n    /// <param name=\"registrations\">The ViewRegistration collection</param>\n    protected ViewRegistryBase(ViewType registryType, IEnumerable<ViewRegistration> registrations)\n        : base(registryType, registrations)\n    {\n    }\n\n    protected override void Autowire(BindableObject view)\n    {\n        if (view.BindingContext is not null)\n            return;\n\n        ViewModelLocator.Autowire(view);\n    }\n\n    protected override void SetContainerProvider(BindableObject view, IContainerProvider container)\n    {\n        view.SetContainerProvider(container);\n    }\n\n    protected override void SetNavigationNameProperty(BindableObject view, string name)\n    {\n        view.SetValue(ViewModelLocator.NavigationNameProperty, name);\n    }\n\n    protected override void SetViewModelProperty(BindableObject view, Type viewModelType)\n    {\n        view.SetValue(ViewModelLocator.ViewModelProperty, viewModelType);\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Builder/CreateTabBuilder.cs",
    "content": "﻿using System.Web;\nusing Prism.Common;\nusing Prism.Mvvm;\n\nnamespace Prism.Navigation.Builder;\n\ninternal class CreateTabBuilder : ICreateTabBuilder, IUriSegment, IRegistryAware\n{\n    private List<IUriSegment> _segments { get; }\n\n    public CreateTabBuilder(IViewRegistry registry)\n    {\n        _segments = new List<IUriSegment>();\n        Registry = registry;\n    }\n\n    public string Segment => BuildSegment();\n\n    public IViewRegistry Registry { get; }\n\n    public ICreateTabBuilder AddSegment(string segmentName, Action<ISegmentBuilder> configureSegment)\n    {\n        var builder = new SegmentBuilder(segmentName);\n        configureSegment?.Invoke(builder);\n        _segments.Add(builder);\n        return this;\n    }\n\n    private string BuildSegment()\n    {\n        var uri = string.Join(\"/\", _segments.Select(x => x.Segment));\n        return HttpUtility.HtmlEncode(uri);\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Builder/IConfigurableSegmentName.cs",
    "content": "﻿namespace Prism.Navigation.Builder;\n\ninternal interface IConfigurableSegmentName\n{\n    /// <summary>\n    ///  Gets the Segment Name\n    /// </summary>\n    string SegmentName { get; }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Builder/ICreateTabBuilder.cs",
    "content": "﻿namespace Prism.Navigation.Builder;\n\npublic interface ICreateTabBuilder\n{\n    /// <summary>\n    /// Adds a Segment for the <see cref=\"TabbedPage\"/>\n    /// </summary>\n    /// <param name=\"segmentName\"></param>\n    /// <param name=\"configureSegment\"></param>\n    /// <returns></returns>\n    ICreateTabBuilder AddSegment(string segmentName, Action<ISegmentBuilder> configureSegment);\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Builder/INavigationBuilder.cs",
    "content": "namespace Prism.Navigation.Builder;\n\n/// <summary>\n/// Represents a builder for configuring navigation in Prism.\n/// </summary>\npublic interface INavigationBuilder\n{\n    /// <summary>\n    /// Gets the URI associated with the navigation.\n    /// </summary>\n    Uri Uri { get; }\n\n    /// <summary>\n    /// Adds a segment to the navigation with the specified segment name and configuration.\n    /// </summary>\n    /// <param name=\"segmentName\">The name of the segment.</param>\n    /// <param name=\"configureSegment\">The configuration action for the segment.</param>\n    /// <returns>The navigation builder.</returns>\n    INavigationBuilder AddSegment(string segmentName, Action<ISegmentBuilder> configureSegment);\n\n    /// <summary>\n    /// Adds a tabbed segment to the navigation with the specified configuration.\n    /// </summary>\n    /// <param name=\"configuration\">The configuration action for the tabbed segment.</param>\n    /// <returns>The navigation builder.</returns>\n    INavigationBuilder AddTabbedSegment(Action<ITabbedSegmentBuilder> configuration);\n\n    /// <summary>\n    /// Adds a tabbed segment to the navigation with the specified segment name and configuration.\n    /// </summary>\n    /// <param name=\"segmentName\">The name of the segment.</param>\n    /// <param name=\"configureSegment\">The configuration action for the tabbed segment.</param>\n    /// <returns>The navigation builder.</returns>\n    INavigationBuilder AddTabbedSegment(string segmentName, Action<ITabbedSegmentBuilder> configureSegment);\n\n    /// <summary>\n    /// Sets the navigation parameters for the navigation.\n    /// </summary>\n    /// <param name=\"parameters\">The navigation parameters.</param>\n    /// <returns>The navigation builder.</returns>\n    INavigationBuilder WithParameters(INavigationParameters parameters);\n\n    /// <summary>\n    /// Adds a parameter to the navigation with the specified key and value.\n    /// </summary>\n    /// <param name=\"key\">The key of the parameter.</param>\n    /// <param name=\"value\">The value of the parameter.</param>\n    /// <returns>The navigation builder.</returns>\n    INavigationBuilder AddParameter(string key, object value);\n\n    /// <summary>\n    /// Sets whether to use absolute navigation.\n    /// </summary>\n    /// <param name=\"absolute\">A flag indicating whether to use absolute navigation.</param>\n    /// <returns>The navigation builder.</returns>\n    INavigationBuilder UseAbsoluteNavigation(bool absolute);\n\n    /// <summary>\n    /// Sets whether to use relative navigation.\n    /// </summary>\n    /// <returns>The navigation builder.</returns>\n    INavigationBuilder UseRelativeNavigation();\n\n    /// <summary>\n    /// Navigates back to the specified view asynchronously.\n    /// </summary>\n    /// <param name=\"name\">The name of the View to navigate back to.</param>\n    /// <returns>A task representing the asynchronous operation.</returns>\n    Task<INavigationResult> GoBackToAsync(string name);\n\n    /// <summary>\n    /// Navigates to the specified view model asynchronously.\n    /// </summary>\n    /// <returns>A task representing the asynchronous operation.</returns>\n    Task<INavigationResult> NavigateAsync();\n\n    /// <summary>\n    /// Navigates to the specified view model asynchronously and handles any errors with the specified action.\n    /// </summary>\n    /// <param name=\"onError\">The action to handle errors.</param>\n    /// <returns>A task representing the asynchronous operation.</returns>\n    Task NavigateAsync(Action<Exception> onError);\n\n    /// <summary>\n    /// Navigates to the specified view model asynchronously and executes the specified success and error actions.\n    /// </summary>\n    /// <param name=\"onSuccess\">The action to execute on success.</param>\n    /// <param name=\"onError\">The action to handle errors.</param>\n    /// <returns>A task representing the asynchronous operation.</returns>\n    Task NavigateAsync(Action onSuccess, Action<Exception> onError);\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Builder/ISegmentBuilder.cs",
    "content": "namespace Prism.Navigation.Builder;\n\n/// <summary>\n/// Represents a builder for constructing navigation segments.\n/// </summary>\npublic interface ISegmentBuilder\n{\n    /// <summary>\n    /// Gets the segment name, such as `ViewA`.\n    /// </summary>\n    string SegmentName { get; }\n\n    /// <summary>\n    /// Adds a segment parameter. This will append the generated URI query parameters, not the <see cref=\"INavigationParameters\"/> that are passed to every page.\n    /// </summary>\n    /// <param name=\"key\">The query parameter key.</param>\n    /// <param name=\"value\">The query parameter value.</param>\n    /// <returns>The <see cref=\"ISegmentBuilder\"/>.</returns>\n    ISegmentBuilder AddParameter(string key, object value);\n\n    /// <summary>\n    /// Specifies whether to force modal navigation for the current navigation segment.\n    /// </summary>\n    /// <param name=\"useModalNavigation\">If <see langword=\"true\"/>, the NavigationService will force modal navigation for the navigation segment. Modal navigation may be the default following this segment if it is not a NavigationPage.</param>\n    /// <returns>The <see cref=\"ISegmentBuilder\"/>.</returns>\n    ISegmentBuilder UseModalNavigation(bool useModalNavigation);\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Builder/ITabbedNavigationBuilder.cs",
    "content": "using System.ComponentModel;\n\nnamespace Prism.Navigation.Builder;\n\n/// <summary>\n/// Represents a builder for configuring tabbed navigation in Prism.\n/// </summary>\npublic interface ITabbedNavigationBuilder : INavigationBuilder\n{\n    /// <summary>\n    /// Creates a new tab with the specified segment name or URI.\n    /// </summary>\n    /// <param name=\"segmentNameOrUri\">The segment name or URI of the tab.</param>\n    /// <returns>The current instance of the <see cref=\"ITabbedNavigationBuilder\"/>.</returns>\n    ITabbedNavigationBuilder CreateTab(string segmentNameOrUri);\n\n    /// <summary>\n    /// Creates a new tab with the specified view model type.\n    /// </summary>\n    /// <typeparam name=\"TViewModel\">The type of the view model for the tab.</typeparam>\n    /// <returns>The current instance of the <see cref=\"ITabbedNavigationBuilder\"/>.</returns>\n    ITabbedNavigationBuilder CreateTab<TViewModel>()\n        where TViewModel : class, INotifyPropertyChanged;\n\n    /// <summary>\n    /// Selects the tab with the specified segment name or URI.\n    /// </summary>\n    /// <param name=\"segmentNameOrUri\">The segment name or URI of the tab to select.</param>\n    /// <returns>The current instance of the <see cref=\"ITabbedNavigationBuilder\"/>.</returns>\n    ITabbedNavigationBuilder SelectTab(string segmentNameOrUri);\n\n    /// <summary>\n    /// Selects the tab with the specified view model type.\n    /// </summary>\n    /// <typeparam name=\"TViewModel\">The type of the view model for the tab to select.</typeparam>\n    /// <returns>The current instance of the <see cref=\"ITabbedNavigationBuilder\"/>.</returns>\n    ITabbedNavigationBuilder SelectTab<TViewModel>()\n        where TViewModel : class, INotifyPropertyChanged;\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Builder/ITabbedSegmentBuilder.cs",
    "content": "namespace Prism.Navigation.Builder;\n\n/// <summary>\n/// Represents a builder for configuring tabbed segments in Prism navigation.\n/// </summary>\npublic interface ITabbedSegmentBuilder\n{\n    /// <summary>\n    /// Creates a new tab with the specified configuration.\n    /// </summary>\n    /// <param name=\"configureSegment\">The action to configure the tab.</param>\n    /// <returns>The current instance of the <see cref=\"ITabbedSegmentBuilder\"/>.</returns>\n    ITabbedSegmentBuilder CreateTab(Action<ICreateTabBuilder> configureSegment);\n\n    /// <summary>\n    /// Sets the selected tab by its name.\n    /// </summary>\n    /// <param name=\"segmentName\">The name of the tab to select.</param>\n    /// <returns>The current instance of the <see cref=\"ITabbedSegmentBuilder\"/>.</returns>\n    ITabbedSegmentBuilder SelectedTab(string segmentName);\n    \n    /// <summary>\n    /// Sets the tabbed page title\n    /// </summary>\n    /// <param name=\"title\">The title of the tabbed page.</param>\n    /// <returns>The current instance of the <see cref=\"ITabbedSegmentBuilder\"/>.</returns>\n    ITabbedSegmentBuilder Title(string title);\n\n    /// <summary>\n    /// Adds a parameter to the current tab segment.\n    /// </summary>\n    /// <param name=\"key\">The key of the parameter.</param>\n    /// <param name=\"value\">The value of the parameter.</param>\n    /// <returns>The current instance of the <see cref=\"ITabbedSegmentBuilder\"/>.</returns>\n    ITabbedSegmentBuilder AddSegmentParameter(string key, object value);\n\n    /// <summary>\n    /// Sets whether to use modal navigation for the current tab segment.\n    /// </summary>\n    /// <param name=\"useModalNavigation\">A flag indicating whether to use modal navigation.</param>\n    /// <returns>The current instance of the <see cref=\"ITabbedSegmentBuilder\"/>.</returns>\n    ITabbedSegmentBuilder UseModalNavigation(bool useModalNavigation);\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Builder/IUriSegment.cs",
    "content": "﻿namespace Prism.Navigation.Builder;\n\ninternal interface IUriSegment\n{\n    string Segment { get; }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Builder/NavigationBuilder.cs",
    "content": "using Prism.Common;\nusing Prism.Mvvm;\n\nnamespace Prism.Navigation.Builder;\n\ninternal class NavigationBuilder : INavigationBuilder, IRegistryAware\n{\n    internal static readonly Uri RootUri = new Uri(\"app://prismapp.maui\", UriKind.Absolute);\n\n    private INavigationService _navigationService { get; }\n    private INavigationParameters _navigationParameters { get; }\n    private bool _absoluteNavigation;\n    private List<IUriSegment> _uriSegments { get; }\n\n    public NavigationBuilder(INavigationService navigationService)\n    {\n        _navigationService = navigationService;\n        _navigationParameters = new NavigationParameters();\n        _uriSegments = new List<IUriSegment>();\n    }\n\n    IViewRegistry IRegistryAware.Registry => ((IRegistryAware)_navigationService).Registry;\n\n    public Uri Uri => BuildUri();\n\n    public INavigationBuilder AddSegment(string segmentName, Action<ISegmentBuilder> configureSegment)\n    {\n        var builder = new SegmentBuilder(segmentName);\n        configureSegment?.Invoke(builder);\n        _uriSegments.Add(builder);\n        return this;\n    }\n\n    public INavigationBuilder AddTabbedSegment(Action<ITabbedSegmentBuilder> configureSegment)\n    {\n        var builder = new TabbedSegmentBuilder(this);\n        configureSegment?.Invoke(builder);\n        _uriSegments.Add(builder);\n        return this;\n    }\n\n    public INavigationBuilder AddTabbedSegment(string segmentName, Action<ITabbedSegmentBuilder> configureSegment)\n    {\n        var builder = new TabbedSegmentBuilder(this, segmentName);\n        configureSegment?.Invoke(builder);\n        _uriSegments.Add(builder);\n        return this;\n    }\n\n    public INavigationBuilder AddParameter(string key, object value)\n    {\n        _navigationParameters.Add(key, value);\n        return this;\n    }\n\n    public Task<INavigationResult> GoBackToAsync<TViewModel>() =>\n        GoBackToAsync(NavigationBuilderExtensions.GetNavigationKey<TViewModel>(this));\n\n    public Task<INavigationResult> GoBackToAsync(string name) =>\n        _navigationService.GoBackToAsync(name, _navigationParameters);\n\n    public Task<INavigationResult> NavigateAsync()\n    {\n        return _navigationService.NavigateAsync(BuildUri(), _navigationParameters);\n    }\n\n    public Task NavigateAsync(Action<Exception> onError)\n    {\n        return NavigateAsync(() => { }, onError);\n    }\n\n    public async Task NavigateAsync(Action onSuccess, Action<Exception> onError)\n    {\n        var result = await NavigateAsync();\n        if (result.Exception != null)\n            onError?.Invoke(result.Exception);\n        else if (result.Success)\n            onSuccess?.Invoke();\n    }\n\n    public INavigationBuilder UseAbsoluteNavigation(bool absolute)\n    {\n        _absoluteNavigation = absolute;\n        return this;\n    }\n\n    public INavigationBuilder UseRelativeNavigation()\n    {\n        _absoluteNavigation = false;\n        return this;\n    }\n\n    public INavigationBuilder WithParameters(INavigationParameters parameters)\n    {\n        foreach ((var key, var value) in parameters)\n            _navigationParameters.Add(key, value);\n\n        return this;\n    }\n\n    internal Uri BuildUri()\n    {\n        var uri = (_absoluteNavigation ? \"/\" : string.Empty) +\n            string.Join(\"/\", _uriSegments.Select(x => x.Segment));\n\n        if(uri.Contains(\"../\"))\n        {\n            if (_absoluteNavigation)\n                throw new InvalidOperationException(\"The generated URI has one or more relative back operators and was marked as an absolute path. This is not supported.\");\n\n            var segments = uri.Split('/');\n            if (!segments.Any(x => x != \"..\"))\n                throw new InvalidOperationException($\"The constructed URI contains one or more relative back operators, but contains no other navigation segments - '{uri}'.\");\n            var hasNonBackSegment = false;\n            for(int i = 0; i < segments.Length; i++)\n            {\n                if (hasNonBackSegment && segments[i] == \"..\")\n                    throw new InvalidOperationException($\"The constructed URI has a relative back operator after a new Navigation Segment which is not supported - '{uri}'.\");\n                else if (segments[i] != \"..\")\n                    hasNonBackSegment = true;\n            }\n        }\n\n        return UriParsingHelper.Parse(uri);\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Builder/NavigationBuilderExtensions.cs",
    "content": "using Prism.Common;\nusing Prism.Navigation.Builder;\n\nnamespace Prism.Navigation;\n\npublic static class NavigationBuilderExtensions\n{\n    /// <summary>\n    /// Creates a <see cref=\"INavigationBuilder\"/> using the current instance of the <see cref=\"INavigationService\"/>.\n    /// </summary>\n    /// <param name=\"navigationService\">The <see cref=\"INavigationService\"/>.</param>\n    /// <returns><see cref=\"INavigationBuilder\"/></returns>\n    public static INavigationBuilder CreateBuilder(this INavigationService navigationService) =>\n           new NavigationBuilder(navigationService);\n\n    internal static string GetNavigationKey<TViewModel>(object builder)\n    {\n        var vmType = typeof(TViewModel);\n        if (vmType.IsAssignableFrom(typeof(VisualElement)))\n            throw new NavigationException(NavigationException.MvvmPatternBreak, typeof(TViewModel).Name);\n\n        if (builder is not IRegistryAware registryAware)\n            throw new Exception(\"The builder does not implement IRegistryAware\");\n\n        return registryAware.Registry.GetViewModelNavigationKey(vmType);\n    }\n\n    public static INavigationBuilder RelativeBack(this INavigationBuilder builder) =>\n        builder.AddSegment(\"..\");\n\n    /// <summary>\n    /// This will force the generated Navigation URI to return an Absolute URI resetting the current <see cref=\"Window\"/>'s <see cref=\"Page\"/> property.\n    /// </summary>\n    /// <param name=\"builder\">The <see cref=\"INavigationBuilder\"/>.</param>\n    /// <returns>The <see cref=\"INavigationBuilder\"/>.</returns>\n    public static INavigationBuilder UseAbsoluteNavigation(this INavigationBuilder builder) =>\n        builder.UseAbsoluteNavigation(true);\n\n    /// <summary>\n    /// Adds the specified segment `ViewA` to the Navigation URI\n    /// </summary>\n    /// <param name=\"builder\">The <see cref=\"INavigationBuilder\"/>.</param>\n    /// <param name=\"segmentName\">The navigation segment name `ViewA`.</param>\n    /// <param name=\"useModalNavigation\">An optional parameter whether to force Modal Navigation or use the default behavior based on the Navigation Stack.</param>\n    /// <returns>The <see cref=\"INavigationBuilder\"/>.</returns>\n    public static INavigationBuilder AddSegment(this INavigationBuilder builder, string segmentName, bool? useModalNavigation = null) =>\n        builder.AddSegment(segmentName, o =>\n        {\n            if (useModalNavigation.HasValue)\n                o.UseModalNavigation(useModalNavigation.Value);\n        });\n\n    /// <summary>\n    /// Adds the registered Navigation Segment name for the specified ViewModel.\n    /// </summary>\n    /// <typeparam name=\"TViewModel\">The ViewModel to navigate to.</typeparam>\n    /// <param name=\"builder\">The <see cref=\"INavigationBuilder\"/>.</param>\n    /// <returns>The <see cref=\"INavigationBuilder\"/>.</returns>\n    public static ICreateTabBuilder AddSegment<TViewModel>(this ICreateTabBuilder builder)  =>\n        builder.AddSegment<TViewModel>(b => { });\n\n    public static ICreateTabBuilder AddSegment<TViewModel>(this ICreateTabBuilder builder, Action<ISegmentBuilder> configureSegment) =>\n        builder.AddSegment(GetNavigationKey<TViewModel>(builder), configureSegment);\n\n    public static INavigationBuilder AddSegment<TViewModel>(this INavigationBuilder builder) =>\n        builder.AddSegment<TViewModel>(b => { });\n\n    public static INavigationBuilder AddSegment<TViewModel>(this INavigationBuilder builder, Action<ISegmentBuilder> configureSegment) =>\n        builder.AddSegment(GetNavigationKey<TViewModel>(builder), configureSegment);\n\n    public static INavigationBuilder AddSegment<TViewModel>(this INavigationBuilder builder, bool useModalNavigation) =>\n        builder.AddSegment<TViewModel>(b => b.UseModalNavigation(useModalNavigation));\n\n    // Will check for the Navigation key of a registered NavigationPage\n    public static INavigationBuilder AddNavigationPage(this INavigationBuilder builder) =>\n        builder.AddNavigationPage(b => { });\n\n    public static INavigationBuilder AddNavigationPage(this INavigationBuilder builder, Action<ISegmentBuilder> configureSegment)\n    {\n        if (builder is not IRegistryAware registryAware)\n            throw new Exception(\"The builder does not implement IRegistryAware\");\n\n        var registrations = registryAware.Registry.ViewsOfType(typeof(NavigationPage));\n        if (!registrations.Any())\n            throw new NavigationException(NavigationException.NoPageIsRegistered, nameof(NavigationPage));\n\n        var registration = registrations.Last();\n        return builder.AddSegment(registration.Name, configureSegment);\n    }\n\n    public static ICreateTabBuilder AddNavigationPage(this ICreateTabBuilder builder) =>\n        builder.AddNavigationPage(b => { });\n\n    public static ICreateTabBuilder AddNavigationPage(this ICreateTabBuilder builder, Action<ISegmentBuilder> configureSegment)\n    {\n        if (builder is not IRegistryAware registryAware)\n            throw new Exception(\"The builder does not implement IRegistryAware\");\n\n        var registrations = registryAware.Registry.ViewsOfType(typeof(NavigationPage));\n        if (!registrations.Any())\n            throw new NavigationException(NavigationException.NoPageIsRegistered, nameof(NavigationPage));\n\n        var registration = registrations.Last();\n        return builder.AddSegment(registration.Name, configureSegment);\n    }\n\n    /// <summary>\n    /// Adds a NavigationPage to the Navigation Uri\n    /// </summary>\n    /// <param name=\"builder\">The <see cref=\"INavigationBuilder\"/>.</param>\n    /// <param name=\"useModalNavigation\">When <see langword=\"true\" /> this will force Modal Navigation.</param>\n    /// <returns>The <see cref=\"INavigationBuilder\"/>.</returns>\n    /// <remarks>This should only be used when you have a single <see cref=\"NavigationPage\"/> registered for Navigation. Typically this is automatically registered for you by Prism.</remarks>\n    public static INavigationBuilder AddNavigationPage(this INavigationBuilder builder, bool useModalNavigation) =>\n        builder.AddNavigationPage(o => o.UseModalNavigation(useModalNavigation));\n\n    /// <summary>\n    /// Navigates back to the specified view model asynchronously.\n    /// </summary>\n    /// <typeparam name=\"TViewModel\">The ViewModel to navigate to.</typeparam>\n    /// <param name=\"builder\">The <see cref=\"INavigationBuilder\"/>.</param>\n    /// <returns>A task representing the asynchronous operation.</returns>\n    public static Task<INavigationResult> GoBackToAsync<TViewModel>(this INavigationBuilder builder) =>\n        builder.GoBackToAsync(GetNavigationKey<TViewModel>(builder));\n\n    //public static INavigationBuilder AddSegment(this INavigationBuilder builder, string segmentName, params string[] createTabs)\n    //{\n    //    return builder;\n    //}\n\n    //public static INavigationBuilder AddSegment(this INavigationBuilder builder, string segmentName, bool useModalNavigation, params string[] createTabs)\n    //{\n    //    return builder;\n    //}\n\n    //public static INavigationBuilder AddSegment(this INavigationBuilder builder, string segmentName, string selectTab, bool? useModalNavigation, params string[] createTabs)\n    //{\n    //    return builder;\n    //}\n\n    /// <summary>\n    /// Navigates to the URI generated by the <see cref=\"INavigationBuilder\"/>.\n    /// </summary>\n    /// <param name=\"builder\">The <see cref=\"INavigationBuilder\"/>.</param>\n    public static async void Navigate(this INavigationBuilder builder)\n    {\n        await builder.NavigateAsync();\n    }\n\n    /// <summary>\n    /// Navigates to the URI generated by the <see cref=\"INavigationBuilder\"/> with a specified callback\n    /// when the Navigation is unsuccessful with an Exception encountered while navigating. This is typically a <see cref=\"NavigationException\"/>. You should check that the navigation was not cancelled.\n    /// </summary>\n    /// <param name=\"builder\">The <see cref=\"INavigationBuilder\"/>.</param>\n    /// <param name=\"onError\">Delegate to handle when we encounter a Navigation Exception</param>\n    public static async void Navigate(this INavigationBuilder builder, Action<Exception> onError)\n    {\n        await builder.NavigateAsync(onError);\n    }\n\n    /// <summary>\n    /// Navigates to the URI generated by the <see cref=\"INavigationBuilder\"/> with a specified callback when the Navigation is successful.\n    /// </summary>\n    /// <param name=\"builder\">The <see cref=\"INavigationBuilder\"/>.</param>\n    /// <param name=\"onSuccess\">Delegate to handle when the navigation is successful</param>\n    public static async void Navigate(this INavigationBuilder builder, Action onSuccess)\n    {\n        await builder.NavigateAsync(onSuccess, _ => { });\n    }\n\n    /// <summary>\n    /// Navigates to the URI generated by the <see cref=\"INavigationBuilder\"/> with callbacks for navigation success and errors.\n    /// </summary>\n    /// <param name=\"builder\">The <see cref=\"INavigationBuilder\"/>.</param>\n    /// <param name=\"onSuccess\">Delegate to handle when the navigation is successful</param>\n    /// <param name=\"onError\">Delegate to handle when we encounter a Navigation Exception</param>\n    public static async void Navigate(this INavigationBuilder builder, Action onSuccess, Action<Exception> onError)\n    {\n        await builder.NavigateAsync(onSuccess, onError);\n    }\n\n    /// <summary>\n    /// Forces Modal Navigation\n    /// </summary>\n    /// <param name=\"builder\">The <see cref=\"ISegmentBuilder\"/>.</param>\n    /// <returns>The <see cref=\"INavigationBuilder\"/>.</returns>\n    public static ISegmentBuilder UseModalNavigation(this ISegmentBuilder builder) =>\n        builder.UseModalNavigation(true);\n\n    /// <summary>\n    /// Adds a Segment to the <see cref=\"ICreateTabBuilder\"/> for deep linking within a created tab\n    /// </summary>\n    /// <param name=\"builder\">The <see cref=\"ICreateTabBuilder\"/>.</param>\n    /// <param name=\"segmentNameOrUri\">The Navigation Segment name `ViewA` or uri `ViewA?id=5`</param>\n    /// <returns>The <see cref=\"INavigationBuilder\"/>.</returns>\n    public static ICreateTabBuilder AddSegment(this ICreateTabBuilder builder, string segmentNameOrUri) =>\n            builder.AddSegment(segmentNameOrUri, null);\n\n    /// <summary>\n    /// Will dynamically create a Tab within the <see cref=\"TabbedPage\"/>.\n    /// </summary>\n    /// <param name=\"builder\">The <see cref=\"ITabbedSegmentBuilder\"/>.</param>\n    /// <param name=\"segmentName\">The name of the <see cref=\"TabbedPage\"/>.</param>\n    /// <param name=\"configureSegment\">Delegate to configure the generated <see cref=\"TabbedPage\"/>.</param>\n    /// <returns>The <see cref=\"ITabbedSegmentBuilder\"/>.</returns>\n    public static ITabbedSegmentBuilder CreateTab(this ITabbedSegmentBuilder builder, string segmentName, Action<ISegmentBuilder> configureSegment) =>\n        builder.CreateTab(o => o.AddSegment(segmentName, configureSegment));\n\n    /// <summary>\n    /// Dynamically creates a tab within a <see cref=\"TabbedPage\"/> based on a Segment Name `ViewA` or Uri `ViewA?id=5`.\n    /// </summary>\n    /// <param name=\"builder\">The <see cref=\"ITabbedSegmentBuilder\"/>.</param>\n    /// <param name=\"segmentNameOrUri\">The View name or Uri</param>\n    /// <returns>The <see cref=\"ITabbedSegmentBuilder\"/>.</returns>\n    public static ITabbedSegmentBuilder CreateTab(this ITabbedSegmentBuilder builder, string segmentNameOrUri) =>\n        builder.CreateTab(o => o.AddSegment(segmentNameOrUri));\n\n    public static ITabbedSegmentBuilder CreateTab<TViewModel>(this ITabbedSegmentBuilder builder)\n    {\n        var navigationKey = GetNavigationKey<TViewModel>(builder);\n        return builder.CreateTab(navigationKey);\n    }\n\n    /// <summary>\n    /// Selects the active tab for the specified ViewModel\n    /// </summary>\n    /// <typeparam name=\"TViewModel\">The ViewModel</typeparam>\n    /// <param name=\"builder\">The <see cref=\"ITabbedSegmentBuilder\"/>.</param>\n    /// <returns>The <see cref=\"ITabbedSegmentBuilder\"/>.</returns>\n    public static ITabbedSegmentBuilder SelectTab<TViewModel>(this ITabbedSegmentBuilder builder)\n    {\n        var navigationKey = GetNavigationKey<TViewModel>(builder);\n        return builder.SelectedTab(navigationKey);\n    }\n\n    /// <summary>\n    /// Will Select a specific Tab within the <see cref=\"TabbedPage\"/>.\n    /// </summary>\n    /// <param name=\"builder\">The <see cref=\"ITabbedNavigationBuilder\"/>.</param>\n    /// <param name=\"navigationSegments\">The Navigation Segment Name or Names.</param>\n    /// <returns></returns>\n    /// <remarks>Typically only a single Navigation Segment should be needed. In the event multiple tabs use a <see cref=\"NavigationPage\"/> you should specify the name of the NavigationPage &amp; the name of the Current or Top most Page within the tab you want to navigate to</remarks>\n    /// <example>\n    /// builder.SelectTab(\"NavigationPage\", \"ViewA\");\n    /// </example>\n    public static ITabbedNavigationBuilder SelectTab(this ITabbedNavigationBuilder builder, params string[] navigationSegments) =>\n        builder.SelectTab(string.Join(\"|\", navigationSegments));\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Builder/SegmentBuilder.cs",
    "content": "﻿namespace Prism.Navigation.Builder;\n\ninternal class SegmentBuilder : ISegmentBuilder, IConfigurableSegmentName, IUriSegment\n{\n    private INavigationParameters _parameters { get; }\n\n    public SegmentBuilder(string segmentName)\n    {\n        _parameters = new NavigationParameters();\n        SegmentName = segmentName;\n    }\n\n    public string SegmentName { get; set; }\n\n    public string Segment => BuildSegment();\n\n    public ISegmentBuilder AddParameter(string key, object value)\n    {\n        _parameters.Add(key, value);\n        return this;\n    }\n\n    public ISegmentBuilder UseModalNavigation(bool useModalNavigation)\n    {\n        return AddParameter(KnownNavigationParameters.UseModalNavigation, useModalNavigation);\n    }\n\n    private string BuildSegment()\n    {\n        if (!_parameters.Any())\n            return SegmentName;\n\n        return SegmentName + _parameters.ToString();\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Builder/TabbedSegmentBuilder.cs",
    "content": "using Prism.Common;\nusing Prism.Mvvm;\n\nnamespace Prism.Navigation.Builder;\n\ninternal class TabbedSegmentBuilder : ITabbedSegmentBuilder, IConfigurableSegmentName, IUriSegment, IRegistryAware\n{\n    private INavigationParameters _parameters { get; }\n    private INavigationBuilder _builder { get; }\n\n    public TabbedSegmentBuilder(INavigationBuilder builder)\n    {\n        _builder = builder;\n        _parameters = new NavigationParameters();\n\n        if (builder is not IRegistryAware registryAware)\n            throw new Exception(\"The builder does not implement IRegistryAware\");\n\n        var registrations = registryAware.Registry.ViewsOfType(typeof(TabbedPage));\n        if (!registrations.Any())\n            throw new NavigationException(NavigationException.NoPageIsRegistered, nameof(TabbedPage));\n\n        var registration = registrations.Last();\n        SegmentName = registration.Name;\n    }\n\n    public TabbedSegmentBuilder(INavigationBuilder builder, string segmentName)\n    {\n        _builder = builder;\n        _parameters = new NavigationParameters();\n\n        if (builder is not IRegistryAware registryAware)\n            throw new Exception(\"The builder does not implement IRegistryAware\");\n\n        var registration = registryAware.Registry.ViewsOfType(typeof(TabbedPage)).FirstOrDefault(x => x.Name == segmentName);\n        if (registration == null)\n            throw new NavigationException(NavigationException.NoPageIsRegistered, nameof(TabbedPage));\n\n        SegmentName = registration.Name;\n    }\n\n    IViewRegistry IRegistryAware.Registry => ((IRegistryAware)_builder).Registry;\n\n    public string SegmentName { get; set; }\n\n    public string Segment => BuildSegment();\n\n    public ITabbedSegmentBuilder AddSegmentParameter(string key, object value)\n    {\n        _parameters.Add(key, value);\n        return this;\n    }\n\n    public ITabbedSegmentBuilder UseModalNavigation(bool useModalNavigation)\n    {\n        return AddSegmentParameter(KnownNavigationParameters.UseModalNavigation, useModalNavigation);\n    }\n\n    public ITabbedSegmentBuilder CreateTab(Action<ICreateTabBuilder> configureSegment)\n    {\n        if (configureSegment is null)\n        {\n            throw new ArgumentNullException(nameof(configureSegment));\n        }\n\n        var builder = new CreateTabBuilder(((IRegistryAware)_builder).Registry);\n        configureSegment(builder);\n        return AddSegmentParameter(KnownNavigationParameters.CreateTab, builder.Segment);\n    }\n\n    public ITabbedSegmentBuilder SelectedTab(string segmentName)\n    {\n        return AddSegmentParameter(KnownNavigationParameters.SelectedTab, segmentName);\n    }\n\n    public ITabbedSegmentBuilder Title(string title)\n    {\n        return AddSegmentParameter(KnownNavigationParameters.Title, title);\n    }\n\n    private string BuildSegment()\n    {\n        if (!_parameters.Any())\n            return SegmentName;\n\n        return SegmentName + _parameters.ToString();\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/IConfirmNavigation.cs",
    "content": "﻿namespace Prism.Navigation;\n\n/// <summary>\n/// Provides a way for ViewModels involved in navigation to determine if a navigation request should continue.\n/// </summary>\npublic interface IConfirmNavigation\n{\n    /// <summary>\n    /// Determines whether this instance accepts being navigated away from.\n    /// </summary>\n    /// <param name=\"parameters\">The navigation parameters.</param>\n    /// <returns><c>True</c> if navigation can continue, <c>False</c> if navigation is not allowed to continue</returns>\n    bool CanNavigate(INavigationParameters parameters);\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/IConfirmNavigationAsync.cs",
    "content": "﻿namespace Prism.Navigation;\n\n/// <summary>\n/// Provides a way for ViewModels involved in navigation to asynchronously determine if a navigation request should continue.\n/// </summary>\npublic interface IConfirmNavigationAsync\n{\n    /// <summary>\n    /// Determines whether this instance accepts being navigated away from.\n    /// </summary>\n    /// <param name=\"parameters\">The navigation parameters.</param>\n    /// <returns><c>True</c> if navigation can continue, <c>False</c> if navigation is not allowed to continue</returns>\n    Task<bool> CanNavigateAsync(INavigationParameters parameters);\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/IFlyoutPageOptions.cs",
    "content": "﻿namespace Prism.Navigation;\n\n/// <summary>\n/// Provides a way for the <see cref=\"INavigationService\" /> to know whether the Flyout should be presented after navigation.\n/// </summary>\npublic interface IFlyoutPageOptions\n{\n    /// <summary>\n    /// The INavigationService uses the result of this property to determine if the FlyoutPage.Flyout should be presented after navigation.\n    /// </summary>\n    bool IsPresentedAfterNavigation { get; }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/IInitialize.cs",
    "content": "﻿namespace Prism.Navigation;\n\n/// <summary>\n/// Provides a way for ViewModels involved in navigation to initialize.\n/// </summary>\npublic interface IInitialize\n{\n    /// <summary>\n    /// Initializes this instance.\n    /// </summary>\n    /// <param name=\"parameters\">The navigation parameters.</param>\n    void Initialize(INavigationParameters parameters);\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/IInitializeAsync.cs",
    "content": "﻿namespace Prism.Navigation;\n\n/// <summary>\n/// Provides a way for ViewModels involved in navigation to asynchronously initialize.\n/// </summary>\npublic interface IInitializeAsync\n{\n    /// <summary>\n    /// Initializes this instance.\n    /// </summary>\n    /// <param name=\"parameters\">The navigation parameters.</param>\n    Task InitializeAsync(INavigationParameters parameters);\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/INavigatedAware.cs",
    "content": "﻿namespace Prism.Navigation;\n\n/// <summary>\n/// Provides a way for ViewModels involved in navigation to be notified of navigation activities after the target Page has been added to the navigation stack.\n/// </summary>\npublic interface INavigatedAware\n{\n    /// <summary>\n    /// Called when the implementer has been navigated away from.\n    /// </summary>\n    /// <param name=\"parameters\">The navigation parameters.</param>\n    void OnNavigatedFrom(INavigationParameters parameters);\n\n    /// <summary>\n    /// Called when the implementer has been navigated to.\n    /// </summary>\n    /// <param name=\"parameters\">The navigation parameters.</param>\n    void OnNavigatedTo(INavigationParameters parameters);\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/INavigationAware.cs",
    "content": "﻿namespace Prism.Navigation;\n\n/// <summary>\n/// Provides a way for ViewModels involved in navigation to be notified of navigation activities.\n/// </summary>\npublic interface INavigationAware : INavigatedAware\n{\n\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/INavigationPageOptions.cs",
    "content": "﻿namespace Prism.Navigation;\n\n/// <summary>\n/// Provides a way for the INavigationService to make decisions regarding a NavigationPage during navigation.\n/// </summary>\npublic interface INavigationPageOptions\n{\n    /// <summary>\n    /// The INavigationService uses the result of this property to determine if the NavigationPage should clear the NavigationStack when navigating to a new Page.\n    /// </summary>\n    /// <remarks>This is equivalent to calling PopToRoot, and then replacing the current Page with the target Page being navigated to.</remarks>\n    bool ClearNavigationStackOnNavigation { get; }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/INavigationRegistry.cs",
    "content": "﻿using Prism.Mvvm;\n\nnamespace Prism.Navigation;\n\npublic interface INavigationRegistry : IViewRegistry { }\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/INavigationService.cs",
    "content": "namespace Prism.Navigation;\n\n/// <summary>\n/// Provides page based navigation for ViewModels.\n/// </summary>\npublic interface INavigationService\n{\n    /// <summary>\n    /// Navigates to the most recent entry in the back navigation history by popping the calling Page off the navigation stack.\n    /// </summary>\n    /// <param name=\"parameters\">The navigation parameters</param>\n    /// <returns>If <c>true</c> a go back operation was successful. If <c>false</c> the go back operation failed.</returns>\n    Task<INavigationResult> GoBackAsync(INavigationParameters parameters);\n\n    /// <summary>\n    /// Navigates to the most recent entry in the back navigation history for the <paramref name=\"viewName\"/>.\n    /// </summary>\n    /// <param name=\"viewName\">The name of the View to navigate back to</param>\n    /// <param name=\"parameters\">The navigation parameters</param>\n    /// <returns>If <c>true</c> a go back operation was successful. If <c>false</c> the go back operation failed.</returns>\n    Task<INavigationResult> GoBackToAsync(string viewName, INavigationParameters parameters);\n\n    /// <summary>\n    /// When navigating inside a NavigationPage: Pops all but the root Page off the navigation stack\n    /// </summary>\n    /// <param name=\"parameters\">The navigation parameters</param>\n    /// <returns><see cref=\"INavigationResult\"/> indicating whether the request was successful or if there was an encountered <see cref=\"Exception\"/>.</returns>\n    /// <remarks>Only works when called from a View within a NavigationPage</remarks>\n    Task<INavigationResult> GoBackToRootAsync(INavigationParameters parameters);\n\n    /// <summary>\n    /// Initiates navigation to the target specified by the <paramref name=\"uri\"/>.\n    /// </summary>\n    /// <param name=\"uri\">The Uri to navigate to</param>\n    /// <param name=\"parameters\">The navigation parameters</param>\n    /// <returns><see cref=\"INavigationResult\"/> indicating whether the request was successful or if there was an encountered <see cref=\"Exception\"/>.</returns>\n    /// <remarks>Navigation parameters can be provided in the Uri and by using the <paramref name=\"parameters\"/>.</remarks>\n    /// <example>\n    /// NavigateAsync(new Uri(\"MainPage?id=3&amp;name=Brian\", UriKind.RelativeSource), parameters);\n    /// </example>\n    Task<INavigationResult> NavigateAsync(Uri uri, INavigationParameters parameters);\n\n    /// <summary>\n    /// Selects a Tab of the TabbedPage parent and Navigates to a specified Uri\n    /// </summary>\n    /// <param name=\"name\">The name of the tab to select</param>\n    /// <param name=\"uri\">The Uri to navigate to</param>\n    /// <param name=\"parameters\">The navigation parameters</param>\n    /// <returns><see cref=\"INavigationResult\"/> indicating whether the request was successful or if there was an encountered <see cref=\"Exception\"/>.</returns>\n    Task<INavigationResult> SelectTabAsync(string name, Uri uri, INavigationParameters parameters);\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/INavigationServiceExtensions.cs",
    "content": "using Prism.Common;\n\nnamespace Prism.Navigation;\n\n/// <summary>\n/// Common extensions for the <see cref=\"INavigationService\"/>\n/// </summary>\npublic static class INavigationServiceExtensions\n{\n    /// <summary>\n    /// Navigates to the most recent entry in the back navigation history by popping the calling Page off the navigation stack.\n    /// </summary>\n    /// <returns><see cref=\"INavigationResult\"/> indicating whether the request was successful or if there was an encountered <see cref=\"Exception\"/>.</returns>\n    public static Task<INavigationResult> GoBackAsync(this INavigationService navigationService) =>\n        navigationService.GoBackAsync(new NavigationParameters());\n\n    /// <summary>\n    /// Navigates to the most recent entry in the back navigation history by popping the calling Page off the navigation stack.\n    /// </summary>\n    /// <param name=\"navigationService\">Service for handling navigation between views</param>\n    /// <param name=\"parameters\">The navigation parameters</param>\n    /// <returns><see cref=\"INavigationResult\"/> indicating whether the request was successful or if there was an encountered <see cref=\"Exception\"/>.</returns>\n    public static Task<INavigationResult> GoBackAsync(this INavigationService navigationService, params (string Key, object Value)[] parameters)\n    {\n        return navigationService.GoBackAsync(GetNavigationParameters(parameters));\n    }\n\n    /// <summary>\n    /// Navigates to the most recent entry in the back navigation history for the <paramref name=\"viewName\"/>.\n    /// </summary>\n    /// <param name=\"navigationService\">Service for handling navigation between views</param>\n    /// <param name=\"viewName\">The name of the View to navigate back to</param>\n    /// <returns>If <c>true</c> a go back operation was successful. If <c>false</c> the go back operation failed.</returns>\n    public static Task<INavigationResult> GoBackToAsync(this INavigationService navigationService, string viewName) => navigationService.GoBackToAsync(viewName, new NavigationParameters());\n\n    /// <summary>\n    /// When navigating inside a NavigationPage: Pops all but the root Page off the navigation stack\n    /// </summary>\n    /// <returns><see cref=\"INavigationResult\"/> indicating whether the request was successful or if there was an encountered <see cref=\"Exception\"/>.</returns>\n    /// <remarks>Only works when called from a View within a NavigationPage</remarks>\n    public static Task<INavigationResult> GoBackToRootAsync(this INavigationService navigationService) =>\n        navigationService.GoBackToRootAsync(null);\n\n    /// <summary>\n    /// Initiates navigation to the target specified by the <paramref name=\"uri\"/>.\n    /// </summary>\n    /// <param name=\"navigationService\">Service for handling navigation between views</param>\n    /// <param name=\"uri\">The Uri to navigate to</param>\n    /// <example>\n    /// NavigateAsync(new Uri(\"MainPage?id=3&amp;name=brian\", UriKind.RelativeSource));\n    /// </example>\n    public static Task<INavigationResult> NavigateAsync(this INavigationService navigationService, Uri uri) =>\n        navigationService.NavigateAsync(uri, null);\n\n    /// <summary>\n    /// Initiates navigation to the target specified by the <paramref name=\"uri\"/>.\n    /// </summary>\n    /// <param name=\"navigationService\">Service for handling navigation between views</param>\n    /// <param name=\"uri\">The Uri to navigate to</param>\n    /// <param name=\"parameters\">The navigation parameters</param>\n    /// <returns><see cref=\"INavigationResult\"/> indicating whether the request was successful or if there was an encountered <see cref=\"Exception\"/>.</returns>\n    /// <remarks>Navigation parameters can be provided in the Uri and by using the <paramref name=\"parameters\"/>.</remarks>\n    /// <example>\n    /// NavigateAsync(new Uri(\"MainPage?id=3&amp;name=dan\", UriKind.RelativeSource), (\"person\", person), (\"foo\", bar));\n    /// </example>\n    public static Task<INavigationResult> NavigateAsync(this INavigationService navigationService, Uri uri, params (string Key, object Value)[] parameters)\n    {\n        return navigationService.NavigateAsync(uri, GetNavigationParameters(parameters));\n    }\n\n    /// <summary>\n    /// Initiates navigation to the target specified by the <paramref name=\"name\"/>.\n    /// </summary>\n    /// <param name=\"navigationService\">Service for handling navigation between views</param>\n    /// <param name=\"name\">The name of the target to navigate to.</param>\n    public static Task<INavigationResult> NavigateAsync(this INavigationService navigationService, string name) =>\n        navigationService.NavigateAsync(name, default(INavigationParameters));\n\n    /// <summary>\n    /// Initiates navigation to the target specified by the <paramref name=\"name\"/>.\n    /// </summary>\n    /// <param name=\"navigationService\">Service for handling navigation between views</param>\n    /// <param name=\"name\">The name of the target to navigate to.</param>\n    /// <param name=\"parameters\">The navigation parameters</param>\n    public static Task<INavigationResult> NavigateAsync(this INavigationService navigationService, string name, INavigationParameters parameters)\n    {\n        if (name.StartsWith(PageNavigationService.RemovePageRelativePath))\n            name = name.Replace(PageNavigationService.RemovePageRelativePath, PageNavigationService.RemovePageInstruction);\n\n        return navigationService.NavigateAsync(UriParsingHelper.Parse(name), parameters);\n    }\n\n    /// <summary>\n    /// Initiates navigation to the target specified by the <paramref name=\"name\"/>.\n    /// </summary>\n    /// <param name=\"navigationService\">Service for handling navigation between views</param>\n    /// <param name=\"name\">The Uri to navigate to</param>\n    /// <param name=\"parameters\">The navigation parameters</param>\n    /// <returns><see cref=\"INavigationResult\"/> indicating whether the request was successful or if there was an encountered <see cref=\"Exception\"/>.</returns>\n    /// <remarks>Navigation parameters can be provided in the Uri and by using the <paramref name=\"parameters\"/>.</remarks>\n    /// <example>\n    /// NavigateAsync(\"MainPage?id=3&amp;name=dan\", (\"person\", person), (\"foo\", bar));\n    /// </example>\n    public static Task<INavigationResult> NavigateAsync(this INavigationService navigationService, string name, params (string Key, object Value)[] parameters)\n    {\n        return navigationService.NavigateAsync(name, GetNavigationParameters(parameters));\n    }\n\n    /// <summary>\n    /// Provides an easy to use way to provide an Error Callback without using await NavigationService\n    /// </summary>\n    /// <param name=\"navigationTask\">The current Navigation Task</param>\n    /// <param name=\"errorCallback\">The <see cref=\"Exception\"/> handler</param>\n    public static void OnNavigationError(this Task<INavigationResult> navigationTask, Action<Exception> errorCallback)\n    {\n        navigationTask.Await(r =>\n        {\n            if (!r.Success)\n                errorCallback?.Invoke(r.Exception);\n        });\n    }\n\n    /// <summary>\n    /// Selects a Tab of the TabbedPage parent.\n    /// </summary>\n    /// <param name=\"navigationService\">Service for handling navigation between views</param>\n    /// <param name=\"name\">The name of the tab to select</param>\n    /// <param name=\"parameters\">The navigation parameters</param>\n    /// <returns><see cref=\"INavigationResult\"/> indicating whether the request was successful or if there was an encountered <see cref=\"Exception\"/>.</returns>\n    public static Task<INavigationResult> SelectTabAsync(this INavigationService navigationService, string name, INavigationParameters parameters) =>\n        navigationService.SelectTabAsync(name, null, parameters);\n\n    /// <summary>\n    /// Selects a Tab of the TabbedPage parent.\n    /// </summary>\n    /// <param name=\"navigationService\">Service for handling navigation between views</param>\n    /// <param name=\"name\">The name of the tab to select</param>\n    /// <param name=\"uri\">The Uri to navigate to</param>\n    /// <returns><see cref=\"INavigationResult\"/> indicating whether the request was successful or if there was an encountered <see cref=\"Exception\"/>.</returns>\n    public static Task<INavigationResult> SelectTabAsync(this INavigationService navigationService, string name, Uri uri) =>\n        navigationService.SelectTabAsync(name, uri, new NavigationParameters());\n\n    /// <summary>\n    /// Selects a Tab of the TabbedPage parent.\n    /// </summary>\n    /// <param name=\"navigationService\">Service for handling navigation between views</param>\n    /// <param name=\"name\">The name of the tab to select</param>\n    /// <param name=\"uri\">The Uri to navigate to</param>\n    /// <returns><see cref=\"INavigationResult\"/> indicating whether the request was successful or if there was an encountered <see cref=\"Exception\"/>.</returns>\n    public static Task<INavigationResult> SelectTabAsync(this INavigationService navigationService, string name, string uri) =>\n        navigationService.SelectTabAsync(name, UriParsingHelper.Parse(uri), new NavigationParameters());\n\n    /// <summary>\n    /// Selects a Tab of the TabbedPage parent.\n    /// </summary>\n    /// <param name=\"navigationService\">Service for handling navigation between views</param>\n    /// <param name=\"name\">The name of the tab to select</param>\n    /// <param name=\"uri\">The Uri to navigate to</param>\n    /// <param name=\"parameters\">The navigation parameters</param>\n    /// <returns><see cref=\"INavigationResult\"/> indicating whether the request was successful or if there was an encountered <see cref=\"Exception\"/>.</returns>\n    public static Task<INavigationResult> SelectTabAsync(this INavigationService navigationService, string name, string uri, INavigationParameters parameters) =>\n        navigationService.SelectTabAsync(name, UriParsingHelper.Parse(uri), parameters);\n\n    /// <summary>\n    /// Selects a tab programatically\n    /// </summary>\n    /// <param name=\"navigationService\">Service for handling navigation between views</param>\n    /// <param name=\"tabName\">The name of the tab to select</param>\n    /// <returns>The <see cref=\"INavigationResult\"/>.</returns>\n    public static Task<INavigationResult> SelectTabAsync(this INavigationService navigationService, string tabName) =>\n        navigationService.SelectTabAsync(tabName, new NavigationParameters());\n\n    private static INavigationParameters GetNavigationParameters((string Key, object Value)[] parameters)\n    {\n        var navParams = new NavigationParameters();\n        foreach (var (Key, Value) in parameters)\n        {\n            navParams.Add(Key, Value);\n        }\n        return navParams;\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/IWindowManager.cs",
    "content": "namespace Prism.Navigation;\n\n#nullable enable\n/// <summary>\n/// Defines an interface for managing windows within an application.\n/// </summary>\npublic interface IWindowManager\n{\n    /// <summary>\n    /// Gets a read-only collection of all currently open windows.\n    /// </summary>\n    IReadOnlyList<Window> Windows { get; }\n\n    /// <summary>\n    /// Gets the currently active window, if any.\n    /// </summary>\n    Window? Current { get; }\n\n    /// <summary>\n    /// Opens a new window.\n    /// </summary>\n    /// <param name=\"window\">The Window object to be opened.</param>\n    /// <exception cref=\"ArgumentNullException\">Thrown if the window parameter is null.</exception>\n    void OpenWindow(Window window);\n\n    /// <summary>\n    /// Closes a specified window.\n    /// </summary>\n    /// <param name=\"window\">The Window object to be closed.</param>\n    /// <exception cref=\"ArgumentNullException\">Thrown if the window parameter is null.</exception>\n    void CloseWindow(Window window);\n}\n\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/IWindowManagerExtensions.cs",
    "content": "using Prism.Dialogs;\nusing Prism.Navigation.Xaml;\n\nnamespace Prism.Navigation;\n\n/// <summary>\n/// Provides extensions for the <see cref=\"IWindowManager\"/>\n/// </summary>\npublic static class IWindowManagerExtensions\n{\n    /// <summary>\n    /// Gets the <see cref=\"INavigationService\"/> for the currently displayed <see cref=\"Page\"/>.\n    /// </summary>\n    /// <param name=\"windowManager\">The <see cref=\"IWindowManager\"/>.</param>\n    /// <returns>The <see cref=\"INavigationService\"/> for the current <see cref=\"Page\"/>.</returns>\n    public static INavigationService GetCurrentNavigationService(this IWindowManager windowManager)\n    {\n        var page = windowManager.GetCurrentPage();\n        return Xaml.Navigation.GetNavigationService(page);\n    }\n\n    /// <summary>\n    /// Gets the <see cref=\"IDialogService\"/> for the currently displayed <see cref=\"Page\"/>.\n    /// </summary>\n    /// <param name=\"windowManager\">The <see cref=\"IWindowManager\"/>.</param>\n    /// <returns>The <see cref=\"IDialogService\"/> for the current <see cref=\"Page\"/>.</returns>\n    public static IDialogService GetCurrentDialogService(this IWindowManager windowManager)\n    {\n        var page = windowManager.GetCurrentPage();\n        var container = page.GetContainerProvider();\n        return container.Resolve<IDialogService>();\n    }\n\n    private static Page GetCurrentPage(this IWindowManager windowManager)\n    {\n        var window = windowManager.Current;\n        if (window is null)\n            throw new InvalidOperationException(\"No Window has been set in the Application\");\n        else if (window is not PrismWindow prismWindow)\n            throw new InvalidOperationException($\"Prism applications only support the use of PrismWindow, but found '{window.GetType().FullName}'.\");\n        else if (prismWindow.CurrentPage is null)\n            throw new InvalidOperationException(\"No current page has been set.\");\n        else\n            return prismWindow.CurrentPage;\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Internals/ChildRegionCollection.cs",
    "content": "using System.Collections;\nusing Prism.Navigation.Regions;\n\nnamespace Prism.Navigation.Internals;\n\n/// <summary>\n/// Represents a collection of child regions.\n/// </summary>\npublic class ChildRegionCollection : IEnumerable<VisualElement>, IDisposable\n{\n    private readonly List<IRegion> _regions = new();\n\n    /// <summary>\n    /// Adds a region to the collection.\n    /// </summary>\n    /// <param name=\"region\">The region to add.</param>\n    public void Add(IRegion region)\n    {\n        _regions.Add(region);\n    }\n\n    internal void Clear() => _regions.Clear();\n\n    /// <summary>\n    /// Returns an enumerator that iterates through the collection.\n    /// </summary>\n    /// <returns>An enumerator that can be used to iterate through the collection.</returns>\n    public IEnumerator<VisualElement> GetEnumerator() =>\n        _regions.SelectMany(x => x.ActiveViews)\n            .OfType<VisualElement>()\n            .Where(x => x is not null) // sanity check\n            .GetEnumerator();\n\n    IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();\n\n    /// <summary>\n    /// Disposes the collection and removes all regions from their respective region managers.\n    /// </summary>\n    public void Dispose()\n    {\n        foreach (var region in _regions)\n        {\n            var manager = region.RegionManager;\n            if (manager is null) continue;\n\n            manager.Regions.Remove(region.Name);\n        }\n        _regions.Clear();\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/KnownInternalParameters.cs",
    "content": "﻿namespace Prism.Navigation;\n\ninternal static class KnownInternalParameters\n{\n    public const string NavigationMode = \"__NavigationMode\";\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/KnownNavigationParameters.cs",
    "content": "﻿namespace Prism.Navigation;\n\npublic static class KnownNavigationParameters\n{\n    /// <summary>\n    /// Used to dynamically create a Page that will be used as a Tab when navigating to a TabbedPage.\n    /// </summary>\n    public const string CreateTab = \"createTab\";\n\n    /// <summary>\n    /// Used to select an existing Tab when navigating to a TabbedPage.\n    /// </summary>\n    public const string SelectedTab = \"selectedTab\";\n    \n    /// <summary>\n    /// Used to set the title to a TabbedPage.\n    /// </summary>\n    public const string Title = \"title\";\n\n    /// <summary>\n    /// Used to control the navigation stack. If <c>true</c> uses PopModalAsync, if <c>false</c> uses PopAsync.\n    /// </summary>\n    public const string UseModalNavigation = \"useModalNavigation\";\n\n    /// <summary>\n    /// Used to control whether the navigation should be animated.\n    /// </summary>\n    public const string Animated = \"animated\";\n\n    /// <summary>\n    /// Used to define a navigation parameter that is bound directly to a CommandParameter via <code>{Binding .}</code>.\n    /// </summary>\n    public const string XamlParam = \"xamlParam\";\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/NavigationMode.cs",
    "content": "﻿namespace Prism.Navigation;\n\n/// <summary>\n/// The NavigationMode provides information about the navigation operation that has been invoked.\n/// </summary>\npublic enum NavigationMode\n{\n    /// <summary>\n    /// Indicates that a navigation operation occured that resulted in navigating backwards in the navigation stack.\n    /// </summary>\n    Back,\n    /// <summary>\n    /// Indicates that a new navigation operation has occured and a new page has been added to the navigation stack.\n    /// </summary>\n    New,\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/NavigationParametersExtensions.cs",
    "content": "﻿using Prism.Properties;\n\nnamespace Prism.Navigation;\n\npublic static class NavigationParametersExtensions\n{\n    public static NavigationMode GetNavigationMode(this INavigationParameters parameters)\n    {\n        var internalParams = (INavigationParametersInternal)parameters;\n        if (internalParams.ContainsKey(KnownInternalParameters.NavigationMode))\n            return internalParams.GetValue<NavigationMode>(KnownInternalParameters.NavigationMode);\n\n        throw new System.ArgumentNullException(Resources.NavigationModeNotAvailable);\n    }\n\n    internal static INavigationParametersInternal GetNavigationParametersInternal(this INavigationParameters parameters)\n    {\n        return (INavigationParametersInternal)parameters;\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/NavigationRegistry.cs",
    "content": "﻿using Prism.Behaviors;\nusing Prism.Common;\nusing Prism.Mvvm;\nusing Prism.Navigation.Xaml;\nusing TabbedPage = Microsoft.Maui.Controls.TabbedPage;\n\nnamespace Prism.Navigation;\n\ninternal class NavigationRegistry : ViewRegistryBase, INavigationRegistry\n{\n    public NavigationRegistry(IEnumerable<ViewRegistration> registrations)\n        : base(ViewType.Page, registrations)\n    {\n    }\n\n    protected override void ConfigureView(BindableObject bindable, IContainerProvider container)\n    {\n        ConfigurePage(container, bindable as Page);\n    }\n\n    private static void ConfigurePage(IContainerProvider container, Page page)\n    {\n        if (page is TabbedPage tabbed)\n        {\n            foreach (var child in tabbed.Children)\n            {\n                var scope = container.CreateScope();\n                ConfigurePage(scope, child);\n            }\n        }\n        else if (page is NavigationPage navPage && navPage.RootPage is not null)\n        {\n            var scope = container.CreateScope();\n            ConfigurePage(scope, navPage.RootPage);\n\n            if (navPage.RootPage.GetType().Equals(typeof(Page)))\n            {\n                if (navPage.RootPage == navPage.CurrentPage)\n                {\n                    navPage.Pushed += PreventDefaultRootPage;\n                }\n                else\n                {\n                    navPage.Navigation.RemovePage(navPage.RootPage);\n                }\n            }\n        }\n\n        if (page.GetContainerProvider() is null)\n            page.SetContainerProvider(container);\n\n        var accessor = container.Resolve<IPageAccessor>();\n        if (accessor.Page is not null && accessor.Page != page)\n        {\n#if DEBUG\n            if (System.Diagnostics.Debugger.IsAttached)\n                System.Diagnostics.Debugger.Break();\n#endif\n            throw new NavigationException($\"Invalid Scope provided. The current scope Page Accessor contains '{accessor.Page.GetType().FullName}', expected '{page.GetType().FullName}'.\", page);\n        }\n\n        accessor.Page ??= page;\n\n        var behaviorFactories = container.Resolve<IEnumerable<IPageBehaviorFactory>>();\n        foreach (var factory in behaviorFactories)\n            factory.ApplyPageBehaviors(page);\n    }\n\n    private static void PreventDefaultRootPage(object sender, NavigationEventArgs e)\n    {\n        if (sender is not NavigationPage navigationPage)\n        {\n            return;\n        }\n\n        if (!navigationPage.RootPage.GetType().Equals(typeof(Page)))\n        {\n            navigationPage.Pushed -= PreventDefaultRootPage;\n            return;\n        }\n\n        if (navigationPage.RootPage == navigationPage.CurrentPage)\n        {\n            return;\n        }\n\n        navigationPage.Pushed -= PreventDefaultRootPage;\n\n        navigationPage.Navigation.RemovePage(navigationPage.RootPage);\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/NavigationRequestContext.cs",
    "content": "﻿namespace Prism.Navigation;\n\npublic record NavigationRequestContext\n{\n    public bool Cancelled => Result?.Exception is not null && Result.Exception is NavigationException ne && ne.Message == NavigationException.IConfirmNavigationReturnedFalse;\n    public NavigationRequestType Type { get; init; }\n    public Uri Uri { get; init; }\n    public INavigationParameters Parameters { get; init; }\n    public INavigationResult Result { get; init; }\n}"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/NavigationRequestType.cs",
    "content": "﻿namespace Prism.Navigation;\n\npublic enum NavigationRequestType\n{\n    Navigate,\n    GoBack,\n    GoToRoot,\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/PageNavigationService.cs",
    "content": "using System.Text.RegularExpressions;\nusing System.Web;\nusing Prism.Common;\nusing Prism.Events;\nusing Prism.Mvvm;\nusing Application = Microsoft.Maui.Controls.Application;\nusing XamlTab = Prism.Navigation.Xaml.TabbedPage;\n\nnamespace Prism.Navigation;\n\n/// <summary>\n/// Provides page based navigation for ViewModels.\n/// </summary>\npublic class PageNavigationService : INavigationService, IRegistryAware\n{\n    private static readonly SemaphoreSlim _semaphore = new (1, 1);\n    private static readonly TimeSpan _minTimeBetweenNavigations = TimeSpan.FromMilliseconds(150);\n    private static DateTime _lastNavigate;\n    internal const string RemovePageRelativePath = \"../\";\n    internal const string RemovePageInstruction = \"__RemovePage/\";\n    internal const string RemovePageSegment = \"__RemovePage\";\n\n    internal static PageNavigationSource NavigationSource { get; set; } = PageNavigationSource.Device;\n\n    private readonly IContainerProvider _container;\n    protected readonly IWindowManager _windowManager;\n    protected readonly IPageAccessor _pageAccessor;\n    protected readonly IEventAggregator _eventAggregator;\n\n    private Window _window;\n    protected Window Window\n    {\n        get\n        {\n            if(_window is null && _pageAccessor.Page is not null)\n            {\n                _window = _pageAccessor.Page.GetParentWindow();\n            }\n            else\n            {\n                _window = _windowManager.Windows.OfType<PrismWindow>().FirstOrDefault();\n            }\n\n            return _window;\n        }\n    }\n\n    // This should be resolved by the container when accessed as a Module could register views after the NavigationService was resolved\n    /// <summary>\n    /// Gets the <see cref=\"IViewRegistry\"/>\n    /// </summary>\n    public IViewRegistry Registry => _container.Resolve<INavigationRegistry>();\n\n    /// <summary>\n    /// Constructs a new instance of the <see cref=\"PageNavigationService\"/>.\n    /// </summary>\n    /// <param name=\"container\">The <see cref=\"IContainerProvider\"/> that will be used to resolve pages for navigation.</param>\n    /// <param name=\"windowManager\">The <see cref=\"IWindowManager\"/> that will let the NavigationService retrieve, open or close the app Windows.</param>\n    /// <param name=\"eventAggregator\">The <see cref=\"IEventAggregator\"/> that will raise <see cref=\"NavigationRequestEvent\"/>.</param>\n    /// <param name=\"pageAccessor\">The <see cref=\"IPageAccessor\"/> that will let the NavigationService retrieve the <see cref=\"Page\"/> for the current scope.</param>q\n    public PageNavigationService(IContainerProvider container,\n        IWindowManager windowManager,\n        IEventAggregator eventAggregator,\n        IPageAccessor pageAccessor)\n    {\n        _container = container;\n        _windowManager = windowManager;\n        _eventAggregator = eventAggregator;\n        _pageAccessor = pageAccessor;\n    }\n\n    /// <summary>\n    /// Navigates to the most recent entry in the back navigation history by popping the calling Page off the navigation stack.\n    /// </summary>\n    /// <param name=\"parameters\">The navigation parameters</param>\n    /// <returns>If <c>true</c> a go back operation was successful. If <c>false</c> the go back operation failed.</returns>\n    public virtual async Task<INavigationResult> GoBackAsync(INavigationParameters parameters)\n    {\n        try\n        {\n            await WaitForPendingNavigationRequests();\n            return await GoBackInternalAsync(parameters);\n        }\n        finally\n        {\n            _lastNavigate = DateTime.Now;\n            NavigationSource = PageNavigationSource.Device;\n            _semaphore.Release();\n        }\n    }\n\n    private async Task<INavigationResult> GoBackInternalAsync(INavigationParameters parameters)\n    {\n        Page page = null;\n        try\n        {\n            parameters ??= new NavigationParameters();\n\n            NavigationSource = PageNavigationSource.NavigationService;\n\n            page = GetCurrentPage();\n\n            parameters.GetNavigationParametersInternal().Add(KnownInternalParameters.NavigationMode, NavigationMode.Back);\n\n            var canNavigate = await MvvmHelpers.CanNavigateAsync(page, parameters);\n            if (!canNavigate)\n            {\n                throw new NavigationException(NavigationException.IConfirmNavigationReturnedFalse, page);\n            }\n\n            if (IsRoot(GetPageFromWindow(), page))\n            {\n                return SendAppToBackground(page);\n            }\n\n            bool useModalForDoPop = UseModalGoBack(page, parameters);\n            Page previousPage = MvvmHelpers.GetOnNavigatedToTarget(page, Window?.Page, useModalForDoPop);\n\n            bool? animated = parameters.ContainsKey(KnownNavigationParameters.Animated) ? parameters.GetValue<bool>(KnownNavigationParameters.Animated) : null;\n            var poppedPage = await DoPop(page.Navigation, useModalForDoPop, animated ?? true);\n            if (poppedPage != null)\n            {\n                MvvmHelpers.OnNavigatedFrom(page, parameters);\n                MvvmHelpers.OnNavigatedTo(previousPage, parameters);\n                MvvmHelpers.DestroyPage(poppedPage);\n\n                return Notify(NavigationRequestType.GoBack, parameters);\n            }\n        }\n        catch (Exception ex)\n        {\n            return Notify(NavigationRequestType.GoBack, parameters, ex);\n        }\n        finally\n        {\n            NavigationSource = PageNavigationSource.Device;\n        }\n\n        return Notify(NavigationRequestType.GoBack, parameters, GetGoBackException(page, GetPageFromWindow()));\n    }\n\n    /// <inheritdoc />\n    public virtual async Task<INavigationResult> GoBackToAsync(string viewName, INavigationParameters parameters)\n    {\n        await WaitForPendingNavigationRequests();\n        try\n        {\n            parameters ??= new NavigationParameters();\n\n            parameters.GetNavigationParametersInternal().Add(KnownInternalParameters.NavigationMode, NavigationMode.Back);\n\n            var page = GetCurrentPage();\n            var canNavigate = await MvvmHelpers.CanNavigateAsync(page, parameters);\n            if (!canNavigate)\n            {\n                throw new NavigationException(NavigationException.IConfirmNavigationReturnedFalse, page);\n            }\n\n            var pagesToDestroy = page.Navigation.NavigationStack.ToList(); // get all pages to destroy\n            pagesToDestroy.Reverse(); // destroy them in reverse order\n            var goBackPage = pagesToDestroy.FirstOrDefault(p => ViewModelLocator.GetNavigationName(p) == viewName) \n                ?? throw new NavigationException(NavigationException.GoBackRequiresNavigationPage); // find the go back page\n            var index = pagesToDestroy.IndexOf(goBackPage);\n            pagesToDestroy.RemoveRange(index, pagesToDestroy.Count - index); // don't destroy pages from the go back page to the root page\n            var pagesToRemove = pagesToDestroy.Skip(1).ToList(); // exclude the current page from the destroy pages\n\n            bool animated = !parameters.ContainsKey(KnownNavigationParameters.Animated) || parameters.GetValue<bool>(KnownNavigationParameters.Animated);\n            NavigationSource = PageNavigationSource.NavigationService;\n            foreach(var removePage in pagesToRemove)\n            {\n                page.Navigation.RemovePage(removePage);\n            }\n            await page.Navigation.PopAsync(animated);\n            NavigationSource = PageNavigationSource.Device;\n\n            foreach (var destroyPage in pagesToDestroy)\n            {\n                MvvmHelpers.OnNavigatedFrom(destroyPage, parameters);\n                MvvmHelpers.DestroyPage(destroyPage);\n            }\n\n            MvvmHelpers.OnNavigatedTo(goBackPage, parameters);\n\n            return Notify(NavigationRequestType.GoBack, parameters);\n        }\n        catch (Exception ex)\n        {\n            return Notify(NavigationRequestType.GoBack, parameters, ex);\n        }\n        finally\n        {\n            _lastNavigate = DateTime.Now;\n            NavigationSource = PageNavigationSource.Device;\n            _semaphore.Release();\n        }\n    }\n\n    private static NavigationException GetGoBackException(Page currentPage, IView mainPage)\n    {\n        if (IsMainPage(currentPage, mainPage))\n        {\n            return new NavigationException(NavigationException.CannotPopApplicationMainPage, currentPage);\n        }\n        else if ((currentPage is NavigationPage navPage && IsOnNavigationPageRoot(navPage)) ||\n            (currentPage.Parent is NavigationPage navParent && IsOnNavigationPageRoot(navParent)))\n        {\n            return new NavigationException(NavigationException.CannotGoBackFromRoot, currentPage);\n        }\n\n        return new NavigationException(NavigationException.UnknownException, currentPage);\n    }\n\n    private static bool IsOnNavigationPageRoot(NavigationPage navigationPage) =>\n        navigationPage.CurrentPage == navigationPage.RootPage;\n\n    private static bool IsMainPage(IView currentPage, IView mainPage)\n    {\n        if (currentPage == mainPage)\n        {\n            return true;\n        }\n        else if (mainPage is FlyoutPage flyout && flyout.Detail == currentPage)\n        {\n            return true;\n        }\n        else if (currentPage.Parent is TabbedPage tabbed && mainPage == tabbed)\n        {\n            return true;\n        }\n        else if (currentPage.Parent is NavigationPage navPage && navPage.CurrentPage == navPage.RootPage)\n        {\n            return IsMainPage(navPage, mainPage);\n        }\n\n        return false;\n    }\n\n    /// <summary>\n    /// When navigating inside a NavigationPage: Pops all but the root Page off the navigation stack\n    /// </summary>\n    /// <param name=\"parameters\">The navigation parameters</param>\n    /// <returns><see cref=\"INavigationResult\"/> indicating whether the request was successful or if there was an encountered <see cref=\"Exception\"/>.</returns>\n    /// <remarks>Only works when called from a View within a NavigationPage</remarks>\n    public virtual async Task<INavigationResult> GoBackToRootAsync(INavigationParameters parameters)\n    {\n        try\n        {\n            await WaitForPendingNavigationRequests();\n            parameters ??= new NavigationParameters();\n\n            parameters.GetNavigationParametersInternal().Add(KnownInternalParameters.NavigationMode, NavigationMode.Back);\n\n            var page = GetCurrentPage();\n            var canNavigate = await MvvmHelpers.CanNavigateAsync(page, parameters);\n            if (!canNavigate)\n            {\n                throw new NavigationException(NavigationException.IConfirmNavigationReturnedFalse, page);\n            }\n\n            var pagesToDestroy = page.Navigation.NavigationStack.ToList(); // get all pages to destroy\n            pagesToDestroy.Reverse(); // destroy them in reverse order\n            var root = pagesToDestroy.Last();\n            pagesToDestroy.Remove(root); //don't destroy the root page\n\n            bool animated = !parameters.ContainsKey(KnownNavigationParameters.Animated) || parameters.GetValue<bool>(KnownNavigationParameters.Animated);\n            NavigationSource = PageNavigationSource.NavigationService;\n            await page.Navigation.PopToRootAsync(animated);\n            NavigationSource = PageNavigationSource.Device;\n\n            foreach (var destroyPage in pagesToDestroy)\n            {\n                MvvmHelpers.OnNavigatedFrom(destroyPage, parameters);\n                MvvmHelpers.DestroyPage(destroyPage);\n            }\n\n            MvvmHelpers.OnNavigatedTo(root, parameters);\n\n            return Notify(NavigationRequestType.GoToRoot, parameters);\n        }\n        catch (Exception ex)\n        {\n            return Notify(NavigationRequestType.GoToRoot, parameters, ex);\n        }\n        finally\n        {\n            _lastNavigate = DateTime.Now;\n            NavigationSource = PageNavigationSource.Device;\n            _semaphore.Release();\n        }\n    }\n\n    /// <summary>\n    /// Initiates navigation to the target specified by the <paramref name=\"uri\"/>.\n    /// </summary>\n    /// <param name=\"uri\">The Uri to navigate to</param>\n    /// <param name=\"parameters\">The navigation parameters</param>\n    /// <remarks>Navigation parameters can be provided in the Uri and by using the <paramref name=\"parameters\"/>.</remarks>\n    /// <example>\n    /// NavigateAsync(new Uri(\"MainPage?id=3&amp;name=dan\", UriKind.RelativeSource), parameters);\n    /// </example>\n    public virtual async Task<INavigationResult> NavigateAsync(Uri uri, INavigationParameters parameters)\n    {\n        await WaitForPendingNavigationRequests();\n\n        try\n        {\n            parameters ??= new NavigationParameters();\n\n            NavigationSource = PageNavigationSource.NavigationService;\n\n            var navigationSegments = UriParsingHelper.GetUriSegments(uri);\n\n            if (uri.IsAbsoluteUri)\n            {\n                await ProcessNavigationForAbsoluteUri(navigationSegments, parameters, null, null);\n            }\n            else\n            {\n                await ProcessNavigation(GetCurrentPage(), navigationSegments, parameters, null, null);\n            }\n\n            return Notify(uri, parameters);\n        }\n        catch (Exception ex)\n        {\n            return Notify(uri, parameters, ex);\n        }\n        finally\n        {\n            _lastNavigate = DateTime.Now;\n            NavigationSource = PageNavigationSource.Device;\n            _semaphore.Release();\n        }\n    }\n\n    /// <summary>\n    /// Selects a Tab of the TabbedPage parent.\n    /// </summary>\n    /// <param name=\"tabName\">The name of the tab to select</param>\n    /// <param name=\"uri\">The Uri to navigate to</param>\n    /// <param name=\"parameters\">The navigation parameters</param>\n    /// <returns><see cref=\"INavigationResult\"/> indicating whether the request was successful or if there was an encountered <see cref=\"Exception\"/>.</returns>\n    public virtual async Task<INavigationResult> SelectTabAsync(string tabName, Uri uri, INavigationParameters parameters)\n    {\n        try\n        {\n            ArgumentException.ThrowIfNullOrWhiteSpace(tabName);\n\n            await PageNavigationService.WaitForPendingNavigationRequests();\n            NavigationSource = PageNavigationSource.NavigationService;\n\n            var tabbedPage = GetTabbedPage(_pageAccessor.Page);\n\n            static TabbedPage GetTabbedPage(Element page) =>\n                page switch\n                {\n                    TabbedPage tabbedPage => tabbedPage,\n                    null => null,\n                    _ => GetTabbedPage(page.Parent)\n                };\n\n            if (tabbedPage is null)\n                throw new NullReferenceException(\"The Page is null.\");\n\n            var parts = tabName.Split('|');\n            Page selectedChild = null;\n            if (parts.Length == 1)\n                selectedChild = tabbedPage.Children.FirstOrDefault(x => ViewModelLocator.GetNavigationName(x) == tabName || (x is NavigationPage navPage && ViewModelLocator.GetNavigationName(navPage.RootPage) == tabName));\n            else if (parts.Length == 2)\n                selectedChild = tabbedPage.Children.FirstOrDefault(x => x is NavigationPage navPage && ViewModelLocator.GetNavigationName(navPage) == parts[0] && ViewModelLocator.GetNavigationName(navPage.RootPage) == parts[1]);\n            else\n                throw new NavigationException($\"Invalid Tab Name: {tabName}\");\n\n            if (selectedChild is null)\n                throw new NavigationException($\"No Tab found with the Name: {tabName}\");\n\n            var navigatedFromPage = _pageAccessor.Page;\n            if (!await MvvmHelpers.CanNavigateAsync(navigatedFromPage, parameters))\n                throw new NavigationException(NavigationException.IConfirmNavigationReturnedFalse, navigatedFromPage);\n\n            var navigatedToTarget = selectedChild is NavigationPage navPage ? navPage.CurrentPage : selectedChild;\n            if (uri is not null)\n            {\n                if (uri.IsAbsoluteUri)\n                {\n                    throw new NavigationException(\"Cannot process an absolute Navigation Uri when navigating within a specified Tab\");\n                }\n\n                var navigationSegments = UriParsingHelper.GetUriSegments(uri);\n                await ProcessNavigation(navigatedToTarget, navigationSegments, parameters, null, null);\n                tabbedPage.CurrentPage = selectedChild;\n            }\n            else\n            {\n                tabbedPage.CurrentPage = selectedChild;\n                MvvmHelpers.OnNavigatedFrom(navigatedFromPage, parameters);\n                MvvmHelpers.OnNavigatedTo(navigatedToTarget, parameters);\n            }\n\n            return new NavigationResult();\n        }\n        catch (Exception ex)\n        {\n            return new NavigationResult(ex);\n        }\n        finally\n        {\n            _lastNavigate = DateTime.Now;\n            NavigationSource = PageNavigationSource.Device;\n            _semaphore.Release();\n        }\n    }\n\n    private static async Task WaitForPendingNavigationRequests()\n    {\n        await _semaphore.WaitAsync();\n        // Ensure adequate time has passed since last navigation so that UI Refresh can Occur\n        TimeSpan timeSinceLastNav = DateTime.Now - _lastNavigate;\n        if (timeSinceLastNav < _minTimeBetweenNavigations)\n        {\n            await Task.Delay(_minTimeBetweenNavigations - timeSinceLastNav);\n        }\n    }\n\n    /// <summary>\n    /// Processes the Navigation for the Queued navigation segments\n    /// </summary>\n    /// <param name=\"currentPage\">The Current <see cref=\"Page\"/> that we are navigating from.</param>\n    /// <param name=\"segments\">The Navigation <see cref=\"Uri\"/> segments.</param>\n    /// <param name=\"parameters\">The <see cref=\"INavigationParameters\"/>.</param>\n    /// <param name=\"useModalNavigation\"><see cref=\"Nullable{Boolean}\"/> flag if we should force Modal Navigation.</param>\n    /// <param name=\"animated\">If <c>true</c>, the navigation will be animated.</param>\n    /// <returns></returns>\n    protected virtual async Task ProcessNavigation(Page currentPage, Queue<string> segments, INavigationParameters parameters, bool? useModalNavigation, bool? animated)\n    {\n        if (segments.Count == 0)\n        {\n            return;\n        }\n\n        var nextSegment = segments.Dequeue();\n\n        var pageParameters = UriParsingHelper.GetSegmentParameters(nextSegment, parameters);\n\n        if (pageParameters.TryGetValue<bool>(KnownNavigationParameters.UseModalNavigation, out var parameterModal))\n            useModalNavigation = parameterModal;\n\n        bool? pageAnimation = animated;\n        if (animated is null && pageParameters.TryGetValue<bool>(KnownNavigationParameters.Animated, out var parameterAnimation))\n        {\n            pageAnimation = parameterAnimation;\n        }\n\n        if (nextSegment == RemovePageSegment)\n        {\n            await ProcessNavigationForRemovePageSegments(currentPage, nextSegment, segments, parameters, useModalNavigation, pageAnimation);\n            return;\n        }\n\n        if (currentPage is null)\n        {\n            await ProcessNavigationForRootPage(nextSegment, segments, parameters, useModalNavigation, pageAnimation);\n            return;\n        }\n\n        if (currentPage is ContentPage)\n        {\n            await ProcessNavigationForContentPage(currentPage, nextSegment, segments, parameters, useModalNavigation, pageAnimation);\n        }\n        else if (currentPage is NavigationPage nav)\n        {\n            await ProcessNavigationForNavigationPage(nav, nextSegment, segments, parameters, useModalNavigation, pageAnimation);\n        }\n        else if (currentPage is TabbedPage tabbed)\n        {\n            await ProcessNavigationForTabbedPage(tabbed, nextSegment, segments, parameters, useModalNavigation, pageAnimation);\n        }\n        else if (currentPage is FlyoutPage flyout)\n        {\n            await ProcessNavigationForFlyoutPage(flyout, nextSegment, segments, parameters, useModalNavigation, pageAnimation);\n        }\n    }\n\n    protected virtual Task ProcessNavigationForRemovePageSegments(Page currentPage, string nextSegment, Queue<string> segments, INavigationParameters parameters, bool? useModalNavigation, bool? animated)\n    {\n        if (!MvvmHelpers.HasDirectNavigationPageParent(currentPage))\n        {\n            throw new NavigationException(NavigationException.RelativeNavigationRequiresNavigationPage, currentPage);\n        }\n\n        return CanRemoveAndPush(segments)\n            ? RemoveAndPush(currentPage, nextSegment, segments, parameters, useModalNavigation, animated)\n            : RemoveAndGoBack(currentPage, nextSegment, segments, parameters, useModalNavigation, animated);\n    }\n\n    private static bool CanRemoveAndPush(Queue<string> segments)\n    {\n        return !segments.All(x => x == RemovePageSegment);\n    }\n\n    private Task RemoveAndGoBack(Page currentPage, string nextSegment, Queue<string> segments, INavigationParameters parameters, bool? useModalNavigation, bool? animated)\n    {\n        var pagesToRemove = new List<Page>();\n\n        var currentPageIndex = currentPage.Navigation.NavigationStack.Count;\n        if (currentPage.Navigation.NavigationStack.Count > 0)\n        {\n            currentPageIndex = currentPage.Navigation.NavigationStack.Count - 1;\n        }\n\n        while (segments.Count != 0)\n        {\n            currentPageIndex -= 1;\n            pagesToRemove.Add(currentPage.Navigation.NavigationStack[currentPageIndex]);\n            nextSegment = segments.Dequeue();\n        }\n\n        RemovePagesFromNavigationPage(currentPage, pagesToRemove);\n\n        return GoBackInternalAsync(parameters);\n    }\n\n    private async Task RemoveAndPush(Page currentPage, string nextSegment, Queue<string> segments, INavigationParameters parameters, bool? useModalNavigation, bool? animated)\n    {\n        var pagesToRemove = new List<Page>\n        {\n            currentPage\n        };\n\n        var currentPageIndex = currentPage.Navigation.NavigationStack.Count;\n        if (currentPage.Navigation.NavigationStack.Count > 0)\n        {\n            currentPageIndex = currentPage.Navigation.NavigationStack.Count - 1;\n        }\n\n        while (segments.Peek() == RemovePageSegment)\n        {\n            currentPageIndex -= 1;\n            pagesToRemove.Add(currentPage.Navigation.NavigationStack[currentPageIndex]);\n            nextSegment = segments.Dequeue();\n        }\n\n        await ProcessNavigation(currentPage, segments, parameters, useModalNavigation, animated);\n\n        RemovePagesFromNavigationPage(currentPage, pagesToRemove);\n    }\n\n    private static void RemovePagesFromNavigationPage(Page currentPage, List<Page> pagesToRemove)\n    {\n        var navigationPage = (NavigationPage)currentPage.Parent;\n        foreach (var page in pagesToRemove)\n        {\n            navigationPage.Navigation.RemovePage(page);\n            MvvmHelpers.DestroyPage(page);\n        }\n    }\n\n    protected virtual Task ProcessNavigationForAbsoluteUri(Queue<string> segments, INavigationParameters parameters, bool? useModalNavigation, bool? animated)\n    {\n        return ProcessNavigation(null, segments, parameters, useModalNavigation, animated);\n    }\n\n    protected virtual async Task ProcessNavigationForRootPage(string nextSegment, Queue<string> segments, INavigationParameters parameters, bool? useModalNavigation, bool? animated)\n    {\n        var nextPage = CreatePageFromSegment(nextSegment);\n        if (nextPage is TabbedPage tabbedPage)\n            await ConfigureTabbedPage(tabbedPage, nextSegment, parameters);\n\n        await ProcessNavigation(nextPage, segments, parameters, useModalNavigation, animated);\n\n        var currentPage = GetPageFromWindow();\n        var modalStack = currentPage?.Navigation.ModalStack.ToList();\n        await DoNavigateAction(GetCurrentPage(), nextSegment, nextPage, parameters, async () =>\n        {\n            await DoPush(null, nextPage, useModalNavigation, animated);\n        });\n        if (currentPage != null)\n        {\n            MvvmHelpers.DestroyWithModalStack(currentPage, modalStack);\n        }\n    }\n\n    protected virtual async Task ProcessNavigationForContentPage(Page currentPage, string nextSegment, Queue<string> segments, INavigationParameters parameters, bool? useModalNavigation, bool? animated)\n    {\n        var nextPageType = Registry.GetViewType(UriParsingHelper.GetSegmentName(nextSegment));\n        bool useReverse = UseReverseNavigation(currentPage, nextPageType) && !(useModalNavigation.HasValue && useModalNavigation.Value);\n        if (!useReverse)\n        {\n            var nextPage = CreatePageFromSegment(nextSegment);\n            if (nextPage is TabbedPage tabbedPage)\n                await ConfigureTabbedPage(tabbedPage, nextSegment, parameters);\n\n            await ProcessNavigation(nextPage, segments, parameters, useModalNavigation, animated);\n\n            await DoNavigateAction(currentPage, nextSegment, nextPage, parameters, async () =>\n            {\n                await DoPush(currentPage, nextPage, useModalNavigation, animated);\n            });\n        }\n        else\n        {\n            await UseReverseNavigation(currentPage, nextSegment, segments, parameters, useModalNavigation, animated);\n        }\n    }\n\n    protected virtual async Task ProcessNavigationForNavigationPage(NavigationPage currentPage, string nextSegment, Queue<string> segments, INavigationParameters parameters, bool? useModalNavigation, bool? animated)\n    {\n        if (currentPage.Navigation.NavigationStack.Count == 0)\n        {\n            await UseReverseNavigation(currentPage, nextSegment, segments, parameters, false, animated);\n            return;\n        }\n\n        var clearNavigationStack = GetClearNavigationPageNavigationStack(currentPage);\n        var isEmptyOfNavigationStack = currentPage.Navigation.NavigationStack.Count == 0;\n\n        List<Page> destroyPages;\n        if (clearNavigationStack && !isEmptyOfNavigationStack)\n        {\n            destroyPages = currentPage.Navigation.NavigationStack.ToList();\n            destroyPages.Reverse();\n\n            await currentPage.Navigation.PopToRootAsync(false);\n        }\n        else\n        {\n            destroyPages = new List<Page>();\n        }\n\n        var topPage = currentPage.Navigation.NavigationStack.LastOrDefault();\n        var nextPageType = Registry.GetViewType(UriParsingHelper.GetSegmentName(nextSegment));\n        if (topPage?.GetType() == nextPageType)\n        {\n            if (clearNavigationStack)\n                destroyPages.Remove(destroyPages.Last());\n\n            if (segments.Count > 0)\n                await UseReverseNavigation(topPage, segments.Dequeue(), segments, parameters, false, animated);\n\n            await DoNavigateAction(topPage, nextSegment, topPage, parameters, onNavigationActionCompleted: (p) =>\n            {\n                if (nextSegment.Contains(KnownNavigationParameters.SelectedTab))\n                {\n                    var segmentParams = UriParsingHelper.GetSegmentParameters(nextSegment, parameters);\n                    SelectPageTab(topPage, segmentParams);\n                }\n            });\n        }\n        else\n        {\n            await UseReverseNavigation(currentPage, nextSegment, segments, parameters, false, animated);\n\n            if (clearNavigationStack && !isEmptyOfNavigationStack)\n            {\n                currentPage.Navigation.RemovePage(topPage);\n            }\n        }\n\n        foreach (var destroyPage in destroyPages)\n        {\n            MvvmHelpers.DestroyPage(destroyPage);\n        }\n    }\n\n    protected virtual async Task ProcessNavigationForTabbedPage(TabbedPage currentPage, string nextSegment, Queue<string> segments, INavigationParameters parameters, bool? useModalNavigation, bool? animated)\n    {\n        var nextPage = CreatePageFromSegment(nextSegment);\n        if (nextPage is TabbedPage tabbedPage)\n            await ConfigureTabbedPage(tabbedPage, nextSegment, parameters);\n        await ProcessNavigation(nextPage, segments, parameters, useModalNavigation, animated);\n        await DoNavigateAction(currentPage, nextSegment, nextPage, parameters, async () =>\n        {\n            await DoPush(currentPage, nextPage, useModalNavigation, animated);\n        });\n    }\n\n    protected virtual async Task ProcessNavigationForFlyoutPage(FlyoutPage currentPage, string nextSegment, Queue<string> segments, INavigationParameters parameters, bool? useModalNavigation, bool? animated)\n    {\n        bool isPresented = GetFlyoutPageIsPresented(currentPage);\n\n        var detail = currentPage.Detail;\n        if (detail is null)\n        {\n            var newDetail = CreatePageFromSegment(nextSegment);\n            if (newDetail is TabbedPage tabbedPage)\n                await ConfigureTabbedPage(tabbedPage, nextSegment, parameters);\n            await ProcessNavigation(newDetail, segments, parameters, useModalNavigation, animated);\n            await DoNavigateAction(null, nextSegment, newDetail, parameters, onNavigationActionCompleted: (p) =>\n            {\n                currentPage.IsPresented = isPresented;\n                currentPage.Detail = newDetail;\n            });\n            return;\n        }\n\n        if (useModalNavigation.HasValue && useModalNavigation.Value)\n        {\n            var nextPage = CreatePageFromSegment(nextSegment);\n            if (nextPage is TabbedPage tabbedPage)\n                await ConfigureTabbedPage(tabbedPage, nextSegment, parameters);\n            await ProcessNavigation(nextPage, segments, parameters, useModalNavigation, animated);\n            await DoNavigateAction(currentPage, nextSegment, nextPage, parameters, async () =>\n            {\n                currentPage.IsPresented = isPresented;\n                await DoPush(currentPage, nextPage, true, animated);\n            });\n            return;\n        }\n\n        var nextSegmentType = Registry.GetViewType(UriParsingHelper.GetSegmentName(nextSegment));\n\n        //we must recreate the NavigationPage every time or the transitions on iOS will not work properly, unless we meet the two scenarios below\n        bool detailIsNavPage = false;\n        bool reuseNavPage = false;\n        if (detail is NavigationPage navPage)\n        {\n            detailIsNavPage = true;\n\n            //we only care if we the next segment is also a NavigationPage.\n            if (MvvmHelpers.IsSameOrSubclassOf<NavigationPage>(nextSegmentType))\n            {\n                //first we check to see if we are being forced to reuse the NavPage by checking the interface\n                reuseNavPage = !GetClearNavigationPageNavigationStack(navPage);\n\n                if (!reuseNavPage)\n                {\n                    //if we weren't forced to reuse the NavPage, then let's check the NavPage.CurrentPage against the next segment type as we don't want to recreate the entire nav stack\n                    //just in case the user is trying to navigate to the same page which may be nested in a NavPage\n                    var nextPageType = Registry.GetViewType(UriParsingHelper.GetSegmentName(segments.Peek()));\n                    var currentPageType = navPage.CurrentPage.GetType();\n                    if (nextPageType == currentPageType)\n                    {\n                        reuseNavPage = true;\n                    }\n                }\n            }\n        }\n\n        if ((detailIsNavPage && reuseNavPage) || (!detailIsNavPage && detail.GetType() == nextSegmentType))\n        {\n            await ProcessNavigation(detail, segments, parameters, useModalNavigation, animated);\n            await DoNavigateAction(null, nextSegment, detail, parameters, onNavigationActionCompleted: (p) =>\n            {\n                if (detail is TabbedPage && nextSegment.Contains(KnownNavigationParameters.SelectedTab))\n                {\n                    var segmentParams = UriParsingHelper.GetSegmentParameters(nextSegment, parameters);\n                    SelectPageTab(detail, segmentParams);\n                }\n\n                currentPage.IsPresented = isPresented;\n            });\n            return;\n        }\n        else\n        {\n            var newDetail = CreatePageFromSegment(nextSegment);\n            if (newDetail is TabbedPage tabbedPage)\n                await ConfigureTabbedPage(tabbedPage, nextSegment, parameters);\n            await ProcessNavigation(newDetail, segments, parameters, newDetail is NavigationPage ? false : true, animated);\n            await DoNavigateAction(detail, nextSegment, newDetail, parameters, onNavigationActionCompleted: (p) =>\n            {\n                if (detailIsNavPage)\n                    OnNavigatedFrom(((NavigationPage)detail).CurrentPage, p);\n\n                currentPage.IsPresented = isPresented;\n                currentPage.Detail = newDetail;\n                MvvmHelpers.DestroyPage(detail);\n            });\n            return;\n        }\n    }\n\n    protected static bool GetFlyoutPageIsPresented(FlyoutPage page)\n    {\n        if (page is IFlyoutPageOptions flyoutPageOptions)\n            return flyoutPageOptions.IsPresentedAfterNavigation;\n\n        else if (page.BindingContext is IFlyoutPageOptions flyoutPageBindingContext)\n            return flyoutPageBindingContext.IsPresentedAfterNavigation;\n\n        return false;\n    }\n\n    protected static bool GetClearNavigationPageNavigationStack(NavigationPage page)\n    {\n        if (page is INavigationPageOptions iNavigationPage)\n            return iNavigationPage.ClearNavigationStackOnNavigation;\n\n        else if (page.BindingContext is INavigationPageOptions iNavigationPageBindingContext)\n            return iNavigationPageBindingContext.ClearNavigationStackOnNavigation;\n\n        return true;\n    }\n\n    protected static async Task DoNavigateAction(Page fromPage, string toSegment, Page toPage, INavigationParameters parameters, Func<Task> navigationAction = null, Action<INavigationParameters> onNavigationActionCompleted = null)\n    {\n        var segmentParameters = UriParsingHelper.GetSegmentParameters(toSegment, parameters);\n        segmentParameters.GetNavigationParametersInternal().Add(KnownInternalParameters.NavigationMode, NavigationMode.New);\n\n        var canNavigate = await MvvmHelpers.CanNavigateAsync(fromPage, segmentParameters);\n        if (!canNavigate)\n        {\n            throw new NavigationException(NavigationException.IConfirmNavigationReturnedFalse, toPage);\n        }\n\n        await OnInitializedAsync(toPage, segmentParameters);\n\n        if (navigationAction != null)\n        {\n            await navigationAction();\n        }\n\n        OnNavigatedFrom(fromPage, segmentParameters);\n\n        onNavigationActionCompleted?.Invoke(segmentParameters);\n\n        OnNavigatedTo(toPage, segmentParameters);\n    }\n\n    static async Task OnInitializedAsync(Page toPage, INavigationParameters parameters)\n    {\n        await MvvmHelpers.OnInitializedAsync(toPage, parameters);\n\n        if (toPage is TabbedPage tabbedPage)\n        {\n            foreach (var child in tabbedPage.Children)\n            {\n                if (child is NavigationPage navigationPage)\n                {\n                    await MvvmHelpers.OnInitializedAsync(navigationPage.CurrentPage, parameters);\n                }\n                else\n                {\n                    await MvvmHelpers.OnInitializedAsync(child, parameters);\n                }\n            }\n        }\n    }\n\n    private static void OnNavigatedTo(Page toPage, INavigationParameters parameters)\n    {\n        MvvmHelpers.OnNavigatedTo(toPage, parameters);\n\n        if (toPage is TabbedPage tabbedPage)\n        {\n            if (tabbedPage.CurrentPage is NavigationPage navigationPage)\n            {\n                MvvmHelpers.OnNavigatedTo(navigationPage.CurrentPage, parameters);\n            }\n            else if (tabbedPage.BindingContext != tabbedPage.CurrentPage?.BindingContext)\n            {\n                MvvmHelpers.OnNavigatedTo(tabbedPage.CurrentPage, parameters);\n            }\n        }\n    }\n\n    private static void OnNavigatedFrom(Page fromPage, INavigationParameters parameters)\n    {\n        MvvmHelpers.OnNavigatedFrom(fromPage, parameters);\n\n        if (fromPage is TabbedPage tabbedPage)\n        {\n            if (tabbedPage.CurrentPage is NavigationPage navigationPage)\n            {\n                MvvmHelpers.OnNavigatedFrom(navigationPage.CurrentPage, parameters);\n            }\n            else if (tabbedPage.BindingContext != tabbedPage.CurrentPage.BindingContext)\n            {\n                MvvmHelpers.OnNavigatedFrom(tabbedPage.CurrentPage, parameters);\n            }\n        }\n    }\n\n    protected virtual Page CreatePage(string segmentName)\n    {\n        try\n        {\n            var scope = _container.CreateScope();\n            var page = (Page)Registry.CreateView(scope, segmentName);\n\n            if (page is null)\n                throw new NullReferenceException($\"The resolved type for {segmentName} was null. You may be attempting to navigate to a Non-Page type\");\n\n            return page;\n        }\n        catch(NavigationException)\n        {\n            throw;\n        }\n        catch(KeyNotFoundException knfe)\n        {\n            throw new NavigationException(NavigationException.NoPageIsRegistered, segmentName, knfe);\n        }\n        catch(ViewModelCreationException vmce)\n        {\n            throw new NavigationException(NavigationException.ErrorCreatingViewModel, segmentName, _pageAccessor.Page, vmce);\n        }\n        //catch(ViewCreationException viewCreationException)\n        //{\n        //    if(!string.IsNullOrEmpty(viewCreationException.InnerException?.Message) && viewCreationException.InnerException.Message.Contains(\"Maui\"))\n        //        throw new NavigationException(NavigationException.)\n        //}\n        catch (Exception ex)\n        {\n            var inner = ex.InnerException;\n            while(inner is not null)\n            {\n                if (inner.Message.Contains(\"thread with a dispatcher\"))\n                    throw new NavigationException(NavigationException.UnsupportedMauiCreation, segmentName, _pageAccessor.Page, ex);\n                inner = inner.InnerException;\n            }\n            throw new NavigationException(NavigationException.ErrorCreatingPage, segmentName, ex);\n        }\n    }\n\n    protected virtual Page CreatePageFromSegment(string segment)\n    {\n        string segmentName = UriParsingHelper.GetSegmentName(segment);\n        var page = CreatePage(segmentName);\n        if (page is null)\n        {\n            var innerException = new NullReferenceException(string.Format(\"{0} could not be created. Please make sure you have registered {0} for navigation.\", segmentName));\n            throw new NavigationException(NavigationException.NoPageIsRegistered, segmentName, _pageAccessor.Page, innerException);\n        }\n\n        return page;\n    }\n\n    async Task ConfigureTabbedPage(TabbedPage tabbedPage, string segment, INavigationParameters parameters)\n    {\n        var tabParameters = UriParsingHelper.GetSegmentParameters(segment, parameters);\n\n        if (tabParameters.GetValue<string>(KnownNavigationParameters.Title) is string title)\n        {\n            tabbedPage.Title = title;\n        }\n        var tabsToCreate = tabParameters.GetValues<string>(KnownNavigationParameters.CreateTab);\n        foreach (var tabToCreateEncoded in tabsToCreate ?? Array.Empty<string>())\n        {\n            //created tab can be a single view or a view nested in a NavigationPage with the syntax \"NavigationPage|ViewToCreate\"\n            var tabToCreate = HttpUtility.UrlDecode(tabToCreateEncoded);\n            var tabSegments = tabToCreate.Split('/', '|');\n            NavigationPage navigationPage = null;\n            for(int i = 0; i < tabSegments.Length; i++)\n            {\n                var tabSegment = tabSegments[i];\n                var child = CreatePageFromSegment(tabSegment);\n                var childParameters = UriParsingHelper.GetSegmentParameters(tabSegment, parameters);\n                if (i == 0 && child is NavigationPage navPage)\n                {\n                    navigationPage = navPage;\n                    await MvvmHelpers.OnInitializedAsync(child, childParameters);\n                }\n                else if(i == 0)\n                {\n                    tabbedPage.Children.Add(child);\n                    break;\n                }\n                else if(i > 0 && navigationPage is not null)\n                {\n                    await navigationPage.Navigation.PushAsync(child);\n                }\n            }\n\n            if(navigationPage is null)\n            {\n                continue;\n            }\n\n            tabbedPage.Children.Add(navigationPage);\n            if (navigationPage.RootPage.IsSet(XamlTab.TitleProperty))\n            {\n                navigationPage.Title = XamlTab.GetTitle(navigationPage.RootPage);\n                navigationPage.IconImageSource = XamlTab.GetIconImageSource(navigationPage.RootPage);\n            }\n            else if(!navigationPage.IsSet(Page.TitleProperty))\n            {\n                var source = navigationPage.IsSet(XamlTab.TitleBindingSourceProperty) ?\n                XamlTab.GetTitleBindingSource(navigationPage) :\n                navigationPage.RootPage.IsSet(XamlTab.TitleBindingSourceProperty) ?\n                XamlTab.GetTitleBindingSource(navigationPage.RootPage) :\n                Xaml.TabBindingSource.RootPage;\n\n                //set the title because Xamarin doesn't do this for us.\n                if (!navigationPage.IsSet(Page.TitleProperty))\n                    navigationPage.SetBinding(Page.TitleProperty, new Binding($\"{source}.Title\", BindingMode.OneWay, source: navigationPage));\n                if (!navigationPage.IsSet(Page.IconImageSourceProperty))\n                    navigationPage.SetBinding(Page.IconImageSourceProperty, new Binding($\"{source}.IconImageSource\", BindingMode.OneWay, source: navigationPage));\n            }\n        }\n\n        TabbedPageSelectTab(tabbedPage, tabParameters);\n    }\n\n    private void SelectPageTab(Page page, INavigationParameters parameters)\n    {\n        if (page is TabbedPage tabbedPage)\n        {\n            TabbedPageSelectTab(tabbedPage, parameters);\n        }\n    }\n\n    private void TabbedPageSelectTab(TabbedPage tabbedPage, INavigationParameters parameters)\n    {\n        if (!parameters.TryGetValue<string>(KnownNavigationParameters.SelectedTab, out var selectedTab)\n            || string.IsNullOrEmpty(selectedTab))\n            return;\n\n        var segments = selectedTab.Split('|').Where(x => !string.IsNullOrEmpty(x));\n        if (segments.Count() == 1)\n            TabbedPageSelectRootTab(tabbedPage, selectedTab);\n        else if (segments.Count() > 1)\n            TabbedPageSelectNavigationChildTab(tabbedPage, segments.First(), segments.Last());\n    }\n\n    private void TabbedPageSelectRootTab(TabbedPage tabbedPage, string selectedTab)\n    {\n        var registry = Registry;\n        var selectRegistration = registry.Registrations.FirstOrDefault(x => x.Name == selectedTab);\n        Page child = null;\n        if (selectRegistration is null)\n        {\n            child = tabbedPage.Children.FirstOrDefault(x => x.GetType().Name == selectedTab) ??\n                throw new KeyNotFoundException($\"No Registration found to select tab '{selectedTab}'.\");\n        }\n        else\n        {\n            child = tabbedPage.Children.FirstOrDefault(x => IsPage(x, selectRegistration, selectedTab)) ??\n                throw new KeyNotFoundException($\"No Child Page was found with the key '{selectedTab}'.\");\n        }\n\n        tabbedPage.CurrentPage = child;\n    }\n\n    private void TabbedPageSelectNavigationChildTab(TabbedPage tabbedPage, string rootTab, string selectedTab)\n    {\n        var registry = Registry;\n        var rootRegistration = registry.Registrations.FirstOrDefault(x => x.Name == rootTab);\n        var selectRegistration = registry.Registrations.FirstOrDefault(x => x.Name == selectedTab);\n\n        var candidates = tabbedPage.Children\n            .OfType<NavigationPage>()\n            .Where(x => IsPage(x, rootRegistration, rootTab));\n        var child = candidates.SingleOrDefault(x => IsPage(x.RootPage, selectRegistration, selectedTab)) ??\n            candidates.SingleOrDefault(x => IsPage(x.CurrentPage, selectRegistration, selectedTab));\n\n        if (child is not null)\n            tabbedPage.CurrentPage = child;\n    }\n\n    // This provides a fallback if we did not find a registration for the Page\n    private static bool IsPage(Page referencePage, string name) =>\n        ViewModelLocator.GetNavigationName(referencePage) == name || referencePage.GetType().Name == name || referencePage.GetType().FullName == name;\n\n    private static bool IsPage(Page referencePage, ViewRegistration registration, string name)\n    {\n        var referenceType = referencePage.GetType();\n        if (registration is not null)\n        {\n            // We're allowing an empty string here for cases where someone has a manually constructed TabbedPage\n            var navigationName = ViewModelLocator.GetNavigationName(referencePage);\n            if (registration.View == referenceType && (string.IsNullOrEmpty(navigationName) || navigationName == name))\n                return true;\n\n            // This is an override for cases where someone may have a NavigationPage\n            return name == nameof(NavigationPage) && referenceType == typeof(NavigationPage);\n        }\n\n        return IsPage(referencePage, name);\n    }\n\n    protected virtual async Task UseReverseNavigation(Page currentPage, string nextSegment, Queue<string> segments, INavigationParameters parameters, bool? useModalNavigation, bool? animated)\n    {\n        var navigationStack = new Stack<string>();\n\n        if (!string.IsNullOrWhiteSpace(nextSegment))\n            navigationStack.Push(nextSegment);\n\n        var illegalSegments = new Queue<string>();\n\n        bool illegalPageFound = false;\n        foreach (var item in segments)\n        {\n            //if we run into an illegal page, we need to create new navigation segments to properly handle the deep link\n            if (illegalPageFound)\n            {\n                illegalSegments.Enqueue(item);\n                continue;\n            }\n\n            //if any page decide to go modal, we need to consider it and all pages after it an illegal page\n            var pageParameters = UriParsingHelper.GetSegmentParameters(item, parameters);\n            if (pageParameters.ContainsKey(KnownNavigationParameters.UseModalNavigation))\n            {\n                if (pageParameters.GetValue<bool>(KnownNavigationParameters.UseModalNavigation))\n                {\n                    illegalSegments.Enqueue(item);\n                    illegalPageFound = true;\n                }\n                else\n                {\n                    navigationStack.Push(item);\n                }\n            }\n            else\n            {\n                var pageType = Registry.GetViewType(UriParsingHelper.GetSegmentName(item));\n                if (MvvmHelpers.IsSameOrSubclassOf<FlyoutPage>(pageType))\n                {\n                    illegalSegments.Enqueue(item);\n                    illegalPageFound = true;\n                }\n                else\n                {\n                    navigationStack.Push(item);\n                }\n            }\n        }\n\n        var pageOffset = currentPage.Navigation.NavigationStack.Count;\n        // NOTE: Disabled due to Issue 2232\n        //if (currentPage.Navigation.NavigationStack.Count > 2)\n        //    pageOffset = currentPage.Navigation.NavigationStack.Count - 1;\n\n        var onNavigatedFromTarget = currentPage;\n        if (currentPage is NavigationPage navPage && navPage.CurrentPage != null)\n            onNavigatedFromTarget = navPage.CurrentPage;\n\n        bool insertBefore = false;\n        while (navigationStack.Count > 0)\n        {\n            var segment = navigationStack.Pop();\n            var nextPage = CreatePageFromSegment(segment);\n            if (nextPage is TabbedPage tabbedPage)\n                await ConfigureTabbedPage(tabbedPage, nextSegment, parameters);\n            await DoNavigateAction(onNavigatedFromTarget, segment, nextPage, parameters, async () =>\n            {\n                await DoPush(currentPage, nextPage, useModalNavigation, animated, insertBefore, pageOffset);\n            });\n            insertBefore = true;\n        }\n\n        //if an illegal page is found, we force a Modal navigation\n        if (illegalSegments.Count > 0)\n            await ProcessNavigation(currentPage.Navigation.NavigationStack.Last(), illegalSegments, parameters, true, animated);\n    }\n\n    protected virtual async Task DoPush(Page currentPage, Page page, bool? useModalNavigation, bool? animated, bool insertBeforeLast = false, int navigationOffset = 0)\n    {\n        ArgumentNullException.ThrowIfNull(page);\n\n        try\n        {\n            // Prevent Page from using Parent's ViewModel\n            page.BindingContext ??= new object();\n\n            if (currentPage is null)\n            {\n                if (_windowManager.Windows.OfType<PrismWindow>().Any(x => x.Name == PrismWindow.DefaultWindowName))\n                    _window = _windowManager.Windows.OfType<PrismWindow>().First(x => x.Name == PrismWindow.DefaultWindowName);\n\n                if (Window is null)\n                {\n                    _window = new PrismWindow\n                    {\n                        Page = page\n                    };\n\n                    _windowManager.OpenWindow(_window);\n                }\n                else\n                {\n                    Window.Page = page;\n                }\n            }\n            else\n            {\n                bool useModalForPush = UseModalNavigation(currentPage, useModalNavigation);\n\n                if (useModalForPush)\n                {\n                    await currentPage.Navigation.PushModalAsync(page, animated ?? true);\n                }\n                else\n                {\n                    if (insertBeforeLast)\n                    {\n                        await InsertPageBefore(currentPage, page, navigationOffset);\n                    }\n                    else\n                    {\n                        await currentPage.Navigation.PushAsync(page, animated ?? true);\n                    }\n                }\n            }\n        }\n        catch (Exception ex)\n        {\n            throw new NavigationException(NavigationException.UnsupportedMauiNavigation, _pageAccessor.Page, ex);\n        }\n    }\n\n    protected virtual Task InsertPageBefore(Page currentPage, Page page, int pageOffset)\n    {\n        var firstPage = currentPage.Navigation.NavigationStack.Skip(pageOffset).FirstOrDefault();\n        currentPage.Navigation.InsertPageBefore(page, firstPage);\n        return Task.FromResult(true);\n    }\n\n    protected virtual Task<Page> DoPop(INavigation navigation, bool useModalNavigation, bool animated)\n    {\n        if (useModalNavigation)\n            return navigation.PopModalAsync(animated);\n        else\n            return navigation.PopAsync(animated);\n    }\n\n    protected virtual Page GetCurrentPage()\n    {\n        return _pageAccessor.Page is not null ? _pageAccessor.Page : GetPageFromWindow();\n    }\n\n    internal static bool UseModalNavigation(Page currentPage, bool? useModalNavigationDefault)\n    {\n        bool useModalNavigation;\n        if (useModalNavigationDefault.HasValue)\n            useModalNavigation = useModalNavigationDefault.Value;\n        else if (currentPage is NavigationPage)\n            useModalNavigation = false;\n        else\n            useModalNavigation = !MvvmHelpers.HasNavigationPageParent(currentPage);\n\n        return useModalNavigation;\n    }\n\n    internal bool UseModalGoBack(Page currentPage, INavigationParameters parameters)\n    {\n        if (parameters.ContainsKey(KnownNavigationParameters.UseModalNavigation))\n            return parameters.GetValue<bool>(KnownNavigationParameters.UseModalNavigation);\n        else if (currentPage is NavigationPage navPage)\n            return GoBackModal(navPage);\n        else if (MvvmHelpers.HasNavigationPageParent(currentPage, out var navParent))\n            return GoBackModal(navParent);\n        else\n            return true;\n    }\n\n    private bool GoBackModal(NavigationPage navPage)\n    {\n        var rootPage = GetPageFromWindow();\n        if (navPage.CurrentPage != navPage.RootPage)\n            return false;\n        else if (navPage.CurrentPage == navPage.RootPage && navPage.Parent is Application && rootPage != navPage)\n            return true;\n        else if (navPage.Parent is TabbedPage tabbed && tabbed != rootPage)\n            return true;\n        else if (rootPage != navPage || IsRoot(rootPage, navPage.CurrentPage))\n            return true;\n\n        return false;\n    }\n\n    internal static bool UseReverseNavigation(Page currentPage, Type nextPageType)\n    {\n        return MvvmHelpers.HasNavigationPageParent(currentPage) && MvvmHelpers.IsSameOrSubclassOf<ContentPage>(nextPageType);\n    }\n\n    private INavigationResult SendAppToBackground(Page page)\n    {\n#if ANDROID\n        if (Window.Handler.PlatformView is MauiAppCompatActivity activity)\n        {\n            activity.MoveTaskToBack(true);\n            return new NavigationResult();\n        }\n#endif\n        throw new NavigationException(NavigationException.CannotPopApplicationMainPage, page);\n    }\n\n    private INavigationResult Notify(NavigationRequestType type, INavigationParameters parameters, Exception exception = null)\n    {\n        var result = new NavigationResult(exception);\n        _eventAggregator.GetEvent<NavigationRequestEvent>().Publish(new NavigationRequestContext\n        {\n            Parameters = parameters,\n            Result = result,\n            Type = type,\n        });\n\n        return result;\n    }\n\n    private INavigationResult Notify(Uri uri, INavigationParameters parameters, Exception exception = null)\n    {\n        var result = new NavigationResult(exception);\n\n        var temp = Regex.Replace(uri.ToString(), RemovePageInstruction, RemovePageRelativePath);\n\n        _eventAggregator.GetEvent<NavigationRequestEvent>().Publish(new NavigationRequestContext\n        {\n            Parameters = parameters,\n            Result = result,\n            Type = NavigationRequestType.Navigate,\n            Uri = new Uri(temp, UriKind.RelativeOrAbsolute),\n        });\n\n        return result;\n    }\n\n    protected static bool IsRoot(Page mainPage, Page currentPage)\n    {\n        if (mainPage == currentPage)\n            return true;\n\n        return mainPage switch\n        {\n            FlyoutPage fp => IsRoot(fp.Detail, currentPage),\n            TabbedPage tp => IsRoot(tp.CurrentPage, currentPage),\n            NavigationPage np => IsRoot(np.RootPage, currentPage),\n            _ => false\n        };\n    }\n\n    private Page GetPageFromWindow()\n    {\n        try\n        {\n            return Window?.Page;\n        }\n#if DEBUG\n        catch (Exception ex)\n        {\n            Console.Error.WriteLine(ex);\n            return null;\n        }\n#else\n        catch\n        {\n            return null;\n        }\n#endif\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/PageNavigationSource.cs",
    "content": "﻿namespace Prism.Navigation;\n\npublic enum PageNavigationSource\n{\n    NavigationService,\n    Device,\n    DialogService\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/PrismWindow.cs",
    "content": "using System.ComponentModel;\nusing Prism.AppModel;\nusing Prism.Common;\nusing Prism.Dialogs;\nusing Prism.Ioc;\nusing Prism.Navigation.Xaml;\nusing TabbedPage = Microsoft.Maui.Controls.TabbedPage;\n\nnamespace Prism.Navigation\n{\n    /// <summary>\n    /// Represents a window used for Prism navigation in a Maui application.\n    /// </summary>\n    [EditorBrowsable(EditorBrowsableState.Never)]\n    public class PrismWindow : Window\n    {\n        /// <summary>\n        /// The default name for the Prism window.\n        /// </summary>\n        public const string DefaultWindowName = \"__PrismRootWindow\";\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"PrismWindow\"/> class with the specified name.\n        /// </summary>\n        /// <param name=\"name\">The name of the window.</param>\n        public PrismWindow(string name = DefaultWindowName)\n        {\n            Name = name;\n            ModalPopping += PrismWindow_ModalPopping;\n        }\n\n        /// <summary>\n        /// Gets the name of the window.\n        /// </summary>\n        public string Name { get; }\n\n        /// <summary>\n        /// Gets or sets a value indicating whether the window is active.\n        /// </summary>\n        public bool IsActive { get; internal set; }\n\n        /// <summary>\n        /// Gets the current page displayed in the window.\n        /// </summary>\n        internal Page CurrentPage => Page is null ? null : MvvmHelpers.GetCurrentPage(Page);\n\n        /// <summary>\n        /// Gets a value indicating whether the current page is the root page.\n        /// </summary>\n        internal bool IsRootPage => GetRootPage(Page) == CurrentPage;\n\n        private Page GetRootPage(Page page) =>\n            page switch\n            {\n                TabbedPage tabbed => GetRootPage(tabbed.CurrentPage),\n                NavigationPage nav => GetRootPage(nav.RootPage),\n                FlyoutPage flyout => GetRootPage(flyout.Detail),\n                _ => page\n            };\n\n        internal bool IsRoot(Page page)\n        {\n            if (page == Page) return true;\n\n            return page.Parent switch\n            {\n                FlyoutPage flyout => IsRoot(flyout),\n                TabbedPage tabbed => IsRoot(tabbed),\n                NavigationPage navigation => IsRoot(navigation),\n                _ => false\n            };\n        }\n\n        private async void PrismWindow_ModalPopping(object sender, ModalPoppingEventArgs e)\n        {\n            if (PageNavigationService.NavigationSource == PageNavigationSource.Device)\n            {\n                e.Cancel = true;\n                var dialogModal = IDialogContainer.DialogStack.LastOrDefault();\n                if (dialogModal is not null)\n                {\n                    if (dialogModal.Dismiss.CanExecute(null))\n                        dialogModal.Dismiss.Execute(null);\n                }\n                else\n                {\n                    var navService = Xaml.Navigation.GetNavigationService(e.Modal);\n                    await navService.GoBackAsync();\n                }\n            }\n        }\n\n        /// <summary>\n        /// Called when the window is activated.\n        /// </summary>\n        protected override void OnActivated()\n        {\n            IsActive = true;\n            MvvmHelpers.InvokeViewAndViewModelAction<IActiveAware>(CurrentPage, x => x.IsActive = true);\n        }\n\n        /// <summary>\n        /// Called when the window is deactivated.\n        /// </summary>\n        protected override void OnDeactivated()\n        {\n            IsActive = false;\n            MvvmHelpers.InvokeViewAndViewModelAction<IActiveAware>(CurrentPage, x => x.IsActive = true);\n        }\n\n        /// <summary>\n        /// Called when the window is resumed.\n        /// </summary>\n        protected override void OnResumed()\n        {\n            MvvmHelpers.InvokeViewAndViewModelAction<IApplicationLifecycleAware>(CurrentPage, x => x.OnResume());\n        }\n\n        /// <summary>\n        /// Called when the window is stopped.\n        /// </summary>\n        protected override void OnStopped()\n        {\n            MvvmHelpers.InvokeViewAndViewModelAction<IApplicationLifecycleAware>(CurrentPage, x => x.OnSleep());\n        }\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/PrismWindowManager.cs",
    "content": "using Prism.Behaviors;\nusing Prism.Extensions;\n\nnamespace Prism.Navigation;\n\ninternal sealed class PrismWindowManager : IWindowCreator, IWindowManager\n{\n    private IApplication _application { get; }\n\n    public PrismWindowManager(IApplication application)\n    {\n        _application = application;\n    }\n\n    private Window _initialWindow;\n\n    private Window _current;\n    public Window Current => _current ?? _initialWindow;\n\n    public IReadOnlyList<Window> Windows => _application.Windows.OfType<Window>().ToList();\n\n    public Window CreateWindow(Application app, IActivationState activationState)\n    {\n        if (_initialWindow is not null)\n            return _initialWindow;\n        else if (app.Windows.OfType<PrismWindow>().Any())\n            return _initialWindow = app.Windows.OfType<PrismWindow>().First();\n\n        activationState.Context.Services.GetRequiredService<PrismAppBuilder>().OnCreateWindow();\n\n        return _initialWindow ?? throw new InvalidNavigationException(\"Expected Navigation Failed. No Root Window has been created.\");\n    }\n\n    public void OpenWindow(Window window)\n    {\n        if (_initialWindow is null)\n            _initialWindow = window;\n        else\n            _application.OpenWindow(window);\n\n        foreach(var pWindow in Windows.OfType<PrismWindow>().Where(x => x.IsActive))\n        {\n            pWindow.IsActive = window.Equals(pWindow);\n        }\n    }\n\n    public void CloseWindow(Window window)\n    {\n        if (_initialWindow == window)\n            _initialWindow = null;\n\n        _application.CloseWindow(window);\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Regions/Adapters/CarouselViewRegionAdapter.cs",
    "content": "using System.Collections.Specialized;\nusing Prism.Behaviors;\nusing Prism.Common;\nusing Prism.Mvvm;\nusing Prism.Properties;\n\nnamespace Prism.Navigation.Regions.Adapters;\n\n/// <summary>\n/// Adapter that creates a new <see cref=\"SingleActiveRegion\"/> and monitors its\n/// active view to set it on the adapted <see cref=\"CarouselView\"/>.\n/// </summary>\npublic class CarouselViewRegionAdapter : RegionAdapterBase<CarouselView>\n{\n    /// <summary>\n    /// Initializes a new instance of <see cref=\"CarouselViewRegionAdapter\"/>.\n    /// </summary>\n    /// <param name=\"regionBehaviorFactory\">The factory used to create the region behaviors to attach to the created regions.</param>\n    public CarouselViewRegionAdapter(IRegionBehaviorFactory regionBehaviorFactory)\n        : base(regionBehaviorFactory)\n    {\n    }\n\n    /// <summary>\n    /// Adapts a <see cref=\"CarouselView\"/> to an <see cref=\"IRegion\"/>.\n    /// </summary>\n    /// <param name=\"region\">The new region being used.</param>\n    /// <param name=\"regionTarget\">The object to adapt.</param>\n    protected override void Adapt(IRegion region, CarouselView regionTarget)\n    {\n        ArgumentNullException.ThrowIfNull(region);\n        ArgumentNullException.ThrowIfNull(regionTarget);\n\n        bool itemsSourceIsSet = regionTarget.ItemsSource != null || regionTarget.IsSet(ItemsView.ItemsSourceProperty);\n\n        if (itemsSourceIsSet)\n            throw new InvalidOperationException(Resources.CarouselViewHasItemsSourceException);\n\n\n        regionTarget.ItemsSource = region.Views;\n        regionTarget.ItemTemplate = new RegionItemsSourceTemplate();\n        var regionBehavior = new CarouselRegionBehavior(region);\n        regionTarget.Behaviors.Add(regionBehavior);\n\n        region.ActiveViews.CollectionChanged += delegate\n        {\n            var activeView = region.ActiveViews.OfType<VisualElement>().FirstOrDefault();\n            regionBehavior.CurrentView = activeView;\n            regionTarget.CurrentItem = activeView;\n        };\n\n        void OnFirstItemAdded(object sender, NotifyCollectionChangedEventArgs e)\n        {\n            if (e.Action == NotifyCollectionChangedAction.Add)\n            {\n                var items = e.NewItems.Cast<object>()\n                                      .Where(x => x is VisualElement)\n                                      .Cast<VisualElement>()\n                                      .ToList();\n                if (region.ActiveViews.Count() == 0)\n                {\n                    region.Activate(items[0]);\n                }\n\n                region.Views.CollectionChanged -= OnFirstItemAdded;\n            }\n        }\n\n        region.Views.CollectionChanged += OnFirstItemAdded;\n    }\n\n    /// <summary>\n    /// Creates a new instance of <see cref=\"SingleActiveRegion\"/>.\n    /// </summary>\n    /// <returns>A new instance of <see cref=\"SingleActiveRegion\"/>.</returns>\n    protected override IRegion CreateRegion(IContainerProvider container) =>\n        container.Resolve<SingleActiveRegion>();\n\n    private class CarouselRegionBehavior : BehaviorBase<CarouselView>\n    {\n        private IRegion _region { get; }\n        public VisualElement CurrentView;\n\n        public CarouselRegionBehavior(IRegion region)\n        {\n            _region = region;\n        }\n\n        protected override void OnAttachedTo(CarouselView carousel)\n        {\n            base.OnAttachedTo(carousel);\n            carousel.CurrentItemChanged += OnCurrentItemChanged;\n        }\n\n        protected override void OnDetachingFrom(CarouselView carousel)\n        {\n            base.OnDetachingFrom(carousel);\n            carousel.CurrentItemChanged -= OnCurrentItemChanged;\n        }\n\n        private void OnCurrentItemChanged(object sender, CurrentItemChangedEventArgs e)\n        {\n            if (sender is CarouselView carousel && carousel.CurrentItem != CurrentView && carousel.CurrentItem != null && carousel.CurrentItem is VisualElement newActiveView)\n            {\n                var previousView = CurrentView;\n                CurrentView = newActiveView;\n\n                if (!_region.ActiveViews.Contains(newActiveView))\n                {\n                    _region.Activate(newActiveView);\n                }\n\n                var name = newActiveView.GetValue(ViewModelLocator.NavigationNameProperty) as string;\n                if (string.IsNullOrEmpty(name))\n                {\n                    var viewType = newActiveView.GetType();\n                    var registry = _region.Container().Resolve<IRegionNavigationRegistry>();\n                    var candidate = registry.ViewsOfType(viewType)\n                        .Where(x => x.Type == ViewType.Region)\n                        .FirstOrDefault(x => x.View == viewType);\n                    if (candidate is null)\n                        name = viewType.FullName;\n                    else\n                        name = candidate.Name;\n                }\n\n                var context = new NavigationContext(_region.NavigationService, new Uri(name, UriKind.RelativeOrAbsolute));\n\n                MvvmHelpers.OnNavigatedFrom(previousView, context);\n                MvvmHelpers.OnNavigatedTo(newActiveView, context);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Regions/Adapters/CollectionViewRegionAdapter.cs",
    "content": "using Prism.Properties;\n\nnamespace Prism.Navigation.Regions.Adapters;\n\n/// <summary>\n/// Adapter that creates a new <see cref=\"Region\"/> and monitors its\n/// active view to set it on the adapted <see cref=\"CollectionView\"/>.\n/// </summary>\npublic class CollectionViewRegionAdapter : RegionAdapterBase<CollectionView>\n{\n    /// <summary>\n    /// Initializes a new instance of <see cref=\"CollectionViewRegionAdapter\"/>.\n    /// </summary>\n    /// <param name=\"regionBehaviorFactory\">The factory used to create the region behaviors to attach to the created regions.</param>\n    public CollectionViewRegionAdapter(IRegionBehaviorFactory regionBehaviorFactory)\n        : base(regionBehaviorFactory)\n    {\n    }\n\n    /// <summary>\n    /// Adapts a <see cref=\"CollectionView\"/> to an <see cref=\"IRegion\"/>.\n    /// </summary>\n    /// <param name=\"region\">The new region being used.</param>\n    /// <param name=\"regionTarget\">The object to adapt.</param>\n    protected override void Adapt(IRegion region, CollectionView regionTarget)\n    {\n        ArgumentNullException.ThrowIfNull(region);\n        ArgumentNullException.ThrowIfNull(regionTarget);\n\n        bool itemsSourceIsSet = regionTarget.ItemsSource != null || regionTarget.IsSet(ItemsView.ItemsSourceProperty);\n\n        if (itemsSourceIsSet)\n        {\n            throw new InvalidOperationException(Resources.CollectionViewHasItemsSourceException);\n        }\n\n        regionTarget.ItemsSource = region.Views;\n        regionTarget.ItemTemplate = new RegionItemsSourceTemplate();\n    }\n\n    /// <summary>\n    /// Creates a new instance of <see cref=\"IRegion\"/>.\n    /// </summary>\n    /// <returns>A new instance of <see cref=\"Region\"/>.</returns>\n    protected override IRegion CreateRegion(IContainerProvider container) =>\n        container.Resolve<Region>();\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Regions/Adapters/ContentViewRegionAdapter.cs",
    "content": "﻿namespace Prism.Navigation.Regions.Adapters;\n\n/// <summary>\n/// Adapter that creates a new <see cref=\"SingleActiveRegion\"/> and monitors its\n/// active view to set it on the adapted <see cref=\"ContentView\"/>.\n/// </summary>\npublic class ContentViewRegionAdapter : ContentViewRegionAdapter<ContentView>\n{\n    /// <summary>\n    /// Initializes a new instance of <see cref=\"ContentViewRegionAdapter\"/>.\n    /// </summary>\n    /// <param name=\"regionBehaviorFactory\">The factory used to create the region behaviors to attach to the created regions.</param>\n    public ContentViewRegionAdapter(IRegionBehaviorFactory regionBehaviorFactory)\n        : base(regionBehaviorFactory)\n    {\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Regions/Adapters/ContentViewRegionAdapter{TContentView}.cs",
    "content": "using System.Collections.Specialized;\nusing Prism.Properties;\n\nnamespace Prism.Navigation.Regions.Adapters;\n\n/// <summary>\n/// Adapter that creates a new <see cref=\"SingleActiveRegion\"/> and monitors its\n/// active view to set it on the adapted <see cref=\"ContentView\"/>.\n/// </summary>\npublic class ContentViewRegionAdapter<TContentView> : RegionAdapterBase<TContentView>\n    where TContentView : ContentView\n{\n    /// <summary>\n    /// Initializes a new instance of <see cref=\"ContentViewRegionAdapter{TContentView}\"/>.\n    /// </summary>\n    /// <param name=\"regionBehaviorFactory\">The factory used to create the region behaviors to attach to the created regions.</param>\n    public ContentViewRegionAdapter(IRegionBehaviorFactory regionBehaviorFactory)\n        : base(regionBehaviorFactory)\n    {\n    }\n\n    /// <summary>\n    /// Adapts a <see cref=\"ContentView\"/> to an <see cref=\"IRegion\"/>.\n    /// </summary>\n    /// <param name=\"region\">The new region being used.</param>\n    /// <param name=\"regionTarget\">The object to adapt.</param>\n    protected override void Adapt(IRegion region, TContentView regionTarget)\n    {\n        ArgumentNullException.ThrowIfNull(region);\n        ArgumentNullException.ThrowIfNull(regionTarget);\n\n        bool contentIsSet = regionTarget.Content != null || regionTarget.IsSet(ContentView.ContentProperty);\n\n        if (contentIsSet)\n            throw new InvalidOperationException(Resources.ContentViewHasContentException);\n\n        region.ActiveViews.CollectionChanged += delegate\n        {\n            regionTarget.Content = region.ActiveViews.FirstOrDefault() as View;\n        };\n\n        region.Views.CollectionChanged +=\n            (sender, e) =>\n            {\n                if (e.Action == NotifyCollectionChangedAction.Add && region.ActiveViews.Count() == 0)\n                {\n                    region.Activate(e.NewItems[0] as VisualElement);\n                }\n            };\n    }\n\n    /// <summary>\n    /// Creates a new instance of <see cref=\"SingleActiveRegion\"/>.\n    /// </summary>\n    /// <returns>A new instance of <see cref=\"SingleActiveRegion\"/>.</returns>\n    protected override IRegion CreateRegion(IContainerProvider container) =>\n        container.Resolve<SingleActiveRegion>();\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Regions/Adapters/LayoutRegionAdapter.cs",
    "content": "using Prism.Properties;\n\nnamespace Prism.Navigation.Regions.Adapters;\n\n/// <summary>\n/// Adapter that creates a new <see cref=\"Region\"/> and monitors its\n/// active view to set it on the adapted <see cref=\"Layout\"/>.\n/// </summary>\npublic class LayoutRegionAdapter : RegionAdapterBase<Layout>\n{\n    /// <summary>\n    /// Initializes a new instance of <see cref=\"LayoutRegionAdapter\"/>.\n    /// </summary>\n    /// <param name=\"regionBehaviorFactory\">The factory used to create the region behaviors to attach to the created regions.</param>\n    public LayoutRegionAdapter(IRegionBehaviorFactory regionBehaviorFactory)\n        : base(regionBehaviorFactory)\n    {\n    }\n\n    /// <summary>\n    /// Adapts a <see cref=\"Layout\"/> to an <see cref=\"IRegion\"/>.\n    /// </summary>\n    /// <param name=\"region\">The new region being used.</param>\n    /// <param name=\"regionTarget\">The object to adapt.</param>\n    protected override void Adapt(IRegion region, Layout regionTarget)\n    {\n        if (region == null)\n            throw new ArgumentNullException(nameof(region));\n\n        if (regionTarget == null)\n            throw new ArgumentNullException(nameof(regionTarget));\n\n        bool itemsSourceIsSet = regionTarget.Children?.Any() ?? false || regionTarget.IsSet(BindableLayout.ItemsSourceProperty);\n\n        if (itemsSourceIsSet)\n        {\n            throw new InvalidOperationException(Resources.LayoutViewHasChildrenException);\n        }\n\n        BindableLayout.SetItemsSource(regionTarget, region.Views);\n        BindableLayout.SetItemTemplate(regionTarget, new RegionItemsSourceTemplate());\n    }\n\n    /// <summary>\n    /// Creates a new instance of <see cref=\"IRegion\"/>.\n    /// </summary>\n    /// <returns>A new instance of <see cref=\"Region\"/>.</returns>\n    protected override IRegion CreateRegion(IContainerProvider container) =>\n        container.Resolve<Region>();\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Regions/Adapters/LayoutViewRegionAdapter.cs",
    "content": "using Microsoft.Maui.Controls.Compatibility;\nusing Prism.Properties;\n\nnamespace Prism.Navigation.Regions.Adapters;\n\n/// <summary>\n/// Adapter that creates a new <see cref=\"Region\"/> and monitors its\n/// active view to set it on the adapted <see cref=\"Layout{View}\"/>.\n/// </summary>\npublic class LayoutViewRegionAdapter : RegionAdapterBase<Layout<View>>\n{\n    /// <summary>\n    /// Initializes a new instance of <see cref=\"LayoutViewRegionAdapter\"/>.\n    /// </summary>\n    /// <param name=\"regionBehaviorFactory\">The factory used to create the region behaviors to attach to the created regions.</param>\n    public LayoutViewRegionAdapter(IRegionBehaviorFactory regionBehaviorFactory)\n        : base(regionBehaviorFactory)\n    {\n    }\n\n    /// <summary>\n    /// Adapts a <see cref=\"Layout{View}\"/> to an <see cref=\"IRegion\"/>.\n    /// </summary>\n    /// <param name=\"region\">The new region being used.</param>\n    /// <param name=\"regionTarget\">The object to adapt.</param>\n    protected override void Adapt(IRegion region, Layout<View> regionTarget)\n    {\n        ArgumentNullException.ThrowIfNull(region);\n        ArgumentNullException.ThrowIfNull(regionTarget);\n\n        bool itemsSourceIsSet = regionTarget.Children?.Any() ?? false || regionTarget.IsSet(BindableLayout.ItemsSourceProperty);\n\n        if (itemsSourceIsSet)\n        {\n            throw new InvalidOperationException(Resources.LayoutViewHasChildrenException);\n        }\n\n        BindableLayout.SetItemsSource(regionTarget, region.Views);\n        BindableLayout.SetItemTemplate(regionTarget, new RegionItemsSourceTemplate());\n    }\n\n    /// <summary>\n    /// Creates a new instance of <see cref=\"IRegion\"/>.\n    /// </summary>\n    /// <returns>A new instance of <see cref=\"Region\"/>.</returns>\n    protected override IRegion CreateRegion(IContainerProvider container) =>\n        container.Resolve<Region>();\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Regions/Adapters/RegionAdapterBase.cs",
    "content": "using System.Globalization;\nusing Prism.Extensions;\nusing Prism.Navigation.Regions.Behaviors;\nusing Prism.Navigation.Xaml;\nusing Prism.Properties;\n\nnamespace Prism.Navigation.Regions.Adapters;\n\n/// <summary>\n/// Base class to facilitate the creation of <see cref=\"IRegionAdapter\"/> implementations.\n/// </summary>\n/// <typeparam name=\"T\">Type of object to adapt.</typeparam>\npublic abstract class RegionAdapterBase<T> : IRegionAdapter where T : VisualElement\n{\n    /// <summary>\n    /// Initializes a new instance of <see cref=\"RegionAdapterBase{T}\"/>.\n    /// </summary>\n    /// <param name=\"regionBehaviorFactory\">The factory used to create the region behaviors to attach to the created regions.</param>\n    protected RegionAdapterBase(IRegionBehaviorFactory regionBehaviorFactory)\n    {\n        RegionBehaviorFactory = regionBehaviorFactory;\n    }\n\n    /// <summary>\n    /// Gets or sets the factory used to create the region behaviors to attach to the created regions.\n    /// </summary>\n    protected IRegionBehaviorFactory RegionBehaviorFactory { get; set; }\n\n    /// <summary>\n    /// Adapts an object and binds it to a new <see cref=\"IRegion\"/>.\n    /// </summary>\n    /// <param name=\"regionTarget\">The object to adapt.</param>\n    /// <param name=\"regionName\">The name of the region to be created.</param>\n    /// <returns>The new instance of <see cref=\"IRegion\"/> that the <paramref name=\"regionTarget\"/> is bound to.</returns>\n    public IRegion Initialize(T regionTarget, string regionName)\n    {\n        var page = regionTarget.GetParentPage();\n        var container = regionTarget.GetContainerProvider();\n        IRegion region = CreateRegion(container);\n        region.Name = regionName ?? throw new ArgumentNullException(nameof(regionName));\n        if (region is ITargetAwareRegion taRegion)\n            taRegion.TargetElement = regionTarget;\n\n        var children = page.GetChildRegions(true);\n        children.Add(region);\n\n        SetObservableRegionOnHostingControl(region, regionTarget);\n\n        Adapt(region, regionTarget);\n        AttachBehaviors(region, regionTarget);\n        AttachDefaultBehaviors(region, regionTarget);\n        return region;\n    }\n\n    /// <summary>\n    /// Adapts an object and binds it to a new <see cref=\"IRegion\"/>.\n    /// </summary>\n    /// <param name=\"regionTarget\">The object to adapt.</param>\n    /// <param name=\"regionName\">The name of the region to be created.</param>\n    /// <returns>The new instance of <see cref=\"IRegion\"/> that the <paramref name=\"regionTarget\"/> is bound to.</returns>\n    /// <remarks>This methods performs validation to check that <paramref name=\"regionTarget\"/>\n    /// is of type <typeparamref name=\"T\"/>.</remarks>\n    /// <exception cref=\"ArgumentNullException\">When <paramref name=\"regionTarget\"/> is <see langword=\"null\" />.</exception>\n    /// <exception cref=\"InvalidOperationException\">When <paramref name=\"regionTarget\"/> is not of type <typeparamref name=\"T\"/>.</exception>\n    IRegion IRegionAdapter.Initialize(object regionTarget, string regionName)\n    {\n        return Initialize(GetCastedObject(regionTarget), regionName);\n    }\n\n    /// <summary>\n    /// This method adds the default behaviors by using the <see cref=\"IRegionBehaviorFactory\"/> object.\n    /// </summary>\n    /// <param name=\"region\">The region being used.</param>\n    /// <param name=\"regionTarget\">The object to adapt.</param>\n    protected virtual void AttachDefaultBehaviors(IRegion region, T regionTarget)\n    {\n        ArgumentNullException.ThrowIfNull(region);\n        ArgumentNullException.ThrowIfNull(regionTarget);\n\n        IRegionBehaviorFactory behaviorFactory = RegionBehaviorFactory;\n        if (behaviorFactory != null)\n        {\n            foreach (string behaviorKey in behaviorFactory)\n            {\n                if (!region.Behaviors.ContainsKey(behaviorKey))\n                {\n                    IRegionBehavior behavior = behaviorFactory.CreateFromKey(behaviorKey);\n\n                    if (regionTarget is VisualElement visualElementRegionTarget)\n                    {\n                        if (behavior is IHostAwareRegionBehavior hostAwareRegionBehavior)\n                        {\n                            hostAwareRegionBehavior.HostControl = visualElementRegionTarget;\n                        }\n                    }\n\n                    region.Behaviors.Add(behaviorKey, behavior);\n                }\n            }\n        }\n    }\n\n    /// <summary>\n    /// Template method to attach new behaviors.\n    /// </summary>\n    /// <param name=\"region\">The region being used.</param>\n    /// <param name=\"regionTarget\">The object to adapt.</param>\n    protected virtual void AttachBehaviors(IRegion region, T regionTarget)\n    {\n    }\n\n    /// <summary>\n    /// Template method to adapt the object to an <see cref=\"IRegion\"/>.\n    /// </summary>\n    /// <param name=\"region\">The new region being used.</param>\n    /// <param name=\"regionTarget\">The object to adapt.</param>\n    protected abstract void Adapt(IRegion region, T regionTarget);\n\n    /// <summary>\n    /// Template method to create a new instance of <see cref=\"IRegion\"/>\n    /// that will be used to adapt the object.\n    /// </summary>\n    /// <returns>A new instance of <see cref=\"IRegion\"/>.</returns>\n    protected abstract IRegion CreateRegion(IContainerProvider container);\n\n    private static T GetCastedObject(object regionTarget)\n    {\n        if (regionTarget == null)\n            throw new ArgumentNullException(nameof(regionTarget));\n\n        if (regionTarget is not T castedObject)\n            throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, Resources.AdapterInvalidTypeException, typeof(T).Name));\n\n        return castedObject;\n    }\n\n    private static void SetObservableRegionOnHostingControl(IRegion region, T regionTarget)\n    {\n        if (regionTarget is VisualElement targetElement)\n        {\n            // Set the region as a dependency property on the control hosting the region\n            // Because we are using an observable region, the hosting control can detect that the\n            // region has actually been created. This is an ideal moment to hook up custom behaviors\n            Xaml.RegionManager.GetObservableRegion(targetElement).Value = region;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Regions/Adapters/RegionAdapterMappings.cs",
    "content": "﻿using System.Diagnostics.CodeAnalysis;\nusing System.Globalization;\nusing Prism.Properties;\n\nnamespace Prism.Navigation.Regions.Adapters;\n\n/// <summary>\n/// This class maps <see cref=\"Type\"/> with <see cref=\"IRegionAdapter\"/>.\n/// </summary>\npublic class RegionAdapterMappings\n{\n    private readonly Dictionary<Type, IRegionAdapter> mappings = [];\n\n    /// <summary>\n    /// Registers the mapping between a type and an adapter.\n    /// </summary>\n    /// <typeparam name=\"TControl\">The type of the control</typeparam>\n    /// <typeparam name=\"TAdapter\">The type of the IRegionAdapter to use with the TControl</typeparam>\n    /// <exception cref=\"InvalidOperationException\">Throws <see cref=\"InvalidOperationException\"/> when a mapping has already been defined for a specified control type.</exception>\n    public void RegisterMapping<TControl, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] TAdapter>() where TAdapter : IRegionAdapter\n    {\n        var controlType = typeof(TControl);\n\n        if (mappings.ContainsKey(controlType))\n            throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture,\n                                                              Resources.MappingExistsException, controlType.Name));\n\n        var adapter = ContainerLocator.Container.Resolve<TAdapter>();\n\n        mappings.Add(controlType, adapter);\n    }\n\n    /// <summary>\n    /// Removes an existing Registration if one exists and registers the new mapping between a type and an adapter.\n    /// </summary>\n    /// <typeparam name=\"TControl\">The type of the control</typeparam>\n    /// <typeparam name=\"TAdapter\">The type of the IRegionAdapter to use with the TControl</typeparam>\n    public void RegisterOrReplaceMapping<TControl, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] TAdapter>() where TAdapter : IRegionAdapter\n    {\n        var controlType = typeof(TControl);\n        var adapter = ContainerLocator.Container.Resolve<TAdapter>();\n\n        if (mappings.ContainsKey(controlType))\n            mappings.Remove(controlType);\n\n        mappings.Add(controlType, adapter);\n    }\n\n    internal void RegisterDefaultMapping<TControl, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] TAdapter>() where TAdapter : IRegionAdapter\n    {\n        var controlType = typeof(TControl);\n\n        if (mappings.ContainsKey(controlType))\n            return;\n\n        var adapter = ContainerLocator.Container.Resolve<TAdapter>();\n\n        mappings.Add(controlType, adapter);\n    }\n\n    /// <summary>\n    /// Returns the adapter associated with the type provided.\n    /// </summary>\n    /// <param name=\"controlType\">The type to obtain the <see cref=\"IRegionAdapter\"/> mapped.</param>\n    /// <returns>The <see cref=\"IRegionAdapter\"/> mapped to the <paramref name=\"controlType\"/>.</returns>\n    /// <remarks>This class will look for a registered type for <paramref name=\"controlType\"/> and if there is not any,\n    /// it will look for a registered type for any of its ancestors in the class hierarchy.\n    /// If there is no registered type for <paramref name=\"controlType\"/> or any of its ancestors,\n    /// an exception will be thrown.</remarks>\n    /// <exception cref=\"KeyNotFoundException\">When there is no registered type for <paramref name=\"controlType\"/> or any of its ancestors.</exception>\n    public IRegionAdapter GetMapping(Type controlType)\n    {\n        Type currentType = controlType;\n\n        while (currentType != null)\n        {\n            if (mappings.TryGetValue(currentType, out IRegionAdapter value))\n            {\n                return value;\n            }\n            currentType = currentType.BaseType;\n        }\n        throw new KeyNotFoundException(string.Format(CultureInfo.CurrentCulture, Resources.NoRegionAdapterException, controlType));\n    }\n\n    /// <summary>\n    /// Returns the adapter associated with the type provided.\n    /// </summary>\n    /// <typeparam name=\"T\">The control type used to obtain the <see cref=\"IRegionAdapter\"/> mapped.</typeparam>\n    /// <returns>The <see cref=\"IRegionAdapter\"/> mapped to the <typeparamref name=\"T\"/>.</returns>\n    /// <remarks>This class will look for a registered type for <typeparamref name=\"T\"/> and if there is not any,\n    /// it will look for a registered type for any of its ancestors in the class hierarchy.\n    /// If there is no registered type for <typeparamref name=\"T\"/> or any of its ancestors,\n    /// an exception will be thrown.</remarks>\n    /// <exception cref=\"KeyNotFoundException\">When there is no registered type for <typeparamref name=\"T\"/> or any of its ancestors.</exception>\n    public IRegionAdapter GetMapping<T>()\n    {\n        return GetMapping(typeof(T));\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Regions/Adapters/RegionItemsSourceTemplate.cs",
    "content": "﻿namespace Prism.Navigation.Regions.Adapters;\n\n// Implementation Note:\n// In discussing with PureWeen, it is best to provide a ContentView and provide a\n// simple Binding of the BindingContext to the Content property. The Xamarin.Forms\n// Layout engine may reuse the template provided and change out change out the Binding\n// Context for memory optimization.\ninternal class RegionItemsSourceTemplate : DataTemplate\n{\n    public RegionItemsSourceTemplate()\n        : base(ViewTemplate)\n    {\n    }\n\n    private static View ViewTemplate()\n    {\n        var view = new ContentView();\n        view.SetBinding(ContentView.ContentProperty, new Binding(\".\"));\n        return view;\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Regions/Adapters/ScrollViewRegionAdapter.cs",
    "content": "using System.Collections.Specialized;\nusing Prism.Properties;\n\nnamespace Prism.Navigation.Regions.Adapters;\n\n/// <summary>\n/// Adapter that creates a new <see cref=\"Region\"/> and monitors its\n/// active view to set it on the adapted <see cref=\"ScrollView\"/>.\n/// </summary>\npublic class ScrollViewRegionAdapter : RegionAdapterBase<ScrollView>\n{\n    /// <summary>\n    /// Initializes a new instance of <see cref=\"ScrollViewRegionAdapter\"/>.\n    /// </summary>\n    /// <param name=\"regionBehaviorFactory\">The factory used to create the region behaviors to attach to the created regions.</param>\n    public ScrollViewRegionAdapter(IRegionBehaviorFactory regionBehaviorFactory)\n        : base(regionBehaviorFactory)\n    {\n    }\n\n    /// <summary>\n    /// Adapts a <see cref=\"ScrollView\"/> to an <see cref=\"IRegion\"/>.\n    /// </summary>\n    /// <param name=\"region\">The new region being used.</param>\n    /// <param name=\"regionTarget\">The object to adapt.</param>\n    protected override void Adapt(IRegion region, ScrollView regionTarget)\n    {\n        ArgumentNullException.ThrowIfNull(region);\n        ArgumentNullException.ThrowIfNull(regionTarget);\n\n        // No binding check required as the ContentProperty is not Bindable\n        bool contentIsSet = regionTarget.Content != null;\n\n        if (contentIsSet)\n            throw new InvalidOperationException(Resources.ScrollViewHasContentException);\n\n        region.ActiveViews.CollectionChanged += delegate\n        {\n            regionTarget.Content = region.ActiveViews.FirstOrDefault() as View;\n        };\n\n        region.Views.CollectionChanged +=\n            (sender, e) =>\n            {\n                if (e.Action == NotifyCollectionChangedAction.Add && region.ActiveViews.Count() == 0)\n                {\n                    region.Activate(e.NewItems[0] as VisualElement);\n                }\n            };\n    }\n\n    /// <summary>\n    /// Creates a new instance of <see cref=\"Region\"/>.\n    /// </summary>\n    /// <returns>A new instance of <see cref=\"Region\"/>.</returns>\n    protected override IRegion CreateRegion(IContainerProvider container) =>\n        container.Resolve<Region>();\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Regions/AllActiveRegion.cs",
    "content": "﻿using Prism.Properties;\n\nnamespace Prism.Navigation.Regions;\n\n/// <summary>\n/// Region that keeps all the views in it as active. Deactivation of views is not allowed.\n/// </summary>\npublic class AllActiveRegion : Region\n{\n    /// <summary>\n    /// Creates a new <see cref=\"AllActiveRegion\"/>.\n    /// </summary>\n    /// <param name=\"regionNavigationService\"></param>\n    public AllActiveRegion(IRegionNavigationService regionNavigationService)\n        : base(regionNavigationService)\n    {\n    }\n\n    /// <summary>\n    /// Gets a readonly view of the collection of all the active views in the region. These are all the added views.\n    /// </summary>\n    /// <value>An <see cref=\"IViewsCollection\"/> of all the active views.</value>\n    public override IViewsCollection ActiveViews => Views;\n\n    /// <summary>\n    /// Deactivate is not valid in this Region. This method will always throw <see cref=\"InvalidOperationException\"/>.\n    /// </summary>\n    /// <param name=\"view\">The view to deactivate.</param>\n    /// <exception cref=\"InvalidOperationException\">Every time this method is called.</exception>\n    public override void Deactivate(object view)\n    {\n        throw new InvalidOperationException(Resources.DeactiveNotPossibleException);\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Regions/Behaviors/AutoPopulateRegionBehavior.cs",
    "content": "﻿using System.ComponentModel;\nusing Prism.Ioc;\n\nnamespace Prism.Navigation.Regions.Behaviors;\n\n/// <summary>\n/// Populates the target region with the views registered to it in the <see cref=\"IRegionViewRegistry\"/>.\n/// </summary>\npublic class AutoPopulateRegionBehavior : RegionBehavior\n{\n    /// <summary>\n    /// The key of this behavior.\n    /// </summary>\n    public const string BehaviorKey = \"AutoPopulate\";\n\n    private readonly IRegionViewRegistry regionViewRegistry;\n\n    /// <summary>\n    /// Creates a new instance of the AutoPopulateRegionBehavior\n    /// associated with the <see cref=\"IRegionViewRegistry\"/> received.\n    /// </summary>\n    /// <param name=\"regionViewRegistry\"><see cref=\"IRegionViewRegistry\"/> that the behavior will monitor for views to populate the region.</param>\n    public AutoPopulateRegionBehavior(IRegionViewRegistry regionViewRegistry)\n    {\n        this.regionViewRegistry = regionViewRegistry;\n    }\n\n    /// <summary>\n    /// Attaches the AutoPopulateRegionBehavior to the Region.\n    /// </summary>\n    protected override void OnAttach()\n    {\n        if (string.IsNullOrEmpty(Region.Name))\n        {\n            Region.PropertyChanged += Region_PropertyChanged;\n        }\n        else\n        {\n            StartPopulatingContent();\n        }\n    }\n\n    private void StartPopulatingContent()\n    {\n        foreach (VisualElement view in CreateViewsToAutoPopulate())\n        {\n            AddViewIntoRegion(view);\n        }\n\n        if (Region is ITargetAwareRegion targetAware && targetAware.TargetElement.GetValue(Xaml.RegionManager.DefaultViewProperty) != null)\n        {\n            var defaultView = targetAware.TargetElement.GetValue(Xaml.RegionManager.DefaultViewProperty);\n            if (defaultView is string targetName)\n                Region.Add(targetName);\n            else if (defaultView is VisualElement element)\n                Region.Add(element);\n            else if (defaultView is Type type)\n            {\n                var container = targetAware.Container;\n                var registry = container.Resolve<IRegionNavigationRegistry>();\n                var registration = registry.Registrations.FirstOrDefault(x => x.View == type);\n                if (registration is not null)\n                {\n                    var view = registry.CreateView(container, registration.Name) as VisualElement;\n                    Region.Add(view);\n                }\n            }\n        }\n\n        regionViewRegistry.ContentRegistered += OnViewRegistered;\n    }\n\n    /// <summary>\n    /// Returns a collection of views that will be added to the\n    /// View collection.\n    /// </summary>\n    /// <returns></returns>\n    protected virtual IEnumerable<object> CreateViewsToAutoPopulate()\n    {\n        return regionViewRegistry.GetContents(Region.Name, Region.Container());\n    }\n\n    /// <summary>\n    /// Adds a view into the views collection of this region.\n    /// </summary>\n    /// <param name=\"viewToAdd\"></param>\n    protected virtual void AddViewIntoRegion(VisualElement viewToAdd)\n    {\n        Region.Add(viewToAdd);\n    }\n\n    private void Region_PropertyChanged(object sender, PropertyChangedEventArgs e)\n    {\n        if (e.PropertyName == \"Name\" && !string.IsNullOrEmpty(Region.Name))\n        {\n            Region.PropertyChanged -= Region_PropertyChanged;\n            StartPopulatingContent();\n        }\n    }\n\n    /// <summary>\n    /// Handler of the event that fires when a new viewtype is registered to the registry.\n    /// </summary>\n    /// <remarks>Although this is a public method to support Weak Delegates in Silverlight, it should not be called by the user.</remarks>\n    /// <param name=\"sender\"></param>\n    /// <param name=\"e\"></param>\n    public virtual void OnViewRegistered(object sender, ViewRegisteredEventArgs e)\n    {\n        if (e == null)\n            throw new ArgumentNullException(nameof(e));\n\n        if (e.RegionName == Region.Name)\n        {\n            AddViewIntoRegion((VisualElement)e.GetView(Region.Container()));\n        }\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Regions/Behaviors/BindRegionContextToVisualElementBehavior.cs",
    "content": "﻿using System.Collections;\nusing System.Collections.Specialized;\nusing System.ComponentModel;\nusing Prism.Common;\n\nnamespace Prism.Navigation.Regions.Behaviors;\n\n/// <summary>\n/// Defines a behavior that forwards the <see cref=\"Xaml.RegionManager.RegionContextProperty\"/>\n/// to the views in the region.\n/// </summary>\npublic class BindRegionContextToVisualElementBehavior : IRegionBehavior\n{\n    /// <summary>\n    /// The key of this behavior.\n    /// </summary>\n    public const string BehaviorKey = \"ContextToVisualElement\";\n\n    /// <summary>\n    /// Behavior's attached region.\n    /// </summary>\n    public IRegion Region { get; set; }\n\n    /// <summary>\n    /// Attaches the behavior to the specified region.\n    /// </summary>\n    public void Attach()\n    {\n        Region.Views.CollectionChanged += Views_CollectionChanged;\n        Region.PropertyChanged += Region_PropertyChanged;\n        SetContextToViews(Region.Views, Region.Context);\n        AttachNotifyChangeEvent(Region.Views);\n    }\n\n    private static void SetContextToViews(IEnumerable views, object context)\n    {\n        foreach (var view in views)\n        {\n            if (view is VisualElement visualElement)\n            {\n                ObservableObject<object> contextWrapper = RegionContext.GetObservableContext(visualElement);\n                contextWrapper.Value = context;\n            }\n        }\n    }\n\n    private void AttachNotifyChangeEvent(IEnumerable views)\n    {\n        foreach (var view in views)\n        {\n            if (view is VisualElement visualElement)\n            {\n                ObservableObject<object> viewRegionContext = RegionContext.GetObservableContext(visualElement);\n                viewRegionContext.PropertyChanged += ViewRegionContext_OnPropertyChangedEvent;\n            }\n        }\n    }\n\n    private void DetachNotifyChangeEvent(IEnumerable views)\n    {\n        foreach (var view in views)\n        {\n            if (view is VisualElement visualElement)\n            {\n                ObservableObject<object> viewRegionContext = RegionContext.GetObservableContext(visualElement);\n                viewRegionContext.PropertyChanged -= ViewRegionContext_OnPropertyChangedEvent;\n            }\n        }\n    }\n\n    private void ViewRegionContext_OnPropertyChangedEvent(object sender, PropertyChangedEventArgs args)\n    {\n        if (args.PropertyName == \"Value\")\n        {\n            var context = (ObservableObject<object>)sender;\n            Region.Context = context.Value;\n        }\n    }\n\n    private void Views_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)\n    {\n        if (e.Action == NotifyCollectionChangedAction.Add)\n        {\n            SetContextToViews(e.NewItems, Region.Context);\n            AttachNotifyChangeEvent(e.NewItems);\n        }\n        else if (e.Action == NotifyCollectionChangedAction.Remove && Region.Context != null)\n        {\n            DetachNotifyChangeEvent(e.OldItems);\n            SetContextToViews(e.OldItems, null);\n        }\n    }\n\n    private void Region_PropertyChanged(object sender, PropertyChangedEventArgs e)\n    {\n        if (e.PropertyName == \"Context\")\n        {\n            SetContextToViews(Region.Views, Region.Context);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Regions/Behaviors/ClearChildViewsRegionBehavior.cs",
    "content": "﻿namespace Prism.Navigation.Regions.Behaviors;\n\n/// <summary>\n/// Behavior that removes the RegionManager attached property of all the views in a region once the RegionManager property of a region becomes null.\n/// This is useful when removing views with nested regions, to ensure these nested regions get removed from the RegionManager as well.\n/// <remarks>\n/// This behavior does not apply by default.\n/// In order to activate it, the ClearChildViews attached property must be set to True in the view containing the affected child regions.\n/// </remarks>\n/// </summary>\npublic class ClearChildViewsRegionBehavior : RegionBehavior\n{\n    /// <summary>\n    /// The behavior key.\n    /// </summary>\n    public const string BehaviorKey = \"ClearChildViews\";\n\n    /// <summary>\n    /// This attached property can be defined on a view to indicate that regions defined in it must be removed from the region manager when the parent view gets removed from a region.\n    /// </summary>\n    public static readonly BindableProperty ClearChildViewsProperty =\n        BindableProperty.CreateAttached(\"ClearChildViews\", typeof(bool), typeof(ClearChildViewsRegionBehavior), false);\n\n    /// <summary>\n    /// Gets the ClearChildViews attached property from a BindableObject.\n    /// </summary>\n    /// <param name=\"target\">The object from which to get the value.</param>\n    /// <returns>The value of the ClearChildViews attached property in the target specified.</returns>\n    public static bool GetClearChildViews(BindableObject target)\n    {\n        if (target == null)\n            throw new ArgumentNullException(nameof(target));\n\n        return (bool)target.GetValue(ClearChildViewsProperty);\n    }\n\n    /// <summary>\n    /// Sets the ClearChildViews attached property in a BindableObject.\n    /// </summary>\n    /// <param name=\"target\">The object in which to set the value.</param>\n    /// <param name=\"value\">The value of to set in the target object's ClearChildViews attached property.</param>\n    public static void SetClearChildViews(BindableObject target, bool value)\n    {\n        if (target == null)\n            throw new ArgumentNullException(nameof(target));\n\n        target.SetValue(ClearChildViewsProperty, value);\n    }\n\n    /// <summary>\n    /// Subscribes to the <see cref=\"Region\"/>'s PropertyChanged method to monitor its RegionManager property.\n    /// </summary>\n    protected override void OnAttach()\n    {\n        Region.PropertyChanged += Region_PropertyChanged;\n    }\n\n    private static void ClearChildViews(IRegion region)\n    {\n        foreach (var view in region.Views.OfType<VisualElement>())\n        {\n            if (GetClearChildViews(view))\n            {\n                view.ClearValue(Xaml.RegionManager.RegionManagerProperty);\n            }\n        }\n    }\n\n    private void Region_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)\n    {\n        if (e.PropertyName == \"RegionManager\")\n        {\n            if (Region.RegionManager == null)\n            {\n                ClearChildViews(Region);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Regions/Behaviors/DelayedRegionCreationBehavior.cs",
    "content": "﻿using System.Collections.ObjectModel;\nusing System.Globalization;\nusing Prism.Behaviors;\nusing Prism.Extensions;\nusing Prism.Navigation.Regions.Adapters;\nusing Prism.Navigation.Xaml;\nusing Prism.Properties;\n\nnamespace Prism.Navigation.Regions.Behaviors;\n\n/// <summary>\n/// Behavior that creates a new <see cref=\"IRegion\"/>, when the control that will host the <see cref=\"IRegion\"/> (see <see cref=\"TargetElement\"/>)\n/// is added to the VisualTree. This behavior will use the <see cref=\"RegionAdapterMappings\"/> class to find the right type of adapter to create\n/// the region. After the region is created, this behavior will detach.\n/// </summary>\n/// <remarks>\n/// Attached property value inheritance is not available in Silverlight, so the current approach walks up the visual tree when requesting a region from a region manager.\n/// The <see cref=\"RegionManagerRegistrationBehavior\"/> is now responsible for walking up the Tree.\n/// </remarks>\npublic class DelayedRegionCreationBehavior\n{\n    private static readonly ICollection<DelayedRegionCreationBehavior> _instanceTracker =\n        new Collection<DelayedRegionCreationBehavior>();\n\n    private readonly RegionAdapterMappings _regionAdapterMappings;\n    private readonly object _trackerLock = new object();\n\n    private WeakReference _elementWeakReference;\n    private bool _regionCreated = false;\n\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"DelayedRegionCreationBehavior\"/> class.\n    /// </summary>\n    /// <param name=\"regionAdapterMappings\">\n    /// The region adapter mappings, that are used to find the correct adapter for\n    /// a given controltype. The controltype is determined by the <see name=\"TargetElement\"/> value.\n    /// </param>\n    public DelayedRegionCreationBehavior(RegionAdapterMappings regionAdapterMappings)\n    {\n        _regionAdapterMappings = regionAdapterMappings;\n        RegionManagerAccessor = new DefaultRegionManagerAccessor();\n    }\n\n    /// <summary>\n    /// Sets a class that interfaces between the <see cref=\"RegionManager\"/> 's static properties/events and this behavior,\n    /// so this behavior can be tested in isolation.\n    /// </summary>\n    /// <value>The region manager accessor.</value>\n    public IRegionManagerAccessor RegionManagerAccessor { get; }\n\n    /// <summary>\n    /// The element that will host the Region.\n    /// </summary>\n    /// <value>The target element.</value>\n    public VisualElement TargetElement\n    {\n        get => _elementWeakReference != null ? _elementWeakReference.Target as VisualElement : null;\n        set => _elementWeakReference = new WeakReference(value);\n    }\n\n    private Page ParentPage => TargetElement.GetParentPage();\n\n    /// <summary>\n    /// Start monitoring the <see cref=\"RegionManager\"/> and the <see cref=\"TargetElement\"/> to detect when the <see cref=\"TargetElement\"/> becomes\n    /// part of the Visual Tree. When that happens, the Region will be created and the behavior will <see cref=\"Detach\"/>.\n    /// </summary>\n    public void Attach()\n    {\n        RegionManagerAccessor.UpdatingRegions += OnUpdatingRegions;\n        TargetElement.Behaviors.Add(new ElementParentedCallbackBehavior(TryCreateRegion));\n    }\n\n    /// <summary>\n    /// Stop monitoring the <see cref=\"RegionManager\"/> and the  <see cref=\"TargetElement\"/>, so that this behavior can be garbage collected.\n    /// </summary>\n    public void Detach()\n    {\n        RegionManagerAccessor.UpdatingRegions -= OnUpdatingRegions;\n        Untrack();\n    }\n\n    /// <summary>\n    /// Called when the <see cref=\"IRegionManager\"/> is updating it's <see cref=\"IRegionManager.Regions\"/> collection.\n    /// </summary>\n    /// <param name=\"sender\">The <see cref=\"IRegionManager\"/>. </param>\n    /// <param name=\"e\">The <see cref=\"EventArgs\"/> instance containing the event data.</param>\n    public void OnUpdatingRegions(object sender, EventArgs e)\n    {\n        TryCreateRegion();\n    }\n\n    private void TryCreateRegion()\n    {\n        if (TargetElement == null)\n        {\n            Detach();\n            return;\n        }\n\n        if (TargetElement.TryGetParentPage(out var _))\n        {\n            Detach();\n\n            if (!_regionCreated)\n            {\n                string regionName = RegionManagerAccessor.GetRegionName(TargetElement);\n                CreateRegion(TargetElement, regionName);\n                Track();\n                _regionCreated = true;\n            }\n        }\n    }\n\n    /// <summary>\n    /// Method that will create the region, by calling the right <see cref=\"IRegionAdapter\"/>.\n    /// </summary>\n    /// <param name=\"targetElement\">The target element that will host the <see cref=\"IRegion\"/>.</param>\n    /// <param name=\"regionName\">Name of the region.</param>\n    /// <returns>The created <see cref=\"IRegion\"/></returns>\n    protected virtual IRegion CreateRegion(VisualElement targetElement, string regionName)\n    {\n        if (targetElement == null)\n            throw new ArgumentNullException(nameof(targetElement));\n\n        try\n        {\n            if (!targetElement.TryGetParentPage(out var page))\n                throw new Exception(\"The Target Element has not yet been parented and we cannot get the parent page.\");\n\n            // Build the region\n            var container = page.GetContainerProvider();\n            targetElement.SetContainerProvider(container);\n            var regionAdapter = _regionAdapterMappings.GetMapping(targetElement.GetType());\n            var region = regionAdapter.Initialize(targetElement, regionName);\n\n            return region;\n        }\n        catch (Exception ex)\n        {\n            throw new RegionCreationException(string.Format(CultureInfo.CurrentCulture, Resources.RegionCreationException, regionName, ex), ex);\n        }\n    }\n\n    /// <summary>\n    /// Add the instance of this class to <see cref=\"_instanceTracker\"/> to keep it alive\n    /// </summary>\n    private void Track()\n    {\n        lock (_trackerLock)\n        {\n            if (!_instanceTracker.Contains(this))\n            {\n                _instanceTracker.Add(this);\n            }\n        }\n    }\n\n    /// <summary>\n    /// Remove the instance of this class from <see cref=\"_instanceTracker\"/>\n    /// so it can eventually be garbage collected\n    /// </summary>\n    private void Untrack()\n    {\n        lock (_trackerLock)\n        {\n            _instanceTracker.Remove(this);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Regions/Behaviors/DestructibleRegionBehavior.cs",
    "content": "﻿using System.Collections.Specialized;\nusing Prism.Common;\n\nnamespace Prism.Navigation.Regions.Behaviors;\n\n/// <summary>\n/// Provides a Behavior to Destroy the View/ViewModel when the View is removed from the Region's Views\n/// </summary>\npublic class DestructibleRegionBehavior : RegionBehavior\n{\n    /// <summary>\n    /// The key of this behavior.\n    /// </summary>\n    public const string BehaviorKey = \"IDestructibleRegionBehavior\";\n\n    /// <summary>\n    /// Attaches the behavior to the specified region.\n    /// </summary>\n    protected override void OnAttach()\n    {\n        Region.Views.CollectionChanged += Views_CollectionChanged;\n    }\n\n    private void Views_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)\n    {\n        if (e.Action == NotifyCollectionChangedAction.Remove)\n        {\n            foreach (var item in e.OldItems)\n            {\n                MvvmHelpers.InvokeViewAndViewModelAction<IDestructible>(item, v => v.Destroy());\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Regions/Behaviors/IHostAwareRegionBehavior.cs",
    "content": "﻿namespace Prism.Navigation.Regions.Behaviors;\n\n/// <summary>\n/// Defines a <see cref=\"IRegionBehavior\"/> that not allows extensible behaviors on regions which also interact\n/// with the target element that the <see cref=\"IRegion\"/> is attached to.\n/// </summary>\npublic interface IHostAwareRegionBehavior : IRegionBehavior\n{\n    /// <summary>\n    /// Gets or sets the <see cref=\"VisualElement\"/> that the <see cref=\"IRegion\"/> is attached to.\n    /// </summary>\n    /// <value>A <see cref=\"VisualElement\"/> that the <see cref=\"IRegion\"/> is attached to.\n    /// This is usually a <see cref=\"View\"/> that is part of the tree.</value>\n    VisualElement HostControl { get; set; }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Regions/Behaviors/RegionActiveAwareBehavior.cs",
    "content": "using System.Collections.Specialized;\nusing Prism.Common;\n\nnamespace Prism.Navigation.Regions.Behaviors;\n\n/// <summary>\n/// Behavior that monitors a <see cref=\"IRegion\"/> object and\n/// changes the value for the <see cref=\"IActiveAware.IsActive\"/> property when\n/// an object that implements <see cref=\"IActiveAware\"/> gets added or removed\n/// from the collection.\n/// </summary>\n/// <remarks>\n/// This class can also sync the active state for any scoped regions directly on the view based on the <see cref=\"SyncActiveStateAttribute\"/>.\n/// If you use the <see cref=\"Regions.Region.Add(object,string,bool)\" /> method with the createRegionManagerScope option, the scoped manager will be attached to the view.\n/// </remarks>\npublic class RegionActiveAwareBehavior : IRegionBehavior\n{\n    /// <summary>\n    /// Name that identifies the <see cref=\"RegionActiveAwareBehavior\"/> behavior in a collection of <see cref=\"IRegionBehavior\"/>.\n    /// </summary>\n    public const string BehaviorKey = \"ActiveAware\";\n\n    /// <summary>\n    /// The region that this behavior is extending\n    /// </summary>\n    public IRegion Region { get; set; }\n\n    /// <summary>\n    /// Attaches the behavior to the specified region\n    /// </summary>\n    public void Attach()\n    {\n        INotifyCollectionChanged collection = GetCollection();\n        if (collection != null)\n        {\n            collection.CollectionChanged += OnCollectionChanged;\n        }\n    }\n\n    /// <summary>\n    /// Detaches the behavior from the <see cref=\"INotifyCollectionChanged\"/>.\n    /// </summary>\n    public void Detach()\n    {\n        INotifyCollectionChanged collection = GetCollection();\n        if (collection != null)\n        {\n            collection.CollectionChanged -= OnCollectionChanged;\n        }\n    }\n\n    private void OnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)\n    {\n        if (e.Action == NotifyCollectionChangedAction.Add)\n        {\n            foreach (object item in e.NewItems)\n            {\n                void SetActive(IActiveAware activeAware) => activeAware.IsActive = true;\n\n                MvvmHelpers.InvokeViewAndViewModelAction(item, (Action<IActiveAware>)SetActive);\n                InvokeOnSynchronizedActiveAwareChildren(item, SetActive);\n            }\n        }\n        else if (e.Action == NotifyCollectionChangedAction.Remove)\n        {\n            foreach (object item in e.OldItems)\n            {\n                void SetInActive(IActiveAware activeAware) => activeAware.IsActive = false;\n\n                MvvmHelpers.InvokeViewAndViewModelAction(item, (Action<IActiveAware>)SetInActive);\n                InvokeOnSynchronizedActiveAwareChildren(item, SetInActive);\n            }\n        }\n\n        // May need to handle other action values (reset, replace). Currently the ViewsCollection class does not raise CollectionChanged with these values.\n    }\n\n    private void InvokeOnSynchronizedActiveAwareChildren(object item, Action<IActiveAware> invocation)\n    {\n        if (item is VisualElement visualElement)\n        {\n            // We are assuming that any scoped region managers are attached directly to the\n            // view.\n            var regionManager = Xaml.RegionManager.GetRegionManager(visualElement);\n\n            // If the view's RegionManager attached property is different from the region's RegionManager,\n            // then the view's region manager is a scoped region manager.\n            if (regionManager == null || regionManager == Region.RegionManager) return;\n\n            var activeViews = regionManager.Regions.SelectMany(e => e.ActiveViews);\n\n            var syncActiveViews = activeViews.OfType<VisualElement>().Where(ShouldSyncActiveState);\n\n            foreach (var syncActiveView in syncActiveViews)\n            {\n                MvvmHelpers.InvokeViewAndViewModelAction(syncActiveView, invocation);\n            }\n        }\n    }\n\n    private bool ShouldSyncActiveState(VisualElement view)\n    {\n        if (Attribute.IsDefined(view.GetType(), typeof(SyncActiveStateAttribute)))\n        {\n            return true;\n        }\n\n        var viewModel = view.BindingContext;\n\n        return viewModel != null && Attribute.IsDefined(viewModel.GetType(), typeof(SyncActiveStateAttribute));\n    }\n\n    private INotifyCollectionChanged GetCollection()\n    {\n        return Region.ActiveViews;\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Regions/Behaviors/RegionCreationException.cs",
    "content": "using System.Runtime.Serialization;\n\nnamespace Prism.Navigation.Regions.Behaviors;\n\n/// <summary>\n/// Represents errors that occurred during region creation.\n/// </summary>\npublic partial class RegionCreationException : Exception\n{\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"RegionCreationException\"/>\n    /// </summary>\n    public RegionCreationException()\n    {\n    }\n\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"RegionCreationException\"/> class with a specified error message.\n    /// </summary>\n    /// <param name=\"message\">The message that describes the error.</param>\n    public RegionCreationException(string message)\n        : base(message)\n    {\n    }\n\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"RegionCreationException\"/> class with a specified error message and a reference \n    /// to the inner exception that is the cause of this exception. \n    /// </summary>\n    /// <param name=\"message\">The error message that explains the reason for the exception.</param>\n    /// <param name=\"inner\">The exception that is the cause of the current exception, or a null reference \n    /// (Nothing in Visual Basic) if no inner exception is specified.</param>\n    public RegionCreationException(string message, Exception inner)\n        : base(message, inner)\n    {\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Regions/Behaviors/RegionManagerRegistrationBehavior.cs",
    "content": "﻿using System.ComponentModel;\nusing Prism.Properties;\n\nnamespace Prism.Navigation.Regions.Behaviors;\n\n/// <summary>\n/// Subscribes to a static event from the <see cref=\"RegionManager\"/> in order to register the target <see cref=\"IRegion\"/>\n/// in a <see cref=\"IRegionManager\"/> when one is available on the host control by walking up the tree and finding\n/// a control whose <see cref=\"Xaml.RegionManager.RegionManagerProperty\"/> property is not <see langword=\"null\"/>.\n/// </summary>\npublic class RegionManagerRegistrationBehavior : RegionBehavior, IHostAwareRegionBehavior\n{\n    /// <summary>\n    /// The key of this behavior.\n    /// </summary>\n    public static readonly string BehaviorKey = \"RegionManagerRegistration\";\n\n    private WeakReference _attachedRegionManagerWeakReference;\n    private VisualElement _hostControl;\n\n    /// <summary>\n    /// Initializes a new instance of <see cref=\"RegionManagerRegistrationBehavior\"/>.\n    /// </summary>\n    public RegionManagerRegistrationBehavior()\n    {\n        RegionManagerAccessor = new DefaultRegionManagerAccessor();\n    }\n\n    /// <summary>\n    /// Provides an abstraction on top of the RegionManager static members.\n    /// </summary>\n    public IRegionManagerAccessor RegionManagerAccessor { get; set; }\n\n    /// <summary>\n    /// Gets or sets the <see cref=\"VisualElement\"/> that the <see cref=\"IRegion\"/> is attached to.\n    /// </summary>\n    /// <value>A <see cref=\"VisualElement\"/> that the <see cref=\"IRegion\"/> is attached to.\n    /// This is usually a <see cref=\"View\"/> that is part of the tree.</value>\n    /// <exception cref=\"InvalidOperationException\">When this member is set after the <see cref=\"IRegionBehavior.Attach\"/> method has being called.</exception>\n    public VisualElement HostControl\n    {\n        get => _hostControl;\n        set\n        {\n            if (IsAttached)\n            {\n                throw new InvalidOperationException(Resources.HostControlCannotBeSetAfterAttach);\n            }\n            _hostControl = value;\n        }\n    }\n\n    /// <summary>\n    /// When the <see cref=\"IRegion\"/> has a name assigned, the behavior will start monitoring the ancestor controls in the element tree\n    /// to look for an <see cref=\"IRegionManager\"/> where to register the region in.\n    /// </summary>\n    protected override void OnAttach()\n    {\n        if (string.IsNullOrEmpty(Region.Name))\n        {\n            Region.PropertyChanged += Region_PropertyChanged;\n        }\n        else\n        {\n            StartMonitoringRegionManager();\n        }\n    }\n\n    private void Region_PropertyChanged(object sender, PropertyChangedEventArgs e)\n    {\n        if (e.PropertyName == \"Name\" && !string.IsNullOrEmpty(Region.Name))\n        {\n            Region.PropertyChanged -= Region_PropertyChanged;\n            StartMonitoringRegionManager();\n        }\n    }\n\n    private void StartMonitoringRegionManager()\n    {\n        RegionManagerAccessor.UpdatingRegions += OnUpdatingRegions;\n        TryRegisterRegion();\n    }\n\n    private void TryRegisterRegion()\n    {\n        var targetElement = HostControl;\n        //if (targetElement.CheckAccess())\n        {\n            var regionManager = FindRegionManager(targetElement);\n            var attachedRegionManager = GetAttachedRegionManager();\n\n            if (regionManager != attachedRegionManager)\n            {\n                if (attachedRegionManager != null)\n                {\n                    _attachedRegionManagerWeakReference = null;\n                    attachedRegionManager.Regions.Remove(Region.Name);\n                }\n\n                if (regionManager != null)\n                {\n                    _attachedRegionManagerWeakReference = new WeakReference(regionManager);\n                    regionManager.Regions.Add(Region);\n                }\n            }\n        }\n    }\n\n    /// <summary>\n    /// This event handler gets called when a RegionManager is requiring the instances of a region to be registered if they are not already.\n    /// <remarks>Although this is a public method to support Weak Delegates in Silverlight, it should not be called by the user.</remarks>\n    /// </summary>\n    /// <param name=\"sender\">The sender.</param>\n    /// <param name=\"e\">The arguments.</param>\n    public void OnUpdatingRegions(object sender, EventArgs e)\n    {\n        TryRegisterRegion();\n    }\n\n    private IRegionManager FindRegionManager(Element element)\n    {\n        if (element is VisualElement visualElement)\n        {\n            var regionManager = RegionManagerAccessor.GetRegionManager(visualElement);\n            if (regionManager != null)\n            {\n                return regionManager;\n            }\n        }\n\n        if (element.Parent != null)\n        {\n            return FindRegionManager(element.Parent);\n        }\n\n        return null;\n    }\n\n    private IRegionManager GetAttachedRegionManager()\n    {\n        if (_attachedRegionManagerWeakReference != null)\n        {\n            return _attachedRegionManagerWeakReference.Target as IRegionManager;\n        }\n\n        return null;\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Regions/Behaviors/RegionMemberLifetimeBehavior.cs",
    "content": "﻿using System.Collections.Specialized;\nusing Prism.Common;\n\nnamespace Prism.Navigation.Regions.Behaviors;\n\n/// <summary>\n/// The RegionMemberLifetimeBehavior determines if items should be removed from the <see cref=\"IRegion\"/>\n/// when they are deactivated.\n/// </summary>\n/// <remarks>\n/// The <see cref=\"RegionMemberLifetimeBehavior\"/> monitors the <see cref=\"IRegion.ActiveViews\"/>\n/// collection to discover items that transition into a deactivated state.\n/// <p/>\n/// The behavior checks the removed items for either the <see cref=\"IRegionMemberLifetime\"/>\n/// or the <see cref=\"RegionMemberLifetimeAttribute\"/> (in that order) to determine if it should be kept\n/// alive on removal.\n/// <p/>\n/// If the item in the collection is a <see cref=\"VisualElement\"/>, it will\n/// also check it's DataContext for <see cref=\"IRegionMemberLifetime\"/> or the <see cref=\"RegionMemberLifetimeAttribute\"/>.\n/// <p/>\n/// The order of checks are:\n/// <list type=\"number\">\n///     <item>Region Item's IRegionMemberLifetime.KeepAlive value.</item>\n///     <item>Region Item's DataContext's IRegionMemberLifetime.KeepAlive value.</item>\n///     <item>Region Item's RegionMemberLifetimeAttribute.KeepAlive value.</item>\n///     <item>Region Item's DataContext's RegionMemberLifetimeAttribute.KeepAlive value.</item>\n/// </list>\n/// </remarks>\npublic class RegionMemberLifetimeBehavior : RegionBehavior\n{\n    /// <summary>\n    /// The key for this behavior.\n    /// </summary>\n    public const string BehaviorKey = \"RegionMemberLifetimeBehavior\";\n\n    /// <summary>\n    /// Override this method to perform the logic after the behavior has been attached.\n    /// </summary>\n    protected override void OnAttach()\n    {\n        Region.ActiveViews.CollectionChanged += OnActiveViewsChanged;\n    }\n\n    private void OnActiveViewsChanged(object sender, NotifyCollectionChangedEventArgs e)\n    {\n        // We only pay attention to items removed from the ActiveViews list.\n        // Thus, we expect that any ICollectionView implementation would\n        // always raise a remove and we don't handle any resets\n        // unless we wanted to start tracking views that used to be active.\n        if (e.Action != NotifyCollectionChangedAction.Remove) return;\n\n        var inactiveViews = e.OldItems.Cast<VisualElement>();\n        foreach (var inactiveView in inactiveViews)\n        {\n            if (!ShouldKeepAlive(inactiveView))\n            {\n                if (Region.Views.Contains(inactiveView))\n                    Region.Remove(inactiveView);\n            }\n        }\n    }\n\n    private static bool ShouldKeepAlive(object inactiveView)\n    {\n        var lifetime = MvvmHelpers.GetImplementerFromViewOrViewModel<IRegionMemberLifetime>(inactiveView);\n        if (lifetime != null)\n        {\n            return lifetime.KeepAlive;\n        }\n\n        var lifetimeAttribute = GetItemOrContextLifetimeAttribute(inactiveView);\n        if (lifetimeAttribute != null)\n        {\n            return lifetimeAttribute.KeepAlive;\n        }\n\n        return true;\n    }\n\n    private static RegionMemberLifetimeAttribute GetItemOrContextLifetimeAttribute(object inactiveView)\n    {\n        var lifetimeAttribute = GetCustomAttributes<RegionMemberLifetimeAttribute>(inactiveView.GetType()).FirstOrDefault();\n        if (lifetimeAttribute != null)\n        {\n            return lifetimeAttribute;\n        }\n\n        if (inactiveView is VisualElement frameworkElement && frameworkElement.BindingContext != null)\n        {\n            var dataContext = frameworkElement.BindingContext;\n            var contextLifetimeAttribute =\n                GetCustomAttributes<RegionMemberLifetimeAttribute>(dataContext.GetType()).FirstOrDefault();\n            return contextLifetimeAttribute;\n        }\n\n        return null;\n    }\n\n    private static IEnumerable<T> GetCustomAttributes<T>(Type type) =>\n        type.GetCustomAttributes(typeof(T), true).OfType<T>();\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Regions/Behaviors/SyncRegionContextWithHostBehavior.cs",
    "content": "﻿using Prism.Common;\nusing Prism.Properties;\n\nnamespace Prism.Navigation.Regions.Behaviors;\n\n/// <summary>\n/// Behavior that synchronizes the <see cref=\"IRegion.Context\"/> property of a <see cref=\"IRegion\"/> with\n/// the control that hosts the Region. It does this by setting the <see cref=\"Xaml.RegionManager.RegionContextProperty\"/>\n/// Dependency Property on the host control.\n///\n/// This behavior allows the usage of two way databinding of the RegionContext from XAML.\n/// </summary>\npublic class SyncRegionContextWithHostBehavior : RegionBehavior, IHostAwareRegionBehavior\n{\n    private const string RegionContextPropertyName = \"Context\";\n    private VisualElement _hostControl;\n\n    /// <summary>\n    /// Name that identifies the SyncRegionContextWithHostBehavior behavior in a collection of RegionsBehaviors.\n    /// </summary>\n    public static readonly string BehaviorKey = \"SyncRegionContextWithHost\";\n\n    private ObservableObject<object> HostControlRegionContext => RegionContext.GetObservableContext(_hostControl);\n\n    /// <summary>\n    /// Gets or sets the <see cref=\"VisualElement\"/> that the <see cref=\"IRegion\"/> is attached to.\n    /// </summary>\n    /// <value>\n    /// A <see cref=\"VisualElement\"/> that the <see cref=\"IRegion\"/> is attached to.\n    /// This is usually a <see cref=\"VisualElement\"/> that is part of the tree.\n    /// </value>\n    public VisualElement HostControl\n    {\n        get\n        {\n            return _hostControl;\n        }\n        set\n        {\n            if (IsAttached)\n            {\n                throw new InvalidOperationException(Resources.HostControlCannotBeSetAfterAttach);\n            }\n            _hostControl = value;\n        }\n    }\n\n    /// <summary>\n    /// Override this method to perform the logic after the behavior has been attached.\n    /// </summary>\n    protected override void OnAttach()\n    {\n        if (HostControl != null)\n        {\n            // Sync values initially.\n            SynchronizeRegionContext();\n\n            // Now register for events to keep them in sync\n            HostControlRegionContext.PropertyChanged += RegionContextObservableObject_PropertyChanged;\n            Region.PropertyChanged += Region_PropertyChanged;\n        }\n    }\n\n    void Region_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)\n    {\n        if (e.PropertyName == RegionContextPropertyName)\n        {\n            if (Xaml.RegionManager.GetRegionContext(HostControl) != Region.Context)\n            {\n                // Setting this Dependency Property will automatically also change the HostControlRegionContext.Value\n                // (see RegionManager.OnRegionContextChanged())\n                Xaml.RegionManager.SetRegionContext(_hostControl, Region.Context);\n            }\n        }\n    }\n\n    void RegionContextObservableObject_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)\n    {\n        if (e.PropertyName == \"Value\")\n        {\n            SynchronizeRegionContext();\n        }\n    }\n\n    private void SynchronizeRegionContext()\n    {\n        // Forward this value to the Region\n        if (Region.Context != HostControlRegionContext.Value)\n        {\n            Region.Context = HostControlRegionContext.Value;\n        }\n\n        // Also make sure the region's DependencyProperty was changed (this can occur if the value\n        // was changed only on the HostControlRegionContext)\n        if (Xaml.RegionManager.GetRegionContext(HostControl) != HostControlRegionContext.Value)\n        {\n            Xaml.RegionManager.SetRegionContext(HostControl, HostControlRegionContext.Value);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Regions/DefaultRegionManagerAccessor.cs",
    "content": "﻿using Prism.Ioc;\n\nnamespace Prism.Navigation.Regions;\n\ninternal class DefaultRegionManagerAccessor : IRegionManagerAccessor\n{\n    /// <summary>\n    /// Notification used by attached behaviors to update the region managers appropriately if needed to.\n    /// </summary>\n    /// <remarks>This event uses weak references to the event handler to prevent this static event of keeping the\n    /// target element longer than expected.</remarks>\n    public event EventHandler UpdatingRegions\n    {\n        add => Xaml.RegionManager.UpdatingRegions += value;\n        remove => Xaml.RegionManager.UpdatingRegions -= value;\n    }\n\n    /// <summary>\n    /// Gets the value for the RegionName attached property.\n    /// </summary>\n    /// <param name=\"element\">The object to adapt. This is typically a container (i.e a control).</param>\n    /// <returns>The name of the region that should be created when\n    /// the RegionManager is also set in this element.</returns>\n    public string GetRegionName(VisualElement element)\n    {\n        if (element == null)\n            throw new ArgumentNullException(nameof(element));\n\n        return element.GetValue(Xaml.RegionManager.RegionNameProperty) as string;\n    }\n\n    /// <summary>\n    /// Gets the value of the RegionName attached property.\n    /// </summary>\n    /// <param name=\"element\">The target element.</param>\n    /// <returns>The <see cref=\"IRegionManager\"/> attached to the <paramref name=\"element\"/> element.</returns>\n    public IRegionManager GetRegionManager(VisualElement element)\n    {\n        if (element == null)\n            throw new ArgumentNullException(nameof(element));\n\n        var regionManager = TryGetRegion(element);\n        if (regionManager is null)\n        {\n            regionManager = ContainerLocator.Container.Resolve<IRegionManager>();\n            element.SetValue(Xaml.RegionManager.RegionManagerProperty, regionManager);\n        }\n\n        return regionManager;\n    }\n\n    private IRegionManager TryGetRegion(VisualElement element)\n    {\n        try\n        {\n            return element.GetValue(Xaml.RegionManager.RegionManagerProperty) as IRegionManager;\n        }\n        catch\n        {\n            return null;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Regions/IRegionManagerAccessor.cs",
    "content": "﻿namespace Prism.Navigation.Regions;\n\n/// <summary>\n/// Provides an abstraction on top of the RegionManager static members.\n/// </summary>\npublic interface IRegionManagerAccessor\n{\n    /// <summary>\n    /// Notification used by attached behaviors to update the region managers appropriately if needed to.\n    /// </summary>\n    /// <remarks>This event uses weak references to the event handler to prevent this static event of keeping the\n    /// target element longer than expected.</remarks>\n    event EventHandler UpdatingRegions;\n\n    /// <summary>\n    /// Gets the value for the RegionName attached property.\n    /// </summary>\n    /// <param name=\"element\">The object to adapt. This is typically a container (i.e a control).</param>\n    /// <returns>The name of the region that should be created when\n    /// the RegionManager is also set in this element.</returns>\n    string GetRegionName(VisualElement element);\n\n    /// <summary>\n    /// Gets the value of the RegionName attached property.\n    /// </summary>\n    /// <param name=\"element\">The target element.</param>\n    /// <returns>The <see cref=\"IRegionManager\"/> attached to the <paramref name=\"element\"/> element.</returns>\n    IRegionManager GetRegionManager(VisualElement element);\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Regions/ITargetAwareRegion.cs",
    "content": "﻿using System.ComponentModel;\nusing Prism.Ioc;\nusing Prism.Navigation.Xaml;\n\nnamespace Prism.Navigation.Regions;\n\n[EditorBrowsable(EditorBrowsableState.Never)]\npublic interface ITargetAwareRegion : IRegion\n{\n    VisualElement TargetElement { get; set; }\n\n    IContainerProvider Container => TargetElement.GetContainerProvider();\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Regions/ItemMetadata.cs",
    "content": "﻿namespace Prism.Navigation.Regions;\n\n/// <summary>\n/// Defines a class that wraps an item and adds metadata for it.\n/// </summary>\npublic class ItemMetadata : BindableObject\n{\n    /// <summary>\n    /// The name of the wrapped item.\n    /// </summary>\n    public static readonly BindableProperty NameProperty =\n        BindableProperty.Create(nameof(Name), typeof(string), typeof(ItemMetadata), null);\n\n    /// <summary>\n    /// Value indicating whether the wrapped item is considered active.\n    /// </summary>\n    public static readonly BindableProperty IsActiveProperty =\n        BindableProperty.Create(nameof(IsActive), typeof(bool), typeof(ItemMetadata), propertyChanged: BindablePropertyChanged);\n\n    /// <summary>\n    /// Initializes a new instance of <see cref=\"ItemMetadata\"/>.\n    /// </summary>\n    /// <param name=\"item\">The item to wrap.</param>\n    public ItemMetadata(VisualElement item)\n    {\n        // check for null\n        Item = item;\n    }\n\n    /// <summary>\n    /// Gets the wrapped item.\n    /// </summary>\n    /// <value>The wrapped item.</value>\n    public VisualElement Item { get; private set; }\n\n    /// <summary>\n    /// Gets or sets a name for the wrapped item.\n    /// </summary>\n    /// <value>The name of the wrapped item.</value>\n    public string Name\n    {\n        get => (string)GetValue(NameProperty);\n        set => SetValue(NameProperty, value);\n    }\n\n    /// <summary>\n    /// Gets or sets a value indicating whether the wrapped item is considered active.\n    /// </summary>\n    /// <value><see langword=\"true\" /> if the item should be considered active; otherwise <see langword=\"false\" />.</value>\n    public bool IsActive\n    {\n        get => (bool)GetValue(IsActiveProperty);\n        set => SetValue(IsActiveProperty, value);\n    }\n\n    /// <summary>\n    /// Occurs when metadata on the item changes.\n    /// </summary>\n    public event EventHandler MetadataChanged;\n\n    /// <summary>\n    /// Explicitly invokes <see cref=\"MetadataChanged\"/> to notify listeners.\n    /// </summary>\n    public void InvokeMetadataChanged()\n    {\n        MetadataChanged?.Invoke(this, EventArgs.Empty);\n    }\n\n    private static void BindablePropertyChanged(BindableObject bindableObject, object oldValue, object newValue)\n    {\n        if (bindableObject is ItemMetadata itemMetadata)\n        {\n            itemMetadata.InvokeMetadataChanged();\n        }\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Regions/Navigation/RegionNavigationContentLoader.cs",
    "content": "using System.Globalization;\nusing Prism.Common;\nusing Prism.Ioc;\nusing Prism.Mvvm;\nusing Prism.Properties;\n\nnamespace Prism.Navigation.Regions.Navigation;\n\n/// <summary>\n/// Implementation of <see cref=\"IRegionNavigationContentLoader\"/> that relies on a <see cref=\"IContainerProvider\"/>\n/// to create new views when necessary.\n/// </summary>\npublic class RegionNavigationContentLoader : IRegionNavigationContentLoader\n{\n    /// <summary>\n    /// Gets the view to which the navigation request represented by <paramref name=\"navigationContext\"/> applies.\n    /// </summary>\n    /// <param name=\"region\">The region.</param>\n    /// <param name=\"navigationContext\">The context representing the navigation request.</param>\n    /// <returns>\n    /// The view to be the target of the navigation request.\n    /// </returns>\n    /// <remarks>\n    /// If none of the views in the region can be the target of the navigation request, a new view\n    /// is created and added to the region.\n    /// </remarks>\n    /// <exception cref=\"ArgumentException\">when a new view cannot be created for the navigation request.</exception>\n    public object LoadContent(IRegion region, NavigationContext navigationContext)\n    {\n        ArgumentNullException.ThrowIfNull(region);\n        ArgumentNullException.ThrowIfNull(navigationContext);\n\n        string candidateTargetContract = GetContractFromNavigationContext(navigationContext);\n\n        var candidates = GetCandidatesFromRegion(region, candidateTargetContract);\n\n        var acceptingCandidates =\n            candidates.Where(\n                v => MvvmHelpers.IsNavigationTarget(v, navigationContext));\n\n        var view = acceptingCandidates.FirstOrDefault();\n\n        if (view != null)\n        {\n            return view;\n        }\n\n        view = CreateNewRegionItem(candidateTargetContract, region) as VisualElement;\n        region.Add(view);\n\n        return view;\n    }\n\n    /// <summary>\n    /// Provides a new item for the region based on the supplied candidate target contract name.\n    /// </summary>\n    /// <param name=\"candidateTargetContract\">The target contract to build.</param>\n    /// <param name=\"region\">The <see cref=\"IRegion\"/> to create the new Region Item in.</param>\n    /// <returns>An instance of an item to put into the <see cref=\"IRegion\"/>.</returns>\n    protected virtual object CreateNewRegionItem(string candidateTargetContract, IRegion region)\n    {\n        try\n        {\n            var registry = region.Container().Resolve<IRegionNavigationRegistry>();\n            return registry.CreateView(region.Container(), candidateTargetContract);\n        }\n        catch (KeyNotFoundException)\n        {\n            throw;\n        }\n        catch (ContainerResolutionException)\n        {\n            throw;\n        }\n        catch (Exception e)\n        {\n            throw new InvalidOperationException(\n                string.Format(CultureInfo.CurrentCulture, Resources.CannotCreateNavigationTarget, candidateTargetContract),\n                e);\n        }\n    }\n\n    /// <summary>\n    /// Returns the candidate TargetContract based on the <see cref=\"NavigationContext\"/>.\n    /// </summary>\n    /// <param name=\"navigationContext\">The navigation contract.</param>\n    /// <returns>The candidate contract to seek within the <see cref=\"IRegion\"/> and to use, if not found, when resolving from the container.</returns>\n    protected virtual string GetContractFromNavigationContext(NavigationContext navigationContext)\n    {\n        ArgumentNullException.ThrowIfNull(navigationContext);\n\n        var candidateTargetContract = UriParsingHelper.EnsureAbsolute(navigationContext.Uri).AbsolutePath;\n        candidateTargetContract = candidateTargetContract.TrimStart('/');\n        return candidateTargetContract;\n    }\n\n    /// <summary>\n    /// Returns the set of candidates that may satisfy this navigation request.\n    /// </summary>\n    /// <param name=\"region\">The region containing items that may satisfy the navigation request.</param>\n    /// <param name=\"candidateNavigationContract\">The candidate navigation target as determined by <see cref=\"GetContractFromNavigationContext\"/></param>\n    /// <returns>An enumerable of candidate objects from the <see cref=\"IRegion\"/></returns>\n    protected virtual IEnumerable<VisualElement> GetCandidatesFromRegion(IRegion region, string candidateNavigationContract)\n    {\n        ArgumentNullException.ThrowIfNull(region);\n\n        if (string.IsNullOrEmpty(candidateNavigationContract))\n        {\n            throw new ArgumentNullException(nameof(candidateNavigationContract));\n        }\n\n        var contractCandidates = RegionNavigationContentLoader.GetCandidatesFromRegionViews(region, candidateNavigationContract);\n\n        if (!contractCandidates.Any())\n        {\n            var registry = region.Container().Resolve<IRegionNavigationRegistry>();\n            var registration = registry.Registrations.FirstOrDefault(x => x.Type == ViewType.Region && (x.Name == candidateNavigationContract || x.View.Name == candidateNavigationContract || x.View.FullName == candidateNavigationContract));\n            if (registration is not null)\n            {\n                RegionNavigationContentLoader.GetCandidatesFromRegionViews(region, registration.View.FullName);\n            }\n\n            return [];\n        }\n\n        return contractCandidates;\n    }\n\n    private static IEnumerable<VisualElement> GetCandidatesFromRegionViews(IRegion region, string candidateNavigationContract)\n    {\n        return region.Views.OfType<VisualElement>().Where(v => ViewIsMatch(v.GetType(), candidateNavigationContract));\n    }\n\n    private static bool ViewIsMatch(Type viewType, string navigationSegment)\n    {\n        return viewType.FullName == navigationSegment || viewType.Name == navigationSegment;\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Regions/Navigation/RegionNavigationService.cs",
    "content": "﻿using Prism.Common;\nusing Prism.Ioc;\nusing Prism.Properties;\n\nnamespace Prism.Navigation.Regions.Navigation;\n\n/// <summary>\n/// Provides navigation for regions.\n/// </summary>\npublic class RegionNavigationService : IRegionNavigationService\n{\n    private readonly IContainerProvider _container;\n    private readonly IRegionNavigationContentLoader _regionNavigationContentLoader;\n    private NavigationContext _currentNavigationContext;\n\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"RegionNavigationService\"/> class.\n    /// </summary>\n    /// <param name=\"container\">The <see cref=\"IContainerExtension\" />.</param>\n    /// <param name=\"regionNavigationContentLoader\">The navigation target handler.</param>\n    /// <param name=\"journal\">The journal.</param>\n    public RegionNavigationService(IContainerExtension container, IRegionNavigationContentLoader regionNavigationContentLoader, IRegionNavigationJournal journal)\n    {\n        _container = container ?? throw new ArgumentNullException(nameof(container));\n        _regionNavigationContentLoader = regionNavigationContentLoader ?? throw new ArgumentNullException(nameof(regionNavigationContentLoader));\n        Journal = journal ?? throw new ArgumentNullException(nameof(journal));\n        Journal.NavigationTarget = this;\n    }\n\n    /// <summary>\n    /// Gets or sets the region.\n    /// </summary>\n    /// <value>The region.</value>\n    public IRegion Region { get; set; }\n\n    /// <summary>\n    /// Gets the journal.\n    /// </summary>\n    /// <value>The journal.</value>\n    public IRegionNavigationJournal Journal { get; private set; }\n\n    /// <summary>\n    /// Raised when the region is about to be navigated to content.\n    /// </summary>\n    public event EventHandler<RegionNavigationEventArgs> Navigating;\n\n    private void RaiseNavigating(NavigationContext navigationContext)\n    {\n        Navigating?.Invoke(this, new RegionNavigationEventArgs(navigationContext));\n    }\n\n    /// <summary>\n    /// Raised when the region is navigated to content.\n    /// </summary>\n    public event EventHandler<RegionNavigationEventArgs> Navigated;\n\n    private void RaiseNavigated(NavigationContext navigationContext)\n    {\n        Navigated?.Invoke(this, new RegionNavigationEventArgs(navigationContext));\n    }\n\n    /// <summary>\n    /// Raised when a navigation request fails.\n    /// </summary>\n    public event EventHandler<RegionNavigationFailedEventArgs> NavigationFailed;\n\n    private void RaiseNavigationFailed(NavigationContext navigationContext, Exception error)\n    {\n        NavigationFailed?.Invoke(this, new RegionNavigationFailedEventArgs(navigationContext, error));\n    }\n\n    /// <summary>\n    /// Initiates navigation to the specified target.\n    /// </summary>\n    /// <param name=\"target\">The target.</param>\n    /// <param name=\"navigationCallback\">A callback to execute when the navigation request is completed.</param>\n    public void RequestNavigate(Uri target, Action<NavigationResult> navigationCallback)\n    {\n        RequestNavigate(target, navigationCallback, null);\n    }\n\n    /// <summary>\n    /// Initiates navigation to the specified target.\n    /// </summary>\n    /// <param name=\"target\">The target.</param>\n    /// <param name=\"navigationCallback\">A callback to execute when the navigation request is completed.</param>\n    /// <param name=\"regionParameters\">The navigation parameters specific to the navigation request.</param>\n    public void RequestNavigate(Uri target, Action<NavigationResult> navigationCallback, INavigationParameters regionParameters)\n    {\n        if (navigationCallback == null)\n            throw new ArgumentNullException(nameof(navigationCallback));\n\n        try\n        {\n            DoNavigate(target, navigationCallback, regionParameters);\n        }\n        catch (Exception e)\n        {\n            NotifyNavigationFailed(new NavigationContext(this, target), navigationCallback, e);\n        }\n    }\n\n    private void DoNavigate(Uri source, Action<NavigationResult> navigationCallback, INavigationParameters regionParameters)\n    {\n        if (source == null)\n            throw new ArgumentNullException(nameof(source));\n\n        if (Region == null)\n            throw new InvalidOperationException(Resources.NavigationServiceHasNoRegion);\n\n        _currentNavigationContext = new NavigationContext(this, source, regionParameters);\n\n        // starts querying the active views\n        RequestCanNavigateFromOnCurrentlyActiveView(\n            _currentNavigationContext,\n            navigationCallback,\n            Region.ActiveViews.OfType<VisualElement>().ToArray(),\n            0);\n    }\n\n    private void RequestCanNavigateFromOnCurrentlyActiveView(\n        NavigationContext navigationContext,\n        Action<NavigationResult> navigationCallback,\n        VisualElement[] activeViews,\n        int currentViewIndex)\n    {\n        if (currentViewIndex < activeViews.Length)\n        {\n            if (activeViews[currentViewIndex] is IConfirmNavigationRequest vetoingView)\n            {\n                // the current active view implements IConfirmNavigationRequest, request confirmation\n                // providing a callback to resume the navigation request\n                vetoingView.ConfirmNavigationRequest(\n                    navigationContext,\n                    canNavigate =>\n                    {\n                        if (_currentNavigationContext == navigationContext && canNavigate)\n                        {\n                            RequestCanNavigateFromOnCurrentlyActiveViewModel(\n                                navigationContext,\n                                navigationCallback,\n                                activeViews,\n                                currentViewIndex);\n                        }\n                        else\n                        {\n                            NotifyNavigationFailed(navigationContext, navigationCallback, null);\n                        }\n                    });\n            }\n            else\n            {\n                RequestCanNavigateFromOnCurrentlyActiveViewModel(\n                    navigationContext,\n                    navigationCallback,\n                    activeViews,\n                    currentViewIndex);\n            }\n        }\n        else\n        {\n            ExecuteNavigation(navigationContext, activeViews, navigationCallback);\n        }\n    }\n\n    private void RequestCanNavigateFromOnCurrentlyActiveViewModel(\n        NavigationContext navigationContext,\n        Action<NavigationResult> navigationCallback,\n        VisualElement[] activeViews,\n        int currentViewIndex)\n    {\n        if (activeViews[currentViewIndex].BindingContext is IConfirmNavigationRequest vetoingViewModel)\n        {\n            // the data model for the current active view implements IConfirmNavigationRequest, request confirmation\n            // providing a callback to resume the navigation request\n            vetoingViewModel.ConfirmNavigationRequest(\n                navigationContext,\n                canNavigate =>\n                {\n                    if (_currentNavigationContext == navigationContext && canNavigate)\n                    {\n                        RequestCanNavigateFromOnCurrentlyActiveView(\n                            navigationContext,\n                            navigationCallback,\n                            activeViews,\n                            currentViewIndex + 1);\n                    }\n                    else\n                    {\n                        NotifyNavigationFailed(navigationContext, navigationCallback, null);\n                    }\n                });\n\n            return;\n        }\n\n        RequestCanNavigateFromOnCurrentlyActiveView(\n            navigationContext,\n            navigationCallback,\n            activeViews,\n            currentViewIndex + 1);\n    }\n\n    private void ExecuteNavigation(NavigationContext navigationContext, object[] activeViews, Action<NavigationResult> navigationCallback)\n    {\n        try\n        {\n            NotifyActiveViewsNavigatingFrom(navigationContext, activeViews);\n\n            var view = (VisualElement)_regionNavigationContentLoader.LoadContent(Region, navigationContext);\n\n            // Raise the navigating event just before activating the view.\n            RaiseNavigating(navigationContext);\n\n            Region.Activate(view);\n\n            // Update the navigation journal before notifying others of navigation\n            IRegionNavigationJournalEntry journalEntry = _container.Resolve<IRegionNavigationJournalEntry>();\n            journalEntry.Uri = navigationContext.Uri;\n            journalEntry.Parameters = navigationContext.Parameters;\n\n            bool persistInHistory = PersistInHistory(view);\n\n            Journal.RecordNavigation(journalEntry, persistInHistory);\n\n            // The view can be informed of navigation\n            MvvmHelpers.OnNavigatedTo(view, navigationContext);\n\n            navigationCallback(new NavigationResult(navigationContext, true));\n\n            // Raise the navigated event when navigation is completed.\n            RaiseNavigated(navigationContext);\n        }\n        catch (Exception e)\n        {\n            NotifyNavigationFailed(navigationContext, navigationCallback, e);\n        }\n    }\n\n    private static bool PersistInHistory(object view)\n    {\n        bool persist = true;\n        MvvmHelpers.InvokeViewAndViewModelAction<IJournalAware>(view, ija => { persist &= ija.PersistInHistory(); });\n        return persist;\n    }\n\n    private void NotifyNavigationFailed(NavigationContext navigationContext, Action<NavigationResult> navigationCallback, Exception e)\n    {\n        var navigationResult =\n            e != null ? new NavigationResult(navigationContext, e) : new NavigationResult(navigationContext, false);\n\n        navigationCallback(navigationResult);\n        RaiseNavigationFailed(navigationContext, e);\n    }\n\n    private static void NotifyActiveViewsNavigatingFrom(NavigationContext navigationContext, object[] activeViews)\n    {\n        foreach (var item in activeViews)\n        {\n            MvvmHelpers.OnNavigatedFrom(item, navigationContext);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Regions/Region.cs",
    "content": "﻿using System.Collections.ObjectModel;\nusing System.Globalization;\nusing Prism.Ioc;\nusing Prism.Mvvm;\nusing Prism.Navigation.Xaml;\nusing Prism.Properties;\n\nnamespace Prism.Navigation.Regions;\n\n/// <summary>\n/// Implementation of <see cref=\"IRegion\"/> that allows multiple active views.\n/// </summary>\npublic class Region : BindableBase, IRegion, ITargetAwareRegion\n{\n    private ObservableCollection<ItemMetadata> _itemMetadataCollection;\n    private IRegionManager _regionManager;\n    private readonly IRegionNavigationService _regionNavigationService;\n    private Comparison<object> _sort;\n\n    /// <summary>\n    /// Initializes a new instance of <see cref=\"Region\"/>.\n    /// </summary>\n    public Region(IRegionNavigationService regionNavigationService)\n    {\n        Behaviors = new RegionBehaviorCollection(this);\n        _regionNavigationService = regionNavigationService;\n        _regionNavigationService.Region = this;\n        _sort = DefaultSortComparison;\n    }\n\n    public VisualElement TargetElement { get; set; }\n\n    private ViewsCollection _views;\n    /// <summary>\n    /// Gets a readonly view of the collection of views in the region.\n    /// </summary>\n    /// <value>An <see cref=\"IViewsCollection\"/> of all the added views.</value>\n    public virtual IViewsCollection Views\n    {\n        get\n        {\n            if (_views == null)\n            {\n                _views = new ViewsCollection(ItemMetadataCollection, x => true)\n                {\n                    SortComparison = _sort\n                };\n            }\n\n            return _views;\n        }\n    }\n\n    private ViewsCollection _activeViews;\n    /// <summary>\n    /// Gets a readonly view of the collection of all the active views in the region.\n    /// </summary>\n    /// <value>An <see cref=\"IViewsCollection\"/> of all the active views.</value>\n    public virtual IViewsCollection ActiveViews\n    {\n        get\n        {\n            if (_views == null)\n            {\n                _views = new ViewsCollection(ItemMetadataCollection, x => true)\n                {\n                    SortComparison = _sort\n                };\n            }\n\n            if (_activeViews == null)\n            {\n                _activeViews = new ViewsCollection(ItemMetadataCollection, x => x.IsActive)\n                {\n                    SortComparison = _sort\n                };\n            }\n\n            return _activeViews;\n        }\n    }\n\n    private object _context;\n    /// <summary>\n    /// Gets or sets a context for the region. This value can be used by the user to share context with the views.\n    /// </summary>\n    /// <value>The context value to be shared.</value>\n    public object Context\n    {\n        get => _context;\n        set => SetProperty(ref _context, value);\n    }\n\n    private string _name;\n    /// <summary>\n    /// Gets the name of the region that uniquely identifies the region within a <see cref=\"IRegionManager\"/>.\n    /// </summary>\n    /// <value>The name of the region.</value>\n    public string Name\n    {\n        get => _name;\n        set\n        {\n            if (_name != null && _name != value)\n            {\n                throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, Resources.CannotChangeRegionNameException, _name));\n            }\n\n            if (string.IsNullOrEmpty(value))\n            {\n                throw new ArgumentException(Resources.RegionNameCannotBeEmptyException);\n            }\n\n            _name = value;\n            RaisePropertyChanged(nameof(Name));\n        }\n    }\n\n    /// <summary>\n    /// Gets or sets the comparison used to sort the views.\n    /// </summary>\n    /// <value>The comparison to use.</value>\n    public Comparison<object> SortComparison\n    {\n        get => _sort;\n        set\n        {\n            _sort = value;\n\n            if (_activeViews != null)\n            {\n                _activeViews.SortComparison = _sort;\n            }\n\n            if (_views != null)\n            {\n                _views.SortComparison = _sort;\n            }\n        }\n    }\n\n    /// <summary>\n    /// Gets or sets the <see cref=\"IRegionManager\"/> that will be passed to the views when adding them to the region, unless the view is added by specifying createRegionManagerScope as <see langword=\"true\" />.\n    /// </summary>\n    /// <value>The <see cref=\"IRegionManager\"/> where this <see cref=\"IRegion\"/> is registered.</value>\n    /// <remarks>This is usually used by implementations of <see cref=\"IRegionManager\"/> and should not be\n    /// used by the developer explicitly.</remarks>\n    public IRegionManager RegionManager\n    {\n        get => _regionManager;\n        set => SetProperty(ref _regionManager, value);\n    }\n\n    /// <summary>\n    /// Gets the collection of <see cref=\"IRegionBehavior\"/>s that can extend the behavior of regions.\n    /// </summary>\n    public IRegionBehaviorCollection Behaviors { get; }\n\n    /// <summary>\n    /// Gets the navigation service.\n    /// </summary>\n    /// <value>The navigation service.</value>\n    public IRegionNavigationService NavigationService\n    {\n        get => _regionNavigationService;\n        set => throw new NotImplementedException();\n    }\n\n    /// <summary>\n    /// Gets the collection with all the views along with their metadata.\n    /// </summary>\n    /// <value>An <see cref=\"ObservableCollection{T}\"/> of <see cref=\"ItemMetadata\"/> with all the added views.</value>\n    protected virtual ObservableCollection<ItemMetadata> ItemMetadataCollection\n    {\n        get\n        {\n            if (_itemMetadataCollection == null)\n            {\n                _itemMetadataCollection = new ObservableCollection<ItemMetadata>();\n            }\n\n            return _itemMetadataCollection;\n        }\n    }\n\n    /// <summary>\n    /// Marks the specified view as active.\n    /// </summary>\n    /// <param name=\"view\">The view to activate.</param>\n    public virtual void Activate(object view)\n    {\n        var itemMetadata = GetItemMetadataOrThrow(view);\n\n        if (!itemMetadata.IsActive)\n        {\n            itemMetadata.IsActive = true;\n        }\n    }\n\n    /// <summary>\n    /// Marks the specified view as inactive.\n    /// </summary>\n    /// <param name=\"view\">The view to deactivate.</param>\n    public virtual void Deactivate(object view)\n    {\n        var itemMetadata = GetItemMetadataOrThrow(view);\n\n        if (itemMetadata.IsActive)\n        {\n            itemMetadata.IsActive = false;\n        }\n    }\n\n    public IRegionManager Add(string viewName)\n    {\n        var container = TargetElement.GetContainerProvider();\n        var registry = container.Resolve<IRegionNavigationRegistry>();\n        var view = registry.CreateView(container, viewName) as VisualElement;\n        return Add(view, viewName);\n    }\n\n    /// <overloads>Adds a new view to the region.</overloads>\n    /// <summary>\n    /// Adds a new view to the region.\n    /// </summary>\n    /// <param name=\"view\">The view to add.</param>\n    /// <returns>The <see cref=\"IRegionManager\"/> that is set on the view if it is a <see cref=\"VisualElement\"/>. It will be the current region manager when using this overload.</returns>\n    public IRegionManager Add(object view)\n    {\n        return Add(view, null, false);\n    }\n\n    /// <summary>\n    /// Adds a new view to the region.\n    /// </summary>\n    /// <param name=\"view\">The view to add.</param>\n    /// <param name=\"viewName\">The name of the view. This can be used to retrieve it later by calling <see cref=\"IRegion.GetView\"/>.</param>\n    /// <returns>The <see cref=\"IRegionManager\"/> that is set on the view if it is a <see cref=\"VisualElement\"/>. It will be the current region manager when using this overload.</returns>\n    public IRegionManager Add(object view, string viewName)\n    {\n        if (string.IsNullOrEmpty(viewName))\n        {\n            throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Resources.StringCannotBeNullOrEmpty, nameof(viewName)));\n        }\n\n        return Add(view, viewName, false);\n    }\n\n    /// <summary>\n    /// Adds a new view to the region.\n    /// </summary>\n    /// <param name=\"view\">The view to add.</param>\n    /// <param name=\"viewName\">The name of the view. This can be used to retrieve it later by calling <see cref=\"IRegion.GetView\"/>.</param>\n    /// <param name=\"createRegionManagerScope\">When <see langword=\"true\"/>, the added view will receive a new instance of <see cref=\"IRegionManager\"/>, otherwise it will use the current region manager for this region.</param>\n    /// <returns>The <see cref=\"IRegionManager\"/> that is set on the view if it is a <see cref=\"VisualElement\"/>.</returns>\n    public virtual IRegionManager Add(object view, string viewName, bool createRegionManagerScope)\n    {\n        IRegionManager manager = createRegionManagerScope ? RegionManager.CreateRegionManager() : RegionManager;\n        InnerAdd(view, viewName, manager);\n        return manager;\n    }\n\n    private void InnerAdd(object view, string viewName, IRegionManager scopedRegionManager)\n    {\n        if (view is not VisualElement visualElement)\n        {\n            throw new UpdateRegionsException(\"The view must inherit from VisualElement.\");\n        }\n\n        if (ItemMetadataCollection.FirstOrDefault(x => x.Item == view) != null)\n        {\n            throw new InvalidOperationException(Resources.RegionViewExistsException);\n        }\n\n        var itemMetadata = new ItemMetadata(visualElement);\n        if (!string.IsNullOrEmpty(viewName))\n        {\n            if (ItemMetadataCollection.FirstOrDefault(x => x.Name == viewName) != null)\n            {\n                throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, Resources.RegionViewNameExistsException, viewName));\n            }\n            itemMetadata.Name = viewName;\n        }\n\n        Xaml.RegionManager.SetRegionManager(visualElement, scopedRegionManager);\n\n        ItemMetadataCollection.Add(itemMetadata);\n    }\n\n    /// <summary>\n    /// Returns the view instance that was added to the region using a specific name.\n    /// </summary>\n    /// <param name=\"viewName\">The name used when adding the view to the region.</param>\n    /// <returns>Returns the named view or <see langword=\"null\"/> if the view with <paramref name=\"viewName\"/> does not exist in the current region.</returns>\n    public virtual object GetView(string viewName)\n    {\n        if (string.IsNullOrEmpty(viewName))\n        {\n            throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Resources.StringCannotBeNullOrEmpty, nameof(viewName)));\n        }\n\n        var metadata = ItemMetadataCollection.FirstOrDefault(x => x.Name == viewName);\n\n        if (metadata != null)\n        {\n            return metadata.Item;\n        }\n\n        return null;\n    }\n\n    /// <summary>\n    /// Removes the specified view from the region.\n    /// </summary>\n    /// <param name=\"view\">The view to remove.</param>\n    public void Remove(object view)\n    {\n        if (view is not VisualElement visualElement)\n        {\n            throw new Exception(\"The view must inherit from VisualElement.\");\n        }\n\n        var itemMetadata = GetItemMetadataOrThrow(view);\n\n        ItemMetadataCollection.Remove(itemMetadata);\n\n        if (Xaml.RegionManager.GetRegionManager(visualElement) == RegionManager)\n        {\n            visualElement.ClearValue(Xaml.RegionManager.RegionManagerProperty);\n        }\n    }\n\n    /// <summary>\n    /// Removes all views from the region.\n    /// </summary>\n    public void RemoveAll()\n    {\n        foreach (var view in Views)\n        {\n            Remove(view);\n        }\n    }\n\n    private ItemMetadata GetItemMetadataOrThrow(object view)\n    {\n        if (view == null)\n            throw new ArgumentNullException(nameof(view));\n\n        var itemMetadata = ItemMetadataCollection.FirstOrDefault(x => x.Item == view);\n\n        if (itemMetadata == null)\n            throw new ArgumentException(Resources.ViewNotInRegionException, nameof(view));\n\n        return itemMetadata;\n    }\n\n    internal static int DefaultSortComparison(object x, object y)\n    {\n        if (x == null)\n        {\n            if (y == null)\n            {\n                return 0;\n            }\n            else\n            {\n                return -1;\n            }\n        }\n        else\n        {\n            if (y == null)\n            {\n                return 1;\n            }\n            else\n            {\n                Type xType = x.GetType();\n                Type yType = y.GetType();\n\n                ViewSortHintAttribute xAttribute = xType.GetCustomAttributes(typeof(ViewSortHintAttribute), true).FirstOrDefault() as ViewSortHintAttribute;\n                ViewSortHintAttribute yAttribute = yType.GetCustomAttributes(typeof(ViewSortHintAttribute), true).FirstOrDefault() as ViewSortHintAttribute;\n\n                return ViewSortHintAttributeComparison(xAttribute, yAttribute);\n            }\n        }\n    }\n\n    private static int ViewSortHintAttributeComparison(ViewSortHintAttribute x, ViewSortHintAttribute y)\n    {\n        if (x == null)\n        {\n            if (y == null)\n            {\n                return 0;\n            }\n            else\n            {\n                return -1;\n            }\n        }\n        else\n        {\n            if (y == null)\n            {\n                return 1;\n            }\n            else\n            {\n                return string.Compare(x.Hint, y.Hint, StringComparison.Ordinal);\n            }\n        }\n    }\n\n    public void RequestNavigate(Uri target, Action<NavigationResult> navigationCallback, INavigationParameters navigationParameters) =>\n        NavigationService.RequestNavigate(target, navigationCallback, navigationParameters);\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Regions/RegionCollection.cs",
    "content": "﻿using System.Collections;\nusing System.Collections.Specialized;\nusing System.Globalization;\nusing Prism.Properties;\n\nnamespace Prism.Navigation.Regions;\n\ninternal class RegionCollection : IRegionCollection\n{\n    private readonly IRegionManager regionManager;\n    private readonly List<IRegion> _regions;\n\n    public RegionCollection(IRegionManager regionManager)\n    {\n        this.regionManager = regionManager;\n        _regions = new List<IRegion>();\n    }\n\n    public event NotifyCollectionChangedEventHandler CollectionChanged;\n\n    public IEnumerator<IRegion> GetEnumerator()\n    {\n        Xaml.RegionManager.UpdateRegions();\n\n        return _regions.GetEnumerator();\n    }\n\n    IEnumerator IEnumerable.GetEnumerator() =>\n        GetEnumerator();\n\n    public IRegion this[string regionName]\n    {\n        get\n        {\n            Xaml.RegionManager.UpdateRegions();\n\n            IRegion region = GetRegionByName(regionName);\n            if (region == null)\n            {\n                throw new KeyNotFoundException(string.Format(CultureInfo.CurrentUICulture, Resources.RegionNotInRegionManagerException, regionName));\n            }\n\n            return region;\n        }\n    }\n\n    public void Add(IRegion region)\n    {\n        if (region == null)\n            throw new ArgumentNullException(nameof(region));\n\n        Xaml.RegionManager.UpdateRegions();\n\n        if (region.Name == null)\n        {\n            throw new InvalidOperationException(Resources.RegionNameCannotBeEmptyException);\n        }\n\n        if (GetRegionByName(region.Name) != null)\n        {\n            throw new ArgumentException(string.Format(CultureInfo.InvariantCulture,\n                                                      Resources.RegionNameExistsException, region.Name));\n        }\n\n        _regions.Add(region);\n        region.RegionManager = regionManager;\n\n        OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, region, 0));\n    }\n\n    public bool Remove(string regionName)\n    {\n        Xaml.RegionManager.UpdateRegions();\n\n        bool removed = false;\n\n        IRegion region = GetRegionByName(regionName);\n        if (region != null)\n        {\n            removed = true;\n            _regions.Remove(region);\n            region.RegionManager = null;\n\n            OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, region, 0));\n        }\n\n        return removed;\n    }\n\n    public bool ContainsRegionWithName(string regionName)\n    {\n        Xaml.RegionManager.UpdateRegions();\n\n        return GetRegionByName(regionName) != null;\n    }\n\n    /// <summary>\n    /// Adds a region to the <see cref=\"RegionManager\"/> with the name received as argument.\n    /// </summary>\n    /// <param name=\"regionName\">The name to be given to the region.</param>\n    /// <param name=\"region\">The region to be added to the <see cref=\"RegionManager\"/>.</param>\n    /// <exception cref=\"ArgumentNullException\">Thrown if <paramref name=\"region\"/> is <see langword=\"null\"/>.</exception>\n    /// <exception cref=\"ArgumentException\">Thrown if <paramref name=\"regionName\"/> and <paramref name=\"region\"/>'s name do not match and the <paramref name=\"region\"/> <see cref=\"IRegion.Name\"/> is not <see langword=\"null\"/>.</exception>\n    public void Add(string regionName, IRegion region)\n    {\n        if (region == null)\n            throw new ArgumentNullException(nameof(region));\n\n        if (region.Name != null && region.Name != regionName)\n            throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Resources.RegionManagerWithDifferentNameException, region.Name, regionName), nameof(regionName));\n\n        if (region.Name == null)\n            region.Name = regionName;\n\n        Add(region);\n    }\n\n    private IRegion GetRegionByName(string regionName) =>\n        _regions.FirstOrDefault(r => r.Name == regionName);\n\n    private void OnCollectionChanged(NotifyCollectionChangedEventArgs notifyCollectionChangedEventArgs) =>\n        CollectionChanged?.Invoke(this, notifyCollectionChangedEventArgs);\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Regions/RegionContext.cs",
    "content": "﻿using Prism.Common;\nusing Prism.Navigation.Regions.Behaviors;\n\nnamespace Prism.Navigation.Regions;\n\n/// <summary>\n/// Class that holds methods to Set and Get the RegionContext from a BindableObject.\n///\n/// RegionContext allows sharing of contextual information between the view that's hosting a <see cref=\"IRegion\"/>\n/// and any views that are inside the Region.\n/// </summary>\npublic static class RegionContext\n{\n    private static readonly BindableProperty ObservableRegionContextProperty =\n        BindableProperty.CreateAttached(\"ObservableRegionContext\", typeof(ObservableObject<object>), typeof(RegionContext), null);\n\n    /// <summary>\n    /// Returns an <see cref=\"ObservableObject{T}\"/> wrapper around the RegionContext value. The RegionContext\n    /// will be set on any views (BindableObject's) that are inside the <see cref=\"IRegion.Views\"/> collection by\n    /// the <see cref=\"BindRegionContextToVisualElementBehavior\"/> Behavior.\n    /// The RegionContext will also be set to the control that hosts the Region, by the <see cref=\"SyncRegionContextWithHostBehavior\"/> Behavior.\n    ///\n    /// If the <see cref=\"ObservableObject{T}\"/> wrapper does not already exist, an empty one will be created. This way, an observer can\n    /// notify when the value is set for the first time.\n    /// </summary>\n    /// <param name=\"view\">Any view that hold the RegionContext value. </param>\n    /// <returns>Wrapper around the <see cref=\"RegionContext\"/> value. </returns>\n    public static ObservableObject<object> GetObservableContext(VisualElement view)\n    {\n        if (view == null)\n            throw new ArgumentNullException(nameof(view));\n\n        if (!(view.GetValue(ObservableRegionContextProperty) is ObservableObject<object> context))\n        {\n            context = new ObservableObject<object>();\n            view.SetValue(ObservableRegionContextProperty, context);\n        }\n\n        return context;\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Regions/RegionExtensions.cs",
    "content": "﻿using Prism.Ioc;\n\nnamespace Prism.Navigation.Regions;\n\ninternal static class RegionExtensions\n{\n    internal static IContainerProvider Container(this IRegion region)\n    {\n        if (region is ITargetAwareRegion car)\n            return car.Container;\n\n        throw new NotSupportedException(\"The Region does not implement IContainerAwareRegion\");\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Regions/RegionManager.cs",
    "content": "﻿using Prism.Ioc;\nusing Prism.Properties;\n\nnamespace Prism.Navigation.Regions;\n\n/// <summary>\n/// This class is responsible for maintaining a collection of regions and attaching regions to controls.\n/// </summary>\n/// <remarks>\n/// This class supplies the attached properties that can be used for simple region creation from XAML.\n/// </remarks>\npublic partial class RegionManager : IRegionManager\n{\n    /// <summary>\n    /// Initializes a new instance of <see cref=\"RegionManager\"/>.\n    /// </summary>\n    public RegionManager()\n    {\n        Regions = new RegionCollection(this);\n    }\n\n    /// <summary>\n    /// Gets a collection of <see cref=\"IRegion\"/> that identify each region by name. You can use this collection to add or remove regions to the current region manager.\n    /// </summary>\n    /// <value>A <see cref=\"IRegionCollection\"/> with all the registered regions.</value>\n    public IRegionCollection Regions { get; }\n\n    /// <summary>\n    /// Add a view to the Views collection of a Region. Note that the region must already exist in this <see cref=\"IRegionManager\"/>.\n    /// </summary>\n    /// <param name=\"regionName\">The name of the region to add a view to</param>\n    /// <param name=\"targetName\">The view to add to the views collection</param>\n    /// <returns>The RegionManager, to easily add several views. </returns>\n    public IRegionManager AddToRegion(string regionName, string targetName)\n    {\n        if (!Regions.ContainsRegionWithName(regionName))\n            throw new ArgumentException(string.Format(Thread.CurrentThread.CurrentCulture, Resources.RegionNotFound, regionName), nameof(regionName));\n\n        var region = Regions[regionName];\n        return region.Add(targetName);\n    }\n\n    /// <summary>\n    ///     Add a view to the Views collection of a Region. Note that the region must already exist in this <see cref=\"IRegionManager\"/>.\n    /// </summary>\n    /// <param name=\"regionName\">The name of the region to add a view to</param>\n    /// <param name=\"view\">The view to add to the views collection</param>\n    /// <returns>The RegionManager, to easily add several views. </returns>\n    public IRegionManager AddToRegion(string regionName, object view)\n    {\n        if (!Regions.ContainsRegionWithName(regionName))\n            throw new ArgumentException(string.Format(Thread.CurrentThread.CurrentCulture, Resources.RegionNotFound, regionName), nameof(regionName));\n\n        return Regions[regionName].Add(view);\n    }\n\n    /// <summary>\n    /// Creates a new region manager.\n    /// </summary>\n    /// <returns>A new region manager that can be used as a different scope from the current region manager.</returns>\n    public IRegionManager CreateRegionManager() =>\n        new RegionManager();\n\n    /// <summary>\n    /// Associate a view with a region, by registering a type. When the region get's displayed\n    /// this type will be resolved using the ServiceLocator into a concrete instance. The instance\n    /// will be added to the Views collection of the region\n    /// </summary>\n    /// <param name=\"regionName\">The name of the region to associate the view with.</param>\n    /// <param name=\"viewType\">The type of the view to register with the </param>\n    /// <returns>The <see cref=\"IRegionManager\"/>, for adding several views easily</returns>\n    public IRegionManager RegisterViewWithRegion(string regionName, Type viewType)\n    {\n        var regionViewRegistry = ContainerLocator.Container.Resolve<IRegionViewRegistry>();\n        regionViewRegistry.RegisterViewWithRegion(regionName, viewType);\n        return this;\n    }\n\n    /// <summary>\n    /// Associate a view with a region, by registering a type. When the region get's displayed\n    /// this type will be resolved using the ServiceLocator into a concrete instance. The instance\n    /// will be added to the Views collection of the region\n    /// </summary>\n    /// <param name=\"regionName\">The name of the region to associate the view with.</param>\n    /// <param name=\"targetName\">The type of the view to register with the </param>\n    /// <returns>The <see cref=\"IRegionManager\"/>, for adding several views easily</returns>\n    public IRegionManager RegisterViewWithRegion(string regionName, string targetName)\n    {\n        var regionViewRegistry = ContainerLocator.Container.Resolve<IRegionViewRegistry>();\n        regionViewRegistry.RegisterViewWithRegion(regionName, targetName);\n        return this;\n    }\n\n    /// <summary>\n    /// Associate a view with a region, using a delegate to resolve a concrete instance of the view.\n    /// When the region get's displayed, this delegate will be called and the result will be added to the\n    /// views collection of the region.\n    /// </summary>\n    /// <param name=\"regionName\">The name of the region to associate the view with.</param>\n    /// <param name=\"getContentDelegate\">The delegate used to resolve a concrete instance of the view.</param>\n    /// <returns>The <see cref=\"IRegionManager\"/>, for adding several views easily</returns>\n    public IRegionManager RegisterViewWithRegion(string regionName, Func<IContainerProvider, object> getContentDelegate)\n    {\n        var regionViewRegistry = ContainerLocator.Container.Resolve<IRegionViewRegistry>();\n\n        regionViewRegistry.RegisterViewWithRegion(regionName, getContentDelegate);\n\n        return this;\n    }\n\n    /// <summary>\n    /// Navigates the specified region manager.\n    /// </summary>\n    /// <param name=\"regionName\">The name of the region to call Navigate on.</param>\n    /// <param name=\"target\">The URI of the content to display.</param>\n    /// <param name=\"navigationCallback\">The navigation callback.</param>\n    public void RequestNavigate(string regionName, Uri target, Action<NavigationResult> navigationCallback) =>\n        RequestNavigate(regionName, target, navigationCallback, null);\n\n    /// <summary>\n    /// This method allows an <see cref=\"IRegionManager\"/> to locate a specified region and navigate in it to the specified target <see cref=\"Uri\"/>, passing a navigation callback and an instance of <see cref=\"INavigationParameters\"/>, which holds a collection of object parameters.\n    /// </summary>\n    /// <param name=\"regionName\">The name of the region where the navigation will occur.</param>\n    /// <param name=\"target\">A <see cref=\"Uri\"/> that represents the target where the region will navigate.</param>\n    /// <param name=\"navigationCallback\">The navigation callback that will be executed after the navigation is completed.</param>\n    /// <param name=\"navigationParameters\">An instance of <see cref=\"INavigationParameters\"/>, which holds a collection of object parameters.</param>\n    public void RequestNavigate(string regionName, Uri target, Action<NavigationResult> navigationCallback, INavigationParameters navigationParameters)\n    {\n        try\n        {\n            if (string.IsNullOrEmpty(regionName))\n                throw new ArgumentNullException(nameof(regionName));\n\n            var region = Regions[regionName];\n\n            if (region is null)\n                throw new Exception(\"Region not Found\");\n\n            region.NavigationService.RequestNavigate(target, navigationCallback, navigationParameters);\n        }\n        catch (Exception ex)\n        {\n            var navigationContext = new NavigationContext(null, target, navigationParameters);\n            navigationCallback?.Invoke(new NavigationResult(navigationContext, ex));\n        }\n    }\n\n    ///// <summary>\n    ///// Provides a new item for the region based on the supplied candidate target contract name.\n    ///// </summary>\n    ///// <param name=\"candidateTargetContract\">The target contract to build.</param>\n    ///// <returns>An instance of an item to put into the <see cref=\"IRegion\"/>.</returns>\n    //protected virtual VisualElement CreateNewRegionItem(string candidateTargetContract)\n    //{\n    //    try\n    //    {\n    //        var view = ContainerLocator.Container.Resolve<object>(candidateTargetContract) as VisualElement;\n\n    //        MvvmHelpers.SetAutowireViewModel(view);\n\n    //        return view;\n    //    }\n    //    catch (ContainerResolutionException)\n    //    {\n    //        throw;\n    //    }\n    //    catch (Exception e)\n    //    {\n    //        throw new InvalidOperationException(\n    //            string.Format(CultureInfo.CurrentCulture, Resources.CannotCreateNavigationTarget, candidateTargetContract),\n    //            e);\n    //    }\n    //}\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Regions/RegionNavigationRegistry.cs",
    "content": "﻿using Prism.Ioc;\nusing Prism.Mvvm;\n\nnamespace Prism.Navigation.Regions;\n\ninternal class RegionNavigationRegistry : ViewRegistryBase, IRegionNavigationRegistry\n{\n    public RegionNavigationRegistry(IEnumerable<ViewRegistration> registrations)\n        : base(ViewType.Region, registrations)\n    {\n    }\n\n    protected override void ConfigureView(BindableObject bindable, IContainerProvider container)\n    {\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Regions/RegionViewRegistry.cs",
    "content": "﻿using System.Globalization;\nusing System.Reflection;\nusing Prism.Common;\nusing Prism.Events;\nusing Prism.Ioc;\nusing Prism.Mvvm;\nusing Prism.Properties;\n\nnamespace Prism.Navigation.Regions;\n\n/// <summary>\n/// Defines a registry for the content of the regions used on View Discovery composition.\n/// </summary>\npublic class RegionViewRegistry : IRegionViewRegistry\n{\n    private readonly ListDictionary<string, Func<IContainerProvider, object>> _registeredContent = new();\n    private readonly WeakDelegatesManager _contentRegisteredListeners = new();\n\n    /// <summary>\n    /// Occurs whenever a new view is registered.\n    /// </summary>\n    public event EventHandler<ViewRegisteredEventArgs> ContentRegistered\n    {\n        add => _contentRegisteredListeners.AddListener(value);\n        remove => _contentRegisteredListeners.RemoveListener(value);\n    }\n\n    /// <summary>\n    /// Returns the contents registered for a region.\n    /// </summary>\n    /// <param name=\"container\">The <see cref=\"IContainerProvider\"/> to use.</param>\n    /// <param name=\"regionName\">Name of the region which content is being requested.</param>\n    /// <returns>Collection of contents registered for the region.</returns>\n    public IEnumerable<object> GetContents(string regionName, IContainerProvider container)\n    {\n        var items = new List<object>();\n        foreach (var getContentDelegate in _registeredContent[regionName])\n        {\n            items.Add(getContentDelegate(container));\n        }\n\n        return items;\n    }\n\n    /// <summary>\n    /// Registers a content type with a region name.\n    /// </summary>\n    /// <param name=\"regionName\">Region name to which the <paramref name=\"viewType\"/> will be registered.</param>\n    /// <param name=\"viewType\">Content type to be registered for the <paramref name=\"regionName\"/>.</param>\n    public void RegisterViewWithRegion(string regionName, Type viewType)\n    {\n        RegisterViewWithRegion(regionName, c =>\n        {\n            var registry = c.Resolve<IRegionNavigationRegistry>();\n            var registration = registry.Registrations.FirstOrDefault(x => x.Type == ViewType.Region && x.View == viewType);\n            if (registration is null)\n                throw new KeyNotFoundException($\"No registration found for the Region View '{viewType.FullName}'.\");\n\n            return registry.CreateView(c, registration.Name);\n        });\n    }\n\n    /// <summary>\n    /// Registers a content type with a region name.\n    /// </summary>\n    /// <param name=\"regionName\">Region name to which the <paramref name=\"targetName\"/> will be registered.</param>\n    /// <param name=\"targetName\">Content type to be registered for the <paramref name=\"regionName\"/>.</param>\n    public void RegisterViewWithRegion(string regionName, string targetName)\n    {\n        RegisterViewWithRegion(regionName, c =>\n        {\n            var registry = c.Resolve<IRegionNavigationRegistry>();\n            return registry.CreateView(c, targetName);\n        });\n    }\n\n    /// <summary>\n    /// Registers a delegate that can be used to retrieve the content associated with a region name.\n    /// </summary>\n    /// <param name=\"regionName\">Region name to which the <paramref name=\"getContentDelegate\"/> will be registered.</param>\n    /// <param name=\"getContentDelegate\">Delegate used to retrieve the content associated with the <paramref name=\"regionName\"/>.</param>\n    public void RegisterViewWithRegion(string regionName, Func<IContainerProvider, object> getContentDelegate)\n    {\n        _registeredContent.Add(regionName, getContentDelegate);\n        OnContentRegistered(new ViewRegisteredEventArgs(regionName, getContentDelegate));\n    }\n\n    private void OnContentRegistered(ViewRegisteredEventArgs e)\n    {\n        try\n        {\n            _contentRegisteredListeners.Raise(this, e);\n        }\n        catch (TargetInvocationException ex)\n        {\n            Exception rootException;\n            if (ex.InnerException != null)\n            {\n                rootException = ex.InnerException.GetRootException();\n            }\n            else\n            {\n                rootException = ex.GetRootException();\n            }\n\n            throw new ViewRegistrationException(string.Format(CultureInfo.CurrentCulture,\n                Resources.OnViewRegisteredException, e.RegionName, rootException), ex.InnerException);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Regions/SingleActiveRegion.cs",
    "content": "﻿namespace Prism.Navigation.Regions;\n\n/// <summary>\n/// Region that allows a maximum of one active view at a time.\n/// </summary>\npublic class SingleActiveRegion : Region\n{\n    /// <summary>\n    /// Creates a new <see cref=\"SingleActiveRegion\"/>.\n    /// </summary>\n    /// <param name=\"regionNavigationService\"></param>\n    public SingleActiveRegion(IRegionNavigationService regionNavigationService)\n        : base(regionNavigationService)\n    {\n    }\n\n    /// <summary>\n    /// Marks the specified view as active.\n    /// </summary>\n    /// <param name=\"view\">The view to activate.</param>\n    /// <remarks>If there is an active view before calling this method,\n    /// that view will be deactivated automatically.</remarks>\n    public override void Activate(object view)\n    {\n        var currentActiveView = ActiveViews.FirstOrDefault();\n\n        if (currentActiveView != null && currentActiveView != view && Views.Contains(currentActiveView))\n        {\n            base.Deactivate(currentActiveView);\n        }\n\n        base.Activate(view);\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Regions/ViewsCollection.cs",
    "content": "﻿using System.Collections;\nusing System.Collections.ObjectModel;\nusing System.Collections.Specialized;\nusing Prism.Mvvm;\n\nnamespace Prism.Navigation.Regions;\n\n/// <summary>\n/// Implementation of <see cref=\"IViewsCollection\"/> that takes an <see cref=\"ObservableCollection{T}\"/> of <see cref=\"ItemMetadata\"/>\n/// and filters it to display an <see cref=\"INotifyCollectionChanged\"/> collection of\n/// <see cref=\"object\"/> elements (the items which the <see cref=\"ItemMetadata\"/> wraps).\n/// </summary>\npublic class ViewsCollection : BindableBase, IViewsCollection\n{\n    private readonly ObservableCollection<ItemMetadata> _subjectCollection;\n\n    private readonly Dictionary<ItemMetadata, MonitorInfo> _monitoredItems = new Dictionary<ItemMetadata, MonitorInfo>();\n    private Comparison<object> _sort;\n    private List<VisualElement> filteredItems = new List<VisualElement>();\n\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"ViewsCollection\"/> class.\n    /// </summary>\n    /// <param name=\"list\">The list to wrap and filter.</param>\n    /// <param name=\"filter\">A predicate to filter the <paramref name=\"list\"/> collection.</param>\n    public ViewsCollection(ObservableCollection<ItemMetadata> list, Predicate<ItemMetadata> filter)\n    {\n        _subjectCollection = list;\n        Filter = filter;\n        MonitorAllMetadataItems();\n        _subjectCollection.CollectionChanged += SourceCollectionChanged;\n        UpdateFilteredItemsList();\n    }\n\n    /// <summary>\n    /// Occurs when the collection changes.\n    /// </summary>\n    public event NotifyCollectionChangedEventHandler CollectionChanged;\n\n    /// <summary>\n    /// Gets or sets the comparison used to sort the views.\n    /// </summary>\n    /// <value>The comparison to use.</value>\n    public Comparison<object> SortComparison\n    {\n        get => _sort;\n        set => SetProperty(ref _sort, value, () =>\n        {\n            UpdateFilteredItemsList();\n            OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));\n        });\n    }\n\n    /// <summary>\n    /// Gets the Predicate filter\n    /// </summary>\n    public Predicate<ItemMetadata> Filter { get; }\n\n    /// <summary>\n    /// Determines whether the collection contains a specific value.\n    /// </summary>\n    /// <param name=\"value\">The object to locate in the collection.</param>\n    /// <returns><see langword=\"true\" /> if <paramref name=\"value\"/> is found in the collection; otherwise, <see langword=\"false\" />.</returns>\n    public bool Contains(object value) => filteredItems.Contains(value);\n\n    ///<summary>\n    ///Returns an enumerator that iterates through the collection.\n    ///</summary>\n    ///<returns>\n    ///A <see cref=\"T:System.Collections.Generic.IEnumerator`1\" /> that can be used to iterate through the collection.\n    ///</returns>\n    public IEnumerator<object> GetEnumerator() => filteredItems.GetEnumerator();\n\n    ///<summary>\n    ///Returns an enumerator that iterates through a collection.\n    ///</summary>\n    ///<returns>\n    ///An <see cref=\"T:System.Collections.IEnumerator\" /> object that can be used to iterate through the collection.\n    ///</returns>\n    IEnumerator IEnumerable.GetEnumerator()\n    {\n        return GetEnumerator();\n    }\n\n    /// <summary>\n    /// Used to invoked the <see cref=\"CollectionChanged\"/> event.\n    /// </summary>\n    /// <param name=\"e\"></param>\n    private void OnCollectionChanged(NotifyCollectionChangedEventArgs e)\n    {\n        CollectionChanged?.Invoke(this, e);\n    }\n\n    private void NotifyReset()\n    {\n        OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));\n    }\n\n    /// <summary>\n    /// Removes all monitoring of underlying MetadataItems and re-adds them.\n    /// </summary>\n    private void ResetAllMonitors()\n    {\n        RemoveAllMetadataMonitors();\n        MonitorAllMetadataItems();\n    }\n\n    /// <summary>\n    /// Adds all underlying MetadataItems to the list from the subjectCollection\n    /// </summary>\n    private void MonitorAllMetadataItems()\n    {\n        foreach (var item in _subjectCollection)\n        {\n            AddMetadataMonitor(item, Filter(item));\n        }\n    }\n\n    /// <summary>\n    /// Removes all monitored items from our monitoring list.\n    /// </summary>\n    private void RemoveAllMetadataMonitors()\n    {\n        foreach (var item in _monitoredItems)\n        {\n            item.Key.MetadataChanged -= OnItemMetadataChanged;\n        }\n\n        _monitoredItems.Clear();\n    }\n\n    /// <summary>\n    /// Adds handler to monitor the MetadataItem and adds it to our monitoring list.\n    /// </summary>\n    /// <param name=\"itemMetadata\"></param>\n    /// <param name=\"isInList\"></param>\n    private void AddMetadataMonitor(ItemMetadata itemMetadata, bool isInList)\n    {\n        itemMetadata.MetadataChanged += OnItemMetadataChanged;\n        _monitoredItems.Add(\n            itemMetadata,\n            new MonitorInfo\n            {\n                IsInList = isInList\n            });\n    }\n\n    /// <summary>\n    /// Unhooks from the MetadataItem change event and removes from our monitoring list.\n    /// </summary>\n    /// <param name=\"itemMetadata\"></param>\n    private void RemoveMetadataMonitor(ItemMetadata itemMetadata)\n    {\n        itemMetadata.MetadataChanged -= OnItemMetadataChanged;\n        _monitoredItems.Remove(itemMetadata);\n    }\n\n    /// <summary>\n    /// Invoked when any of the underlying ItemMetadata items we're monitoring changes.\n    /// </summary>\n    /// <param name=\"sender\"></param>\n    /// <param name=\"e\"></param>\n    private void OnItemMetadataChanged(object sender, EventArgs e)\n    {\n        ItemMetadata itemMetadata = (ItemMetadata)sender;\n\n        // Our monitored item may have been removed during another event before\n        // our OnItemMetadataChanged got called back, so it's not unexpected\n        // that we may not have it in our list.\n        bool foundInfo = _monitoredItems.TryGetValue(itemMetadata, out MonitorInfo monitorInfo);\n        if (!foundInfo) return;\n\n        if (Filter(itemMetadata))\n        {\n            if (!monitorInfo.IsInList)\n            {\n                // This passes our filter and wasn't marked\n                // as in our list so we can consider this\n                // an Add.\n                monitorInfo.IsInList = true;\n                UpdateFilteredItemsList();\n                NotifyAdd(itemMetadata.Item);\n            }\n        }\n        else\n        {\n            // This doesn't fit our filter, we remove from our\n            // tracking list, but should not remove any monitoring in\n            // case it fits our filter in the future.\n            monitorInfo.IsInList = false;\n            RemoveFromFilteredList(itemMetadata.Item);\n        }\n    }\n\n    /// <summary>\n    /// The event handler due to changes in the underlying collection.\n    /// </summary>\n    /// <param name=\"sender\"></param>\n    /// <param name=\"e\"></param>\n    private void SourceCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)\n    {\n        switch (e.Action)\n        {\n            case NotifyCollectionChangedAction.Add:\n                UpdateFilteredItemsList();\n                foreach (ItemMetadata itemMetadata in e.NewItems)\n                {\n                    bool isInFilter = Filter(itemMetadata);\n                    AddMetadataMonitor(itemMetadata, isInFilter);\n                    if (isInFilter)\n                    {\n                        NotifyAdd(itemMetadata.Item);\n                    }\n                }\n\n                // If we're sorting we can't predict how\n                // the collection has changed on an add so we\n                // resort to a reset notification.\n                if (SortComparison != null)\n                {\n                    NotifyReset();\n                }\n\n                break;\n\n            case NotifyCollectionChangedAction.Remove:\n                foreach (ItemMetadata itemMetadata in e.OldItems)\n                {\n                    RemoveMetadataMonitor(itemMetadata);\n                    if (Filter(itemMetadata))\n                    {\n                        RemoveFromFilteredList(itemMetadata.Item);\n                    }\n                }\n\n                break;\n\n            default:\n                ResetAllMonitors();\n                UpdateFilteredItemsList();\n                NotifyReset();\n\n                break;\n        }\n    }\n\n    private void NotifyAdd(VisualElement item)\n    {\n        int newIndex = filteredItems.IndexOf(item);\n        NotifyAdd(new[] { item }, newIndex);\n    }\n\n    private void RemoveFromFilteredList(VisualElement item)\n    {\n        int index = filteredItems.IndexOf(item);\n        UpdateFilteredItemsList();\n        NotifyRemove(new[] { item }, index);\n    }\n\n    private void UpdateFilteredItemsList()\n    {\n        filteredItems = _subjectCollection.Where(i => Filter(i)).Select(i => i.Item)\n            .OrderBy(o => o, new RegionItemComparer(SortComparison)).ToList();\n    }\n\n    private class MonitorInfo\n    {\n        public bool IsInList { get; set; }\n    }\n\n    private class RegionItemComparer : Comparer<VisualElement>\n    {\n        private readonly Comparison<VisualElement> comparer;\n\n        public RegionItemComparer(Comparison<VisualElement> comparer)\n        {\n            this.comparer = comparer;\n        }\n\n        public override int Compare(VisualElement x, VisualElement y)\n        {\n            if (comparer == null)\n            {\n                return 0;\n            }\n\n            return comparer(x, y);\n        }\n    }\n\n    private void NotifyAdd(IList items, int newStartingIndex)\n    {\n        if (items.Count > 0)\n        {\n            OnCollectionChanged(new NotifyCollectionChangedEventArgs(\n                                        NotifyCollectionChangedAction.Add,\n                                        items,\n                                        newStartingIndex));\n        }\n    }\n\n    private void NotifyRemove(IList items, int originalIndex)\n    {\n        if (items.Count > 0)\n        {\n            OnCollectionChanged(new NotifyCollectionChangedEventArgs(\n                NotifyCollectionChangedAction.Remove,\n                items,\n                originalIndex));\n        }\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Regions/Xaml/RegionManager.cs",
    "content": "using System.Globalization;\nusing System.Reflection;\nusing Prism.Common;\nusing Prism.Events;\nusing Prism.Ioc;\nusing Prism.Navigation.Regions.Adapters;\nusing Prism.Navigation.Regions.Behaviors;\nusing Prism.Properties;\n\nnamespace Prism.Navigation.Regions.Xaml;\n\n/// <summary>\n/// A class to provide Bindable Properties and helpers for Regions.\n/// </summary>\npublic static class RegionManager\n{\n    private static readonly WeakDelegatesManager updatingRegionsListeners = new ();\n\n    private static readonly BindableProperty ObservableRegionProperty =\n        BindableProperty.CreateAttached(\"ObservableRegion\", typeof(ObservableObject<IRegion>), typeof(RegionManager), null);\n\n    /// <summary>\n    /// Identifies the RegionManager attached property.\n    /// </summary>\n    /// <remarks>\n    /// When a control has both the <see cref=\"RegionNameProperty\"/> and\n    /// <see cref=\"RegionManagerProperty\"/> attached properties set to\n    /// a value different than <see langword=\"null\" /> and there is a\n    /// <see cref=\"IRegionAdapter\"/> mapping registered for the control, it\n    /// will create and adapt a new region for that control, and register it\n    /// in the <see cref=\"IRegionManager\"/> with the specified region name.\n    /// </remarks>\n    public static readonly BindableProperty RegionManagerProperty =\n        BindableProperty.CreateAttached(\"RegionManager\", typeof(IRegionManager), typeof(RegionManager), null);\n\n    /// <summary>\n    /// Identifies the RegionName attached property.\n    /// </summary>\n    /// <remarks>\n    /// When a control has both the <see cref=\"RegionNameProperty\"/> and\n    /// <see cref=\"RegionManagerProperty\"/> attached properties set to\n    /// a value different than <see langword=\"null\" /> and there is a\n    /// <see cref=\"IRegionAdapter\"/> mapping registered for the control, it\n    /// will create and adapt a new region for that control, and register it\n    /// in the <see cref=\"IRegionManager\"/> with the specified region name.\n    /// </remarks>\n    public static readonly BindableProperty RegionNameProperty =\n        BindableProperty.CreateAttached(\"RegionName\", typeof(string), typeof(RegionManager), null, propertyChanged: OnSetRegionNameCallback);\n\n    /// <summary>\n    /// Identifies the RegionContext attached property.\n    /// </summary>\n    public static readonly BindableProperty RegionContextProperty =\n        BindableProperty.CreateAttached(\"RegionContext\", typeof(object), typeof(RegionManager), null, propertyChanged: OnRegionContextChanged);\n\n    /// <summary>\n    /// Sets the default view to be displayed in a region when it is created.\n    /// </summary>\n    public static readonly BindableProperty DefaultViewProperty =\n        BindableProperty.CreateAttached(\"DefaultView\", typeof(object), typeof(RegionManager), null);\n\n    /// <summary>\n    /// Sets the <see cref=\"DefaultViewProperty\"/> attached property for the specified region target.\n    /// </summary>\n    /// <param name=\"regionTarget\">The <see cref=\"VisualElement\"/> that will host the default view.</param>\n    /// <param name=\"viewNameTypeOrInstance\">\n    /// The default view to display in the region. This can be a view name, a type, or an instance of the view.\n    /// </param>\n    public static void SetDefaultView(VisualElement regionTarget, object viewNameTypeOrInstance) =>\n        regionTarget.SetValue(DefaultViewProperty, viewNameTypeOrInstance);\n\n    /// <summary>\n    /// Gets the value of the <see cref=\"DefaultViewProperty\"/> attached property for the specified region target.\n    /// </summary>\n    /// <param name=\"regionTarget\">The <see cref=\"VisualElement\"/> that hosts the default view.</param>\n    /// <returns>\n    /// The default view associated with the region. This can be a view name, a type, or an instance of the view.\n    /// </returns>\n    public static object GetDefaultView(VisualElement regionTarget) =>\n        regionTarget.GetValue(DefaultViewProperty);\n\n    /// <summary>\n    /// Sets the <see cref=\"RegionNameProperty\"/> attached property.\n    /// </summary>\n    /// <param name=\"regionTarget\">The object to adapt. This is typically a container (i.e a control).</param>\n    /// <param name=\"regionName\">The name of the region to register.</param>\n    public static void SetRegionName(VisualElement regionTarget, string regionName)\n    {\n        if (regionTarget == null)\n            throw new ArgumentNullException(nameof(regionTarget));\n\n        regionTarget.SetValue(RegionNameProperty, regionName);\n    }\n\n    /// <summary>\n    /// Gets the value for the <see cref=\"RegionNameProperty\"/> attached property.\n    /// </summary>\n    /// <param name=\"regionTarget\">The object to adapt. This is typically a container (i.e a control).</param>\n    /// <returns>The name of the region that should be created when\n    /// <see cref=\"RegionManagerProperty\"/> is also set in this element.</returns>\n    public static string GetRegionName(VisualElement regionTarget)\n    {\n        if (regionTarget == null)\n            throw new ArgumentNullException(nameof(regionTarget));\n\n        return regionTarget.GetValue(RegionNameProperty) as string;\n    }\n\n    /// <summary>\n    /// Returns an <see cref=\"ObservableObject{T}\"/> wrapper that can hold an <see cref=\"IRegion\"/>. Using this wrapper\n    /// you can detect when an <see cref=\"IRegion\"/> has been created by the <see cref=\"RegionAdapterBase{T}\"/>.\n    ///\n    /// If the <see cref=\"ObservableObject{T}\"/> wrapper does not yet exist, a new wrapper will be created. When the region\n    /// gets created and assigned to the wrapper, you can use the <see cref=\"ObservableObject{T}\"/> event\n    /// to get notified of that change.\n    /// </summary>\n    /// <param name=\"view\">The view that will host the region. </param>\n    /// <returns>Wrapper that can hold an <see cref=\"IRegion\"/> value and can notify when the <see cref=\"IRegion\"/> value changes. </returns>\n    public static ObservableObject<IRegion> GetObservableRegion(VisualElement view)\n    {\n        if (view is null) throw new ArgumentNullException(nameof(view));\n\n        if (view.GetValue(ObservableRegionProperty) is not ObservableObject<IRegion> regionWrapper)\n        {\n            regionWrapper = new ObservableObject<IRegion>();\n            view.SetValue(ObservableRegionProperty, regionWrapper);\n        }\n\n        return regionWrapper;\n    }\n\n    private static void OnSetRegionNameCallback(BindableObject bindable, object oldValue, object newValue)\n    {\n        if (DesignMode.IsDesignModeEnabled || newValue is null || bindable is not VisualElement view)\n            return;\n\n        CreateRegion(view);\n    }\n\n    private static void CreateRegion(VisualElement element)\n    {\n        var regionCreationBehavior = ContainerLocator.Container.Resolve<DelayedRegionCreationBehavior>();\n        regionCreationBehavior.TargetElement = element;\n        regionCreationBehavior.Attach();\n    }\n\n    /// <summary>\n    /// Gets the value of the <see cref=\"RegionNameProperty\"/> attached property.\n    /// </summary>\n    /// <param name=\"target\">The target element.</param>\n    /// <returns>The <see cref=\"IRegionManager\"/> attached to the <paramref name=\"target\"/> element.</returns>\n    public static IRegionManager GetRegionManager(VisualElement target)\n    {\n        if (target == null)\n            throw new ArgumentNullException(nameof(target));\n\n        return (IRegionManager)target.GetValue(RegionManagerProperty);\n    }\n\n    /// <summary>\n    /// Sets the <see cref=\"RegionManagerProperty\"/> attached property.\n    /// </summary>\n    /// <param name=\"target\">The target element.</param>\n    /// <param name=\"value\">The value.</param>\n    public static void SetRegionManager(VisualElement target, IRegionManager value)\n    {\n        if (target == null)\n            throw new ArgumentNullException(nameof(target));\n\n        target.SetValue(RegionManagerProperty, value);\n    }\n\n    private static void OnRegionContextChanged(BindableObject bindable, object oldValue, object newValue)\n    {\n        if (oldValue != newValue && bindable is VisualElement view)\n        {\n            RegionContext.GetObservableContext(view).Value = newValue;\n        }\n    }\n\n    /// <summary>\n    /// Gets the value of the <see cref=\"RegionContextProperty\"/> attached property.\n    /// </summary>\n    /// <param name=\"target\">The target element.</param>\n    /// <returns>The region context to pass to the contained views.</returns>\n    public static object GetRegionContext(VisualElement target)\n    {\n        if (target == null)\n            throw new ArgumentNullException(nameof(target));\n\n        return target.GetValue(RegionContextProperty);\n    }\n\n    /// <summary>\n    /// Sets the <see cref=\"RegionContextProperty\"/> attached property.\n    /// </summary>\n    /// <param name=\"target\">The target element.</param>\n    /// <param name=\"value\">The value.</param>\n    public static void SetRegionContext(VisualElement target, object value)\n    {\n        if (target == null)\n            throw new ArgumentNullException(nameof(target));\n\n        target.SetValue(RegionContextProperty, value);\n    }\n\n    /// <summary>\n    /// Notification used by attached behaviors to update the region managers appropriately if needed to.\n    /// </summary>\n    /// <remarks>This event uses weak references to the event handler to prevent this static event of keeping the\n    /// target element longer than expected.</remarks>\n    public static event EventHandler UpdatingRegions\n    {\n        add => updatingRegionsListeners.AddListener(value);\n        remove => updatingRegionsListeners.RemoveListener(value);\n    }\n\n    /// <summary>\n    /// Notifies attached behaviors to update the region managers appropriately if needed to.\n    /// </summary>\n    /// <remarks>\n    /// This method is normally called internally, and there is usually no need to call this from user code.\n    /// </remarks>\n    public static void UpdateRegions()\n    {\n        try\n        {\n            updatingRegionsListeners.Raise(null, EventArgs.Empty);\n        }\n        catch (TargetInvocationException ex)\n        {\n            Exception rootException = ex.GetRootException();\n\n            throw new UpdateRegionsException(string.Format(CultureInfo.CurrentCulture,\n                Resources.UpdateRegionException, rootException), ex.InnerException);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Xaml/GoBackExtension.cs",
    "content": "\nnamespace Prism.Navigation.Xaml;\n\n[ContentProperty(nameof(GoBackType))]\n[RequireService([typeof(IProvideValueTarget)])]\npublic partial class GoBackExtension : NavigationExtensionBase\n{\n    public static readonly BindableProperty GoBackTypeProperty =\n        BindableProperty.Create(nameof(GoBackType), typeof(GoBackType), typeof(GoBackExtension), GoBackType.Default);\n\n    public GoBackType GoBackType\n    {\n        get => (GoBackType)GetValue(GoBackTypeProperty);\n        set => SetValue(GoBackTypeProperty, value);\n    }\n\n    protected override async Task HandleNavigation(INavigationParameters parameters, INavigationService navigationService)\n    {\n        if (GoBackType != GoBackType.ToRoot)\n        {\n            AddKnownNavigationParameters(parameters);\n        }\n\n        var result = GoBackType == GoBackType.ToRoot ?\n                await navigationService.GoBackToRootAsync(parameters) :\n                await navigationService.GoBackAsync(parameters);\n\n        if (result.Exception != null)\n        {\n            Log(result.Exception, parameters);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Xaml/GoBackType.cs",
    "content": "namespace Prism.Navigation.Xaml;\n\n/// <summary>\n/// Specifies the type of navigation to perform when going back in the navigation stack.\n/// </summary>\npublic enum GoBackType\n{\n    /// <summary>\n    /// Performs the default go back operation, navigating to the previous page in the stack.\n    /// </summary>\n    Default = 0,\n\n    /// <summary>\n    /// Navigates back to the root page of the navigation stack.\n    /// </summary>\n    ToRoot = 1\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Xaml/NavigateToExtension.cs",
    "content": "using Microsoft.Extensions.Logging;\n\nnamespace Prism.Navigation.Xaml;\n\n/// <summary>\n/// A markup extension that enables navigation to a specified page by name using Prism's navigation service.\n/// </summary>\n[ContentProperty(nameof(Name))]\n[RequireService([typeof(IProvideValueTarget)])]\npublic partial class NavigateToExtension : NavigationExtensionBase\n{\n    /// <summary>\n    /// Identifies the <see cref=\"Name\"/> bindable property.\n    /// </summary>\n    public static readonly BindableProperty NameProperty =\n        BindableProperty.Create(nameof(Name), typeof(string), typeof(NavigateToExtension), null);\n\n    /// <summary>\n    /// Gets or sets the name of the page to navigate to.\n    /// </summary>\n    public string Name\n    {\n        get => (string)GetValue(NameProperty);\n        set => SetValue(NameProperty, value);\n    }\n\n    /// <inheritdoc/>\n    protected override async Task HandleNavigation(INavigationParameters parameters, INavigationService navigationService)\n    {\n        AddKnownNavigationParameters(parameters);\n\n        var result = await navigationService.NavigateAsync(Name, parameters);\n        if (result.Exception != null)\n        {\n            Log(result.Exception, parameters);\n        }\n    }\n\n    /// <inheritdoc/>\n    protected override void Log(Exception ex, INavigationParameters parameters)\n    {\n        if (Logger.IsEnabled(LogLevel.Error))\n        {\n            Logger.LogError(ex, \"Navigation to {PageName} failed with parameters: {Parameters}\", Name, parameters);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Xaml/Navigation.cs",
    "content": "using System.ComponentModel;\nusing Prism.Common;\nusing Prism.Navigation.Internals;\n\nnamespace Prism.Navigation.Xaml;\n\n/// <summary>\n/// Provides Attachable properties for Navigation\n/// </summary>\npublic static class Navigation\n{\n    internal const string PrismContainerProvider = nameof(PrismContainerProvider);\n\n    private static readonly BindableProperty NavigationScopeProperty =\n        BindableProperty.CreateAttached(PrismContainerProvider,\n            typeof(IContainerProvider),\n            typeof(Navigation),\n            default(IContainerProvider),\n            propertyChanged: OnNavigationScopeChanged);\n\n    private static readonly BindableProperty ChildMvvmViewsProperty =\n        BindableProperty.CreateAttached(\"ChildRegions\",\n            typeof(ChildRegionCollection),\n            typeof(Navigation),\n            null);\n\n    private static void OnNavigationScopeChanged(BindableObject bindable, object oldValue, object newValue)\n    {\n        if (bindable is not Page page || oldValue == newValue)\n        {\n            return;\n        }\n\n        if (oldValue != null && newValue is null && oldValue is IScopedProvider oldProvider)\n        {\n            oldProvider.Dispose();\n            return;\n        }\n\n        if (newValue != null && newValue is IScopedProvider scopedProvider)\n        {\n            var accessor = scopedProvider.Resolve<IPageAccessor>();\n            if (accessor.Page is null)\n                accessor.Page = page;\n            else if (accessor.Page != page)\n                throw new InvalidOperationException($\"The Scoped Provider has already been assigned to another page. Expected: '{page.GetType().FullName}' - Found: '{accessor.Page.GetType().FullName}'.\");\n\n            scopedProvider.IsAttached = true;\n        }\n    }\n\n    /// <summary>\n    /// Provides bindable CanNavigate Bindable Property\n    /// </summary>\n    public static readonly BindableProperty CanNavigateProperty =\n        BindableProperty.CreateAttached(\"CanNavigate\",\n            typeof(bool),\n            typeof(Navigation),\n            true,\n            propertyChanged: OnCanNavigatePropertyChanged);\n\n    internal static readonly BindableProperty RaiseCanExecuteChangedInternalProperty =\n        BindableProperty.CreateAttached(\"RaiseCanExecuteChangedInternal\",\n            typeof(Action),\n            typeof(Navigation),\n            default(Action));\n\n    /// <summary>\n    /// Gets the Bindable Can Navigate property for an element\n    /// </summary>\n    /// <param name=\"view\">The bindable element</param>\n    public static bool GetCanNavigate(BindableObject view) => (bool)view.GetValue(CanNavigateProperty);\n\n    /// <summary>\n    /// Sets the Bindable Can Navigate property for an element\n    /// </summary>\n    /// <param name=\"view\">The bindable element</param>\n    /// <param name=\"value\">The Can Navigate value</param>\n    public static void SetCanNavigate(BindableObject view, bool value) => view.SetValue(CanNavigateProperty, value);\n\n    /// <summary>\n    /// Gets the Child Regions for a given <see cref=\"Page\"/>\n    /// </summary>\n    /// <param name=\"page\">The <see cref=\"Page\"/> host.</param>\n    /// <param name=\"setIfNull\">Initializes the <see cref=\"ChildRegionCollection\"/> if it has not been set.</param>\n    /// <returns>The <see cref=\"ChildRegionCollection\"/>.</returns>\n    [EditorBrowsable(EditorBrowsableState.Never)]\n    public static ChildRegionCollection GetChildRegions(this Page page, bool setIfNull = false)\n    {\n        var value = page.GetValue(ChildMvvmViewsProperty) as ChildRegionCollection;\n        if (value is null && setIfNull)\n        {\n            value = [];\n            page.SetValue(ChildMvvmViewsProperty, value);\n        }\n\n        return value;\n    }\n\n    internal static void ClearChildRegions(this Page page)\n    {\n        var children = page.GetChildRegions();\n        if(children is not null)\n        {\n            children.Dispose();\n            page.SetValue(ChildMvvmViewsProperty, null);\n        }\n    }\n\n    /// <summary>\n    /// Gets the instance of <see cref=\"INavigationService\"/> for the given <see cref=\"Page\"/>\n    /// </summary>\n    /// <param name=\"page\">The <see cref=\"Page\"/></param>\n    /// <returns>The <see cref=\"INavigationService\"/></returns>\n    /// <remarks>Do not use... this is an internal use API</remarks>\n    [EditorBrowsable(EditorBrowsableState.Never)]\n    public static INavigationService GetNavigationService(Page page)\n    {\n        ArgumentNullException.ThrowIfNull(page);\n\n        var container = page.GetContainerProvider();\n        return container.Resolve<INavigationService>();\n    }\n\n    /// <summary>\n    /// Sets the <see cref=\"IContainerProvider\"/> for the given <see cref=\"BindableObject\"/>\n    /// </summary>\n    /// <param name=\"bindable\">The <see cref=\"BindableObject\"/>.</param>\n    /// <param name=\"container\">The <see cref=\"IContainerProvider\"/>.</param>\n    [EditorBrowsable(EditorBrowsableState.Never)]\n    public static void SetContainerProvider(this BindableObject bindable, IContainerProvider container)\n    {\n        bindable.SetValue(NavigationScopeProperty, container);\n    }\n\n    /// <summary>\n    /// Gets the Container for the given View\n    /// </summary>\n    /// <param name=\"bindable\">The View</param>\n    /// <returns>The <see cref=\"IContainerProvider\"/>.</returns>\n    /// <remarks>\n    /// Will initialize a new Container Scope if the <see cref=\"Mvvm.ViewModelLocatorBehavior\"/> is Forced.\n    /// </remarks>\n    [EditorBrowsable(EditorBrowsableState.Never)]\n    public static IContainerProvider GetContainerProvider(this BindableObject bindable)\n    {\n        if (bindable is null)\n            return null;\n\n        var container = bindable.GetValue(NavigationScopeProperty) as IContainerProvider;\n        if (container is not null)\n            return container;\n        else if(bindable is Page page)\n        {\n            if (page.Parent is FlyoutPage flyout && flyout.Flyout == page)\n                return flyout.GetContainerProvider();\n\n            if (Mvvm.ViewModelLocator.GetAutowireViewModel(page) == Mvvm.ViewModelLocatorBehavior.Forced)\n            {\n                container = ContainerLocator.Container.CreateScope();\n                var accessor = container.Resolve<IPageAccessor>();\n                accessor.Page = page;\n                SetContainerProvider(page, container);\n                return container;\n            }\n        }\n        else if (bindable is Element element && element.Parent is not null)\n            return GetContainerProvider(element.Parent);\n\n        return null;\n    }\n\n    internal static Action GetRaiseCanExecuteChangedInternal(BindableObject view) => (Action)view.GetValue(RaiseCanExecuteChangedInternalProperty);\n\n    internal static void SetRaiseCanExecuteChangedInternal(BindableObject view, Action value) => view.SetValue(RaiseCanExecuteChangedInternalProperty, value);\n\n    private static void OnCanNavigatePropertyChanged(BindableObject bindable, object oldvalue, object newvalue)\n    {\n        var action = GetRaiseCanExecuteChangedInternal(bindable);\n        action?.Invoke();\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Xaml/NavigationExtensionBase.cs",
    "content": "using System.Runtime.CompilerServices;\nusing System.Windows.Input;\nusing Microsoft.Extensions.Logging;\nusing Prism.Xaml;\n\nnamespace Prism.Navigation.Xaml;\n\n/// <summary>\n/// Provides a base class for navigation extensions in XAML, implementing <see cref=\"ICommand\"/> for navigation actions.\n/// </summary>\npublic abstract class NavigationExtensionBase : TargetAwareExtensionBase<ICommand>, ICommand\n{\n    /// <summary>\n    /// Identifies the <see cref=\"Animated\"/> bindable property.\n    /// </summary>\n    public static readonly BindableProperty AnimatedProperty =\n        BindableProperty.Create(nameof(Animated), typeof(bool), typeof(NavigationExtensionBase), true);\n\n    /// <summary>\n    /// Identifies the <see cref=\"UseModalNavigation\"/> bindable property.\n    /// </summary>\n    public static readonly BindableProperty UseModalNavigationProperty =\n        BindableProperty.Create(nameof(UseModalNavigation), typeof(bool?), typeof(NavigationExtensionBase), null);\n\n    /// <summary>\n    /// Gets a value indicating whether a navigation operation is currently in progress.\n    /// </summary>\n    protected internal bool IsNavigating { get; private set; }\n\n    /// <summary>\n    /// Gets or sets a value indicating whether navigation should be animated.\n    /// </summary>\n    public bool Animated\n    {\n        get => (bool)GetValue(AnimatedProperty);\n        set => SetValue(AnimatedProperty, value);\n    }\n\n    /// <summary>\n    /// Gets or sets a value indicating whether modal navigation should be used.\n    /// </summary>\n    public bool? UseModalNavigation\n    {\n        get => (bool?)GetValue(UseModalNavigationProperty);\n        set => SetValue(UseModalNavigationProperty, value);\n    }\n\n    /// <summary>\n    /// Determines whether the command can execute in its current state.\n    /// </summary>\n    /// <param name=\"parameter\">Data used by the command. If the command does not require data, this object can be set to null.</param>\n    /// <returns>true if the command can execute; otherwise, false.</returns>\n    public bool CanExecute(object parameter) => Page is not null && !IsNavigating;\n\n    /// <inheritdoc/>\n    public event EventHandler CanExecuteChanged;\n\n    /// <summary>\n    /// Executes the navigation command.\n    /// </summary>\n    /// <param name=\"parameter\">The navigation parameters.</param>\n    public async void Execute(object parameter)\n    {\n        var parameters = parameter.ToNavigationParameters(TargetElement);\n\n        IsNavigating = true;\n        try\n        {\n            var navigationService = Navigation.GetNavigationService(Page);\n            await HandleNavigation(parameters, navigationService);\n        }\n        catch (Exception ex)\n        {\n            Log(ex, parameters);\n        }\n        finally\n        {\n            IsNavigating = false;\n        }\n    }\n\n    /// <summary>\n    /// Provides the value of the extension, which is the command itself.\n    /// </summary>\n    /// <param name=\"serviceProvider\">The service provider.</param>\n    /// <returns>The command instance.</returns>\n    protected override ICommand ProvideValue(IServiceProvider serviceProvider) =>\n        this;\n\n    /// <summary>\n    /// Logs navigation errors.\n    /// </summary>\n    /// <param name=\"ex\">The exception that occurred.</param>\n    /// <param name=\"parameters\">The navigation parameters.</param>\n    protected virtual void Log(Exception ex, INavigationParameters parameters)\n    {\n        if (Logger.IsEnabled(LogLevel.Error))\n        {\n            Logger.LogError(ex, \"Error Navigating: \\n[exception]\");\n        }\n    }\n\n    /// <summary>\n    /// Handles the navigation logic. Must be implemented by derived classes.\n    /// </summary>\n    /// <param name=\"parameters\">The navigation parameters.</param>\n    /// <param name=\"navigationService\">The navigation service.</param>\n    /// <returns>A task representing the asynchronous operation.</returns>\n    protected abstract Task HandleNavigation(INavigationParameters parameters, INavigationService navigationService);\n\n    /// <summary>\n    /// Raises the <see cref=\"CanExecuteChanged\"/> event.\n    /// </summary>\n    protected void RaiseCanExecuteChanged() => CanExecuteChanged?.Invoke(this, EventArgs.Empty);\n\n    /// <summary>\n    /// Adds known navigation parameters such as <see cref=\"KnownNavigationParameters.Animated\"/> and <see cref=\"KnownNavigationParameters.UseModalNavigation\"/> to the provided <see cref=\"INavigationParameters\"/>.\n    /// </summary>\n    /// <param name=\"parameters\">The navigation parameters to which known values will be added.</param>\n    protected void AddKnownNavigationParameters(INavigationParameters parameters)\n    {\n        parameters.Add(KnownNavigationParameters.Animated, Animated);\n\n        if (UseModalNavigation.HasValue)\n            parameters.Add(KnownNavigationParameters.UseModalNavigation, UseModalNavigation);\n    }\n\n    /// <summary>\n    /// Called when a property value changes.\n    /// </summary>\n    /// <param name=\"propertyName\">The name of the property that changed.</param>\n    protected override void OnPropertyChanged([CallerMemberName] string propertyName = null)\n    {\n        base.OnPropertyChanged(propertyName);\n        if (propertyName == nameof(Page) || propertyName == nameof(IsNavigating))\n            RaiseCanExecuteChanged();\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Xaml/TabBindingSource.cs",
    "content": "﻿namespace Prism.Navigation.Xaml;\n\npublic enum TabBindingSource\n{\n    RootPage,\n    CurrentPage\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Navigation/Xaml/TabbedPage.cs",
    "content": "namespace Prism.Navigation.Xaml;\n\n/// <summary>\n/// Provides attached properties for tabbed page navigation and appearance in .NET MAUI applications.\n/// </summary>\npublic static class TabbedPage\n{\n    /// <summary>\n    /// Identifies the <c>TitleBindingSource</c> attached property.\n    /// Determines the source for the tab title binding.\n    /// </summary>\n    public static BindableProperty TitleBindingSourceProperty =\n        BindableProperty.CreateAttached(\n            \"TitleBindingSource\",\n            typeof(TabBindingSource),\n            typeof(TabbedPage),\n            TabBindingSource.RootPage);\n\n    /// <summary>\n    /// Identifies the <c>Title</c> attached property.\n    /// Sets the title for a tab in a <see cref=\"Microsoft.Maui.Controls.TabbedPage\"/>.\n    /// </summary>\n    public static BindableProperty TitleProperty =\n        BindableProperty.CreateAttached(\n            \"Title\",\n            typeof(string),\n            typeof(TabbedPage),\n            null);\n\n    /// <summary>\n    /// Identifies the <c>IconImageSource</c> attached property.\n    /// Sets the icon image source for a tab in a <see cref=\"Microsoft.Maui.Controls.TabbedPage\"/>.\n    /// </summary>\n    public static BindableProperty IconImageSourceProperty =\n        BindableProperty.CreateAttached(\n            \"IconImageSource\",\n            typeof(ImageSource),\n            typeof(TabbedPage),\n            null);\n\n    /// <summary>\n    /// Gets the value of the <c>TitleBindingSource</c> attached property from the specified <see cref=\"Page\"/>.\n    /// </summary>\n    /// <param name=\"page\">The page from which to get the property value.</param>\n    /// <returns>The <see cref=\"TabBindingSource\"/> value.</returns>\n    public static TabBindingSource GetTitleBindingSource(Page page) =>\n        (TabBindingSource)page.GetValue(TitleBindingSourceProperty);\n\n    /// <summary>\n    /// Sets the value of the <c>TitleBindingSource</c> attached property on the specified <see cref=\"Page\"/>.\n    /// </summary>\n    /// <param name=\"page\">The page on which to set the property value.</param>\n    /// <param name=\"bindingSource\">The <see cref=\"TabBindingSource\"/> value to set.</param>\n    public static void SetTitleBindingSource(Page page, TabBindingSource bindingSource) =>\n        page.SetValue(TitleBindingSourceProperty, bindingSource);\n\n    /// <summary>\n    /// Gets the value of the <c>Title</c> attached property from the specified <see cref=\"Page\"/>.\n    /// </summary>\n    /// <param name=\"page\">The page from which to get the property value.</param>\n    /// <returns>The title string.</returns>\n    public static string GetTitle(Page page) =>\n        (string)page.GetValue(TitleProperty);\n\n    /// <summary>\n    /// Sets the value of the <c>Title</c> attached property on the specified <see cref=\"Page\"/>.\n    /// </summary>\n    /// <param name=\"page\">The page on which to set the property value.</param>\n    /// <param name=\"title\">The title string to set.</param>\n    public static void SetTitle(Page page, string title) =>\n        page.SetValue(TitleProperty, title);\n\n    /// <summary>\n    /// Gets the value of the <c>IconImageSource</c> attached property from the specified <see cref=\"Page\"/>.\n    /// </summary>\n    /// <param name=\"page\">The page from which to get the property value.</param>\n    /// <returns>The <see cref=\"ImageSource\"/> for the tab icon.</returns>\n    public static ImageSource GetIconImageSource(Page page) =>\n        (ImageSource)page.GetValue(IconImageSourceProperty);\n\n    /// <summary>\n    /// Sets the value of the <c>IconImageSource</c> attached property on the specified <see cref=\"Page\"/>.\n    /// </summary>\n    /// <param name=\"page\">The page on which to set the property value.</param>\n    /// <param name=\"imageSource\">The <see cref=\"ImageSource\"/> to set as the tab icon.</param>\n    public static void SetIconImageSource(Page page, ImageSource imageSource) =>\n        page.SetValue(IconImageSourceProperty, imageSource);\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Prism.Maui.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFrameworks>net9.0;net9.0-android;net9.0-ios;net10.0;net10.0-android;net10.0-ios;</TargetFrameworks>\n    <TargetFrameworks Condition=\"$([MSBuild]::IsOSPlatform('windows'))\">$(TargetFrameworks);net9.0-windows10.0.19041;net10.0-windows10.0.19041</TargetFrameworks>\n    <Description>Prism provides an implementation of a collection of design patterns that are helpful in writing well structured, maintainable, and testable XAML applications, including MVVM, dependency injection, commanding, event aggregation, and more. Prism's core functionality is a shared library targeting the .NET Framework and .NET. Features that need to be platform specific are implemented in the respective libraries for the target platform (WPF, Uno Platform, .NET MAUI and Xamarin Forms).\n\nPrism for .NET MAUI helps you more easily design and build rich, flexible, and easy to maintain .NET MAUI applications. This library provides user interface composition as well as modularity support.\n    </Description>\n    <RootNamespace>Prism</RootNamespace>\n    <GeneratePackageOnBuild>true</GeneratePackageOnBuild>\n    <UseMaui>true</UseMaui>\n    <ImplicitUsings>true</ImplicitUsings>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\Prism.Core\\Prism.Core.csproj\" />\n  </ItemGroup>\n\n  <Choose>\n    <When Condition=\"$(TargetFramework.StartsWith('net9'))\">\n      <ItemGroup>\n        <PackageReference Include=\"Microsoft.Maui.Controls\" VersionOverride=\"9.0.110\" />\n      </ItemGroup>\n    </When>\n    <When Condition=\"$(TargetFramework.StartsWith('net10'))\">\n      <ItemGroup>\n        <PackageReference Include=\"Microsoft.Maui.Controls\" VersionOverride=\"10.0.10\" />\n      </ItemGroup>\n    </When>\n  </Choose>\n\n\n\n  <ItemGroup>\n    <InternalsVisibleTo Include=\"Prism.Maui.Tests\" />\n    <InternalsVisibleTo Include=\"Prism.DryIoc.Maui.Tests\" />\n    <Compile Update=\"Properties\\Resources.Designer.cs\">\n      <DesignTime>True</DesignTime>\n      <AutoGen>True</AutoGen>\n      <DependentUpon>Resources.resx</DependentUpon>\n    </Compile>\n  </ItemGroup>\n\n  <ItemGroup>\n    <EmbeddedResource Update=\"Properties\\Resources.resx\">\n      <Generator>ResXFileCodeGenerator</Generator>\n      <LastGenOutput>Resources.Designer.cs</LastGenOutput>\n    </EmbeddedResource>\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "src/Maui/Prism.Maui/PrismAppBuilder.cs",
    "content": "using Microsoft.Extensions.Logging;\nusing Microsoft.Maui.LifecycleEvents;\nusing Prism.AppModel;\nusing Prism.Behaviors;\nusing Prism.Common;\nusing Prism.Controls;\nusing Prism.Dialogs;\nusing Prism.Events;\nusing Prism.Modularity;\nusing Prism.Mvvm;\nusing Prism.Navigation;\nusing Prism.Navigation.Regions;\nusing Prism.Navigation.Regions.Adapters;\nusing Prism.Navigation.Xaml;\nusing Prism.Services;\nusing TabbedPage = Microsoft.Maui.Controls.TabbedPage;\n\nnamespace Prism;\n\n/// <summary>\n/// A builder for Prism with .NET MAUI cross-platform applications and services.\n/// </summary>\npublic sealed class PrismAppBuilder\n{\n    private readonly List<Action<IContainerRegistry>> _registrations;\n    private readonly List<Action<IContainerProvider>> _initializations;\n    private readonly IContainerProvider _container;\n    private Func<IContainerProvider, INavigationService, Task> _createWindow;\n    private Action<RegionAdapterMappings> _configureAdapters;\n    private Action<IRegionBehaviorFactory> _configureBehaviors;\n\n    internal PrismAppBuilder(IContainerExtension containerExtension, MauiAppBuilder builder)\n    {\n        ArgumentNullException.ThrowIfNull(containerExtension);\n        ArgumentNullException.ThrowIfNull(builder);\n\n        _container = containerExtension;\n        _registrations = [];\n        _initializations = [];\n\n        ViewModelCreationException.SetViewNameDelegate(view =>\n        {\n            if (view is BindableObject bindable)\n                return Mvvm.ViewModelLocator.GetNavigationName(bindable);\n\n            return $\"View is not a BindableObject: '{view.GetType().FullName}\";\n        });\n\n        // Ensure that the DialogStack is cleared when the Application is started.\n        // This is primarily to help with Unit Tests\n        IDialogContainer.DialogStack.Clear();\n        MauiBuilder = builder;\n        MauiBuilder.ConfigureContainer(new PrismServiceProviderFactory(RegistrationCallback));\n        MauiBuilder.ConfigureLifecycleEvents(lifecycle =>\n        {\n#if ANDROID\n            lifecycle.AddAndroid(android =>\n            {\n                android.OnBackPressed(activity =>\n                {\n                    //the PrismWindow and PrismNavigationPage have their own back press logic and intercepts the hardware back button behavior\n                    //when this happens the PageNavigationService will take over and handle the navigation and decides whether to allow GoBack or not\n                    //this means we need to check if the PageNavigationService is handling the navigation and if it is, we need to prevent the OnBackPressed logic\n                    if (PageNavigationService.NavigationSource == PageNavigationSource.NavigationService)\n                        return true; \n\n                    var root = ContainerLocator.Container;\n                    if (root is null)\n                        return false;\n\n                    var app = root.Resolve<IApplication>();\n                    var window = app.Windows.OfType<PrismWindow>()\n                        .FirstOrDefault(x => x.IsActive);\n\n                    if (window is null)\n                        return false;\n\n                    //we are on the root page and the user pressed the hardward back button. the app has nowhere to navigation except to the background.\n                    //neither the PrismNavigationPage or the PrismWindow can handle this scenario, so we need to handle it here\n                    if (window.IsRootPage)\n                    {\n                        //when showing a dialog on the root page, if the user presses the hardware back button, we need to make sure the dialog\n                        //decides either to dismiss the dialog or keep it open\n                        var dialogModal = IDialogContainer.DialogStack.LastOrDefault();\n                        if (dialogModal is not null)\n                        {\n                            return true;\n                        }\n\n                        //note: if the PageNavigationService sends the android app to the background, this can cause the CanNavigate to be called twice.\n                        //if this becomes a problem, we may need to add an additional static flag to know when we are sending the app to the background to prevent the double call\n                        var canNavigate = MvvmHelpers.CanNavigate(MvvmHelpers.GetTarget(window.Page), new NavigationParameters());\n                        return !canNavigate;                        \n                    }\n\n                    return true;\n                });\n            });\n#endif\n        });\n\n        ContainerLocator.ResetContainer();\n        ContainerLocator.SetContainerExtension(containerExtension);\n\n        containerExtension.RegisterInstance(this);\n        containerExtension.RegisterSingleton<IMauiInitializeService, PrismInitializationService>();\n\n        ConfigureViewModelLocator();\n    }\n\n    /// <summary>\n    /// Gets the associated <see cref=\"MauiAppBuilder\"/>.\n    /// </summary>\n    public MauiAppBuilder MauiBuilder { get; }\n\n    private static void ConfigureViewModelLocator()\n    {\n        ViewModelLocationProvider.SetDefaultViewToViewModelTypeResolver(view =>\n        {\n            if (view is not BindableObject bindable)\n                return null;\n\n            return bindable.GetValue(ViewModelLocator.ViewModelProperty) as Type;\n        });\n\n        ViewModelLocationProvider.SetDefaultViewModelFactory(DefaultViewModelLocator);\n    }\n\n    internal static object DefaultViewModelLocator(object view, Type viewModelType)\n    {\n        try\n        {\n            if (view is not BindableObject bindable || bindable.BindingContext is not null)\n                return null;\n\n            var container = bindable.GetContainerProvider();\n\n            return container.Resolve(viewModelType, (typeof(IDispatcher), bindable.Dispatcher));\n        }\n        catch (ViewModelCreationException)\n        {\n            throw;\n        }\n        catch (Exception ex)\n        {\n            throw new ViewModelCreationException(view, ex);\n        }\n    }\n\n    /// <summary>\n    /// Provides a Delegate to register services with the <see cref=\"PrismAppBuilder\"/>\n    /// </summary>\n    /// <param name=\"registerTypes\">The delegate to register your services.</param>\n    /// <returns>The <see cref=\"PrismAppBuilder\"/>.</returns>\n    public PrismAppBuilder RegisterTypes(Action<IContainerRegistry> registerTypes)\n    {\n        _registrations.Add(registerTypes);\n        return this;\n    }\n\n    /// <summary>\n    /// Provides a Delegate to invoke when the App is initialized.\n    /// </summary>\n    /// <param name=\"action\">The delegate to invoke.</param>\n    /// <returns>The <see cref=\"PrismAppBuilder\"/>.</returns>\n    public PrismAppBuilder OnInitialized(Action<IContainerProvider> action)\n    {\n        _initializations.Add(action);\n        return this;\n    }\n\n    private bool _initialized;\n    internal void OnInitialized()\n    {\n        if (_initialized)\n            return;\n\n        _initialized = true;\n        var logger = _container.Resolve<ILogger<PrismAppBuilder>>();\n        var errors = new List<Exception>();\n\n        _initializations.ForEach(action =>\n        {\n            try\n            {\n                action(_container);\n            }\n            catch (Exception ex)\n            {\n                logger.LogError(ex, \"Error executing Initialization Delegate.\");\n                errors.Add(ex);\n            }\n        });\n\n        if (errors.Count == 1)\n        {\n            throw new PrismInitializationException(\"An error was encountered while invoking the OnInitialized Delegates\", errors[0]);\n        }\n        else if (errors.Count > 1)\n        {\n            throw new AggregateException(\"One or more errors were encountered while executing the OnInitialized Delegates\", [.. errors]);\n        }\n\n        if (_container.IsRegistered<IModuleCatalog>() && _container.Resolve<IModuleCatalog>().Modules.Any())\n        {\n            try\n            {\n                logger.LogDebug(\"Initializing modules.\");\n                var manager = _container.Resolve<IModuleManager>();\n                manager.Run();\n                logger.LogDebug(\"Modules Initialized.\");\n            }\n            catch (Exception ex)\n            {\n                logger.LogError(ex, \"An error ocurred while initializing the Modules.\");\n                throw new PrismInitializationException(\"An error occurred while initializing the Modules.\", ex);\n            }\n        }\n        else\n        {\n            logger.LogDebug(\"No Modules found to initialize.\");\n        }\n\n        var navRegistry = _container.Resolve<INavigationRegistry>();\n        if (!navRegistry.IsRegistered(nameof(NavigationPage)))\n        {\n            var registry = _container as IContainerRegistry;\n            registry\n                .Register<PrismNavigationPage>(() => new PrismNavigationPage())\n                .RegisterInstance(new ViewRegistration\n                {\n                    Name = nameof(NavigationPage),\n                    View = typeof(PrismNavigationPage),\n                    Type = ViewType.Page\n                });\n        }\n\n        if (!navRegistry.IsRegistered(nameof(TabbedPage)))\n        {\n            var registry = _container as IContainerRegistry;\n            registry.RegisterForNavigation<TabbedPage>();\n        }\n    }\n\n    internal void OnCreateWindow()\n    {\n        if (_createWindow is null)\n            throw new ArgumentException(\"You must call CreateWindow on the PrismAppBuilder.\");\n\n        // Ensure that this is executed before we navigate.\n        OnInitialized();\n        var onStart = _createWindow(_container, _container.Resolve<INavigationService>());\n        onStart.Wait();\n    }\n\n    /// <summary>\n    /// When the <see cref=\"Application\"/> is started and the native platform calls <see cref=\"IApplication.CreateWindow(IActivationState?)\"/>\n    /// this delegate will be invoked to do your initial Navigation.\n    /// </summary>\n    /// <param name=\"createWindow\">The Navigation Delegate.</param>\n    /// <returns>The <see cref=\"PrismAppBuilder\"/>.</returns>\n    public PrismAppBuilder CreateWindow(Func<IContainerProvider, INavigationService, Task> createWindow)\n    {\n        _createWindow = createWindow;\n        return this;\n    }\n\n    /// <summary>\n    /// Configures the <see cref=\"ViewModelLocator\"/> used by Prism.\n    /// </summary>\n    public PrismAppBuilder ConfigureDefaultViewModelFactory(Func<IContainerProvider, object, Type, object> viewModelFactory)\n    {\n        ViewModelLocationProvider.SetDefaultViewModelFactory((view, type) =>\n        {\n            if (view is not BindableObject bindable)\n                return null;\n\n            var container = bindable.GetContainerProvider();\n            return viewModelFactory(container, view, type);\n        });\n\n        return this;\n    }\n\n    private void RegistrationCallback(IContainerExtension container)\n    {\n        RegisterDefaultRequiredTypes(container);\n\n        _registrations.ForEach(action => action(container));\n    }\n\n    /// <summary>\n    /// Configures <see cref=\"RegionAdapterMappings\"/> for Region Navigation with the <see cref=\"IRegionManager\"/>.\n    /// </summary>\n    /// <param name=\"configureMappings\">Delegate to configure the <see cref=\"RegionAdapterMappings\"/>.</param>\n    /// <returns>The <see cref=\"PrismAppBuilder\"/>.</returns>\n    public PrismAppBuilder ConfigureRegionAdapters(Action<RegionAdapterMappings> configureMappings)\n    {\n        _configureAdapters = configureMappings;\n        return this;\n    }\n\n    /// <summary>\n    /// Configures the <see cref=\"IRegionBehaviorFactory\"/>.\n    /// </summary>\n    /// <param name=\"configureBehaviors\">Delegate to configure the <see cref=\"IRegionBehaviorFactory\"/>.</param>\n    /// <returns>The <see cref=\"PrismAppBuilder\"/>.</returns>\n    public PrismAppBuilder ConfigureRegionBehaviors(Action<IRegionBehaviorFactory> configureBehaviors)\n    {\n        _configureBehaviors = configureBehaviors;\n        return this;\n    }\n\n    private void RegisterDefaultRequiredTypes(IContainerRegistry containerRegistry)\n    {\n        containerRegistry.TryRegisterSingleton<IEventAggregator, EventAggregator>();\n        containerRegistry.TryRegisterSingleton<IKeyboardMapper, KeyboardMapper>();\n        containerRegistry.TryRegisterSingleton<IPageDialogService, PageDialogService>();\n        containerRegistry.TryRegisterScoped<IDialogService, DialogService>();\n        containerRegistry.TryRegister<IDialogViewRegistry, DialogViewRegistry>();\n        containerRegistry.RegisterDialogContainer<DialogContainerPage>();\n        //containerRegistry.RegisterSingleton<IDeviceService, DeviceService>();\n        containerRegistry.TryRegisterScoped<IPageAccessor, PageAccessor>();\n        containerRegistry.TryRegisterScoped<INavigationService, PageNavigationService>();\n        containerRegistry.TryRegister<INavigationRegistry, NavigationRegistry>();\n        containerRegistry.RegisterManySingleton<PrismWindowManager>();\n        containerRegistry.RegisterPageBehavior<NavigationPage, NavigationPageSystemGoBackBehavior>();\n        containerRegistry.RegisterPageBehavior<NavigationPage, NavigationPageActiveAwareBehavior>();\n        containerRegistry.RegisterPageBehavior<NavigationPage, NavigationPageTabbedParentBehavior>();\n        containerRegistry.RegisterPageBehavior<TabbedPage, TabbedPageActiveAwareBehavior>();\n        containerRegistry.RegisterPageBehavior<PageLifeCycleAwareBehavior>();\n        containerRegistry.RegisterPageBehavior<PageScopeBehavior>();\n        containerRegistry.RegisterPageBehavior<RegionCleanupBehavior>();\n        containerRegistry.RegisterRegionServices(_configureAdapters, _configureBehaviors);\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/PrismAppBuilderExtensions.cs",
    "content": "using Microsoft.Extensions.Logging;\nusing Prism.Modularity;\nusing Prism.Mvvm;\nusing Prism.Navigation;\nusing Prism.Navigation.Builder;\n\nnamespace Prism;\n\n/// <summary>\n/// Common extensions and overloads for the <see cref=\"PrismAppBuilder\"/>\n/// </summary>\npublic static class PrismAppBuilderExtensions\n{\n    /// <summary>\n    /// Configures the <see cref=\"MauiAppBuilder\"/> to use Prism with a callback for the <see cref=\"PrismAppBuilder\"/>\n    /// </summary>\n    /// <param name=\"builder\">The <see cref=\"MauiAppBuilder\"/>.</param>\n    /// <param name=\"containerExtension\">The instance of the <see cref=\"IContainerExtension\"/> Prism should use.</param>\n    /// <param name=\"configurePrism\">A delegate callback for the <see cref=\"PrismAppBuilder\"/></param>\n    /// <returns>The <see cref=\"MauiAppBuilder\"/>.</returns>\n    public static MauiAppBuilder UsePrism(this MauiAppBuilder builder, IContainerExtension containerExtension, Action<PrismAppBuilder> configurePrism)\n    {\n        var prismBuilder = new PrismAppBuilder(containerExtension, builder);\n        configurePrism(prismBuilder);\n        return builder;\n    }\n\n    /// <summary>\n    /// Provides a Delegate to invoke when the App is initialized.\n    /// </summary>\n    /// <param name=\"builder\">The <see cref=\"PrismAppBuilder\"/>.</param>\n    /// <param name=\"action\">The delegate to invoke.</param>\n    /// <returns>The <see cref=\"PrismAppBuilder\"/>.</returns>\n    public static PrismAppBuilder OnInitialized(this PrismAppBuilder builder, Action action)\n    {\n        return builder.OnInitialized(_ => action());\n    }\n\n    /// <summary>\n    /// Configures the <see cref=\"IModuleCatalog\"/> used by Prism.\n    /// </summary>\n    /// <param name=\"builder\">The <see cref=\"PrismAppBuilder\"/>.</param>\n    /// <param name=\"configureCatalog\">Delegate to configure the <see cref=\"IModuleCatalog\"/>.</param>\n    public static PrismAppBuilder ConfigureModuleCatalog(this PrismAppBuilder builder, Action<IModuleCatalog> configureCatalog)\n    {\n        builder.RegisterTypes(container =>\n        {\n            container.TryRegisterSingleton<IModuleCatalog, ModuleCatalog>();\n            container.TryRegisterSingleton<IModuleManager, ModuleManager>();\n            container.TryRegisterSingleton<IModuleInitializer, ModuleInitializer>();\n        });\n\n        return builder.OnInitialized(container =>\n        {\n            var moduleCatalog = container.Resolve<IModuleCatalog>();\n            configureCatalog(moduleCatalog);\n        });\n    }\n\n    /// <summary>\n    /// When the <see cref=\"Application\"/> is started and the native platform calls <see cref=\"IApplication.CreateWindow(IActivationState?)\"/>\n    /// this delegate will be invoked to do your initial Navigation.\n    /// </summary>\n    /// <param name=\"builder\">The <see cref=\"PrismAppBuilder\"/>.</param>\n    /// <param name=\"uri\">The initial Navigation Uri.</param>\n    /// <returns>The <see cref=\"PrismAppBuilder\"/>.</returns>\n    public static PrismAppBuilder CreateWindow(this PrismAppBuilder builder, string uri) =>\n        builder.CreateWindow(navigation => navigation.NavigateAsync(uri));\n\n    /// <summary>\n    /// When the <see cref=\"Application\"/> is started and the native platform calls <see cref=\"IApplication.CreateWindow(IActivationState?)\"/>\n    /// this delegate will be invoked to do your initial Navigation.\n    /// </summary>\n    /// <param name=\"builder\">The <see cref=\"PrismAppBuilder\"/>.</param>\n    /// <param name=\"uri\">The intial Navigation Uri.</param>\n    /// <param name=\"onError\">A delegate callback if the navigation fails.</param>\n    /// <returns>The <see cref=\"PrismAppBuilder\"/>.</returns>\n    public static PrismAppBuilder CreateWindow(this PrismAppBuilder builder, string uri, Action<Exception> onError) =>\n        builder.CreateWindow(async navigation =>\n        {\n            var result = await navigation.NavigateAsync(uri);\n            if (result.Exception is not null)\n                onError(result.Exception);\n        });\n\n    /// <summary>\n    /// When the <see cref=\"Application\"/> is started and the native platform calls <see cref=\"IApplication.CreateWindow(IActivationState?)\"/>\n    /// this delegate will be invoked to do your initial Navigation.\n    /// </summary>\n    /// <param name=\"builder\">The <see cref=\"PrismAppBuilder\"/>.</param>\n    /// <param name=\"createWindow\">The Navigation Delegate.</param>\n    /// <returns>The <see cref=\"PrismAppBuilder\"/>.</returns>\n    public static PrismAppBuilder CreateWindow(this PrismAppBuilder builder, Func<IContainerProvider, INavigationService, Task> createWindow) =>\n        builder.CreateWindow((c, n) => createWindow(c, n));\n\n    /// <summary>\n    /// When the <see cref=\"Application\"/> is started and the native platform calls <see cref=\"IApplication.CreateWindow(IActivationState?)\"/>\n    /// this delegate will be invoked to do your initial Navigation.\n    /// </summary>\n    /// <param name=\"builder\">The <see cref=\"PrismAppBuilder\"/>.</param>\n    /// <param name=\"createWindow\">The Navigation Delegate.</param>\n    /// <returns>The <see cref=\"PrismAppBuilder\"/>.</returns>\n    public static PrismAppBuilder CreateWindow(this PrismAppBuilder builder, Func<INavigationService, Task> createWindow) =>\n        builder.CreateWindow((_, n) => createWindow(n));\n\n    /// <summary>\n    /// When the <see cref=\"Application\"/> is started and the native platform calls <see cref=\"IApplication.CreateWindow(IActivationState?)\"/>\n    /// this delegate will be invoked to do your initial Navigation.\n    /// </summary>\n    /// <param name=\"builder\">The <see cref=\"PrismAppBuilder\"/>.</param>\n    /// <param name=\"createWindow\">The Navigation Delegate.</param>\n    /// <returns>The <see cref=\"PrismAppBuilder\"/>.</returns>\n    public static PrismAppBuilder CreateWindow(this PrismAppBuilder builder, Func<INavigationService, INavigationBuilder> createWindow) =>\n        builder.CreateWindow(n => createWindow(n).NavigateAsync());\n\n    /// <summary>\n    /// When the <see cref=\"Application\"/> is started and the native platform calls <see cref=\"IApplication.CreateWindow(IActivationState?)\"/>\n    /// this delegate will be invoked to do your initial Navigation.\n    /// </summary>\n    /// <param name=\"builder\">The <see cref=\"PrismAppBuilder\"/>.</param>\n    /// <param name=\"createWindow\">The Navigation Delegate.</param>\n    /// <returns>The <see cref=\"PrismAppBuilder\"/>.</returns>\n    public static PrismAppBuilder CreateWindow(this PrismAppBuilder builder, Func<IContainerProvider, INavigationService, INavigationBuilder> createWindow) =>\n        builder.CreateWindow((c, n) => createWindow(c, n).NavigateAsync());\n\n\n    /// <summary>\n    /// Provides a configuration delegate to add services to the <see cref=\"MauiAppBuilder.Services\"/>\n    /// </summary>\n    /// <param name=\"builder\">The <see cref=\"PrismAppBuilder\"/>.</param>\n    /// <param name=\"configureServices\">Configuration Delegate</param>\n    /// <returns>The <see cref=\"PrismAppBuilder\"/>.</returns>\n    public static PrismAppBuilder ConfigureServices(this PrismAppBuilder builder, Action<IServiceCollection> configureServices)\n    {\n        configureServices(builder.MauiBuilder.Services);\n        return builder;\n    }\n\n    /// <summary>\n    /// Provides a delegate to configure Logging within the Maui application\n    /// </summary>\n    /// <param name=\"builder\">The <see cref=\"PrismAppBuilder\"/>.</param>\n    /// <param name=\"configureLogging\"></param>\n    /// <returns>The <see cref=\"PrismAppBuilder\"/>.</returns>\n    public static PrismAppBuilder ConfigureLogging(this PrismAppBuilder builder, Action<ILoggingBuilder> configureLogging)\n    {\n        configureLogging(builder.MauiBuilder.Logging);\n        return builder;\n    }\n\n    /// <summary>\n    /// Provides a configuration Delegate to the <see cref=\"ViewModelLocationProvider\"/> to set the\n    /// DefaultViewTypeToViewModelTypeResolver.\n    /// </summary>\n    /// <param name=\"builder\">The <see cref=\"PrismAppBuilder\"/>.</param>\n    /// <param name=\"viewModelTypeResolver\">The Configuration Delegate for the Default ViewType to ViewModelType Resolver.</param>\n    /// <returns>The <see cref=\"PrismAppBuilder\"/>.</returns>\n    public static PrismAppBuilder ConfigureViewTypeToViewModelTypeResolver(this PrismAppBuilder builder, Func<Type, Type> viewModelTypeResolver)\n    {\n        ViewModelLocationProvider.SetDefaultViewTypeToViewModelTypeResolver(viewModelTypeResolver);\n        return builder;\n    }\n\n    /// <summary>\n    /// Registers an <see cref=\"AppAction\"/> with a callback that will be invoked on the UI thread for the specified <see cref=\"AppAction\"/>.\n    /// </summary>\n    /// <param name=\"builder\">The <see cref=\"PrismAppBuilder\"/>.</param>\n    /// <param name=\"appAction\">An <see cref=\"AppAction\"/></param>\n    /// <param name=\"callback\">The callback to invoke when the <see cref=\"AppAction\"/> is triggered.</param>\n    /// <returns>The <see cref=\"PrismAppBuilder\"/>.</returns>\n    public static PrismAppBuilder RegisterAppAction(this PrismAppBuilder builder, AppAction appAction, Func<IContainerProvider, INavigationService, AppAction, Task> callback)\n    {\n        builder.MauiBuilder.ConfigureEssentials(essentials =>\n        {\n            essentials.AddAppAction(appAction)\n                .OnAppAction(async action =>\n                {\n                    if (appAction.Id != action.Id)\n                        return;\n\n                    var app = Application.Current;\n                    if (app?.Handler?.MauiContext?.Services is null || app.Dispatcher is null)\n                        return;\n\n                    var container = app.Handler.MauiContext.Services.GetRequiredService<IContainerProvider>();\n                    var navigation = container.Resolve<INavigationService>();\n                    await app.Dispatcher.DispatchAsync(() =>\n                    {\n                        return callback(container, navigation, action);\n                    });\n                });\n        });\n        return builder;\n    }\n\n    /// <summary>\n    /// Registers an <see cref=\"AppAction\"/> with a callback that will be invoked on the UI thread for the specified <see cref=\"AppAction\"/>.\n    /// </summary>\n    /// <param name=\"builder\">The <see cref=\"PrismAppBuilder\"/>.</param>\n    /// <param name=\"appAction\">An <see cref=\"AppAction\"/></param>\n    /// <param name=\"callback\">The callback to invoke when the <see cref=\"AppAction\"/> is triggered.</param>\n    /// <returns>The <see cref=\"PrismAppBuilder\"/>.</returns>\n    public static PrismAppBuilder RegisterAppAction(this PrismAppBuilder builder, AppAction appAction, Func<INavigationService, AppAction, Task> callback)\n    {\n        builder.MauiBuilder.ConfigureEssentials(essentials =>\n        {\n            essentials.AddAppAction(appAction)\n                .OnAppAction(async action =>\n                {\n                    if (appAction.Id != action.Id)\n                        return;\n\n                    var app = Application.Current;\n                    if (app?.Handler?.MauiContext?.Services is null || app.Dispatcher is null)\n                        return;\n\n                    var navigation = app.Handler.MauiContext.Services.GetRequiredService<INavigationService>();\n                    await app.Dispatcher.DispatchAsync(() =>\n                    {\n                        return callback(navigation, action);\n                    });\n                });\n        });\n        return builder;\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/PrismInitializationException.cs",
    "content": "﻿namespace Prism;\n\n/// <summary>\n/// Represents errors that occur during application initialization.\n/// </summary>\npublic sealed class PrismInitializationException : Exception\n{\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"PrismInitializationException\"/> class with a specified error\n    /// message and a reference to the inner exception that is the cause of this exception.\n    /// </summary>\n    /// <param name=\"message\">The error message that explains the reason for the exception.</param>\n    /// <param name=\"innerException\">The exception that is the cause of the current exception.</param>\n    public PrismInitializationException(string message, Exception innerException)\n        : base(message, innerException)\n    {\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/PrismInitializationService.cs",
    "content": "﻿namespace Prism;\n\ninternal class PrismInitializationService : IMauiInitializeService\n{\n    /// <summary>\n    /// Initializes the modules.\n    /// </summary>\n    public void Initialize(IServiceProvider services)\n    {\n        var builder = services.GetRequiredService<PrismAppBuilder>();\n        builder.OnInitialized();\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Properties/AssemblyInfo.cs",
    "content": "﻿using Microsoft.Maui.Controls;\n\n[assembly: XmlnsDefinition(\"http://prismlibrary.com\", \"Prism\")]\n[assembly: XmlnsDefinition(\"http://prismlibrary.com\", \"Prism.Behaviors\")]\n[assembly: XmlnsDefinition(\"http://prismlibrary.com\", \"Prism.Controls\")]\n[assembly: XmlnsDefinition(\"http://prismlibrary.com\", \"Prism.Ioc\")]\n[assembly: XmlnsDefinition(\"http://prismlibrary.com\", \"Prism.Modularity\")]\n[assembly: XmlnsDefinition(\"http://prismlibrary.com\", \"Prism.Mvvm\")]\n[assembly: XmlnsDefinition(\"http://prismlibrary.com\", \"Prism.Navigation.Xaml\")]\n[assembly: XmlnsDefinition(\"http://prismlibrary.com\", \"Prism.Navigation.Regions.Xaml\")]\n[assembly: XmlnsDefinition(\"http://prismlibrary.com\", \"Prism.Dialogs.Xaml\")]\n[assembly: XmlnsDefinition(\"http://prismlibrary.com\", \"Prism.Xaml\")]\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Properties/Resources.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.42000\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace Prism.Properties {\n    using System;\n    \n    \n    /// <summary>\n    ///   A strongly-typed resource class, for looking up localized strings, etc.\n    /// </summary>\n    // This class was auto-generated by the StronglyTypedResourceBuilder\n    // class via a tool like ResGen or Visual Studio.\n    // To add or remove a member, edit your .ResX file then rerun ResGen\n    // with the /str option, or rebuild your VS project.\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"17.0.0.0\")]\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    internal class Resources {\n        \n        private static global::System.Resources.ResourceManager resourceMan;\n        \n        private static global::System.Globalization.CultureInfo resourceCulture;\n        \n        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        internal Resources() {\n        }\n        \n        /// <summary>\n        ///   Returns the cached ResourceManager instance used by this class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Resources.ResourceManager ResourceManager {\n            get {\n                if (object.ReferenceEquals(resourceMan, null)) {\n                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"Prism.Properties.Resources\", typeof(Resources).Assembly);\n                    resourceMan = temp;\n                }\n                return resourceMan;\n            }\n        }\n        \n        /// <summary>\n        ///   Overrides the current thread's CurrentUICulture property for all\n        ///   resource lookups using this strongly typed resource class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Globalization.CultureInfo Culture {\n            get {\n                return resourceCulture;\n            }\n            set {\n                resourceCulture = value;\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The object must be of type &apos;{0}&apos; in order to use the current region adapter..\n        /// </summary>\n        internal static string AdapterInvalidTypeException {\n            get {\n                return ResourceManager.GetString(\"AdapterInvalidTypeException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Cannot change the region name once is set. The current region name is &apos;{0}&apos;..\n        /// </summary>\n        internal static string CannotChangeRegionNameException {\n            get {\n                return ResourceManager.GetString(\"CannotChangeRegionNameException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Cannot create navigation target &apos;{0}&apos;..\n        /// </summary>\n        internal static string CannotCreateNavigationTarget {\n            get {\n                return ResourceManager.GetString(\"CannotCreateNavigationTarget\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Type &apos;{0}&apos; does not implement from IRegionBehavior..\n        /// </summary>\n        internal static string CanOnlyAddTypesThatInheritIFromRegionBehavior {\n            get {\n                return ResourceManager.GetString(\"CanOnlyAddTypesThatInheritIFromRegionBehavior\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to CarouselView&apos;s ItemSource property is not empty. \n        ///    This control is being associated with a region, but the control is already bound to something else. \n        ///    If you did not explicitly set the control&apos;s ItemSource property, \n        ///    this exception may be caused by a change in the value of the inherited RegionManager attached property..\n        /// </summary>\n        internal static string CarouselViewHasItemsSourceException {\n            get {\n                return ResourceManager.GetString(\"CarouselViewHasItemsSourceException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to CollectionView&apos;s ItemSource property is not empty. \n        ///    This control is being associated with a region, but the control is already bound to something else. \n        ///    If you did not explicitly set the control&apos;s ItemsSource property, this exception may be \n        ///    caused by a change in the value of the inherited RegionManager attached property..\n        /// </summary>\n        internal static string CollectionViewHasItemsSourceException {\n            get {\n                return ResourceManager.GetString(\"CollectionViewHasItemsSourceException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to ContentView&apos;s Content property is not empty. \n        ///    This control is being associated with a region, but the control is already bound to something else. \n        ///    If you did not explicitly set the control&apos;s Content property, \n        ///    this exception may be caused by a change in the value of the inherited RegionManager attached property..\n        /// </summary>\n        internal static string ContentViewHasContentException {\n            get {\n                return ResourceManager.GetString(\"ContentViewHasContentException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Deactivation is not possible in this type of region..\n        /// </summary>\n        internal static string DeactiveNotPossibleException {\n            get {\n                return ResourceManager.GetString(\"DeactiveNotPossibleException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to A duplicated module with name {0} has been found in the ModuleCatalog..\n        /// </summary>\n        internal static string DuplicatedModuleInCatalog {\n            get {\n                return ResourceManager.GetString(\"DuplicatedModuleInCatalog\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to HostControl cannot have null value when behavior attaches..\n        /// </summary>\n        internal static string HostControlCannotBeNull {\n            get {\n                return ResourceManager.GetString(\"HostControlCannotBeNull\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The HostControl property cannot be set after Attach method has been called..\n        /// </summary>\n        internal static string HostControlCannotBeSetAfterAttach {\n            get {\n                return ResourceManager.GetString(\"HostControlCannotBeSetAfterAttach\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Layout&lt;View&gt;&apos;s Children property is not empty. \n        ///    This control is being associated with a region, but the control is already bound to something else. \n        ///    If you did not explicitly set the control&apos;s Children or ItemsSource property, \n        ///    this exception may be caused by a change in the value of the inherited RegionManager attached property..\n        /// </summary>\n        internal static string LayoutViewHasChildrenException {\n            get {\n                return ResourceManager.GetString(\"LayoutViewHasChildrenException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Mapping with the given type is already registered: {0}..\n        /// </summary>\n        internal static string MappingExistsException {\n            get {\n                return ResourceManager.GetString(\"MappingExistsException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Module {0} was not found in the catalog..\n        /// </summary>\n        internal static string ModuleNotFound {\n            get {\n                return ResourceManager.GetString(\"ModuleNotFound\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Module Reference Location is not supported in Maui.\n        /// </summary>\n        internal static string ModuleRefLocationNotSupported {\n            get {\n                return ResourceManager.GetString(\"ModuleRefLocationNotSupported\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Multiple Views have been registered for the navigation key &apos;{0}&apos;: {1}.\n        /// </summary>\n        internal static string MultipleViewsRegisteredForNavigationKey {\n            get {\n                return ResourceManager.GetString(\"MultipleViewsRegisteredForNavigationKey\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to NavigationMode is not available.\n        /// </summary>\n        internal static string NavigationModeNotAvailable {\n            get {\n                return ResourceManager.GetString(\"NavigationModeNotAvailable\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Navigation cannot proceed until a region is set for the RegionNavigationService..\n        /// </summary>\n        internal static string NavigationServiceHasNoRegion {\n            get {\n                return ResourceManager.GetString(\"NavigationServiceHasNoRegion\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The IRegionAdapter for the type {0} is not registered in the region adapter mappings. You can register an IRegionAdapter for this control by overriding the ConfigureRegionAdapterMappings method in the bootstrapper..\n        /// </summary>\n        internal static string NoRegionAdapterException {\n            get {\n                return ResourceManager.GetString(\"NoRegionAdapterException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to An exception has occurred while trying to add a view to region &apos;{0}&apos;. \n        ///    - The most likely causing exception was was: &apos;{1}&apos;.\n        ///    But also check the InnerExceptions for more detail or call .GetRootException()..\n        /// </summary>\n        internal static string OnViewRegisteredException {\n            get {\n                return ResourceManager.GetString(\"OnViewRegisteredException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The Attach method cannot be called when Region property is null..\n        /// </summary>\n        internal static string RegionBehaviorAttachCannotBeCallWithNullRegion {\n            get {\n                return ResourceManager.GetString(\"RegionBehaviorAttachCannotBeCallWithNullRegion\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The Region property cannot be set after Attach method has been called..\n        /// </summary>\n        internal static string RegionBehaviorRegionCannotBeSetAfterAttach {\n            get {\n                return ResourceManager.GetString(\"RegionBehaviorRegionCannotBeSetAfterAttach\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to An exception occurred while creating a region with name &apos;{0}&apos;. The exception was: {1}..\n        /// </summary>\n        internal static string RegionCreationException {\n            get {\n                return ResourceManager.GetString(\"RegionCreationException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The region being added already has a name of &apos;{0}&apos; and cannot be added to the region manager with a different name (&apos;{1}&apos;)..\n        /// </summary>\n        internal static string RegionManagerWithDifferentNameException {\n            get {\n                return ResourceManager.GetString(\"RegionManagerWithDifferentNameException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The region name cannot be null or empty..\n        /// </summary>\n        internal static string RegionNameCannotBeEmptyException {\n            get {\n                return ResourceManager.GetString(\"RegionNameCannotBeEmptyException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Region with the given name is already registered: {0}.\n        /// </summary>\n        internal static string RegionNameExistsException {\n            get {\n                return ResourceManager.GetString(\"RegionNameExistsException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to This RegionManager does not contain a Region with the name &apos;{0}&apos;..\n        /// </summary>\n        internal static string RegionNotFound {\n            get {\n                return ResourceManager.GetString(\"RegionNotFound\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The region manager does not contain the {0} region..\n        /// </summary>\n        internal static string RegionNotInRegionManagerException {\n            get {\n                return ResourceManager.GetString(\"RegionNotInRegionManagerException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to View already exists in region..\n        /// </summary>\n        internal static string RegionViewExistsException {\n            get {\n                return ResourceManager.GetString(\"RegionViewExistsException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to View with name &apos;{0}&apos; already exists in the region..\n        /// </summary>\n        internal static string RegionViewNameExistsException {\n            get {\n                return ResourceManager.GetString(\"RegionViewNameExistsException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to ScrollView&apos;s Content property is not empty. \n        ///    This control is being associated with a region, but the control is already bound to something else. \n        ///    If you did not explicitly set the control&apos;s Content property, \n        ///    this exception may be caused by a change in the value of the inherited RegionManager attached property..\n        /// </summary>\n        internal static string ScrollViewHasContentException {\n            get {\n                return ResourceManager.GetString(\"ScrollViewHasContentException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The ServiceProvider did not provide a &apos;IProvideValueTarget&apos;.\n        /// </summary>\n        internal static string ServiceProviderDidNotHaveIProvideValueTarget {\n            get {\n                return ResourceManager.GetString(\"ServiceProviderDidNotHaveIProvideValueTarget\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The provided String argument {0} must not be null or empty..\n        /// </summary>\n        internal static string StringCannotBeNullOrEmpty {\n            get {\n                return ResourceManager.GetString(\"StringCannotBeNullOrEmpty\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to No BehaviorType with key &apos;{0}&apos; was registered..\n        /// </summary>\n        internal static string TypeWithKeyNotRegistered {\n            get {\n                return ResourceManager.GetString(\"TypeWithKeyNotRegistered\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to An exception occurred while trying to create region objects. \n        ///    - The most likely causing exception was: &apos;{0}&apos;.\n        ///    But also check the InnerExceptions for more detail or call .GetRootException()..\n        /// </summary>\n        internal static string UpdateRegionException {\n            get {\n                return ResourceManager.GetString(\"UpdateRegionException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The region does not contain the specified view..\n        /// </summary>\n        internal static string ViewNotInRegionException {\n            get {\n                return ResourceManager.GetString(\"ViewNotInRegionException\", resourceCulture);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Properties/Resources.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <data name=\"DuplicatedModuleInCatalog\" xml:space=\"preserve\">\n    <value>A duplicated module with name {0} has been found in the ModuleCatalog.</value>\n  </data>\n  <data name=\"ModuleNotFound\" xml:space=\"preserve\">\n    <value>Module {0} was not found in the catalog.</value>\n  </data>\n  <data name=\"ModuleRefLocationNotSupported\" xml:space=\"preserve\">\n    <value>Module Reference Location is not supported in Maui</value>\n  </data>\n  <data name=\"MultipleViewsRegisteredForNavigationKey\" xml:space=\"preserve\">\n    <value>Multiple Views have been registered for the navigation key '{0}': {1}</value>\n  </data>\n  <data name=\"NavigationModeNotAvailable\" xml:space=\"preserve\">\n    <value>NavigationMode is not available</value>\n  </data>\n  <data name=\"ServiceProviderDidNotHaveIProvideValueTarget\" xml:space=\"preserve\">\n    <value>The ServiceProvider did not provide a 'IProvideValueTarget'</value>\n  </data>\n  <data name=\"AdapterInvalidTypeException\" xml:space=\"preserve\">\n    <value>The object must be of type '{0}' in order to use the current region adapter.</value>\n  </data>\n  <data name=\"CannotChangeRegionNameException\" xml:space=\"preserve\">\n    <value>Cannot change the region name once is set. The current region name is '{0}'.</value>\n  </data>\n  <data name=\"CannotCreateNavigationTarget\" xml:space=\"preserve\">\n    <value>Cannot create navigation target '{0}'.</value>\n  </data>\n  <data name=\"CanOnlyAddTypesThatInheritIFromRegionBehavior\" xml:space=\"preserve\">\n    <value>Type '{0}' does not implement from IRegionBehavior.</value>\n  </data>\n  <data name=\"CarouselViewHasItemsSourceException\" xml:space=\"preserve\">\n    <value>CarouselView's ItemSource property is not empty. \n    This control is being associated with a region, but the control is already bound to something else. \n    If you did not explicitly set the control's ItemSource property, \n    this exception may be caused by a change in the value of the inherited RegionManager attached property.</value>\n  </data>\n  <data name=\"CollectionViewHasItemsSourceException\" xml:space=\"preserve\">\n    <value>CollectionView's ItemSource property is not empty. \n    This control is being associated with a region, but the control is already bound to something else. \n    If you did not explicitly set the control's ItemsSource property, this exception may be \n    caused by a change in the value of the inherited RegionManager attached property.</value>\n  </data>\n  <data name=\"ContentViewHasContentException\" xml:space=\"preserve\">\n    <value>ContentView's Content property is not empty. \n    This control is being associated with a region, but the control is already bound to something else. \n    If you did not explicitly set the control's Content property, \n    this exception may be caused by a change in the value of the inherited RegionManager attached property.</value>\n  </data>\n  <data name=\"DeactiveNotPossibleException\" xml:space=\"preserve\">\n    <value>Deactivation is not possible in this type of region.</value>\n  </data>\n  <data name=\"HostControlCannotBeNull\" xml:space=\"preserve\">\n    <value>HostControl cannot have null value when behavior attaches.</value>\n  </data>\n  <data name=\"HostControlCannotBeSetAfterAttach\" xml:space=\"preserve\">\n    <value>The HostControl property cannot be set after Attach method has been called.</value>\n  </data>\n  <data name=\"LayoutViewHasChildrenException\" xml:space=\"preserve\">\n    <value>Layout&lt;View&gt;'s Children property is not empty. \n    This control is being associated with a region, but the control is already bound to something else. \n    If you did not explicitly set the control's Children or ItemsSource property, \n    this exception may be caused by a change in the value of the inherited RegionManager attached property.</value>\n  </data>\n  <data name=\"MappingExistsException\" xml:space=\"preserve\">\n    <value>Mapping with the given type is already registered: {0}.</value>\n  </data>\n  <data name=\"NavigationServiceHasNoRegion\" xml:space=\"preserve\">\n    <value>Navigation cannot proceed until a region is set for the RegionNavigationService.</value>\n  </data>\n  <data name=\"NoRegionAdapterException\" xml:space=\"preserve\">\n    <value>The IRegionAdapter for the type {0} is not registered in the region adapter mappings. You can register an IRegionAdapter for this control by overriding the ConfigureRegionAdapterMappings method in the bootstrapper.</value>\n  </data>\n  <data name=\"OnViewRegisteredException\" xml:space=\"preserve\">\n    <value>An exception has occurred while trying to add a view to region '{0}'. \n    - The most likely causing exception was was: '{1}'.\n    But also check the InnerExceptions for more detail or call .GetRootException().</value>\n  </data>\n  <data name=\"RegionBehaviorAttachCannotBeCallWithNullRegion\" xml:space=\"preserve\">\n    <value>The Attach method cannot be called when Region property is null.</value>\n  </data>\n  <data name=\"RegionBehaviorRegionCannotBeSetAfterAttach\" xml:space=\"preserve\">\n    <value>The Region property cannot be set after Attach method has been called.</value>\n  </data>\n  <data name=\"RegionCreationException\" xml:space=\"preserve\">\n    <value>An exception occurred while creating a region with name '{0}'. The exception was: {1}.</value>\n  </data>\n  <data name=\"RegionManagerWithDifferentNameException\" xml:space=\"preserve\">\n    <value>The region being added already has a name of '{0}' and cannot be added to the region manager with a different name ('{1}').</value>\n  </data>\n  <data name=\"RegionNameCannotBeEmptyException\" xml:space=\"preserve\">\n    <value>The region name cannot be null or empty.</value>\n  </data>\n  <data name=\"RegionNameExistsException\" xml:space=\"preserve\">\n    <value>Region with the given name is already registered: {0}</value>\n  </data>\n  <data name=\"RegionNotFound\" xml:space=\"preserve\">\n    <value>This RegionManager does not contain a Region with the name '{0}'.</value>\n  </data>\n  <data name=\"RegionNotInRegionManagerException\" xml:space=\"preserve\">\n    <value>The region manager does not contain the {0} region.</value>\n  </data>\n  <data name=\"RegionViewExistsException\" xml:space=\"preserve\">\n    <value>View already exists in region.</value>\n  </data>\n  <data name=\"RegionViewNameExistsException\" xml:space=\"preserve\">\n    <value>View with name '{0}' already exists in the region.</value>\n  </data>\n  <data name=\"ScrollViewHasContentException\" xml:space=\"preserve\">\n    <value>ScrollView's Content property is not empty. \n    This control is being associated with a region, but the control is already bound to something else. \n    If you did not explicitly set the control's Content property, \n    this exception may be caused by a change in the value of the inherited RegionManager attached property.</value>\n  </data>\n  <data name=\"StringCannotBeNullOrEmpty\" xml:space=\"preserve\">\n    <value>The provided String argument {0} must not be null or empty.</value>\n  </data>\n  <data name=\"TypeWithKeyNotRegistered\" xml:space=\"preserve\">\n    <value>No BehaviorType with key '{0}' was registered.</value>\n  </data>\n  <data name=\"UpdateRegionException\" xml:space=\"preserve\">\n    <value>An exception occurred while trying to create region objects. \n    - The most likely causing exception was: '{0}'.\n    But also check the InnerExceptions for more detail or call .GetRootException().</value>\n  </data>\n  <data name=\"ViewNotInRegionException\" xml:space=\"preserve\">\n    <value>The region does not contain the specified view.</value>\n  </data>\n</root>"
  },
  {
    "path": "src/Maui/Prism.Maui/Services/PageDialogs/ActionSheetButton.cs",
    "content": "﻿namespace Prism.Services;\n\n/// <summary>\n/// Represents a button displayed in <see cref=\"IPageDialogService.DisplayActionSheetAsync(string, IActionSheetButton[])\"/>\n/// </summary>\npublic class ActionSheetButton : ActionSheetButtonBase\n{\n    /// <summary>\n    /// Represents a button in an action sheet dialog.\n    /// </summary>\n    protected internal ActionSheetButton()\n    {\n\n    }\n\n    /// <summary>\n    /// Gets or sets the action to perform when the button is pressed.\n    /// </summary>\n    /// <value>The action.</value>\n    public Action Action { get; protected set; }\n\n    /// <summary>\n    /// Gets or sets the asynchronous callback to execute when the button is pressed.\n    /// </summary>\n    public Func<Task> AsyncCallback { get; protected set; }\n\n    /// <summary>\n    /// Executes the action to take when the button is pressed.\n    /// </summary>\n    protected override async Task OnButtonPressed()\n    {\n        Action?.Invoke();\n        if (AsyncCallback != null)\n            await AsyncCallback();\n    }\n\n    /// <summary>\n    /// Creates a new instance of <see cref=\"ActionSheetButton\"/> that displays as a \"cancel button\".\n    /// </summary>\n    /// <param name=\"text\">The button text.</param>\n    /// <returns>An instance of <see cref=\"ActionSheetButton\"/>.</returns>\n    public static IActionSheetButton CreateCancelButton(string text) => CreateCancelButton(text, default);\n\n    /// <summary>\n    /// Creates a new instance of <see cref=\"ActionSheetButton\"/> that displays as a \"cancel button\".\n    /// </summary>\n    /// <param name=\"text\">The button text.</param>\n    /// <param name=\"action\">The action to execute when the button is pressed.</param>\n    /// <returns>An instance of <see cref=\"ActionSheetButton\"/>.</returns>\n    public static IActionSheetButton CreateCancelButton(string text, Action action) =>\n        CreateButtonInternal(text, action, null, isCancel: true);\n\n    /// <summary>\n    /// Creates a new instance of <see cref=\"ActionSheetButton\"/> that displays as a \"cancel button\".\n    /// </summary>\n    /// <param name=\"text\">The button text.</param>\n    /// <param name=\"asyncCallback\">The action to execute when the button is pressed.</param>\n    /// <returns>An instance of <see cref=\"ActionSheetButton\"/>.</returns>\n    public static IActionSheetButton CreateCancelButton(string text, Func<Task> asyncCallback) =>\n        CreateButtonInternal(text, null, asyncCallback, isCancel: true);\n\n    /// <summary>\n    /// Creates a new instance of <see cref=\"ActionSheetButton\"/> that displays as a \"cancel button\".\n    /// </summary>\n    /// <param name=\"text\">The button text.</param>\n    /// <param name=\"action\">The action to execute when the button is pressed.</param>\n    /// <param name=\"parameter\">The parameter to pass to the action when the button is pressed.</param>\n    /// <returns>An instance of <see cref=\"ActionSheetButton\"/>.</returns>\n    public static IActionSheetButton CreateCancelButton<T>(string text, Action<T> action, T parameter) =>\n        CreateButtonInternal(text, action, null, parameter, isCancel: true);\n\n    /// <summary>\n    /// Creates a new instance of <see cref=\"ActionSheetButton\"/> that displays as a \"cancel button\".\n    /// </summary>\n    /// <param name=\"text\">The button text.</param>\n    /// <param name=\"asyncCallback\">The action to execute when the button is pressed.</param>\n    /// <param name=\"parameter\">The parameter to pass to the action when the button is pressed.</param>\n    /// <returns>An instance of <see cref=\"ActionSheetButton\"/>.</returns>\n    public static IActionSheetButton CreateCancelButton<T>(string text, Func<T, Task> asyncCallback, T parameter) =>\n        CreateButtonInternal(text, null, asyncCallback, parameter, isCancel: true);\n\n    /// <summary>\n    /// Creates a new instance of <see cref=\"ActionSheetButton\"/> that displays as a \"destroy button\".\n    /// </summary>\n    /// <param name=\"text\">The button text.</param>\n    /// <returns>An instance of <see cref=\"ActionSheetButton\"/>.</returns>\n    public static IActionSheetButton CreateDestroyButton(string text) =>\n        CreateDestroyButton(text, default);\n\n    /// <summary>\n    /// Creates a new instance of <see cref=\"ActionSheetButton\"/> that displays as a \"destroy button\".\n    /// </summary>\n    /// <param name=\"text\">The button text.</param>\n    /// <param name=\"action\">The action to execute when the button is pressed.</param>\n    /// <returns>An instance of <see cref=\"ActionSheetButton\"/>.</returns>\n    public static IActionSheetButton CreateDestroyButton(string text, Action action) =>\n        CreateButtonInternal(text, action, null, isDestroy: true);\n\n    /// <summary>\n    /// Creates a new instance of <see cref=\"ActionSheetButton\"/> that displays as a \"destroy button\".\n    /// </summary>\n    /// <param name=\"text\">The button text.</param>\n    /// <param name=\"asyncCallback\">The action to execute when the button is pressed.</param>\n    /// <returns>An instance of <see cref=\"ActionSheetButton\"/>.</returns>\n    public static IActionSheetButton CreateDestroyButton(string text, Func<Task> asyncCallback) =>\n        CreateButtonInternal(text, null, asyncCallback, isDestroy: true);\n\n    /// <summary>\n    /// Creates a new instance of <see cref=\"ActionSheetButton\"/> that displays as a \"destroy button\".\n    /// </summary>\n    /// <param name=\"text\">The button text.</param>\n    /// <param name=\"action\">The action to execute when the button is pressed.</param>\n    /// <param name=\"parameter\">The parameter to pass to the action when the button is pressed.</param>\n    /// <returns>An instance of <see cref=\"ActionSheetButton\"/>.</returns>\n    public static IActionSheetButton CreateDestroyButton<T>(string text, Action<T> action, T parameter) =>\n        CreateButtonInternal(text, action, null, parameter, isDestroy: true);\n\n    /// <summary>\n    /// Creates a new instance of <see cref=\"ActionSheetButton\"/> that displays as a \"destroy button\".\n    /// </summary>\n    /// <param name=\"text\">The button text.</param>\n    /// <param name=\"asyncCallback\">The action to execute when the button is pressed.</param>\n    /// <param name=\"parameter\">The parameter to pass to the action when the button is pressed.</param>\n    /// <returns>An instance of <see cref=\"ActionSheetButton\"/>.</returns>\n    public static IActionSheetButton CreateDestroyButton<T>(string text, Func<T, Task> asyncCallback, T parameter) =>\n        CreateButtonInternal(text, null, asyncCallback, parameter, isDestroy: true);\n\n    /// <summary>\n    /// Creates a new instance of <see cref=\"ActionSheetButton\"/> that displays as an \"other button\".\n    /// </summary>\n    /// <param name=\"text\">The button text.</param>\n    /// <param name=\"action\">The action to execute when the button is pressed.</param>\n    /// <returns>An instance of <see cref=\"ActionSheetButton\"/>.</returns>\n    public static IActionSheetButton CreateButton(string text, Action action) =>\n        CreateButtonInternal(text, action, null);\n\n    /// <summary>\n    /// Creates a new instance of <see cref=\"ActionSheetButton\"/> that displays as an \"other button\".\n    /// </summary>\n    /// <param name=\"text\">The button text.</param>\n    /// <param name=\"asyncCallback\">The action to execute when the button is pressed.</param>\n    /// <returns>An instance of <see cref=\"ActionSheetButton\"/>.</returns>\n    public static IActionSheetButton CreateButton(string text, Func<Task> asyncCallback) =>\n        CreateButtonInternal(text, null, asyncCallback);\n\n    /// <summary>\n    /// Creates a new instance of <see cref=\"ActionSheetButton\"/> that displays as an \"other button\".\n    /// </summary>\n    /// <param name=\"text\">The button text.</param>\n    /// <param name=\"action\">The action to execute when the button is pressed.</param>\n    /// <param name=\"parameter\">The parameter to pass to the action when the button is pressed.</param>\n    /// <returns>An instance of <see cref=\"ActionSheetButton\"/>.</returns>\n    public static IActionSheetButton CreateButton<T>(string text, Action<T> action, T parameter) =>\n        CreateButtonInternal(text, action, null, parameter);\n\n    /// <summary>\n    /// Creates a new instance of <see cref=\"ActionSheetButton\"/> that displays as an \"other button\".\n    /// </summary>\n    /// <param name=\"text\">The button text.</param>\n    /// <param name=\"asyncCallback\">The action to execute when the button is pressed.</param>\n    /// <param name=\"parameter\">The parameter to pass to the action when the button is pressed.</param>\n    /// <returns>An instance of <see cref=\"ActionSheetButton\"/>.</returns>\n    public static IActionSheetButton CreateButton<T>(string text, Func<T, Task> asyncCallback, T parameter) =>\n        CreateButtonInternal(text, null, asyncCallback, parameter);\n\n    private static IActionSheetButton CreateButtonInternal(string text, Action action, Func<Task> asyncCallback, bool isCancel = false, bool isDestroy = false) =>\n        new ActionSheetButton()\n        {\n            Text = text,\n            Action = action,\n            AsyncCallback = asyncCallback,\n            IsCancel = isCancel,\n            IsDestroy = isDestroy,\n        };\n\n    private static IActionSheetButton CreateButtonInternal<T>(string text, Action<T> action, Func<T, Task> asyncCallback, T parameter, bool isCancel = false, bool isDestroy = false) =>\n        new ActionSheetButton<T>()\n        {\n            Text = text,\n            Action = action,\n            AsyncCallback = asyncCallback,\n            Parameter = parameter,\n            IsCancel = isCancel,\n            IsDestroy = isDestroy,\n        };\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Services/PageDialogs/ActionSheetButtonBase.cs",
    "content": "﻿namespace Prism.Services;\n\n/// <summary>\n/// ActionSheetButton Base class\n/// </summary>\npublic abstract class ActionSheetButtonBase : IActionSheetButton\n{\n    /// <summary>\n    /// Base class for action sheet buttons.\n    /// </summary>\n    protected ActionSheetButtonBase()\n    {\n\n    }\n\n    /// <summary>\n    /// Gets a value indicating whether this <see cref=\"IActionSheetButton\"/> is cancel.\n    /// </summary>\n    /// <value><c>true</c> if is cancel; otherwise, <c>false</c>.</value>\n    protected bool _isCancel { get; private set; }\n\n    /// <summary>\n    /// Gets a value indicating whether this <see cref=\"IActionSheetButton\"/> is destroy.\n    /// </summary>\n    /// <value><c>true</c> if is destroy; otherwise, <c>false</c>.</value>\n    protected bool _isDestroy { get; private set; }\n\n    /// <summary>\n    /// The backing text for <see cref=\"IActionSheetButton\"/>.\n    /// </summary>\n    /// <value>The text.</value>\n    protected string _text { get; private set; }\n\n    /// <summary>\n    /// Gets or sets a value indicating whether the button will be used as a Cancel Button.\n    /// </summary>\n    /// <value><c>true</c> if is cancel; otherwise, <c>false</c>.</value>\n    public bool IsCancel\n    {\n        get => _isCancel;\n        protected internal set\n        {\n            if (_isCancel = value)\n                IsDestroy = false;\n        }\n    }\n\n    /// <summary>\n    /// Gets or sets a value indicating whether the button will be used as a Destroy Button.\n    /// </summary>\n    /// <value><c>true</c> if is destroy; otherwise, <c>false</c>.</value>\n    public bool IsDestroy\n    {\n        get => _isDestroy;\n        protected internal set\n        {\n            if (_isDestroy = value)\n                IsCancel = false;\n        }\n    }\n\n    /// <summary>\n    /// Gets or sets the text of the button.\n    /// </summary>\n    /// <value>The text.</value>\n    public string Text\n    {\n        get => _text;\n        protected internal set => _text = value;\n    }\n\n    /// <summary>\n    /// Executes the action to take when the button is pressed.\n    /// </summary>\n    protected abstract Task OnButtonPressed();\n\n    /// <inheritdoc />\n    bool IActionSheetButton.IsCancel => _isCancel;\n\n    /// <inheritdoc />\n    bool IActionSheetButton.IsDestroy => _isDestroy;\n\n    /// <inheritdoc />\n    string IActionSheetButton.Text => _text;\n\n    /// <inheritdoc />\n    Task IActionSheetButton.PressButton() =>\n       OnButtonPressed();\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Services/PageDialogs/ActionSheetButton{T}.cs",
    "content": "﻿namespace Prism.Services;\n\n/// <summary>\n/// Provides a Generic Implementation for IActionSheetButton\n/// </summary>\npublic class ActionSheetButton<T> : ActionSheetButtonBase\n{\n    protected internal ActionSheetButton()\n    {\n\n    }\n\n    /// <summary>\n    /// Generic Action to perform\n    /// </summary>\n    /// <value>The action.</value>\n    public Action<T> Action { get; set; }\n\n    public Func<T, Task> AsyncCallback { get; set; }\n\n    /// <summary>\n    /// Typed Parameter\n    /// </summary>\n    /// <value>The parameter.</value>\n    public T Parameter { get; set; }\n\n    /// <summary>\n    /// Executes the action to take when the button is pressed\n    /// </summary>\n    protected override async Task OnButtonPressed()\n    {\n        Action?.Invoke(Parameter);\n        if (AsyncCallback != null)\n            await AsyncCallback(Parameter);\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Services/PageDialogs/IActionSheetButton.cs",
    "content": "﻿namespace Prism.Services;\n\n/// <summary>\n/// Convenient contract to enable executing commands directly when using <see cref=\"IPageDialogService.DisplayActionSheetAsync(string, IActionSheetButton[])\"/>\n/// </summary>\npublic interface IActionSheetButton\n{\n    /// <summary>\n    /// The button will be used as destroy\n    /// </summary>\n    bool IsDestroy { get; }\n\n    /// <summary>\n    /// The button will be used as cancel\n    /// </summary>\n    bool IsCancel { get; }\n\n    /// <summary>\n    /// Text to display in the action sheet\n    /// </summary>\n    string Text { get; }\n\n    /// <summary>\n    /// Presses the button.\n    /// </summary>\n    Task PressButton();\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Services/PageDialogs/IPageDialogService.cs",
    "content": "﻿using Prism.AppModel;\nusing FlowDirection = Prism.AppModel.FlowDirection;\n\nnamespace Prism.Services;\n\n/// <summary>\n/// A service which provides access to the DisplayAlert and DisplayActionSheet off of the Microsoft.Maui.Controls.Page class.\n/// </summary>\npublic interface IPageDialogService\n{\n    /// <summary>\n    /// Presents an alert dialog to the application user with an accept and a cancel button.\n    /// </summary>\n    /// <para>\n    /// The <paramref name=\"message\"/> can be empty.\n    /// </para>\n    /// <param name=\"title\">Title to display.</param>\n    /// <param name=\"message\">Message to display.</param>\n    /// <param name=\"acceptButton\">Text for the accept button.</param>\n    /// <param name=\"cancelButton\">Text for the cancel button.</param>\n    /// <returns><c>true</c> if non-destructive button pressed; otherwise <c>false</c>/></returns>\n    Task<bool> DisplayAlertAsync(string title, string message, string acceptButton, string cancelButton);\n\n    /// <summary>\n    /// Presents an alert dialog to the application user with an accept and a cancel button.\n    /// </summary>\n    /// <para>\n    /// The <paramref name=\"message\"/> can be empty.\n    /// </para>\n    /// <param name=\"title\">Title to display.</param>\n    /// <param name=\"message\">Message to display.</param>\n    /// <param name=\"acceptButton\">Text for the accept button.</param>\n    /// <param name=\"cancelButton\">Text for the cancel button.</param>\n    /// <param name=\"flowDirection\">The Text flow direction.</param>\n    /// <returns><c>true</c> if non-destructive button pressed; otherwise <c>false</c>/></returns>\n    Task<bool> DisplayAlertAsync(string title, string message, string acceptButton, string cancelButton, FlowDirection flowDirection);\n\n    /// <summary>\n    /// Presents an alert dialog to the application user with a single cancel button.\n    /// </summary>\n    /// <para>\n    /// The <paramref name=\"message\"/> can be empty.\n    /// </para>\n    /// <param name=\"title\">Title to display.</param>\n    /// <param name=\"message\">Message to display.</param>\n    /// <param name=\"cancelButton\">Text for the cancel button.</param>\n    /// <returns></returns>\n    Task DisplayAlertAsync(string title, string message, string cancelButton);\n\n    /// <summary>\n    /// Presents an alert dialog to the application user with a single cancel button.\n    /// </summary>\n    /// <para>\n    /// The <paramref name=\"message\"/> can be empty.\n    /// </para>\n    /// <param name=\"title\">Title to display.</param>\n    /// <param name=\"message\">Message to display.</param>\n    /// <param name=\"cancelButton\">Text for the cancel button.</param>\n    /// <param name=\"flowDirection\">The Text flow direction.</param>\n    /// <returns></returns>\n    Task DisplayAlertAsync(string title, string message, string cancelButton, FlowDirection flowDirection);\n\n    /// <summary>\n    /// Displays a native platform action sheet, allowing the application user to choose from several buttons.\n    /// </summary>\n    /// <param name=\"title\">Title to display in view.</param>\n    /// <param name=\"cancelButton\">Text for the cancel button.</param>\n    /// <param name=\"destroyButton\">Text for the ok button.</param>\n    /// <param name=\"otherButtons\">Text for other buttons.</param>\n    /// <returns>Text for the pressed button</returns>\n    Task<string> DisplayActionSheetAsync(string title, string cancelButton, string destroyButton, params string[] otherButtons);\n\n    /// <summary>\n    /// Displays a native platform action sheet, allowing the application user to choose from several buttons.\n    /// </summary>\n    /// <param name=\"title\">Title to display in view.</param>\n    /// <param name=\"cancelButton\">Text for the cancel button.</param>\n    /// <param name=\"destroyButton\">Text for the ok button.</param>\n    /// <param name=\"flowDirection\">The Text flow direction.</param>\n    /// <param name=\"otherButtons\">Text for other buttons.</param>\n    /// <returns>Text for the pressed button</returns>\n    Task<string> DisplayActionSheetAsync(string title, string cancelButton, string destroyButton, FlowDirection flowDirection, params string[] otherButtons);\n\n    /// <summary>\n    /// Displays a native platform action sheet, allowing the application user to choose from several buttons.\n    /// </summary>\n    /// <para>\n    /// The text displayed in the action sheet will be the value for <see cref=\"IActionSheetButton.Text\"/> and when pressed\n    /// the callback action will be executed.\n    /// </para>\n    /// <param name=\"title\">Text to display in action sheet</param>\n    /// <param name=\"buttons\">Buttons displayed in action sheet</param>\n    /// <returns></returns>\n    Task DisplayActionSheetAsync(string title, params IActionSheetButton[] buttons);\n\n    /// <summary>\n    /// Displays a native platform action sheet, allowing the application user to choose from several buttons.\n    /// </summary>\n    /// <para>\n    /// The text displayed in the action sheet will be the value for <see cref=\"IActionSheetButton.Text\"/> and when pressed\n    /// the callback action will be executed.\n    /// </para>\n    /// <param name=\"title\">Text to display in action sheet</param>\n    /// <param name=\"flowDirection\">The Text flow direction.</param>\n    /// <param name=\"buttons\">Buttons displayed in action sheet</param>\n    /// <returns></returns>\n    Task DisplayActionSheetAsync(string title, FlowDirection flowDirection, params IActionSheetButton[] buttons);\n\n    /// <summary>\n    /// Displays a native platform prompt, allowing the application user to enter a string.\n    /// </summary>\n    /// <param name=\"title\">Title to display</param>\n    /// <param name=\"message\">Message to display</param>\n    /// <param name=\"accept\">Text for the accept button</param>\n    /// <param name=\"cancel\">Text for the cancel button</param>\n    /// <param name=\"placeholder\">Placeholder text to display in the prompt</param>\n    /// <param name=\"maxLength\">Maximum length of the user response</param>\n    /// <param name=\"keyboardType\">Keyboard type to use for the user response</param>\n    /// <param name=\"initialValue\">Pre-defined response that will be displayed, and which can be edited</param>\n    /// <returns><c>string</c> entered by the user. <c>null</c> if cancel is pressed</returns>\n    Task<string> DisplayPromptAsync(string title, string message, string accept = \"OK\", string cancel = \"Cancel\", string placeholder = default, int maxLength = -1, KeyboardType keyboardType = KeyboardType.Default, string initialValue = \"\");\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Services/PageDialogs/PageDialogService.cs",
    "content": "using Prism.AppModel;\nusing Prism.Navigation;\nusing FlowDirection = Prism.AppModel.FlowDirection;\nusing MauiFlow = Microsoft.Maui.FlowDirection;\n\nnamespace Prism.Services;\n\n/// <summary>\n/// Implementation of the <see cref=\"IPageDialogService\"/>\n/// </summary>\npublic class PageDialogService : IPageDialogService\n{\n    private IWindowManager _windowManager { get; }\n    /// <summary>\n    /// Gets the <see cref=\"IKeyboardMapper\"/>.\n    /// </summary>\n    protected IKeyboardMapper _keyboardMapper { get; }\n\n    /// <summary>\n    /// Creates a new <see cref=\"IPageDialogService\"/>\n    /// </summary>\n    /// <param name=\"windowManager\">The <see cref=\"IWindowManager\"/>.</param>\n    /// <param name=\"keyboardMapper\">The <see cref=\"IKeyboardMapper\"/>.</param>\n    public PageDialogService(IWindowManager windowManager, IKeyboardMapper keyboardMapper)\n    {\n        _windowManager = windowManager;\n        _keyboardMapper = keyboardMapper;\n    }\n\n    /// <summary>\n    /// Presents an alert dialog to the application user with an accept and a cancel button.\n    /// </summary>\n    /// <para>\n    /// The <paramref name=\"message\"/> can be empty.\n    /// </para>\n    /// <param name=\"title\">Title to display.</param>\n    /// <param name=\"message\">Message to display.</param>\n    /// <param name=\"acceptButton\">Text for the accept button.</param>\n    /// <param name=\"cancelButton\">Text for the cancel button.</param>\n    /// <returns><c>true</c> if non-destructive button pressed; otherwise <c>false</c>/></returns>\n    public virtual Task<bool> DisplayAlertAsync(string title, string message, string acceptButton, string cancelButton)\n    {\n        return DisplayAlertAsync(title, message, acceptButton, cancelButton, FlowDirection.MatchParent);\n    }\n\n    /// <summary>\n    /// Presents an alert dialog to the application user with an accept and a cancel button.\n    /// </summary>\n    /// <para>\n    /// The <paramref name=\"message\"/> can be empty.\n    /// </para>\n    /// <param name=\"title\">Title to display.</param>\n    /// <param name=\"message\">Message to display.</param>\n    /// <param name=\"acceptButton\">Text for the accept button.</param>\n    /// <param name=\"cancelButton\">Text for the cancel button.</param>\n    /// <param name=\"flowDirection\">The Text flow direction.</param>\n    /// <returns><c>true</c> if non-destructive button pressed; otherwise <c>false</c>/></returns>\n    public virtual Task<bool> DisplayAlertAsync(string title, string message, string acceptButton, string cancelButton, FlowDirection flowDirection)\n    {\n        return GetPage().DisplayAlert(title, message, acceptButton, cancelButton, (MauiFlow)flowDirection);\n    }\n\n    /// <summary>\n    /// Presents an alert dialog to the application user with a single cancel button.\n    /// </summary>\n    /// <para>\n    /// The <paramref name=\"message\"/> can be empty.\n    /// </para>\n    /// <param name=\"title\">Title to display.</param>\n    /// <param name=\"message\">Message to display.</param>\n    /// <param name=\"cancelButton\">Text for the cancel button.</param>\n    /// <returns></returns>\n    public virtual Task DisplayAlertAsync(string title, string message, string cancelButton)\n    {\n        return GetPage().DisplayAlert(title, message, cancelButton);\n    }\n\n    /// <summary>\n    /// Presents an alert dialog to the application user with a single cancel button.\n    /// </summary>\n    /// <para>\n    /// The <paramref name=\"message\"/> can be empty.\n    /// </para>\n    /// <param name=\"title\">Title to display.</param>\n    /// <param name=\"message\">Message to display.</param>\n    /// <param name=\"cancelButton\">Text for the cancel button.</param>\n    /// <param name=\"flowDirection\">The Text flow direction.</param>\n    /// <returns></returns>\n    public virtual Task DisplayAlertAsync(string title, string message, string cancelButton, FlowDirection flowDirection)\n    {\n        return GetPage().DisplayAlert(title, message, cancelButton, (MauiFlow)flowDirection);\n    }\n\n    /// <summary>\n    /// Displays a native platform action sheet, allowing the application user to choose from several buttons.\n    /// </summary>\n    /// <param name=\"title\">Title to display in view.</param>\n    /// <param name=\"cancelButton\">Text for the cancel button.</param>\n    /// <param name=\"destroyButton\">Text for the ok button.</param>\n    /// <param name=\"otherButtons\">Text for other buttons.</param>\n    /// <returns>Text for the pressed button</returns>\n    public virtual Task<string> DisplayActionSheetAsync(string title, string cancelButton, string destroyButton, params string[] otherButtons)\n    {\n        return DisplayActionSheetAsync(title, cancelButton, destroyButton, FlowDirection.MatchParent, otherButtons);\n    }\n\n    /// <summary>\n    /// Displays a native platform action sheet, allowing the application user to choose from several buttons.\n    /// </summary>\n    /// <param name=\"title\">Title to display in view.</param>\n    /// <param name=\"cancelButton\">Text for the cancel button.</param>\n    /// <param name=\"destroyButton\">Text for the ok button.</param>\n    /// <param name=\"flowDirection\">The Text flow direction.</param>\n    /// <param name=\"otherButtons\">Text for other buttons.</param>\n    /// <returns>Text for the pressed button</returns>\n    public virtual Task<string> DisplayActionSheetAsync(string title, string cancelButton, string destroyButton, FlowDirection flowDirection, params string[] otherButtons)\n    {\n        return GetPage().DisplayActionSheet(title, cancelButton, destroyButton, (MauiFlow)flowDirection, otherButtons);\n    }\n\n    /// <summary>\n    /// Displays a native platform action sheet, allowing the application user to choose from several buttons.\n    /// </summary>\n    /// <para>\n    /// The text displayed in the action sheet will be the value for <see cref=\"IActionSheetButton.Text\"/> and when pressed\n    /// the <see cref=\"System.Windows.Input.ICommand\"/> or <see cref=\"Action\"/> will be executed.\n    /// </para>\n    /// <param name=\"title\">Text to display in action sheet</param>\n    /// <param name=\"buttons\">Buttons displayed in action sheet</param>\n    /// <returns></returns>\n    public virtual async Task DisplayActionSheetAsync(string title, params IActionSheetButton[] buttons)\n    {\n        await DisplayActionSheetAsync(title, FlowDirection.MatchParent, buttons);\n    }\n\n    /// <summary>\n    /// Displays a native platform action sheet, allowing the application user to choose from several buttons.\n    /// </summary>\n    /// <para>\n    /// The text displayed in the action sheet will be the value for <see cref=\"IActionSheetButton.Text\"/> and when pressed\n    /// the callback action will be executed.\n    /// </para>\n    /// <param name=\"title\">Text to display in action sheet</param>\n    /// <param name=\"flowDirection\">The Text flow direction.</param>\n    /// <param name=\"buttons\">Buttons displayed in action sheet</param>\n    /// <returns></returns>\n    public virtual async Task DisplayActionSheetAsync(string title, FlowDirection flowDirection, params IActionSheetButton[] buttons)\n    {\n        if (buttons == null || buttons.All(b => b == null))\n            throw new ArgumentException(\"At least one button needs to be supplied\", nameof(buttons));\n\n        var destroyButton = buttons.FirstOrDefault(button => button != null && button.IsDestroy);\n        var cancelButton = buttons.FirstOrDefault(button => button != null && button.IsCancel);\n        var otherButtonsText = buttons.Where(button => button != null && !(button.IsDestroy || button.IsCancel)).Select(b => b.Text).ToArray();\n\n        var pressedButton = await DisplayActionSheetAsync(title, cancelButton?.Text, destroyButton?.Text, flowDirection, otherButtonsText);\n\n        foreach (var button in buttons.Where(button => button != null && button.Text.Equals(pressedButton)))\n        {\n            await button.PressButton();\n            return;\n        }\n    }\n\n    /// <summary>\n    /// Displays a native platform prompt, allowing the application user to enter a string.\n    /// </summary>\n    /// <param name=\"title\">Title to display</param>\n    /// <param name=\"message\">Message to display</param>\n    /// <param name=\"accept\">Text for the accept button</param>\n    /// <param name=\"cancel\">Text for the cancel button</param>\n    /// <param name=\"placeholder\">Placeholder text to display in the prompt</param>\n    /// <param name=\"maxLength\">Maximum length of the user response</param>\n    /// <param name=\"keyboardType\">Keyboard type to use for the user response</param>\n    /// <param name=\"initialValue\">Pre-defined response that will be displayed, and which can be edited</param>\n    /// <returns><c>string</c> entered by the user. <c>null</c> if cancel is pressed</returns>\n    public virtual Task<string> DisplayPromptAsync(string title, string message, string accept = \"OK\", string cancel = \"Cancel\", string placeholder = default, int maxLength = -1, KeyboardType keyboardType = KeyboardType.Default, string initialValue = \"\")\n    {\n        var keyboard = _keyboardMapper.Map(keyboardType);\n        return GetPage().DisplayPromptAsync(title, message, accept, cancel, placeholder, maxLength, keyboard, initialValue);\n    }\n\n    private Page GetPage()\n    {\n        if (_windowManager.Current is not PrismWindow window)\n            throw new InvalidOperationException(\"There is no Prism Window currently displayed.\");\n\n        return window.CurrentPage;\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Xaml/DynamicTab.cs",
    "content": "namespace Prism.Xaml;\n\npublic static class DynamicTab\n{\n    public static readonly BindableProperty TitleProperty =\n        BindableProperty.CreateAttached(nameof(Page.Title), typeof(string), typeof(DynamicTab), null, BindingMode.OneWay, defaultValueCreator: CreateDefaultTitle);\n\n    public static string GetTitle(BindableObject bindable) =>\n        (string)bindable.GetValue(TitleProperty);\n\n    public static void SetTitle(BindableObject bindable, string title) =>\n        bindable.SetValue(TitleProperty, title);\n\n    private static object CreateDefaultTitle(BindableObject bindable)\n    {\n        if (bindable is Page page)\n        {\n            return page.Title;\n        }\n\n        return null;\n    }\n\n    public static readonly BindableProperty IconImageSourceProperty =\n        BindableProperty.CreateAttached(nameof(Page.IconImageSource), typeof(ImageSource), typeof(DynamicTab), null, BindingMode.OneWay, defaultValueCreator: CreateDefaultIconImageSource);\n\n    public static ImageSource GetIconImageSource(BindableObject bindable) =>\n        (ImageSource)bindable.GetValue(IconImageSourceProperty);\n\n    public static void SetIconImageSource(BindableObject bindable, ImageSource imageSource) =>\n        bindable.SetValue(IconImageSourceProperty, imageSource);\n\n    private static object CreateDefaultIconImageSource(BindableObject bindable)\n    {\n        if (bindable is Page page)\n        {\n            return page.IconImageSource;\n        }\n\n        return null;\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Xaml/Parameter.cs",
    "content": "﻿\nnamespace Prism.Xaml;\n\n/// <summary>\n/// Represents a parameter used in XAML markup.\n/// </summary>\npublic class Parameter : BindableObject\n{\n    /// <summary>\n    /// Gets or sets the key associated with the parameter.\n    /// </summary>\n    public string Key { get; set; }\n\n    /// <summary>\n    /// Identifies the <see cref=\"Value\"/> bindable property.\n    /// </summary>\n    public static readonly BindableProperty ValueProperty =\n        BindableProperty.Create(nameof(Value), typeof(object), typeof(Parameter));\n\n    /// <summary>\n    /// Gets or sets the value of the parameter.\n    /// </summary>\n    public object Value\n    {\n        get => GetValue(ValueProperty);\n        set => SetValue(ValueProperty, value);\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Xaml/ParameterExtension.cs",
    "content": "﻿\nnamespace Prism.Xaml;\n\n/// <summary>\n/// XAML Extension for INavigation and IDialog parameters\n/// </summary>\npublic class ParameterExtension : Parameter, IMarkupExtension<Parameter>\n{\n    /// <summary>\n    /// Method to retrieve value for parameter\n    /// </summary>\n    /// <param name=\"serviceProvider\">The service that supplies the parameters value</param>\n    /// <returns>The instance of the ParameterExtension class</returns>\n    public Parameter ProvideValue(IServiceProvider serviceProvider) =>\n        this;\n\n    /// <summary>\n    /// Method to retrieve value for parameter\n    /// </summary>\n    /// <param name=\"serviceProvider\">The service that supplies the parameters value</param>\n    /// <returns>The return value from <see cref=\"ProvideValue(IServiceProvider)\"/></returns>\n    object IMarkupExtension.ProvideValue(IServiceProvider serviceProvider) =>\n        ProvideValue(serviceProvider);\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Xaml/ParameterExtensions.cs",
    "content": "﻿using Prism.Navigation;\nusing Prism.Dialogs;\n\nnamespace Prism.Xaml;\n\ninternal static class ParameterExtensions\n{\n    public static INavigationParameters ToNavigationParameters(this object parameter, BindableObject parent)\n    {\n        parameter = parameter ?? new NavigationParameters();\n        switch (parameter)\n        {\n            case INavigationParameters parameters:\n                return parameters;\n            case Parameter xamlParameter:\n                xamlParameter.BindingContext = xamlParameter.BindingContext ?? parent.BindingContext;\n                return new NavigationParameters { { xamlParameter.Key, xamlParameter.Value } };\n            case Parameters xamlParameters:\n                xamlParameters.BindingContext = xamlParameters.BindingContext ?? parent.BindingContext;\n                return xamlParameters.ToParameters<NavigationParameters>(parent);\n            default:\n                return new NavigationParameters { { KnownNavigationParameters.XamlParam, parameter } };\n        }\n    }\n\n    public static IDialogParameters ToDialogParameters(this object parameter, BindableObject parent)\n    {\n        parameter = parameter ?? new DialogParameters();\n        switch (parameter)\n        {\n            case IDialogParameters parameters:\n                return parameters;\n            case Parameter xamlParameter:\n                xamlParameter.BindingContext = xamlParameter.BindingContext ?? parent.BindingContext;\n                return new DialogParameters { { xamlParameter.Key, xamlParameter.Value } };\n            case Parameters xamlParameters:\n                xamlParameters.BindingContext = xamlParameters.BindingContext ?? parent.BindingContext;\n                return xamlParameters.ToParameters<DialogParameters>(parent);\n            default:\n                return new DialogParameters { { KnownDialogParameters.XamlParam, parameter } };\n        }\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Xaml/Parameters.cs",
    "content": "using System.Collections;\n\nnamespace Prism.Xaml;\n\n/// <summary>\n/// Represents a collection of parameters used for navigation.\n/// </summary>\npublic class Parameters : BindableObject, IList<Parameter>\n{\n    /// <summary>\n    /// Identifies the <see cref=\"ItemsSource\"/> bindable property.\n    /// </summary>\n    public static readonly BindableProperty ItemsSourceProperty =\n        BindableProperty.Create(nameof(ItemsSource), typeof(IDictionary), typeof(Parameters), null, propertyChanged: OnItemsSourceChanged);\n\n    private static void OnItemsSourceChanged(BindableObject bindable, object oldValue, object newValue)\n    {\n        if (bindable is Parameters parameters)\n        {\n            parameters.Clear();\n            foreach (KeyValuePair<string, object> item in parameters.ItemsSource)\n            {\n                parameters.Add(new Parameter { Key = item.Key, Value = item.Value });\n            }\n        }\n    }\n\n    /// <summary>\n    /// Identifies the <see cref=\"Parent\"/> bindable property.\n    /// </summary>\n    public static readonly BindableProperty ParentProperty = BindableProperty.Create(nameof(Parent),\n        typeof(BindableObject),\n        typeof(Parameters),\n        default(BindableObject), propertyChanged: OnParentPropertyChanged);\n\n    private readonly IList<Parameter> _list = new List<Parameter>();\n\n    /// <summary>\n    /// Gets or sets the items source for the parameters.\n    /// </summary>\n    public IDictionary ItemsSource\n    {\n        get => (IDictionary)GetValue(ItemsSourceProperty);\n        set => SetValue(ItemsSourceProperty, value);\n    }\n\n    /// <summary>\n    /// Gets or sets the parent object for the parameters.\n    /// </summary>\n    /// <remarks>\n    /// This is used to set the BindingContext of the CommandParameters to the BindingContext of its parent.\n    /// </remarks>\n    public BindableObject Parent\n    {\n        get => (BindableObject)GetValue(ParentProperty);\n        set => SetValue(ParentProperty, value);\n    }\n\n    /// <summary>\n    /// Adds a parameter to the collection.\n    /// </summary>\n    /// <param name=\"item\">The parameter to add.</param>\n    public void Add(Parameter item) => _list.Add(item);\n\n    /// <summary>\n    /// Removes all parameters from the collection.\n    /// </summary>\n    public void Clear() => _list.Clear();\n\n    /// <summary>\n    /// Determines whether the collection contains a specific parameter.\n    /// </summary>\n    /// <param name=\"item\">The parameter to locate in the collection.</param>\n    /// <returns>true if the parameter is found; otherwise, false.</returns>\n    public bool Contains(Parameter item) => _list.Contains(item);\n\n    /// <summary>\n    /// Copies the elements of the collection to an array, starting at a particular array index.\n    /// </summary>\n    /// <param name=\"array\">The one-dimensional array that is the destination of the elements copied from the collection.</param>\n    /// <param name=\"arrayIndex\">The zero-based index in array at which copying begins.</param>\n    public void CopyTo(Parameter[] array, int arrayIndex) => _list.CopyTo(array, arrayIndex);\n\n    /// <summary>\n    /// Gets the number of parameters in the collection.\n    /// </summary>\n    public int Count => _list.Count;\n\n    /// <summary>\n    /// Returns an enumerator that iterates through the collection.\n    /// </summary>\n    /// <returns>An enumerator that can be used to iterate through the collection.</returns>\n    public IEnumerator<Parameter> GetEnumerator() => _list.GetEnumerator();\n\n    /// <summary>\n    /// Returns the zero-based index of the first occurrence of a specific parameter in the collection.\n    /// </summary>\n    /// <param name=\"item\">The parameter to locate in the collection.</param>\n    /// <returns>The zero-based index of the first occurrence of item within the entire collection, if found; otherwise, -1.</returns>\n    public int IndexOf(Parameter item) => _list.IndexOf(item);\n\n    /// <summary>\n    /// Inserts a parameter into the collection at the specified index.\n    /// </summary>\n    /// <param name=\"index\">The zero-based index at which the parameter should be inserted.</param>\n    /// <param name=\"item\">The parameter to insert.</param>\n    public void Insert(int index, Parameter item) => _list.Insert(index, item);\n\n    /// <inheritdoc/>\n    public bool IsReadOnly => _list.IsReadOnly;\n\n    /// <summary>\n    /// Gets or sets the parameter at the specified index.\n    /// </summary>\n    /// <param name=\"index\">The zero-based index of the parameter to get or set.</param>\n    /// <returns>The parameter at the specified index.</returns>\n    public Parameter this[int index]\n    {\n        get => _list[index];\n        set => _list[index] = value;\n    }\n\n    /// <summary>\n    /// Removes the first occurrence of a specific parameter from the collection.\n    /// </summary>\n    /// <param name=\"item\">The parameter to remove.</param>\n    /// <returns>true if the parameter is successfully removed; otherwise, false.</returns>\n    public bool Remove(Parameter item) => _list.Remove(item);\n\n    /// <summary>\n    /// Removes the parameter at the specified index from the collection.\n    /// </summary>\n    /// <param name=\"index\">The zero-based index of the parameter to remove.</param>\n    public void RemoveAt(int index) => _list.RemoveAt(index);\n\n    public T ToParameters<T>(BindableObject parent)\n        where T : Common.ParametersBase\n    {\n        Parent = Parent ?? parent;\n        var parameters = (T)Activator.CreateInstance(typeof(T));\n        parameters.FromParameters(_list.Select(x => new KeyValuePair<string, object>(x.Key, x.Value)));\n\n        return parameters;\n    }\n\n    private static void OnParentPropertyChanged(BindableObject bindable, object oldvalue, object newvalue)\n    {\n        if (oldvalue == newvalue) return;\n\n        var self = (Parameters)bindable;\n        if (oldvalue is BindableObject oldParent)\n            oldParent.BindingContextChanged -= BindingContextChanged;\n\n        if (newvalue is BindableObject newParent)\n            newParent.BindingContextChanged += BindingContextChanged;\n\n        void BindingContextChanged(object parentObject, EventArgs args)\n        {\n            var parent = (BindableObject)parentObject;\n            self.BindingContext = parent?.BindingContext;\n        }\n    }\n\n    /// <inheritdoc/>\n    protected override void OnBindingContextChanged()\n    {\n        foreach (var param in this)\n        {\n            param.BindingContext = BindingContext;\n        }\n    }\n\n    IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Xaml/TargetAwareExtensionBase.cs",
    "content": "using System.Runtime.CompilerServices;\nusing Microsoft.Extensions.Logging;\nusing Prism.Behaviors;\nusing Prism.Extensions;\nusing Prism.Ioc;\nusing Prism.Navigation.Xaml;\nusing Prism.Properties;\n\nnamespace Prism.Xaml;\n\n/// <summary>\n/// Provides a base class for XAML markup extensions that are aware of their target element and page context.\n/// </summary>\n/// <typeparam name=\"T\">The type of value provided by the markup extension.</typeparam>\npublic abstract class TargetAwareExtensionBase<T> : BindableObject, IMarkupExtension<T>\n{\n    private ILogger _logger;\n\n    /// <summary>\n    /// Gets the <see cref=\"ILogger\"/> instance for logging within the extension.\n    /// </summary>\n    protected ILogger Logger => _logger ??= GetLogger();\n\n    private Page _page;\n\n    /// <summary>\n    /// Gets or sets the <see cref=\"Page\"/> that contains the target element.\n    /// </summary>\n    protected internal Page Page\n    {\n        get => _page;\n        set\n        {\n            OnPropertyChanging(nameof(Page));\n            _page = value;\n            OnPropertyChanged(nameof(Page));\n        }\n    }\n\n    private VisualElement _targetElement;\n\n    /// <summary>\n    /// Gets or sets the target <see cref=\"VisualElement\"/> to which the extension is applied.\n    /// </summary>\n    protected internal VisualElement TargetElement\n    {\n        get => _targetElement;\n        set\n        {\n            OnPropertyChanging(nameof(TargetElement));\n            _targetElement = value;\n            OnPropertyChanged(nameof(TargetElement));\n        }\n    }\n\n    /// <summary>\n    /// Gets the <see cref=\"IContainerProvider\"/> associated with the target element.\n    /// </summary>\n    protected IContainerProvider Container => TargetElement.GetContainerProvider();\n\n    /// <summary>\n    /// Gets or sets the strategy for determining the binding context for the target.\n    /// </summary>\n    public TargetBindingContext TargetBindingContext { get; set; }\n\n    /// <summary>\n    /// Provides the value for the markup extension.\n    /// </summary>\n    /// <param name=\"serviceProvider\">The service provider for the markup extension.</param>\n    /// <returns>The value to set on the property where the extension is applied.</returns>\n    /// <exception cref=\"ArgumentException\">Thrown if the service provider does not provide an <see cref=\"IProvideValueTarget\"/>.</exception>\n    /// <exception cref=\"Exception\">Thrown if the target object is not supported.</exception>\n    T IMarkupExtension<T>.ProvideValue(IServiceProvider serviceProvider)\n    {\n        var valueTargetProvider = serviceProvider.GetService<IProvideValueTarget>();\n\n        if (valueTargetProvider == null)\n            throw new ArgumentException(Resources.ServiceProviderDidNotHaveIProvideValueTarget);\n\n        TargetElement = valueTargetProvider.TargetObject as VisualElement;\n\n        //this is handling the scenario of the extension being used within the EventToCommandBehavior\n        if (TargetElement is null && valueTargetProvider.TargetObject is BehaviorBase<BindableObject> behavior)\n            TargetElement = behavior.AssociatedObject as VisualElement;\n\n        if (TargetElement is null)\n            throw new Exception($\"{valueTargetProvider.TargetObject} is not supported\");\n\n        if (TargetElement.TryGetParentPage(out var page))\n            Page = page;\n        else\n            TargetElement.Behaviors.Add(new ElementParentedCallbackBehavior(() => Page = TargetElement.GetParentPage()));\n\n        return ProvideValue(serviceProvider);\n    }\n\n    /// <summary>\n    /// Provides the value for the markup extension (non-generic implementation).\n    /// </summary>\n    /// <param name=\"serviceProvider\">The service provider for the markup extension.</param>\n    /// <returns>The value to set on the property where the extension is applied.</returns>\n    object IMarkupExtension.ProvideValue(IServiceProvider serviceProvider) =>\n        ((IMarkupExtension<T>)this).ProvideValue(serviceProvider);\n\n    /// <summary>\n    /// When implemented in a derived class, provides the value for the markup extension.\n    /// </summary>\n    /// <param name=\"serviceProvider\">The service provider for the markup extension.</param>\n    /// <returns>The value to set on the property where the extension is applied.</returns>\n    protected abstract T ProvideValue(IServiceProvider serviceProvider);\n\n    /// <summary>\n    /// Gets the <see cref=\"ILogger\"/> instance for the current page context.\n    /// </summary>\n    /// <returns>An <see cref=\"ILogger\"/> instance, or <c>null</c> if the page is not set.</returns>\n    private ILogger GetLogger()\n    {\n        if (Page is null)\n            return null;\n\n        var loggerFactory = Page.GetContainerProvider().Resolve<ILoggerFactory>();\n        return loggerFactory.CreateLogger(GetType().Name);\n    }\n\n    /// <summary>\n    /// Called when a property value changes.\n    /// </summary>\n    /// <param name=\"propertyName\">The name of the property that changed.</param>\n    protected override void OnPropertyChanged([CallerMemberName] string propertyName = null)\n    {\n        base.OnPropertyChanged(propertyName);\n\n        if (propertyName == nameof(TargetElement) || propertyName == nameof(Page))\n        {\n            var source = TargetBindingContext == TargetBindingContext.Element ? TargetElement : Page;\n            if (source is not null)\n                SetBinding(BindingContextProperty, new Binding(nameof(BindingContext), BindingMode.OneWay, source: source));\n        }\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/Xaml/TargetBindingContext.cs",
    "content": "﻿namespace Prism.Xaml;\n\n/// <summary>\n/// Target BindingContext behavior for the <see cref=\"TargetAwareExtensionBase{T}\" />\n/// </summary>\npublic enum TargetBindingContext\n{\n    /// <summary>\n    /// Use the Target Element's Binding Context\n    /// </summary>\n    Element = 0,\n\n    /// <summary>\n    /// Use the Parent Page's Binding Context (usually the ViewModel)\n    /// </summary>\n    Page = 1\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui/build/Package.targets",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<Project>\n  <ItemGroup Condition=\" '$(ImplicitUsings)' == 'true' OR '$(ImplicitUsings)' == 'enable' \">\n    <Using Include=\"Prism.AppModel\" />\n    <Using Include=\"Prism.Services\" />\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": "src/Maui/Prism.Maui.Rx/GlobalNavigationObserver.cs",
    "content": "using System.Reactive.Subjects;\nusing Prism.Events;\n\nnamespace Prism.Navigation;\n\ninternal class GlobalNavigationObserver : IGlobalNavigationObserver, IDisposable\n{\n    private readonly Subject<NavigationRequestContext> _subject;\n    private SubscriptionToken _token;\n\n    public GlobalNavigationObserver(IEventAggregator eventAggregator)\n    {\n        _subject = new Subject<NavigationRequestContext>();\n        _token = eventAggregator.GetEvent<NavigationRequestEvent>().Subscribe(context => _subject.OnNext(context));\n    }\n\n    public IObservable<NavigationRequestContext> NavigationRequest => _subject;\n\n    public void Dispose()\n    {\n        if (_token is null)\n            return;\n\n        _token.Dispose();\n        _token = null;\n        _subject.Dispose();\n    }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui.Rx/IGlobalNavigationObserver.cs",
    "content": "namespace Prism.Navigation;\n\n\npublic interface IGlobalNavigationObserver\n{\n    IObservable<NavigationRequestContext> NavigationRequest { get; }\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui.Rx/NavigationObserverRegistrationExtensions.cs",
    "content": "namespace Prism.Navigation;\n\npublic static class NavigationObserverRegistrationExtensions\n{\n    private static bool s_IsRegistered;\n\n    private static PrismAppBuilder RegisterGlobalNavigationObserver(this PrismAppBuilder builder)\n    {\n        if (s_IsRegistered)\n            return builder;\n\n        s_IsRegistered = true;\n        return builder.RegisterTypes(c => \n            c.RegisterSingleton<IGlobalNavigationObserver, GlobalNavigationObserver>());\n    }\n\n    public static PrismAppBuilder AddGlobalNavigationObserver(this PrismAppBuilder builder, Action<IObservable<NavigationRequestContext>> addObservable) =>\n        builder.RegisterGlobalNavigationObserver()\n        .OnInitialized(c =>\n        {\n            addObservable(c.Resolve<IGlobalNavigationObserver>().NavigationRequest);\n        });\n\n    public static PrismAppBuilder AddGlobalNavigationObserver(this PrismAppBuilder builder, Action<IContainerProvider, IObservable<NavigationRequestContext>> addObservable) =>\n        builder.RegisterGlobalNavigationObserver()\n        .OnInitialized(c =>\n        {\n            addObservable(c, c.Resolve<IGlobalNavigationObserver>().NavigationRequest);\n        });\n}\n"
  },
  {
    "path": "src/Maui/Prism.Maui.Rx/Prism.Maui.Rx.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFrameworks>net9.0;net10.0</TargetFrameworks>\n    <ImplicitUsings>true</ImplicitUsings>\n    <Description>Prism.Maui.Rx is a support package for .NET MAUI developers. This package provides some helpers to access an IObservable for globally handling Navigation Request Results.</Description>\n    <GeneratePackageOnBuild>true</GeneratePackageOnBuild>\n    <UseMaui>true</UseMaui>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Prism.Maui\\Prism.Maui.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"System.Reactive\" />\n  </ItemGroup>\n\n  <Choose>\n    <When Condition=\"$(TargetFramework.StartsWith('net9'))\">\n      <ItemGroup>\n        <PackageReference Include=\"Microsoft.Maui.Controls\" VersionOverride=\"9.0.110\" />\n      </ItemGroup>\n    </When>\n    <When Condition=\"$(TargetFramework.StartsWith('net10'))\">\n      <ItemGroup>\n        <PackageReference Include=\"Microsoft.Maui.Controls\" VersionOverride=\"10.0.10\" />\n      </ItemGroup>\n    </When>\n  </Choose>\n\n</Project>\n"
  },
  {
    "path": "src/Prism.Core/Commands/AsyncDelegateCommand.cs",
    "content": "﻿using System.Linq.Expressions;\nusing System;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing System.Windows.Input;\nusing Prism.Properties;\n\n#nullable enable\nnamespace Prism.Commands;\n\n/// <summary>\n/// Provides an implementation of the <see cref=\"IAsyncCommand\"/>\n/// </summary>\npublic class AsyncDelegateCommand : DelegateCommandBase, IAsyncCommand\n{\n    private bool _enableParallelExecution = false;\n    private bool _isExecuting = false;\n    private readonly Func<CancellationToken, Task> _executeMethod;\n    private Func<bool> _canExecuteMethod;\n    private Func<CancellationToken> _getCancellationToken = () => CancellationToken.None;\n\n    /// <summary>\n    /// Creates a new instance of <see cref=\"AsyncDelegateCommand\"/> with the <see cref=\"Func{Task}\"/> to invoke on execution.\n    /// </summary>\n    /// <param name=\"executeMethod\">The <see cref=\"Func{Task}\"/> to invoke when <see cref=\"ICommand.Execute(object)\"/> is called.</param>\n    public AsyncDelegateCommand(Func<Task> executeMethod)\n#if NET6_0_OR_GREATER\n        : this (c => executeMethod().WaitAsync(c), () => true)\n#else\n        : this(c => executeMethod(), () => true)\n#endif\n    {\n\n    }\n\n    /// <summary>\n    /// Creates a new instance of <see cref=\"AsyncDelegateCommand\"/> with the <see cref=\"Func{Task}\"/> to invoke on execution.\n    /// </summary>\n    /// <param name=\"executeMethod\">The <see cref=\"Func{CancellationToken, Task}\"/> to invoke when <see cref=\"ICommand.Execute(object)\"/> is called.</param>\n    public AsyncDelegateCommand(Func<CancellationToken, Task> executeMethod)\n        : this(executeMethod, () => true)\n    {\n\n    }\n\n    /// <summary>\n    /// Creates a new instance of <see cref=\"DelegateCommand\"/> with the <see cref=\"Func{Task}\"/> to invoke on execution\n    /// and a <see langword=\"Func\" /> to query for determining if the command can execute.\n    /// </summary>\n    /// <param name=\"executeMethod\">The <see cref=\"Func{Task}\"/> to invoke when <see cref=\"ICommand.Execute\"/> is called.</param>\n    /// <param name=\"canExecuteMethod\">The delegate to invoke when <see cref=\"ICommand.CanExecute\"/> is called</param>\n    public AsyncDelegateCommand(Func<Task> executeMethod, Func<bool> canExecuteMethod)\n#if NET6_0_OR_GREATER\n        : this(c => executeMethod().WaitAsync(c), canExecuteMethod)\n#else\n        : this(c => executeMethod(), canExecuteMethod)\n#endif\n    {\n    }\n\n    /// <summary>\n    /// Creates a new instance of <see cref=\"DelegateCommand\"/> with the <see cref=\"Func{Task}\"/> to invoke on execution\n    /// and a <see langword=\"Func\" /> to query for determining if the command can execute.\n    /// </summary>\n    /// <param name=\"executeMethod\">The <see cref=\"Func{CancellationToken, Task}\"/> to invoke when <see cref=\"ICommand.Execute\"/> is called.</param>\n    /// <param name=\"canExecuteMethod\">The delegate to invoke when <see cref=\"ICommand.CanExecute\"/> is called</param>\n    public AsyncDelegateCommand(Func<CancellationToken, Task> executeMethod, Func<bool> canExecuteMethod)\n        : base()\n    {\n        if (executeMethod == null || canExecuteMethod == null)\n            throw new ArgumentNullException(nameof(executeMethod), Resources.DelegateCommandDelegatesCannotBeNull);\n\n        _executeMethod = executeMethod;\n        _canExecuteMethod = canExecuteMethod;\n    }\n\n    /// <summary>\n    /// Gets the current state of the AsyncDelegateCommand\n    /// </summary>\n    public bool IsExecuting\n    {\n        get => _isExecuting;\n        private set => SetProperty(ref _isExecuting, value, OnCanExecuteChanged);\n    }\n\n    ///<summary>\n    /// Executes the command.\n    ///</summary>\n    public async Task Execute(CancellationToken? cancellationToken = null)\n    {\n        var token = cancellationToken ?? _getCancellationToken();\n        try\n        {\n            if (!_enableParallelExecution && IsExecuting)\n                return;\n\n            IsExecuting = true;\n            await _executeMethod(token)\n                .ConfigureAwait(false);\n        }\n        catch (Exception ex)\n        {\n            if (!ExceptionHandler.CanHandle(ex))\n                throw;\n\n            ExceptionHandler.Handle(ex, null);\n        }\n        finally\n        {\n            IsExecuting = false;\n        }\n    }\n\n    /// <summary>\n    /// Determines if the command can be executed.\n    /// </summary>\n    /// <returns>Returns <see langword=\"true\"/> if the command can execute,otherwise returns <see langword=\"false\"/>.</returns>\n    public bool CanExecute()\n    {\n        try\n        {\n            if (!_enableParallelExecution && IsExecuting)\n                return false;\n\n            return _canExecuteMethod?.Invoke() ?? true;\n        }\n        catch (Exception ex)\n        {\n            if (!ExceptionHandler.CanHandle(ex))\n                throw;\n\n            ExceptionHandler.Handle(ex, null);\n\n            return false;\n        }\n    }\n\n    /// <summary>\n    /// Handle the internal invocation of <see cref=\"ICommand.Execute(object)\"/>\n    /// </summary>\n    /// <param name=\"parameter\">Command Parameter</param>\n    protected override async void Execute(object? parameter)\n    {\n        // We don't want to wrap this in a try/catch because we already handle\n        // or mean to rethrow the exception in the call with the CancellationToken.\n        var cancellationToken = _getCancellationToken();\n        await Execute(cancellationToken)\n            .ConfigureAwait(false);\n    }\n\n    /// <summary>\n    /// Handle the internal invocation of <see cref=\"ICommand.CanExecute(object)\"/>\n    /// </summary>\n    /// <param name=\"parameter\"></param>\n    /// <returns><see langword=\"true\"/> if the Command Can Execute, otherwise <see langword=\"false\" /></returns>\n    protected override bool CanExecute(object? parameter)\n    {\n        return CanExecute();\n    }\n\n    /// <summary>\n    /// Enables Parallel Execution of Async Tasks\n    /// </summary>\n    /// <returns>The current instance of <see cref=\"AsyncDelegateCommand\"/>.</returns>\n    public AsyncDelegateCommand EnableParallelExecution()\n    {\n        _enableParallelExecution = true;\n        return this;\n    }\n\n    /// <summary>\n    /// Sets the <see cref=\"CancellationTokenSourceFactory(Func{CancellationToken})\"/> based on the specified timeout.\n    /// </summary>\n    /// <param name=\"timeout\">A specified timeout.</param>\n    /// <returns>The current instance of <see cref=\"AsyncDelegateCommand{T}\"/>.</returns>\n    public AsyncDelegateCommand CancelAfter(TimeSpan timeout) =>\n        CancellationTokenSourceFactory(() => new CancellationTokenSource(timeout).Token);\n\n    /// <summary>\n    /// Provides a delegate callback to provide a default CancellationToken when the Command is invoked.\n    /// </summary>\n    /// <param name=\"factory\">The default <see cref=\"CancellationToken\"/> Factory.</param>\n    /// <returns>The current instance of <see cref=\"AsyncDelegateCommand\"/>.</returns>\n    public AsyncDelegateCommand CancellationTokenSourceFactory(Func<CancellationToken> factory)\n    {\n        _getCancellationToken = factory;\n        return this;\n    }\n\n    /// <summary>\n    /// Observes a property that implements INotifyPropertyChanged, and automatically calls DelegateCommandBase.RaiseCanExecuteChanged on property changed notifications.\n    /// </summary>\n    /// <typeparam name=\"T\">The object type containing the property specified in the expression.</typeparam>\n    /// <param name=\"propertyExpression\">The property expression. Example: ObservesProperty(() => PropertyName).</param>\n    /// <returns>The current instance of <see cref=\"AsyncDelegateCommand\"/>.</returns>\n    public AsyncDelegateCommand ObservesProperty<T>(Expression<Func<T>> propertyExpression)\n    {\n        ObservesPropertyInternal(propertyExpression);\n        return this;\n    }\n\n    /// <summary>\n    /// Observes a property that is used to determine if this command can execute, and if it implements INotifyPropertyChanged it will automatically call DelegateCommandBase.RaiseCanExecuteChanged on property changed notifications.\n    /// </summary>\n    /// <param name=\"canExecuteExpression\">The property expression. Example: ObservesCanExecute(() => PropertyName).</param>\n    /// <returns>The current instance of <see cref=\"AsyncDelegateCommand\"/>.</returns>\n    public AsyncDelegateCommand ObservesCanExecute(Expression<Func<bool>> canExecuteExpression)\n    {\n        _canExecuteMethod = canExecuteExpression.Compile();\n        ObservesPropertyInternal(canExecuteExpression);\n        return this;\n    }\n\n    /// <summary>\n    /// Provides the ability to connect a delegate to catch exceptions encountered by CanExecute or the Execute methods of the DelegateCommand\n    /// </summary>\n    /// <param name=\"catch\">TThe callback when a specific exception is encountered</param>\n    /// <returns>The current instance of <see cref=\"AsyncDelegateCommand\"/>.</returns>\n    public AsyncDelegateCommand Catch<TException>(Action<TException> @catch)\n        where TException : Exception\n    {\n        ExceptionHandler.Register<TException>(@catch);\n        return this;\n    }\n\n    /// <summary>\n    /// Provides the ability to connect a delegate to catch exceptions encountered by CanExecute or the Execute methods of the DelegateCommand\n    /// </summary>\n    /// <param name=\"catch\">The generic / default callback when an exception is encountered</param>\n    /// <returns>The current instance of <see cref=\"AsyncDelegateCommand\"/>.</returns>\n    public AsyncDelegateCommand Catch(Action<Exception> @catch)\n    {\n        ExceptionHandler.Register<Exception>(@catch);\n        return this;\n    }\n\n    Task IAsyncCommand.ExecuteAsync(object? parameter)\n    {\n        return Execute(_getCancellationToken());\n    }\n\n    Task IAsyncCommand.ExecuteAsync(object? parameter, CancellationToken cancellationToken)\n    {\n        return Execute(cancellationToken);\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Commands/AsyncDelegateCommand{T}.cs",
    "content": "﻿using System.Linq.Expressions;\nusing System;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing System.Windows.Input;\nusing Prism.Properties;\n\n#nullable enable\nnamespace Prism.Commands;\n\n/// <summary>\n/// Provides an implementation of the <see cref=\"IAsyncCommand\"/> with a generic parameter type.\n/// </summary>\n/// <typeparam name=\"T\"></typeparam>\npublic class AsyncDelegateCommand<T> : DelegateCommandBase, IAsyncCommand\n{\n    private bool _enableParallelExecution = false;\n    private bool _isExecuting = false;\n    private readonly Func<T, CancellationToken, Task> _executeMethod;\n    private Func<T, bool> _canExecuteMethod;\n    private Func<CancellationToken> _getCancellationToken = () => CancellationToken.None;\n\n    /// <summary>\n    /// Creates a new instance of <see cref=\"AsyncDelegateCommand{T}\"/> with the <see cref=\"Func{Task}\"/> to invoke on execution.\n    /// </summary>\n    /// <param name=\"executeMethod\">The <see cref=\"Func{T, Task}\"/> to invoke when <see cref=\"ICommand.Execute(object)\"/> is called.</param>\n    public AsyncDelegateCommand(Func<T, Task> executeMethod)\n#if NET6_0_OR_GREATER\n        : this((p,t) => executeMethod(p).WaitAsync(t), _ => true)\n#else\n        : this((p, t) => executeMethod(p), _ => true)\n#endif\n    {\n\n    }\n\n    /// <summary>\n    /// Creates a new instance of <see cref=\"AsyncDelegateCommand{T}\"/> with the <see cref=\"Func{Task}\"/> to invoke on execution.\n    /// </summary>\n    /// <param name=\"executeMethod\">The <see cref=\"Func{T, CancellationToken, Task}\"/> to invoke when <see cref=\"ICommand.Execute(object)\"/> is called.</param>\n    public AsyncDelegateCommand(Func<T, CancellationToken, Task> executeMethod)\n        : this(executeMethod, _ => true)\n    {\n\n    }\n\n    /// <summary>\n    /// Creates a new instance of <see cref=\"DelegateCommand\"/> with the <see cref=\"Func{Task}\"/> to invoke on execution\n    /// and a <see langword=\"Func\" /> to query for determining if the command can execute.\n    /// </summary>\n    /// <param name=\"executeMethod\">The <see cref=\"Func{T, Task}\"/> to invoke when <see cref=\"ICommand.Execute\"/> is called.</param>\n    /// <param name=\"canExecuteMethod\">The delegate to invoke when <see cref=\"ICommand.CanExecute\"/> is called</param>\n    public AsyncDelegateCommand(Func<T, Task> executeMethod, Func<T, bool> canExecuteMethod)\n#if NET6_0_OR_GREATER\n        : this((p, c) => executeMethod(p).WaitAsync(c), canExecuteMethod)\n#else\n        : this((p, c) => executeMethod(p), canExecuteMethod)\n#endif\n    {\n\n    }\n\n    /// <summary>\n    /// Creates a new instance of <see cref=\"DelegateCommand\"/> with the <see cref=\"Func{Task}\"/> to invoke on execution\n    /// and a <see langword=\"Func\" /> to query for determining if the command can execute.\n    /// </summary>\n    /// <param name=\"executeMethod\">The <see cref=\"Func{T, CancellationToken, Task}\"/> to invoke when <see cref=\"ICommand.Execute\"/> is called.</param>\n    /// <param name=\"canExecuteMethod\">The delegate to invoke when <see cref=\"ICommand.CanExecute\"/> is called</param>\n    public AsyncDelegateCommand(Func<T, CancellationToken, Task> executeMethod, Func<T, bool> canExecuteMethod)\n        : base()\n    {\n        if (executeMethod == null || canExecuteMethod == null)\n            throw new ArgumentNullException(nameof(executeMethod), Resources.DelegateCommandDelegatesCannotBeNull);\n\n        _executeMethod = executeMethod;\n        _canExecuteMethod = canExecuteMethod;\n    }\n\n    /// <summary>\n    /// Gets the current state of the AsyncDelegateCommand\n    /// </summary>\n    public bool IsExecuting\n    {\n        get => _isExecuting;\n        private set => SetProperty(ref _isExecuting, value, OnCanExecuteChanged);\n    }\n\n    ///<summary>\n    /// Executes the command.\n    ///</summary>\n    public async Task Execute(T parameter, CancellationToken? cancellationToken = null)\n    {\n        var token = cancellationToken ?? _getCancellationToken();\n\n        try\n        {\n            if (!_enableParallelExecution && IsExecuting)\n                return;\n\n            IsExecuting = true;\n            await _executeMethod(parameter, token)\n                .ConfigureAwait(false);\n        }\n        catch (Exception ex)\n        {\n            if (!ExceptionHandler.CanHandle(ex))\n                throw;\n\n            ExceptionHandler.Handle(ex, parameter);\n        }\n        finally\n        {\n            IsExecuting = false;\n        }\n    }\n\n    /// <summary>\n    /// Determines if the command can be executed.\n    /// </summary>\n    /// <returns>Returns <see langword=\"true\"/> if the command can execute,otherwise returns <see langword=\"false\"/>.</returns>\n    public bool CanExecute(T parameter)\n    {\n        try\n        {\n            if (!_enableParallelExecution && IsExecuting)\n                return false;\n\n            return _canExecuteMethod?.Invoke(parameter) ?? true;\n        }\n        catch (Exception ex)\n        {\n            if (!ExceptionHandler.CanHandle(ex))\n                throw;\n\n            ExceptionHandler.Handle(ex, parameter);\n\n            return false;\n        }\n    }\n\n    /// <summary>\n    /// Handle the internal invocation of <see cref=\"ICommand.Execute(object)\"/>\n    /// </summary>\n    /// <param name=\"parameter\">Command Parameter</param>\n    protected override async void Execute(object? parameter)\n    {\n        var cancellationToken = _getCancellationToken();\n        T parameterAsT;\n        try\n        {\n            parameterAsT = (T)parameter!;\n        }\n        catch (Exception ex)\n        {\n            if (!ExceptionHandler.CanHandle(ex))\n                throw;\n\n            ExceptionHandler.Handle(ex, parameter);\n            return;\n        }\n\n        // If we had an exception casting the parameter to T ,\n        // we would have already returned. We want to surface any\n        // exceptions thrown by the Execute method.\n        await Execute(parameterAsT, cancellationToken)\n            .ConfigureAwait(false);\n    }\n\n    /// <summary>\n    /// Handle the internal invocation of <see cref=\"ICommand.CanExecute(object)\"/>\n    /// </summary>\n    /// <param name=\"parameter\"></param>\n    /// <returns><see langword=\"true\"/> if the Command Can Execute, otherwise <see langword=\"false\" /></returns>\n    protected override bool CanExecute(object? parameter)\n    {\n        try\n        {\n            return CanExecute((T)parameter!);\n        }\n        catch (Exception ex)\n        {\n            if (!ExceptionHandler.CanHandle(ex))\n                throw;\n\n            ExceptionHandler.Handle(ex, parameter);\n\n            return false;\n        }\n    }\n\n    /// <summary>\n    /// Enables Parallel Execution of Async Tasks\n    /// </summary>\n    /// <returns>The current instance of <see cref=\"AsyncDelegateCommand{T}\"/>.</returns>\n    public AsyncDelegateCommand<T> EnableParallelExecution()\n    {\n        _enableParallelExecution = true;\n        return this;\n    }\n\n    /// <summary>\n    /// Sets the <see cref=\"CancellationTokenSourceFactory(Func{CancellationToken})\"/> based on the specified timeout.\n    /// </summary>\n    /// <param name=\"timeout\">A specified timeout.</param>\n    /// <returns>The current instance of <see cref=\"AsyncDelegateCommand{T}\"/>.</returns>\n    public AsyncDelegateCommand<T> CancelAfter(TimeSpan timeout) =>\n        CancellationTokenSourceFactory(() => new CancellationTokenSource(timeout).Token);\n\n    /// <summary>\n    /// Provides a delegate callback to provide a default CancellationToken when the Command is invoked.\n    /// </summary>\n    /// <param name=\"factory\">The default <see cref=\"CancellationToken\"/> Factory.</param>\n    /// <returns>The current instance of <see cref=\"AsyncDelegateCommand{T}\"/>.</returns>\n    public AsyncDelegateCommand<T> CancellationTokenSourceFactory(Func<CancellationToken> factory)\n    {\n        _getCancellationToken = factory;\n        return this;\n    }\n\n    /// <summary>\n    /// Observes a property that implements INotifyPropertyChanged, and automatically calls DelegateCommandBase.RaiseCanExecuteChanged on property changed notifications.\n    /// </summary>\n    /// <typeparam name=\"TType\">The type of the return value of the method that this delegate encapsulates</typeparam>\n    /// <param name=\"propertyExpression\">The property expression. Example: ObservesProperty(() => PropertyName).</param>\n    /// <returns>The current instance of <see cref=\"AsyncDelegateCommand{T}\"/>.</returns>\n    public AsyncDelegateCommand<T> ObservesProperty<TType>(Expression<Func<TType>> propertyExpression)\n    {\n        ObservesPropertyInternal(propertyExpression);\n        return this;\n    }\n\n    /// <summary>\n    /// Observes a property that is used to determine if this command can execute, and if it implements INotifyPropertyChanged it will automatically call DelegateCommandBase.RaiseCanExecuteChanged on property changed notifications.\n    /// </summary>\n    /// <param name=\"canExecuteExpression\">The property expression. Example: ObservesCanExecute(() => PropertyName).</param>\n    /// <returns>The current instance of <see cref=\"AsyncDelegateCommand{T}\"/>.</returns>\n    public AsyncDelegateCommand<T> ObservesCanExecute(Expression<Func<bool>> canExecuteExpression)\n    {\n        Expression<Func<T, bool>> expression = Expression.Lambda<Func<T, bool>>(canExecuteExpression.Body, Expression.Parameter(typeof(T), \"o\"));\n        _canExecuteMethod = expression.Compile();\n        ObservesPropertyInternal(canExecuteExpression);\n        return this;\n    }\n\n    /// <summary>\n    /// Provides the ability to connect a delegate to catch exceptions encountered by CanExecute or the Execute methods of the DelegateCommand\n    /// </summary>\n    /// <param name=\"catch\">TThe callback when a specific exception is encountered</param>\n    /// <returns>The current instance of <see cref=\"AsyncDelegateCommand{T}\"/>.</returns>\n    public AsyncDelegateCommand<T> Catch<TException>(Action<TException> @catch)\n        where TException : Exception\n    {\n        ExceptionHandler.Register<TException>(@catch);\n        return this;\n    }\n\n    /// <summary>\n    /// Provides the ability to connect a delegate to catch exceptions encountered by CanExecute or the Execute methods of the DelegateCommand\n    /// </summary>\n    /// <param name=\"catch\">The generic / default callback when an exception is encountered</param>\n    /// <returns>The current instance of <see cref=\"AsyncDelegateCommand{T}\"/>.</returns>\n    public AsyncDelegateCommand<T> Catch(Action<Exception> @catch)\n    {\n        ExceptionHandler.Register<Exception>(@catch);\n        return this;\n    }\n\n    async Task IAsyncCommand.ExecuteAsync(object? parameter)\n    {\n        try\n        {\n            // If T is not nullable this may throw an exception\n            await Execute((T)parameter!, _getCancellationToken());\n        }\n        catch (Exception ex)\n        {\n            if (!ExceptionHandler.CanHandle(ex))\n                throw;\n\n            ExceptionHandler.Handle(ex, parameter);\n        }\n    }\n\n    async Task IAsyncCommand.ExecuteAsync(object? parameter, CancellationToken cancellationToken)\n    {\n        try\n        {\n            // If T is not nullable this may throw an exception\n            await Execute((T)parameter!, cancellationToken);\n        }\n        catch (Exception ex)\n        {\n            if (!ExceptionHandler.CanHandle(ex))\n                throw;\n\n            ExceptionHandler.Handle(ex, parameter);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Commands/CompositeCommand.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading;\nusing System.Windows.Input;\nusing Prism.Properties;\n\n#nullable enable\nnamespace Prism.Commands\n{\n    /// <summary>\n    /// The CompositeCommand composes one or more ICommands.\n    /// </summary>\n    public class CompositeCommand : ICommand\n    {\n        private readonly List<ICommand> _registeredCommands = new();\n        private readonly bool _monitorCommandActivity;\n        private readonly EventHandler _onRegisteredCommandCanExecuteChangedHandler;\n        private readonly SynchronizationContext? _synchronizationContext;\n\n        /// <summary>\n        /// Initializes a new instance of <see cref=\"CompositeCommand\"/>.\n        /// </summary>\n        public CompositeCommand()\n        {\n            _onRegisteredCommandCanExecuteChangedHandler = new EventHandler(OnRegisteredCommandCanExecuteChanged);\n            _synchronizationContext = SynchronizationContext.Current;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of <see cref=\"CompositeCommand\"/>.\n        /// </summary>\n        /// <param name=\"monitorCommandActivity\">Indicates when the command activity is going to be monitored.</param>\n        public CompositeCommand(bool monitorCommandActivity)\n            : this()\n        {\n            _monitorCommandActivity = monitorCommandActivity;\n        }\n\n        /// <summary>\n        /// Adds a command to the collection and signs up for the <see cref=\"ICommand.CanExecuteChanged\"/> event of it.\n        /// </summary>\n        ///  <remarks>\n        /// If this command is set to monitor command activity, and <paramref name=\"command\"/> \n        /// implements the <see cref=\"IActiveAware\"/> interface, this method will subscribe to its\n        /// <see cref=\"IActiveAware.IsActiveChanged\"/> event.\n        /// </remarks>\n        /// <param name=\"command\">The command to register.</param>\n        public virtual void RegisterCommand(ICommand command)\n        {\n            if (command == null) throw new ArgumentNullException(nameof(command));\n            if (command == this)\n            {\n                throw new ArgumentException(Resources.CannotRegisterCompositeCommandInItself);\n            }\n\n            lock (_registeredCommands)\n            {\n                if (_registeredCommands.Contains(command))\n                {\n                    throw new InvalidOperationException(Resources.CannotRegisterSameCommandTwice);\n                }\n                _registeredCommands.Add(command);\n            }\n\n            command.CanExecuteChanged += _onRegisteredCommandCanExecuteChangedHandler;\n            OnCanExecuteChanged();\n\n            if (_monitorCommandActivity)\n            {\n                if (command is IActiveAware activeAwareCommand)\n                {\n                    activeAwareCommand.IsActiveChanged += Command_IsActiveChanged;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Removes a command from the collection and removes itself from the <see cref=\"ICommand.CanExecuteChanged\"/> event of it.\n        /// </summary>\n        /// <param name=\"command\">The command to unregister.</param>\n        public virtual void UnregisterCommand(ICommand command)\n        {\n            if (command == null) throw new ArgumentNullException(nameof(command));\n            bool removed;\n            lock (_registeredCommands)\n            {\n                removed = _registeredCommands.Remove(command);\n            }\n\n            if (removed)\n            {\n                command.CanExecuteChanged -= _onRegisteredCommandCanExecuteChangedHandler;\n                OnCanExecuteChanged();\n\n                if (_monitorCommandActivity)\n                {\n                    if (command is IActiveAware activeAwareCommand)\n                    {\n                        activeAwareCommand.IsActiveChanged -= Command_IsActiveChanged;\n                    }\n                }\n            }\n        }\n\n        private void OnRegisteredCommandCanExecuteChanged(object? sender, EventArgs e)\n        {\n            OnCanExecuteChanged();\n        }\n\n\n        /// <summary>\n        /// Forwards <see cref=\"ICommand.CanExecute\"/> to the registered commands and returns\n        /// <see langword=\"true\" /> if all of the commands return <see langword=\"true\" />.\n        /// </summary>\n        /// <param name=\"parameter\">Data used by the command.\n        /// If the command does not require data to be passed, this object can be set to <see langword=\"null\" />.\n        /// </param>\n        /// <returns><see langword=\"true\" /> if all of the commands return <see langword=\"true\" />; otherwise, <see langword=\"false\" />.</returns>\n        public virtual bool CanExecute(object? parameter)\n        {\n            bool hasEnabledCommandsThatShouldBeExecuted = false;\n\n            ICommand[] commandList;\n            lock (_registeredCommands)\n            {\n                commandList = _registeredCommands.ToArray();\n            }\n            foreach (ICommand command in commandList)\n            {\n                if (ShouldExecute(command))\n                {\n                    if (!command.CanExecute(parameter))\n                    {\n                        return false;\n                    }\n\n                    hasEnabledCommandsThatShouldBeExecuted = true;\n                }\n            }\n\n            return hasEnabledCommandsThatShouldBeExecuted;\n        }\n\n        /// <summary>\n        /// Occurs when any of the registered commands raise <see cref=\"ICommand.CanExecuteChanged\"/>.\n        /// </summary>\n        public virtual event EventHandler? CanExecuteChanged;\n\n        /// <summary>\n        /// Forwards <see cref=\"ICommand.Execute\"/> to the registered commands.\n        /// </summary>\n        /// <param name=\"parameter\">Data used by the command.\n        /// If the command does not require data to be passed, this object can be set to <see langword=\"null\" />.\n        /// </param>\n        public virtual void Execute(object? parameter)\n        {\n            Queue<ICommand> commands;\n            lock (_registeredCommands)\n            {\n                commands = new Queue<ICommand>(_registeredCommands.Where(ShouldExecute).ToList());\n            }\n\n            while (commands.Count > 0)\n            {\n                ICommand command = commands.Dequeue();\n                command.Execute(parameter);\n            }\n        }\n\n        /// <summary>\n        /// Evaluates if a command should execute.\n        /// </summary>\n        /// <param name=\"command\">The command to evaluate.</param>\n        /// <returns>A <see cref=\"bool\"/> value indicating whether the command should be used \n        /// when evaluating <see cref=\"CanExecute\"/> and <see cref=\"Execute\"/>.</returns>\n        /// <remarks>\n        /// If this command is set to monitor command activity, and <paramref name=\"command\"/>\n        /// implements the <see cref=\"IActiveAware\"/> interface, \n        /// this method will return <see langword=\"false\" /> if the command's <see cref=\"IActiveAware.IsActive\"/> \n        /// property is <see langword=\"false\" />; otherwise it always returns <see langword=\"true\" />.</remarks>\n        protected virtual bool ShouldExecute(ICommand command)\n        {\n            if (_monitorCommandActivity && command is IActiveAware activeAwareCommand)\n            {\n                return activeAwareCommand.IsActive;\n            }\n\n            return true;\n        }\n\n        /// <summary>\n        /// Gets the list of all the registered commands.\n        /// </summary>\n        /// <value>A list of registered commands.</value>\n        /// <remarks>This returns a copy of the commands subscribed to the CompositeCommand.</remarks>\n        public IList<ICommand> RegisteredCommands\n        {\n            get\n            {\n                IList<ICommand> commandList;\n                lock (_registeredCommands)\n                {\n                    commandList = _registeredCommands.ToList();\n                }\n\n                return commandList;\n            }\n        }\n\n        /// <summary>\n        /// Raises <see cref=\"ICommand.CanExecuteChanged\"/> on the UI thread so every \n        /// command invoker can requery <see cref=\"ICommand.CanExecute\"/> to check if the\n        /// <see cref=\"CompositeCommand\"/> can execute.\n        /// </summary>\n        protected virtual void OnCanExecuteChanged()\n        {\n            var handler = CanExecuteChanged;\n            if (handler != null)\n            {\n                if (_synchronizationContext != null && _synchronizationContext != SynchronizationContext.Current)\n                    _synchronizationContext.Post((o) => handler.Invoke(this, EventArgs.Empty), null);\n                else\n                    handler.Invoke(this, EventArgs.Empty);\n            }\n        }\n\n        /// <summary>\n        /// Handler for IsActiveChanged events of registered commands.\n        /// </summary>\n        /// <param name=\"sender\">The sender.</param>\n        /// <param name=\"e\">EventArgs to pass to the event.</param>\n        private void Command_IsActiveChanged(object? sender, EventArgs e)\n        {\n            OnCanExecuteChanged();\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Commands/DelegateCommand.cs",
    "content": "using System;\nusing System.Linq.Expressions;\nusing System.Threading.Tasks;\nusing System.Windows.Input;\nusing Prism.Properties;\n\n#nullable enable\nnamespace Prism.Commands\n{\n    /// <summary>\n    /// An <see cref=\"ICommand\"/> whose delegates do not take any parameters for <see cref=\"Execute()\"/> and <see cref=\"CanExecute()\"/>.\n    /// </summary>\n    /// <see cref=\"DelegateCommandBase\"/>\n    /// <see cref=\"DelegateCommand{T}\"/>\n    public class DelegateCommand : DelegateCommandBase\n    {\n        Action _executeMethod;\n        Func<bool> _canExecuteMethod;\n\n        /// <summary>\n        /// Creates a new instance of <see cref=\"DelegateCommand\"/> with the <see cref=\"Action\"/> to invoke on execution.\n        /// </summary>\n        /// <param name=\"executeMethod\">The <see cref=\"Action\"/> to invoke when <see cref=\"ICommand.Execute(object)\"/> is called.</param>\n        public DelegateCommand(Action executeMethod)\n            : this(executeMethod, () => true)\n        {\n\n        }\n\n        /// <summary>\n        /// Creates a new instance of <see cref=\"DelegateCommand\"/> with the <see cref=\"Action\"/> to invoke on execution\n        /// and a <see langword=\"Func\" /> to query for determining if the command can execute.\n        /// </summary>\n        /// <param name=\"executeMethod\">The <see cref=\"Action\"/> to invoke when <see cref=\"ICommand.Execute\"/> is called.</param>\n        /// <param name=\"canExecuteMethod\">The <see cref=\"Func{TResult}\"/> to invoke when <see cref=\"ICommand.CanExecute\"/> is called</param>\n        public DelegateCommand(Action executeMethod, Func<bool> canExecuteMethod)\n            : base()\n        {\n            if (executeMethod == null || canExecuteMethod == null)\n                throw new ArgumentNullException(nameof(executeMethod), Resources.DelegateCommandDelegatesCannotBeNull);\n\n            _executeMethod = executeMethod;\n            _canExecuteMethod = canExecuteMethod;\n        }\n\n        ///<summary>\n        /// Executes the command.\n        ///</summary>\n        public void Execute()\n        {\n            try\n            {\n                _executeMethod();\n            }\n            catch (Exception ex)\n            {\n                if (!ExceptionHandler.CanHandle(ex))\n                    throw;\n\n                ExceptionHandler.Handle(ex, null);\n            }\n        }\n\n        /// <summary>\n        /// Determines if the command can be executed.\n        /// </summary>\n        /// <returns>Returns <see langword=\"true\"/> if the command can execute,otherwise returns <see langword=\"false\"/>.</returns>\n        public bool CanExecute()\n        {\n            try\n            {\n                return _canExecuteMethod();\n            }\n            catch (Exception ex)\n            {\n                if (!ExceptionHandler.CanHandle(ex))\n                    throw;\n\n                ExceptionHandler.Handle(ex, null);\n\n                return false;\n            }\n        }\n\n        /// <summary>\n        /// Handle the internal invocation of <see cref=\"ICommand.Execute(object)\"/>\n        /// </summary>\n        /// <param name=\"parameter\">Command Parameter</param>\n        protected override void Execute(object? parameter)\n        {\n            Execute();\n        }\n\n        /// <summary>\n        /// Handle the internal invocation of <see cref=\"ICommand.CanExecute(object)\"/>\n        /// </summary>\n        /// <param name=\"parameter\"></param>\n        /// <returns><see langword=\"true\"/> if the Command Can Execute, otherwise <see langword=\"false\" /></returns>\n        protected override bool CanExecute(object? parameter)\n        {\n            return CanExecute();\n        }\n\n        /// <summary>\n        /// Observes a property that implements INotifyPropertyChanged, and automatically calls DelegateCommandBase.RaiseCanExecuteChanged on property changed notifications.\n        /// </summary>\n        /// <typeparam name=\"T\">The object type containing the property specified in the expression.</typeparam>\n        /// <param name=\"propertyExpression\">The property expression. Example: ObservesProperty(() => PropertyName).</param>\n        /// <returns>The current instance of DelegateCommand</returns>\n        public DelegateCommand ObservesProperty<T>(Expression<Func<T>> propertyExpression)\n        {\n            ObservesPropertyInternal(propertyExpression);\n            return this;\n        }\n\n        /// <summary>\n        /// Observes a property that is used to determine if this command can execute, and if it implements INotifyPropertyChanged it will automatically call DelegateCommandBase.RaiseCanExecuteChanged on property changed notifications.\n        /// </summary>\n        /// <param name=\"canExecuteExpression\">The property expression. Example: ObservesCanExecute(() => PropertyName).</param>\n        /// <returns>The current instance of DelegateCommand</returns>\n        public DelegateCommand ObservesCanExecute(Expression<Func<bool>> canExecuteExpression)\n        {\n            _canExecuteMethod = canExecuteExpression.Compile();\n            ObservesPropertyInternal(canExecuteExpression);\n            return this;\n        }\n\n        /// <summary>\n        /// Registers an callback if an exception is encountered while executing the <see cref=\"DelegateCommand\"/>\n        /// </summary>\n        /// <param name=\"catch\">The Callback</param>\n        /// <returns>The current instance of <see cref=\"DelegateCommand\"/></returns>\n        public DelegateCommand Catch(Action<Exception> @catch)\n        {\n            ExceptionHandler.Register<Exception>(@catch);\n            return this;\n        }\n\n        /// <summary>\n        /// Registers an callback if an exception is encountered while executing the <see cref=\"DelegateCommand\"/>\n        /// </summary>\n        /// <param name=\"catch\">The Callback</param>\n        /// <returns>The current instance of <see cref=\"DelegateCommand\"/></returns>\n        public DelegateCommand Catch(Action<Exception, object> @catch)\n        {\n            ExceptionHandler.Register<Exception>(@catch);\n            return this;\n        }\n\n        /// <summary>\n        /// Registers an callback if an exception is encountered while executing the <see cref=\"DelegateCommand\"/>\n        /// </summary>\n        /// <typeparam name=\"TException\">The Exception Type</typeparam>\n        /// <param name=\"catch\">The Callback</param>\n        /// <returns>The current instance of <see cref=\"DelegateCommand\"/></returns>\n        public DelegateCommand Catch<TException>(Action<TException> @catch)\n            where TException : Exception\n        {\n            ExceptionHandler.Register<TException>(@catch);\n            return this;\n        }\n\n        /// <summary>\n        /// Registers an callback if an exception is encountered while executing the <see cref=\"DelegateCommand\"/>\n        /// </summary>\n        /// <typeparam name=\"TException\">The Exception Type</typeparam>\n        /// <param name=\"catch\">The Callback</param>\n        /// <returns>The current instance of <see cref=\"DelegateCommand\"/></returns>\n        public DelegateCommand Catch<TException>(Action<TException, object> @catch)\n            where TException : Exception\n        {\n            ExceptionHandler.Register<TException>(@catch);\n            return this;\n        }\n\n        /// <summary>\n        /// Registers an async callback if an exception is encountered while executing the <see cref=\"DelegateCommand\"/>\n        /// </summary>\n        /// <param name=\"catch\">The Callback</param>\n        /// <returns>The current instance of <see cref=\"DelegateCommand\"/></returns>\n        public DelegateCommand Catch(Func<Exception, Task> @catch)\n        {\n            ExceptionHandler.Register<Exception>(@catch);\n            return this;\n        }\n\n        /// <summary>\n        /// Registers an async callback if an exception is encountered while executing the <see cref=\"DelegateCommand\"/>\n        /// </summary>\n        /// <param name=\"catch\">The Callback</param>\n        /// <returns>The current instance of <see cref=\"DelegateCommand\"/></returns>\n        public DelegateCommand Catch(Func<Exception, object, Task> @catch)\n        {\n            ExceptionHandler.Register<Exception>(@catch);\n            return this;\n        }\n\n        /// <summary>\n        /// Registers an async callback if an exception is encountered while executing the <see cref=\"DelegateCommand\"/>\n        /// </summary>\n        /// <typeparam name=\"TException\">The Exception Type</typeparam>\n        /// <param name=\"catch\">The Callback</param>\n        /// <returns>The current instance of <see cref=\"DelegateCommand\"/></returns>\n        public DelegateCommand Catch<TException>(Func<TException, Task> @catch)\n            where TException : Exception\n        {\n            ExceptionHandler.Register<TException>(@catch);\n            return this;\n        }\n\n        /// <summary>\n        /// Registers an async callback if an exception is encountered while executing the <see cref=\"DelegateCommand\"/>\n        /// </summary>\n        /// <typeparam name=\"TException\">The Exception Type</typeparam>\n        /// <param name=\"catch\">The Callback</param>\n        /// <returns>The current instance of <see cref=\"DelegateCommand\"/></returns>\n        public DelegateCommand Catch<TException>(Func<TException, object, Task> @catch)\n            where TException : Exception\n        {\n            ExceptionHandler.Register<TException>(@catch);\n            return this;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Commands/DelegateCommandBase.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Linq.Expressions;\nusing System.Threading;\nusing System.Windows.Input;\nusing Prism.Common;\nusing Prism.Mvvm;\n\n#nullable enable\nnamespace Prism.Commands\n{\n    /// <summary>\n    /// An <see cref=\"ICommand\"/> whose delegates can be attached for <see cref=\"Execute\"/> and <see cref=\"CanExecute\"/>.\n    /// </summary>\n    public abstract class DelegateCommandBase : BindableBase, ICommand, IActiveAware\n    {\n        private bool _isActive;\n\n        private SynchronizationContext? _synchronizationContext;\n        private readonly HashSet<string> _observedPropertiesExpressions = new();\n\n        /// <summary>\n        /// Provides an Exception Handler to register callbacks or handle encountered exceptions within \n        /// </summary>\n        protected readonly MulticastExceptionHandler ExceptionHandler = new();\n\n        /// <summary>\n        /// Creates a new instance of a <see cref=\"DelegateCommandBase\"/>, specifying both the execute action and the can execute function.\n        /// </summary>\n        protected DelegateCommandBase()\n        {\n            _synchronizationContext = SynchronizationContext.Current;\n        }\n\n        /// <summary>\n        /// Occurs when changes occur that affect whether or not the command should execute.\n        /// </summary>\n        public virtual event EventHandler? CanExecuteChanged;\n\n        /// <summary>\n        /// Raises <see cref=\"ICommand.CanExecuteChanged\"/> so every \n        /// command invoker can re-query <see cref=\"ICommand.CanExecute\"/>.\n        /// </summary>\n        protected virtual void OnCanExecuteChanged()\n        {\n            var handler = CanExecuteChanged;\n            if (handler != null)\n            {\n                if (_synchronizationContext != null && _synchronizationContext != SynchronizationContext.Current)\n                    _synchronizationContext.Post((o) => handler.Invoke(this, EventArgs.Empty), null);\n                else\n                    handler.Invoke(this, EventArgs.Empty);\n            }\n        }\n\n        /// <summary>\n        /// Raises <see cref=\"CanExecuteChanged\"/> so every command invoker\n        /// can re-query to check if the command can execute.\n        /// </summary>\n        /// <remarks>Note that this will trigger the execution of <see cref=\"CanExecuteChanged\"/> once for each invoker.</remarks>\n        [SuppressMessage(\"Microsoft.Design\", \"CA1030:UseEventsWhereAppropriate\")]\n        public void RaiseCanExecuteChanged()\n        {\n            OnCanExecuteChanged();\n        }\n\n        void ICommand.Execute(object? parameter)\n        {\n            Execute(parameter);\n        }\n\n        bool ICommand.CanExecute(object? parameter)\n        {\n            return CanExecute(parameter);\n        }\n\n        /// <summary>\n        /// Handle the internal invocation of <see cref=\"ICommand.Execute(object)\"/>\n        /// </summary>\n        /// <param name=\"parameter\">Command Parameter</param>\n        protected abstract void Execute(object? parameter);\n\n        /// <summary>\n        /// Handle the internal invocation of <see cref=\"ICommand.CanExecute(object)\"/>\n        /// </summary>\n        /// <param name=\"parameter\"></param>\n        /// <returns><see langword=\"true\"/> if the Command Can Execute, otherwise <see langword=\"false\" /></returns>\n        protected abstract bool CanExecute(object? parameter);\n\n        /// <summary>\n        /// Observes a property that implements INotifyPropertyChanged, and automatically calls DelegateCommandBase.RaiseCanExecuteChanged on property changed notifications.\n        /// </summary>\n        /// <typeparam name=\"T\">The object type containing the property specified in the expression.</typeparam>\n        /// <param name=\"propertyExpression\">The property expression. Example: ObservesProperty(() => PropertyName).</param>\n        protected internal void ObservesPropertyInternal<T>(Expression<Func<T>> propertyExpression)\n        {\n            if (_observedPropertiesExpressions.Contains(propertyExpression.ToString()))\n            {\n                throw new ArgumentException($\"{propertyExpression} is already being observed.\",\n                    nameof(propertyExpression));\n            }\n            else\n            {\n                _observedPropertiesExpressions.Add(propertyExpression.ToString());\n                PropertyObserver.Observes(propertyExpression, RaiseCanExecuteChanged);\n            }\n        }\n\n        #region IsActive\n\n        /// <summary>\n        /// Gets or sets a value indicating whether the object is active.\n        /// </summary>\n        /// <value><see langword=\"true\" /> if the object is active; otherwise <see langword=\"false\" />.</value>\n        public bool IsActive\n        {\n            get => _isActive;\n            set => SetProperty(ref _isActive, value, OnIsActiveChanged);\n        }\n\n        /// <summary>\n        /// Fired if the <see cref=\"IsActive\"/> property changes.\n        /// </summary>\n        public virtual event EventHandler? IsActiveChanged;\n\n        /// <summary>\n        /// This raises the <see cref=\"IsActiveChanged\"/> event.\n        /// </summary>\n        protected virtual void OnIsActiveChanged()\n        {\n            IsActiveChanged?.Invoke(this, EventArgs.Empty);\n        }\n\n        #endregion\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Commands/DelegateCommand{T}.cs",
    "content": "﻿using System;\nusing System.Linq.Expressions;\nusing System.Reflection;\nusing System.Threading.Tasks;\nusing System.Windows.Input;\nusing Prism.Properties;\n\n#nullable enable\nnamespace Prism.Commands\n{\n    /// <summary>\n    /// An <see cref=\"ICommand\"/> whose delegates can be attached for <see cref=\"Execute(T)\"/> and <see cref=\"CanExecute(T)\"/>.\n    /// </summary>\n    /// <typeparam name=\"T\">Parameter type.</typeparam>\n    /// <remarks>\n    /// The constructor deliberately prevents the use of value types.\n    /// Because ICommand takes an object, having a value type for T would cause unexpected behavior when CanExecute(null) is called during XAML initialization for command bindings.\n    /// Using default(T) was considered and rejected as a solution because the implementor would not be able to distinguish between a valid and defaulted values.\n    /// <para/>\n    /// Instead, callers should support a value type by using a nullable value type and checking the HasValue property before using the Value property.\n    /// <example>\n    ///     <code>\n    /// public MyClass()\n    /// {\n    ///     this.submitCommand = new DelegateCommand&lt;int?&gt;(this.Submit, this.CanSubmit);\n    /// }\n    /// \n    /// private bool CanSubmit(int? customerId)\n    /// {\n    ///     return (customerId.HasValue &amp;&amp; customers.Contains(customerId.Value));\n    /// }\n    ///     </code>\n    /// </example>\n    /// </remarks>\n    public class DelegateCommand<T> : DelegateCommandBase\n    {\n        readonly Action<T> _executeMethod;\n        Func<T, bool> _canExecuteMethod;\n\n        /// <summary>\n        /// Initializes a new instance of <see cref=\"DelegateCommand{T}\"/>.\n        /// </summary>\n        /// <param name=\"executeMethod\">Delegate to execute when Execute is called on the command. This can be null to just hook up a CanExecute delegate.</param>\n        /// <remarks><see cref=\"CanExecute(T)\"/> will always return true.</remarks>\n        public DelegateCommand(Action<T> executeMethod)\n            : this(executeMethod, (o) => true)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of <see cref=\"DelegateCommand{T}\"/>.\n        /// </summary>\n        /// <param name=\"executeMethod\">Delegate to execute when Execute is called on the command. This can be null to just hook up a CanExecute delegate.</param>\n        /// <param name=\"canExecuteMethod\">Delegate to execute when CanExecute is called on the command. This can be null.</param>\n        /// <exception cref=\"ArgumentNullException\">When both <paramref name=\"executeMethod\"/> and <paramref name=\"canExecuteMethod\"/> are <see langword=\"null\" />.</exception>\n        public DelegateCommand(Action<T> executeMethod, Func<T, bool> canExecuteMethod)\n            : base()\n        {\n            if (executeMethod == null || canExecuteMethod == null)\n                throw new ArgumentNullException(nameof(executeMethod), Resources.DelegateCommandDelegatesCannotBeNull);\n\n            TypeInfo genericTypeInfo = typeof(T).GetTypeInfo();\n\n            // DelegateCommand allows object or Nullable<>.  \n            // note: Nullable<> is a struct so we cannot use a class constraint.\n            if (genericTypeInfo.IsValueType)\n            {\n                if ((!genericTypeInfo.IsGenericType) || (!typeof(Nullable<>).GetTypeInfo().IsAssignableFrom(genericTypeInfo.GetGenericTypeDefinition().GetTypeInfo())))\n                {\n                    throw new InvalidCastException(Resources.DelegateCommandInvalidGenericPayloadType);\n                }\n            }\n\n            _executeMethod = executeMethod;\n            _canExecuteMethod = canExecuteMethod;\n        }\n\n        ///<summary>\n        ///Executes the command and invokes the <see cref=\"Action{T}\"/> provided during construction.\n        ///</summary>\n        ///<param name=\"parameter\">Data used by the command.</param>\n        public void Execute(T parameter)\n        {\n            try\n            {\n                _executeMethod(parameter);\n            }\n            catch (Exception ex)\n            {\n                if (!ExceptionHandler.CanHandle(ex))\n                    throw;\n\n                ExceptionHandler.Handle(ex, parameter);\n            }\n        }\n\n        ///<summary>\n        ///Determines if the command can execute by invoked the <see cref=\"Func{T,Bool}\"/> provided during construction.\n        ///</summary>\n        ///<param name=\"parameter\">Data used by the command to determine if it can execute.</param>\n        ///<returns>\n        ///<see langword=\"true\" /> if this command can be executed; otherwise, <see langword=\"false\" />.\n        ///</returns>\n        public bool CanExecute(T parameter)\n        {\n            try\n            {\n                return _canExecuteMethod(parameter);\n            }\n            catch (Exception ex)\n            {\n                if (!ExceptionHandler.CanHandle(ex))\n                    throw;\n\n                ExceptionHandler.Handle(ex, parameter);\n\n                return false;\n            }\n        }\n\n        /// <summary>\n        /// Handle the internal invocation of <see cref=\"ICommand.Execute(object)\"/>\n        /// </summary>\n        /// <param name=\"parameter\">Command Parameter</param>\n        protected override void Execute(object? parameter)\n        {\n            try\n            {\n                // Note: We don't call Execute because we would potentially invoke the Try/Catch twice.\n                // It is also needed here incase (T)parameter throws the exception\n                _executeMethod((T)parameter!);\n            }\n            catch (Exception ex)\n            {\n                if (!ExceptionHandler.CanHandle(ex))\n                    throw;\n\n                ExceptionHandler.Handle(ex, parameter);\n            }\n        }\n\n        /// <summary>\n        /// Handle the internal invocation of <see cref=\"ICommand.CanExecute(object)\"/>\n        /// </summary>\n        /// <param name=\"parameter\"></param>\n        /// <returns><see langword=\"true\"/> if the Command Can Execute, otherwise <see langword=\"false\" /></returns>\n        protected override bool CanExecute(object? parameter)\n        {\n            try\n            {\n                // Note: We don't call Execute because we would potentially invoke the Try/Catch twice.\n                // It is also needed here incase (T)parameter throws the exception\n                return CanExecute((T)parameter!);\n            }\n            catch (Exception ex)\n            {\n                if (!ExceptionHandler.CanHandle(ex))\n                    throw;\n\n                ExceptionHandler.Handle(ex, parameter);\n\n                return false;\n            }\n        }\n\n        /// <summary>\n        /// Observes a property that implements INotifyPropertyChanged, and automatically calls DelegateCommandBase.RaiseCanExecuteChanged on property changed notifications.\n        /// </summary>\n        /// <typeparam name=\"TType\">The type of the return value of the method that this delegate encapsulates</typeparam>\n        /// <param name=\"propertyExpression\">The property expression. Example: ObservesProperty(() => PropertyName).</param>\n        /// <returns>The current instance of DelegateCommand</returns>\n        public DelegateCommand<T> ObservesProperty<TType>(Expression<Func<TType>> propertyExpression)\n        {\n            ObservesPropertyInternal(propertyExpression);\n            return this;\n        }\n\n        /// <summary>\n        /// Observes a property that is used to determine if this command can execute, and if it implements INotifyPropertyChanged it will automatically call DelegateCommandBase.RaiseCanExecuteChanged on property changed notifications.\n        /// </summary>\n        /// <param name=\"canExecuteExpression\">The property expression. Example: ObservesCanExecute(() => PropertyName).</param>\n        /// <returns>The current instance of DelegateCommand</returns>\n        public DelegateCommand<T> ObservesCanExecute(Expression<Func<bool>> canExecuteExpression)\n        {\n            Expression<Func<T, bool>> expression = Expression.Lambda<Func<T, bool>>(canExecuteExpression.Body, Expression.Parameter(typeof(T), \"o\"));\n            _canExecuteMethod = expression.Compile();\n            ObservesPropertyInternal(canExecuteExpression);\n            return this;\n        }\n\n        /// <summary>\n        /// Registers an callback if an exception is encountered while executing the <see cref=\"DelegateCommand\"/>\n        /// </summary>\n        /// <param name=\"catch\">The Callback</param>\n        /// <returns>The current instance of <see cref=\"DelegateCommand\"/></returns>\n        public DelegateCommand<T> Catch(Action<Exception> @catch)\n        {\n            ExceptionHandler.Register<Exception>(@catch);\n            return this;\n        }\n\n        /// <summary>\n        /// Registers an callback if an exception is encountered while executing the <see cref=\"DelegateCommand\"/>\n        /// </summary>\n        /// <param name=\"catch\">The Callback</param>\n        /// <returns>The current instance of <see cref=\"DelegateCommand\"/></returns>\n        public DelegateCommand<T> Catch(Action<Exception, object> @catch)\n        {\n            ExceptionHandler.Register<Exception>(@catch);\n            return this;\n        }\n\n        /// <summary>\n        /// Registers an callback if an exception is encountered while executing the <see cref=\"DelegateCommand\"/>\n        /// </summary>\n        /// <typeparam name=\"TException\">The Exception Type</typeparam>\n        /// <param name=\"catch\">The Callback</param>\n        /// <returns>The current instance of <see cref=\"DelegateCommand\"/></returns>\n        public DelegateCommand<T> Catch<TException>(Action<TException> @catch)\n            where TException : Exception\n        {\n            ExceptionHandler.Register<TException>(@catch);\n            return this;\n        }\n\n        /// <summary>\n        /// Registers an callback if an exception is encountered while executing the <see cref=\"DelegateCommand\"/>\n        /// </summary>\n        /// <typeparam name=\"TException\">The Exception Type</typeparam>\n        /// <param name=\"catch\">The Callback</param>\n        /// <returns>The current instance of <see cref=\"DelegateCommand\"/></returns>\n        public DelegateCommand<T> Catch<TException>(Action<TException, object> @catch)\n            where TException : Exception\n        {\n            ExceptionHandler.Register<TException>(@catch);\n            return this;\n        }\n\n        /// <summary>\n        /// Registers an async callback if an exception is encountered while executing the <see cref=\"DelegateCommand\"/>\n        /// </summary>\n        /// <param name=\"catch\">The Callback</param>\n        /// <returns>The current instance of <see cref=\"DelegateCommand\"/></returns>\n        public DelegateCommand<T> Catch(Func<Exception, Task> @catch)\n        {\n            ExceptionHandler.Register<Exception>(@catch);\n            return this;\n        }\n\n        /// <summary>\n        /// Registers an async callback if an exception is encountered while executing the <see cref=\"DelegateCommand\"/>\n        /// </summary>\n        /// <param name=\"catch\">The Callback</param>\n        /// <returns>The current instance of <see cref=\"DelegateCommand\"/></returns>\n        public DelegateCommand<T> Catch(Func<Exception, object, Task> @catch)\n        {\n            ExceptionHandler.Register<Exception>(@catch);\n            return this;\n        }\n\n        /// <summary>\n        /// Registers an async callback if an exception is encountered while executing the <see cref=\"DelegateCommand\"/>\n        /// </summary>\n        /// <typeparam name=\"TException\">The Exception Type</typeparam>\n        /// <param name=\"catch\">The Callback</param>\n        /// <returns>The current instance of <see cref=\"DelegateCommand\"/></returns>\n        public DelegateCommand<T> Catch<TException>(Func<TException, Task> @catch)\n            where TException : Exception\n        {\n            ExceptionHandler.Register<TException>(@catch);\n            return this;\n        }\n\n        /// <summary>\n        /// Registers an async callback if an exception is encountered while executing the <see cref=\"DelegateCommand\"/>\n        /// </summary>\n        /// <typeparam name=\"TException\">The Exception Type</typeparam>\n        /// <param name=\"catch\">The Callback</param>\n        /// <returns>The current instance of <see cref=\"DelegateCommand\"/></returns>\n        public DelegateCommand<T> Catch<TException>(Func<TException, object, Task> @catch)\n            where TException : Exception\n        {\n            ExceptionHandler.Register<TException>(@catch);\n            return this;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Commands/IAsyncCommand.cs",
    "content": "﻿using System.Threading;\nusing System.Threading.Tasks;\nusing System.Windows.Input;\n\n#nullable enable\nnamespace Prism.Commands;\n\n/// <summary>\n/// Provides an abstraction layer for custom controls which want to make use of Async Commands\n/// </summary>\npublic interface IAsyncCommand : ICommand\n{\n    /// <summary>\n    /// Executes the Command with a specified parameter and the Default <see cref=\"CancellationToken\"/>.\n    /// </summary>\n    /// <param name=\"parameter\">The Command Parameter</param>\n    /// <returns>An Asynchronous Task</returns>\n    Task ExecuteAsync(object? parameter);\n\n    /// <summary>\n    /// Executes the Command with a specified parameter and using a <see cref=\"CancellationToken\"/>\n    /// </summary>\n    /// <param name=\"parameter\">The Command Parameter</param>\n    /// <param name=\"cancellationToken\">The <see cref=\"CancellationToken\"/>.</param>\n    /// <returns>An Asynchronous Task</returns>\n    Task ExecuteAsync(object? parameter, CancellationToken cancellationToken);\n}\n"
  },
  {
    "path": "src/Prism.Core/Commands/PropertyObserver.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Linq.Expressions;\nusing System.Reflection;\n\n#nullable enable\nnamespace Prism.Commands\n{\n    /// <summary>\n    /// Provide a way to observe property changes of INotifyPropertyChanged objects and invokes a \n    /// custom action when the PropertyChanged event is fired.\n    /// </summary>\n    internal class PropertyObserver\n    {\n        private readonly Action _action;\n\n        private PropertyObserver(Expression propertyExpression, Action action)\n        {\n            _action = action;\n            SubscribeListeners(propertyExpression);\n        }\n\n        private void SubscribeListeners(Expression? propertyExpression)\n        {\n            var propNameStack = new Stack<PropertyInfo>();\n            while (propertyExpression is MemberExpression temp) // Gets the root of the property chain.\n            {\n                propertyExpression = temp.Expression;\n\n                if (temp.Member is PropertyInfo propertyInfo)\n                {\n                    propNameStack.Push(propertyInfo); // Records the member info as property info\n                }\n            }\n\n            if (propertyExpression is not ConstantExpression constantExpression)\n                throw new NotSupportedException(\"Operation not supported for the given expression type. \" +\n                                                \"Only MemberExpression and ConstantExpression are currently supported.\");\n\n            var propObserverNodeRoot = new PropertyObserverNode(propNameStack.Pop(), _action);\n            PropertyObserverNode previousNode = propObserverNodeRoot;\n            foreach (var propName in propNameStack) // Create a node chain that corresponds to the property chain.\n            {\n                var currentNode = new PropertyObserverNode(propName, _action);\n                previousNode.Next = currentNode;\n                previousNode = currentNode;\n            }\n\n            object? propOwnerObject = constantExpression.Value;\n\n            if (propOwnerObject is not INotifyPropertyChanged inpcObject)\n                throw new InvalidOperationException(\"Tried to subscribe to PropertyChanged in the object that \" +\n                                                    $\"defines the '{propObserverNodeRoot.PropertyInfo.Name}' property, but the object does not implement INotifyPropertyChanged.\");\n\n            propObserverNodeRoot.SubscribeListenerFor(inpcObject);\n        }\n\n        /// <summary>\n        /// Observes a property that implements INotifyPropertyChanged, and automatically calls a custom action on \n        /// property changed notifications. The given expression must be in this form: \"() => Prop.NestedProp.PropToObserve\".\n        /// </summary>\n        /// <param name=\"propertyExpression\">Expression representing property to be observed. Ex.: \"() => Prop.NestedProp.PropToObserve\".</param>\n        /// <param name=\"action\">Action to be invoked when PropertyChanged event occurs.</param>\n        internal static PropertyObserver Observes<T>(Expression<Func<T>> propertyExpression, Action action)\n        {\n            return new PropertyObserver(propertyExpression.Body, action);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Commands/PropertyObserverNode.cs",
    "content": "using System;\nusing System.ComponentModel;\nusing System.Reflection;\n\n#nullable enable\nnamespace Prism.Commands\n{\n    /// <summary>\n    /// Represents each node of nested properties expression and takes care of \n    /// subscribing/unsubscribing INotifyPropertyChanged.PropertyChanged listeners on it.\n    /// </summary>\n    internal class PropertyObserverNode\n    {\n        private readonly Action _action;\n        private INotifyPropertyChanged? _inpcObject;\n\n        public PropertyInfo PropertyInfo { get; }\n        public PropertyObserverNode? Next { get; set; }\n\n        public PropertyObserverNode(PropertyInfo propertyInfo, Action action)\n        {\n            PropertyInfo = propertyInfo ?? throw new ArgumentNullException(nameof(propertyInfo));\n            _action = () =>\n            {\n                action?.Invoke();\n                if (Next == null) return;\n                Next.UnsubscribeListener();\n                GenerateNextNode();\n            };\n        }\n\n        public void SubscribeListenerFor(INotifyPropertyChanged inpcObject)\n        {\n            _inpcObject = inpcObject;\n            _inpcObject.PropertyChanged += OnPropertyChanged;\n\n            if (Next != null) GenerateNextNode();\n        }\n\n        private void GenerateNextNode()\n        {\n            var nextProperty = PropertyInfo.GetValue(_inpcObject);\n            if (nextProperty == null) return;\n            if (nextProperty is not INotifyPropertyChanged nextInpcObject)\n                throw new InvalidOperationException(\"Tried to subscribe to PropertyChanged in the object that \" +\n                                                    $\"defines the '{Next?.PropertyInfo.Name}' property, but the object does not implement INotifyPropertyChanged.\");\n\n            Next?.SubscribeListenerFor(nextInpcObject);\n        }\n\n        private void UnsubscribeListener()\n        {\n            if (_inpcObject != null)\n                _inpcObject.PropertyChanged -= OnPropertyChanged;\n\n            Next?.UnsubscribeListener();\n        }\n\n        private void OnPropertyChanged(object? sender, PropertyChangedEventArgs e)\n        {\n            if (e?.PropertyName == PropertyInfo.Name || string.IsNullOrEmpty(e?.PropertyName))\n            {\n                _action?.Invoke();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Common/IParameters.cs",
    "content": "using System.Diagnostics.CodeAnalysis;\n\n#nullable enable\nnamespace Prism.Common\n{\n    /// <summary>\n    /// Defines a contract for specifying values associated with a unique key.\n    /// </summary>\n    public interface IParameters : IEnumerable<KeyValuePair<string, object>>\n    {\n        /// <summary>\n        /// Adds the specified key and value to the parameter collection.\n        /// </summary>\n        /// <param name=\"key\">The key of the parameter to add.</param>\n        /// <param name=\"value\">The value of the parameter to add.</param>\n        void Add(string key, object value);\n\n        /// <summary>\n        /// Determines whether the <see cref=\"IParameters\"/> contains the specified <paramref name=\"key\"/>.\n        /// </summary>\n        /// <param name=\"key\">The key to search the parameters for existence.</param>\n        /// <returns>true if the <see cref=\"IParameters\"/> contains a parameter with the specified key; otherwise, false.</returns>\n        bool ContainsKey(string key);\n\n        /// <summary>\n        /// Gets the number of parameters contained in the <see cref=\"IParameters\"/>.\n        /// </summary>\n        int Count { get; }\n\n        /// <summary>\n        /// Gets a collection containing the keys in the <see cref=\"IParameters\"/>.\n        /// </summary>\n        IEnumerable<string> Keys { get; }\n\n        /// <summary>\n        /// Gets the parameter associated with the specified <paramref name=\"key\"/>.\n        /// </summary>\n        /// <typeparam name=\"T\">The type of the parameter to get.</typeparam>\n        /// <param name=\"key\">The key of the parameter to find.</param>\n        /// <returns>A matching value of <typeparamref name=\"T\"/> if it exists.</returns>\n        T GetValue<T>(string key);\n\n        /// <summary>\n        /// Gets the parameter associated with the specified <paramref name=\"key\"/>.\n        /// </summary>\n        /// <typeparam name=\"T\">The type of the parameter to get.</typeparam>\n        /// <param name=\"key\">The key of the parameter to find.</param>\n        /// <returns>An <see cref=\"IEnumerable{T}\"/> of all the values referenced by key.</returns>\n        IEnumerable<T> GetValues<T>(string key);\n\n        /// <summary>\n        /// Gets the parameter associated with the specified <paramref name=\"key\"/>.\n        /// </summary>\n        /// <typeparam name=\"T\">The type of the parameter to get.</typeparam>\n        /// <param name=\"key\">The key of the parameter to get.</param>\n        /// <param name=\"value\">\n        /// When this method returns, contains the parameter associated with the specified key,\n        /// if the key is found; otherwise, the default value for the type of the value parameter.\n        /// </param>\n        /// <returns>true if the <see cref=\"IParameters\"/> contains a parameter with the specified key; otherwise, false.</returns>\n        bool TryGetValue<T>(string key, [MaybeNullWhen(false)] out T value);\n\n        /// <summary>\n        /// Gets the parameter associated with the specified key (legacy).\n        /// </summary>\n        /// <param name=\"key\">The key of the parameter to get.</param>\n        /// <returns>A matching value if it exists.</returns>\n        object? this[string key] { get; }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Common/IRegistryAware.cs",
    "content": "﻿using Prism.Mvvm;\n\nnamespace Prism.Common;\n\n/// <summary>\n/// An internal marker API used within Prism to access the instance of the <see cref=\"IViewRegistry\"/>\n/// within a service where we do not want to publicly expose it but need access for Extension methods.\n/// </summary>\npublic interface IRegistryAware\n{\n    /// <summary>\n    ///  The instance of the IViewRegistry\n    /// </summary>\n    IViewRegistry Registry { get; }\n}\n"
  },
  {
    "path": "src/Prism.Core/Common/ListDictionary.cs",
    "content": "namespace Prism.Common\n{\n    /// <summary>\n    /// A dictionary of lists.\n    /// </summary>\n    /// <typeparam name=\"TKey\">The key to use for lists.</typeparam>\n    /// <typeparam name=\"TValue\">The type of the value held by lists.</typeparam>\n    public sealed class ListDictionary<TKey, TValue> : IDictionary<TKey, IList<TValue>>\n    {\n        readonly Dictionary<TKey, IList<TValue>> innerValues = [];\n\n        #region Public Methods\n\n        /// <summary>\n        /// If a list does not already exist, it will be created automatically.\n        /// </summary>\n        /// <param name=\"key\">The key of the list that will hold the value.</param>\n        public void Add(TKey key)\n        {\n            if (key == null)\n                throw new ArgumentNullException(nameof(key));\n\n            CreateNewList(key);\n        }\n\n        /// <summary>\n        /// Adds a value to a list with the given key. If a list does not already exist,\n        /// it will be created automatically.\n        /// </summary>\n        /// <param name=\"key\">The key of the list that will hold the value.</param>\n        /// <param name=\"value\">The value to add to the list under the given key.</param>\n        public void Add(TKey key, TValue value)\n        {\n            if (key == null)\n                throw new ArgumentNullException(nameof(key));\n\n            if (value == null)\n                throw new ArgumentNullException(nameof(value));\n\n            if (innerValues.ContainsKey(key))\n            {\n                innerValues[key].Add(value);\n            }\n            else\n            {\n                List<TValue> values = CreateNewList(key);\n                values.Add(value);\n            }\n        }\n\n        private List<TValue> CreateNewList(TKey key)\n        {\n            List<TValue> values = new List<TValue>();\n            innerValues.Add(key, values);\n\n            return values;\n        }\n\n        /// <summary>\n        /// Removes all entries in the dictionary.\n        /// </summary>\n        public void Clear()\n        {\n            innerValues.Clear();\n        }\n\n        /// <summary>\n        /// Determines whether the dictionary contains the specified value.\n        /// </summary>\n        /// <param name=\"value\">The value to locate.</param>\n        /// <returns>true if the dictionary contains the value in any list; otherwise, false.</returns>\n        public bool ContainsValue(TValue value)\n        {\n            foreach (KeyValuePair<TKey, IList<TValue>> pair in innerValues)\n            {\n                if (pair.Value.Contains(value))\n                {\n                    return true;\n                }\n            }\n\n            return false;\n        }\n\n        /// <summary>\n        /// Determines whether the dictionary contains the given key.\n        /// </summary>\n        /// <param name=\"key\">The key to locate.</param>\n        /// <returns>true if the dictionary contains the given key; otherwise, false.</returns>\n        public bool ContainsKey(TKey key)\n        {\n            if (key == null)\n                throw new ArgumentNullException(nameof(key));\n\n            return innerValues.ContainsKey(key);\n        }\n\n        /// <summary>\n        /// Retrieves the all the elements from the list which have a key that matches the condition\n        /// defined by the specified predicate.\n        /// </summary>\n        /// <param name=\"keyFilter\">The filter with the condition to use to filter lists by their key.</param>\n        /// <returns>The elements that have a key that matches the condition defined by the specified predicate.</returns>\n        public IEnumerable<TValue> FindAllValuesByKey(Predicate<TKey> keyFilter)\n        {\n            foreach (KeyValuePair<TKey, IList<TValue>> pair in this)\n            {\n                if (keyFilter(pair.Key))\n                {\n                    foreach (TValue value in pair.Value)\n                    {\n                        yield return value;\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Retrieves all the elements that match the condition defined by the specified predicate.\n        /// </summary>\n        /// <param name=\"valueFilter\">The filter with the condition to use to filter values.</param>\n        /// <returns>The elements that match the condition defined by the specified predicate.</returns>\n        public IEnumerable<TValue> FindAllValues(Predicate<TValue> valueFilter)\n        {\n            foreach (KeyValuePair<TKey, IList<TValue>> pair in this)\n            {\n                foreach (TValue value in pair.Value)\n                {\n                    if (valueFilter(value))\n                    {\n                        yield return value;\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Removes a list by key.\n        /// </summary>\n        /// <param name=\"key\">The key of the list to remove.</param>\n        /// <returns><see langword=\"true\" /> if the element was removed.</returns>\n        public bool Remove(TKey key)\n        {\n            if (key == null)\n                throw new ArgumentNullException(nameof(key));\n\n            return innerValues.Remove(key);\n        }\n\n        /// <summary>\n        /// Removes a value from the list with the given key.\n        /// </summary>\n        /// <param name=\"key\">The key of the list where the value exists.</param>\n        /// <param name=\"value\">The value to remove.</param>\n        public void RemoveValue(TKey key, TValue value)\n        {\n            if (key == null)\n                throw new ArgumentNullException(nameof(key));\n\n            if (value == null)\n                throw new ArgumentNullException(nameof(value));\n\n            if (innerValues.ContainsKey(key))\n            {\n                List<TValue> innerList = (List<TValue>)innerValues[key];\n                innerList.RemoveAll(delegate (TValue item)\n                                               {\n                                                   return value.Equals(item);\n                                               });\n            }\n        }\n\n        /// <summary>\n        /// Removes a value from all lists where it may be found.\n        /// </summary>\n        /// <param name=\"value\">The value to remove.</param>\n        public void RemoveValue(TValue value)\n        {\n            foreach (KeyValuePair<TKey, IList<TValue>> pair in innerValues)\n            {\n                RemoveValue(pair.Key, value);\n            }\n        }\n\n        #endregion\n\n        #region Properties\n\n        /// <summary>\n        /// Gets a shallow copy of all values in all lists.\n        /// </summary>\n        /// <value>List of values.</value>\n        public IList<TValue> Values\n        {\n            get\n            {\n                List<TValue> values = new List<TValue>();\n                foreach (IEnumerable<TValue> list in innerValues.Values)\n                {\n                    values.AddRange(list);\n                }\n\n                return values;\n            }\n        }\n\n        /// <summary>\n        /// Gets the list of keys in the dictionary.\n        /// </summary>\n        /// <value>Collection of keys.</value>\n        public ICollection<TKey> Keys\n        {\n            get { return innerValues.Keys; }\n        }\n\n        /// <summary>\n        /// Gets or sets the list associated with the given key. The\n        /// access always succeeds, eventually returning an empty list.\n        /// </summary>\n        /// <param name=\"key\">The key of the list to access.</param>\n        /// <returns>The list associated with the key.</returns>\n        public IList<TValue> this[TKey key]\n        {\n            get\n            {\n                if (innerValues.ContainsKey(key) == false)\n                {\n                    innerValues.Add(key, new List<TValue>());\n                }\n                return innerValues[key];\n            }\n            set { innerValues[key] = value; }\n        }\n\n        /// <summary>\n        /// Gets the number of lists in the dictionary.\n        /// </summary>\n        /// <value>Value indicating the values count.</value>\n        public int Count\n        {\n            get { return innerValues.Count; }\n        }\n\n        #endregion\n\n        #region IDictionary<TKey,List<TValue>> Members\n\n        /// <summary>\n        /// See <see cref=\"IDictionary{TKey,TValue}.Add\"/> for more information.\n        /// </summary>\n        void IDictionary<TKey, IList<TValue>>.Add(TKey key, IList<TValue> value)\n        {\n            if (key == null)\n                throw new ArgumentNullException(nameof(key));\n\n            if (value == null)\n                throw new ArgumentNullException(nameof(value));\n\n            innerValues.Add(key, value);\n        }\n\n        /// <summary>\n        /// See <see cref=\"IDictionary{TKey,TValue}.TryGetValue\"/> for more information.\n        /// </summary>\n        bool IDictionary<TKey, IList<TValue>>.TryGetValue(TKey key, out IList<TValue> value)\n        {\n            value = this[key];\n            return true;\n        }\n\n        /// <summary>\n        /// See <see cref=\"IDictionary{TKey,TValue}.Values\"/> for more information.\n        /// </summary>\n        ICollection<IList<TValue>> IDictionary<TKey, IList<TValue>>.Values\n        {\n            get { return innerValues.Values; }\n        }\n\n        #endregion\n\n        #region ICollection<KeyValuePair<TKey,List<TValue>>> Members\n\n        /// <summary>\n        /// See <see cref=\"ICollection{TValue}.Add\"/> for more information.\n        /// </summary>\n        void ICollection<KeyValuePair<TKey, IList<TValue>>>.Add(KeyValuePair<TKey, IList<TValue>> item)\n        {\n            ((ICollection<KeyValuePair<TKey, IList<TValue>>>)innerValues).Add(item);\n        }\n\n        /// <summary>\n        /// See <see cref=\"ICollection{TValue}.Contains\"/> for more information.\n        /// </summary>\n        bool ICollection<KeyValuePair<TKey, IList<TValue>>>.Contains(KeyValuePair<TKey, IList<TValue>> item)\n        {\n            return ((ICollection<KeyValuePair<TKey, IList<TValue>>>)innerValues).Contains(item);\n        }\n\n        /// <summary>\n        /// See <see cref=\"ICollection{TValue}.CopyTo\"/> for more information.\n        /// </summary>\n        void ICollection<KeyValuePair<TKey, IList<TValue>>>.CopyTo(KeyValuePair<TKey, IList<TValue>>[] array, int arrayIndex)\n        {\n            ((ICollection<KeyValuePair<TKey, IList<TValue>>>)innerValues).CopyTo(array, arrayIndex);\n        }\n\n        /// <summary>\n        /// See <see cref=\"ICollection{TValue}.IsReadOnly\"/> for more information.\n        /// </summary>\n        bool ICollection<KeyValuePair<TKey, IList<TValue>>>.IsReadOnly\n        {\n            get { return ((ICollection<KeyValuePair<TKey, IList<TValue>>>)innerValues).IsReadOnly; }\n        }\n\n        /// <summary>\n        /// See <see cref=\"ICollection{TValue}.Remove\"/> for more information.\n        /// </summary>\n        bool ICollection<KeyValuePair<TKey, IList<TValue>>>.Remove(KeyValuePair<TKey, IList<TValue>> item)\n        {\n            return ((ICollection<KeyValuePair<TKey, IList<TValue>>>)innerValues).Remove(item);\n        }\n\n        #endregion\n\n        #region IEnumerable<KeyValuePair<TKey,List<TValue>>> Members\n\n        /// <summary>\n        /// See <see cref=\"IEnumerable{TValue}.GetEnumerator\"/> for more information.\n        /// </summary>\n        IEnumerator<KeyValuePair<TKey, IList<TValue>>> IEnumerable<KeyValuePair<TKey, IList<TValue>>>.GetEnumerator()\n        {\n            return innerValues.GetEnumerator();\n        }\n\n        #endregion\n\n        #region IEnumerable Members\n\n        /// <summary>\n        /// See <see cref=\"System.Collections.IEnumerable.GetEnumerator\"/> for more information.\n        /// </summary>\n        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()\n        {\n            return innerValues.GetEnumerator();\n        }\n\n        #endregion\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Common/MulticastExceptionHandler.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\n\nnamespace Prism.Common;\n\n#nullable enable\n/// <summary>\n/// Provides a wrapper for managing multicast delegates for handling specific errors\n/// </summary>\npublic readonly struct MulticastExceptionHandler\n{\n    private readonly Dictionary<Type, MulticastDelegate> _handlers;\n\n    /// <summary>\n    /// Initializes a new MulticastExceptionHandler\n    /// </summary>\n    public MulticastExceptionHandler()\n    {\n        _handlers = [];\n    }\n\n    /// <summary>\n    /// Registers a callback to handle the specified exception\n    /// </summary>\n    /// <typeparam name=\"TException\">The <see cref=\"Exception\"/> type.</typeparam>\n    /// <param name=\"callback\">The callback to invoke for the given <see cref=\"Exception\"/> type.</param>\n    public void Register<TException>(MulticastDelegate callback)\n        where TException : Exception\n    {\n        _handlers.Add(typeof(TException), callback);\n    }\n\n    /// <summary>\n    /// Determines if there is a callback registered to handle the specified exception\n    /// </summary>\n    /// <param name=\"exception\">An <see cref=\"Exception\"/> to handle or rethrow</param>\n    /// <returns><c>True</c> if a Callback has been registered for the given type of <see cref=\"Exception\"/>.</returns>\n    public bool CanHandle(Exception exception) =>\n        GetDelegate(exception.GetType()) is not null;\n\n    /// <summary>\n    /// Handles a specified \n    /// </summary>\n    /// <param name=\"exception\"></param>\n    /// <param name=\"parameter\"></param>\n    public async void Handle(Exception exception, object? parameter = null) =>\n        await HandleAsync(exception, parameter);\n\n    /// <summary>\n    /// Handles a specified <see cref=\"Exception\"/> asynchronously with a given optional parameter\n    /// </summary>\n    /// <param name=\"exception\">The <see cref=\"Exception\"/> encountered.</param>\n    /// <param name=\"parameter\">An optional parameter which may be passed to a registered callback delegate.</param>\n    /// <returns>An asynchronus Task.</returns>\n    /// <exception cref=\"InvalidOperationException\"></exception>\n    public async Task HandleAsync(Exception exception, object? parameter = null)\n    {\n        var multicastDelegate = GetDelegate(exception.GetType());\n\n        if (multicastDelegate is null)\n            return;\n\n        // Get Invoke() method of the delegate\n        var invokeMethod = multicastDelegate.GetType().GetMethod(\"Invoke\")\n            ?? throw new InvalidOperationException($\"Could not find Invoke() method for delegate of type {multicastDelegate.GetType().Name}\");\n\n        var parameters = invokeMethod.GetParameters();\n        var arguments = parameters.Length switch\n        {\n            0 => Array.Empty<object?>(),\n            1 => typeof(Exception).IsAssignableFrom(parameters[0].ParameterType) ? [exception] : [parameter],\n            2 => typeof(Exception).IsAssignableFrom(parameters[0].ParameterType) ? [exception, parameter] : [parameter, exception],\n            _ => throw new InvalidOperationException($\"Handler of type {multicastDelegate.GetType().Name} is not supported\", exception)\n        };\n\n        // Invoke the delegate\n        var result = invokeMethod.Invoke(multicastDelegate, arguments);\n\n        // If the handler is async (returns a Task), then we await the task\n        if (result is Task task)\n        {\n            await task;\n        }\n#if NET6_0_OR_GREATER\n        else if (result is ValueTask valueTask)\n        {\n            await valueTask;\n        }\n#endif\n    }\n\n    private MulticastDelegate? GetDelegate(Type type)\n    {\n        if (_handlers.ContainsKey(type))\n            return _handlers[type];\n        else if (type.BaseType is not null)\n            return GetDelegate(type.BaseType);\n\n        return null;\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Common/ParametersBase.cs",
    "content": "using System.Collections;\nusing System.ComponentModel;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Text;\n#nullable enable\nnamespace Prism.Common\n{\n    /// <summary>\n    /// This is a generic parameters base class used for Dialog Parameters and Navigation Parameters.\n    /// </summary>\n    public abstract class ParametersBase : IParameters\n    {\n        private readonly List<KeyValuePair<string, object?>> _entries = [];\n\n        /// <summary>\n        /// Default constructor.\n        /// </summary>\n        protected ParametersBase()\n        {\n        }\n\n        /// <summary>\n        /// Constructs a list of parameters.\n        /// </summary>\n        /// <param name=\"query\">Query string to be parsed.</param>\n        protected ParametersBase(string query)\n        {\n            if (!string.IsNullOrWhiteSpace(query))\n            {\n                int num = query.Length;\n                for (int i = ((query.Length > 0) && (query[0] == '?')) ? 1 : 0; i < num; i++)\n                {\n                    int startIndex = i;\n                    int num4 = -1;\n                    while (i < num)\n                    {\n                        char ch = query[i];\n                        if (ch == '=')\n                        {\n                            if (num4 < 0)\n                            {\n                                num4 = i;\n                            }\n                        }\n                        else if (ch == '&')\n                        {\n                            break;\n                        }\n                        i++;\n                    }\n                    string? key = null;\n                    string value;\n                    if (num4 >= 0)\n                    {\n                        key = query.Substring(startIndex, num4 - startIndex);\n                        value = query.Substring(num4 + 1, (i - num4) - 1);\n                    }\n                    else\n                    {\n                        value = query.Substring(startIndex, i - startIndex);\n                    }\n\n                    if (key != null)\n                        Add(Uri.UnescapeDataString(key), Uri.UnescapeDataString(value));\n                }\n            }\n        }\n\n        /// <summary>\n        /// Searches Parameter collection and returns value if Collection contains key.\n        /// Otherwise returns null.\n        /// </summary>\n        /// <param name=\"key\">The key for the value to be returned.</param>\n        /// <returns>The value of the parameter referenced by the key; otherwise <c>null</c>.</returns>\n        public object? this[string key]\n        {\n            get\n            {\n                foreach (var entry in _entries)\n                {\n                    if (string.Compare(entry.Key, key, StringComparison.Ordinal) == 0)\n                    {\n                        return entry.Value;\n                    }\n                }\n\n                return null;\n            }\n        }\n\n        /// <summary>\n        /// The count, or number, of parameters in collection.\n        /// </summary>\n        public int Count => _entries.Count;\n\n        /// <summary>\n        /// Returns an IEnumerable of the Keys in the collection.\n        /// </summary>\n        public IEnumerable<string> Keys =>\n            _entries.Select(x => x.Key).Distinct();\n\n        /// <summary>\n        /// Adds the key and value to the parameters collection.\n        /// </summary>\n        /// <param name=\"key\">The key to reference this value in the parameters collection.</param>\n        /// <param name=\"value\">The value of the parameter to store.</param>\n        public void Add(string key, object value) =>\n            _entries.Add(new KeyValuePair<string, object?>(key, value));\n\n        /// <summary>\n        /// Checks collection for presence of key.\n        /// </summary>\n        /// <param name=\"key\">The key to check in the collection.</param>\n        /// <returns><c>true</c> if key exists; else returns <c>false</c>.</returns>\n        public bool ContainsKey(string key) =>\n            _entries.ContainsKey(key);\n\n        /// <summary>\n        /// Gets an enumerator for the KeyValuePairs in parameter collection.\n        /// </summary>\n        /// <returns>Enumerator.</returns>\n        public IEnumerator<KeyValuePair<string, object?>> GetEnumerator() =>\n            _entries.GetEnumerator();\n\n        /// <summary>\n        /// Returns the value of the member referenced by key.\n        /// </summary>\n        /// <typeparam name=\"T\">The type of object to be returned.</typeparam>\n        /// <param name=\"key\">The key for the value to be returned.</param>\n        /// <returns>Returns a matching parameter of <typeparamref name=\"T\"/> if one exists in the Collection.</returns>\n        public T GetValue<T>(string key) =>\n            _entries.GetValue<T>(key);\n\n        /// <summary>\n        /// Returns an IEnumerable of all parameters.\n        /// </summary>\n        /// <typeparam name=\"T\">The type for the values to be returned.</typeparam>\n        /// <param name=\"key\">The key for the values to be returned.</param>\n        ///<returns>Returns a IEnumerable of all the instances of type <typeparamref name=\"T\"/>.</returns>\n        public IEnumerable<T> GetValues<T>(string key) =>\n            _entries.GetValues<T>(key);\n\n        /// <summary>\n        /// Checks to see if the parameter collection contains the value.\n        /// </summary>\n        /// <typeparam name=\"T\">The type for the values to be returned.</typeparam>\n        /// <param name=\"key\">The key for the value to be returned.</param>\n        /// <param name=\"value\">Value of the returned parameter if it exists.</param>\n        public bool TryGetValue<T>(string key, [MaybeNullWhen(false)] out T value) =>\n            _entries.TryGetValue(key, out value);\n\n        IEnumerator IEnumerable.GetEnumerator() =>\n            GetEnumerator();\n\n        /// <summary>\n        /// Converts parameter collection to a parameter string.\n        /// </summary>\n        /// <returns>A string representation of the parameters.</returns>\n        public override string ToString()\n        {\n            var queryBuilder = new StringBuilder();\n\n            if (_entries.Count > 0)\n            {\n                queryBuilder.Append('?');\n                var first = true;\n\n                foreach (var kvp in _entries)\n                {\n                    if (!first)\n                    {\n                        queryBuilder.Append('&');\n                    }\n                    else\n                    {\n                        first = false;\n                    }\n\n                    queryBuilder.Append(Uri.EscapeDataString(kvp.Key));\n                    queryBuilder.Append('=');\n                    queryBuilder.Append(Uri.EscapeDataString(kvp.Value?.ToString() ?? string.Empty));\n                }\n            }\n\n            return queryBuilder.ToString();\n        }\n\n        /// <summary>\n        /// Adds a collection of parameters to the local parameter list.\n        /// </summary>\n        /// <param name=\"parameters\">An IEnumerable of KeyValuePairs to add to the current parameter list.</param>\n        [EditorBrowsable(EditorBrowsableState.Never)]\n        public void FromParameters(IEnumerable<KeyValuePair<string, object?>> parameters) =>\n            _entries.AddRange(parameters);\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Common/ParametersExtensions.cs",
    "content": "#nullable enable\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Linq;\n\nnamespace Prism.Common\n{\n    /// <summary>\n    /// Extension methods for Navigation or Dialog parameters\n    /// </summary>\n    [EditorBrowsable(EditorBrowsableState.Never)]\n    public static class ParametersExtensions\n    {\n        /// <summary>\n        /// Searches <paramref name=\"parameters\"/> for <paramref name=\"key\"/>\n        /// </summary>\n        /// <typeparam name=\"T\">The type of the parameter to return</typeparam>\n        /// <param name=\"parameters\">A collection of parameters to search</param>\n        /// <param name=\"key\">The key of the parameter to find</param>\n        /// <returns>A matching value of <typeparamref name=\"T\"/> if it exists</returns>\n        [EditorBrowsable(EditorBrowsableState.Never)]\n        public static T GetValue<T>(this IEnumerable<KeyValuePair<string, object>> parameters, string key) =>\n            (T)GetValue(parameters, key, typeof(T));\n\n        /// <summary>\n        /// Searches <paramref name=\"parameters\"/> for value referenced by <paramref name=\"key\"/>\n        /// </summary>\n        /// <param name=\"parameters\">A collection of parameters to search</param>\n        /// <param name=\"key\">The key of the parameter to find</param>\n        /// <param name=\"type\">The type of the parameter to return</param>\n        /// <returns>A matching value of <paramref name=\"type\"/> if it exists</returns>\n        /// <exception cref=\"InvalidCastException\">Unable to convert the value of Type</exception>\n        [EditorBrowsable(EditorBrowsableState.Never)]\n        public static object GetValue(this IEnumerable<KeyValuePair<string, object>> parameters, string key, Type type)\n        {\n            foreach (var kvp in parameters)\n            {\n                if (string.Compare(kvp.Key, key, StringComparison.Ordinal) == 0)\n                {\n                    if (TryGetValueInternal(kvp, type, out var value))\n                        return value;\n\n                    throw new InvalidCastException($\"Unable to convert the value of Type '{kvp.Value.GetType().FullName}' to '{type.FullName}' for the key '{key}' \");\n                }\n            }\n\n            return GetDefault(type);\n        }\n\n        /// <summary>\n        /// Searches <paramref name=\"parameters\"/> for value referenced by <paramref name=\"key\"/>\n        /// </summary>\n        /// <typeparam name=\"T\">The type of the parameter to return</typeparam>\n        /// <param name=\"parameters\">A collection of parameters to search</param>\n        /// <param name=\"key\">The key of the parameter to find</param>\n        /// <param name=\"value\">The value of parameter to return</param>\n        /// <returns>Success if value is found; otherwise returns <c>false</c></returns>\n        [EditorBrowsable(EditorBrowsableState.Never)]\n        public static bool TryGetValue<T>(this IEnumerable<KeyValuePair<string, object>> parameters, string key, out T value)\n        {\n            var type = typeof(T);\n\n            foreach (var kvp in parameters)\n            {\n                if (string.Compare(kvp.Key, key, StringComparison.Ordinal) == 0)\n                {\n                    var success = TryGetValueInternal(kvp, type, out var valueAsObject);\n                    if (valueAsObject is T valueAsT)\n                    {\n                        value = valueAsT;\n                        return success;\n                    }\n                }\n            }\n\n            value = default;\n            return false;\n        }\n\n        /// <summary>\n        /// Searches <paramref name=\"parameters\"/> for value referenced by <paramref name=\"key\"/>\n        /// </summary>\n        /// <typeparam name=\"T\">The type of the parameter to return</typeparam>\n        /// <param name=\"parameters\">A collection of parameters to search</param>\n        /// <param name=\"key\">The key of the parameter to find</param>\n        /// <returns>An IEnumerable{T} of all the values referenced by key</returns>\n        [EditorBrowsable(EditorBrowsableState.Never)]\n        public static IEnumerable<T> GetValues<T>(this IEnumerable<KeyValuePair<string, object>> parameters, string key)\n        {\n            List<T> values = [];\n            var type = typeof(T);\n\n            foreach (var kvp in parameters)\n            {\n                if (string.Compare(kvp.Key, key, StringComparison.Ordinal) == 0 &&\n                    TryGetValueInternal(kvp, type, out var value) &&\n                    value is T valueAsT)\n                {\n                    values.Add(valueAsT);\n                }\n            }\n\n            return values.ToArray();\n        }\n\n        private static bool TryGetValueInternal(KeyValuePair<string, object> kvp, Type type, out object value)\n        {\n            value = GetDefault(type);\n            var valueAsString = kvp.Value is string str ? str : kvp.Value?.ToString();\n            var success = false;\n            if (kvp.Value == null)\n            {\n                success = true;\n            }\n            else if (kvp.Value.GetType() == type)\n            {\n                success = true;\n                value = kvp.Value;\n            }\n            else if (type.IsAssignableFrom(kvp.Value.GetType()))\n            {\n                success = true;\n                value = kvp.Value;\n            }\n            else if (type.IsEnum && !string.IsNullOrEmpty(valueAsString))\n            {\n                if (Enum.IsDefined(type, valueAsString))\n                {\n                    success = true;\n                    value = Enum.Parse(type, valueAsString);\n                }\n                else if (int.TryParse(valueAsString, out var numericValue))\n                {\n                    success = true;\n                    value = Enum.ToObject(type, numericValue);\n                }\n            }\n\n            if (!success && type.GetInterface(\"System.IConvertible\") != null)\n            {\n                success = true;\n                value = Convert.ChangeType(kvp.Value, type);\n            }\n\n            return success;\n        }\n\n        /// <summary>\n        /// Checks to see if key exists in parameter collection\n        /// </summary>\n        /// <param name=\"parameters\">IEnumerable to search</param>\n        /// <param name=\"key\">The key to search the <paramref name=\"parameters\"/> for existence</param>\n        /// <returns><c>true</c> if key exists; <c>false</c> otherwise</returns>\n        [EditorBrowsable(EditorBrowsableState.Never)]\n        public static bool ContainsKey(this IEnumerable<KeyValuePair<string, object>> parameters, string key) =>\n            parameters.Any(x => string.Compare(x.Key, key, StringComparison.Ordinal) == 0);\n\n        private static object? GetDefault(Type type) => type.IsValueType ? Activator.CreateInstance(type) : null;\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Common/UriParsingHelper.cs",
    "content": "using Prism.Dialogs;\nusing Prism.Navigation;\n\n#nullable enable\nnamespace Prism.Common\n{\n    /// <summary>\n    /// Helper class for parsing <see cref=\"Uri\"/> instances.\n    /// </summary>\n    public static class UriParsingHelper\n    {\n        private static readonly char[] _pathDelimiter = ['/'];\n\n        /// <summary>\n        /// Gets the Uri segments from a deep linked Navigation Uri\n        /// </summary>\n        /// <param name=\"uri\">A navigation <see cref=\"Uri\"/>.</param>\n        /// <returns>A collection of strings for each navigation segment within the Navigation <see cref=\"Uri\"/>.</returns>\n        public static Queue<string> GetUriSegments(Uri uri)\n        {\n            var segmentStack = new Queue<string>();\n\n            if (!uri.IsAbsoluteUri)\n            {\n                uri = EnsureAbsolute(uri);\n            }\n\n            string[] segments = uri.PathAndQuery.Split(_pathDelimiter, StringSplitOptions.RemoveEmptyEntries);\n            foreach (var segment in segments)\n            {\n                segmentStack.Enqueue(Uri.UnescapeDataString(segment));\n            }\n\n            return segmentStack;\n        }\n\n        /// <summary>\n        /// Gets the Segment name from a Navigation Segment\n        /// </summary>\n        /// <param name=\"segment\">A Navigation Segment</param>\n        /// <returns>The navigation segment name from the provided segment.</returns>\n        public static string GetSegmentName(string segment) => segment.Split('?')[0];\n\n        /// <summary>\n        /// Gets the Segment Parameters from a Navigation Segment that may contain a querystring\n        /// </summary>\n        /// <param name=\"segment\">A navigation segment which may contain a querystring</param>\n        /// <returns>The <see cref=\"INavigationParameters\"/>.</returns>\n        public static INavigationParameters GetSegmentParameters(string segment)\n        {\n            string query = string.Empty;\n\n            if (string.IsNullOrWhiteSpace(segment))\n            {\n                return new NavigationParameters(query);\n            }\n\n            var indexOfQuery = segment.IndexOf('?');\n            if (indexOfQuery > 0)\n                query = segment.Substring(indexOfQuery);\n\n            return new NavigationParameters(query);\n        }\n\n        /// <summary>\n        /// Gets Segment Parameters including those parameters from an existing <see cref=\"INavigationParameters\"/> collection.\n        /// </summary>\n        /// <param name=\"uriSegment\">The <see cref=\"Uri\"/> segment</param>\n        /// <param name=\"parameters\">The existing <see cref=\"INavigationParameters\"/>.</param>\n        /// <returns>The combined <see cref=\"INavigationParameters\"/>.</returns>\n        public static INavigationParameters GetSegmentParameters(string uriSegment, INavigationParameters? parameters)\n        {\n            var navParameters = GetSegmentParameters(uriSegment);\n\n            if (parameters is not null)\n            {\n                foreach (KeyValuePair<string, object> navigationParameter in parameters)\n                {\n                    navParameters.Add(navigationParameter.Key, navigationParameter.Value);\n                }\n            }\n\n            return navParameters;\n        }\n\n        /// <summary>\n        /// Gets the <see cref=\"IDialogParameters\"/> from a specified segment\n        /// </summary>\n        /// <param name=\"segment\">A navigation segment which may contain a querystring.</param>\n        /// <returns>The <see cref=\"IDialogParameters\"/>.</returns>\n        public static IDialogParameters GetSegmentDialogParameters(string segment)\n        {\n            string query = string.Empty;\n\n            if (string.IsNullOrWhiteSpace(segment))\n            {\n                return new DialogParameters(query);\n            }\n\n            var indexOfQuery = segment.IndexOf('?');\n            if (indexOfQuery > 0)\n                query = segment.Substring(indexOfQuery);\n\n            return new DialogParameters(query);\n        }\n\n        /// <summary>\n        /// Gets the combined <see cref=\"IDialogParameters\"/> from a specified segment and existing <see cref=\"IDialogParameters\"/>\n        /// </summary>\n        /// <param name=\"uriSegment\">A navigation segment which may contain a querystring.</param>\n        /// <param name=\"parameters\">Existing <see cref=\"IDialogParameters\"/>.</param>\n        /// <returns></returns>\n        public static IDialogParameters GetSegmentParameters(string uriSegment, IDialogParameters? parameters)\n        {\n            var dialogParameters = GetSegmentDialogParameters(uriSegment);\n\n            if (parameters != null)\n            {\n                foreach (KeyValuePair<string, object> navigationParameter in parameters)\n                {\n                    dialogParameters.Add(navigationParameter.Key, navigationParameter.Value);\n                }\n            }\n\n            return dialogParameters;\n        }\n\n        /// <summary>\n        /// Gets the query part of <paramref name=\"uri\"/>.\n        /// </summary>\n        /// <param name=\"uri\">The Uri.</param>\n        public static string GetQuery(Uri uri) => EnsureAbsolute(uri).Query;\n\n        /// <summary>\n        /// Gets the AbsolutePath part of <paramref name=\"uri\"/>.\n        /// </summary>\n        /// <param name=\"uri\">The Uri.</param>\n        public static string GetAbsolutePath(Uri uri) => EnsureAbsolute(uri).AbsolutePath;\n\n        /// <summary>\n        /// Parses the query of <paramref name=\"uri\"/> into a dictionary.\n        /// </summary>\n        /// <param name=\"uri\">The URI.</param>\n        public static INavigationParameters ParseQuery(Uri uri)\n        {\n            var query = GetQuery(uri);\n\n            return new NavigationParameters(query);\n        }\n\n        /// <summary>\n        /// Parses a uri string to a properly initialized Uri for Prism\n        /// </summary>\n        /// <param name=\"uri\">A uri string.</param>\n        /// <returns>A <see cref=\"Uri\"/>.</returns>\n        /// <exception cref=\"ArgumentNullException\">Throws an <see cref=\"ArgumentNullException\"/> when the string is null or empty.</exception>\n        public static Uri Parse(string uri)\n        {\n            if (uri == null)\n            {\n                throw new ArgumentNullException(nameof(uri));\n            }\n\n            return uri.StartsWith(\"/\", StringComparison.Ordinal)\n                ? new Uri(\"http://localhost\" + uri, UriKind.Absolute)\n                : new Uri(uri, UriKind.RelativeOrAbsolute);\n        }\n\n        /// <summary>\n        /// This will provide the existing <see cref=\"Uri\"/> if it is already Absolute, otherwise\n        /// it will build a new Absolute <see cref=\"Uri\"/>.\n        /// </summary>\n        /// <param name=\"uri\">The source <see cref=\"Uri\"/>.</param>\n        /// <returns>An Absolute <see cref=\"Uri\"/>.</returns>\n        public static Uri EnsureAbsolute(Uri uri)\n        {\n            if (uri.IsAbsoluteUri)\n            {\n                return uri;\n            }\n\n            return !uri.OriginalString.StartsWith(\"/\", StringComparison.Ordinal) ? new Uri(\"http://localhost/\" + uri, UriKind.Absolute) : new Uri(\"http://localhost\" + uri, UriKind.Absolute);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Dialogs/ButtonResult.cs",
    "content": "﻿namespace Prism.Dialogs\n{\n    /// <summary>\n    /// The result of the dialog.\n    /// </summary>\n    public enum ButtonResult\n    {\n        /// <summary>\n        /// Abort.\n        /// </summary>\n        Abort = 3,\n        /// <summary>\n        /// Cancel.\n        /// </summary>\n        Cancel = 2,\n        /// <summary>\n        /// Ignore.\n        /// </summary>\n        Ignore = 5,\n        /// <summary>\n        /// No.\n        /// </summary>\n        No = 7,\n        /// <summary>\n        /// No result returned.\n        /// </summary>\n        None = 0,\n        /// <summary>\n        /// OK.\n        /// </summary>\n        OK = 1,\n        /// <summary>\n        /// Retry.\n        /// </summary>\n        Retry = 4,\n        /// <summary>\n        /// Yes.\n        /// </summary>\n        Yes = 6\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Dialogs/DialogCallback.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing Prism.Common;\n\nnamespace Prism.Dialogs;\n\n/// <summary>\n/// Provides a container for one or more Callbacks which may target specific Error Handling or Delegates to invoke on the successful close of the Dialog\n/// </summary>\n#nullable enable\npublic readonly struct DialogCallback\n{\n    private readonly bool _empty = false;\n    private readonly List<MulticastDelegate> _callbacks = new ();\n    private readonly MulticastExceptionHandler _errorCallbacks = new ();\n\n    /// <summary>\n    /// Creates a new instance of a DialogCallback\n    /// </summary>\n    public DialogCallback()\n        : this(false)\n    {\n    }\n\n    private DialogCallback(bool empty)\n    {\n        _empty = empty;\n    }\n\n    /// <summary>\n    /// Invokes the Delegates based on a specific Exception that was encountered.\n    /// </summary>\n    /// <param name=\"ex\"></param>\n    /// <returns></returns>\n    [EditorBrowsable(EditorBrowsableState.Never)]\n    public Task Invoke(Exception ex) =>\n        Invoke(new DialogResult { Exception = ex });\n\n    /// <summary>\n    /// Invokes the Delegates for a given <see cref=\"IDialogResult\"/>\n    /// </summary>\n    /// <param name=\"result\">The Result</param>\n    /// <returns>A <see cref=\"Task\"/>.</returns>\n    [EditorBrowsable(EditorBrowsableState.Never)]\n    public async Task Invoke(IDialogResult result)\n    {\n        if (_empty || (result.Exception is DialogException && result.Exception.Message == DialogException.CanCloseIsFalse))\n        {\n            return;\n        }\n        else if (result.Exception is not null && _errorCallbacks.CanHandle(result.Exception))\n        {\n            await _errorCallbacks.HandleAsync(result.Exception, result);\n            return;\n        }\n        else if(_callbacks.Any())\n        {\n            foreach(var callback in _callbacks)\n            {\n                await Process(callback, result);\n            }\n        }\n    }\n\n    private static async Task Process(MulticastDelegate @delegate, IDialogResult result)\n    {\n        if (@delegate is Action action)\n            action();\n        else if (@delegate is Action<IDialogResult> actionResult)\n            actionResult(result);\n        else if (@delegate is Func<Task> func)\n            await func();\n        else if (@delegate is Func<IDialogResult, Task> funcResult)\n            await funcResult(result);\n    }\n\n    /// <summary>\n    /// Provides an empty DialogCallback that will not execute any \n    /// </summary>\n    public static DialogCallback Empty => new DialogCallback(true);\n\n    /// <summary>\n    /// Provides a delegate callback method when the Dialog is closed\n    /// </summary>\n    /// <param name=\"action\">The callback</param>\n    /// <returns></returns>\n    public DialogCallback OnClose(Action action)\n    {\n        _callbacks.Add(action);\n        return this;\n    }\n\n\n    /// <summary>\n    /// Provides a delegate callback method when the Dialog is closed\n    /// </summary>\n    /// <param name=\"action\">The callback</param>\n    /// <returns></returns>\n    public DialogCallback OnClose(Action<IDialogResult> action)\n    {\n        _callbacks.Add(action);\n        return this;\n    }\n\n    /// <summary>\n    /// Provides a delegate callback method when an Exception is encountered\n    /// </summary>\n    /// <param name=\"action\">The callback</param>\n    /// <returns></returns>\n    public DialogCallback OnError(Action action)\n    {\n        _errorCallbacks.Register<Exception>(action);\n        return this;\n    }\n\n    /// <summary>\n    /// Provides a delegate callback method when an Exception is encountered\n    /// </summary>\n    /// <param name=\"action\">The callback</param>\n    /// <returns></returns>\n    public DialogCallback OnError<TException>(Action action)\n        where TException : Exception\n    {\n        _errorCallbacks.Register<TException>(action);\n        return this;\n    }\n\n    /// <summary>\n    /// Provides a delegate callback method when an Exception is encountered\n    /// </summary>\n    /// <param name=\"action\">The callback</param>\n    /// <returns></returns>\n    public DialogCallback OnError(Action<Exception> action)\n    {\n        _errorCallbacks.Register<Exception>(action);\n        return this;\n    }\n\n    /// <summary>\n    /// Provides a delegate callback method when an Exception is encountered\n    /// </summary>\n    /// <param name=\"action\">The callback</param>\n    /// <returns></returns>\n    public DialogCallback OnError<TException>(Action<TException> action)\n        where TException : Exception\n    {\n        _errorCallbacks.Register<TException>(action);\n        return this;\n    }\n\n    /// <summary>\n    /// Provides a delegate callback method when an Exception is encountered\n    /// </summary>\n    /// <param name=\"action\">The callback</param>\n    /// <returns></returns>\n    public DialogCallback OnError<TException>(Action<TException, IDialogResult> action)\n        where TException : Exception\n    {\n        _errorCallbacks.Register<TException>(action);\n        return this;\n    }\n\n    /// <summary>\n    /// Provides an asynchronous delegate callback method when the Dialog is closed\n    /// </summary>\n    /// <param name=\"func\">The callback</param>\n    /// <returns></returns>\n    public DialogCallback OnCloseAsync(Func<Task> func)\n    {\n        _callbacks.Add(func);\n        return this;\n    }\n\n    /// <summary>\n    /// Provides an asynchronous delegate callback method when the Dialog is closed\n    /// </summary>\n    /// <param name=\"func\">The callback</param>\n    /// <returns></returns>\n    public DialogCallback OnCloseAsync(Func<IDialogResult, Task> func)\n    {\n        _callbacks.Add(func);\n        return this;\n    }\n\n    /// <summary>\n    /// Provides an asynchronous delegate callback method when an Exception is encountered\n    /// </summary>\n    /// <param name=\"func\">The callback</param>\n    /// <returns></returns>\n    public DialogCallback OnErrorAsync(Func<Task> func)\n    {\n        _errorCallbacks.Register<Exception>(func);\n        return this;\n    }\n\n    /// <summary>\n    /// Provides an asynchronous delegate callback method when an Exception is encountered\n    /// </summary>\n    /// <param name=\"func\">The callback</param>\n    /// <returns></returns>\n    public DialogCallback OnErrorAsync<TException>(Func<Task> func)\n        where TException : Exception\n    {\n        _errorCallbacks.Register<TException>(func);\n        return this;\n    }\n\n    /// <summary>\n    /// Provides an asynchronous delegate callback method when an Exception is encountered\n    /// </summary>\n    /// <param name=\"func\">The callback</param>\n    /// <returns></returns>\n    public DialogCallback OnErrorAsync(Func<Exception, Task> func)\n    {\n        _errorCallbacks.Register<Exception>(func);\n        return this;\n    }\n\n    /// <summary>\n    /// Provides an asynchronous delegate callback method when an Exception is encountered\n    /// </summary>\n    /// <param name=\"func\">The callback</param>\n    /// <returns></returns>\n    public DialogCallback OnErrorAsync<TException>(Func<TException, Task> func)\n        where TException : Exception\n    {\n        _errorCallbacks.Register<TException>(func);\n        return this;\n    }\n\n    /// <summary>\n    /// Provides an asynchronous delegate callback method when an Exception is encountered\n    /// </summary>\n    /// <param name=\"func\">The callback</param>\n    /// <returns></returns>\n    public DialogCallback OnErrorAsync<TException>(Func<TException, IDialogResult, Task> func)\n        where TException : Exception\n    {\n        _errorCallbacks.Register<TException>(func);\n        return this;\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Dialogs/DialogCloseListener.cs",
    "content": "using System;\nusing System.Threading.Tasks;\n\n#nullable enable\nnamespace Prism.Dialogs;\n\n/// <summary>\n/// This is set by the <see cref=\"IDialogService\"/> on your <see cref=\"IDialogAware\"/> ViewModel. This can then\n/// be invoked by either the DialogService or your code to initiate closing the Dialog.\n/// </summary>\npublic struct DialogCloseListener\n{\n    private readonly MulticastDelegate? _callback;\n\n    /// <summary>\n    /// Creates a default instance of the <see cref=\"DialogCloseListener\"/>\n    /// </summary>\n    public DialogCloseListener()\n    {\n    }\n\n    internal DialogCloseListener(Action<IDialogResult> callback)\n    {\n        _callback = callback;\n    }\n\n    internal DialogCloseListener(Func<IDialogResult, Task> callback)\n    {\n        _callback = callback;\n    }\n\n    /// <summary>\n    /// Invokes the initialized delegate with no <see cref=\"IDialogResult\"/>.\n    /// </summary>\n    public void Invoke() =>\n        Invoke(new DialogResult());\n\n    /// <summary>\n    /// Invokes the initialized delegate with the specified <see cref=\"ButtonResult\"/>.\n    /// </summary>\n    /// <param name=\"result\">The <see cref=\"ButtonResult\"/>.</param>\n    public void Invoke(ButtonResult result) =>\n        Invoke(new DialogResult(result));\n\n    /// <summary>\n    /// Invokes the initialized delegate with the specified <see cref=\"IDialogParameters\"/>.\n    /// </summary>\n    /// <param name=\"parameters\">The <see cref=\"IDialogParameters\"/>.</param>\n    /// <param name=\"result\">The <see cref=\"ButtonResult\"/>.</param>\n    public void Invoke(IDialogParameters parameters, ButtonResult result = ButtonResult.None) =>\n        Invoke(new DialogResult\n        {\n            Parameters = parameters,\n            Result = result\n        });\n\n    /// <summary>\n    /// Invokes the initialized delegate with the specified <see cref=\"IDialogResult\"/>\n    /// </summary>\n    /// <param name=\"result\"></param>\n    public async void Invoke(IDialogResult result)\n    {\n        switch(_callback)\n        {\n            case Action<IDialogResult> actionCallback:\n                actionCallback(result);\n                break;\n            case Func<IDialogResult, Task> taskCallback:\n                await taskCallback(result);\n                break;\n            default:\n                throw new InvalidOperationException(\"The DialogCloseCallback has not been properly initialized. This must be initialized by the DialogService, and should not be set by user code.\");\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Dialogs/DialogException.cs",
    "content": "﻿using System;\n\nnamespace Prism.Dialogs;\n\n/// <summary>\n/// Represents errors that may occur within the <see cref=\"IDialogService\"/>.\n/// </summary>\npublic class DialogException : Exception\n{\n    /// <summary>\n    /// The <see cref=\"DialogException\"/> Message returned when an unexpected error occurred while displaying the dialog.\n    /// </summary>\n    public const string ShowDialog = \"Error while displaying dialog\";\n\n    /// <summary>\n    /// The <see cref=\"DialogException\"/> Message returned when the CurrentPage must be a ContentPage\n    /// </summary>\n    /// <remarks>Xamarin.Forms &amp; Maui specific</remarks>\n    public const string RequiresContentPage = \"The current page must be a ContentPage\";\n\n    /// <summary>\n    /// The <see cref=\"DialogException\"/> Message returned when the Current View is not host a Dialog\n    /// </summary>\n    public const string HostPageIsNotDialogHost = \"The current page is not currently hosting a Dialog\";\n\n    /// <summary>\n    /// The <see cref=\"DialogException\"/> Message returned when CanClose returns false\n    /// </summary>\n    public const string CanCloseIsFalse = \"CanClose returned false\";\n\n    /// <summary>\n    /// The <see cref=\"DialogException\"/> Message returned when No ViewModel can be found\n    /// </summary>\n    public const string NoViewModel = \"No ViewModel could be found\";\n\n    /// <summary>\n    /// The <see cref=\"DialogException\"/> Message returned when the ViewModel does not implement IDialogAware.\n    /// </summary>\n    public const string ImplementIDialogAware = \"The ViewModel does not implement IDialogAware\";\n\n    /// <summary>\n    /// The <see cref=\"DialogException\"/> Message returned when Prism is unable to locate the backing field or setter for the <see cref=\"DialogCloseListener\"/>.\n    /// </summary>\n    public const string UnableToSetTheDialogCloseListener = \"Unable to locate the backing field or setter for IDialogAware.RequestClose\";\n\n    /// <summary>\n    /// Initializes a new <see cref=\"DialogException\"/> with a given message\n    /// </summary>\n    /// <param name=\"message\"></param>\n    public DialogException(string message) : base(message)\n    {\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Dialogs/DialogParameters.cs",
    "content": "﻿using Prism.Common;\n\nnamespace Prism.Dialogs;\n\n/// <summary>\n/// Provides a base implementation of <see cref=\"IDialogParameters\"/>.\n/// </summary>\npublic class DialogParameters : ParametersBase, IDialogParameters\n{\n    /// <summary>\n    /// Initializes a new instance of <see cref=\"DialogParameters\"/>.\n    /// </summary>\n    public DialogParameters()\n    {\n    }\n\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"DialogParameters\"/> based on a specified query string.\n    /// </summary>\n    /// <param name=\"query\">A uri query string</param>\n    public DialogParameters(string query)\n        : base(query)\n    {\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Dialogs/DialogResult.cs",
    "content": "﻿using System;\n\n#nullable enable\nnamespace Prism.Dialogs;\n\n/// <summary>\n/// An <see cref=\"IDialogResult\"/> that contains <see cref=\"IDialogParameters\"/> from the dialog\n/// and the <see cref=\"ButtonResult\"/> of the dialog.\n/// </summary>\npublic class DialogResult : IDialogResult\n{\n    /// <summary>\n    /// Creates a new <see cref=\"DialogResult\"/>\n    /// </summary>\n    public DialogResult()\n        : this(ButtonResult.None)\n    {\n    }\n\n    /// <summary>\n    /// Creates a new <see cref=\"DialogResult\"/> with a specified <see cref=\"ButtonResult\"/>\n    /// </summary>\n    /// <param name=\"result\"></param>\n    public DialogResult(ButtonResult result)\n    {\n        Result = result;\n    }\n\n    /// <summary>\n    /// An <see cref=\"System.Exception\"/> that was thrown by the DialogService\n    /// </summary>\n    public Exception? Exception { get; set; }\n\n    /// <summary>\n    /// The parameters from the dialog.\n    /// </summary>\n    public IDialogParameters Parameters { get; set; } = new DialogParameters();\n\n    /// <summary>\n    /// The result of the dialog.\n    /// </summary>\n    public ButtonResult Result { get; set; } = ButtonResult.None;\n}\n"
  },
  {
    "path": "src/Prism.Core/Dialogs/DialogUtilities.cs",
    "content": "﻿using System;\nusing System.ComponentModel;\nusing System.Linq;\nusing System.Reflection;\nusing System.Threading.Tasks;\n\nnamespace Prism.Dialogs;\n\n/// <summary>\n/// Provides utilities for the Dialog Service to be able to reuse\n/// </summary>\n[EditorBrowsable(EditorBrowsableState.Never)]\npublic static class DialogUtilities\n{\n    /// <summary>\n    /// Initializes <see cref=\"IDialogAware.RequestClose\"/>\n    /// </summary>\n    /// <param name=\"dialogAware\"></param>\n    /// <param name=\"callback\"></param>\n    [EditorBrowsable(EditorBrowsableState.Never)]\n    public static void InitializeListener(IDialogAware dialogAware, Func<IDialogResult, Task> callback)\n    {\n        var listener = new DialogCloseListener(callback);\n        SetListener(dialogAware, listener);\n    }\n\n    /// <summary>\n    /// Initializes <see cref=\"IDialogAware.RequestClose\"/>\n    /// </summary>\n    /// <param name=\"dialogAware\"></param>\n    /// <param name=\"callback\"></param>\n    [EditorBrowsable(EditorBrowsableState.Never)]\n    public static void InitializeListener(IDialogAware dialogAware, Action<IDialogResult> callback)\n    {\n        var listener = new DialogCloseListener(callback);\n        SetListener(dialogAware, listener);\n    }\n\n    private static void SetListener(IDialogAware dialogAware, DialogCloseListener listener)\n    {\n        var setter = GetListenerSetter(dialogAware, dialogAware.GetType());\n        setter(listener);\n    }\n\n    private static Action<DialogCloseListener> GetListenerSetter(IDialogAware dialogAware, Type type)\n    {\n        var propInfo = type.GetProperty(nameof(IDialogAware.RequestClose));\n\n        if (propInfo is not null && propInfo.PropertyType == typeof(DialogCloseListener) && propInfo.SetMethod is not null)\n        {\n            return x => propInfo.SetValue(dialogAware, x);\n        }\n\n        var fields = type.GetRuntimeFields().Where(x => x.FieldType == typeof(DialogCloseListener));\n        var field = fields.FirstOrDefault(x => x.Name == $\"<{nameof(IDialogAware.RequestClose)}>k__BackingField\");\n        if (field is not null)\n        {\n            return x => field.SetValue(dialogAware, x);\n        }\n        else if (fields.Any())\n        {\n            field = fields.First();\n            return x => field.SetValue(dialogAware, x);\n        }\n\n        var baseType = type.BaseType;\n        if (baseType is null || baseType == typeof(object))\n            throw new DialogException(DialogException.UnableToSetTheDialogCloseListener);\n\n        return GetListenerSetter(dialogAware, baseType);\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Dialogs/IDialogAware.cs",
    "content": "namespace Prism.Dialogs;\n\n/// <summary>\n/// Provides a way for objects involved in Dialogs to be notified of Dialog activities.\n/// </summary>\npublic interface IDialogAware\n{\n    /// <summary>\n    /// Evaluates whether the Dialog is in a state that would allow the Dialog to Close\n    /// </summary>\n    /// <returns><c>true</c> if the Dialog can close</returns>\n    bool CanCloseDialog();\n\n    /// <summary>\n    /// Provides a callback to clean up resources or finalize tasks when the Dialog has been closed\n    /// </summary>\n    void OnDialogClosed();\n\n    /// <summary>\n    /// Initializes the state of the Dialog with provided DialogParameters\n    /// </summary>\n    /// <param name=\"parameters\"></param>\n    void OnDialogOpened(IDialogParameters parameters);\n\n    /// <summary>\n    /// The <see cref=\"DialogCloseListener\"/> will be set by the <see cref=\"IDialogService\"/> and can be called to\n    /// invoke the close of the Dialog.\n    /// </summary>\n    DialogCloseListener RequestClose { get; }\n}\n"
  },
  {
    "path": "src/Prism.Core/Dialogs/IDialogParameters.cs",
    "content": "﻿using Prism.Common;\n\nnamespace Prism.Dialogs;\n\n/// <summary>\n/// Provides a way for the <see cref=\"IDialogService\"/> to pass parameters when displaying a dialog.\n/// </summary>\npublic interface IDialogParameters : IParameters\n{\n}\n"
  },
  {
    "path": "src/Prism.Core/Dialogs/IDialogResult.cs",
    "content": "﻿using System;\n\n#nullable enable\nnamespace Prism.Dialogs;\n\n/// <summary>\n/// Contains <see cref=\"IDialogParameters\"/> from the dialog\n/// and the <see cref=\"ButtonResult\"/> of the dialog.\n/// </summary>\npublic interface IDialogResult\n{\n    /// <summary>\n    /// An <see cref=\"System.Exception\"/> that was thrown by the DialogService\n    /// </summary>\n    Exception? Exception { get; }\n\n    /// <summary>\n    /// The result of the dialog.\n    /// </summary>\n    public ButtonResult Result { get; }\n\n    /// <summary>\n    /// The parameters from the dialog.\n    /// </summary>\n    IDialogParameters Parameters { get; }\n}\n"
  },
  {
    "path": "src/Prism.Core/Dialogs/IDialogService.cs",
    "content": "﻿namespace Prism.Dialogs;\n\n/// <summary>\n/// Defines a contract for displaying dialogs from ViewModels.\n/// </summary>\npublic interface IDialogService\n{\n    /// <summary>\n    /// Displays a dialog.\n    /// </summary>\n    /// <param name=\"name\">The unique name of the dialog to display. Must match an entry in the <see cref=\"Prism.Ioc.IContainerRegistry\"/>.</param>\n    /// <param name=\"parameters\">Parameters that the dialog can use for custom functionality.</param>\n    /// <param name=\"callback\">The action to be invoked upon successful or failed completion of displaying the dialog.</param>\n    /// <example>\n    /// This example shows how to display a dialog with two parameters.\n    /// <code>\n    /// var parameters = new DialogParameters\n    /// {\n    ///     { \"title\", \"Connection Lost!\" },\n    ///     { \"message\", \"We seem to have lost network connectivity\" }\n    /// };\n    /// _dialogService.ShowDialog(\"DemoDialog\", parameters, <paramref name=\"callback\"/>: null);\n    /// </code>\n    /// </example>\n    void ShowDialog(string name, IDialogParameters parameters, DialogCallback callback);\n}\n"
  },
  {
    "path": "src/Prism.Core/Dialogs/IDialogServiceExtensions.cs",
    "content": "﻿using System;\nusing System.Threading.Tasks;\n\nnamespace Prism.Dialogs;\n\n/// <summary>\n/// Provides compatibility Extensions for the <see cref=\"IDialogService\"/>\n/// </summary>\npublic static class IDialogServiceExtensions\n{\n    /// <summary>\n    /// Shows the dialog with the given name and passes parameters to the dialog\n    /// </summary>\n    /// <param name=\"dialogService\">The <see cref=\"IDialogService\"/>.</param>\n    /// <param name=\"name\">The name of the dialog</param>\n    /// <param name=\"parameters\">The <see cref=\"IDialogParameters\"/> to pass to the dialog</param>\n    public static void ShowDialog(this IDialogService dialogService, string name, IDialogParameters parameters) =>\n        dialogService.ShowDialog(name, parameters, DialogCallback.Empty);\n\n    /// <summary>\n    /// Shows the dialog with the given name and passes an empty set of DialogParameters\n    /// </summary>\n    /// <param name=\"dialogService\">The <see cref=\"IDialogService\"/>.</param>\n    /// <param name=\"name\">The name of the dialog</param>\n    public static void ShowDialog(this IDialogService dialogService, string name) =>\n        dialogService.ShowDialog(name, new DialogParameters());\n\n    /// <summary>\n    /// Shows a dialog with a given name which needs no parameters but has a <see cref=\"DialogCallback\"/>\n    /// </summary>\n    /// <param name=\"dialogService\">The <see cref=\"IDialogService\"/>.</param>\n    /// <param name=\"name\">The name of the dialog</param>\n    /// <param name=\"callback\">A specified <see cref=\"DialogCallback\"/>.</param>\n    public static void ShowDialog(this IDialogService dialogService, string name, DialogCallback callback) =>\n        dialogService.ShowDialog(name, new DialogParameters(), callback);\n\n    /// <summary>\n    /// Shows a Dialog with a given name and an <see cref=\"Action\"/> for a callback\n    /// </summary>\n    /// <param name=\"dialogService\">The <see cref=\"IDialogService\"/>.</param>\n    /// <param name=\"name\">The name of the dialog</param>\n    /// <param name=\"callback\"></param>\n    /// <remarks>This is for backwards compatibility. Use DialogCallback instead.</remarks>\n    public static void ShowDialog(this IDialogService dialogService, string name, Action callback) =>\n        dialogService.ShowDialog(name, null, callback);\n\n    /// <summary>\n    /// Shows a Dialog with a given name and an <see cref=\"Action{IDialogResult}\"/> for a callback\n    /// </summary>\n    /// <param name=\"dialogService\">The <see cref=\"IDialogService\"/>.</param>\n    /// <param name=\"name\">The name of the dialog</param>\n    /// <param name=\"callback\"></param>\n    /// <remarks>This is for backwards compatibility. Use DialogCallback instead.</remarks>\n    public static void ShowDialog(this IDialogService dialogService, string name, Action<IDialogResult> callback) =>\n        dialogService.ShowDialog(name, null, callback);\n\n    /// <summary>\n    /// Shows a Dialog with a given name and an <see cref=\"Action\"/> for a callback.\n    /// </summary>\n    /// <param name=\"dialogService\">The <see cref=\"IDialogService\"/>.</param>\n    /// <param name=\"name\">The name of the dialog</param>\n    /// <param name=\"parameters\">The <see cref=\"IDialogParameters\"/> to pass to the dialog</param>\n    /// <param name=\"callback\"></param>\n    /// <remarks>This is for backwards compatibility. Use DialogCallback instead.</remarks>\n    public static void ShowDialog(this IDialogService dialogService, string name, IDialogParameters parameters, Action callback) =>\n        dialogService.ShowDialog(name, parameters, new DialogCallback().OnClose(callback));\n\n    /// <summary>\n    /// Shows a Dialog with a given name and an <see cref=\"Action{IDialogResult}\"/> for a callback\n    /// </summary>\n    /// <param name=\"dialogService\">The <see cref=\"IDialogService\"/>.</param>\n    /// <param name=\"name\">The name of the dialog</param>\n    /// <param name=\"parameters\">The <see cref=\"IDialogParameters\"/> to pass to the dialog</param>\n    /// <param name=\"callback\"></param>\n    /// <remarks>This is for backwards compatibility. Use DialogCallback instead.</remarks>\n    public static void ShowDialog(this IDialogService dialogService, string name, IDialogParameters parameters, Action<IDialogResult> callback) =>\n        dialogService.ShowDialog(name, parameters, new DialogCallback().OnClose(callback));\n\n    /// <summary>\n    /// Asynchronously shows the Dialog and returns the <see cref=\"IDialogResult\"/>.\n    /// </summary>\n    /// <param name=\"dialogService\">The <see cref=\"IDialogService\"/>.</param>\n    /// <param name=\"name\">The name of the dialog</param>\n    /// <returns>An <see cref=\"IDialogResult\"/> on the close of the dialog.</returns>\n    public static Task<IDialogResult> ShowDialogAsync(this IDialogService dialogService, string name) =>\n        dialogService.ShowDialogAsync(name, new DialogParameters());\n\n    /// <summary>\n    /// Asynchronously shows the Dialog and returns the <see cref=\"IDialogResult\"/>, with given <see cref=\"IDialogParameters\"/>.\n    /// </summary>\n    /// <param name=\"dialogService\">The <see cref=\"IDialogService\"/>.</param>\n    /// <param name=\"name\">The name of the dialog</param>\n    /// <param name=\"parameters\">The <see cref=\"IDialogParameters\"/> to pass to the dialog</param>\n    /// <returns>An <see cref=\"IDialogResult\"/> on the close of the dialog.</returns>\n    public static Task<IDialogResult> ShowDialogAsync(this IDialogService dialogService, string name, IDialogParameters parameters)\n    {\n        var tcs = new TaskCompletionSource<IDialogResult>();\n        dialogService.ShowDialog(name, parameters, new DialogCallback().OnClose(result =>\n        {\n            if (result.Exception is DialogException de && de.Message == DialogException.CanCloseIsFalse)\n                return;\n            else if (result.Exception is not null)\n                tcs.TrySetException(result.Exception);\n            else\n                tcs.TrySetResult(result);\n        }));\n        return tcs.Task;\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Extensions/TaskExtensions.cs",
    "content": "﻿namespace System.Threading.Tasks\n{\n    /// <summary>\n    /// Extension methods for the Task object.\n    /// </summary>\n    public static class TaskExtensions\n    {\n        /// <summary>\n        /// Awaits a task without blocking the main thread.\n        /// </summary>\n        /// <remarks>Primarily used to replace async void scenarios such as ctor's and ICommands.</remarks>\n        /// <param name=\"task\">The task to be awaited</param>\n        public static void Await(this Task task)\n        {\n            task.Await(null, null, false);\n        }\n\n        /// <summary>\n        /// Awaits a task without blocking the main thread.\n        /// </summary>\n        /// <remarks>Primarily used to replace async void scenarios such as ctor's and ICommands.</remarks>\n        /// <param name=\"task\">The task to be awaited</param>\n        /// <param name=\"configureAwait\">Configures an awaiter used to await this task</param>\n        public static void Await(this Task task, bool configureAwait)\n        {\n            task.Await(null, null, configureAwait);\n        }\n\n        /// <summary>\n        /// Awaits a task without blocking the main thread.\n        /// </summary>\n        /// <remarks>Primarily used to replace async void scenarios such as ctor's and ICommands.</remarks>\n        /// <param name=\"task\">The task to be awaited</param>\n        /// <param name=\"completedCallback\">The action to perform when the task is complete.</param>\n        public static void Await(this Task task, Action completedCallback)\n        {\n            task.Await(completedCallback, null, false);\n        }\n\n        /// <summary>\n        /// Awaits a task without blocking the main thread.\n        /// </summary>\n        /// <remarks>Primarily used to replace async void scenarios such as ctor's and ICommands.</remarks>\n        /// <param name=\"task\">The task to be awaited</param>\n        /// <param name=\"completedCallback\">The action to perform when the task is complete.</param>\n        /// <param name=\"errorCallback\">The action to perform when an error occurs executing the task.</param>\n        public static void Await(this Task task, Action completedCallback, Action<Exception> errorCallback)\n        {\n            task.Await(completedCallback, errorCallback, false);\n        }\n\n        /// <summary>\n        /// Awaits a task without blocking the main thread.\n        /// </summary>\n        /// <remarks>Primarily used to replace async void scenarios such as ctor's and ICommands.</remarks>\n        /// <param name=\"task\">The task to be awaited</param>\n        /// <param name=\"errorCallback\">The action to perform when an error occurs executing the task.</param>\n        public static void Await(this Task task, Action<Exception> errorCallback)\n        {\n            task.Await(null, errorCallback, false);\n        }\n\n        /// <summary>\n        /// Awaits a task without blocking the main thread.\n        /// </summary>\n        /// <remarks>Primarily used to replace async void scenarios such as ctor's and ICommands.</remarks>\n        /// <param name=\"task\">The task to be awaited</param>\n        /// <param name=\"completedCallback\">The action to perform when the task is complete.</param>\n        /// <param name=\"errorCallback\">The action to perform when an error occurs executing the task.</param>\n        /// <param name=\"configureAwait\">Configures an awaiter used to await this task</param>\n        public async static void Await(this Task task, Action completedCallback, Action<Exception> errorCallback, bool configureAwait)\n        {\n            try\n            {\n                await task.ConfigureAwait(configureAwait);\n                completedCallback?.Invoke();\n            }\n            catch (Exception ex)\n            {\n                errorCallback?.Invoke(ex);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Extensions/TaskExtensions{T}.cs",
    "content": "﻿namespace System.Threading.Tasks\n{\n    /// <summary>\n    /// Extension methods for the Task object.\n    /// </summary>\n    public static class TaskExtensionsT\n    {\n        /// <summary>\n        /// Awaits a task without blocking the main thread.\n        /// </summary>\n        /// <remarks>Primarily used to replace async void scenarios such as ctor's and ICommands.</remarks>\n        /// <typeparam name=\"T\">The result type</typeparam>\n        /// <param name=\"task\">The task to be awaited</param>\n        public static void Await<T>(this Task<T> task)\n        {\n            task.Await(null, null, false);\n        }\n\n        /// <summary>\n        /// Awaits a task without blocking the main thread.\n        /// </summary>\n        /// <remarks>Primarily used to replace async void scenarios such as ctor's and ICommands.</remarks>\n        /// <typeparam name=\"T\">The result type</typeparam>\n        /// <param name=\"task\">The task to be awaited</param>\n        /// <param name=\"configureAwait\">Configures an awaiter used to await this task</param>\n        public static void Await<T>(this Task<T> task, bool configureAwait)\n        {\n            task.Await(null, null, configureAwait);\n        }\n\n        /// <summary>\n        /// Awaits a task without blocking the main thread.\n        /// </summary>\n        /// <remarks>Primarily used to replace async void scenarios such as ctor's and ICommands.</remarks>\n        /// <typeparam name=\"T\">The result type</typeparam>\n        /// <param name=\"task\">The task to be awaited</param>\n        /// <param name=\"completedCallback\">The action to perform when the task is complete.</param>\n        public static void Await<T>(this Task<T> task, Action<T> completedCallback)\n        {\n            task.Await(completedCallback, null, false);\n        }\n\n        /// <summary>\n        /// Awaits a task without blocking the main thread.\n        /// </summary>\n        /// <remarks>Primarily used to replace async void scenarios such as ctor's and ICommands.</remarks>\n        /// <typeparam name=\"T\">The result type</typeparam>\n        /// <param name=\"task\">The task to be awaited</param>\n        /// <param name=\"completedCallback\">The action to perform when the task is complete.</param>\n        /// <param name=\"errorCallback\">The action to perform when an error occurs executing the task.</param>\n        public static void Await<T>(this Task<T> task, Action<T> completedCallback, Action<Exception> errorCallback)\n        {\n            task.Await(completedCallback, errorCallback, false);\n        }\n\n        /// <summary>\n        /// Awaits a task without blocking the main thread.\n        /// </summary>\n        /// <remarks>Primarily used to replace async void scenarios such as ctor's and ICommands.</remarks>\n        /// <typeparam name=\"T\">The result type</typeparam>\n        /// <param name=\"task\">The task to be awaited</param>\n        /// <param name=\"errorCallback\">The action to perform when an error occurs executing the task.</param>\n        public static void Await<T>(this Task<T> task, Action<Exception> errorCallback)\n        {\n            task.Await(null, errorCallback, false);\n        }\n\n        /// <summary>\n        /// Awaits a task without blocking the main thread.\n        /// </summary>\n        /// <remarks>Primarily used to replace async void scenarios such as ctor's and ICommands.</remarks>\n        /// <typeparam name=\"T\">The result type</typeparam>\n        /// <param name=\"task\">The task to be awaited</param>\n        /// <param name=\"completedCallback\">The action to perform when the task is complete.</param>\n        /// <param name=\"errorCallback\">The action to perform when an error occurs executing the task.</param>\n        /// <param name=\"configureAwait\">Configures an awaiter used to await this task</param>\n        public async static void Await<T>(this Task<T> task, Action<T> completedCallback, Action<Exception> errorCallback, bool configureAwait)\n        {\n            try\n            {\n                T result = await task.ConfigureAwait(configureAwait);\n                completedCallback?.Invoke(result);\n            }\n            catch (Exception ex)\n            {\n                errorCallback?.Invoke(ex);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/GlobalSuppressions.cs",
    "content": "﻿// This file is used by Code Analysis to maintain SuppressMessage\n// attributes that are applied to this project.\n// Project-level suppression either have no target or are given\n// a specific target and scoped to a namespace, type, member, etc.\n\nusing System.Diagnostics.CodeAnalysis;\n\n[assembly: SuppressMessage(\"Design\", \"CA1031:Do not catch general exception types\", Justification = \"We actually want to catch any exception\")]\n"
  },
  {
    "path": "src/Prism.Core/IActiveAware.cs",
    "content": "﻿using System;\n\nnamespace Prism\n{\n    /// <summary>\n    /// Interface that defines if the object instance is active\n    /// and notifies when the activity changes.\n    /// </summary>\n    public interface IActiveAware\n    {\n        /// <summary>\n        /// Gets or sets a value indicating whether the object is active.\n        /// </summary>\n        /// <value><see langword=\"true\" /> if the object is active; otherwise <see langword=\"false\" />.</value>\n        bool IsActive { get; set; }\n\n        /// <summary>\n        /// Notifies that the value for <see cref=\"IsActive\"/> property has changed.\n        /// </summary>\n        event EventHandler IsActiveChanged;\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Modularity/CyclicDependencyFoundException.Desktop.cs",
    "content": "\n\nusing System;\nusing System.Runtime.Serialization;\n\nnamespace Prism.Modularity\n{\n    [Serializable]\n    public partial class CyclicDependencyFoundException\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CyclicDependencyFoundException\"/> class\n        /// with the serialization data.\n        /// </summary>\n        /// <param name=\"info\">Holds the serialized object data about the exception being thrown.</param>\n        /// <param name=\"context\">Contains contextual information about the source or destination.</param>\n        protected CyclicDependencyFoundException(SerializationInfo info, StreamingContext context) : base(info, context) { }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Modularity/CyclicDependencyFoundException.cs",
    "content": "using System;\n\nnamespace Prism.Modularity\n{\n    /// <summary>\n    /// Represents the exception that is thrown when there is a circular dependency\n    /// between modules during the module loading process.\n    /// </summary>\n    public partial class CyclicDependencyFoundException : ModularityException\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CyclicDependencyFoundException\"/> class.\n        /// </summary>\n        public CyclicDependencyFoundException() : base() { }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CyclicDependencyFoundException\"/> class\n        /// with the specified error message.\n        /// </summary>\n        /// <param name=\"message\">The message that describes the error.</param>\n        public CyclicDependencyFoundException(string message) : base(message) { }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CyclicDependencyFoundException\"/> class\n        /// with the specified error message and inner exception.\n        /// </summary>\n        /// <param name=\"message\">The error message that explains the reason for the exception.</param>\n        /// <param name=\"innerException\">The exception that is the cause of the current exception.</param>\n        public CyclicDependencyFoundException(string message, Exception innerException) : base(message, innerException) { }\n\n        /// <summary>\n        /// Initializes the exception with a particular module, error message and inner exception that happened.\n        /// </summary>\n        /// <param name=\"moduleName\">The name of the module.</param>\n        /// <param name=\"message\">The error message that explains the reason for the exception.</param>\n        /// <param name=\"innerException\">The exception that is the cause of the current exception, \n        /// or a <see langword=\"null\"/> reference if no inner exception is specified.</param>\n        public CyclicDependencyFoundException(string moduleName, string message, Exception innerException)\n            : base(moduleName, message, innerException)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Modularity/DuplicateModuleException.Desktop.cs",
    "content": "\n\nusing System;\nusing System.Runtime.Serialization;\n\nnamespace Prism.Modularity\n{\n    [Serializable]\n    public partial class DuplicateModuleException\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DuplicateModuleException\"/> class\n        /// with the serialization data.\n        /// </summary>\n        /// <param name=\"info\">Holds the serialized object data about the exception being thrown.</param>\n        /// <param name=\"context\">Contains contextual information about the source or destination.</param>\n        protected DuplicateModuleException(SerializationInfo info, StreamingContext context) : base(info, context) { }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Modularity/DuplicateModuleException.cs",
    "content": "\n\nusing System;\n\nnamespace Prism.Modularity\n{\n    /// <summary>\n    /// Exception thrown when a module is declared twice in the same catalog.\n    /// </summary>\n    public partial class DuplicateModuleException : ModularityException\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DuplicateModuleException\"/> class.\n        /// </summary>\n        public DuplicateModuleException()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DuplicateModuleException\"/> class.\n        /// </summary>\n        /// <param name=\"message\">The exception message.</param>\n        public DuplicateModuleException(string message) : base(message)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DuplicateModuleException\"/> class.\n        /// </summary>\n        /// <param name=\"message\">The exception message.</param>\n        /// <param name=\"innerException\">The inner exception.</param>\n        public DuplicateModuleException(string message, Exception innerException) : base(message, innerException)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DuplicateModuleException\" /> class with a specified error message.\n        /// </summary>\n        /// <param name=\"moduleName\">The name of the module.</param>\n        /// <param name=\"message\">The message that describes the error.</param>\n        public DuplicateModuleException(string moduleName, string message)\n            : base(moduleName, message)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DuplicateModuleException\" /> class with a specified error message and a reference to the inner exception that is the cause of this exception.\n        /// </summary>\n        /// <param name=\"moduleName\">The name of the module.</param>\n        /// <param name=\"message\">The error message that explains the reason for the exception.</param>\n        /// <param name=\"innerException\">The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified.</param>\n        public DuplicateModuleException(string moduleName, string message, Exception innerException)\n            : base(moduleName, message, innerException)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Modularity/IModule.cs",
    "content": "using Prism.Ioc;\n\nnamespace Prism.Modularity\n{\n    /// <summary>\n    /// Defines the contract for the modules deployed in the application.\n    /// </summary>\n    public interface IModule\n    {\n        /// <summary>\n        /// Used to register types with the container that will be used by your application.\n        /// </summary>\n        void RegisterTypes(IContainerRegistry containerRegistry);\n\n        /// <summary>\n        /// Notifies the module that it has been initialized.\n        /// </summary>\n        void OnInitialized(IContainerProvider containerProvider);\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Modularity/IModuleCatalog.cs",
    "content": "using System.Collections.Generic;\n\nnamespace Prism.Modularity\n{\n    /// <summary>\n    /// This is the expected catalog definition for the ModuleManager. \n    /// The ModuleCatalog holds information about the modules that can be used by the \n    /// application. Each module is described in a ModuleInfo class, that records the \n    /// name, type and location of the module. \n    /// </summary>\n    public interface IModuleCatalog\n    {\n        /// <summary>\n        /// Gets all the <see cref=\"IModuleInfo\"/> classes that are in the <see cref=\"IModuleCatalog\"/>.\n        /// </summary>\n        IEnumerable<IModuleInfo> Modules { get; }\n\n        /// <summary>\n        /// Return the list of <see cref=\"IModuleInfo\"/>s that <paramref name=\"moduleInfo\"/> depends on.\n        /// </summary>\n        /// <param name=\"moduleInfo\">The <see cref=\"IModuleInfo\"/> to get the </param>\n        /// <returns>An enumeration of <see cref=\"IModuleInfo\"/> that <paramref name=\"moduleInfo\"/> depends on.</returns>\n        IEnumerable<IModuleInfo> GetDependentModules(IModuleInfo moduleInfo);\n\n        /// <summary>\n        /// Returns the collection of <see cref=\"IModuleInfo\"/>s that contain both the <see cref=\"IModuleInfo\"/>s in \n        /// <paramref name=\"modules\"/>, but also all the modules they depend on. \n        /// </summary>\n        /// <param name=\"modules\">The modules to get the dependencies for.</param>\n        /// <returns>\n        /// A collection of <see cref=\"IModuleInfo\"/> that contains both all <see cref=\"IModuleInfo\"/>s in <paramref name=\"modules\"/>\n        /// and also all the <see cref=\"IModuleInfo\"/> they depend on.\n        /// </returns>\n        IEnumerable<IModuleInfo> CompleteListWithDependencies(IEnumerable<IModuleInfo> modules);\n\n        /// <summary>\n        /// Initializes the catalog, which may load and validate the modules.\n        /// </summary>\n        void Initialize();\n\n        /// <summary>\n        /// Adds a <see cref=\"IModuleInfo\"/> to the <see cref=\"IModuleCatalog\"/>.\n        /// </summary>\n        /// <param name=\"moduleInfo\">The <see cref=\"IModuleInfo\"/> to add.</param>\n        /// <returns>The <see cref=\"IModuleCatalog\"/> for easily adding multiple modules.</returns>\n        IModuleCatalog AddModule(IModuleInfo moduleInfo);\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Modularity/IModuleCatalogCoreExtensions.cs",
    "content": "﻿using System.Linq;\n\nnamespace Prism.Modularity\n{\n    /// <summary>\n    /// <see cref=\"IModuleCatalog\"/>  extensions.\n    /// </summary>\n    public static class IModuleCatalogCommonExtensions\n    {\n        /// <summary>\n        /// Checks to see if the <see cref=\"IModule\"/> exists in the <see cref=\"IModuleCatalog.Modules\"/>  \n        /// </summary>\n        /// <returns><c>true</c> if the Module exists.</returns>\n        /// <param name=\"catalog\">Catalog.</param>\n        /// <typeparam name=\"T\">The <see cref=\"IModule\"/> to check for.</typeparam>\n        public static bool Exists<T>(this IModuleCatalog catalog)\n            where T : IModule =>\n            catalog.Modules.Any(mi => mi.ModuleType == typeof(T).AssemblyQualifiedName);\n\n        /// <summary>\n        /// Exists the specified catalog and name.\n        /// </summary>\n        /// <returns><c>true</c> if the Module exists.</returns>\n        /// <param name=\"catalog\">Catalog.</param>\n        /// <param name=\"name\">Name.</param>\n        public static bool Exists(this IModuleCatalog catalog, string name) =>\n            catalog.Modules.Any(module => module.ModuleName == name);\n\n        /// <summary>\n        /// Gets the current <see cref=\"ModuleState\"/> of the <see cref=\"IModule\"/>.\n        /// </summary>\n        /// <typeparam name=\"T\">The <see cref=\"IModule\"/> to check.</typeparam>\n        /// <param name=\"catalog\">Catalog.</param>\n        /// <returns></returns>\n        public static ModuleState GetModuleState<T>(this IModuleCatalog catalog)\n            where T : IModule =>\n            catalog.Modules.FirstOrDefault(mi => mi.ModuleType == typeof(T).AssemblyQualifiedName).State;\n\n        /// <summary>\n        /// Gets the current <see cref=\"ModuleState\"/> of the <see cref=\"IModule\"/>.\n        /// </summary>\n        /// <param name=\"catalog\">Catalog.</param>\n        /// <param name=\"name\">Name.</param>\n        /// <returns></returns>\n        public static ModuleState GetModuleState(this IModuleCatalog catalog, string name) =>\n            catalog.Modules.FirstOrDefault(module => module.ModuleName == name).State;\n\n        /// <summary>\n        /// Checks to see if the <see cref=\"IModule\"/> is already initialized. \n        /// </summary>\n        /// <returns><c>true</c>, if initialized, <c>false</c> otherwise.</returns>\n        /// <param name=\"catalog\">Catalog.</param>\n        /// <typeparam name=\"T\">The <see cref=\"IModule\"/> to check.</typeparam>\n        public static bool IsInitialized<T>(this IModuleCatalog catalog)\n            where T : IModule =>\n            catalog.Modules.FirstOrDefault(mi => mi.ModuleType == typeof(T).AssemblyQualifiedName)?.State == ModuleState.Initialized;\n\n        /// <summary>\n        /// Checks to see if the <see cref=\"IModule\"/> is already initialized. \n        /// </summary>\n        /// <returns><c>true</c>, if initialized, <c>false</c> otherwise.</returns>\n        /// <param name=\"catalog\">Catalog.</param>\n        /// <param name=\"name\">Name.</param>\n        public static bool IsInitialized(this IModuleCatalog catalog, string name) =>\n            catalog.Modules.FirstOrDefault(module => module.ModuleName == name)?.State == ModuleState.Initialized;\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Modularity/IModuleCatalogItem.cs",
    "content": "\n\nnamespace Prism.Modularity\n{\n    /// <summary>\n    /// Marker interface that allows both <see cref=\"IModuleInfoGroup\"/>s and <see cref=\"IModuleInfo\"/>s to be\n    /// added to the <see cref=\"IModuleCatalog\"/> from code and XAML. \n    /// </summary>\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Design\", \"CA1040:AvoidEmptyInterfaces\", Justification = \"This is a marker interface\")]\n    public interface IModuleCatalogItem\n    {\n\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Modularity/IModuleInfo.cs",
    "content": "﻿using System.Collections.ObjectModel;\n\nnamespace Prism.Modularity\n{\n    /// <summary>\n    /// Set of properties for each Module\n    /// </summary>\n    public interface IModuleInfo : IModuleCatalogItem\n    {\n        /// <summary>\n        /// The module names this instance depends on.\n        /// </summary>\n        Collection<string> DependsOn { get; set; }\n\n        /// <summary>\n        /// Gets or Sets the <see cref=\"InitializationMode\" />\n        /// </summary>\n        InitializationMode InitializationMode { get; set; }\n\n        /// <summary>\n        /// The name of the module\n        /// </summary>\n        string ModuleName { get; set; }\n\n        /// <summary>\n        /// The module's type\n        /// </summary>\n        string ModuleType { get; set; }\n\n        /// <summary>\n        /// A string ref is a location reference to load the module as it may not be already loaded in the Appdomain in some cases may need to be downloaded.\n        /// </summary>\n        /// <Remarks>\n        /// This is only used for WPF\n        /// </Remarks>\n        string Ref { get; set; }\n\n        /// <summary>\n        /// Gets or Sets the current <see cref=\"ModuleState\" />\n        /// </summary>\n        ModuleState State { get; set; }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Modularity/IModuleInfoGroup.cs",
    "content": "﻿using System.Collections;\nusing System.Collections.Generic;\n\nnamespace Prism.Modularity\n{\n    // IList must be supported in Silverlight 2 to be able to add items from XAML\n    /// <summary>\n    /// A collection of <see cref=\"IModuleInfo\"/> for the Modules used by the application\n    /// </summary>\n    public interface IModuleInfoGroup : IModuleCatalogItem, IList<IModuleInfo>, IList\n    {\n        /// <summary>\n        /// When Prism should Initialize the module\n        /// <see cref=\"InitializationMode\"/>\n        /// </summary>\n        InitializationMode InitializationMode { get; set; }\n\n        /// <summary>\n        /// A string ref is a location reference to load the module as it may not be already loaded in the Appdomain in some cases may need to be downloaded.\n        /// </summary>\n        /// <Remarks>\n        /// This is only used for WPF\n        /// </Remarks>\n        string Ref { get; set; }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Modularity/IModuleInitializer.cs",
    "content": "\n\nnamespace Prism.Modularity\n{\n    /// <summary>\n    /// Declares a service which initializes the modules into the application.\n    /// </summary>\n    public interface IModuleInitializer\n    {\n        /// <summary>\n        /// Initializes the specified module.\n        /// </summary>\n        /// <param name=\"moduleInfo\">The module to initialize</param>\n        void Initialize(IModuleInfo moduleInfo);\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Modularity/IModuleManager.cs",
    "content": "using System;\nusing System.Collections.Generic;\n\nnamespace Prism.Modularity\n{\n    /// <summary>\n    /// Defines the interface for the service that will retrieve and initialize the application's modules.\n    /// </summary>\n    public interface IModuleManager\n    {\n        /// <summary>\n        /// Gets all the <see cref=\"IModuleInfo\"/> classes that are in the <see cref=\"IModuleCatalog\"/>.\n        /// </summary>\n        IEnumerable<IModuleInfo> Modules { get; }\n\n        /// <summary>\n        /// Initializes the modules marked as <see cref=\"InitializationMode.WhenAvailable\"/> on the <see cref=\"IModuleCatalog\"/>.\n        /// </summary>\n        void Run();\n\n        /// <summary>\n        /// Loads and initializes the module on the <see cref=\"IModuleCatalog\"/> with the name <paramref name=\"moduleName\"/>.\n        /// </summary>\n        /// <param name=\"moduleName\">Name of the module requested for initialization.</param>\n        void LoadModule(string moduleName);\n\n        /// <summary>\n        /// Raised repeatedly to provide progress as modules are downloaded.\n        /// </summary>\n        event EventHandler<ModuleDownloadProgressChangedEventArgs> ModuleDownloadProgressChanged;\n\n        /// <summary>\n        /// Raised when a module is loaded or fails to load.\n        /// </summary>\n        event EventHandler<LoadModuleCompletedEventArgs> LoadModuleCompleted;\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Modularity/IModuleManagerExtensions.cs",
    "content": "﻿using System.Linq;\n\nnamespace Prism.Modularity\n{\n    /// <summary>\n    /// Common extensions for the <see cref=\"IModuleManager\"/>\n    /// </summary>\n    public static class IModuleManagerExtensions\n    {\n        /// <summary>\n        /// Checks to see if the <see cref=\"IModule\"/> exists in the <see cref=\"IModuleCatalog.Modules\"/>  \n        /// </summary>\n        /// <returns><c>true</c> if the Module exists.</returns>\n        /// <param name=\"manager\">The <see cref=\"IModuleManager\"/>.</param>\n        /// <typeparam name=\"T\">The <see cref=\"IModule\"/> to check for.</typeparam>\n        public static bool ModuleExists<T>(this IModuleManager manager)\n            where T : IModule =>\n            manager.Modules.Any(mi => mi.ModuleType == typeof(T).AssemblyQualifiedName);\n\n        /// <summary>\n        /// Exists the specified catalog and name.\n        /// </summary>\n        /// <returns><c>true</c> if the Module exists.</returns>\n        /// <param name=\"catalog\">Catalog.</param>\n        /// <param name=\"name\">Name.</param>\n        public static bool ModuleExists(this IModuleManager catalog, string name) =>\n            catalog.Modules.Any(module => module.ModuleName == name);\n\n        /// <summary>\n        /// Gets the current <see cref=\"ModuleState\"/> of the <see cref=\"IModule\"/>.\n        /// </summary>\n        /// <typeparam name=\"T\">The <see cref=\"IModule\"/> to check.</typeparam>\n        /// <param name=\"manager\">The <see cref=\"IModuleManager\"/>.</param>\n        /// <returns></returns>\n        public static ModuleState GetModuleState<T>(this IModuleManager manager)\n            where T : IModule =>\n            manager.Modules.FirstOrDefault(mi => mi.ModuleType == typeof(T).AssemblyQualifiedName).State;\n\n        /// <summary>\n        /// Gets the current <see cref=\"ModuleState\"/> of the <see cref=\"IModule\"/>.\n        /// </summary>\n        /// <param name=\"manager\">The <see cref=\"IModuleManager\"/>.</param>\n        /// <param name=\"name\">Name.</param>\n        /// <returns></returns>\n        public static ModuleState GetModuleState(this IModuleManager manager, string name) =>\n            manager.Modules.FirstOrDefault(module => module.ModuleName == name).State;\n\n        /// <summary>\n        /// Checks to see if the <see cref=\"IModule\"/> is already initialized. \n        /// </summary>\n        /// <returns><c>true</c>, if initialized, <c>false</c> otherwise.</returns>\n        /// <param name=\"manager\">The <see cref=\"IModuleManager\"/>.</param>\n        /// <typeparam name=\"T\">The <see cref=\"IModule\"/> to check.</typeparam>\n        public static bool IsModuleInitialized<T>(this IModuleManager manager)\n            where T : IModule =>\n            manager.Modules.FirstOrDefault(mi => mi.ModuleType == typeof(T).AssemblyQualifiedName)?.State == ModuleState.Initialized;\n\n        /// <summary>\n        /// Checks to see if the <see cref=\"IModule\"/> is already initialized. \n        /// </summary>\n        /// <returns><c>true</c>, if initialized, <c>false</c> otherwise.</returns>\n        /// <param name=\"manager\">The <see cref=\"IModuleManager\"/>.</param>\n        /// <param name=\"name\">Name.</param>\n        public static bool IsModuleInitialized(this IModuleManager manager, string name) =>\n            manager.Modules.FirstOrDefault(module => module.ModuleName == name)?.State == ModuleState.Initialized;\n\n        /// <summary>\n        /// Loads and initializes the module in the <see cref=\"IModuleCatalog\"/>.\n        /// </summary>\n        /// <typeparam name=\"T\">The <see cref=\"IModule\"/> to load.</typeparam>\n        /// <param name=\"manager\">The <see cref=\"IModuleManager\"/>.</param>\n        public static void LoadModule<T>(this IModuleManager manager)\n            where T : IModule =>\n            manager.LoadModule(typeof(T).Name);\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Modularity/InitializationMode.cs",
    "content": "namespace Prism.Modularity\n{\n    /// <summary>\n    /// Specifies on which stage the Module group will be initialized.\n    /// </summary>\n    public enum InitializationMode\n    {\n        /// <summary>\n        /// The module will be initialized when it is available on application start-up.\n        /// </summary>\n        WhenAvailable,\n\n        /// <summary>\n        /// The module will be initialized when requested, and not automatically on application start-up.\n        /// </summary>\n        OnDemand\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Modularity/LoadModuleCompletedEventArgs.cs",
    "content": "\n\nusing System;\n\nnamespace Prism.Modularity\n{\n    /// <summary>\n    /// Provides completion information after a module is loaded, or fails to load.\n    /// </summary>\n    public class LoadModuleCompletedEventArgs : EventArgs\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"LoadModuleCompletedEventArgs\"/> class.\n        /// </summary>\n        /// <param name=\"moduleInfo\">The module info.</param>\n        /// <param name=\"error\">Any error that occurred during the call.</param>\n        public LoadModuleCompletedEventArgs(IModuleInfo moduleInfo, Exception error)\n        {\n            if (moduleInfo == null)\n            {\n                throw new ArgumentNullException(nameof(moduleInfo));\n            }\n\n            this.ModuleInfo = moduleInfo;\n            this.Error = error;\n        }\n\n        /// <summary>\n        /// Gets the module info.\n        /// </summary>\n        /// <value>The module info.</value>\n        public IModuleInfo ModuleInfo { get; private set; }\n\n        /// <summary>\n        /// Gets any error that occurred\n        /// </summary>\n        /// <value>The exception if an error occurred; otherwise null.</value>\n        public Exception Error { get; private set; }\n\n        /// <summary>\n        /// Gets or sets a value indicating whether the error has been handled by the event subscriber.\n        /// </summary>\n        /// <value><c>true</c>if the error is handled; otherwise, <c>false</c>.</value>\n        /// <remarks>\n        /// If there is an error on this event and no event subscriber sets this to true, an exception will be thrown by the event publisher.\n        /// </remarks>\n        public bool IsErrorHandled { get; set; }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Modularity/ModularityException.Desktop.cs",
    "content": "\n\nusing System;\nusing System.Runtime.Serialization;\nusing System.Security.Permissions;\n\nnamespace Prism.Modularity\n{\n    [Serializable]\n    public partial class ModularityException\n    {\n        /// <summary>\n        /// Initializes a new instance with serialized data.\n        /// </summary>\n        /// <param name=\"info\">The <see cref=\"SerializationInfo\"/> that holds the serialized object data about the exception being thrown.</param>\n        /// <param name=\"context\">The <see cref=\"StreamingContext\"/> that contains contextual information about the source or destination.</param>\n        protected ModularityException(SerializationInfo info, StreamingContext context)\n            : base(info, context)\n        {\n            this.ModuleName = info.GetValue(\"ModuleName\", typeof(string)) as string;\n        }\n\n        /// <summary>\n        /// Sets the <see cref=\"System.Runtime.Serialization.SerializationInfo\"/> with information about the exception.\n        /// </summary>\n        /// <param name=\"info\">The <see cref=\"System.Runtime.Serialization.SerializationInfo\"/> that holds the serialized object data about the exception being thrown.</param>\n        /// <param name=\"context\">The <see cref=\"System.Runtime.Serialization.StreamingContext\"/> that contains contextual information about the source or destination.</param>\n#if !NET6_0_OR_GREATER\n        [SecurityPermission(SecurityAction.Demand, Flags = SecurityPermissionFlag.SerializationFormatter)]\n#endif\n        public override void GetObjectData(SerializationInfo info, StreamingContext context)\n        {\n            base.GetObjectData(info, context);\n            info.AddValue(\"ModuleName\", this.ModuleName);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Modularity/ModularityException.cs",
    "content": "\n\nusing System;\n\nnamespace Prism.Modularity\n{\n    /// <summary>\n    /// Base class for exceptions that are thrown because of a problem with modules. \n    /// </summary>\n    public partial class ModularityException : Exception\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ModularityException\"/> class.\n        /// </summary>\n        public ModularityException()\n            : this(null)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ModularityException\"/> class.\n        /// </summary>\n        /// <param name=\"message\">The exception message.</param>\n        public ModularityException(string message)\n            : this(null, message)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ModularityException\"/> class.\n        /// </summary>\n        /// <param name=\"message\">The exception message.</param>\n        /// <param name=\"innerException\">The inner exception.</param>\n        public ModularityException(string message, Exception innerException)\n            : this(null, message, innerException)\n        {\n        }\n\n        /// <summary>\n        /// Initializes the exception with a particular module and error message.\n        /// </summary>\n        /// <param name=\"moduleName\">The name of the module.</param>\n        /// <param name=\"message\">The error message that explains the reason for the exception.</param>\n        public ModularityException(string moduleName, string message)\n            : this(moduleName, message, null)\n        {\n        }\n\n        /// <summary>\n        /// Initializes the exception with a particular module, error message and inner exception that happened.\n        /// </summary>\n        /// <param name=\"moduleName\">The name of the module.</param>\n        /// <param name=\"message\">The error message that explains the reason for the exception.</param>\n        /// <param name=\"innerException\">The exception that is the cause of the current exception, \n        /// or a <see langword=\"null\"/> reference if no inner exception is specified.</param>\n        public ModularityException(string moduleName, string message, Exception innerException)\n            : base(message, innerException)\n        {\n            this.ModuleName = moduleName;\n        }\n\n        /// <summary>\n        /// Gets or sets the name of the module that this exception refers to.\n        /// </summary>\n        /// <value>The name of the module.</value>\n        public string ModuleName { get; set; }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Modularity/ModuleCatalogBase.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Collections.Specialized;\nusing System.Globalization;\nusing System.Linq;\nusing Prism.Properties;\n\nnamespace Prism.Modularity\n{\n    /// <summary>\n    /// The <see cref=\"ModuleCatalogBase\"/> holds information about the modules that can be used by the\n    /// application. Each module is described in a <see cref=\"IModuleInfo\"/> class, that records the\n    /// name, type and location of the module.\n    ///\n    /// It also verifies that the <see cref=\"ModuleCatalogBase\"/> is internally valid. That means that\n    /// it does not have:\n    /// <list>\n    ///     <item>Circular dependencies</item>\n    ///     <item>Missing dependencies</item>\n    ///     <item>\n    ///         Invalid dependencies, such as a Module that's loaded at startup that depends on a module\n    ///         that might need to be retrieved.\n    ///     </item>\n    /// </list>\n    /// The <see cref=\"ModuleCatalogBase\"/> also serves as a baseclass for more specialized Catalogs .\n    /// </summary>\n    public class ModuleCatalogBase : IModuleCatalog\n    {\n        private ModuleCatalogItemCollection _items { get; }\n        private bool _isLoaded;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"IModuleCatalog\"/> class.\n        /// </summary>\n        public ModuleCatalogBase()\n        {\n            _items = new ModuleCatalogItemCollection();\n            _items.CollectionChanged += ItemsCollectionChanged;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"IModuleCatalog\"/> class while providing an\n        /// initial list of <see cref=\"IModuleInfo\"/>s.\n        /// </summary>\n        /// <param name=\"modules\">The initial list of modules.</param>\n        public ModuleCatalogBase(IEnumerable<IModuleInfo> modules)\n            : this()\n        {\n            if (modules == null) throw new ArgumentNullException(nameof(modules));\n            foreach (IModuleInfo moduleInfo in modules)\n            {\n                Items.Add(moduleInfo);\n            }\n        }\n\n        /// <summary>\n        /// Gets the items in the <see cref=\"IModuleCatalog\"/>. This property is mainly used to add <see cref=\"IModuleInfoGroup\"/>s or\n        /// <see cref=\"IModuleInfo\"/>s through XAML.\n        /// </summary>\n        /// <value>The items in the catalog.</value>\n        public Collection<IModuleCatalogItem> Items => _items;\n\n        /// <summary>\n        /// Gets all the <see cref=\"IModuleInfo\"/> classes that are in the <see cref=\"IModuleCatalog\"/>, regardless\n        /// if they are within a <see cref=\"IModuleInfoGroup\"/> or not.\n        /// </summary>\n        /// <value>The modules.</value>\n        public virtual IEnumerable<IModuleInfo> Modules => GrouplessModules.Union(Groups.SelectMany(g => g));\n\n        /// <summary>\n        /// Gets the <see cref=\"IModuleInfoGroup\"/>s that have been added to the <see cref=\"IModuleCatalog\"/>.\n        /// </summary>\n        /// <value>The groups.</value>\n        public IEnumerable<IModuleInfoGroup> Groups => Items.OfType<IModuleInfoGroup>();\n\n        /// <summary>\n        /// Gets or sets a value that remembers whether the <see cref=\"ModuleCatalogBase\"/> has been validated already.\n        /// </summary>\n        protected bool Validated { get; set; }\n\n        /// <summary>\n        /// Returns the list of <see cref=\"IModuleInfo\"/>s that are not contained within any <see cref=\"IModuleInfoGroup\"/>.\n        /// </summary>\n        /// <value>The groupless modules.</value>\n        [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Naming\", \"CA1704:IdentifiersShouldBeSpelledCorrectly\", MessageId = \"Groupless\")]\n        protected IEnumerable<IModuleInfo> GrouplessModules => Items.OfType<IModuleInfo>();\n\n        /// <summary>\n        /// Loads the catalog if necessary.\n        /// </summary>\n        public virtual void Load()\n        {\n            _isLoaded = true;\n            InnerLoad();\n        }\n\n        /// <summary>\n        /// Return the list of <see cref=\"IModuleInfo\"/>s that <paramref name=\"moduleInfo\"/> depends on.\n        /// </summary>\n        /// <remarks>\n        /// If  the <see cref=\"IModuleCatalog\"/> was not yet validated, this method will call <see cref=\"Validate\"/>.\n        /// </remarks>\n        /// <param name=\"moduleInfo\">The <see cref=\"IModuleInfo\"/> to get the </param>\n        /// <returns>An enumeration of <see cref=\"IModuleInfo\"/> that <paramref name=\"moduleInfo\"/> depends on.</returns>\n        public virtual IEnumerable<IModuleInfo> GetDependentModules(IModuleInfo moduleInfo)\n        {\n            this.EnsureCatalogValidated();\n\n            return this.GetDependentModulesInner(moduleInfo);\n        }\n\n        /// <summary>\n        /// Returns a list of <see cref=\"IModuleInfo\"/>s that contain both the <see cref=\"IModuleInfo\"/>s in\n        /// <paramref name=\"modules\"/>, but also all the modules they depend on.\n        /// </summary>\n        /// <param name=\"modules\">The modules to get the dependencies for.</param>\n        /// <returns>\n        /// A list of <see cref=\"IModuleInfo\"/> that contains both all <see cref=\"IModuleInfo\"/>s in <paramref name=\"modules\"/>\n        /// but also all the <see cref=\"IModuleInfo\"/> they depend on.\n        /// </returns>\n        public virtual IEnumerable<IModuleInfo> CompleteListWithDependencies(IEnumerable<IModuleInfo> modules)\n        {\n            if (modules == null)\n                throw new ArgumentNullException(nameof(modules));\n\n            EnsureCatalogValidated();\n\n            List<IModuleInfo> completeList = new List<IModuleInfo>();\n            List<IModuleInfo> pendingList = modules.ToList();\n            while (pendingList.Count > 0)\n            {\n                var moduleInfo = pendingList[0];\n\n                foreach (var dependency in GetDependentModules(moduleInfo))\n                {\n                    if (!completeList.Contains(dependency) && !pendingList.Contains(dependency))\n                    {\n                        pendingList.Add(dependency);\n                    }\n                }\n\n                pendingList.RemoveAt(0);\n                completeList.Add(moduleInfo);\n            }\n\n            IEnumerable<IModuleInfo> sortedList = Sort(completeList);\n            return sortedList;\n        }\n\n        /// <summary>\n        /// Validates the <see cref=\"IModuleCatalog\"/>.\n        /// </summary>\n        /// <exception cref=\"ModularityException\">When validation of the <see cref=\"IModuleCatalog\"/> fails.</exception>\n        public virtual void Validate()\n        {\n            ValidateUniqueModules();\n            ValidateDependencyGraph();\n            ValidateCrossGroupDependencies();\n            ValidateDependenciesInitializationMode();\n\n            Validated = true;\n        }\n\n        /// <summary>\n        /// Adds a <see cref=\"IModuleInfo\"/> to the <see cref=\"IModuleCatalog\"/>.\n        /// </summary>\n        /// <param name=\"moduleInfo\">The <see cref=\"IModuleInfo\"/> to add.</param>\n        /// <returns>The <see cref=\"IModuleCatalog\"/> for easily adding multiple modules.</returns>\n        public virtual IModuleCatalog AddModule(IModuleInfo moduleInfo)\n        {\n            Items.Add(moduleInfo);\n            return this;\n        }\n\n        /// <summary>\n        /// Initializes the catalog, which may load and validate the modules.\n        /// </summary>\n        /// <exception cref=\"ModularityException\">When validation of the <see cref=\"ModuleCatalogBase\"/> fails, because this method calls <see cref=\"Validate\"/>.</exception>\n        public virtual void Initialize()\n        {\n            if (!_isLoaded)\n            {\n                Load();\n            }\n\n            Validate();\n        }\n\n        /// <summary>\n        /// Checks for cyclic dependencies, by calling the dependency solver.\n        /// </summary>\n        /// <param name=\"modules\">the.</param>\n        /// <returns></returns>\n        protected static string[] SolveDependencies(IEnumerable<IModuleInfo> modules)\n        {\n            if (modules == null)\n                throw new ArgumentNullException(nameof(modules));\n\n            ModuleDependencySolver solver = new ModuleDependencySolver();\n\n            foreach (var data in modules)\n            {\n                solver.AddModule(data.ModuleName);\n\n                if (data.DependsOn != null)\n                {\n                    foreach (string dependency in data.DependsOn)\n                    {\n                        solver.AddDependency(data.ModuleName, dependency);\n                    }\n                }\n            }\n\n            if (solver.ModuleCount > 0)\n            {\n                return solver.Solve();\n            }\n\n            return new string[0];\n        }\n\n        /// <summary>\n        /// Ensures that all the dependencies within <paramref name=\"modules\"/> refer to <see cref=\"IModuleInfo\"/>s\n        /// within that list.\n        /// </summary>\n        /// <param name=\"modules\">The modules to validate modules for.</param>\n        /// <exception cref=\"ModularityException\">\n        /// Throws if a <see cref=\"IModuleInfo\"/> in <paramref name=\"modules\"/> depends on a module that's\n        /// not in <paramref name=\"modules\"/>.\n        /// </exception>\n        /// <exception cref=\"ArgumentNullException\">Throws if <paramref name=\"modules\"/> is <see langword=\"null\"/>.</exception>\n        protected static void ValidateDependencies(IEnumerable<IModuleInfo> modules)\n        {\n            if (modules == null)\n                throw new ArgumentNullException(nameof(modules));\n\n            var moduleNames = modules.Select(m => m.ModuleName).ToList();\n            foreach (var moduleInfo in modules)\n            {\n                if (moduleInfo.DependsOn != null && moduleInfo.DependsOn.Except(moduleNames).Any())\n                {\n                    throw new ModularityException(\n                        moduleInfo.ModuleName,\n                        string.Format(CultureInfo.CurrentCulture, Resources.ModuleDependenciesNotMetInGroup, moduleInfo.ModuleName));\n                }\n            }\n        }\n\n        /// <summary>\n        /// Does the actual work of loading the catalog.  The base implementation does nothing.\n        /// </summary>\n        protected virtual void InnerLoad()\n        {\n        }\n\n        /// <summary>\n        /// Sorts a list of <see cref=\"IModuleInfo\"/>s. This method is called by <see cref=\"CompleteListWithDependencies\"/>\n        /// to return a sorted list.\n        /// </summary>\n        /// <param name=\"modules\">The <see cref=\"IModuleInfo\"/>s to sort.</param>\n        /// <returns>Sorted list of <see cref=\"IModuleInfo\"/>s</returns>\n        protected virtual IEnumerable<IModuleInfo> Sort(IEnumerable<IModuleInfo> modules)\n        {\n            foreach (string moduleName in SolveDependencies(modules))\n            {\n                yield return modules.First(m => m.ModuleName == moduleName);\n            }\n        }\n\n        /// <summary>\n        /// Makes sure all modules have an Unique name.\n        /// </summary>\n        /// <exception cref=\"DuplicateModuleException\">\n        /// Thrown if the names of one or more modules are not unique.\n        /// </exception>\n        protected virtual void ValidateUniqueModules()\n        {\n            List<string> moduleNames = Modules.Select(m => m.ModuleName).ToList();\n\n            string duplicateModule = moduleNames.FirstOrDefault(\n                m => moduleNames.Count(m2 => m2 == m) > 1);\n\n            if (duplicateModule != null)\n            {\n                throw new DuplicateModuleException(duplicateModule, string.Format(CultureInfo.CurrentCulture, Resources.DuplicatedModule, duplicateModule));\n            }\n        }\n\n        /// <summary>\n        /// Ensures that there are no cyclic dependencies.\n        /// </summary>\n        protected virtual void ValidateDependencyGraph()\n        {\n            SolveDependencies(Modules);\n        }\n\n        /// <summary>\n        /// Ensures that there are no dependencies between modules on different groups.\n        /// </summary>\n        /// <remarks>\n        /// A groupless module can only depend on other groupless modules.\n        /// A module within a group can depend on other modules within the same group and/or on groupless modules.\n        /// </remarks>\n        protected virtual void ValidateCrossGroupDependencies()\n        {\n            ValidateDependencies(GrouplessModules);\n            foreach (var group in Groups)\n            {\n                ValidateDependencies(GrouplessModules.Union(group));\n            }\n        }\n\n        /// <summary>\n        /// Ensures that there are no modules marked to be loaded <see cref=\"InitializationMode.WhenAvailable\"/>\n        /// depending on modules loaded <see cref=\"InitializationMode.OnDemand\"/>\n        /// </summary>\n        protected virtual void ValidateDependenciesInitializationMode()\n        {\n            var moduleInfo = Modules.FirstOrDefault(\n                m =>\n                m.InitializationMode == InitializationMode.WhenAvailable &&\n                GetDependentModulesInner(m)\n                    .Any(dependency => dependency.InitializationMode == InitializationMode.OnDemand));\n\n            if (moduleInfo != null)\n            {\n                throw new ModularityException(\n                    moduleInfo.ModuleName,\n                    string.Format(CultureInfo.CurrentCulture, Resources.StartupModuleDependsOnAnOnDemandModule, moduleInfo.ModuleName));\n            }\n        }\n\n        /// <summary>\n        /// Returns the <see cref=\"IModuleInfo\"/> on which the received module depends on.\n        /// </summary>\n        /// <param name=\"moduleInfo\">Module whose dependant modules are requested.</param>\n        /// <returns>Collection of <see cref=\"IModuleInfo\"/> dependants of <paramref name=\"moduleInfo\"/>.</returns>\n        protected virtual IEnumerable<IModuleInfo> GetDependentModulesInner(IModuleInfo moduleInfo)\n        {\n            return Modules.Where(dependantModule => moduleInfo.DependsOn.Contains(dependantModule.ModuleName));\n        }\n\n        /// <summary>\n        /// Ensures that the catalog is validated.\n        /// </summary>\n        protected virtual void EnsureCatalogValidated()\n        {\n            if (!Validated)\n            {\n                Validate();\n            }\n        }\n\n        private void ItemsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)\n        {\n            if (Validated)\n            {\n                EnsureCatalogValidated();\n            }\n        }\n\n        private class ModuleCatalogItemCollection : Collection<IModuleCatalogItem>, INotifyCollectionChanged\n        {\n            public event NotifyCollectionChangedEventHandler CollectionChanged;\n\n            protected override void InsertItem(int index, IModuleCatalogItem item)\n            {\n                base.InsertItem(index, item);\n\n                RaiseCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, item, index));\n            }\n\n            protected void RaiseCollectionChanged(NotifyCollectionChangedEventArgs eventArgs)\n            {\n                CollectionChanged?.Invoke(this, eventArgs);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Modularity/ModuleDependencyAttribute.cs",
    "content": "using System;\n\nnamespace Prism.Modularity\n{\n    /// <summary>\n    /// Specifies that the current module has a dependency on another module. This attribute should be used on classes that implement <see cref=\"IModule\"/>.\n    /// </summary>\n    [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]\n    public sealed class ModuleDependencyAttribute : Attribute\n    {\n\n        /// <summary>\n        /// Initializes a new instance of <see cref=\"ModuleDependencyAttribute\"/>.\n        /// </summary>\n        /// <param name=\"moduleName\">The name of the module that this module is dependant upon.</param>\n        public ModuleDependencyAttribute(string moduleName)\n        {\n            ModuleName = moduleName;\n        }\n\n        /// <summary>\n        /// Gets the name of the module that this module is dependant upon.\n        /// </summary>\n        /// <value>The name of the module that this module is dependant upon.</value>\n        public string ModuleName { get; }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Modularity/ModuleDependencySolver.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing Prism.Common;\nusing Prism.Properties;\n\nnamespace Prism.Modularity\n{\n    /// <summary>\n    /// Used by <see cref=\"IModuleInitializer\"/> to get the load sequence\n    /// for the modules to load according to their dependencies.\n    /// </summary>\n    public class ModuleDependencySolver\n    {\n        private readonly ListDictionary<string, string> dependencyMatrix = new ListDictionary<string, string>();\n        private readonly List<string> knownModules = new List<string>();\n\n        /// <summary>\n        /// Adds a module to the solver.\n        /// </summary>\n        /// <param name=\"name\">The name that uniquely identifies the module.</param>\n        public void AddModule(string name)\n        {\n            if (String.IsNullOrEmpty(name))\n                throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Resources.StringCannotBeNullOrEmpty, \"name\"));\n\n            AddToDependencyMatrix(name);\n            AddToKnownModules(name);\n        }\n\n        /// <summary>\n        /// Adds a module dependency between the modules specified by dependingModule and\n        /// dependentModule.\n        /// </summary>\n        /// <param name=\"dependingModule\">The name of the module with the dependency.</param>\n        /// <param name=\"dependentModule\">The name of the module dependingModule\n        /// depends on.</param>\n        public void AddDependency(string dependingModule, string dependentModule)\n        {\n            if (String.IsNullOrEmpty(dependingModule))\n                throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Resources.StringCannotBeNullOrEmpty, \"dependingModule\"));\n\n            if (String.IsNullOrEmpty(dependentModule))\n                throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Resources.StringCannotBeNullOrEmpty, \"dependentModule\"));\n\n            if (!knownModules.Contains(dependingModule))\n                throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Resources.DependencyForUnknownModule, dependingModule));\n\n            AddToDependencyMatrix(dependentModule);\n            dependencyMatrix.Add(dependentModule, dependingModule);\n        }\n\n        private void AddToDependencyMatrix(string module)\n        {\n            if (!dependencyMatrix.ContainsKey(module))\n            {\n                dependencyMatrix.Add(module);\n            }\n        }\n\n        private void AddToKnownModules(string module)\n        {\n            if (!knownModules.Contains(module))\n            {\n                knownModules.Add(module);\n            }\n        }\n\n        /// <summary>\n        /// Calculates an ordered vector according to the defined dependencies.\n        /// Non-dependant modules appears at the beginning of the resulting array.\n        /// </summary>\n        /// <returns>The resulting ordered list of modules.</returns>\n        /// <exception cref=\"CyclicDependencyFoundException\">This exception is thrown\n        /// when a cycle is found in the defined dependency graph.</exception>\n        public string[] Solve()\n        {\n            List<string> skip = new List<string>();\n            while (skip.Count < dependencyMatrix.Count)\n            {\n                List<string> leaves = this.FindLeaves(skip);\n                if (leaves.Count == 0 && skip.Count < dependencyMatrix.Count)\n                {\n                    throw new CyclicDependencyFoundException(Resources.CyclicDependencyFound);\n                }\n                skip.AddRange(leaves);\n            }\n            skip.Reverse();\n\n            if (skip.Count > knownModules.Count)\n            {\n                string moduleNames = this.FindMissingModules(skip);\n                throw new ModularityException(moduleNames, string.Format(CultureInfo.CurrentCulture,\n                                                            Resources.DependencyOnMissingModule,\n                                                            moduleNames));\n            }\n\n            return skip.ToArray();\n        }\n\n        private string FindMissingModules(List<string> skip)\n        {\n            string missingModules = \"\";\n\n            foreach (string module in skip)\n            {\n                if (!knownModules.Contains(module))\n                {\n                    missingModules += \", \";\n                    missingModules += module;\n                }\n            }\n\n            return missingModules.Substring(2);\n        }\n\n        /// <summary>\n        /// Gets the number of modules added to the solver.\n        /// </summary>\n        /// <value>The number of modules.</value>\n        public int ModuleCount\n        {\n            get { return dependencyMatrix.Count; }\n        }\n\n        private List<string> FindLeaves(List<string> skip)\n        {\n            List<string> result = new List<string>();\n\n            foreach (string precedent in dependencyMatrix.Keys)\n            {\n                if (skip.Contains(precedent))\n                {\n                    continue;\n                }\n\n                int count = 0;\n                foreach (string dependent in dependencyMatrix[precedent])\n                {\n                    if (skip.Contains(dependent))\n                    {\n                        continue;\n                    }\n                    count++;\n                }\n                if (count == 0)\n                {\n                    result.Add(precedent);\n                }\n            }\n            return result;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Modularity/ModuleDownloadProgressChangedEventArgs.cs",
    "content": "using System;\nusing System.ComponentModel;\n\nnamespace Prism.Modularity\n{\n    /// <summary>\n    /// Provides progress information as a module downloads.\n    /// </summary>\n    public class ModuleDownloadProgressChangedEventArgs : ProgressChangedEventArgs\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ModuleDownloadProgressChangedEventArgs\"/> class.\n        /// </summary>\n        /// <param name=\"moduleInfo\">The module info.</param>\n        /// <param name=\"bytesReceived\">The bytes received.</param>\n        /// <param name=\"totalBytesToReceive\">The total bytes to receive.</param>\n        public ModuleDownloadProgressChangedEventArgs(IModuleInfo moduleInfo, long bytesReceived, long totalBytesToReceive)\n            : base(CalculateProgressPercentage(bytesReceived, totalBytesToReceive), null)\n        {\n            ModuleInfo = moduleInfo ?? throw new ArgumentNullException(nameof(moduleInfo));\n            BytesReceived = bytesReceived;\n            TotalBytesToReceive = totalBytesToReceive;\n        }\n\n        /// <summary>\n        /// Gets the module info.\n        /// </summary>\n        /// <value>The module info.</value>\n        public IModuleInfo ModuleInfo { get; }\n\n        /// <summary>\n        /// Gets the bytes received.\n        /// </summary>\n        /// <value>The bytes received.</value>\n        public long BytesReceived { get; }\n\n        /// <summary>\n        /// Gets the total bytes to receive.\n        /// </summary>\n        /// <value>The total bytes to receive.</value>\n        public long TotalBytesToReceive { get; }\n\n        private static int CalculateProgressPercentage(long bytesReceived, long totalBytesToReceive)\n        {\n            if ((bytesReceived == 0L) || (totalBytesToReceive == 0L) || (totalBytesToReceive == -1L))\n            {\n                return 0;\n            }\n\n            return (int)((bytesReceived * 100L) / totalBytesToReceive);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Modularity/ModuleInitializeException.Desktop.cs",
    "content": "\n\nusing System;\nusing System.Runtime.Serialization;\n\nnamespace Prism.Modularity\n{\n    [Serializable]\n    public partial class ModuleInitializeException\n    {\n        /// <summary>\n        /// Initializes a new instance with serialized data.\n        /// </summary>\n        /// <param name=\"info\">The <see cref=\"SerializationInfo\"/> that holds the serialized object data about the exception being thrown.</param>\n        /// <param name=\"context\">The <see cref=\"StreamingContext\"/> that contains contextual information about the source or destination.</param>\n        protected ModuleInitializeException(SerializationInfo info, StreamingContext context)\n            : base(info, context)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Modularity/ModuleInitializeException.cs",
    "content": "\n\nusing System;\nusing System.Globalization;\nusing Prism.Properties;\n\nnamespace Prism.Modularity\n{\n    /// <summary>\n    /// Exception thrown by <see cref=\"IModuleInitializer\"/> implementations whenever \n    /// a module fails to load.\n    /// </summary>\n    public partial class ModuleInitializeException : ModularityException\n    {\n        /// <summary>\n        /// Initializes a new instance.\n        /// </summary>\n        public ModuleInitializeException()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ModuleInitializeException\"/> class.\n        /// </summary>\n        /// <param name=\"message\">The exception message.</param>\n        public ModuleInitializeException(string message) : base(message)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ModuleInitializeException\"/> class.\n        /// </summary>\n        /// <param name=\"message\">The exception message.</param>\n        /// <param name=\"innerException\">The inner exception.</param>\n        public ModuleInitializeException(string message, Exception innerException)\n            : base(message, innerException)\n        {\n        }\n\n        /// <summary>\n        /// Initializes the exception with a particular module and error message.\n        /// </summary>\n        /// <param name=\"moduleName\">The name of the module.</param>\n        /// <param name=\"moduleAssembly\">The assembly where the module is located.</param>\n        /// <param name=\"message\">The error message that explains the reason for the exception.</param>\n        public ModuleInitializeException(string moduleName, string moduleAssembly, string message)\n            : this(moduleName, message, moduleAssembly, null)\n        {\n        }\n\n        /// <summary>\n        /// Initializes the exception with a particular module, error message and inner exception \n        /// that happened.\n        /// </summary>\n        /// <param name=\"moduleName\">The name of the module.</param>\n        /// <param name=\"moduleAssembly\">The assembly where the module is located.</param>\n        /// <param name=\"message\">The error message that explains the reason for the exception.</param>\n        /// <param name=\"innerException\">The exception that is the cause of the current exception, \n        /// or a <see langword=\"null\"/> reference if no inner exception is specified.</param>\n        public ModuleInitializeException(string moduleName, string moduleAssembly, string message, Exception innerException)\n            : base(\n                moduleName,\n                String.Format(CultureInfo.CurrentCulture, Resources.FailedToLoadModule, moduleName, moduleAssembly, message),\n                innerException)\n        {\n        }\n\n        /// <summary>\n        /// Initializes the exception with a particular module, error message and inner exception that happened.\n        /// </summary>\n        /// <param name=\"moduleName\">The name of the module.</param>\n        /// <param name=\"message\">The error message that explains the reason for the exception.</param>\n        /// <param name=\"innerException\">The exception that is the cause of the current exception, \n        /// or a <see langword=\"null\"/> reference if no inner exception is specified.</param>\n        public ModuleInitializeException(string moduleName, string message, Exception innerException)\n            : base(\n                moduleName,\n                String.Format(CultureInfo.CurrentCulture, Resources.FailedToLoadModuleNoAssemblyInfo, moduleName, message),\n                innerException)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Modularity/ModuleNotFoundException.Desktop.cs",
    "content": "\n\nusing System;\nusing System.Runtime.Serialization;\n\nnamespace Prism.Modularity\n{\n    /// <summary>\n    /// Exception thrown when a requested <see cref=\"IModuleInfo\"/> is not found.\n    /// </summary>\n    [Serializable]\n    public partial class ModuleNotFoundException\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ModuleNotFoundException\"/> class\n        /// with the serialization data.\n        /// </summary>\n        /// <param name=\"info\">Holds the serialized object data about the exception being thrown.</param>\n        /// <param name=\"context\">Contains contextual information about the source or destination.</param>\n        protected ModuleNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Modularity/ModuleNotFoundException.cs",
    "content": "\n\nusing System;\n\nnamespace Prism.Modularity\n{\n    /// <summary>\n    /// Exception thrown when a requested <see cref=\"InitializationMode.OnDemand\"/> <see cref=\"IModule\"/> was not found.\n    /// </summary>\n    public partial class ModuleNotFoundException : ModularityException\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ModuleNotFoundException\" /> class.\n        /// </summary>\n        public ModuleNotFoundException()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ModuleNotFoundException\" /> class with a specified error message.\n        /// </summary>\n        /// <param name=\"message\">\n        /// The message that describes the error. \n        /// </param>\n        public ModuleNotFoundException(string message)\n            : base(message)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ModuleNotFoundException\" /> class with a specified error message.\n        /// </summary>\n        /// <param name=\"message\">\n        /// The message that describes the error. \n        /// </param>\n        /// <param name=\"innerException\">The inner exception</param>\n        public ModuleNotFoundException(string message, Exception innerException)\n            : base(message, innerException)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ModuleNotFoundException\" /> class with a specified error message and a reference to the inner exception that is the cause of this exception.\n        /// </summary>\n        /// <param name=\"moduleName\">The name of the module.</param>\n        /// <param name=\"message\">The error message that explains the reason for the exception.</param>\n        public ModuleNotFoundException(string moduleName, string message)\n            : base(moduleName, message)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ModuleNotFoundException\" /> class with a specified error message and a reference to the inner exception that is the cause of this exception.\n        /// </summary>\n        /// <param name=\"moduleName\">The name of the module.</param>\n        /// <param name=\"message\">The error message that explains the reason for the exception.</param>\n        /// <param name=\"innerException\">The exception that is the cause of the current exception, or a null reference if no inner exception is specified.</param>\n        public ModuleNotFoundException(string moduleName, string message, Exception innerException)\n            : base(moduleName, message, innerException)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Modularity/ModuleState.cs",
    "content": "\n\nnamespace Prism.Modularity\n{\n    /// <summary>\n    /// Defines the states a <see cref=\"IModuleInfo\"/> can be in, with regards to the module loading and initialization process. \n    /// </summary>\n    public enum ModuleState\n    {\n        /// <summary>\n        /// Initial state for <see cref=\"IModuleInfo\"/>s. The <see cref=\"IModuleInfo\"/> is defined, \n        /// but it has not been loaded, retrieved or initialized yet.\n        /// </summary>\n        NotStarted,\n\n        /// <summary>\n        /// The assembly that contains the type of the module is currently being loaded.\n        /// </summary>\n        /// <remarks>\n        /// Used in Wpf to load a module dynamically\n        /// </remarks>\n        LoadingTypes,\n\n        /// <summary>\n        /// The assembly that holds the Module is present. This means the type of the <see cref=\"IModule\"/> can be instantiated and initialized. \n        /// </summary>\n        ReadyForInitialization,\n\n        /// <summary>\n        /// The module is currently Initializing, by the <see cref=\"IModuleInitializer\"/>\n        /// </summary>\n        Initializing,\n\n        /// <summary>\n        /// The module is initialized and ready to be used. \n        /// </summary>\n        Initialized\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Modularity/ModuleTypeLoadingException.Desktop.cs",
    "content": "\n\nusing System;\nusing System.Runtime.Serialization;\n\nnamespace Prism.Modularity\n{\n    [Serializable]\n    public partial class ModuleTypeLoadingException\n    {\n        /// <summary>\n        /// Initializes a new instance with serialized data.\n        /// </summary>\n        /// <param name=\"info\">The <see cref=\"SerializationInfo\"/> that holds the serialized object data about the exception being thrown.</param>\n        /// <param name=\"context\">The <see cref=\"StreamingContext\"/> that contains contextual information about the source or destination.</param>\n        protected ModuleTypeLoadingException(SerializationInfo info, StreamingContext context)\n            : base(info, context)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Modularity/ModuleTypeLoadingException.cs",
    "content": "\n\nusing System;\nusing System.Globalization;\nusing Prism.Properties;\n\nnamespace Prism.Modularity\n{\n    /// <summary>\n    /// Exception thrown by <see cref=\"IModuleManager\"/> implementations whenever \n    /// a module fails to retrieve.\n    /// </summary>\n    public partial class ModuleTypeLoadingException : ModularityException\n    {\n        /// <summary>\n        /// Initializes a new instance.\n        /// </summary>\n        public ModuleTypeLoadingException()\n            : base()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance with a specified error message.\n        /// </summary>\n        /// <param name=\"message\">The message that describes the error.</param>\n        public ModuleTypeLoadingException(string message)\n            : base(message)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance with a specified error message \n        /// and a reference to the inner exception that is the cause of this exception.\n        /// </summary>\n        /// <param name=\"message\">The error message that explains the reason for the exception.</param>\n        /// <param name=\"exception\">The exception that is the cause of the current exception, \n        /// or a <see langword=\"null\"/> reference if no inner exception is specified.</param>\n        public ModuleTypeLoadingException(string message, Exception exception)\n            : base(message, exception)\n        {\n        }\n\n        /// <summary>\n        /// Initializes the exception with a particular module and error message.\n        /// </summary>\n        /// <param name=\"moduleName\">The name of the module.</param>\n        /// <param name=\"message\">The error message that explains the reason for the exception.</param>\n        public ModuleTypeLoadingException(string moduleName, string message)\n            : this(moduleName, message, null)\n        {\n        }\n\n        /// <summary>\n        /// Initializes the exception with a particular module, error message and inner exception that happened.\n        /// </summary>\n        /// <param name=\"moduleName\">The name of the module.</param>\n        /// <param name=\"message\">The error message that explains the reason for the exception.</param>\n        /// <param name=\"innerException\">The exception that is the cause of the current exception, \n        /// or a <see langword=\"null\"/> reference if no inner exception is specified.</param>\n        public ModuleTypeLoadingException(string moduleName, string message, Exception innerException)\n            : base(moduleName, String.Format(CultureInfo.CurrentCulture, Resources.FailedToRetrieveModule, moduleName, message), innerException)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Mvvm/BindableBase.cs",
    "content": "using System.ComponentModel;\nusing System.Runtime.CompilerServices;\n\n#nullable enable\nnamespace Prism.Mvvm\n{\n    /// <summary>\n    /// Implementation of <see cref=\"INotifyPropertyChanged\"/> to simplify models.\n    /// </summary>\n    public abstract class BindableBase : INotifyPropertyChanged\n    {\n        /// <summary>\n        /// Occurs when a property value changes.\n        /// </summary>\n        public event PropertyChangedEventHandler? PropertyChanged;\n\n        /// <summary>\n        /// Checks if a property already matches a desired value. Sets the property and\n        /// notifies listeners only when necessary.\n        /// </summary>\n        /// <typeparam name=\"T\">Type of the property.</typeparam>\n        /// <param name=\"storage\">Reference to a property with both getter and setter.</param>\n        /// <param name=\"value\">Desired value for the property.</param>\n        /// <param name=\"propertyName\">Name of the property used to notify listeners. This\n        /// value is optional and can be provided automatically when invoked from compilers that\n        /// support CallerMemberName.</param>\n        /// <returns>True if the value was changed, false if the existing value matched the\n        /// desired value.</returns>\n        protected virtual bool SetProperty<T>(ref T storage, T value, [CallerMemberName] string? propertyName = null)\n        {\n            if (EqualityComparer<T>.Default.Equals(storage, value)) return false;\n\n            storage = value;\n            RaisePropertyChanged(propertyName);\n\n            return true;\n        }\n\n        /// <summary>\n        /// Checks if a property already matches a desired value. Sets the property and\n        /// notifies listeners only when necessary.\n        /// </summary>\n        /// <typeparam name=\"T\">Type of the property.</typeparam>\n        /// <param name=\"storage\">Reference to a property with both getter and setter.</param>\n        /// <param name=\"value\">Desired value for the property.</param>\n        /// <param name=\"propertyName\">Name of the property used to notify listeners. This\n        /// value is optional and can be provided automatically when invoked from compilers that\n        /// support CallerMemberName.</param>\n        /// <param name=\"onChanged\">Action that is called after the property value has been changed.</param>\n        /// <returns>True if the value was changed, false if the existing value matched the\n        /// desired value.</returns>\n        protected virtual bool SetProperty<T>(ref T storage, T value, Action? onChanged,\n            [CallerMemberName] string? propertyName = null)\n        {\n            if (EqualityComparer<T>.Default.Equals(storage, value)) return false;\n\n            storage = value;\n            onChanged?.Invoke();\n            RaisePropertyChanged(propertyName);\n\n            return true;\n        }\n\n        /// <summary>\n        /// Raises this object's PropertyChanged event.\n        /// </summary>\n        /// <param name=\"propertyName\">Name of the property used to notify listeners. This\n        /// value is optional and can be provided automatically when invoked from compilers\n        /// that support <see cref=\"CallerMemberNameAttribute\"/>.</param>\n        protected void RaisePropertyChanged([CallerMemberName] string? propertyName = null)\n        {\n            OnPropertyChanged(new PropertyChangedEventArgs(propertyName));\n        }\n\n        /// <summary>\n        /// Raises this object's PropertyChanged event.\n        /// </summary>\n        /// <param name=\"args\">The PropertyChangedEventArgs</param>\n        protected virtual void OnPropertyChanged(PropertyChangedEventArgs args)\n        {\n            PropertyChanged?.Invoke(this, args);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Mvvm/ErrorsContainer.cs",
    "content": "using System.Linq.Expressions;\n\n#nullable enable\nnamespace Prism.Mvvm\n{\n    /// <summary>\n    /// Manages validation errors for an object, notifying when the error state changes.\n    /// </summary>\n    /// <typeparam name=\"T\">The type of the error object.</typeparam>\n    public class ErrorsContainer<T>\n    {\n        private static readonly T[] noErrors = new T[0];\n\n        /// <summary>\n        /// Delegate to be called when raiseErrorsChanged is invoked.\n        /// </summary>\n        protected readonly Action<string> raiseErrorsChanged;\n\n        /// <summary>\n        /// A map from property name to a <see cref=\"List{T}\"/> of the errors and sources.\n        /// </summary>\n        protected readonly Dictionary<string, List<T>> validationResults;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ErrorsContainer{T}\"/> class.\n        /// </summary>\n        /// <param name=\"raiseErrorsChanged\">The action that is invoked when errors are added for an object.</param>\n        public ErrorsContainer(Action<string> raiseErrorsChanged)\n        {\n            if (raiseErrorsChanged == null)\n            {\n                throw new ArgumentNullException(nameof(raiseErrorsChanged));\n            }\n\n            this.raiseErrorsChanged = raiseErrorsChanged;\n            this.validationResults = new Dictionary<string, List<T>>();\n        }\n\n        /// <summary>\n        /// Gets a value indicating whether the object has validation errors. \n        /// </summary>\n        public bool HasErrors\n        {\n            get\n            {\n                return this.validationResults.Count != 0;\n            }\n        }\n\n        /// <summary>\n        /// Returns all the errors in the container.\n        /// </summary>\n        /// <returns>The dictionary of errors per property.</returns>\n        public Dictionary<string, List<T>> GetErrors() => validationResults;\n\n        /// <summary>\n        /// Gets the validation errors for a specified property.\n        /// </summary>\n        /// <param name=\"propertyName\">The name of the property.</param>\n        /// <returns>The validation errors of type <typeparamref name=\"T\"/> for the property.</returns>\n        public IEnumerable<T> GetErrors(string? propertyName)\n        {\n            var localPropertyName = propertyName ?? string.Empty;\n            if (this.validationResults.TryGetValue(localPropertyName, out var currentValidationResults))\n            {\n                return currentValidationResults;\n            }\n            else\n            {\n                return noErrors;\n            }\n        }\n\n        /// <summary>\n        /// Clears all errors.\n        /// </summary>\n        public void ClearErrors()\n        {\n            foreach (var key in this.validationResults.Keys.ToArray())\n            {\n                ClearErrors(key);\n            }\n        }\n\n        /// <summary>\n        /// Clears the errors for the property indicated by the property expression.\n        /// </summary>\n        /// <typeparam name=\"TProperty\">The property type.</typeparam>\n        /// <param name=\"propertyExpression\">The expression indicating a property.</param>\n        /// <example>\n        /// container.ClearErrors(()=>SomeProperty);\n        /// </example>\n        [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Design\", \"CA1006:DoNotNestGenericTypesInMemberSignatures\")]\n        public void ClearErrors<TProperty>(Expression<Func<TProperty>> propertyExpression)\n        {\n            var propertyName = PropertySupport.ExtractPropertyName(propertyExpression);\n            this.ClearErrors(propertyName);\n        }\n\n        /// <summary>\n        /// Clears the errors for a property.\n        /// </summary>\n        /// <param name=\"propertyName\">The name of the property for which to clear errors.</param>\n        /// <example>\n        /// container.ClearErrors(\"SomeProperty\");\n        /// </example>\n        public void ClearErrors(string? propertyName) => this.SetErrors(propertyName, new List<T>());\n\n        /// <summary>\n        /// Sets the validation errors for the specified property.\n        /// </summary>\n        /// <typeparam name=\"TProperty\">The property type for which to set errors.</typeparam>\n        /// <param name=\"propertyExpression\">The <see cref=\"Expression\"/> indicating the property.</param>\n        /// <param name=\"propertyErrors\">The list of errors to set for the property.</param>\n        [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Design\", \"CA1006:DoNotNestGenericTypesInMemberSignatures\")]\n        public void SetErrors<TProperty>(Expression<Func<TProperty>> propertyExpression, IEnumerable<T>? propertyErrors)\n        {\n            var propertyName = PropertySupport.ExtractPropertyName(propertyExpression);\n            this.SetErrors(propertyName, propertyErrors);\n        }\n\n        /// <summary>\n        /// Sets the validation errors for the specified property.\n        /// </summary>\n        /// <remarks>\n        /// If a change is detected then the errors changed event is raised.\n        /// </remarks>\n        /// <param name=\"propertyName\">The name of the property.</param>\n        /// <param name=\"newValidationResults\">The new validation errors.</param>\n        public void SetErrors(string? propertyName, IEnumerable<T>? newValidationResults)\n        {\n            var localPropertyName = propertyName ?? string.Empty;\n            var hasCurrentValidationResults = this.validationResults.ContainsKey(localPropertyName);\n            var hasNewValidationResults = newValidationResults != null && newValidationResults.Count() > 0;\n\n            if (hasCurrentValidationResults || hasNewValidationResults)\n            {\n                if (hasNewValidationResults)\n                {\n                    this.validationResults[localPropertyName] = new List<T>(newValidationResults);\n                    this.raiseErrorsChanged(localPropertyName);\n                }\n                else\n                {\n                    this.validationResults.Remove(localPropertyName);\n                    this.raiseErrorsChanged(localPropertyName);\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Mvvm/IViewRegistry.cs",
    "content": "﻿namespace Prism.Mvvm;\n\n/// <summary>\n/// Provides an abstraction layer for ViewRegistration that can be mocked\n/// </summary>\npublic interface IViewRegistry\n{\n    /// <summary>\n    /// The existing ViewRegistrations\n    /// </summary>\n    IEnumerable<ViewRegistration> Registrations { get; }\n\n    /// <summary>\n    /// Creates a view given a specified instance of the Container and a navigation name\n    /// </summary>\n    /// <param name=\"container\"></param>\n    /// <param name=\"name\"></param>\n    /// <returns></returns>\n    object CreateView(IContainerProvider container, string name);\n\n    /// <summary>\n    /// Gets the ViewType for a specified navigation name\n    /// </summary>\n    /// <param name=\"name\"></param>\n    /// <returns></returns>\n    Type GetViewType(string name);\n\n    /// <summary>\n    /// Gets the navigation name for a specified ViewModelType\n    /// </summary>\n    /// <param name=\"viewModelType\"></param>\n    /// <returns></returns>\n    string GetViewModelNavigationKey(Type viewModelType);\n\n    /// <summary>\n    /// Gets the Registrations where the View is of a given base type\n    /// </summary>\n    /// <param name=\"baseType\"></param>\n    /// <returns></returns>\n    IEnumerable<ViewRegistration> ViewsOfType(Type baseType);\n\n    /// <summary>\n    /// Confirms whether the given navigation name has been registered\n    /// </summary>\n    /// <param name=\"name\"></param>\n    /// <returns></returns>\n    bool IsRegistered(string name);\n}\n"
  },
  {
    "path": "src/Prism.Core/Mvvm/PropertySupport.cs",
    "content": "using System.Linq.Expressions;\nusing System.Reflection;\nusing Prism.Properties;\n\n#nullable enable\nnamespace Prism.Mvvm\n{\n    ///<summary>\n    /// Provides support for extracting property information based on a property expression.\n    ///</summary>\n    public static class PropertySupport\n    {\n        /// <summary>\n        /// Extracts the property name from a property expression.\n        /// </summary>\n        /// <typeparam name=\"T\">The object type containing the property specified in the expression.</typeparam>\n        /// <param name=\"propertyExpression\">The property expression (e.g. p => p.PropertyName)</param>\n        /// <returns>The name of the property.</returns>\n        /// <exception cref=\"ArgumentNullException\">Thrown if the <paramref name=\"propertyExpression\"/> is null.</exception>\n        /// <exception cref=\"ArgumentException\">Thrown when the expression is:<br/>\n        ///     Not a <see cref=\"MemberExpression\"/><br/>\n        ///     The <see cref=\"MemberExpression\"/> does not represent a property.<br/>\n        ///     Or, the property is static.\n        /// </exception>\n        public static string? ExtractPropertyName<T>(Expression<Func<T>> propertyExpression)\n        {\n            if (propertyExpression == null)\n                throw new ArgumentNullException(nameof(propertyExpression));\n\n            return ExtractPropertyNameFromLambda(propertyExpression);\n        }\n\n        /// <summary>\n        /// Extracts the property name from a LambdaExpression.\n        /// </summary>\n        /// <param name=\"expression\">The LambdaExpression</param>\n        /// <returns>The name of the property.</returns>\n        /// <exception cref=\"ArgumentNullException\">Thrown if the <paramref name=\"expression\"/> is null.</exception>\n        /// <exception cref=\"ArgumentException\">Thrown when the expression is:<br/>\n        ///     The <see cref=\"MemberExpression\"/> does not represent a property.<br/>\n        ///     Or, the property is static.\n        /// </exception>\n        internal static string? ExtractPropertyNameFromLambda(LambdaExpression expression)\n        {\n            if (expression == null)\n                throw new ArgumentNullException(nameof(expression));\n\n            var memberExpression = expression.Body as MemberExpression;\n            if (memberExpression == null)\n                throw new ArgumentException(Resources.PropertySupport_NotMemberAccessExpression_Exception, nameof(expression));\n\n            var property = memberExpression.Member as PropertyInfo;\n            if (property == null)\n                throw new ArgumentException(Resources.PropertySupport_ExpressionNotProperty_Exception, nameof(expression));\n\n            var getMethod = property.GetMethod;\n            if (getMethod.IsStatic)\n                throw new ArgumentException(Resources.PropertySupport_StaticExpression_Exception, nameof(expression));\n\n            return memberExpression.Member.Name;\n        }\n\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Mvvm/ViewCreationException.cs",
    "content": "﻿#nullable enable\nnamespace Prism.Mvvm;\n\n/// <summary>\n/// Exception thrown when an error occurs during view creation.\n/// </summary>\npublic class ViewCreationException : Exception\n{\n    /// <summary>\n    /// Initializes a new instance of the ViewCreationException class with the specified view name and view type.\n    /// </summary>\n    /// <param name=\"viewName\">The name of the view that failed to create.</param>\n    /// <param name=\"viewType\">The type of view that failed to create (Page, Region, or Dialog).</param>\n    public ViewCreationException(string viewName, ViewType viewType)\n        : this(viewName, viewType, null)\n    {\n    }\n\n    /// <summary>\n    /// Initializes a new instance of the ViewCreationException class with the specified view name, view type, and inner exception.\n    /// </summary>\n    /// <param name=\"viewName\">The name of the view that failed to create.</param>\n    /// <param name=\"viewType\">The type of view that failed to create (Page, Region, or Dialog).</param>\n    /// <param name=\"innerException\">The inner exception that caused the view creation to fail.</param>\n    public ViewCreationException(string viewName, ViewType viewType, Exception? innerException)\n        : base($\"Unable to create {viewType} '{viewName}'.\", innerException)\n    {\n        ViewName = viewName;\n        ViewType = viewType;\n    }\n\n    /// <summary>\n    /// Gets the type of view that failed to create (Page, Region, or Dialog).\n    /// </summary>\n    public ViewType ViewType { get; }\n\n    /// <summary>\n    /// Gets the name of the view that failed to create.\n    /// </summary>\n    public string ViewName { get; }\n}\n"
  },
  {
    "path": "src/Prism.Core/Mvvm/ViewModelCreationException.cs",
    "content": "﻿using System.ComponentModel;\n\n#nullable enable\nnamespace Prism.Mvvm;\n\n/// <summary>\n/// Exception thrown when an error occurs during ViewModel creation.\n/// </summary>\npublic class ViewModelCreationException : Exception\n{\n    private static Func<object, string>? _viewNameDelegate;\n\n    /// <summary>\n    /// Gets the name of the view associated with the exception, based on platform-specific logic.\n    /// </summary>\n    /// <param name=\"view\">The view instance for which ViewModel creation failed.</param>\n    /// <returns>The name of the view, or \"Platform not initialized\" if the platform is not initialized.</returns>\n    private static string GetViewName(object view) => _viewNameDelegate is null ? \"Platform not initialized\" : _viewNameDelegate(view);\n\n    /// <summary>\n    /// Sets the delegate used to retrieve view names for exceptions.\n    /// </summary>\n    /// <param name=\"viewNameDelegate\">The delegate that retrieves view names.</param>\n    [EditorBrowsable(EditorBrowsableState.Never)]\n    public static void SetViewNameDelegate(Func<object, string> viewNameDelegate) => _viewNameDelegate = viewNameDelegate;\n\n    /// <summary>\n    /// Initializes a new instance of the ViewModelCreationException class with the specified view and inner exception.\n    /// </summary>\n    /// <param name=\"view\">The view for which ViewModel creation failed.</param>\n    /// <param name=\"innerException\">The inner exception that caused the ViewModel creation to fail.</param>\n    public ViewModelCreationException(object view, Exception innerException)\n        : base($\"Unable to Create ViewModel for '{view.GetType().FullName}'.\", innerException)\n    {\n        View = view;\n        ViewName = GetViewName(view);\n    }\n\n    /// <summary>\n    /// Gets the view instance for which ViewModel creation failed.\n    /// </summary>\n    public object View { get; }\n\n    /// <summary>\n    /// Gets the name of the view associated with the exception.\n    /// </summary>\n    public string ViewName { get; }\n}\n"
  },
  {
    "path": "src/Prism.Core/Mvvm/ViewModelLocationProvider.cs",
    "content": "using System.ComponentModel;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Globalization;\nusing System.Reflection;\n\n#nullable enable\nnamespace Prism.Mvvm\n{\n    /// <summary>\n    /// The ViewModelLocationProvider class locates the view model for the view that has the AutoWireViewModelChanged attached property set to true.\n    /// The view model will be located and injected into the view's DataContext. To locate the view model, two strategies are used: First the ViewModelLocationProvider\n    /// will look to see if there is a view model factory registered for that view, if not it will try to infer the view model using a convention based approach.\n    /// This class also provides methods for registering the view model factories,\n    /// and also to override the default view model factory and the default view type to view model type resolver.\n    /// </summary>\n\n    // Documentation on using the MVVM pattern is at http://go.microsoft.com/fwlink/?LinkID=288814&clcid=0x409\n\n    public static class ViewModelLocationProvider\n    {\n        /// <summary>\n        /// Resets the ViewModelLocationProvider for Unit Testing Purposes.\n        /// </summary>\n        [EditorBrowsable(EditorBrowsableState.Never)]\n        public static void Reset()\n        {\n            _factories = new Dictionary<string, Func<object>>();\n            _typeFactories = new Dictionary<string, Type>();\n            _defaultViewModelFactory = type => Activator.CreateInstance(type);\n            _defaultViewModelFactoryWithViewParameter = null;\n            _defaultViewTypeToViewModelTypeResolver = DefaultViewTypeToViewModel;\n        }\n\n        /// <summary>\n        /// A dictionary that contains all the registered factories for the views.\n        /// </summary>\n        static Dictionary<string, Func<object>> _factories = new Dictionary<string, Func<object>>();\n\n        /// <summary>\n        /// A dictionary that contains all the registered ViewModel types for the views.\n        /// </summary>\n        static Dictionary<string, Type> _typeFactories = new Dictionary<string, Type>();\n\n        /// <summary>\n        /// The default view model factory which provides the ViewModel type as a parameter.\n        /// </summary>\n        static Func<Type, object> _defaultViewModelFactory = type => Activator.CreateInstance(type);\n\n        /// <summary>\n        /// ViewModelFactory that provides the View instance and ViewModel type as parameters.\n        /// </summary>\n        static Func<object, Type, object>? _defaultViewModelFactoryWithViewParameter;\n\n        /// <summary>\n        /// Default view type to view model type resolver, assumes the view model is in same assembly as the view type, but in the \"ViewModels\" namespace.\n        /// </summary>\n        static Func<Type, Type?> _defaultViewTypeToViewModelTypeResolver = DefaultViewTypeToViewModel;\n\n        private static Type? DefaultViewTypeToViewModel(Type viewType)\n        {\n            var viewName = viewType.FullName;\n            viewName = viewName?.Replace(\".Views.\", \".ViewModels.\");\n            var viewAssemblyName = viewType.GetTypeInfo().Assembly.FullName;\n            var suffix = viewName != null && viewName.EndsWith(\"View\") ? \"Model\" : \"ViewModel\";\n            var viewModelName = string.Format(CultureInfo.InvariantCulture, \"{0}{1}, {2}\", viewName, suffix, viewAssemblyName);\n            return Type.GetType(viewModelName);\n        }\n\n        static Func<object, Type?> _defaultViewToViewModelTypeResolver = view => null;\n\n        /// <summary>\n        /// Sets the default view model factory.\n        /// </summary>\n        /// <param name=\"viewModelFactory\">The view model factory which provides the ViewModel type as a parameter.</param>\n        public static void SetDefaultViewModelFactory(Func<Type, object> viewModelFactory)\n        {\n            _defaultViewModelFactory = viewModelFactory;\n        }\n\n        /// <summary>\n        /// Sets the default view model factory.\n        /// </summary>\n        /// <param name=\"viewModelFactory\">The view model factory that provides the View instance and ViewModel type as parameters.</param>\n        public static void SetDefaultViewModelFactory(Func<object, Type, object> viewModelFactory)\n        {\n            _defaultViewModelFactoryWithViewParameter = viewModelFactory;\n        }\n\n        /// <summary>\n        /// Sets the default view type to view model type resolver.\n        /// </summary>\n        /// <param name=\"viewTypeToViewModelTypeResolver\">The view type to view model type resolver.</param>\n        public static void SetDefaultViewTypeToViewModelTypeResolver(Func<Type, Type?> viewTypeToViewModelTypeResolver)\n        {\n            _defaultViewTypeToViewModelTypeResolver = viewTypeToViewModelTypeResolver;\n        }\n\n        /// <summary>\n        /// Sets the default ViewModel Type Resolver given the View instance. This can be used to evaluate the View for\n        /// custom attributes or Attached Properties to determine the ViewModel Type.\n        /// </summary> \n        public static void SetDefaultViewToViewModelTypeResolver(Func<object, Type?> viewToViewModelTypeResolver) =>\n            _defaultViewToViewModelTypeResolver = viewToViewModelTypeResolver;\n\n        /// <summary>\n        /// Automatically looks up the viewmodel that corresponds to the current view, using two strategies:\n        /// It first looks to see if there is a mapping registered for that view, if not it will fallback to the convention based approach.\n        /// </summary>\n        /// <param name=\"view\">The dependency object, typically a view.</param>\n        /// <param name=\"setDataContextCallback\">The call back to use to create the binding between the View and ViewModel</param>\n        public static void AutoWireViewModelChanged(object view, Action<object, object> setDataContextCallback)\n        {\n            // Try mappings first\n            object? viewModel = GetViewModelForView(view);\n\n            // try to use ViewModel type\n            if (viewModel == null)\n            {\n                // check type mappings\n                var viewModelType = GetViewModelTypeForView(view.GetType());\n\n                // check platform View to ViewModel resolver\n                if (viewModelType == null)\n                    viewModelType = _defaultViewToViewModelTypeResolver(view);\n\n                // fallback to convention based\n                if (viewModelType == null)\n                    viewModelType = _defaultViewTypeToViewModelTypeResolver(view.GetType());\n\n                if (viewModelType == null)\n                    return;\n\n                viewModel = _defaultViewModelFactoryWithViewParameter != null ? _defaultViewModelFactoryWithViewParameter(view, viewModelType) : _defaultViewModelFactory(viewModelType);\n            }\n\n            setDataContextCallback(view, viewModel);\n        }\n\n        /// <summary>\n        /// Gets the view model for the specified view.\n        /// </summary>\n        /// <param name=\"view\">The view that the view model wants.</param>\n        /// <returns>The ViewModel that corresponds to the view passed as a parameter.</returns>\n        private static object? GetViewModelForView(object view)\n        {\n            var viewKey = view.GetType().ToString();\n\n            // Mapping of view models base on view type (or instance) goes here\n            return _factories.ContainsKey(viewKey) ? _factories[viewKey]() : null;\n        }\n\n        /// <summary>\n        /// Gets the ViewModel type for the specified view.\n        /// </summary>\n        /// <param name=\"view\">The View that the ViewModel wants.</param>\n        /// <returns>The ViewModel type that corresponds to the View.</returns>\n        private static Type? GetViewModelTypeForView(Type view)\n        {\n            var viewKey = view.ToString();\n\n            return _typeFactories.ContainsKey(viewKey) ? _typeFactories[viewKey] : null;\n        }\n\n        /// <summary>\n        /// Registers the ViewModel factory for the specified view type.\n        /// </summary>\n        /// <typeparam name=\"T\">The View</typeparam>\n        /// <param name=\"factory\">The ViewModel factory.</param>\n        public static void Register<T>(Func<object> factory)\n        {\n            Register(typeof(T).ToString(), factory);\n        }\n\n        /// <summary>\n        /// Registers the ViewModel factory for the specified view type name.\n        /// </summary>\n        /// <param name=\"viewTypeName\">The name of the view type.</param>\n        /// <param name=\"factory\">The ViewModel factory.</param>\n        public static void Register(string viewTypeName, Func<object> factory)\n        {\n            _factories[viewTypeName] = factory;\n        }\n\n        /// <summary>\n        /// Registers a ViewModel type for the specified view type.\n        /// </summary>\n        /// <typeparam name=\"T\">The View</typeparam>\n        /// <typeparam name=\"VM\">The ViewModel</typeparam>\n        public static void Register<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] T, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] VM>()\n        {\n            var viewType = typeof(T);\n            var viewModelType = typeof(VM);\n\n            Register(viewType.ToString(), viewModelType);\n        }\n\n        /// <summary>\n        /// Registers a ViewModel type for the specified view.\n        /// </summary>\n        /// <param name=\"viewTypeName\">The View type name</param>\n        /// <param name=\"viewModelType\">The ViewModel type</param>\n        public static void Register(string viewTypeName, Type viewModelType)\n        {\n            _typeFactories[viewTypeName] = viewModelType;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Mvvm/ViewRegistration.cs",
    "content": "﻿namespace Prism.Mvvm;\n\n/// <summary>\n/// Represents information about a registered view.\n/// </summary>\npublic record ViewRegistration\n{\n    /// <summary>\n    /// Gets the type of view this registration represents (Page, Region, or Dialog).\n    /// </summary>\n    public ViewType Type { get; init; }\n\n    /// <summary>\n    /// Gets the type of the view class associated with this registration.\n    /// </summary>\n    public Type View { get; init; }\n\n    /// <summary>\n    /// Gets the type of the view model associated with this registration, if any.\n    /// </summary>\n    public Type ViewModel { get; init; }\n\n    /// <summary>\n    /// Gets the unique name used to identify this view registration.\n    /// </summary>\n    public string Name { get; init; }\n}\n\n"
  },
  {
    "path": "src/Prism.Core/Mvvm/ViewRegistryBase{TBaseView}.cs",
    "content": "using System.Text.RegularExpressions;\n\n#nullable enable\nnamespace Prism.Mvvm;\n\n/// <summary>\n/// Base class for registering and creating views based on a specified view type.\n/// </summary>\n/// <typeparam name=\"TBaseView\">The base type of all view classes managed by this registry.</typeparam>\npublic abstract class ViewRegistryBase<TBaseView> : IViewRegistry\n    where TBaseView : class\n{\n    private readonly IEnumerable<ViewRegistration> _registrations;\n    private readonly ViewType _registryType;\n\n    /// <summary>\n    /// Initializes a new instance of the ViewRegistryBase class.\n    /// </summary>\n    /// <param name=\"registryType\">The type of view this registry manages (Page, Region, or Dialog).</param>\n    /// <param name=\"registrations\">The collection of view registrations.</param>\n    protected ViewRegistryBase(ViewType registryType, IEnumerable<ViewRegistration> registrations)\n    {\n        _registrations = registrations;\n        _registryType = registryType;\n    }\n\n    /// <summary>\n    /// Gets a read-only collection of registered views filtered by the current registry type.\n    /// </summary>\n    public IEnumerable<ViewRegistration> Registrations =>\n        _registrations.Where(viewRegistration => viewRegistration.Type == _registryType);\n\n    /// <summary>\n    /// Gets the view type associated with the specified name, or null if not found.\n    /// </summary>\n    /// <param name=\"name\">The name of the view to retrieve.</param>\n    /// <returns>The type of the view, or null if not found.</returns>\n    public Type? GetViewType(string name) =>\n        GetRegistration(name)?.View;\n\n    /// <summary>\n    /// Creates an instance of the specified view using the provided container.\n    /// </summary>\n    /// <param name=\"container\">The container used to resolve dependencies.</param>\n    /// <param name=\"name\">The name of the view to create.</param>\n    /// <returns>An instance of the created view.</returns>\n    /// <exception cref=\"KeyNotFoundException\">Thrown if the specified view is not registered.</exception>\n    /// <exception cref=\"ViewModelCreationException\">Thrown if an error occurs while creating the view model.</exception>\n    /// <exception cref=\"ViewCreationException\">Thrown if an error occurs while creating the view.</exception>\n    public object? CreateView(IContainerProvider container, string name)\n    {\n        try\n        {\n            var registration = GetRegistration(name) ?? throw new KeyNotFoundException($\"No view with the name '{name}' has been registered\");\n            var view = container.Resolve(registration.View) as TBaseView;\n            SetNavigationNameProperty(view, registration.Name);\n\n            SetContainerProvider(view, container);\n            ConfigureView(view, container);\n\n            if (registration.ViewModel is not null)\n                SetViewModelProperty(view, registration.ViewModel);\n\n            Autowire(view);\n\n            return view;\n        }\n        catch (KeyNotFoundException)\n        {\n            throw;\n        }\n        catch (ViewModelCreationException)\n        {\n            throw;\n        }\n        catch (Exception? ex)\n        {\n            throw new ViewCreationException(name, _registryType, ex);\n        }\n    }\n\n    private IEnumerable<Type> GetCandidates(Type viewModelType)\n    {\n        var names = new List<string>\n        {\n            Regex.Replace(viewModelType.Name, @\"ViewModel$\", string.Empty),\n            Regex.Replace(viewModelType.Name, @\"Model$\", string.Empty),\n        };\n\n        if (_registryType == ViewType.Page)\n            names.Add(Regex.Replace(viewModelType.Name, @\"ViewModel$\", \"Page\"));\n        else if (_registryType == ViewType.Region)\n            names.Add(Regex.Replace(viewModelType.Name, @\"ViewModel$\", \"Region\"));\n        else if (_registryType == ViewType.Dialog)\n            names.Add(Regex.Replace(viewModelType.Name, @\"ViewModel$\", \"Dialog\"));\n\n        names = names.Where(x => !x.EndsWith(\"PagePage\")).ToList();\n\n        if (viewModelType.Namespace != null)\n        {\n            string[] namespaces = _registryType switch\n            {\n                ViewType.Page =>\n                [\n                    viewModelType.Namespace.Replace(\"ViewModels\", \"Views\"),\n                    viewModelType.Namespace.Replace(\"ViewModels\", \"Pages\")\n                ],\n                ViewType.Region =>\n                [\n                    viewModelType.Namespace.Replace(\"ViewModels\", \"Views\"),\n                    viewModelType.Namespace.Replace(\"ViewModels\", \"Regions\")\n                ],\n                ViewType.Dialog =>\n                [\n                    viewModelType.Namespace.Replace(\"ViewModels\", \"Views\"),\n                    viewModelType.Namespace.Replace(\"ViewModels\", \"Dialogs\")\n                ],\n                _ =>\n                [\n                    viewModelType.Namespace.Replace(\"ViewModels\", \"Views\"),\n                ]\n            };\n\n            var candidates = namespaces.Select(@namespace => names.Select(name => $\"{@namespace}.{name}\"))\n                .SelectMany(x => x)\n                .Select(x =>\n                    viewModelType.AssemblyQualifiedName?.Replace(viewModelType.FullName ?? string.Empty, x) ??\n                    string.Empty);\n\n            return candidates\n                .Select(x => Type.GetType(x, false))\n                .Where(x => x is not null);\n        }\n\n        return [];\n    }\n\n    /// <summary>\n    /// Gets the navigation key associated with the specified view model type, or throws an exception if not found.\n    /// </summary>\n    /// <param name=\"viewModelType\">The type of the view model.</param>\n    /// <returns>The navigation key for the view associated with the view model.</returns>\n    /// <exception cref=\"KeyNotFoundException\">Thrown if no view is registered for the specified view model.</exception>\n    public string GetViewModelNavigationKey(Type viewModelType)\n    {\n        var registration = Registrations.LastOrDefault(x => x.ViewModel == viewModelType);\n        if (registration is not null)\n            return registration.Name;\n\n        var candidates = GetCandidates(viewModelType);\n        registration = Registrations.LastOrDefault(x => candidates.Any(c => c == x.View));\n        if (registration is not null)\n        {\n            return registration.Name;\n        }\n\n        throw new KeyNotFoundException($\"No View with the ViewModel '{viewModelType.Name}' has been registered\");\n    }\n\n    /// <summary>\n    /// Gets a collection of registered views that inherit from or implement the specified base type.\n    /// </summary>\n    /// <param name=\"baseType\">The base type to filter by.</param>\n    /// <returns>A collection of matching view registrations.</returns>\n    public IEnumerable<ViewRegistration> ViewsOfType(Type baseType) =>\n        Registrations.Where(viewRegistration => viewRegistration.View == baseType || baseType.IsAssignableFrom(viewRegistration.View));\n\n    /// <summary>\n    /// Checks if a view is registered with the specified name.\n    /// </summary>\n    /// <param name=\"name\">The name of the view to check.</param>\n    /// <returns>True if the view is registered, false otherwise.</returns>\n    public bool IsRegistered(string name) =>\n        GetRegistration(name) is not null;\n\n    /// <summary>\n    /// Gets the registration information for a view with the specified name, or null if not found.\n    /// </summary>\n    /// <param name=\"name\">The name of the view to look up.</param>\n    /// <returns>The view registration object, or null if not found.</returns>\n    protected ViewRegistration? GetRegistration(string name) =>\n        Registrations.LastOrDefault(viewRegistration => viewRegistration.Name == name);\n\n    /// <summary>\n    /// Allows subclasses to perform custom configuration on the created view instance.\n    /// </summary>\n    /// <param name=\"view\">The created view instance.</param>\n    /// <param name=\"container\">The container used to resolve dependencies.</param>\n    protected abstract void ConfigureView(TBaseView? view, IContainerProvider container);\n\n    /// <summary>\n    /// Calls the platform code to Autowire the View if it does not have a ViewModel already\n    /// </summary>\n    /// <param name=\"view\"></param>\n    protected abstract void Autowire(TBaseView? view);\n\n    /// <summary>\n    /// Sets the specified navigation name that was used to Navigate. This can be useful for back navigation\n    /// </summary>\n    /// <param name=\"view\"></param>\n    /// <param name=\"name\"></param>\n    protected abstract void SetNavigationNameProperty(TBaseView? view, string name);\n\n    /// <summary>\n    /// Sets the ViewModel Type to resolve\n    /// </summary>\n    /// <param name=\"view\"></param>\n    /// <param name=\"viewModelType\"></param>\n    protected abstract void SetViewModelProperty(TBaseView? view, Type viewModelType);\n\n    /// <summary>\n    /// Sets the IContainerProvider making it easier to access on the given View\n    /// </summary>\n    /// <param name=\"view\"></param>\n    /// <param name=\"container\"></param>\n    protected abstract void SetContainerProvider(TBaseView? view, IContainerProvider container);\n}\n"
  },
  {
    "path": "src/Prism.Core/Mvvm/ViewType.cs",
    "content": "﻿namespace Prism.Mvvm;\n\n/// <summary>\n/// Enumerates the different types of views supported by the framework.\n/// </summary>\npublic enum ViewType\n{\n    /// <summary>\n    /// Unknown view type.\n    /// </summary>\n    Unknown,\n\n    /// <summary>\n    /// Represents a full-screen page or window.\n    /// </summary>\n    Page,\n\n    /// <summary>\n    /// Represents a reusable region within a view.\n    /// </summary>\n    Region,\n\n    /// <summary>\n    /// Represents a modal dialog or popup window.\n    /// </summary>\n    Dialog,\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/IDestructible.cs",
    "content": "﻿namespace Prism.Navigation\n{\n    /// <summary>\n    /// Interface for objects that require cleanup of resources prior to Disposal\n    /// </summary>\n    public interface IDestructible\n    {\n        /// <summary>\n        /// This method allows cleanup of any resources used by your View/ViewModel \n        /// </summary>\n        void Destroy();\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/INavigationParameters.cs",
    "content": "﻿using Prism.Common;\n\nnamespace Prism.Navigation;\n\n/// <summary>\n/// Provides a way to pass parameters during navigation.\n/// </summary>\npublic interface INavigationParameters : IParameters\n{\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/INavigationParametersInternal.cs",
    "content": "﻿namespace Prism.Navigation;\n\n/// <summary>\n/// Used to set internal parameters used by Prism\n/// </summary>\npublic interface INavigationParametersInternal\n{\n    /// <summary>\n    /// Adds the key and value to the parameters Collection\n    /// </summary>\n    /// <param name=\"key\">The key to reference this value in the parameters collection.</param>\n    /// <param name=\"value\">The value of the parameter to store</param>\n    void Add(string key, object value);\n\n    /// <summary>\n    /// Checks collection for presence of key\n    /// </summary>\n    /// <param name=\"key\">The key to check in the Collection</param>\n    /// <returns><c>true</c> if key exists; else returns <c>false</c>.</returns>\n    bool ContainsKey(string key);\n\n    /// <summary>\n    /// Returns the value of the member referenced by key\n    /// </summary>\n    /// <typeparam name=\"T\">The type of object to be returned</typeparam>\n    /// <param name=\"key\">The key for the value to be returned</param>\n    /// <returns>Returns a matching parameter of <typeparamref name=\"T\"/> if one exists in the Collection</returns>\n    T GetValue<T>(string key);\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/INavigationResult.cs",
    "content": "﻿using System;\nusing Prism.Navigation.Regions;\n\nnamespace Prism.Navigation;\n\n#nullable enable\n/// <summary>\n/// Provides a wrapper for a Navigation Result\n/// </summary>\npublic interface INavigationResult\n{\n    /// <summary>\n    /// Indicates that the navigation was successful and no Navigation Errors occurred\n    /// </summary>\n    bool Success { get; }\n\n    /// <summary>\n    /// If <c>true</c> this indicates that the Navigation Event was cancelled.\n    /// </summary>\n    bool Cancelled { get; }\n\n    /// <summary>\n    /// The Exception if one occurred.\n    /// </summary>\n    Exception? Exception { get; }\n\n    /// <summary>\n    /// If the <see cref=\"INavigationResult\"/> is the result of Region Navigation\n    /// This will provide the associate <see cref=\"NavigationContext\"/>\n    /// </summary>\n    NavigationContext? Context { get; }\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/NavigationException.cs",
    "content": "using System;\n\nnamespace Prism.Navigation;\n\n/// <summary>\n/// Represents errors that occurred during the navigation.\n/// </summary>\npublic class NavigationException : Exception\n{\n    /// <summary>\n    /// The <see cref=\"NavigationException\"/> Message returned when cannot pop application main page.\n    /// </summary>\n    public const string CannotPopApplicationMainPage = \"Cannot Pop Application MainPage\";\n\n    /// <summary>\n    /// The <see cref=\"NavigationException\"/> Message returned when cannot go back from root.\n    /// </summary>\n    public const string CannotGoBackFromRoot = \"Cannot GoBack from NavigationPage Root.\";\n\n    /// <summary>\n    /// The <see cref=\"NavigationException\"/> Message returned when GoBackAsync can only be called when the calling Page has been navigated.\n    /// </summary>\n    public const string GoBackRequiresNavigationPage = \"GoBackAsync can only be called when the calling Page has been navigated.\";\n\n    /// <summary>\n    /// The <see cref=\"NavigationException\"/> Message returned when GoBackToRootAsync can only be called when the calling Page is within a NavigationPage.\n    /// </summary>\n    public const string GoBackToRootRequiresNavigationPage = \"GoBackToRootAsync can only be called when the calling Page is within a NavigationPage.\";\n\n    /// <summary>\n    /// The <see cref=\"NavigationException\"/> Message returned when removing views using the relative '../' syntax while navigating is only supported within a NavigationPage.\n    /// </summary>\n    public const string RelativeNavigationRequiresNavigationPage = \"Removing views using the relative '../' syntax while navigating is only supported within a NavigationPage\";\n\n    /// <summary>\n    /// The <see cref=\"NavigationException\"/> Message returned when IConfirmNavigation returned false.\n    /// </summary>\n    public const string IConfirmNavigationReturnedFalse = \"IConfirmNavigation returned false\";\n\n    /// <summary>\n    /// The <see cref=\"NavigationException\"/> Message returned when no Page has been registered with the provided key.\n    /// </summary>\n    public const string NoPageIsRegistered = \"No Page has been registered with the provided key\";\n\n    /// <summary>\n    /// The <see cref=\"NavigationException\"/> Message returned when an error occurred while resolving the page.\n    /// </summary>\n    public const string ErrorCreatingPage = \"An error occurred while resolving the page. This is most likely the result of invalid XAML or other type initialization exception\";\n\n    /// <summary>\n    /// The <see cref=\"NavigationException\"/> Message returned when an unsupported Maui Exception occurred.\n    /// </summary>\n    public const string UnsupportedMauiCreation = \"An unsupported Maui Exception occurred. This may be due to a bug with MAUI or something that is otherwise not supported by MAUI.\";\n\n    /// <summary>\n    /// The <see cref=\"NavigationException\"/> Message returned when an unsupported event occurred while Navigating.\n    /// </summary>\n    public const string UnsupportedMauiNavigation = \"An unsupported event occurred while Navigating. The attempted Navigation Stack is not supported by .NET MAUI\";\n\n    /// <summary>\n    /// The <see cref=\"NavigationException\"/> Message returned when a dependency issue occurred while resolving the ViewModel..\n    /// </summary>\n    public const string ErrorCreatingViewModel = \"A dependency issue occurred while resolving the ViewModel. Check the InnerException for the ContainerResolutionException\";\n\n    /// <summary>\n    /// The <see cref=\"NavigationException\"/> Message returned when you have referenced a View type and are likely breaking the MVVM pattern.\n    /// </summary>\n    public const string MvvmPatternBreak = \"You have referenced a View type and are likely breaking the MVVM pattern. You should never reference a View type from a ViewModel.\";\n\n    /// <summary>\n    /// The <see cref=\"NavigationException\"/> Message returned when an unknown error occurred.\n    /// </summary>\n    public const string UnknownException = \"An unknown error occurred. You may need to specify whether to Use Modal Navigation or not.\";\n\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"NavigationException\"/>\n    /// </summary>\n    public NavigationException()\n        : this(UnknownException)\n    {\n    }\n\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"NavigationException\"/> class with a specified error message.\n    /// </summary>\n    /// <param name=\"message\">The message that describes the error.</param>\n    public NavigationException(string message)\n        : this(message, null, null, null)\n    {\n    }\n\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"NavigationException\"/> class with a specified error message and a view instance.\n    /// </summary>\n    /// <param name=\"message\">The message that describes the error.</param>\n    /// <param name=\"view\">The view instance.</param>\n    public NavigationException(string message, object view)\n        : this(message, view, null)\n    {\n    }\n\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"NavigationException\"/> class with a specified error message and a key used for the failed navigation.\n    /// </summary>\n    /// <param name=\"message\">The message that describes the error.</param>\n    /// <param name=\"navigationKey\">The key used for the failed navigation.</param>\n    public NavigationException(string message, string navigationKey)\n        : this(message, navigationKey, null, null)\n    {\n    }\n\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"NavigationException\"/> class with a specified error message, a key used for the failed navigation, and a reference\n    /// to the inner exception that is the cause of this exception.\n    /// </summary>\n    /// <param name=\"message\">The message that describes the error.</param>\n    /// <param name=\"navigationKey\">The key used for the failed navigation.</param>\n    /// <param name=\"innerException\">The exception that is the cause of the current exception, or a null reference\n    /// (Nothing in Visual Basic) if no inner exception is specified.</param>\n    public NavigationException(string message, string navigationKey, Exception innerException)\n        : this(message, navigationKey, null, innerException)\n    {\n    }\n\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"NavigationException\"/> class with a specified error message, a view instance and a reference\n    /// to the inner exception that is the cause of this exception.\n    /// </summary>\n    /// <param name=\"message\">The message that describes the error.</param>\n    /// <param name=\"view\">The view instance.</param>\n    /// <param name=\"innerException\">The exception that is the cause of the current exception, or a null reference\n    /// (Nothing in Visual Basic) if no inner exception is specified.</param>\n    public NavigationException(string message, object view, Exception innerException)\n        : this(message, null, view, innerException)\n    {\n    }\n\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"NavigationException\"/> class with a specified error message, a key used for the failed navigation, a view instance,\n    /// and a reference to the inner exception that is the cause of this exception.\n    /// </summary>\n    /// <param name=\"message\">The message that describes the error.</param>\n    /// <param name=\"navigationKey\">The key used for the failed navigation.</param>\n    /// <param name=\"view\">The view instance.</param>\n    /// <param name=\"innerException\">The exception that is the cause of the current exception, or a null reference\n    /// (Nothing in Visual Basic) if no inner exception is specified.</param>\n    public NavigationException(string message, string navigationKey, object view, Exception innerException) : base(message, innerException)\n    {\n        View = view;\n        NavigationKey = navigationKey;\n    }\n\n    /// <summary>\n    /// The View Instance\n    /// </summary>\n    public object View { get; }\n\n    /// <summary>\n    /// The key used for the failed navigation\n    /// </summary>\n    public string NavigationKey { get; }\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/NavigationParameters.cs",
    "content": "﻿using System.Collections.Generic;\nusing Prism.Common;\n\nnamespace Prism.Navigation;\n\n/// <summary>\n/// Represents Navigation parameters.\n/// </summary>\n/// <remarks>\n/// This class can be used to to pass object parameters during Navigation. \n/// </remarks>\npublic class NavigationParameters : ParametersBase, INavigationParameters, INavigationParametersInternal\n{\n    private readonly Dictionary<string, object> _internalParameters = new Dictionary<string, object>();\n\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"NavigationParameters\"/> class.\n    /// </summary>\n    public NavigationParameters()\n    {\n    }\n\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"NavigationParameters\"/> class with a query string.\n    /// </summary>\n    /// <param name=\"query\">The query string.</param>\n    public NavigationParameters(string query)\n        : base(query)\n    {\n    }\n\n    #region INavigationParametersInternal\n    void INavigationParametersInternal.Add(string key, object value)\n    {\n        _internalParameters.Add(key, value);\n    }\n\n    bool INavigationParametersInternal.ContainsKey(string key)\n    {\n        return _internalParameters.ContainsKey(key);\n    }\n\n    T INavigationParametersInternal.GetValue<T>(string key)\n    {\n        return _internalParameters.GetValue<T>(key);\n    }\n    #endregion\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/NavigationResult.cs",
    "content": "﻿using System;\nusing Prism.Navigation.Regions;\n\nnamespace Prism.Navigation;\n\n#nullable enable\n/// <summary>\n/// Default implementation for the <see cref=\"INavigationResult\"/>\n/// </summary>\npublic class NavigationResult : INavigationResult\n{\n    private readonly bool? _success;\n\n    /// <summary>\n    /// Initializes a new Navigation Result\n    /// </summary>\n    public NavigationResult()\n    {\n    }\n\n    /// <summary>\n    /// Initializes a new NavigationResult\n    /// </summary>\n    /// <param name=\"success\"></param>\n    public NavigationResult(bool success)\n    {\n        _success = success;\n    }\n\n    /// <summary>\n    /// Initializes a new NavigationResult with an <see cref=\"Exception\"/>\n    /// </summary>\n    /// <param name=\"ex\">The <see cref=\"Exception\"/> encountered as part of the navigation.</param>\n    public NavigationResult(Exception? ex)\n    {\n        Exception = ex;\n    }\n\n    /// <summary>\n    /// Initializes a new NavigationResult\n    /// </summary>\n    /// <param name=\"context\"></param>\n    /// <param name=\"success\"></param>\n    public NavigationResult(NavigationContext context, bool success)\n    {\n        Context = context;\n        _success = success;\n    }\n\n    /// <summary>\n    /// Initializes a new NavigationResult\n    /// </summary>\n    /// <param name=\"context\"></param>\n    /// <param name=\"exception\"></param>\n    public NavigationResult(NavigationContext context, Exception exception)\n    {\n        Context = context;\n        Exception = exception;\n    }\n\n    /// <inheritdoc />\n    public bool Success => _success ?? Exception is null;\n\n    /// <inheritdoc />\n    public bool Cancelled =>\n        Exception is NavigationException navigationException\n        && navigationException.Message == NavigationException.IConfirmNavigationReturnedFalse;\n\n    /// <inheritdoc />\n    public Exception? Exception { get; }\n\n    /// <inheritdoc />\n    public NavigationContext? Context { get; }\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/Regions/IConfirmNavigationRequest.cs",
    "content": "using System;\n\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Provides a way for objects involved in navigation to determine if a navigation request should continue.\n    /// </summary>\n    public interface IConfirmNavigationRequest : IRegionAware\n    {\n        /// <summary>\n        /// Determines whether this instance accepts being navigated away from.\n        /// </summary>\n        /// <param name=\"navigationContext\">The navigation context.</param>\n        /// <param name=\"continuationCallback\">The callback to indicate when navigation can proceed.</param>\n        /// <remarks>\n        /// Implementors of this method do not need to invoke the callback before this method is completed,\n        /// but they must ensure the callback is eventually invoked.\n        /// </remarks>\n        void ConfirmNavigationRequest(NavigationContext navigationContext, Action<bool> continuationCallback);\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/Regions/IJournalAware.cs",
    "content": "﻿namespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Provides a way for objects involved in navigation to opt-out of being added to the IRegionNavigationJournal backstack.\n    /// </summary>\n    public interface IJournalAware\n    {\n        /// <summary>\n        /// Determines if the current object is going to be added to the navigation journal's backstack.\n        /// </summary>\n        /// <returns>True, add to backstack. False, remove from backstack.</returns>\n        bool PersistInHistory();\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/Regions/INavigateAsync.cs",
    "content": "using System;\n\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Provides methods to perform navigation.\n    /// </summary>\n    /// <remarks>\n    /// Convenience overloads for the methods in this interface can be found as extension methods on the\n    /// <see cref=\"NavigationAsyncExtensions\"/> class.\n    /// </remarks>\n    public interface INavigateAsync\n    {\n        /// <summary>\n        /// Initiates navigation to the target specified by the <see cref=\"Uri\"/>.\n        /// </summary>\n        /// <param name=\"target\">The navigation target</param>\n        /// <param name=\"navigationCallback\">The callback executed when the navigation request is completed.</param>\n        /// <param name=\"navigationParameters\">The navigation parameters specific to the navigation request.</param>\n        /// <remarks>\n        /// Convenience overloads for this method can be found as extension methods on the\n        /// <see cref=\"NavigationAsyncExtensions\"/> class.\n        /// </remarks>\n        void RequestNavigate(Uri target, Action<NavigationResult> navigationCallback, INavigationParameters navigationParameters);\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/Regions/IRegion.cs",
    "content": "using System;\nusing System.ComponentModel;\n\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Defines a model that can be used to compose views.\n    /// </summary>\n    public interface IRegion : INavigateAsync, INotifyPropertyChanged\n    {\n        /// <summary>\n        /// Gets a readonly view of the collection of views in the region.\n        /// </summary>\n        /// <value>An <see cref=\"IViewsCollection\"/> of all the added views.</value>\n        IViewsCollection Views { get; }\n\n        /// <summary>\n        /// Gets a readonly view of the collection of all the active views in the region.\n        /// </summary>\n        /// <value>An <see cref=\"IViewsCollection\"/> of all the active views.</value>\n        IViewsCollection ActiveViews { get; }\n\n        /// <summary>\n        /// Gets or sets a context for the region. This value can be used by the user to share context with the views.\n        /// </summary>\n        /// <value>The context value to be shared.</value>\n        object Context { get; set; }\n\n        /// <summary>\n        /// Gets the name of the region that uniquely identifies the region within a <see cref=\"IRegionManager\"/>.\n        /// </summary>\n        /// <value>The name of the region.</value>\n        string Name { get; set; }\n\n        /// <summary>\n        /// Gets or sets the comparison used to sort the views.\n        /// </summary>\n        /// <value>The comparison to use.</value>\n        Comparison<object> SortComparison { get; set; }\n\n        ///<overloads>Adds a new view to the region.</overloads>\n        /// <summary>\n        /// Adds a new view to the region.\n        /// </summary>\n        /// <param name=\"viewName\">The view to add.</param>\n        /// <returns>The <see cref=\"IRegionManager\"/> that is set on the view. It will be the current region manager when using this overload.</returns>\n        IRegionManager Add(string viewName);\n\n        ///<overloads>Adds a new view to the region.</overloads>\n        /// <summary>\n        /// Adds a new view to the region.\n        /// </summary>\n        /// <param name=\"view\">The view to add.</param>\n        /// <returns>The <see cref=\"IRegionManager\"/> that is set on the view. It will be the current region manager when using this overload.</returns>\n        IRegionManager Add(object view);\n\n        /// <summary>\n        /// Adds a new view to the region.\n        /// </summary>\n        /// <param name=\"view\">The view to add.</param>\n        /// <param name=\"viewName\">The name of the view. This can be used to retrieve it later by calling <see cref=\"GetView\"/>.</param>\n        /// <returns>The <see cref=\"IRegionManager\"/> that is set on the view. It will be the current region manager when using this overload.</returns>\n        IRegionManager Add(object view, string viewName);\n\n        /// <summary>\n        /// Adds a new view to the region.\n        /// </summary>\n        /// <param name=\"view\">The view to add.</param>\n        /// <param name=\"viewName\">The name of the view. This can be used to retrieve it later by calling <see cref=\"GetView\"/>.</param>\n        /// <param name=\"createRegionManagerScope\">When <see langword=\"true\"/>, the added view will receive a new instance of <see cref=\"IRegionManager\"/>, otherwise it will use the current region manager for this region.</param>\n        /// <returns>The <see cref=\"IRegionManager\"/> that is set on the view.</returns>\n        IRegionManager Add(object view, string viewName, bool createRegionManagerScope);\n\n        /// <summary>\n        /// Removes the specified view from the region.\n        /// </summary>\n        /// <param name=\"view\">The view to remove.</param>\n        void Remove(object view);\n\n        /// <summary>\n        /// Removes all views from the region.\n        /// </summary>\n        void RemoveAll();\n\n        /// <summary>\n        /// Marks the specified view as active.\n        /// </summary>\n        /// <param name=\"view\">The view to activate.</param>\n        void Activate(object view);\n\n        /// <summary>\n        /// Marks the specified view as inactive.\n        /// </summary>\n        /// <param name=\"view\">The view to deactivate.</param>\n        void Deactivate(object view);\n\n        /// <summary>\n        /// Returns the view instance that was added to the region using a specific name.\n        /// </summary>\n        /// <param name=\"viewName\">The name used when adding the view to the region.</param>\n        /// <returns>Returns the named view or <see langword=\"null\"/> if the view with <paramref name=\"viewName\"/> does not exist in the current region.</returns>\n        object GetView(string viewName);\n\n        /// <summary>\n        /// Gets or sets the <see cref=\"IRegionManager\"/> that will be passed to the views when adding them to the region, unless the view is added by specifying createRegionManagerScope as <see langword=\"true\" />.\n        /// </summary>\n        /// <value>The <see cref=\"IRegionManager\"/> where this <see cref=\"IRegion\"/> is registered.</value>\n        /// <remarks>This is usually used by implementations of <see cref=\"IRegionManager\"/> and should not be\n        /// used by the developer explicitly.</remarks>\n        IRegionManager RegionManager { get; set; }\n\n        /// <summary>\n        /// Gets the collection of <see cref=\"IRegionBehavior\"/>s that can extend the behavior of regions.\n        /// </summary>\n        IRegionBehaviorCollection Behaviors { get; }\n\n        /// <summary>\n        /// Gets or sets the navigation service.\n        /// </summary>\n        /// <value>The navigation service.</value>\n        IRegionNavigationService NavigationService { get; set; }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/Regions/IRegionAdapter.cs",
    "content": "namespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Defines an interfaces to adapt an object and bind it to a new <see cref=\"IRegion\"/>.\n    /// </summary>\n    public interface IRegionAdapter\n    {\n        /// <summary>\n        /// Adapts an object and binds it to a new <see cref=\"IRegion\"/>.\n        /// </summary>\n        /// <param name=\"regionTarget\">The object to adapt.</param>\n        /// <param name=\"regionName\">The name of the region to be created.</param>\n        /// <returns>The new instance of <see cref=\"IRegion\"/> that the <paramref name=\"regionTarget\"/> is bound to.</returns>\n        IRegion Initialize(object regionTarget, string regionName);\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/Regions/IRegionAware.cs",
    "content": "namespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Provides a way for objects involved in navigation to be notified of navigation activities.\n    /// </summary>\n    public interface IRegionAware\n    {\n        /// <summary>\n        /// Called when the implementer has been navigated to.\n        /// </summary>\n        /// <param name=\"navigationContext\">The navigation context.</param>\n        void OnNavigatedTo(NavigationContext navigationContext);\n\n        /// <summary>\n        /// Called to determine if this instance can handle the navigation request.\n        /// </summary>\n        /// <param name=\"navigationContext\">The navigation context.</param>\n        /// <returns>\n        /// <see langword=\"true\"/> if this instance accepts the navigation request; otherwise, <see langword=\"false\"/>.\n        /// </returns>\n        bool IsNavigationTarget(NavigationContext navigationContext);\n\n        /// <summary>\n        /// Called when the implementer is being navigated away from.\n        /// </summary>\n        /// <param name=\"navigationContext\">The navigation context.</param>\n        void OnNavigatedFrom(NavigationContext navigationContext);\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/Regions/IRegionBehavior.cs",
    "content": "namespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Interface for allowing extensible behavior on regions.\n    /// </summary>\n    public interface IRegionBehavior\n    {\n        /// <summary>\n        /// The region that this behavior is extending.\n        /// </summary>\n        IRegion Region { get; set; }\n\n        /// <summary>\n        /// Attaches the behavior to the specified region.\n        /// </summary>\n        void Attach();\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/Regions/IRegionBehaviorCollection.cs",
    "content": "using System.Collections.Generic;\n\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Defines the interface for a collection of <see cref=\"IRegionBehavior\"/> classes on a Region.\n    /// </summary>\n    public interface IRegionBehaviorCollection : IEnumerable<KeyValuePair<string, IRegionBehavior>>\n    {\n\n        /// <summary>\n        /// Adds a <see cref=\"IRegionBehavior\"/> to the collection, using the specified key as an indexer.\n        /// </summary>\n        /// <param name=\"key\">\n        /// The key that specifies the type of <see cref=\"IRegionBehavior\"/> that's added.\n        /// </param>\n        /// <param name=\"regionBehavior\">The <see cref=\"IRegionBehavior\"/> to add.</param>\n        void Add(string key, IRegionBehavior regionBehavior);\n\n        /// <summary>\n        /// Checks if a <see cref=\"IRegionBehavior\"/> with the specified key is already present.\n        /// </summary>\n        /// <param name=\"key\">The key to use to find a particular <see cref=\"IRegionBehavior\"/>.</param>\n        /// <returns></returns>\n        bool ContainsKey(string key);\n\n        /// <summary>\n        /// Gets the <see cref=\"IRegionBehavior\"/> with the specified key.\n        /// </summary>\n        /// <value>The registered <see cref=\"IRegionBehavior\"/></value>\n        IRegionBehavior this[string key] { get; }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/Regions/IRegionBehaviorFactory.cs",
    "content": "using System;\nusing System.Collections.Generic;\n\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Interface for RegionBehaviorFactories. This factory allows the registration of the default set of RegionBehaviors, that will\n    /// be added to the <see cref=\"IRegionBehaviorCollection\"/>s of all <see cref=\"IRegion\"/>s, unless overridden on a 'per-region' basis.\n    /// </summary>\n    public interface IRegionBehaviorFactory : IEnumerable<string>\n    {\n        /// <summary>\n        /// Adds a particular type of RegionBehavior if it was not already registered. the <paramref name=\"behaviorKey\"/> string is used to check if the behavior is already present\n        /// </summary>\n        /// <param name=\"behaviorKey\">The behavior key that's used to find if a certain behavior is already added.</param>\n        /// <param name=\"behaviorType\">Type of the behavior to add.</param>\n        void AddIfMissing(string behaviorKey, Type behaviorType);\n\n        /// <summary>\n        /// Adds or replaces a particular type of RegionBehavior. the <paramref name=\"behaviorKey\"/> string is used to check if the behavior is already present\n        /// </summary>\n        /// <param name=\"behaviorKey\">The behavior key that's used to find if a certain behavior is already added.</param>\n        /// <param name=\"behaviorType\">Type of the behavior to add.</param>\n        void AddOrReplace(string behaviorKey, Type behaviorType);\n\n        /// <summary>\n        /// Determines whether a behavior with the specified key already exists\n        /// </summary>\n        /// <param name=\"behaviorKey\">The behavior key.</param>\n        /// <returns>\n        /// <see langword=\"true\"/> if a behavior with the specified key is present; otherwise, <see langword=\"false\"/>.\n        /// </returns>\n        bool ContainsKey(string behaviorKey);\n\n        /// <summary>\n        /// Creates an instance of the BehaviorType that's registered using the specified key.\n        /// </summary>\n        /// <param name=\"key\">The key that's used to register a behavior type.</param>\n        /// <returns>The created behavior. </returns>\n        IRegionBehavior CreateFromKey(string key);\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/Regions/IRegionBehaviorFactoryExtensions.cs",
    "content": "namespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Extension methods for the IRegionBehaviorFactory.\n    /// </summary>\n    public static class IRegionBehaviorFactoryExtensions\n    {\n        /// <summary>\n        /// Adds a particular type of RegionBehavior if it was not already registered. the Type Name is used to check if the behavior is already present\n        /// </summary>\n        /// <typeparam name=\"T\">Type of the behavior to add.</typeparam>\n        /// <param name=\"regionBehaviorFactory\">The IRegionBehaviorFactory instance</param>\n        public static void AddIfMissing<T>(this IRegionBehaviorFactory regionBehaviorFactory) where T : IRegionBehavior\n        {\n            var behaviorType = typeof(T);\n            regionBehaviorFactory.AddIfMissing(typeof(T).Name, behaviorType);\n        }\n\n        /// <summary>\n        /// Adds or replaces a particular type of RegionBehavior. the Type Name is used to check if the behavior is already present\n        /// </summary>\n        /// <typeparam name=\"T\">Type of the behavior to add.</typeparam>\n        /// <param name=\"regionBehaviorFactory\">The IRegionBehaviorFactory instance</param>\n        public static void AddOrReplace<T>(this IRegionBehaviorFactory regionBehaviorFactory) where T : IRegionBehavior\n        {\n            var behaviorType = typeof(T);\n            regionBehaviorFactory.AddOrReplace(typeof(T).Name, behaviorType);\n        }\n\n        /// <summary>\n        /// Adds a particular type of RegionBehavior if it was not already registered. the <paramref name=\"behaviorKey\"/> string is used to check if the behavior is already present\n        /// </summary>\n        /// <typeparam name=\"T\">Type of the behavior to add.</typeparam>\n        /// <param name=\"regionBehaviorFactory\">The IRegionBehaviorFactory instance</param>\n        /// <param name=\"behaviorKey\">The behavior key that's used to find if a certain behavior is already added.</param>\n        public static void AddIfMissing<T>(this IRegionBehaviorFactory regionBehaviorFactory, string behaviorKey) where T : IRegionBehavior\n        {\n            var behaviorType = typeof(T);\n            regionBehaviorFactory.AddIfMissing(behaviorKey, behaviorType);\n        }\n\n        /// <summary>\n        /// Adds or replaces a particular type of RegionBehavior. the <paramref name=\"behaviorKey\"/> string is used to check if the behavior is already present\n        /// </summary>\n        /// <typeparam name=\"T\">Type of the behavior to add.</typeparam>\n        /// <param name=\"regionBehaviorFactory\">The IRegionBehaviorFactory instance</param>\n        /// <param name=\"behaviorKey\">The behavior key that's used to find if a certain behavior is already added.</param>\n        public static void AddOrReplace<T>(this IRegionBehaviorFactory regionBehaviorFactory, string behaviorKey) where T : IRegionBehavior\n        {\n            var behaviorType = typeof(T);\n            regionBehaviorFactory.AddOrReplace(behaviorKey, behaviorType);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/Regions/IRegionCollection.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Collections.Specialized;\n\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Defines a collection of <see cref=\"IRegion\"/> uniquely identified by their Name.\n    /// </summary>\n    public interface IRegionCollection : IEnumerable<IRegion>, INotifyCollectionChanged\n    {\n        /// <summary>\n        /// Gets the IRegion with the name received as index.\n        /// </summary>\n        /// <param name=\"regionName\">Name of the region to be retrieved.</param>\n        /// <returns>The <see cref=\"IRegion\"/> identified with the requested name.</returns>\n        IRegion this[string regionName] { get; }\n\n        /// <summary>\n        /// Adds a <see cref=\"IRegion\"/> to the collection.\n        /// </summary>\n        /// <param name=\"region\">Region to be added to the collection.</param>\n        void Add(IRegion region);\n\n        /// <summary>\n        /// Removes a <see cref=\"IRegion\"/> from the collection.\n        /// </summary>\n        /// <param name=\"regionName\">Name of the region to be removed.</param>\n        /// <returns><see langword=\"true\"/> if the region was removed from the collection, otherwise <see langword=\"false\"/>.</returns>\n        bool Remove(string regionName);\n\n        /// <summary>\n        /// Checks if the collection contains a <see cref=\"IRegion\"/> with the name received as parameter.\n        /// </summary>\n        /// <param name=\"regionName\">The name of the region to look for.</param>\n        /// <returns><see langword=\"true\"/> if the region is contained in the collection, otherwise <see langword=\"false\"/>.</returns>\n        bool ContainsRegionWithName(string regionName);\n\n        /// <summary>\n        /// Adds a region to the <see cref=\"IRegionManager\"/> with the name received as argument.\n        /// </summary>\n        /// <param name=\"regionName\">The name to be given to the region.</param>\n        /// <param name=\"region\">The region to be added to the <see cref=\"IRegionManager\"/>.</param>\n        /// <exception cref=\"ArgumentNullException\">Thrown if <paramref name=\"region\"/> is <see langword=\"null\"/>.</exception>\n        /// <exception cref=\"ArgumentException\">Thrown if <paramref name=\"regionName\"/> and <paramref name=\"region\"/>'s name do not match and the <paramref name=\"region\"/> <see cref=\"IRegion.Name\"/> is not <see langword=\"null\"/>.</exception>\n        void Add(string regionName, IRegion region);\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/Regions/IRegionManager.cs",
    "content": "using System;\nusing Prism.Ioc;\nusing Prism.Navigation;\n\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Defines an interface to manage a set of <see cref=\"IRegion\">regions</see> and to attach regions to objects (typically controls).\n    /// </summary>\n    public interface IRegionManager\n    {\n        /// <summary>\n        /// Gets a collection of <see cref=\"IRegion\"/> that identify each region by name. You can use this collection to add or remove regions to the current region manager.\n        /// </summary>\n        IRegionCollection Regions { get; }\n\n        /// <summary>\n        /// Creates a new region manager.\n        /// </summary>\n        /// <returns>A new region manager that can be used as a different scope from the current region manager.</returns>\n        IRegionManager CreateRegionManager();\n\n        /// <summary>\n        /// Add a view to the Views collection of a Region. Note that the region must already exist in this <see cref=\"IRegionManager\"/>.\n        /// </summary>\n        /// <param name=\"regionName\">The name of the region to add a view to</param>\n        /// <param name=\"view\">The view to add to the views collection</param>\n        /// <returns>The RegionManager, to easily add several views. </returns>\n        IRegionManager AddToRegion(string regionName, object view);\n\n        /// <summary>\n        /// Add a view to the Views collection of a Region. Note that the region must already exist in this <see cref=\"IRegionManager\"/>.\n        /// </summary>\n        /// <param name=\"regionName\">The name of the region to add a view to</param>\n        /// <param name=\"viewName\">The view to add to the views collection</param>\n        /// <returns>The RegionManager, to easily add several views. </returns>\n        IRegionManager AddToRegion(string regionName, string viewName);\n\n        /// <summary>\n        /// Associate a view with a region, by registering a type. When the region gets displayed\n        /// this type will be resolved using the ServiceLocator into a concrete instance. The instance\n        /// will be added to the Views collection of the region\n        /// </summary>\n        /// <param name=\"regionName\">The name of the region to associate the view with.</param>\n        /// <param name=\"viewName\">The name of the view to register with the <see cref=\"IRegion\"/>.</param>\n        /// <returns>The <see cref=\"IRegionManager\"/>, for adding several views easily</returns>\n        IRegionManager RegisterViewWithRegion(string regionName, string viewName);\n\n        /// <summary>\n        /// Associate a view with a region, by registering a type. When the region gets displayed\n        /// this type will be resolved using the ServiceLocator into a concrete instance. The instance\n        /// will be added to the Views collection of the region\n        /// </summary>\n        /// <param name=\"regionName\">The name of the region to associate the view with.</param>\n        /// <param name=\"viewType\">The type of the view to register with the  <see cref=\"IRegion\"/>.</param>\n        /// <returns>The <see cref=\"IRegionManager\"/>, for adding several views easily</returns>\n        IRegionManager RegisterViewWithRegion(string regionName, Type viewType);\n\n        /// <summary>\n        /// Associate a view with a region, using a delegate to resolve a concrete instance of the view.\n        /// When the region gets displayed, this delegate will be called and the result will be added to the\n        /// views collection of the region.\n        /// </summary>\n        /// <param name=\"regionName\">The name of the region to associate the view with.</param>\n        /// <param name=\"getContentDelegate\">The delegate used to resolve a concrete instance of the view.</param>\n        /// <returns>The <see cref=\"IRegionManager\"/>, for adding several views easily</returns>\n        IRegionManager RegisterViewWithRegion(string regionName, Func<IContainerProvider, object> getContentDelegate);\n\n        /// <summary>\n        /// This method allows an IRegionManager to locate a specified region and navigate in it to the specified target Uri, passing a navigation callback and an instance of NavigationParameters, which holds a collection of object parameters.\n        /// </summary>\n        /// <param name=\"regionName\">The name of the region where the navigation will occur.</param>\n        /// <param name=\"target\">A Uri that represents the target where the region will navigate.</param>\n        /// <param name=\"navigationCallback\">The navigation callback that will be executed after the navigation is completed.</param>\n        /// <param name=\"navigationParameters\">An instance of NavigationParameters, which holds a collection of object parameters.</param>\n        void RequestNavigate(string regionName, Uri target, Action<NavigationResult> navigationCallback, INavigationParameters navigationParameters);\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/Regions/IRegionManagerExtensions.cs",
    "content": "﻿using System;\nusing Prism.Navigation;\n\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Common Extensions for the RegionManager\n    /// </summary>\n    public static class IRegionManagerExtensions\n    {\n        /// <summary>\n        /// Associate a view with a region, using a delegate to resolve a concrete instance of the view.\n        /// When the region gets displayed, this delegate will be called and the result will be added to the\n        /// views collection of the region.\n        /// </summary>\n        /// <param name=\"regionManager\">The current <see cref=\"IRegionManager\"/>.</param>\n        /// <param name=\"regionName\">The name of the region to associate the view with.</param>\n        /// <param name=\"getContentDelegate\">The delegate used to resolve a concrete instance of the view.</param>\n        /// <returns>The <see cref=\"IRegionManager\"/>, for adding several views easily</returns>\n        public static IRegionManager RegisterViewWithRegion(this IRegionManager regionManager, string regionName, Func<object> getContentDelegate) =>\n            regionManager.RegisterViewWithRegion(regionName, _ => getContentDelegate());\n\n        /// <summary>\n        /// Associate a view with a region, by registering a type. When the region get's displayed\n        /// this type will be resolved using the ServiceLocator into a concrete instance. The instance\n        /// will be added to the Views collection of the region\n        /// </summary>\n        /// <typeparam name=\"T\">The type of the view to register with the  <see cref=\"IRegion\"/>.</typeparam>\n        /// <param name=\"regionManager\">The current <see cref=\"IRegionManager\"/>.</param>\n        /// <param name=\"regionName\">The name of the region to associate the view with.</param>\n        /// <returns>The <see cref=\"IRegionManager\"/>, for adding several views easily</returns>\n        public static IRegionManager RegisterViewWithRegion<T>(this IRegionManager regionManager, string regionName) =>\n            regionManager.RegisterViewWithRegion(regionName, typeof(T));\n\n        /// <summary>\n        /// Navigates the specified region manager.\n        /// </summary>\n        /// <param name=\"regionManager\">The current <see cref=\"IRegionManager\"/>.</param>\n        /// <param name=\"regionName\">The name of the region to call Navigate on.</param>\n        /// <param name=\"source\">The URI of the content to display.</param>\n        public static void RequestNavigate(this IRegionManager regionManager, string regionName, Uri source) =>\n            regionManager.RequestNavigate(regionName, source, _ => { }, new NavigationParameters());\n\n        /// <summary>\n        /// Navigates the specified region manager.\n        /// </summary>\n        /// <param name=\"regionManager\">The current <see cref=\"IRegionManager\"/>.</param>\n        /// <param name=\"regionName\">The name of the region to call Navigate on.</param>\n        /// <param name=\"source\">The URI of the content to display.</param>\n        /// <param name=\"navigationCallback\">The navigation callback.</param>\n        public static void RequestNavigate(this IRegionManager regionManager, string regionName, Uri source, Action<NavigationResult> navigationCallback) =>\n            regionManager.RequestNavigate(regionName, source, navigationCallback, new NavigationParameters());\n\n        /// <summary>\n        /// Navigates the specified region manager.\n        /// </summary>\n        /// <param name=\"regionManager\">The current <see cref=\"IRegionManager\"/>.</param>\n        /// <param name=\"regionName\">The name of the region to call Navigate on.</param>\n        /// <param name=\"source\">The URI of the content to display.</param>\n        /// <param name=\"navigationCallback\">The navigation callback.</param>\n        public static void RequestNavigate(this IRegionManager regionManager, string regionName, string source, Action<NavigationResult> navigationCallback) =>\n            regionManager.RequestNavigate(regionName, new Uri(source, UriKind.RelativeOrAbsolute), navigationCallback, new NavigationParameters());\n\n        /// <summary>\n        /// Navigates the specified region manager.\n        /// </summary>\n        /// <param name=\"regionManager\">The current <see cref=\"IRegionManager\"/>.</param>\n        /// <param name=\"regionName\">The name of the region to call Navigate on.</param>\n        /// <param name=\"source\">The URI of the content to display.</param>\n        public static void RequestNavigate(this IRegionManager regionManager, string regionName, string source) =>\n            regionManager.RequestNavigate(regionName, new Uri(source, UriKind.RelativeOrAbsolute), _ => { }, new NavigationParameters());\n\n        /// <summary>\n        /// This method allows an IRegionManager to locate a specified region and navigate in it to the specified target string, passing a navigation callback and an instance of NavigationParameters, which holds a collection of object parameters.\n        /// </summary>\n        /// <param name=\"regionManager\">The current <see cref=\"IRegionManager\"/>.</param>\n        /// <param name=\"regionName\">The name of the region where the navigation will occur.</param>\n        /// <param name=\"target\">A string that represents the target where the region will navigate.</param>\n        /// <param name=\"navigationCallback\">The navigation callback that will be executed after the navigation is completed.</param>\n        /// <param name=\"navigationParameters\">An instance of NavigationParameters, which holds a collection of object parameters.</param>\n        public static void RequestNavigate(this IRegionManager regionManager, string regionName, string target, Action<NavigationResult> navigationCallback, INavigationParameters navigationParameters) =>\n            regionManager.RequestNavigate(regionName, new Uri(target, UriKind.RelativeOrAbsolute), navigationCallback, navigationParameters);\n\n        /// <summary>\n        /// This method allows an IRegionManager to locate a specified region and navigate in it to the specified target Uri, passing an instance of NavigationParameters, which holds a collection of object parameters.\n        /// </summary>\n        /// <param name=\"regionManager\">The current <see cref=\"IRegionManager\"/>.</param>\n        /// <param name=\"regionName\">The name of the region where the navigation will occur.</param>\n        /// <param name=\"target\">A Uri that represents the target where the region will navigate.</param>\n        /// <param name=\"navigationParameters\">An instance of NavigationParameters, which holds a collection of object parameters.</param>\n        public static void RequestNavigate(this IRegionManager regionManager, string regionName, Uri target, INavigationParameters navigationParameters) =>\n            regionManager.RequestNavigate(regionName, target, _ => { }, navigationParameters);\n\n        /// <summary>\n        /// This method allows an IRegionManager to locate a specified region and navigate in it to the specified target string, passing an instance of NavigationParameters, which holds a collection of object parameters.\n        /// </summary>\n        /// <param name=\"regionManager\">The current <see cref=\"IRegionManager\"/>.</param>\n        /// <param name=\"regionName\">The name of the region where the navigation will occur.</param>\n        /// <param name=\"target\">A string that represents the target where the region will navigate.</param>\n        /// <param name=\"navigationParameters\">An instance of NavigationParameters, which holds a collection of object parameters.</param>\n        public static void RequestNavigate(this IRegionManager regionManager, string regionName, string target, INavigationParameters navigationParameters) =>\n            regionManager.RequestNavigate(regionName, new Uri(target, UriKind.RelativeOrAbsolute), navigationParameters);\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/Regions/IRegionMemberLifetime.cs",
    "content": "namespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// When implemented, allows an instance placed in a <see cref=\"IRegion\"/>\n    /// that uses a RegionMemberLifetimeBehavior to indicate\n    /// it should be removed when it transitions from an activated to deactivated state.\n    /// </summary>\n    public interface IRegionMemberLifetime\n    {\n        /// <summary>\n        /// Gets a value indicating whether this instance should be kept-alive upon deactivation.\n        /// </summary>\n        bool KeepAlive { get; }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/Regions/IRegionNavigationContentLoader.cs",
    "content": "using System;\n\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Identifies the view in a region that is the target of a navigation request.\n    /// </summary>\n    public interface IRegionNavigationContentLoader\n    {\n        /// <summary>\n        /// Gets the content to which the navigation request represented by <paramref name=\"navigationContext\"/> applies.\n        /// </summary>\n        /// <remarks>\n        /// If none of the items in the region match the target of the navigation request, a new item\n        /// will be created and added to the region.\n        /// </remarks>\n        /// <param name=\"region\">The region.</param>\n        /// <param name=\"navigationContext\">The context representing the navigation request.</param>\n        /// <returns>The item to be the target of the navigation request.</returns>\n        /// <exception cref=\"InvalidOperationException\">when a new item cannot be created for the navigation request.</exception>\n        object LoadContent(IRegion region, NavigationContext navigationContext);\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/Regions/IRegionNavigationJournal.cs",
    "content": "namespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Provides journaling of current, back, and forward navigation within regions.\n    /// </summary>\n    public interface IRegionNavigationJournal\n    {\n        /// <summary>\n        /// Gets a value that indicates whether there is at least one entry in the back navigation history.\n        /// </summary>\n        /// <value>\n        /// <c>true</c> if the journal can go back; otherwise, <c>false</c>.\n        /// </value>\n        bool CanGoBack { get; }\n\n        /// <summary>\n        /// Gets a value that indicates whether there is at least one entry in the forward navigation history.\n        /// </summary>\n        /// <value>\n        /// <c>true</c> if this instance can go forward; otherwise, <c>false</c>.\n        /// </value>\n        bool CanGoForward { get; }\n\n        /// <summary>\n        /// Gets the current navigation entry of the content that is currently displayed.\n        /// </summary>\n        /// <value>The current entry.</value>\n        IRegionNavigationJournalEntry CurrentEntry { get; }\n\n        /// <summary>\n        /// Gets or sets the target that implements INavigateAsync.\n        /// </summary>\n        /// <value>The INavigate implementation.</value>\n        /// <remarks>\n        /// This is set by the owner of this journal.\n        /// </remarks>\n        INavigateAsync NavigationTarget { get; set; }\n\n        /// <summary>\n        /// Navigates to the most recent entry in the back navigation history, or does nothing if no entry exists in back navigation.\n        /// </summary>\n        void GoBack();\n\n        /// <summary>\n        /// Navigates to the most recent entry in the forward navigation history, or does nothing if no entry exists in forward navigation.\n        /// </summary>\n        void GoForward();\n\n        /// <summary>\n        /// Records the navigation to the entry..\n        /// </summary>\n        /// <param name=\"entry\">The entry to record.</param>\n        /// <param name=\"persistInHistory\">Keep Navigation object in memory when OnNavigationFrom is called</param>\n        void RecordNavigation(IRegionNavigationJournalEntry entry, bool persistInHistory);\n\n        /// <summary>\n        /// Clears the journal of current, back, and forward navigation histories.\n        /// </summary>\n        void Clear();\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/Regions/IRegionNavigationJournalEntry.cs",
    "content": "using System;\nusing Prism.Navigation;\n\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// An entry in an IRegionNavigationJournal representing the URI navigated to.\n    /// </summary>\n    public interface IRegionNavigationJournalEntry\n    {\n        /// <summary>\n        /// Gets or sets the URI.\n        /// </summary>\n        /// <value>The URI.</value>\n        Uri Uri { get; set; }\n\n        /// <summary>\n        /// Gets or sets the NavigationParameters instance.\n        /// </summary>\n        INavigationParameters Parameters { get; set; }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/Regions/IRegionNavigationRegistry.cs",
    "content": "﻿using Prism.Mvvm;\n\nnamespace Prism.Navigation.Regions;\n\n/// <summary>\n/// Interface for a registry that manages views specifically for regions.\n/// </summary>\npublic interface IRegionNavigationRegistry : IViewRegistry { }\n"
  },
  {
    "path": "src/Prism.Core/Navigation/Regions/IRegionNavigationService.cs",
    "content": "using System;\n\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Provides navigation for regions.\n    /// </summary>\n    public interface IRegionNavigationService : INavigateAsync\n    {\n        /// <summary>\n        /// Gets or sets the region owning this service.\n        /// </summary>\n        /// <value>A Region.</value>\n        IRegion Region { get; set; }\n\n        /// <summary>\n        /// Gets the journal.\n        /// </summary>\n        /// <value>The journal.</value>\n        IRegionNavigationJournal Journal { get; }\n\n        /// <summary>\n        /// Raised when the region is about to be navigated to content.\n        /// </summary>\n        event EventHandler<RegionNavigationEventArgs> Navigating;\n\n        /// <summary>\n        /// Raised when the region is navigated to content.\n        /// </summary>\n        event EventHandler<RegionNavigationEventArgs> Navigated;\n\n        /// <summary>\n        /// Raised when a navigation request fails.\n        /// </summary>\n        event EventHandler<RegionNavigationFailedEventArgs> NavigationFailed;\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/Regions/IRegionViewRegistry.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing Prism.Ioc;\n\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Defines the interface for the registry of region's content.\n    /// </summary>\n    public interface IRegionViewRegistry\n    {\n        /// <summary>\n        /// Event triggered when a content is registered to a region name.\n        /// </summary>\n        /// <remarks>\n        /// This event uses weak references to the event handler to prevent this service (typically a singleton) of keeping the\n        /// target element longer than expected.\n        /// </remarks>\n        event EventHandler<ViewRegisteredEventArgs> ContentRegistered;\n\n        /// <summary>\n        /// Returns the contents associated with a region name.\n        /// </summary>\n        /// <param name=\"regionName\">Region name for which contents are requested.</param>\n        /// <param name=\"container\">The <see cref=\"IContainerProvider\"/> to use to resolve the View.</param>\n        /// <returns>Collection of contents associated with the <paramref name=\"regionName\"/>.</returns>\n        IEnumerable<object> GetContents(string regionName, IContainerProvider container);\n\n        /// <summary>\n        /// Associate a view with a region, by registering a type. When the region get's displayed\n        /// this type will be resolved using the ServiceLocator into a concrete instance. The instance\n        /// will be added to the Views collection of the region\n        /// </summary>\n        /// <param name=\"regionName\">The name of the region to associate the view with.</param>\n        /// <param name=\"targetName\">The type of the view to register with the </param>\n        /// <returns>The <see cref=\"IRegionManager\"/>, for adding several views easily</returns>\n        void RegisterViewWithRegion(string regionName, string targetName);\n\n        /// <summary>\n        /// Registers a content type with a region name.\n        /// </summary>\n        /// <param name=\"regionName\">Region name to which the <paramref name=\"viewType\"/> will be registered.</param>\n        /// <param name=\"viewType\">Content type to be registered for the <paramref name=\"regionName\"/>.</param>\n        void RegisterViewWithRegion(string regionName, Type viewType);\n\n        /// <summary>\n        /// Registers a delegate that can be used to retrieve the content associated with a region name.\n        /// </summary>\n        /// <param name=\"regionName\">Region name to which the <paramref name=\"getContentDelegate\"/> will be registered.</param>\n        /// <param name=\"getContentDelegate\">Delegate used to retrieve the content associated with the <paramref name=\"regionName\"/>.</param>\n        public void RegisterViewWithRegion(string regionName, Func<IContainerProvider, object> getContentDelegate);\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/Regions/IViewsCollection.cs",
    "content": "using System.Collections.Generic;\nusing System.Collections.Specialized;\n\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Defines a view of a collection.\n    /// </summary>\n    public interface IViewsCollection : IEnumerable<object>, INotifyCollectionChanged\n    {\n        /// <summary>\n        /// Determines whether the collection contains a specific value.\n        /// </summary>\n        /// <param name=\"value\">The object to locate in the collection.</param>\n        /// <returns><see langword=\"true\" /> if <paramref name=\"value\"/> is found in the collection; otherwise, <see langword=\"false\" />.</returns>\n        bool Contains(object value);\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/Regions/NavigationAsyncExtensions.cs",
    "content": "using System;\nusing Prism.Navigation;\n\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Provides additional methods to the <see cref=\"INavigateAsync\"/> interface.\n    /// </summary>\n    public static class NavigationAsyncExtensions\n    {\n        /// <summary>\n        /// Initiates navigation to the target specified by the <see cref=\"Uri\"/>.\n        /// </summary>\n        /// <param name=\"navigation\">The navigation object.</param>\n        /// <param name=\"target\">The navigation target</param>\n        /// <param name=\"navigationCallback\">The callback executed when the navigation request is completed.</param>\n        /// <remarks>\n        /// Convenience overloads for this method can be found as extension methods on the\n        /// <see cref=\"NavigationAsyncExtensions\"/> class.\n        /// </remarks>\n        public static void RequestNavigate(this INavigateAsync navigation, Uri target, Action<NavigationResult> navigationCallback) =>\n            navigation.RequestNavigate(target, navigationCallback, new NavigationParameters());\n\n        /// <summary>\n        /// Initiates navigation to the target specified by the <paramref name=\"target\"/>.\n        /// </summary>\n        /// <param name=\"navigation\">The navigation object.</param>\n        /// <param name=\"target\">The navigation target</param>\n        public static void RequestNavigate(this INavigateAsync navigation, string target)\n        {\n            RequestNavigate(navigation, target, nr => { });\n        }\n\n        /// <summary>\n        /// Initiates navigation to the target specified by the <paramref name=\"target\"/>.\n        /// </summary>\n        /// <param name=\"navigation\">The navigation object.</param>\n        /// <param name=\"target\">The navigation target</param>\n        /// <param name=\"navigationCallback\">The callback executed when the navigation request is completed.</param>\n        public static void RequestNavigate(this INavigateAsync navigation, string target, Action<NavigationResult> navigationCallback)\n        {\n            if (navigation == null)\n                throw new ArgumentNullException(nameof(navigation));\n\n            if (target == null)\n                throw new ArgumentNullException(nameof(target));\n\n            var targetUri = new Uri(target, UriKind.RelativeOrAbsolute);\n\n            navigation.RequestNavigate(targetUri, navigationCallback);\n        }\n\n        /// <summary>\n        /// Initiates navigation to the target specified by the <see cref=\"Uri\"/>.\n        /// </summary>\n        /// <param name=\"navigation\">The navigation object.</param>\n        /// <param name=\"target\">The navigation target</param>\n        public static void RequestNavigate(this INavigateAsync navigation, Uri target)\n        {\n            if (navigation == null)\n                throw new ArgumentNullException(nameof(navigation));\n\n            navigation.RequestNavigate(target, nr => { });\n        }\n\n        /// <summary>\n        /// Initiates navigation to the target specified by the <paramref name=\"target\"/>.\n        /// </summary>\n        /// <param name=\"navigation\">The navigation object.</param>\n        /// <param name=\"target\">The navigation target</param>\n        /// <param name=\"navigationCallback\">The callback executed when the navigation request is completed.</param>\n        /// <param name=\"navigationParameters\">An instance of NavigationParameters, which holds a collection of object parameters.</param>\n        public static void RequestNavigate(this INavigateAsync navigation, string target, Action<NavigationResult> navigationCallback, INavigationParameters navigationParameters)\n        {\n            if (navigation == null)\n                throw new ArgumentNullException(nameof(navigation));\n\n            if (target == null)\n                throw new ArgumentNullException(nameof(target));\n\n            var targetUri = new Uri(target, UriKind.RelativeOrAbsolute);\n\n            navigation.RequestNavigate(targetUri, navigationCallback, navigationParameters);\n        }\n\n        /// <summary>\n        /// Initiates navigation to the target specified by the <paramref name=\"target\"/>.\n        /// </summary>\n        /// <param name=\"navigation\">The navigation object.</param>\n        /// <param name=\"target\">A Uri that represents the target where the region will navigate.</param>\n        /// <param name=\"navigationParameters\">An instance of NavigationParameters, which holds a collection of object parameters.</param>\n        public static void RequestNavigate(this INavigateAsync navigation, Uri target, INavigationParameters navigationParameters)\n        {\n            if (navigation == null)\n                throw new ArgumentNullException(nameof(navigation));\n\n            navigation.RequestNavigate(target, nr => { }, navigationParameters);\n        }\n\n        /// <summary>\n        /// Initiates navigation to the target specified by the <paramref name=\"target\"/>.\n        /// </summary>\n        /// <param name=\"navigation\">The navigation object.</param>\n        /// <param name=\"target\">A string that represents the target where the region will navigate.</param>\n        /// <param name=\"navigationParameters\">An instance of NavigationParameters, which holds a collection of object parameters.</param>\n        public static void RequestNavigate(this INavigateAsync navigation, string target, INavigationParameters navigationParameters)\n        {\n            if (navigation == null)\n                throw new ArgumentNullException(nameof(navigation));\n\n            if (target == null)\n                throw new ArgumentNullException(nameof(target));\n\n            navigation.RequestNavigate(new Uri(target, UriKind.RelativeOrAbsolute), nr => { }, navigationParameters);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/Regions/NavigationContext.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing Prism.Common;\nusing Prism.Navigation;\n\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Encapsulates information about a navigation request.\n    /// </summary>\n    public class NavigationContext\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"NavigationContext\"/> class for a region name and a\n        /// <see cref=\"Uri\"/>.\n        /// </summary>\n        /// <param name=\"navigationService\">The navigation service.</param>\n        /// <param name=\"uri\">The Uri.</param>\n        public NavigationContext(IRegionNavigationService navigationService, Uri uri) : this(navigationService, uri, null)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"NavigationContext\"/> class for a region name and a\n        /// <see cref=\"Uri\"/>.\n        /// </summary>\n        /// <param name=\"navigationService\">The navigation service.</param>\n        /// <param name=\"navigationParameters\">The navigation parameters.</param>\n        /// <param name=\"uri\">The Uri.</param>\n        public NavigationContext(IRegionNavigationService navigationService, Uri uri, INavigationParameters navigationParameters)\n        {\n            NavigationService = navigationService;\n            Uri = uri;\n            Parameters = uri != null ? UriParsingHelper.ParseQuery(uri) : null;\n            GetNavigationParameters(navigationParameters);\n        }\n\n        /// <summary>\n        /// Gets the region navigation service.\n        /// </summary>\n        /// <value>The navigation service.</value>\n        public IRegionNavigationService NavigationService { get; private set; }\n\n        /// <summary>\n        /// Gets the navigation URI.\n        /// </summary>\n        /// <value>The navigation URI.</value>\n        public Uri Uri { get; private set; }\n\n        /// <summary>\n        /// Gets the <see cref=\"INavigationParameters\"/> extracted from the URI and the object parameters passed in navigation.\n        /// </summary>\n        /// <value>The URI query.</value>\n        public INavigationParameters Parameters { get; private set; }\n\n        private void GetNavigationParameters(INavigationParameters navigationParameters)\n        {\n            if (Parameters == null || NavigationService == null || NavigationService.Region == null)\n            {\n                Parameters = new NavigationParameters();\n                return;\n            }\n\n            if (navigationParameters != null)\n            {\n                foreach (KeyValuePair<string, object> navigationParameter in navigationParameters)\n                {\n                    Parameters.Add(navigationParameter.Key, navigationParameter.Value);\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/Regions/NavigationContextExtensions.cs",
    "content": "﻿using Prism.Common;\n\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Provides extensions for the Navigation Context\n    /// </summary>\n    public static class NavigationContextExtensions\n    {\n        /// <summary>\n        /// Gets the Navigation Segment name from the <see cref=\"NavigationContext\"/>.\n        /// </summary>\n        /// <param name=\"context\">The current instance of the <see cref=\"NavigationContext\"/>.</param>\n        /// <returns>The View Name that was navigated to.</returns>\n        public static string NavigatedName(this NavigationContext context)\n        {\n            var uri = UriParsingHelper.EnsureAbsolute(context.Uri);\n            var segments = UriParsingHelper.GetUriSegments(uri);\n            var segment = segments.Dequeue();\n            return UriParsingHelper.GetSegmentName(segment);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/Regions/RegionBehavior.cs",
    "content": "using System;\nusing Prism.Properties;\n\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Provides a base class for region's behaviors.\n    /// </summary>\n    public abstract class RegionBehavior : IRegionBehavior\n    {\n        private IRegion region;\n\n        /// <summary>\n        /// Behavior's attached region.\n        /// </summary>\n        public IRegion Region\n        {\n            get\n            {\n                return region;\n            }\n            set\n            {\n                if (this.IsAttached)\n                {\n                    throw new InvalidOperationException(Resources.RegionBehaviorRegionCannotBeSetAfterAttach);\n                }\n\n                this.region = value;\n            }\n        }\n\n        /// <summary>\n        /// Returns <see langword=\"true\"/> if the behavior is attached to a region, <see langword=\"false\"/> otherwise.\n        /// </summary>\n        public bool IsAttached { get; private set; }\n\n        /// <summary>\n        /// Attaches the behavior to the region.\n        /// </summary>\n        public void Attach()\n        {\n            if (this.region == null)\n            {\n                throw new InvalidOperationException(Resources.RegionBehaviorAttachCannotBeCallWithNullRegion);\n            }\n\n            IsAttached = true;\n            OnAttach();\n        }\n\n        /// <summary>\n        /// Override this method to perform the logic after the behavior has been attached.\n        /// </summary>\n        protected abstract void OnAttach();\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/Regions/RegionBehaviorCollection.cs",
    "content": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// A collection of <see cref=\"IRegionBehavior\"/> instances, that are stored and retrieved by Key.\n    /// </summary>\n    public class RegionBehaviorCollection : IRegionBehaviorCollection\n    {\n        private readonly IRegion region;\n        private readonly Dictionary<string, IRegionBehavior> behaviors = new Dictionary<string, IRegionBehavior>();\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"RegionBehaviorCollection\"/> class and associates it with a region.\n        /// </summary>\n        /// <param name=\"region\">The region to associate the behavior collection with.</param>\n        public RegionBehaviorCollection(IRegion region)\n        {\n            this.region = region;\n        }\n\n        /// <summary>\n        /// Gets the <see cref=\"IRegionBehavior\"/> with the specified key.\n        /// </summary>\n        /// <value>The RegionBehavior that's registered with the key.</value>\n        public IRegionBehavior this[string key] => behaviors[key];\n\n        /// <summary>\n        /// Adds a <see cref=\"IRegionBehavior\"/> to the collection, using the specified key as an indexer.\n        /// </summary>\n        /// <param name=\"key\">The key that specifies the type of <see cref=\"IRegionBehavior\"/> that's added.</param>\n        /// <param name=\"regionBehavior\">The <see cref=\"IRegionBehavior\"/> to add.</param>\n        /// <exception cref=\"ArgumentNullException\">\n        /// Thrown is the <paramref name=\"key\"/> parameter is Null,\n        /// or if the <paramref name=\"regionBehavior\"/> parameter is Null.\n        /// </exception>\n        /// <exception cref=\"ArgumentException\">Thrown if a behavior with the specified Key parameter already exists.</exception>\n        public void Add(string key, IRegionBehavior regionBehavior)\n        {\n            if (key == null)\n                throw new ArgumentNullException(nameof(key));\n\n            if (regionBehavior == null)\n                throw new ArgumentNullException(nameof(regionBehavior));\n\n            if (behaviors.ContainsKey(key))\n                throw new ArgumentException(\"Could not add duplicate behavior with same key.\", nameof(key));\n\n            behaviors.Add(key, regionBehavior);\n            regionBehavior.Region = region;\n\n            regionBehavior.Attach();\n        }\n\n        /// <summary>\n        /// Checks if a <see cref=\"IRegionBehavior\"/> with the specified key is already present.\n        /// </summary>\n        /// <param name=\"key\">The key to use to find a particular <see cref=\"IRegionBehavior\"/>.</param>\n        /// <returns></returns>\n        public bool ContainsKey(string key) => behaviors.ContainsKey(key);\n\n        /// <summary>\n        /// Returns an enumerator that iterates through the collection.\n        /// </summary>\n        /// <returns>\n        /// A <see cref=\"T:System.Collections.Generic.IEnumerator`1\"/> that can be used to iterate through the collection.\n        /// </returns>\n        public IEnumerator<KeyValuePair<string, IRegionBehavior>> GetEnumerator() => behaviors.GetEnumerator();\n\n        /// <summary>\n        /// Returns an enumerator that iterates through a collection.\n        /// </summary>\n        /// <returns>\n        /// An <see cref=\"T:System.Collections.IEnumerator\"/> object that can be used to iterate through the collection.\n        /// </returns>\n        IEnumerator IEnumerable.GetEnumerator() => behaviors.GetEnumerator();\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/Regions/RegionBehaviorFactory.cs",
    "content": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Threading;\nusing Prism.Ioc;\nusing Prism.Properties;\n\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Defines a factory that allows the registration of the default set of <see cref=\"IRegionBehavior\"/>, that will\n    /// be added to the <see cref=\"IRegionBehaviorCollection\"/> of all <see cref=\"IRegion\"/>s, unless overridden on a 'per-region' basis.\n    /// </summary>\n    public class RegionBehaviorFactory : IRegionBehaviorFactory\n    {\n        private readonly IContainerProvider _container;\n        private readonly Dictionary<string, Type> _registeredBehaviors = new Dictionary<string, Type>();\n\n        /// <summary>\n        /// Initializes a new instance of <see cref=\"RegionBehaviorFactory\"/>.\n        /// </summary>\n        /// <param name=\"container\"><see cref=\"IContainerExtension\"/> used to create the instance of the behavior from its <see cref=\"Type\"/>.</param>\n        public RegionBehaviorFactory(IContainerExtension container)\n        {\n            _container = container;\n        }\n\n        /// <summary>\n        /// Adds a particular type of RegionBehavior if it was not already registered. The <paramref name=\"behaviorKey\"/> string is used to check if the behavior is already present\n        /// </summary>\n        /// <param name=\"behaviorKey\">The behavior key that's used to find if a certain behavior is already added.</param>\n        /// <param name=\"behaviorType\">Type of the behavior to add.</param>\n        public void AddIfMissing(string behaviorKey, Type behaviorType)\n        {\n            if (behaviorKey == null)\n            {\n                throw new ArgumentNullException(nameof(behaviorKey));\n            }\n\n            if (behaviorType == null)\n            {\n                throw new ArgumentNullException(nameof(behaviorType));\n            }\n\n            // Check if the type is a IRegionBehavior\n            if (!typeof(IRegionBehavior).IsAssignableFrom(behaviorType))\n            {\n                throw new ArgumentException(\n                    string.Format(Thread.CurrentThread.CurrentCulture, Resources.CanOnlyAddTypesThatInheritIFromRegionBehavior, behaviorType.Name), nameof(behaviorType));\n            }\n\n            // Only add the behaviorKey if it doesn't already exists.\n            if (_registeredBehaviors.ContainsKey(behaviorKey))\n            {\n                return;\n            }\n\n            _registeredBehaviors.Add(behaviorKey, behaviorType);\n        }\n\n        /// <summary>\n        /// Adds or replaces a particular type of RegionBehavior. The <paramref name=\"behaviorKey\"/> string is used to check if the behavior is already present\n        /// </summary>\n        /// <param name=\"behaviorKey\">The behavior key that's used to find if a certain behavior is already added.</param>\n        /// <param name=\"behaviorType\">Type of the behavior to add.</param>\n        public void AddOrReplace(string behaviorKey, Type behaviorType)\n        {\n            if (_registeredBehaviors.ContainsKey(behaviorKey)\n                && _registeredBehaviors[behaviorKey].Equals(behaviorType) == false)\n            {\n                _registeredBehaviors.Remove(behaviorKey);\n            }\n\n            AddIfMissing(behaviorKey, behaviorType);\n        }\n\n        /// <summary>\n        /// Creates an instance of the behavior <see cref=\"Type\"/> that is registered using the specified key.\n        /// </summary>\n        /// <param name=\"key\">The key that is used to register a behavior type.</param>\n        /// <returns>A new instance of the behavior. </returns>\n        public IRegionBehavior CreateFromKey(string key)\n        {\n            if (!ContainsKey(key))\n            {\n                throw new ArgumentException(\n                    string.Format(Thread.CurrentThread.CurrentCulture, Resources.TypeWithKeyNotRegistered, key), nameof(key));\n            }\n\n            return (IRegionBehavior)_container.Resolve(_registeredBehaviors[key]);\n        }\n\n\n        /// <summary>\n        /// Returns an enumerator that iterates through the collection.\n        /// </summary>\n        /// <returns>\n        /// A <see cref=\"T:System.Collections.Generic.IEnumerator`1\" /> that can be used to iterate through the collection.\n        /// </returns>\n        /// <filterpriority>1</filterpriority>\n        public IEnumerator<string> GetEnumerator()\n        {\n            return _registeredBehaviors.Keys.GetEnumerator();\n        }\n\n        /// <summary>\n        /// Returns an enumerator that iterates through a collection.\n        /// </summary>\n        /// <returns>\n        /// An <see cref=\"T:System.Collections.IEnumerator\" /> object that can be used to iterate through the collection.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return GetEnumerator();\n        }\n\n        /// <summary>\n        /// Determines whether a behavior with the specified key already exists.\n        /// </summary>\n        /// <param name=\"behaviorKey\">The behavior key.</param>\n        /// <returns>\n        /// <see langword=\"true\"/> if a behavior with the specified key is present; otherwise, <see langword=\"false\"/>.\n        /// </returns>\n        public bool ContainsKey(string behaviorKey)\n        {\n            return _registeredBehaviors.ContainsKey(behaviorKey);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/Regions/RegionCreationException.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Runtime.Serialization;\nusing System.Text;\n\nnamespace Prism.Navigation.Regions;\n\n/// <summary>\n/// An exception used when encountering an error in the creation of a Region\n/// </summary>\n[Serializable]\npublic sealed class RegionCreationException : RegionException\n{\n    /// <inheritdoc />\n    public RegionCreationException()\n    {\n    }\n\n    /// <inheritdoc />\n    public RegionCreationException(string message) : base(message)\n    {\n    }\n\n    /// <inheritdoc />\n    public RegionCreationException(SerializationInfo info, StreamingContext context) : base(info, context)\n    {\n    }\n\n    /// <inheritdoc />\n    public RegionCreationException(string message, Exception innerException) : base(message, innerException)\n    {\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/Regions/RegionException.cs",
    "content": "﻿using System;\nusing System.Runtime.Serialization;\n\nnamespace Prism.Navigation.Regions;\n\n/// <summary>\n/// Provides a common base class for Region Exceptions\n/// </summary>\npublic abstract class RegionException : Exception\n{\n    /// <inheritdoc />\n    protected RegionException()\n    {\n    }\n\n    /// <inheritdoc />\n    protected RegionException(string message) : base(message)\n    {\n    }\n\n    /// <inheritdoc />\n    protected RegionException(SerializationInfo info, StreamingContext context) : base(info, context)\n    {\n    }\n\n    /// <inheritdoc />\n    protected RegionException(string message, Exception innerException) : base(message, innerException)\n    {\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/Regions/RegionMemberLifetimeAttribute.cs",
    "content": "using System;\n\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// When <see cref=\"RegionMemberLifetimeAttribute\"/> is applied to class provides data\n    /// the RegionMemberLifetimeBehavior can use to determine if the instance should\n    /// be removed when it is deactivated.\n    /// </summary>\n    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple = true, Inherited = true)]\n    public sealed class RegionMemberLifetimeAttribute : Attribute\n    {\n        /// <summary>\n        /// Instantiates an instance of <see cref=\"RegionMemberLifetimeAttribute\"/>\n        /// </summary>\n        public RegionMemberLifetimeAttribute()\n        {\n            KeepAlive = true;\n        }\n\n        ///<summary>\n        /// Determines if the region member should be kept-alive\n        /// when deactivated.\n        ///</summary>\n        public bool KeepAlive { get; set; }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/Regions/RegionNavigationEventArgs.cs",
    "content": "using System;\n\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// EventArgs used with the Navigated event.\n    /// </summary>\n    public class RegionNavigationEventArgs : EventArgs\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"RegionNavigationEventArgs\"/> class.\n        /// </summary>\n        /// <param name=\"navigationContext\">The navigation context.</param>\n        public RegionNavigationEventArgs(NavigationContext navigationContext)\n        {\n            NavigationContext = navigationContext ?? throw new ArgumentNullException(nameof(navigationContext));\n        }\n\n        /// <summary>\n        /// Gets the navigation context.\n        /// </summary>\n        /// <value>The navigation context.</value>\n        public NavigationContext NavigationContext { get; }\n\n        /// <summary>\n        /// Gets the navigation URI\n        /// </summary>\n        /// <value>The URI.</value>\n        /// <remarks>\n        /// This is a convenience accessor around NavigationContext.Uri.\n        /// </remarks>\n        public Uri Uri => NavigationContext.Uri;\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/Regions/RegionNavigationFailedEventArgs.cs",
    "content": "using System;\n\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// EventArgs used with the NavigationFailed event.\n    /// </summary>\n    public class RegionNavigationFailedEventArgs : EventArgs\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"RegionNavigationEventArgs\"/> class.\n        /// </summary>\n        /// <param name=\"navigationContext\">The navigation context.</param>\n        public RegionNavigationFailedEventArgs(NavigationContext navigationContext)\n        {\n            NavigationContext = navigationContext ?? throw new ArgumentNullException(nameof(navigationContext));\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"RegionNavigationFailedEventArgs\"/> class.\n        /// </summary>\n        /// <param name=\"navigationContext\">The navigation context.</param>\n        /// <param name=\"error\">The error.</param>\n        public RegionNavigationFailedEventArgs(NavigationContext navigationContext, Exception error)\n            : this(navigationContext)\n        {\n            Error = error;\n        }\n\n        /// <summary>\n        /// Gets the navigation context.\n        /// </summary>\n        /// <value>The navigation context.</value>\n        public NavigationContext NavigationContext { get; }\n\n        /// <summary>\n        /// Gets the error.\n        /// </summary>\n        /// <value>The <see cref=\"Exception\"/>, or <see langword=\"null\"/> if the failure was not caused by an exception.</value>\n        public Exception Error { get; }\n\n        /// <summary>\n        /// Gets the navigation URI\n        /// </summary>\n        /// <value>The URI.</value>\n        /// <remarks>\n        /// This is a convenience accessor around NavigationContext.Uri.\n        /// </remarks>\n        public Uri Uri => NavigationContext.Uri;\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/Regions/RegionNavigationJournal.cs",
    "content": "using System;\nusing System.Collections.Generic;\n\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Provides journaling of current, back, and forward navigation within regions.\n    /// </summary>\n    public class RegionNavigationJournal : IRegionNavigationJournal\n    {\n        private Stack<IRegionNavigationJournalEntry> backStack = new Stack<IRegionNavigationJournalEntry>();\n        private Stack<IRegionNavigationJournalEntry> forwardStack = new Stack<IRegionNavigationJournalEntry>();\n\n        private bool isNavigatingInternal;\n\n        /// <summary>\n        /// Gets or sets the target that implements INavigate.\n        /// </summary>\n        /// <value>The INavigate implementation.</value>\n        /// <remarks>\n        /// This is set by the owner of this journal.\n        /// </remarks>\n        public INavigateAsync NavigationTarget { get; set; }\n\n        /// <summary>\n        /// Gets the current navigation entry of the content that is currently displayed.\n        /// </summary>\n        /// <value>The current entry.</value>\n        public IRegionNavigationJournalEntry CurrentEntry { get; private set; }\n\n        /// <summary>\n        /// Gets a value that indicates whether there is at least one entry in the back navigation history.\n        /// </summary>\n        /// <value><c>true</c> if the journal can go back; otherwise, <c>false</c>.</value>\n        public bool CanGoBack\n        {\n            get\n            {\n                return this.backStack.Count > 0;\n            }\n        }\n\n        /// <summary>\n        /// Gets a value that indicates whether there is at least one entry in the forward navigation history.\n        /// </summary>\n        /// <value>\n        /// \t<c>true</c> if this instance can go forward; otherwise, <c>false</c>.\n        /// </value>\n        public bool CanGoForward\n        {\n            get\n            {\n                return this.forwardStack.Count > 0;\n            }\n        }\n\n        /// <summary>\n        /// Navigates to the most recent entry in the back navigation history, or does nothing if no entry exists in back navigation.\n        /// </summary>\n        public void GoBack()\n        {\n            if (this.CanGoBack)\n            {\n                IRegionNavigationJournalEntry entry = this.backStack.Peek();\n                this.InternalNavigate(\n                    entry,\n                    result =>\n                    {\n                        if (result)\n                        {\n                            if (this.CurrentEntry != null)\n                            {\n                                this.forwardStack.Push(this.CurrentEntry);\n                            }\n\n                            this.backStack.Pop();\n                            this.CurrentEntry = entry;\n                        }\n                    });\n            }\n        }\n\n        /// <summary>\n        /// Navigates to the most recent entry in the forward navigation history, or does nothing if no entry exists in forward navigation.\n        /// </summary>\n        public void GoForward()\n        {\n            if (this.CanGoForward)\n            {\n                IRegionNavigationJournalEntry entry = this.forwardStack.Peek();\n                this.InternalNavigate(\n                    entry,\n                    result =>\n                    {\n                        if (result)\n                        {\n                            if (this.CurrentEntry != null)\n                            {\n                                this.backStack.Push(this.CurrentEntry);\n                            }\n\n                            this.forwardStack.Pop();\n                            this.CurrentEntry = entry;\n                        }\n                    });\n            }\n        }\n\n        /// <summary>\n        /// Records the navigation to the entry..\n        /// </summary>\n        /// <param name=\"entry\">The entry to record.</param>\n        /// <param name=\"persistInHistory\">Determine if the view is added to the back stack or excluded from the history.</param>\n        public void RecordNavigation(IRegionNavigationJournalEntry entry, bool persistInHistory)\n        {\n            if (!this.isNavigatingInternal)\n            {\n                if (this.CurrentEntry != null)\n                {\n                    this.backStack.Push(this.CurrentEntry);\n                }\n\n                this.forwardStack.Clear();\n\n                if (persistInHistory)\n                    CurrentEntry = entry;\n                else\n                    CurrentEntry = null;\n            }\n        }\n\n        /// <summary>\n        /// Clears the journal of current, back, and forward navigation histories.\n        /// </summary>\n        public void Clear()\n        {\n            this.CurrentEntry = null;\n            this.backStack.Clear();\n            this.forwardStack.Clear();\n        }\n\n        private void InternalNavigate(IRegionNavigationJournalEntry entry, Action<bool> callback)\n        {\n            isNavigatingInternal = true;\n            NavigationTarget.RequestNavigate(\n                entry.Uri,\n                nr =>\n                {\n                    isNavigatingInternal = false;\n\n                    if (nr.Success)\n                    {\n                        callback(nr.Success);\n                    }\n                },\n                entry.Parameters);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/Regions/RegionNavigationJournalEntry.cs",
    "content": "using System;\nusing System.Globalization;\nusing Prism.Navigation;\n\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// An entry in an IRegionNavigationJournal representing the URI navigated to.\n    /// </summary>\n    public class RegionNavigationJournalEntry : IRegionNavigationJournalEntry\n    {\n        /// <summary>\n        /// Gets or sets the URI.\n        /// </summary>\n        /// <value>The URI.</value>\n        public Uri Uri { get; set; }\n\n        /// <summary>\n        /// Gets or sets the NavigationParameters instance.\n        /// </summary>\n        public INavigationParameters Parameters { get; set; }\n\n        /// <summary>\n        /// Returns a <see cref=\"string\"/> that represents this instance.\n        /// </summary>\n        /// <returns>\n        /// A <see cref=\"string\"/> that represents this instance.\n        /// </returns>\n        public override string ToString()\n        {\n            if (this.Uri != null)\n            {\n                return string.Format(CultureInfo.CurrentCulture, \"RegionNavigationJournalEntry:'{0}'\", this.Uri.ToString());\n            }\n\n            return base.ToString();\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/Regions/RegionViewException.cs",
    "content": "﻿using System;\nusing System.Runtime.Serialization;\n\nnamespace Prism.Navigation.Regions;\n\n/// <summary>\n/// An exception when there is an issue with a View being added to a Region\n/// </summary>\npublic sealed class RegionViewException : RegionException\n{\n    /// <summary>\n    /// Initializes a new <see cref=\"RegionViewException\"/>\n    /// </summary>\n    public RegionViewException()\n    {\n    }\n\n    /// <summary>\n    /// Initializes a new <see cref=\"RegionViewException\"/>\n    /// </summary>\n    /// <param name=\"message\">The Exception Message.</param>\n    public RegionViewException(string message) : base(message)\n    {\n    }\n\n    /// <inheritdoc />\n    public RegionViewException(SerializationInfo info, StreamingContext context) : base(info, context)\n    {\n    }\n\n    /// <summary>\n    /// Initializes a new <see cref=\"RegionViewException\"/>\n    /// </summary>\n    /// <param name=\"message\">The Exception Message.</param>\n    /// <param name=\"innerException\">The Inner <see cref=\"Exception\"/>.</param>\n    public RegionViewException(string message, Exception innerException) : base(message, innerException)\n    {\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/Regions/RegionViewRegistryExtensions.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing Prism.Ioc;\n\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Provides extensions for the <see cref=\"IRegionViewRegistry\"/>.\n    /// </summary>\n    public static class RegionViewRegistryExtensions\n    {\n        /// <summary>\n        /// Registers a delegate that can be used to retrieve the content associated with a region name.\n        /// </summary>\n        /// <param name=\"viewRegistry\">The <see cref=\"IRegionViewRegistry\"/> instance.</param>\n        /// <param name=\"regionName\">Region name to which the <paramref name=\"getContentDelegate\"/> will be registered.</param>\n        /// <param name=\"getContentDelegate\">Delegate used to retrieve the content associated with the <paramref name=\"regionName\"/>.</param>\n        public static void RegisterViewWithRegion(this IRegionViewRegistry viewRegistry, string regionName, Func<object> getContentDelegate) =>\n            viewRegistry.RegisterViewWithRegion(regionName, _ => getContentDelegate());\n\n        /// <summary>\n        /// Returns the contents associated with a region name.\n        /// </summary>\n        /// <param name=\"viewRegistry\">The current <see cref=\"IRegionViewRegistry\"/> instance.</param>\n        /// <param name=\"regionName\">Region name for which contents are requested.</param>\n        /// <returns>Collection of contents associated with the <paramref name=\"regionName\"/>.</returns>\n        public static IEnumerable<object> GetContents(this IRegionViewRegistry viewRegistry, string regionName) =>\n            viewRegistry.GetContents(regionName, ContainerLocator.Container);\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/Regions/SyncActiveStateAttribute.cs",
    "content": "using System;\n\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Defines that a view is synchronized with its parent view's Active state.\n    /// </summary>\n    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]\n    public sealed class SyncActiveStateAttribute : Attribute\n    {\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/Regions/UpdateRegionsException.cs",
    "content": "using System;\nusing System.Runtime.Serialization;\n\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Represents errors that occurred during the regions' update.\n    /// </summary>\n    [Serializable]\n    public partial class UpdateRegionsException : Exception\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"UpdateRegionsException\"/>\n        /// </summary>\n        public UpdateRegionsException()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"UpdateRegionsException\"/> class with a specified error message.\n        /// </summary>\n        /// <param name=\"message\">The message that describes the error.</param>\n        public UpdateRegionsException(string message)\n            : base(message)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"UpdateRegionsException\"/> class with a specified error message and a reference\n        /// to the inner exception that is the cause of this exception.\n        /// </summary>\n        /// <param name=\"message\">The error message that explains the reason for the exception.</param>\n        /// <param name=\"inner\">The exception that is the cause of the current exception, or a null reference\n        /// (Nothing in Visual Basic) if no inner exception is specified.</param>\n        public UpdateRegionsException(string message, Exception inner)\n            : base(message, inner)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"UpdateRegionsException\"/> class with serialized data.\n        /// </summary>\n        /// <param name=\"info\">The <see cref=\"SerializationInfo\"/> that holds the serialized object data about the exception being thrown.</param>\n        /// <param name=\"context\">The <see cref=\"StreamingContext\"/> that contains contextual information about the source or destination.</param>\n        protected UpdateRegionsException(SerializationInfo info, StreamingContext context)\n            : base(info, context)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/Regions/ViewRegisteredEventArgs.cs",
    "content": "using System;\nusing Prism.Ioc;\n\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Argument class used by the <see cref=\"IRegionViewRegistry.ContentRegistered\"/> event when a new content is registered.\n    /// </summary>\n    public class ViewRegisteredEventArgs : EventArgs\n    {\n        /// <summary>\n        /// Initializes the ViewRegisteredEventArgs class.\n        /// </summary>\n        /// <param name=\"regionName\">The region name to which the content was registered.</param>\n        /// <param name=\"getViewDelegate\">The content which was registered.</param>\n        public ViewRegisteredEventArgs(string regionName, Func<IContainerProvider, object> getViewDelegate)\n        {\n            this.GetView = getViewDelegate;\n            this.RegionName = regionName;\n        }\n\n        /// <summary>\n        /// Gets the region name to which the content was registered.\n        /// </summary>\n        public string RegionName { get; private set; }\n\n        /// <summary>\n        /// Gets the content which was registered.\n        /// </summary>\n        public Func<IContainerProvider, object> GetView { get; private set; }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/Regions/ViewRegistrationException.cs",
    "content": "using System;\nusing System.Runtime.Serialization;\n\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Exception that's thrown when something goes wrong while Registering a View with a region name in the <see cref=\"IRegionViewRegistry\"/> class.\n    /// </summary>\n    [Serializable]\n    public partial class ViewRegistrationException : Exception\n    {\n        // TODO: Find updated links as these are dead...\n        //\n        // For guidelines regarding the creation of new exception types, see\n        //    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconerrorraisinghandlingguidelines.asp\n        // and\n        //    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp07192001.asp\n        //\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ViewRegistrationException\"/> class.\n        /// </summary>\n        public ViewRegistrationException()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ViewRegistrationException\"/> class.\n        /// </summary>\n        /// <param name=\"message\">The exception message.</param>\n        public ViewRegistrationException(string message) : base(message)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ViewRegistrationException\"/> class.\n        /// </summary>\n        /// <param name=\"message\">The exception message.</param>\n        /// <param name=\"inner\">The inner exception.</param>\n        public ViewRegistrationException(string message, Exception inner) : base(message, inner)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ViewRegistrationException\"/> class with serialized data.\n        /// </summary>\n        /// <param name=\"info\">The <see cref=\"SerializationInfo\"/> that holds the serialized\n        /// object data about the exception being thrown.</param>\n        /// <param name=\"context\">The <see cref=\"StreamingContext\"/> that contains contextual information about the source or destination.</param>\n        protected ViewRegistrationException(SerializationInfo info, StreamingContext context)\n            : base(info, context)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Navigation/Regions/ViewSortHintAttribute.cs",
    "content": "using System;\nusing System.Net;\n\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Provides a hint from a view to a region on how to sort the view.\n    /// </summary>\n    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]\n    public sealed class ViewSortHintAttribute : Attribute\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ViewSortHintAttribute\"/> class.\n        /// </summary>\n        /// <param name=\"hint\">The hint to use for sorting.</param>\n        public ViewSortHintAttribute(string hint)\n        {\n            Hint = hint;\n        }\n\n        /// <summary>\n        /// Gets  the hint.\n        /// </summary>\n        /// <value>The hint to use for sorting.</value>\n        public string Hint { get; }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Prism.Core.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFrameworks>net462;net47;net8.0;net9.0;net10.0</TargetFrameworks>\n    <AssemblyName>Prism</AssemblyName>\n    <PackageId>Prism.Core</PackageId>\n    <RootNamespace>Prism</RootNamespace>\n    <!-- Summary is not actually supported at this time. Including the summary for future support. -->\n    <!--<Summary>Prism provides an implementation of a collection of design patterns that are helpful in writing well structured and maintainable applications.</Summary>-->\n    <Description> Prism provides an implementation of a collection of design patterns that are helpful in writing well structured and maintainable XAML applications, including MVVM, dependency injection, commanding, event aggregation, and more. Prism's core functionality is a shared code base in a class library that does not target any specific Application Framework. Features that need to be platform specific are implemented in the respective libraries for the target platform.</Description>\n    <PackageTags>prism;wpf;xamarin;dotnet maui;maui;uno;unoplatform;mvvm;xaml</PackageTags>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"PolySharp\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"Prism.Container.Abstractions\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Update=\"Properties\\Resources.Designer.cs\" DesignTime=\"True\" AutoGen=\"True\" DependentUpon=\"Resources.resx\" />\n    <EmbeddedResource Update=\"Properties\\Resources.resx\" Generator=\"ResXFileCodeGenerator\" LastGenOutput=\"Resources.Designer.cs\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Prism.Events\\Prism.Events.csproj\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "src/Prism.Core/Properties/AssemblyInfo.cs",
    "content": "﻿using System;\n\n[assembly: CLSCompliant(true)]\n"
  },
  {
    "path": "src/Prism.Core/Properties/Resources.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.42000\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace Prism.Properties {\n    using System;\n    \n    \n    /// <summary>\n    ///   A strongly-typed resource class, for looking up localized strings, etc.\n    /// </summary>\n    // This class was auto-generated by the StronglyTypedResourceBuilder\n    // class via a tool like ResGen or Visual Studio.\n    // To add or remove a member, edit your .ResX file then rerun ResGen\n    // with the /str option, or rebuild your VS project.\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"17.0.0.0\")]\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    internal class Resources {\n        \n        private static global::System.Resources.ResourceManager resourceMan;\n        \n        private static global::System.Globalization.CultureInfo resourceCulture;\n        \n        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        internal Resources() {\n        }\n        \n        /// <summary>\n        ///   Returns the cached ResourceManager instance used by this class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Resources.ResourceManager ResourceManager {\n            get {\n                if (object.ReferenceEquals(resourceMan, null)) {\n                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"Prism.Properties.Resources\", typeof(Resources).Assembly);\n                    resourceMan = temp;\n                }\n                return resourceMan;\n            }\n        }\n        \n        /// <summary>\n        ///   Overrides the current thread's CurrentUICulture property for all\n        ///   resource lookups using this strongly typed resource class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Globalization.CultureInfo Culture {\n            get {\n                return resourceCulture;\n            }\n            set {\n                resourceCulture = value;\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Cannot register a CompositeCommand in itself..\n        /// </summary>\n        internal static string CannotRegisterCompositeCommandInItself {\n            get {\n                return ResourceManager.GetString(\"CannotRegisterCompositeCommandInItself\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Cannot register the same command twice in the same CompositeCommand..\n        /// </summary>\n        internal static string CannotRegisterSameCommandTwice {\n            get {\n                return ResourceManager.GetString(\"CannotRegisterSameCommandTwice\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Type &apos;{0}&apos; does not implement from IRegionBehavior..\n        /// </summary>\n        internal static string CanOnlyAddTypesThatInheritIFromRegionBehavior {\n            get {\n                return ResourceManager.GetString(\"CanOnlyAddTypesThatInheritIFromRegionBehavior\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to At least one cyclic dependency has been found in the module catalog. Cycles in the module dependencies must be avoided..\n        /// </summary>\n        internal static string CyclicDependencyFound {\n            get {\n                return ResourceManager.GetString(\"CyclicDependencyFound\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to {1}: {2}. Priority: {3}. Timestamp:{0:u}..\n        /// </summary>\n        internal static string DefaultDebugLoggerPattern {\n            get {\n                return ResourceManager.GetString(\"DefaultDebugLoggerPattern\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Neither the executeMethod nor the canExecuteMethod delegates can be null..\n        /// </summary>\n        internal static string DelegateCommandDelegatesCannotBeNull {\n            get {\n                return ResourceManager.GetString(\"DelegateCommandDelegatesCannotBeNull\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to T for DelegateCommand&lt;T&gt; is not an object nor Nullable..\n        /// </summary>\n        internal static string DelegateCommandInvalidGenericPayloadType {\n            get {\n                return ResourceManager.GetString(\"DelegateCommandInvalidGenericPayloadType\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Cannot add dependency for unknown module {0}.\n        /// </summary>\n        internal static string DependencyForUnknownModule {\n            get {\n                return ResourceManager.GetString(\"DependencyForUnknownModule\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to A module declared a dependency on another module which is not declared to be loaded. Missing module(s): {0}.\n        /// </summary>\n        internal static string DependencyOnMissingModule {\n            get {\n                return ResourceManager.GetString(\"DependencyOnMissingModule\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to A duplicated module with name {0} has been found by the loader..\n        /// </summary>\n        internal static string DuplicatedModule {\n            get {\n                return ResourceManager.GetString(\"DuplicatedModule\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to An exception occurred while initializing module &apos;{0}&apos;. \n        ///    - The exception message was: {2}\n        ///    - The Assembly that the module was trying to be loaded from was:{1}\n        ///    Check the InnerException property of the exception for more information. If the exception occurred while creating an object in a DI container, you can exception.GetRootException() to help locate the root cause of the problem..\n        /// </summary>\n        internal static string FailedToLoadModule {\n            get {\n                return ResourceManager.GetString(\"FailedToLoadModule\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to An exception occurred while initializing module &apos;{0}&apos;. \n        ///    - The exception message was: {1}\n        ///    Check the InnerException property of the exception for more information. If the exception occurred \n        ///    while creating an object in a DI container, you can exception.GetRootException() to help locate the \n        ///    root cause of the problem..\n        /// </summary>\n        internal static string FailedToLoadModuleNoAssemblyInfo {\n            get {\n                return ResourceManager.GetString(\"FailedToLoadModuleNoAssemblyInfo\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Failed to load type for module {0}. \n        ///Error was: {1}..\n        /// </summary>\n        internal static string FailedToRetrieveModule {\n            get {\n                return ResourceManager.GetString(\"FailedToRetrieveModule\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The entity does not contain a property with that name.\n        /// </summary>\n        internal static string InvalidPropertyNameException {\n            get {\n                return ResourceManager.GetString(\"InvalidPropertyNameException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Module {0} depends on other modules that don&apos;t belong to the same group..\n        /// </summary>\n        internal static string ModuleDependenciesNotMetInGroup {\n            get {\n                return ResourceManager.GetString(\"ModuleDependenciesNotMetInGroup\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The member access expression does not access a property..\n        /// </summary>\n        internal static string PropertySupport_ExpressionNotProperty_Exception {\n            get {\n                return ResourceManager.GetString(\"PropertySupport_ExpressionNotProperty_Exception\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The expression is not a member access expression..\n        /// </summary>\n        internal static string PropertySupport_NotMemberAccessExpression_Exception {\n            get {\n                return ResourceManager.GetString(\"PropertySupport_NotMemberAccessExpression_Exception\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The referenced property is a static property..\n        /// </summary>\n        internal static string PropertySupport_StaticExpression_Exception {\n            get {\n                return ResourceManager.GetString(\"PropertySupport_StaticExpression_Exception\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The Attach method cannot be called when Region property is null..\n        /// </summary>\n        internal static string RegionBehaviorAttachCannotBeCallWithNullRegion {\n            get {\n                return ResourceManager.GetString(\"RegionBehaviorAttachCannotBeCallWithNullRegion\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The Region property cannot be set after Attach method has been called..\n        /// </summary>\n        internal static string RegionBehaviorRegionCannotBeSetAfterAttach {\n            get {\n                return ResourceManager.GetString(\"RegionBehaviorRegionCannotBeSetAfterAttach\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Module {0} is marked for automatic initialization when the application starts, but it depends on modules that are marked as OnDemand initialization. To fix this error, mark the dependency modules for InitializationMode=WhenAvailable, or remove this validation by extending the ModuleCatalog class..\n        /// </summary>\n        internal static string StartupModuleDependsOnAnOnDemandModule {\n            get {\n                return ResourceManager.GetString(\"StartupModuleDependsOnAnOnDemandModule\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The provided String argument {0} must not be null or empty..\n        /// </summary>\n        internal static string StringCannotBeNullOrEmpty {\n            get {\n                return ResourceManager.GetString(\"StringCannotBeNullOrEmpty\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to No BehaviorType with key &apos;{0}&apos; was registered..\n        /// </summary>\n        internal static string TypeWithKeyNotRegistered {\n            get {\n                return ResourceManager.GetString(\"TypeWithKeyNotRegistered\", resourceCulture);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Core/Properties/Resources.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <data name=\"CannotRegisterCompositeCommandInItself\" xml:space=\"preserve\">\n    <value>Cannot register a CompositeCommand in itself.</value>\n  </data>\n  <data name=\"CannotRegisterSameCommandTwice\" xml:space=\"preserve\">\n    <value>Cannot register the same command twice in the same CompositeCommand.</value>\n  </data>\n  <data name=\"CanOnlyAddTypesThatInheritIFromRegionBehavior\" xml:space=\"preserve\">\n    <value>Type '{0}' does not implement from IRegionBehavior.</value>\n  </data>\n  <data name=\"CyclicDependencyFound\" xml:space=\"preserve\">\n    <value>At least one cyclic dependency has been found in the module catalog. Cycles in the module dependencies must be avoided.</value>\n  </data>\n  <data name=\"DefaultDebugLoggerPattern\" xml:space=\"preserve\">\n    <value>{1}: {2}. Priority: {3}. Timestamp:{0:u}.</value>\n  </data>\n  <data name=\"DelegateCommandDelegatesCannotBeNull\" xml:space=\"preserve\">\n    <value>Neither the executeMethod nor the canExecuteMethod delegates can be null.</value>\n  </data>\n  <data name=\"DelegateCommandInvalidGenericPayloadType\" xml:space=\"preserve\">\n    <value>T for DelegateCommand&lt;T&gt; is not an object nor Nullable.</value>\n  </data>\n  <data name=\"DependencyForUnknownModule\" xml:space=\"preserve\">\n    <value>Cannot add dependency for unknown module {0}</value>\n  </data>\n  <data name=\"DependencyOnMissingModule\" xml:space=\"preserve\">\n    <value>A module declared a dependency on another module which is not declared to be loaded. Missing module(s): {0}</value>\n  </data>\n  <data name=\"DuplicatedModule\" xml:space=\"preserve\">\n    <value>A duplicated module with name {0} has been found by the loader.</value>\n  </data>\n  <data name=\"FailedToLoadModule\" xml:space=\"preserve\">\n    <value>An exception occurred while initializing module '{0}'. \n    - The exception message was: {2}\n    - The Assembly that the module was trying to be loaded from was:{1}\n    Check the InnerException property of the exception for more information. If the exception occurred while creating an object in a DI container, you can exception.GetRootException() to help locate the root cause of the problem.</value>\n  </data>\n  <data name=\"FailedToLoadModuleNoAssemblyInfo\" xml:space=\"preserve\">\n    <value>An exception occurred while initializing module '{0}'. \n    - The exception message was: {1}\n    Check the InnerException property of the exception for more information. If the exception occurred \n    while creating an object in a DI container, you can exception.GetRootException() to help locate the \n    root cause of the problem.</value>\n  </data>\n  <data name=\"FailedToRetrieveModule\" xml:space=\"preserve\">\n    <value>Failed to load type for module {0}. \nError was: {1}.</value>\n  </data>\n  <data name=\"InvalidPropertyNameException\" xml:space=\"preserve\">\n    <value>The entity does not contain a property with that name</value>\n  </data>\n  <data name=\"ModuleDependenciesNotMetInGroup\" xml:space=\"preserve\">\n    <value>Module {0} depends on other modules that don't belong to the same group.</value>\n  </data>\n  <data name=\"PropertySupport_ExpressionNotProperty_Exception\" xml:space=\"preserve\">\n    <value>The member access expression does not access a property.</value>\n  </data>\n  <data name=\"PropertySupport_NotMemberAccessExpression_Exception\" xml:space=\"preserve\">\n    <value>The expression is not a member access expression.</value>\n  </data>\n  <data name=\"PropertySupport_StaticExpression_Exception\" xml:space=\"preserve\">\n    <value>The referenced property is a static property.</value>\n  </data>\n  <data name=\"RegionBehaviorAttachCannotBeCallWithNullRegion\" xml:space=\"preserve\">\n    <value>The Attach method cannot be called when Region property is null.</value>\n  </data>\n  <data name=\"RegionBehaviorRegionCannotBeSetAfterAttach\" xml:space=\"preserve\">\n    <value>The Region property cannot be set after Attach method has been called.</value>\n  </data>\n  <data name=\"StartupModuleDependsOnAnOnDemandModule\" xml:space=\"preserve\">\n    <value>Module {0} is marked for automatic initialization when the application starts, but it depends on modules that are marked as OnDemand initialization. To fix this error, mark the dependency modules for InitializationMode=WhenAvailable, or remove this validation by extending the ModuleCatalog class.</value>\n  </data>\n  <data name=\"StringCannotBeNullOrEmpty\" xml:space=\"preserve\">\n    <value>The provided String argument {0} must not be null or empty.</value>\n  </data>\n  <data name=\"TypeWithKeyNotRegistered\" xml:space=\"preserve\">\n    <value>No BehaviorType with key '{0}' was registered.</value>\n  </data>\n</root>"
  },
  {
    "path": "src/Prism.Core/build/Package.targets",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<Project>\n  <ItemGroup Condition=\" '$(ImplicitUsings)' == 'true' OR '$(ImplicitUsings)' == 'enable' \">\n    <Using Include=\"Prism\" />\n    <Using Include=\"Prism.Commands\" />\n    <Using Include=\"Prism.Dialogs\" />\n    <Using Include=\"Prism.Ioc\" />\n    <Using Include=\"Prism.Modularity\" />\n    <Using Include=\"Prism.Mvvm\" />\n    <Using Include=\"Prism.Navigation\" />\n    <Using Include=\"Prism.Navigation.Regions\" />\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": "src/Prism.Events/BackgroundEventSubscription.cs",
    "content": "using System;\nusing System.Threading.Tasks;\n\nnamespace Prism.Events\n{\n    /// <summary>\n    /// Extends <see cref=\"EventSubscription\"/> to invoke the <see cref=\"EventSubscription.Action\"/> delegate in a background thread.\n    /// </summary>\n    public class BackgroundEventSubscription : EventSubscription\n    {\n        /// <summary>\n        /// Creates a new instance of <see cref=\"BackgroundEventSubscription\"/>.\n        /// </summary>\n        /// <param name=\"actionReference\">A reference to a delegate of type <see cref=\"System.Action\"/>.</param>\n        /// <exception cref=\"ArgumentNullException\">When <paramref name=\"actionReference\"/> or <see paramref=\"filterReference\"/> are <see langword=\"null\" />.</exception>\n        /// <exception cref=\"ArgumentException\">When the target of <paramref name=\"actionReference\"/> is not of type <see cref=\"System.Action\"/>.</exception>\n        public BackgroundEventSubscription(IDelegateReference actionReference)\n            : base(actionReference)\n        {\n        }\n\n        /// <summary>\n        /// Invokes the specified <see cref=\"System.Action\"/> in an asynchronous thread by using a <see cref=\"Task\"/>.\n        /// </summary>\n        /// <param name=\"action\">The action to execute.</param>\n        protected override void InvokeAction(Action action)\n        {\n            Task.Run(action);\n        }\n    }\n\n    /// <summary>\n    /// Extends <see cref=\"EventSubscription{TPayload}\"/> to invoke the <see cref=\"EventSubscription{TPayload}.Action\"/> delegate in a background thread.\n    /// </summary>\n    /// <typeparam name=\"TPayload\">The type to use for the generic <see cref=\"System.Action{TPayload}\"/> and <see cref=\"Predicate{TPayload}\"/> types.</typeparam>\n    public class BackgroundEventSubscription<TPayload> : EventSubscription<TPayload>\n    {\n        /// <summary>\n        /// Creates a new instance of <see cref=\"BackgroundEventSubscription{TPayload}\"/>.\n        /// </summary>\n        /// <param name=\"actionReference\">A reference to a delegate of type <see cref=\"System.Action{TPayload}\"/>.</param>\n        /// <param name=\"filterReference\">A reference to a delegate of type <see cref=\"Predicate{TPayload}\"/>.</param>\n        /// <exception cref=\"ArgumentNullException\">When <paramref name=\"actionReference\"/> or <see paramref=\"filterReference\"/> are <see langword=\"null\" />.</exception>\n        /// <exception cref=\"ArgumentException\">When the target of <paramref name=\"actionReference\"/> is not of type <see cref=\"System.Action{TPayload}\"/>,\n        /// or the target of <paramref name=\"filterReference\"/> is not of type <see cref=\"Predicate{TPayload}\"/>.</exception>\n        public BackgroundEventSubscription(IDelegateReference actionReference, IDelegateReference filterReference)\n            : base(actionReference, filterReference)\n        {\n        }\n\n        /// <summary>\n        /// Invokes the specified <see cref=\"System.Action{TPayload}\"/> in an asynchronous thread by using a <see cref=\"System.Threading.ThreadPool\"/>.\n        /// </summary>\n        /// <param name=\"action\">The action to execute.</param>\n        /// <param name=\"argument\">The payload to pass <paramref name=\"action\"/> while invoking it.</param>\n        public override void InvokeAction(Action<TPayload> action, TPayload argument)\n        {\n            //ThreadPool.QueueUserWorkItem( (o) => action(argument) );\n            Task.Run(() => action(argument));\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Events/DataEventArgs.cs",
    "content": "\n\n\nusing System;\n\nnamespace Prism.Events\n{\n    /// <summary>\n    /// Generic arguments class to pass to event handlers that need to receive data.\n    /// </summary>\n    /// <typeparam name=\"TData\">The type of data to pass.</typeparam>\n    public class DataEventArgs<TData> : EventArgs\n    {\n        private readonly TData _value;\n\n        /// <summary>\n        /// Initializes the DataEventArgs class.\n        /// </summary>\n        /// <param name=\"value\">Information related to the event.</param>\n        public DataEventArgs(TData value)\n        {\n            _value = value;\n        }\n\n        /// <summary>\n        /// Gets the information related to the event.\n        /// </summary>\n        /// <value>Information related to the event.</value>\n        public TData Value\n        {\n            get { return _value; }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Events/DelegateReference.cs",
    "content": "\n\n\nusing System;\nusing System.Reflection;\n\nnamespace Prism.Events\n{\n    /// <summary>\n    /// Represents a reference to a <see cref=\"Delegate\"/> that may contain a\n    /// <see cref=\"WeakReference\"/> to the target. This class is used\n    /// internally by the Prism Library.\n    /// </summary>\n    public class DelegateReference : IDelegateReference\n    {\n        private readonly Delegate _delegate;\n        private readonly WeakReference _weakReference;\n        private readonly MethodInfo _method;\n        private readonly Type _delegateType;\n\n        /// <summary>\n        /// Initializes a new instance of <see cref=\"DelegateReference\"/>.\n        /// </summary>\n        /// <param name=\"delegate\">The original <see cref=\"Delegate\"/> to create a reference for.</param>\n        /// <param name=\"keepReferenceAlive\">If <see langword=\"false\" /> the class will create a weak reference to the delegate, allowing it to be garbage collected. Otherwise it will keep a strong reference to the target.</param>\n        /// <exception cref=\"ArgumentNullException\">If the passed <paramref name=\"delegate\"/> is not assignable to <see cref=\"Delegate\"/>.</exception>\n        public DelegateReference(Delegate @delegate, bool keepReferenceAlive)\n        {\n            if (@delegate == null)\n                throw new ArgumentNullException(\"delegate\");\n\n            if (keepReferenceAlive)\n            {\n                this._delegate = @delegate;\n            }\n            else\n            {\n                _weakReference = new WeakReference(@delegate.Target);\n                _method = @delegate.GetMethodInfo();\n                _delegateType = @delegate.GetType();\n            }\n        }\n\n        /// <summary>\n        /// Gets the <see cref=\"Delegate\" /> (the target) referenced by the current <see cref=\"DelegateReference\"/> object.\n        /// </summary>\n        /// <value><see langword=\"null\"/> if the object referenced by the current <see cref=\"DelegateReference\"/> object has been garbage collected; otherwise, a reference to the <see cref=\"Delegate\"/> referenced by the current <see cref=\"DelegateReference\"/> object.</value>\n        public Delegate Target\n        {\n            get\n            {\n                if (_delegate != null)\n                {\n                    return _delegate;\n                }\n                else\n                {\n                    return TryGetDelegate();\n                }\n            }\n        }\n\n        /// <summary>\n        /// Checks if the <see cref=\"Delegate\" /> (the target) referenced by the current <see cref=\"DelegateReference\"/> object are equal to another <see cref=\"Delegate\" />.\n        /// This is equivalent with comparing <see cref=\"Target\"/> with <paramref name=\"delegate\"/>, only more efficient.\n        /// </summary>\n        /// <param name=\"delegate\">The other delegate to compare with.</param>\n        /// <returns>True if the target referenced by the current object are equal to <paramref name=\"delegate\"/>.</returns>\n        public bool TargetEquals(Delegate @delegate)\n        {\n            if (_delegate != null)\n            {\n                return _delegate == @delegate;\n            }\n            if (@delegate == null)\n            {\n                return !_method.IsStatic && !_weakReference.IsAlive;\n            }\n            return _weakReference.Target == @delegate.Target && Equals(_method, @delegate.GetMethodInfo());\n        }\n\n        private Delegate TryGetDelegate()\n        {\n            if (_method.IsStatic)\n            {\n                return _method.CreateDelegate(_delegateType, null);\n            }\n            object target = _weakReference.Target;\n            if (target != null)\n            {\n                return _method.CreateDelegate(_delegateType, target);\n            }\n            return null;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Events/DispatcherEventSubscription.cs",
    "content": "using System;\nusing System.Threading;\n\nnamespace Prism.Events\n{\n    ///<summary>\n    /// Extends <see cref=\"EventSubscription\"/> to invoke the <see cref=\"EventSubscription.Action\"/> delegate\n    /// in a specific <see cref=\"SynchronizationContext\"/>.\n    ///</summary>\n    public class DispatcherEventSubscription : EventSubscription\n    {\n        private readonly SynchronizationContext syncContext;\n\n        ///<summary>\n        /// Creates a new instance of <see cref=\"BackgroundEventSubscription\"/>.\n        ///</summary>\n        ///<param name=\"actionReference\">A reference to a delegate of type <see cref=\"System.Action{TPayload}\"/>.</param>\n        ///<param name=\"context\">The synchronization context to use for UI thread dispatching.</param>\n        ///<exception cref=\"ArgumentNullException\">When <paramref name=\"actionReference\"/> or <see paramref=\"filterReference\"/> are <see langword=\"null\" />.</exception>\n        ///<exception cref=\"ArgumentException\">When the target of <paramref name=\"actionReference\"/> is not of type <see cref=\"System.Action{TPayload}\"/>.</exception>\n        public DispatcherEventSubscription(IDelegateReference actionReference, SynchronizationContext context)\n            : base(actionReference)\n        {\n            syncContext = context;\n        }\n\n        /// <summary>\n        /// Invokes the specified <see cref=\"System.Action{TPayload}\"/> asynchronously in the specified <see cref=\"SynchronizationContext\"/>.\n        /// </summary>\n        /// <param name=\"action\">The action to execute.</param>\n        protected override void InvokeAction(Action action)\n        {\n            syncContext.Post((o) => action(), null);\n        }\n    }\n\n    ///<summary>\n    /// Extends <see cref=\"EventSubscription{TPayload}\"/> to invoke the <see cref=\"EventSubscription{TPayload}.Action\"/> delegate\n    /// in a specific <see cref=\"SynchronizationContext\"/>.\n    ///</summary>\n    /// <typeparam name=\"TPayload\">The type to use for the generic <see cref=\"System.Action{TPayload}\"/> and <see cref=\"Predicate{TPayload}\"/> types.</typeparam>\n    public class DispatcherEventSubscription<TPayload> : EventSubscription<TPayload>\n    {\n        private readonly SynchronizationContext syncContext;\n\n        ///<summary>\n        /// Creates a new instance of <see cref=\"BackgroundEventSubscription{TPayload}\"/>.\n        ///</summary>\n        ///<param name=\"actionReference\">A reference to a delegate of type <see cref=\"System.Action{TPayload}\"/>.</param>\n        ///<param name=\"filterReference\">A reference to a delegate of type <see cref=\"Predicate{TPayload}\"/>.</param>\n        ///<param name=\"context\">The synchronization context to use for UI thread dispatching.</param>\n        ///<exception cref=\"ArgumentNullException\">When <paramref name=\"actionReference\"/> or <see paramref=\"filterReference\"/> are <see langword=\"null\" />.</exception>\n        ///<exception cref=\"ArgumentException\">When the target of <paramref name=\"actionReference\"/> is not of type <see cref=\"System.Action{TPayload}\"/>,\n        ///or the target of <paramref name=\"filterReference\"/> is not of type <see cref=\"Predicate{TPayload}\"/>.</exception>\n        public DispatcherEventSubscription(IDelegateReference actionReference, IDelegateReference filterReference, SynchronizationContext context)\n            : base(actionReference, filterReference)\n        {\n            syncContext = context;\n        }\n\n        /// <summary>\n        /// Invokes the specified <see cref=\"System.Action{TPayload}\"/> asynchronously in the specified <see cref=\"SynchronizationContext\"/>.\n        /// </summary>\n        /// <param name=\"action\">The action to execute.</param>\n        /// <param name=\"argument\">The payload to pass <paramref name=\"action\"/> while invoking it.</param>\n        public override void InvokeAction(Action<TPayload> action, TPayload argument)\n        {\n            syncContext.Post((o) => action((TPayload)o), argument);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Events/EventAggregator.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Threading;\n\nnamespace Prism.Events\n{\n    /// <summary>\n    /// Implements <see cref=\"IEventAggregator\"/>.\n    /// </summary>\n    public class EventAggregator : IEventAggregator\n    {\n        private static IEventAggregator _current;\n\n        /// <summary>\n        /// Gets or Sets the Current Instance of the <see cref=\"IEventAggregator\"/>\n        /// </summary>\n        public static IEventAggregator Current\n        {\n            get => _current ??= new EventAggregator();\n            set => _current = value;\n        }\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"EventAggregator\"/>\n        /// </summary>\n        public EventAggregator()\n        {\n            if(_current is null)\n            {\n                _current = this;\n            }\n        }\n\n        private readonly Dictionary<Type, EventBase> events = new Dictionary<Type, EventBase>();\n        // Captures the sync context for the UI thread when constructed on the UI thread\n        // in a platform agnostic way so it can be used for UI thread dispatching\n        private readonly SynchronizationContext syncContext = SynchronizationContext.Current;\n\n        /// <summary>\n        /// Gets the single instance of the event managed by this EventAggregator. Multiple calls to this method with the same <typeparamref name=\"TEventType\"/> returns the same event instance.\n        /// </summary>\n        /// <typeparam name=\"TEventType\">The type of event to get. This must inherit from <see cref=\"EventBase\"/>.</typeparam>\n        /// <returns>A singleton instance of an event object of type <typeparamref name=\"TEventType\"/>.</returns>\n        [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Design\", \"CA1004:GenericMethodsShouldProvideTypeParameter\")]\n        public TEventType GetEvent<TEventType>() where TEventType : EventBase, new()\n        {\n            lock (events)\n            {\n                EventBase existingEvent = null;\n\n                if (!events.TryGetValue(typeof(TEventType), out existingEvent))\n                {\n                    TEventType newEvent = new TEventType();\n                    newEvent.SynchronizationContext = syncContext;\n                    events[typeof(TEventType)] = newEvent;\n\n                    return newEvent;\n                }\n                else\n                {\n                    return (TEventType)existingEvent;\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Events/EventBase.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading;\n\nnamespace Prism.Events\n{\n    ///<summary>\n    /// Defines a base class to publish and subscribe to events.\n    ///</summary>\n    public abstract class EventBase\n    {\n        private readonly List<IEventSubscription> _subscriptions = new List<IEventSubscription>();\n\n        /// <summary>\n        /// Allows the SynchronizationContext to be set by the EventAggregator for UI Thread Dispatching\n        /// </summary>\n        public SynchronizationContext SynchronizationContext { get; set; }\n\n        /// <summary>\n        /// Gets the list of current subscriptions.\n        /// </summary>\n        /// <value>The current subscribers.</value>\n        protected ICollection<IEventSubscription> Subscriptions\n        {\n            get { return _subscriptions; }\n        }\n\n        /// <summary>\n        /// Adds the specified <see cref=\"IEventSubscription\"/> to the subscribers' collection.\n        /// </summary>\n        /// <param name=\"eventSubscription\">The subscriber.</param>\n        /// <returns>The <see cref=\"SubscriptionToken\"/> that uniquely identifies every subscriber.</returns>\n        /// <remarks>\n        /// Adds the subscription to the internal list and assigns it a new <see cref=\"SubscriptionToken\"/>.\n        /// </remarks>\n        protected virtual SubscriptionToken InternalSubscribe(IEventSubscription eventSubscription)\n        {\n            if (eventSubscription == null) throw new ArgumentNullException(nameof(eventSubscription));\n\n            eventSubscription.SubscriptionToken = new SubscriptionToken(Unsubscribe);\n\n            lock (Subscriptions)\n            {\n                Subscriptions.Add(eventSubscription);\n            }\n            return eventSubscription.SubscriptionToken;\n        }\n\n        /// <summary>\n        /// Calls all the execution strategies exposed by the list of <see cref=\"IEventSubscription\"/>.\n        /// </summary>\n        /// <param name=\"arguments\">The arguments that will be passed to the listeners.</param>\n        /// <remarks>Before executing the strategies, this class will prune all the subscribers from the\n        /// list that return a <see langword=\"null\" /> <see cref=\"Action{T}\"/> when calling the\n        /// <see cref=\"IEventSubscription.GetExecutionStrategy\"/> method.</remarks>\n        protected virtual void InternalPublish(params object[] arguments)\n        {\n            List<Action<object[]>> executionStrategies = PruneAndReturnStrategies();\n            foreach (var executionStrategy in executionStrategies)\n            {\n                executionStrategy(arguments);\n            }\n        }\n\n        /// <summary>\n        /// Removes the subscriber matching the <see cref=\"SubscriptionToken\"/>.\n        /// </summary>\n        /// <param name=\"token\">The <see cref=\"SubscriptionToken\"/> returned by <see cref=\"EventBase\"/> while subscribing to the event.</param>\n        public virtual void Unsubscribe(SubscriptionToken token)\n        {\n            lock (Subscriptions)\n            {\n                IEventSubscription subscription = Subscriptions.FirstOrDefault(evt => evt.SubscriptionToken == token);\n                if (subscription != null)\n                {\n                    Subscriptions.Remove(subscription);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Returns <see langword=\"true\"/> if there is a subscriber matching <see cref=\"SubscriptionToken\"/>.\n        /// </summary>\n        /// <param name=\"token\">The <see cref=\"SubscriptionToken\"/> returned by <see cref=\"EventBase\"/> while subscribing to the event.</param>\n        /// <returns><see langword=\"true\"/> if there is a <see cref=\"SubscriptionToken\"/> that matches; otherwise <see langword=\"false\"/>.</returns>\n        public virtual bool Contains(SubscriptionToken token)\n        {\n            lock (Subscriptions)\n            {\n                IEventSubscription subscription = Subscriptions.FirstOrDefault(evt => evt.SubscriptionToken == token);\n                return subscription != null;\n            }\n        }\n\n        private List<Action<object[]>> PruneAndReturnStrategies()\n        {\n            List<Action<object[]>> returnList = new List<Action<object[]>>();\n\n            lock (Subscriptions)\n            {\n                for (var i = Subscriptions.Count - 1; i >= 0; i--)\n                {\n                    Action<object[]> listItem =\n                        _subscriptions[i].GetExecutionStrategy();\n\n                    if (listItem == null)\n                    {\n                        // Prune from main list. Log?\n                        _subscriptions.RemoveAt(i);\n                    }\n                    else\n                    {\n                        returnList.Add(listItem);\n                    }\n                }\n            }\n\n            return returnList;\n        }\n\n        /// <summary>\n        /// Forces the PubSubEvent to remove any subscriptions that no longer have an execution strategy.\n        /// </summary>\n        public void Prune()\n        {\n            lock (Subscriptions)\n            {\n                for (var i = Subscriptions.Count - 1; i >= 0; i--)\n                {\n                    if (_subscriptions[i].GetExecutionStrategy() == null)\n                    {\n                        _subscriptions.RemoveAt(i);\n                    }\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Events/EventSubscription.cs",
    "content": "using System;\nusing System.Globalization;\nusing Prism.Events.Properties;\n\nnamespace Prism.Events\n{\n    /// <summary>\n    /// Provides a way to retrieve a <see cref=\"Delegate\"/> to execute an action depending\n    /// on the value of a second filter predicate that returns true if the action should execute.\n    /// </summary>\n    public class EventSubscription : IEventSubscription\n    {\n        private readonly IDelegateReference _actionReference;\n\n        ///<summary>\n        /// Creates a new instance of <see cref=\"EventSubscription\"/>.\n        ///</summary>\n        ///<param name=\"actionReference\">A reference to a delegate of type <see cref=\"System.Action\"/>.</param>\n        ///<exception cref=\"ArgumentNullException\">When <paramref name=\"actionReference\"/> or <see paramref=\"filterReference\"/> are <see langword=\"null\" />.</exception>\n        ///<exception cref=\"ArgumentException\">When the target of <paramref name=\"actionReference\"/> is not of type <see cref=\"System.Action\"/>.</exception>\n        public EventSubscription(IDelegateReference actionReference)\n        {\n            if (actionReference == null)\n                throw new ArgumentNullException(nameof(actionReference));\n            if (!(actionReference.Target is Action))\n                throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Resources.InvalidDelegateRerefenceTypeException, typeof(Action).FullName), nameof(actionReference));\n\n            _actionReference = actionReference;\n        }\n\n        /// <summary>\n        /// Gets the target <see cref=\"System.Action\"/> that is referenced by the <see cref=\"IDelegateReference\"/>.\n        /// </summary>\n        /// <value>An <see cref=\"System.Action\"/> or <see langword=\"null\" /> if the referenced target is not alive.</value>\n        public Action Action\n        {\n            get { return (Action)_actionReference.Target; }\n        }\n\n        /// <summary>\n        /// Gets or sets a <see cref=\"SubscriptionToken\"/> that identifies this <see cref=\"IEventSubscription\"/>.\n        /// </summary>\n        /// <value>A token that identifies this <see cref=\"IEventSubscription\"/>.</value>\n        public SubscriptionToken SubscriptionToken { get; set; }\n\n        /// <summary>\n        /// Gets the execution strategy to publish this event.\n        /// </summary>\n        /// <returns>An <see cref=\"System.Action\"/> with the execution strategy, or <see langword=\"null\" /> if the <see cref=\"IEventSubscription\"/> is no longer valid.</returns>\n        /// <remarks>\n        /// If <see cref=\"Action\"/>is no longer valid because it was\n        /// garbage collected, this method will return <see langword=\"null\" />.\n        /// Otherwise it will return a delegate that evaluates the <see cref=\"EventSubscription{TPayload}.Filter\"/> and if it\n        /// returns <see langword=\"true\" /> will then call <see cref=\"InvokeAction\"/>. The returned\n        /// delegate holds a hard reference to the <see cref=\"Action\"/> target\n        /// <see cref=\"Delegate\">delegates</see>. As long as the returned delegate is not garbage collected,\n        /// the <see cref=\"Action\"/> references delegates won't get collected either.\n        /// </remarks>\n        public virtual Action<object[]> GetExecutionStrategy()\n        {\n            Action action = this.Action;\n            if (action != null)\n            {\n                return arguments =>\n                {\n                    InvokeAction(action);\n                };\n            }\n            return null;\n        }\n\n        /// <summary>\n        /// Invokes the specified <see cref=\"System.Action{TPayload}\"/> synchronously when not overridden.\n        /// </summary>\n        /// <param name=\"action\">The action to execute.</param>\n        /// <exception cref=\"ArgumentNullException\">An <see cref=\"ArgumentNullException\"/> is thrown if <paramref name=\"action\"/> is null.</exception>\n        protected virtual void InvokeAction(Action action)\n        {\n            if (action == null) throw new ArgumentNullException(nameof(action));\n\n            action();\n        }\n    }\n\n    /// <summary>\n    /// Provides a way to retrieve a <see cref=\"Delegate\"/> to execute an action depending\n    /// on the value of a second filter predicate that returns true if the action should execute.\n    /// </summary>\n    /// <typeparam name=\"TPayload\">The type to use for the generic <see cref=\"System.Action{TPayload}\"/> and <see cref=\"Predicate{TPayload}\"/> types.</typeparam>\n    public class EventSubscription<TPayload> : IEventSubscription\n    {\n        private readonly IDelegateReference _actionReference;\n        private readonly IDelegateReference _filterReference;\n\n        ///<summary>\n        /// Creates a new instance of <see cref=\"EventSubscription{TPayload}\"/>.\n        ///</summary>\n        ///<param name=\"actionReference\">A reference to a delegate of type <see cref=\"System.Action{TPayload}\"/>.</param>\n        ///<param name=\"filterReference\">A reference to a delegate of type <see cref=\"Predicate{TPayload}\"/>.</param>\n        ///<exception cref=\"ArgumentNullException\">When <paramref name=\"actionReference\"/> or <see paramref=\"filterReference\"/> are <see langword=\"null\" />.</exception>\n        ///<exception cref=\"ArgumentException\">When the target of <paramref name=\"actionReference\"/> is not of type <see cref=\"System.Action{TPayload}\"/>,\n        ///or the target of <paramref name=\"filterReference\"/> is not of type <see cref=\"Predicate{TPayload}\"/>.</exception>\n        public EventSubscription(IDelegateReference actionReference, IDelegateReference filterReference)\n        {\n            if (actionReference == null)\n                throw new ArgumentNullException(nameof(actionReference));\n            if (!(actionReference.Target is Action<TPayload>))\n                throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Resources.InvalidDelegateRerefenceTypeException, typeof(Action<TPayload>).FullName), nameof(actionReference));\n\n            if (filterReference == null)\n                throw new ArgumentNullException(nameof(filterReference));\n            if (!(filterReference.Target is Predicate<TPayload>))\n                throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Resources.InvalidDelegateRerefenceTypeException, typeof(Predicate<TPayload>).FullName), nameof(filterReference));\n\n            _actionReference = actionReference;\n            _filterReference = filterReference;\n        }\n\n        /// <summary>\n        /// Gets the target <see cref=\"System.Action{T}\"/> that is referenced by the <see cref=\"IDelegateReference\"/>.\n        /// </summary>\n        /// <value>An <see cref=\"System.Action{T}\"/> or <see langword=\"null\" /> if the referenced target is not alive.</value>\n        public Action<TPayload> Action\n        {\n            get { return (Action<TPayload>)_actionReference.Target; }\n        }\n\n        /// <summary>\n        /// Gets the target <see cref=\"Predicate{T}\"/> that is referenced by the <see cref=\"IDelegateReference\"/>.\n        /// </summary>\n        /// <value>An <see cref=\"Predicate{T}\"/> or <see langword=\"null\" /> if the referenced target is not alive.</value>\n        public Predicate<TPayload> Filter\n        {\n            get { return (Predicate<TPayload>)_filterReference.Target; }\n        }\n\n        /// <summary>\n        /// Gets or sets a <see cref=\"SubscriptionToken\"/> that identifies this <see cref=\"IEventSubscription\"/>.\n        /// </summary>\n        /// <value>A token that identifies this <see cref=\"IEventSubscription\"/>.</value>\n        public SubscriptionToken SubscriptionToken { get; set; }\n\n        /// <summary>\n        /// Gets the execution strategy to publish this event.\n        /// </summary>\n        /// <returns>An <see cref=\"System.Action{T}\"/> with the execution strategy, or <see langword=\"null\" /> if the <see cref=\"IEventSubscription\"/> is no longer valid.</returns>\n        /// <remarks>\n        /// If <see cref=\"Action\"/> or <see cref=\"Filter\"/> are no longer valid because they were\n        /// garbage collected, this method will return <see langword=\"null\" />.\n        /// Otherwise it will return a delegate that evaluates the <see cref=\"Filter\"/> and if it\n        /// returns <see langword=\"true\" /> will then call <see cref=\"InvokeAction\"/>. The returned\n        /// delegate holds hard references to the <see cref=\"Action\"/> and <see cref=\"Filter\"/> target\n        /// <see cref=\"Delegate\">delegates</see>. As long as the returned delegate is not garbage collected,\n        /// the <see cref=\"Action\"/> and <see cref=\"Filter\"/> references delegates won't get collected either.\n        /// </remarks>\n        public virtual Action<object[]> GetExecutionStrategy()\n        {\n            Action<TPayload> action = this.Action;\n            Predicate<TPayload> filter = this.Filter;\n            if (action != null && filter != null)\n            {\n                return arguments =>\n                {\n                    TPayload argument = default(TPayload);\n                    if (arguments != null && arguments.Length > 0 && arguments[0] != null)\n                    {\n                        argument = (TPayload)arguments[0];\n                    }\n                    if (filter(argument))\n                    {\n                        InvokeAction(action, argument);\n                    }\n                };\n            }\n            return null;\n        }\n\n        /// <summary>\n        /// Invokes the specified <see cref=\"System.Action{TPayload}\"/> synchronously when not overridden.\n        /// </summary>\n        /// <param name=\"action\">The action to execute.</param>\n        /// <param name=\"argument\">The payload to pass <paramref name=\"action\"/> while invoking it.</param>\n        /// <exception cref=\"ArgumentNullException\">An <see cref=\"ArgumentNullException\"/> is thrown if <paramref name=\"action\"/> is null.</exception>\n        public virtual void InvokeAction(Action<TPayload> action, TPayload argument)\n        {\n            if (action == null) throw new ArgumentNullException(nameof(action));\n\n            action(argument);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Events/IDelegateReference.cs",
    "content": "\n\n\nusing System;\n\nnamespace Prism.Events\n{\n    /// <summary>\n    /// Represents a reference to a <see cref=\"Delegate\"/>.\n    /// </summary>\n    public interface IDelegateReference\n    {\n        /// <summary>\n        /// Gets the referenced <see cref=\"Delegate\" /> object.\n        /// </summary>\n        /// <value>A <see cref=\"Delegate\"/> instance if the target is valid; otherwise <see langword=\"null\"/>.</value>\n        Delegate Target { get; }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Events/IEventAggregator.cs",
    "content": "\n\n\n\nnamespace Prism.Events\n{\n    /// <summary>\n    /// Defines an interface to get instances of an event type.\n    /// </summary>\n    public interface IEventAggregator\n    {\n        /// <summary>\n        /// Gets an instance of an event type.\n        /// </summary>\n        /// <typeparam name=\"TEventType\">The type of event to get.</typeparam>\n        /// <returns>An instance of an event object of type <typeparamref name=\"TEventType\"/>.</returns>\n        [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Design\", \"CA1004:GenericMethodsShouldProvideTypeParameter\")]\n        TEventType GetEvent<TEventType>() where TEventType : EventBase, new();\n    }\n}\n"
  },
  {
    "path": "src/Prism.Events/IEventSubscription.cs",
    "content": "\n\n\nusing System;\n\nnamespace Prism.Events\n{\n    ///<summary>\n    /// Defines a contract for an event subscription to be used by <see cref=\"EventBase\"/>.\n    ///</summary>\n    public interface IEventSubscription\n    {\n        /// <summary>\n        /// Gets or sets a <see cref=\"SubscriptionToken\"/> that identifies this <see cref=\"IEventSubscription\"/>.\n        /// </summary>\n        /// <value>A token that identifies this <see cref=\"IEventSubscription\"/>.</value>\n        SubscriptionToken SubscriptionToken { get; set; }\n\n        /// <summary>\n        /// Gets the execution strategy to publish this event.\n        /// </summary>\n        /// <returns>An <see cref=\"Action{T}\"/> with the execution strategy, or <see langword=\"null\" /> if the <see cref=\"IEventSubscription\"/> is no longer valid.</returns>\n        [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Design\", \"CA1024:UsePropertiesWhereAppropriate\")]\n        Action<object[]> GetExecutionStrategy();\n    }\n}\n"
  },
  {
    "path": "src/Prism.Events/Prism.Events.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFrameworks>net462;net47;net8.0;net9.0;net10.0</TargetFrameworks>\n    <!-- Summary is not actually supported at this time. Including the summary for future support. -->\n    <!--<Summary>Prism provides an implementation of a collection of design patterns that are helpful in writing well structured and maintainable applications.</Summary>-->\n    <Description>Prism.Events is a library that facilitates communication between loosely coupled components in an application. It provides an event aggregator service that allows publishers and subscribers to interact through events without direct references. With multicast publish/subscribe functionality, multiple publishers can raise the same event, and multiple subscribers can listen to it, enabling flexible and efficient communication.</Description>\n    <PackageTags>prism;wpf;xamarin;dotnet maui;maui;uno;unoplatform;events;event aggregator;ieventaggregator;pubsubevent</PackageTags>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <Compile Update=\"Properties\\Resources.Designer.cs\" DesignTime=\"True\" AutoGen=\"True\" DependentUpon=\"Resources.resx\" />\n    <EmbeddedResource Update=\"Properties\\Resources.resx\" Generator=\"ResXFileCodeGenerator\" LastGenOutput=\"Resources.Designer.cs\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "src/Prism.Events/Properties/AssemblyInfo.cs",
    "content": "﻿using System;\n\n[assembly: CLSCompliant(true)]\n"
  },
  {
    "path": "src/Prism.Events/Properties/Resources.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.42000\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace Prism.Events.Properties {\n    using System;\n    \n    \n    /// <summary>\n    ///   A strongly-typed resource class, for looking up localized strings, etc.\n    /// </summary>\n    // This class was auto-generated by the StronglyTypedResourceBuilder\n    // class via a tool like ResGen or Visual Studio.\n    // To add or remove a member, edit your .ResX file then rerun ResGen\n    // with the /str option, or rebuild your VS project.\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"17.0.0.0\")]\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    internal class Resources {\n        \n        private static global::System.Resources.ResourceManager resourceMan;\n        \n        private static global::System.Globalization.CultureInfo resourceCulture;\n        \n        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        internal Resources() {\n        }\n        \n        /// <summary>\n        ///   Returns the cached ResourceManager instance used by this class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Resources.ResourceManager ResourceManager {\n            get {\n                if (object.ReferenceEquals(resourceMan, null)) {\n                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"Prism.Events.Properties.Resources\", typeof(Resources).Assembly);\n                    resourceMan = temp;\n                }\n                return resourceMan;\n            }\n        }\n        \n        /// <summary>\n        ///   Overrides the current thread's CurrentUICulture property for all\n        ///   resource lookups using this strongly typed resource class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Globalization.CultureInfo Culture {\n            get {\n                return resourceCulture;\n            }\n            set {\n                resourceCulture = value;\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to To use the UIThread option for subscribing, the EventAggregator must be constructed on the UI thread..\n        /// </summary>\n        internal static string EventAggregatorNotConstructedOnUIThread {\n            get {\n                return ResourceManager.GetString(\"EventAggregatorNotConstructedOnUIThread\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Invalid Delegate Reference Type Exception.\n        /// </summary>\n        internal static string InvalidDelegateRerefenceTypeException {\n            get {\n                return ResourceManager.GetString(\"InvalidDelegateRerefenceTypeException\", resourceCulture);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Events/Properties/Resources.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <data name=\"EventAggregatorNotConstructedOnUIThread\" xml:space=\"preserve\">\n    <value>To use the UIThread option for subscribing, the EventAggregator must be constructed on the UI thread.</value>\n  </data>\n  <data name=\"InvalidDelegateRerefenceTypeException\" xml:space=\"preserve\">\n    <value>Invalid Delegate Reference Type Exception</value>\n  </data>\n</root>"
  },
  {
    "path": "src/Prism.Events/PubSubEvent.cs",
    "content": "using System;\nusing System.Linq;\nusing Prism.Events.Properties;\n\nnamespace Prism.Events\n{\n    /// <summary>\n    /// Defines a class that manages publication and subscription to events.\n    /// </summary>\n    public class PubSubEvent : EventBase\n    {\n        /// <summary>\n        /// Subscribes a delegate to an event that will be published on the <see cref=\"ThreadOption.PublisherThread\"/>.\n        /// <see cref=\"PubSubEvent\"/> will maintain a <see cref=\"WeakReference\"/> to the target of the supplied <paramref name=\"action\"/> delegate.\n        /// </summary>\n        /// <param name=\"action\">The delegate that gets executed when the event is published.</param>\n        /// <returns>A <see cref=\"SubscriptionToken\"/> that uniquely identifies the added subscription.</returns>\n        /// <remarks>\n        /// The PubSubEvent collection is thread-safe.\n        /// </remarks>\n        public SubscriptionToken Subscribe(Action action)\n        {\n            return Subscribe(action, ThreadOption.PublisherThread);\n        }\n\n        /// <summary>\n        /// Subscribes a delegate to an event.\n        /// PubSubEvent will maintain a <see cref=\"WeakReference\"/> to the Target of the supplied <paramref name=\"action\"/> delegate.\n        /// </summary>\n        /// <param name=\"action\">The delegate that gets executed when the event is raised.</param>\n        /// <param name=\"threadOption\">Specifies on which thread to receive the delegate callback.</param>\n        /// <returns>A <see cref=\"SubscriptionToken\"/> that uniquely identifies the added subscription.</returns>\n        /// <remarks>\n        /// The PubSubEvent collection is thread-safe.\n        /// </remarks>\n        public SubscriptionToken Subscribe(Action action, ThreadOption threadOption)\n        {\n            return Subscribe(action, threadOption, false);\n        }\n\n        /// <summary>\n        /// Subscribes a delegate to an event that will be published on the <see cref=\"ThreadOption.PublisherThread\"/>.\n        /// </summary>\n        /// <param name=\"action\">The delegate that gets executed when the event is published.</param>\n        /// <param name=\"keepSubscriberReferenceAlive\">When <see langword=\"true\"/>, the <see cref=\"PubSubEvent\"/> keeps a reference to the subscriber so it does not get garbage collected.</param>\n        /// <returns>A <see cref=\"SubscriptionToken\"/> that uniquely identifies the added subscription.</returns>\n        /// <remarks>\n        /// If <paramref name=\"keepSubscriberReferenceAlive\"/> is set to <see langword=\"false\" />, <see cref=\"PubSubEvent\"/> will maintain a <see cref=\"WeakReference\"/> to the Target of the supplied <paramref name=\"action\"/> delegate.\n        /// If not using a WeakReference (<paramref name=\"keepSubscriberReferenceAlive\"/> is <see langword=\"true\" />), the user must explicitly call Unsubscribe for the event when disposing the subscriber in order to avoid memory leaks or unexpected behavior.\n        /// <para/>\n        /// The PubSubEvent collection is thread-safe.\n        /// </remarks>\n        public SubscriptionToken Subscribe(Action action, bool keepSubscriberReferenceAlive)\n        {\n            return Subscribe(action, ThreadOption.PublisherThread, keepSubscriberReferenceAlive);\n        }\n\n        /// <summary>\n        /// Subscribes a delegate to an event.\n        /// </summary>\n        /// <param name=\"action\">The delegate that gets executed when the event is published.</param>\n        /// <param name=\"threadOption\">Specifies on which thread to receive the delegate callback.</param>\n        /// <param name=\"keepSubscriberReferenceAlive\">When <see langword=\"true\"/>, the <see cref=\"PubSubEvent\"/> keeps a reference to the subscriber so it does not get garbage collected.</param>\n        /// <returns>A <see cref=\"SubscriptionToken\"/> that uniquely identifies the added subscription.</returns>\n        /// <remarks>\n        /// If <paramref name=\"keepSubscriberReferenceAlive\"/> is set to <see langword=\"false\" />, <see cref=\"PubSubEvent\"/> will maintain a <see cref=\"WeakReference\"/> to the Target of the supplied <paramref name=\"action\"/> delegate.\n        /// If not using a WeakReference (<paramref name=\"keepSubscriberReferenceAlive\"/> is <see langword=\"true\" />), the user must explicitly call Unsubscribe for the event when disposing the subscriber in order to avoid memory leaks or unexpected behavior.\n        /// <para/>\n        /// The PubSubEvent collection is thread-safe.\n        /// </remarks>\n        public virtual SubscriptionToken Subscribe(Action action, ThreadOption threadOption, bool keepSubscriberReferenceAlive)\n        {\n            IDelegateReference actionReference = new DelegateReference(action, keepSubscriberReferenceAlive);\n\n            EventSubscription subscription;\n            switch (threadOption)\n            {\n                case ThreadOption.PublisherThread:\n                    subscription = new EventSubscription(actionReference);\n                    break;\n                case ThreadOption.BackgroundThread:\n                    subscription = new BackgroundEventSubscription(actionReference);\n                    break;\n                case ThreadOption.UIThread:\n                    if (SynchronizationContext == null) throw new InvalidOperationException(Resources.EventAggregatorNotConstructedOnUIThread);\n                    subscription = new DispatcherEventSubscription(actionReference, SynchronizationContext);\n                    break;\n                default:\n                    subscription = new EventSubscription(actionReference);\n                    break;\n            }\n\n            return InternalSubscribe(subscription);\n        }\n\n        /// <summary>\n        /// Publishes the <see cref=\"PubSubEvent\"/>.\n        /// </summary>\n        public virtual void Publish()\n        {\n            InternalPublish();\n        }\n\n        /// <summary>\n        /// Removes the first subscriber matching <see cref=\"Action\"/> from the subscribers' list.\n        /// </summary>\n        /// <param name=\"subscriber\">The <see cref=\"Action\"/> used when subscribing to the event.</param>\n        public virtual void Unsubscribe(Action subscriber)\n        {\n            lock (Subscriptions)\n            {\n                IEventSubscription eventSubscription = Subscriptions.Cast<EventSubscription>().FirstOrDefault(evt => evt.Action == subscriber);\n                if (eventSubscription != null)\n                {\n                    Subscriptions.Remove(eventSubscription);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Returns <see langword=\"true\"/> if there is a subscriber matching <see cref=\"Action\"/>.\n        /// </summary>\n        /// <param name=\"subscriber\">The <see cref=\"Action\"/> used when subscribing to the event.</param>\n        /// <returns><see langword=\"true\"/> if there is an <see cref=\"Action\"/> that matches; otherwise <see langword=\"false\"/>.</returns>\n        public virtual bool Contains(Action subscriber)\n        {\n            IEventSubscription eventSubscription;\n            lock (Subscriptions)\n            {\n                eventSubscription = Subscriptions.Cast<EventSubscription>().FirstOrDefault(evt => evt.Action == subscriber);\n            }\n            return eventSubscription != null;\n        }\n    }\n\n    /// <summary>\n    /// Defines a class that manages publication and subscription to events.\n    /// </summary>\n    /// <typeparam name=\"TPayload\">The type of message that will be passed to the subscribers.</typeparam>\n    public class PubSubEvent<TPayload> : EventBase\n    {\n        /// <summary>\n        /// Subscribes a delegate to an event that will be published on the <see cref=\"ThreadOption.PublisherThread\"/>.\n        /// <see cref=\"PubSubEvent{TPayload}\"/> will maintain a <see cref=\"WeakReference\"/> to the target of the supplied <paramref name=\"action\"/> delegate.\n        /// </summary>\n        /// <param name=\"action\">The delegate that gets executed when the event is published.</param>\n        /// <returns>A <see cref=\"SubscriptionToken\"/> that uniquely identifies the added subscription.</returns>\n        /// <remarks>\n        /// The PubSubEvent collection is thread-safe.\n        /// </remarks>\n        public SubscriptionToken Subscribe(Action<TPayload> action)\n        {\n            return Subscribe(action, ThreadOption.PublisherThread);\n        }\n\n        /// <summary>\n        /// Subscribes a delegate to an event that will be published on the <see cref=\"ThreadOption.PublisherThread\"/>\n        /// </summary>\n        /// <param name=\"action\">The delegate that gets executed when the event is raised.</param>\n        /// <param name=\"filter\">Filter to evaluate if the subscriber should receive the event.</param>\n        /// <returns>A <see cref=\"SubscriptionToken\"/> that uniquely identifies the added subscription.</returns>\n        public virtual SubscriptionToken Subscribe(Action<TPayload> action, Predicate<TPayload> filter)\n        {\n            return Subscribe(action, ThreadOption.PublisherThread, false, filter);\n        }\n\n        /// <summary>\n        /// Subscribes a delegate to an event.\n        /// PubSubEvent will maintain a <see cref=\"WeakReference\"/> to the Target of the supplied <paramref name=\"action\"/> delegate.\n        /// </summary>\n        /// <param name=\"action\">The delegate that gets executed when the event is raised.</param>\n        /// <param name=\"threadOption\">Specifies on which thread to receive the delegate callback.</param>\n        /// <returns>A <see cref=\"SubscriptionToken\"/> that uniquely identifies the added subscription.</returns>\n        /// <remarks>\n        /// The PubSubEvent collection is thread-safe.\n        /// </remarks>\n        public SubscriptionToken Subscribe(Action<TPayload> action, ThreadOption threadOption)\n        {\n            return Subscribe(action, threadOption, false);\n        }\n\n        /// <summary>\n        /// Subscribes a delegate to an event that will be published on the <see cref=\"ThreadOption.PublisherThread\"/>.\n        /// </summary>\n        /// <param name=\"action\">The delegate that gets executed when the event is published.</param>\n        /// <param name=\"keepSubscriberReferenceAlive\">When <see langword=\"true\"/>, the <see cref=\"PubSubEvent{TPayload}\"/> keeps a reference to the subscriber so it does not get garbage collected.</param>\n        /// <returns>A <see cref=\"SubscriptionToken\"/> that uniquely identifies the added subscription.</returns>\n        /// <remarks>\n        /// If <paramref name=\"keepSubscriberReferenceAlive\"/> is set to <see langword=\"false\" />, <see cref=\"PubSubEvent{TPayload}\"/> will maintain a <see cref=\"WeakReference\"/> to the Target of the supplied <paramref name=\"action\"/> delegate.\n        /// If not using a WeakReference (<paramref name=\"keepSubscriberReferenceAlive\"/> is <see langword=\"true\" />), the user must explicitly call Unsubscribe for the event when disposing the subscriber in order to avoid memory leaks or unexpected behavior.\n        /// <para/>\n        /// The PubSubEvent collection is thread-safe.\n        /// </remarks>\n        public SubscriptionToken Subscribe(Action<TPayload> action, bool keepSubscriberReferenceAlive)\n        {\n            return Subscribe(action, ThreadOption.PublisherThread, keepSubscriberReferenceAlive);\n        }\n\n        /// <summary>\n        /// Subscribes a delegate to an event.\n        /// </summary>\n        /// <param name=\"action\">The delegate that gets executed when the event is published.</param>\n        /// <param name=\"threadOption\">Specifies on which thread to receive the delegate callback.</param>\n        /// <param name=\"keepSubscriberReferenceAlive\">When <see langword=\"true\"/>, the <see cref=\"PubSubEvent{TPayload}\"/> keeps a reference to the subscriber so it does not get garbage collected.</param>\n        /// <returns>A <see cref=\"SubscriptionToken\"/> that uniquely identifies the added subscription.</returns>\n        /// <remarks>\n        /// If <paramref name=\"keepSubscriberReferenceAlive\"/> is set to <see langword=\"false\" />, <see cref=\"PubSubEvent{TPayload}\"/> will maintain a <see cref=\"WeakReference\"/> to the Target of the supplied <paramref name=\"action\"/> delegate.\n        /// If not using a WeakReference (<paramref name=\"keepSubscriberReferenceAlive\"/> is <see langword=\"true\" />), the user must explicitly call Unsubscribe for the event when disposing the subscriber in order to avoid memory leaks or unexpected behavior.\n        /// <para/>\n        /// The PubSubEvent collection is thread-safe.\n        /// </remarks>\n        public SubscriptionToken Subscribe(Action<TPayload> action, ThreadOption threadOption, bool keepSubscriberReferenceAlive)\n        {\n            return Subscribe(action, threadOption, keepSubscriberReferenceAlive, null);\n        }\n\n        /// <summary>\n        /// Subscribes a delegate to an event.\n        /// </summary>\n        /// <param name=\"action\">The delegate that gets executed when the event is published.</param>\n        /// <param name=\"threadOption\">Specifies on which thread to receive the delegate callback.</param>\n        /// <param name=\"keepSubscriberReferenceAlive\">When <see langword=\"true\"/>, the <see cref=\"PubSubEvent{TPayload}\"/> keeps a reference to the subscriber so it does not get garbage collected.</param>\n        /// <param name=\"filter\">Filter to evaluate if the subscriber should receive the event.</param>\n        /// <returns>A <see cref=\"SubscriptionToken\"/> that uniquely identifies the added subscription.</returns>\n        /// <remarks>\n        /// If <paramref name=\"keepSubscriberReferenceAlive\"/> is set to <see langword=\"false\" />, <see cref=\"PubSubEvent{TPayload}\"/> will maintain a <see cref=\"WeakReference\"/> to the Target of the supplied <paramref name=\"action\"/> delegate.\n        /// If not using a WeakReference (<paramref name=\"keepSubscriberReferenceAlive\"/> is <see langword=\"true\" />), the user must explicitly call Unsubscribe for the event when disposing the subscriber in order to avoid memory leaks or unexpected behavior.\n        ///\n        /// The PubSubEvent collection is thread-safe.\n        /// </remarks>\n        public virtual SubscriptionToken Subscribe(Action<TPayload> action, ThreadOption threadOption, bool keepSubscriberReferenceAlive, Predicate<TPayload> filter)\n        {\n            IDelegateReference actionReference = new DelegateReference(action, keepSubscriberReferenceAlive);\n            IDelegateReference filterReference;\n            if (filter != null)\n            {\n                filterReference = new DelegateReference(filter, keepSubscriberReferenceAlive);\n            }\n            else\n            {\n                filterReference = new DelegateReference(new Predicate<TPayload>(delegate { return true; }), true);\n            }\n            EventSubscription<TPayload> subscription;\n            switch (threadOption)\n            {\n                case ThreadOption.PublisherThread:\n                    subscription = new EventSubscription<TPayload>(actionReference, filterReference);\n                    break;\n                case ThreadOption.BackgroundThread:\n                    subscription = new BackgroundEventSubscription<TPayload>(actionReference, filterReference);\n                    break;\n                case ThreadOption.UIThread:\n                    if (SynchronizationContext == null) throw new InvalidOperationException(Resources.EventAggregatorNotConstructedOnUIThread);\n                    subscription = new DispatcherEventSubscription<TPayload>(actionReference, filterReference, SynchronizationContext);\n                    break;\n                default:\n                    subscription = new EventSubscription<TPayload>(actionReference, filterReference);\n                    break;\n            }\n\n            return InternalSubscribe(subscription);\n        }\n\n        /// <summary>\n        /// Publishes the <see cref=\"PubSubEvent{TPayload}\"/>.\n        /// </summary>\n        /// <param name=\"payload\">Message to pass to the subscribers.</param>\n        public virtual void Publish(TPayload payload)\n        {\n            InternalPublish(payload);\n        }\n\n        /// <summary>\n        /// Removes the first subscriber matching <see cref=\"Action{TPayload}\"/> from the subscribers' list.\n        /// </summary>\n        /// <param name=\"subscriber\">The <see cref=\"Action{TPayload}\"/> used when subscribing to the event.</param>\n        public virtual void Unsubscribe(Action<TPayload> subscriber)\n        {\n            lock (Subscriptions)\n            {\n                IEventSubscription eventSubscription = Subscriptions.Cast<EventSubscription<TPayload>>().FirstOrDefault(evt => evt.Action == subscriber);\n                if (eventSubscription != null)\n                {\n                    Subscriptions.Remove(eventSubscription);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Returns <see langword=\"true\"/> if there is a subscriber matching <see cref=\"Action{TPayload}\"/>.\n        /// </summary>\n        /// <param name=\"subscriber\">The <see cref=\"Action{TPayload}\"/> used when subscribing to the event.</param>\n        /// <returns><see langword=\"true\"/> if there is an <see cref=\"Action{TPayload}\"/> that matches; otherwise <see langword=\"false\"/>.</returns>\n        public virtual bool Contains(Action<TPayload> subscriber)\n        {\n            IEventSubscription eventSubscription;\n            lock (Subscriptions)\n            {\n                eventSubscription = Subscriptions.Cast<EventSubscription<TPayload>>().FirstOrDefault(evt => evt.Action == subscriber);\n            }\n            return eventSubscription != null;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Events/SubscriptionToken.cs",
    "content": "using System;\n\nnamespace Prism.Events\n{\n    /// <summary>\n    /// Subscription token returned from <see cref=\"EventBase\"/> on subscribe.\n    /// </summary>\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Design\", \"CA1063:ImplementIDisposableCorrectly\", Justification = \"Should never have a need for a finalizer, hence no need for Dispose(bool)\")]\n    public class SubscriptionToken : IEquatable<SubscriptionToken>, IDisposable\n    {\n        private readonly Guid _token;\n        private Action<SubscriptionToken> _unsubscribeAction;\n\n        /// <summary>\n        /// Initializes a new instance of <see cref=\"SubscriptionToken\"/>.\n        /// </summary>\n        public SubscriptionToken(Action<SubscriptionToken> unsubscribeAction)\n        {\n            _unsubscribeAction = unsubscribeAction;\n            _token = Guid.NewGuid();\n        }\n\n        ///<summary>\n        ///Indicates whether the current object is equal to another object of the same type.\n        ///</summary>\n        ///<returns>\n        ///<see langword=\"true\"/> if the current object is equal to the <paramref name=\"other\" /> parameter; otherwise, <see langword=\"false\"/>.\n        ///</returns>\n        ///<param name=\"other\">An object to compare with this object.</param>\n        public bool Equals(SubscriptionToken other)\n        {\n            if (other == null) return false;\n            return Equals(_token, other._token);\n        }\n\n        ///<summary>\n        ///Determines whether the specified <see cref=\"T:System.Object\" /> is equal to the current <see cref=\"T:System.Object\" />.\n        ///</summary>\n        ///<returns>\n        ///true if the specified <see cref=\"T:System.Object\" /> is equal to the current <see cref=\"T:System.Object\" />; otherwise, false.\n        ///</returns>\n        ///<param name=\"obj\">The <see cref=\"T:System.Object\" /> to compare with the current <see cref=\"T:System.Object\" />. </param>\n        ///<exception cref=\"T:System.NullReferenceException\">The <paramref name=\"obj\" /> parameter is null.</exception><filterpriority>2</filterpriority>\n        public override bool Equals(object obj)\n        {\n            if (ReferenceEquals(this, obj)) return true;\n            return Equals(obj as SubscriptionToken);\n        }\n\n        /// <summary>\n        /// Serves as a hash function for a particular type. \n        /// </summary>\n        /// <returns>\n        /// A hash code for the current <see cref=\"T:System.Object\" />.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        public override int GetHashCode()\n        {\n            return _token.GetHashCode();\n        }\n\n        /// <summary>\n        /// Disposes the SubscriptionToken, removing the subscription from the corresponding <see cref=\"EventBase\"/>.\n        /// </summary>\n        [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Design\", \"CA1063:ImplementIDisposableCorrectly\", Justification = \"Should never have need for a finalizer, hence no need for Dispose(bool).\")]\n        public virtual void Dispose()\n        {\n            // While the SubscriptionToken class implements IDisposable, in the case of weak subscriptions \n            // (i.e. keepSubscriberReferenceAlive set to false in the Subscribe method) it's not necessary to unsubscribe,\n            // as no resources should be kept alive by the event subscription. \n            // In such cases, if a warning is issued, it could be suppressed.\n\n            if (this._unsubscribeAction != null)\n            {\n                this._unsubscribeAction(this);\n                this._unsubscribeAction = null;\n            }\n\n            GC.SuppressFinalize(this);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Events/ThreadOption.cs",
    "content": "\n\n\n\nnamespace Prism.Events\n{\n    /// <summary>\n    /// Specifies on which thread a <see cref=\"PubSubEvent{TPayload}\"/> subscriber will be called.\n    /// </summary>\n    public enum ThreadOption\n    {\n        /// <summary>\n        /// The call is done on the same thread on which the <see cref=\"PubSubEvent{TPayload}\"/> was published.\n        /// </summary>\n        PublisherThread,\n\n        /// <summary>\n        /// The call is done on the UI thread.\n        /// </summary>\n        UIThread,\n\n        /// <summary>\n        /// The call is done asynchronously on a background thread.\n        /// </summary>\n        BackgroundThread\n    }\n}\n"
  },
  {
    "path": "src/Prism.Events/WeakDelegatesManager.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Prism.Events\n{\n    /// <summary>\n    /// Manage delegates using weak references to prevent keeping target instances longer than expected.\n    /// </summary>\n    public class WeakDelegatesManager\n    {\n        private readonly List<DelegateReference> _listeners = new List<DelegateReference>();\n\n        /// <summary>\n        /// Adds a weak reference to the specified <see cref=\"Delegate\"/> listener.\n        /// </summary>\n        /// <param name=\"listener\">The original <see cref=\"Delegate\"/> to add.</param>\n        public void AddListener(Delegate listener)\n        {\n            _listeners.Add(new DelegateReference(listener, false));\n        }\n\n        /// <summary>\n        /// Removes the weak reference to the specified <see cref=\"Delegate\"/> listener.\n        /// </summary>\n        /// <param name=\"listener\">The original <see cref=\"Delegate\"/> to remove.</param>\n        public void RemoveListener(Delegate listener)\n        {\n            //Remove the listener, and prune collected listeners\n            _listeners.RemoveAll(reference => reference.TargetEquals(null) || reference.TargetEquals(listener));\n        }\n\n        /// <summary>\n        /// Invoke the delegates for all targets still being alive.\n        /// </summary>\n        /// <param name=\"args\">An array of objects that are the arguments to pass to the delegates. -or- null, if the method represented by the delegate does not require arguments. </param>\n        public void Raise(params object[] args)\n        {\n            _listeners.RemoveAll(listener => listener.TargetEquals(null));\n\n            foreach (Delegate handler in _listeners.Select(listener => listener.Target).Where(listener => listener != null).ToList())\n            {\n                handler.DynamicInvoke(args);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Prism.Events/build/Package.targets",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<Project>\n  <ItemGroup Condition=\" '$(ImplicitUsings)' == 'true' OR '$(ImplicitUsings)' == 'enable' \">\n    <Using Include=\"Prism.Events\" />\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": "src/ReadMe.md",
    "content": "\n\n# Prism Licensing Update\n\nHello and thank you for using **Prism**!\n\nPrism’s licensing terms have recently changed. It's essential to understand and abide by these changes before continuing to use our software.\n\n## Licensing Options:\n\n### Prism Community License\nFor customers that qualify for the Community License, Prism can be used free of charge.\n\nThis license is available to those who:\n* Have an annual gross revenue of less than one (1) million U.S. dollars ($1,000,000.00 USD) per year.\n* Have less than five (5) total developers.\n* Have never received more than $3 million USD in capital from outside sources, such as private equity or venture capital.\n\n*Note*: To use Prism under the Community License, you must also agree to be bound by Prism's terms and conditions.\n\n### Prism Commercial License \nFor customers who do not qualify for the community license, a Commercial License must be purchased.\n\nTo explore our commercial licensing options, visit the [Prism Library website](https://prismlibrary.com/).\n\n## Important Reminders:\nYou **cannot** use this product without:\n1. Possessing either a Community License or a Commercial License.\n2. Agreeing and abiding by Prism's license containing all terms and conditions.\n\nTo view the full Prism license containing the terms and conditions, please visit [this link](https://cdn.prismlibrary.com/downloads/prism_license.pdf).\n\n## How to Purchase Your License:\n1. Determine if you qualify for the Prism Community License by reviewing the criteria above.\n2. If you qualify, make sure to read, understand, and agree to Prism's terms and conditions found in the [Prism License](https://cdn.prismlibrary.com/downloads/prism_license.pdf).\n3. If you do not qualify for the Community License, visit the [Prism Library website](https://prismlibrary.com/) for commercial licensing options and further instructions.\n\nThank you for your attention to this matter. We're committed to delivering the best experience with Prism and appreciate your understanding and cooperation.\n\nIf you have any questions, please don't hesitate to reach out to our support team at support@prismlibrary.com.\n\nBest Regards,\n\nThe Prism Team\n"
  },
  {
    "path": "src/Uno/Prism.DryIoc.Uno/LinkerDefinition.mono.xml",
    "content": "﻿<linker>\n  <assembly fullname=\"DryIoc\" />\n  <assembly fullname=\"Prism.DryIoc.Uno\" />\n</linker>"
  },
  {
    "path": "src/Uno/Prism.DryIoc.Uno/Prism.DryIoc.Uno.WinUI.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project Sdk=\"Uno.Sdk\">\n  <PropertyGroup>\n    <TargetFrameworks>$(UnoTargetFrameworks)</TargetFrameworks>\n    <OutputType>Library</OutputType>\n    <NoWarn>$(NoWarn);1591</NoWarn>\n    <AssemblyName>Prism.DryIoc.Uno</AssemblyName>\n    <PackageId>Prism.DryIoc.Uno.WinUI</PackageId>\n    <ImplicitUsings>enable</ImplicitUsings>\n\n    <!--\n    Library layout generation is disabled as this project does not have any XAML files, and\n    that if set to true, there is a nuget issue where Uno.Prism PRI resource get incorrectly\n    propagated to their dependents.\n    -->\n    <GenerateLibraryLayout>false</GenerateLibraryLayout>\n    <Description>Use these extensions to build apps for Uno Platform, UWP, &amp; WinUI using Prism with the DryIoc Container.\n\nPrism provides an implementation of a collection of design patterns that are helpful in writing well structured and maintainable XAML applications, including MVVM, dependency injection, commanding, event aggregation, and more. Prism's core functionality is a shared library targeting the .NET Framework and .NET. Features that need to be platform specific are implemented in the respective libraries for the target platform (WPF, Uno Platform, .NET MAUI and Xamarin Forms). Prism for Uno Platform helps you more easily design and build rich, flexible, and easy to maintain Windows UWP, WinUI &amp; cross platform Uno applications.</Description>\n    <PackageTags>prism;winui;windows;uno;mvvm;uwp;ios;android;macos;webassembly;linux;xaml;dryioc</PackageTags>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <Using Include=\"Microsoft.Extensions.DependencyInjection\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <None Include=\"build\\*.targets\" Pack=\"true\" PackagePath=\"buildTransitive\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Prism.Container.DryIoc\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <Compile Include=\"..\\..\\Wpf\\Prism.DryIoc.Wpf\\**\\*.cs\" Exclude=\"..\\..\\Wpf\\Prism.DryIoc.Wpf\\bin\\**\\*.cs;..\\..\\Wpf\\Prism.DryIoc.Wpf\\obj\\**\\*.cs\" />\n    <EmbeddedResource Include=\"..\\..\\Wpf\\Prism.Unity.Wpf\\Properties\\**\\*.resx\" Link=\"Properties\\%(FileName)%(Extension)\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Remove=\"..\\..\\Wpf\\Prism.DryIoc.Wpf\\Legacy\\DryIocBootstrapper.cs\" />\n    <Compile Remove=\"..\\..\\Wpf\\Prism.DryIoc.Wpf\\Legacy\\DryIocExtensions.cs\" />\n    <Compile Remove=\"..\\..\\Wpf\\Prism.DryIoc.Wpf\\PrismBootstrapper.cs\" />\n    <Compile Remove=\"..\\..\\Wpf\\Prism.DryIoc.Wpf\\Properties\\AssemblyInfo.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Prism.Uno\\Prism.Uno.WinUI.csproj\" />\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": "src/Uno/Prism.DryIoc.Uno/build/Package.targets",
    "content": "<Project>\n  <ItemGroup Condition=\" '$(ImplicitUsings)' == 'true' OR '$(ImplicitUsings)' == 'enable' \">\n    <Using Include=\"DryIoc\" />\n    <Using Include=\"Prism.DryIoc\" />\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": "src/Uno/Prism.Uno/Common/BindingOperations.cs",
    "content": "﻿namespace Prism;\n\ninternal static class BindingOperations\n{\n    public static BindingExpression GetBinding(FrameworkElement instance, DependencyProperty property) =>\n        instance.GetBindingExpression(property);\n}\n"
  },
  {
    "path": "src/Uno/Prism.Uno/Common/DesignerProperties.cs",
    "content": "namespace Prism;\n\ninternal static class DesignerProperties\n{\n    public static bool GetIsInDesignMode(DependencyObject _) =>\n        Windows.ApplicationModel.DesignMode.DesignModeEnabled;\n}\n"
  },
  {
    "path": "src/Uno/Prism.Uno/Dialogs/DialogService.cs",
    "content": "﻿using Microsoft.UI.Xaml;\nusing Microsoft.UI.Xaml.Controls;\nusing Prism.Common;\nusing Prism.Ioc;\nusing Windows.Foundation;\n\n#nullable enable\nnamespace Prism.Dialogs\n{\n    public class DialogService : IDialogService\n    {\n        private readonly IContainerProvider _containerProvider;\n\n        public DialogService(IContainerProvider containerProvider)\n        {\n            _containerProvider = containerProvider;\n        }\n\n        public async void ShowDialog(string name, IDialogParameters parameters, DialogCallback callback)\n        {\n            try\n            {\n                parameters ??= new DialogParameters();\n                var windowName = parameters.TryGetValue<string>(KnownDialogParameters.WindowName, out var wName) ? wName : null;\n\n                var dialogWindow = CreateDialogWindow(windowName);\n                if (dialogWindow is ContentDialog contentDialog)\n                {\n                    contentDialog.XamlRoot = _containerProvider.Resolve<Window>().Content.XamlRoot;\n                }\n                ConfigureDialogWindowEvents(dialogWindow, callback);\n                ConfigureDialogWindowContent(name, dialogWindow, parameters);\n\n                var placement = parameters.ContainsKey(KnownDialogParameters.DialogPlacement) ?\n                    (parameters[KnownDialogParameters.DialogPlacement] is ContentDialogPlacement placementValue ? placementValue : Enum.Parse<ContentDialogPlacement>(parameters[KnownDialogParameters.DialogPlacement].ToString() ?? string.Empty)) : ContentDialogPlacement.Popup;\n\n                await dialogWindow.ShowAsync(placement);\n            }\n            catch (Exception ex)\n            {\n                var str = ex.ToString();\n                await callback.Invoke(ex);\n            }\n        }\n\n        IDialogWindow CreateDialogWindow(string? name)\n        {\n            if (string.IsNullOrWhiteSpace(name))\n                return _containerProvider.Resolve<IDialogWindow>();\n            else\n                return _containerProvider.Resolve<IDialogWindow>(name);\n        }\n\n        void ConfigureDialogWindowContent(string dialogName, IDialogWindow window, IDialogParameters parameters)\n        {\n            var content = _containerProvider.Resolve<object>(dialogName);\n            if (content is not FrameworkElement dialogContent)\n            {\n                throw new NullReferenceException(\"A dialog's content must be a FrameworkElement\");\n            }\n\n            MvvmHelpers.AutowireViewModel(content);\n\n            if (dialogContent.DataContext is not IDialogAware viewModel)\n            {\n                throw new NullReferenceException($\"A dialog's ViewModel must implement the IDialogAware interface ({dialogContent.DataContext})\");\n            }\n\n            DialogService.ConfigureDialogWindowProperties(window, dialogContent, viewModel);\n\n            MvvmHelpers.ViewAndViewModelAction<IDialogAware>(viewModel, d => d.OnDialogOpened(parameters));\n        }\n\n        void ConfigureDialogWindowEvents(IDialogWindow contentDialog, DialogCallback callback)\n        {\n            IDialogResult? result = null;\n\n            void RequestCloseHandler(IDialogResult r)\n            {\n                result = r ?? new DialogResult();\n                contentDialog.Hide();\n            }\n\n            RoutedEventHandler loadedHandler = null!;\n            loadedHandler = (o, e) =>\n            {\n                contentDialog.Loaded -= loadedHandler;\n\n                if (contentDialog.DataContext is IDialogAware dialogAware)\n                {\n                    DialogUtilities.InitializeListener(dialogAware, RequestCloseHandler);\n                }\n            };\n\n            contentDialog.Loaded += loadedHandler;\n\n            void ClosingHandler(ContentDialog o, ContentDialogClosingEventArgs e)\n            {\n                if (contentDialog.DataContext is IDialogAware dialogAware\n                    && !dialogAware.CanCloseDialog())\n                {\n                    e.Cancel = true;\n                }\n            }\n\n            contentDialog.Closing += ClosingHandler;\n\n            TypedEventHandler<ContentDialog, ContentDialogClosedEventArgs> closedHandler = null!;\n            closedHandler = async (o, e) =>\n            {\n                contentDialog.Closed -= closedHandler;\n                contentDialog.Closing -= ClosingHandler;\n\n                if (contentDialog.DataContext is IDialogAware dialogAware)\n                {\n                    dialogAware.OnDialogClosed();\n                }\n\n                result ??= new DialogResult();\n\n                await callback.Invoke(result);\n\n                contentDialog.DataContext = null;\n                contentDialog.Content = null;\n            };\n            contentDialog.Closed += closedHandler;\n        }\n\n        private static void ConfigureDialogWindowProperties(IDialogWindow window, FrameworkElement dialogContent, IDialogAware viewModel)\n        {\n            var windowStyle = Dialog.GetWindowStyle(dialogContent);\n            if (windowStyle != null)\n                window.Style = windowStyle;\n\n            window.Content = dialogContent;\n            window.DataContext = viewModel;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Uno/Prism.Uno/Dialogs/DialogWindow.xaml",
    "content": "﻿<ContentDialog x:Class=\"Prism.Dialogs.DialogWindow\"\n               xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n               xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n               xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n               xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n               mc:Ignorable=\"d\"\n               Title=\"{Binding Title}\">\n\n</ContentDialog>\n"
  },
  {
    "path": "src/Uno/Prism.Uno/Dialogs/DialogWindow.xaml.cs",
    "content": "﻿using Microsoft.UI.Xaml;\nusing Microsoft.UI.Xaml.Controls;\nusing Windows.Foundation;\n\n#nullable enable\nnamespace Prism.Dialogs\n{\n    /// <summary>\n    /// Prism's default dialog host.\n    /// </summary>\n    public partial class DialogWindow : ContentDialog, IDialogWindow\n    {\n        public DialogWindow()\n        {\n            this.InitializeComponent();\n        }\n        public IDialogResult? Result { get; set; }\n\n        event RoutedEventHandler IDialogWindow.Loaded\n        {\n            add => Loaded += value;\n            remove => Loaded -= value;\n        }\n\n        event TypedEventHandler<ContentDialog, ContentDialogClosingEventArgs> IDialogWindow.Closing\n        {\n            add => Closing += value;\n            remove => Closing -= value;\n        }\n\n        event TypedEventHandler<ContentDialog, ContentDialogClosedEventArgs> IDialogWindow.Closed\n        {\n            add => Closed += value;\n            remove => Closed -= value;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Uno/Prism.Uno/Dialogs/IDialogWindow.cs",
    "content": "using Microsoft.UI.Xaml;\nusing Microsoft.UI.Xaml.Controls;\nusing Windows.Foundation;\n\n#nullable enable\nnamespace Prism.Dialogs\n{\n    public interface IDialogWindow\n    {\n        object? DataContext { get; set; }\n\n        Style Style { get; set; }\n\n        event RoutedEventHandler Loaded;\n\n        event TypedEventHandler<ContentDialog, ContentDialogClosingEventArgs> Closing;\n        event TypedEventHandler<ContentDialog, ContentDialogClosedEventArgs> Closed;\n\n        IDialogResult? Result { get; set; }\n\n        object? Content { get; set; }\n\n        IAsyncOperation<ContentDialogResult> ShowAsync(ContentDialogPlacement placement);\n\n        void Hide();\n    }\n}\n"
  },
  {
    "path": "src/Uno/Prism.Uno/Extensions/DependencyObjectExtensions.Uno.cs",
    "content": "using System.Runtime.InteropServices;\n\nnamespace Prism;\n\ninternal static partial class DependencyObjectExtensions\n{\n#if UNO_WASM\n    // Related to :\n    // https://github.com/dotnet/runtime/issues/76959\n    // https://github.com/unoplatform/uno/blob/56d3f6ece16b2dba51776e95a3c847c9c4b68e8b/src/Uno.UI.Dispatching/Core/CoreDispatcher.wasm.cs#L17\n    private static bool IsWebAssemblyThreadingSupported { get; }\n        = Environment.GetEnvironmentVariable(\"UNO_BOOTSTRAP_MONO_RUNTIME_FEATURES\")\n            ?.Split(',').Any(v => v.Equals(\"threads\", StringComparison.OrdinalIgnoreCase)) ?? false;\n\n    private static bool IsWebAssembly { get; }\n        = RuntimeInformation.IsOSPlatform(OSPlatform.Create(\"BROWSER\"));\n#endif\n\n    /// <summary>\n    /// Compatibility method to determine if the current thread can access a <see cref=\"DependencyObject\"/>\n    /// </summary>\n    /// <param name=\"instance\">The instance to check</param>\n    /// <returns><c>true</c> if the current thread has access to the instance, otherwise <c>false</c></returns>\n    public static bool CheckAccess(this DependencyObject instance)\n    {\n#if UNO_WASM\n        if (IsWebAssembly && !IsWebAssemblyThreadingSupported)\n        {\n            // When threading is disabled, we need to return true \n            return true;\n        }\n#endif\n        return instance.DispatcherQueue.HasThreadAccess;\n    }\n}\n"
  },
  {
    "path": "src/Uno/Prism.Uno/ILoadableShell.cs",
    "content": "﻿namespace Prism;\n\n#nullable enable\npublic interface ILoadableShell\n{\n    void FinishLoading();\n}\n"
  },
  {
    "path": "src/Uno/Prism.Uno/Interactivity/InvokeCommandAction.cs",
    "content": "using System.Reflection;\nusing System.Windows.Input;\nusing Microsoft.Xaml.Interactivity;\n\n\nnamespace Prism.Interactivity\n{\n    /// <summary>\n    /// Trigger action that executes a command when invoked.\n    /// It also maintains the Enabled state of the target control based on the CanExecute method of the command.\n    /// </summary>\n    public partial class InvokeCommandAction : DependencyObject, IAction\n    {\n        private ExecutableCommandBehavior _commandBehavior;\n\n        /// <summary>\n        /// Dependency property identifying if the associated element should automatically be enabled or disabled based on the result of the Command's CanExecute\n        /// </summary>\n        public static readonly DependencyProperty AutoEnableProperty =\n            DependencyProperty.Register(\"AutoEnable\", typeof(bool), typeof(InvokeCommandAction),\n                new PropertyMetadata(true));\n\n        /// <summary>\n        /// Gets or sets whether or not the associated element will automatically be enabled or disabled based on the result of the commands CanExecute\n        /// </summary>\n        public bool AutoEnable\n        {\n            get { return (bool)GetValue(AutoEnableProperty); }\n            set { SetValue(AutoEnableProperty, value); }\n        }\n\n        /// <summary>\n        /// Dependency property identifying the command to execute when invoked.\n        /// </summary>\n        public static readonly DependencyProperty CommandProperty =\n            DependencyProperty.Register(\"Command\", typeof(ICommand), typeof(InvokeCommandAction),\n                new PropertyMetadata(null));\n\n        /// <summary>\n        /// Gets or sets the command to execute when invoked.\n        /// </summary>\n        public ICommand Command\n        {\n            get { return GetValue(CommandProperty) as ICommand; }\n            set { SetValue(CommandProperty, value); }\n        }\n\n        /// <summary>\n        /// Dependency property identifying the command parameter to supply on command execution.\n        /// </summary>\n        public static readonly DependencyProperty CommandParameterProperty =\n            DependencyProperty.Register(\"CommandParameter\", typeof(object), typeof(InvokeCommandAction),\n                new PropertyMetadata(null));\n\n        /// <summary>\n        /// Gets or sets the command parameter to supply on command execution.\n        /// </summary>\n        public object CommandParameter\n        {\n            get { return GetValue(CommandParameterProperty); }\n            set { SetValue(CommandParameterProperty, value); }\n        }\n\n        /// <summary>\n        /// Dependency property identifying the TriggerParameterPath to be parsed to identify the child property of the trigger parameter to be used as the command parameter.\n        /// </summary>\n        public static readonly DependencyProperty TriggerParameterPathProperty =\n            DependencyProperty.Register(\"TriggerParameterPath\", typeof(string), typeof(InvokeCommandAction),\n                new PropertyMetadata(null, (d, e) => { }));\n\n        /// <summary>\n        /// Gets or sets the TriggerParameterPath value.\n        /// </summary>\n        public string TriggerParameterPath\n        {\n            get { return GetValue(TriggerParameterPathProperty) as string; }\n            set { SetValue(TriggerParameterPathProperty, value); }\n        }\n\n        /// <summary>\n        /// Executes the action.\n        /// </summary>\n        /// <param name=\"sender\">The <see cref=\"System.Object\"/> that is passed to the action by the behavior. Generally this is <seealso cref=\"Microsoft.Xaml.Interactivity.IBehavior.AssociatedObject\"/> or a target object.</param>\n        /// <param name=\"parameter\">The value of this parameter is determined by the caller.</param>\n        /// <returns>True if the command is successfully executed; else false.</returns>\n        public object Execute(object sender, object parameter)\n        {\n            if (!string.IsNullOrEmpty(TriggerParameterPath))\n            {\n                //Walk the ParameterPath for nested properties.\n                var propertyPathParts = TriggerParameterPath.Split('.');\n                object propertyValue = parameter;\n                foreach (var propertyPathPart in propertyPathParts)\n                {\n                    var propInfo = propertyValue.GetType().GetTypeInfo().GetProperty(propertyPathPart);\n                    propertyValue = propInfo.GetValue(propertyValue);\n                }\n                parameter = propertyValue;\n            }\n\n            var behavior = GetOrCreateBehavior(sender as UIElement);\n\n            if (behavior != null)\n            {\n                behavior.ExecuteCommand(parameter);\n            }\n\n            return true;\n        }\n\n        private ExecutableCommandBehavior GetOrCreateBehavior(UIElement sender)\n        {\n            // In case this method is called prior to this action being attached,\n            // the CommandBehavior would always keep a null target object (which isn't changeable afterwards).\n            // Therefore, in that case the behavior shouldn't be created and this method should return null.\n            if (_commandBehavior == null && sender != null)\n            {\n                _commandBehavior = new ExecutableCommandBehavior(sender);\n            }\n\n            _commandBehavior.Command = Command;\n            _commandBehavior.CommandParameter = CommandParameter;\n            _commandBehavior.AutoEnable = AutoEnable;\n\n            return _commandBehavior;\n        }\n\n        /// <summary>\n        /// A CommandBehavior that exposes a public ExecuteCommand method. It provides the functionality to invoke commands and update Enabled state of the target control.\n        /// It is not possible to make the <see cref=\"InvokeCommandAction\"/> inherit from <see cref=\"CommandBehaviorBase{T}\"/>, since the <see cref=\"InvokeCommandAction\"/>\n        /// must already inherit from <see cref=\"Trigger{T}\"/>, so we chose to follow the aggregation approach.\n        /// </summary>\n        private class ExecutableCommandBehavior : CommandBehaviorBase<UIElement>\n        {\n            /// <summary>\n            /// Constructor specifying the target object.\n            /// </summary>\n            /// <param name=\"target\">The target object the behavior is attached to.</param>\n            public ExecutableCommandBehavior(UIElement target)\n                : base(target)\n            {\n            }\n\n            /// <summary>\n            /// Executes the command, if it's set.\n            /// </summary>\n            public new void ExecuteCommand(object parameter)\n            {\n                base.ExecuteCommand(parameter);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Uno/Prism.Uno/LinkerDefinition.mono.xml",
    "content": "﻿<linker>\n  <assembly fullname=\"Prism\" />\n  <assembly fullname=\"Prism.Uno\" />\n</linker>"
  },
  {
    "path": "src/Uno/Prism.Uno/Mvvm/ViewModelLocator.cs",
    "content": "namespace Prism.Mvvm\n{\n    /// <summary>\n    /// This class defines the attached property and related change handler that calls the ViewModelLocator in Prism.Mvvm.\n    /// </summary>\n    public static class ViewModelLocator\n    {\n        /// <summary>\n        /// The AutowireViewModel attached property.\n        /// </summary>\n        public static DependencyProperty AutowireViewModelProperty = DependencyProperty.RegisterAttached(\"AutowireViewModel\", typeof(bool?), typeof(ViewModelLocator), new PropertyMetadata(defaultValue: null, propertyChangedCallback: AutowireViewModelChanged));\n\n        /// <summary>\n        /// Gets the value for the <see cref=\"AutowireViewModelProperty\"/> attached property.\n        /// </summary>\n        /// <param name=\"obj\">The target element.</param>\n        /// <returns>The <see cref=\"AutowireViewModelProperty\"/> attached to the <paramref name=\"obj\"/> element.</returns>\n        public static bool? GetAutowireViewModel(DependencyObject obj)\n        {\n            return (bool?)obj.GetValue(AutowireViewModelProperty);\n        }\n\n        /// <summary>\n        /// Sets the <see cref=\"AutowireViewModelProperty\"/> attached property.\n        /// </summary>\n        /// <param name=\"obj\">The target element.</param>\n        /// <param name=\"value\">The value to attach.</param>\n        public static void SetAutowireViewModel(DependencyObject obj, bool? value)\n        {\n            obj.SetValue(AutowireViewModelProperty, value);\n        }\n\n        private static void AutowireViewModelChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            var value = (bool?)e.NewValue;\n            if (value.HasValue && value.Value)\n            {\n                ViewModelLocationProvider.AutoWireViewModelChanged(d, Bind);\n            }\n        }\n\n        /// <summary>\n        /// Sets the DataContext of a View.\n        /// </summary>\n        /// <param name=\"view\">The View to set the DataContext on.</param>\n        /// <param name=\"viewModel\">The object to use as the DataContext for the View.</param>\n        static void Bind(object view, object viewModel)\n        {\n            if (view is FrameworkElement element)\n                element.DataContext = viewModel;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Uno/Prism.Uno/Navigation/Regions/NavigationViewRegionAdapter.cs",
    "content": "namespace Prism.Navigation.Regions;\n\npublic sealed class NavigationViewRegionAdapter : RegionAdapterBase<NavigationView>\n{\n    public NavigationViewRegionAdapter(IRegionBehaviorFactory regionBehaviorFactory)\n        : base(regionBehaviorFactory)\n    {\n    }\n\n    protected override void Adapt(IRegion region, NavigationView regionTarget)\n    {\n        regionTarget.BackRequested += delegate\n        {\n            if (region.NavigationService.Journal.CanGoBack)\n                region.NavigationService.Journal.GoBack();\n        };\n\n        regionTarget.SelectionChanged += delegate\n        {\n            if (regionTarget.SelectedItem is FrameworkElement item && item.Tag is string navigationTarget && !string.IsNullOrEmpty(navigationTarget))\n                region.RequestNavigate(navigationTarget);\n        };\n\n        region.ActiveViews.CollectionChanged += delegate\n        {\n            regionTarget.Content = region.ActiveViews.FirstOrDefault();\n        };\n    }\n\n    protected override IRegion CreateRegion()\n    {\n        return new SingleActiveRegion();\n    }\n}\n"
  },
  {
    "path": "src/Uno/Prism.Uno/Prism.Uno.WinUI.csproj",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project Sdk=\"Uno.Sdk\">\n  <PropertyGroup>\n    <TargetFrameworks>$(UnoTargetFrameworks)</TargetFrameworks>\n    <OutputType>Library</OutputType>\n    <GenerateLibraryLayout>true</GenerateLibraryLayout>\n    <AssemblyName>Prism.Uno</AssemblyName>\n    <RootNamespace>Prism</RootNamespace>\n    <NoWarn>$(NoWarn);1591</NoWarn>\n    <PackageId>Prism.Uno.WinUI</PackageId>\n    <ImplicitUsings>true</ImplicitUsings>\n    <Description>\n      Prism provides an implementation of a collection of design patterns that are helpful in writing well structured, maintainable, and testable XAML applications, including MVVM, dependency injection, commanding, event aggregation, and more. Prism's core functionality is a shared library targeting the .NET Framework and .NET. Features that need to be platform specific are implemented in the respective libraries for the target platform (WPF, Uno Platform, .NET MAUI and Xamarin Forms).\n\n      Prism for Uno Platform helps you more easily design and build rich, flexible, and easy to maintain Windows UWP, WinUI &amp; cross platform Uno applications. This library provides user interface composition as well as modularity support.\n    </Description>\n    <PackageTags>prism;winui;windows;uno;mvvm;uwp;ios;android;macos;webassembly;linux;xaml</PackageTags>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Uno.WinUI\" />\n    <PackageReference Include=\"Uno.Extensions.Hosting.WinUI\" />\n  </ItemGroup>\n\n  <ItemGroup Condition=\"!$(TargetFramework.Contains('windows10'))\">\n    <PackageReference Include=\"Uno.Microsoft.Xaml.Behaviors.WinUI.Managed\" />\n  </ItemGroup>\n  <ItemGroup Condition=\"$(TargetFramework.Contains('windows10'))\">\n    <PackageReference Include=\"Microsoft.Xaml.Behaviors.WinUI.Managed\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"..\\..\\Wpf\\Prism.Wpf\\**\\*.cs\" Exclude=\"..\\..\\Wpf\\Prism.Wpf\\bin\\**\\*.cs;..\\..\\Wpf\\Prism.Wpf\\obj\\**\\*.cs\" />\n    <Compile Include=\"..\\..\\Maui\\Prism.Maui\\Modularity\\*.cs\" LinkBase=\"Modularity\" />\n    <Compile Remove=\"**\\*.net45.cs\" />\n    <Compile Remove=\"**\\*.netcore.cs\" />\n    <Compile Remove=\"..\\..\\Wpf\\Prism.Wpf\\Modularity\\**\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Remove=\"..\\..\\Wpf\\Prism.Wpf\\Bootstrapper.cs\" />\n    <Compile Remove=\"..\\..\\Wpf\\Prism.Wpf\\Interactivity\\InvokeCommandAction.cs\" />\n    <Compile Remove=\"..\\..\\Wpf\\Prism.Wpf\\Ioc\\ContainerProviderExtension.cs\" />\n    <Compile Remove=\"..\\..\\Wpf\\Prism.Wpf\\Mvvm\\ViewModelLocator.cs\" />\n    <Compile Remove=\"..\\..\\Wpf\\Prism.Wpf\\PrismApplicationBase.cs\" />\n    <Compile Remove=\"..\\..\\Wpf\\Prism.Wpf\\PrismBootstrapperBase.cs\" />\n    <Compile Remove=\"..\\..\\Wpf\\Prism.Wpf\\Properties\\AssemblyInfo.cs\" />\n    <Compile Remove=\"..\\..\\Wpf\\Prism.Wpf\\Properties\\Resources.Designer.cs\" />\n    <Compile Remove=\"..\\..\\Wpf\\Prism.Wpf\\Properties\\Settings.Designer.cs\" />\n    <Compile Remove=\"..\\..\\Wpf\\Prism.Wpf\\Dialogs\\DialogService.cs\" />\n    <Compile Remove=\"..\\..\\Wpf\\Prism.Wpf\\Dialogs\\DialogWindow.xaml.cs\" />\n    <Compile Remove=\"..\\..\\Wpf\\Prism.Wpf\\Dialogs\\IDialogWindow.cs\" />\n    <Compile Remove=\"..\\..\\Wpf\\Prism.Wpf\\Dialogs\\IDialogWindowExtensions.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\Prism.Core\\Prism.Core.csproj\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Update=\"Properties\\Resources.Designer.cs\">\n      <DesignTime>True</DesignTime>\n      <AutoGen>True</AutoGen>\n      <DependentUpon>Resources.resx</DependentUpon>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <EmbeddedResource Update=\"Properties\\Resources.resx\">\n      <Generator>ResXFileCodeGenerator</Generator>\n      <LastGenOutput>Resources.Designer.cs</LastGenOutput>\n    </EmbeddedResource>\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": "src/Uno/Prism.Uno/PrismApplicationBase.cs",
    "content": "using Microsoft.Extensions.DependencyInjection;\nusing Microsoft.Extensions.Hosting;\nusing Prism.Common;\nusing Prism.Modularity;\nusing Prism.Mvvm;\nusing Prism.Navigation.Regions;\nusing Application = Microsoft.UI.Xaml.Application;\n\n#nullable enable\nnamespace Prism\n{\n    /// <summary>\n    /// Base application class that provides a basic initialization sequence\n    /// </summary>\n    /// <remarks>\n    /// This class must be overridden to provide application specific configuration.\n    /// </remarks>\n    public abstract class PrismApplicationBase : Application\n    {\n        private readonly IContainerExtension _containerExtension;\n        private IHost? _host;\n        private IRegionManager? _regionManager;\n\n        protected PrismApplicationBase()\n        {\n            _containerExtension = CreateContainerExtension();\n            ContainerLocator.SetContainerExtension(_containerExtension);\n        }\n\n        /// <summary>\n        /// The dependency injection container used to resolve objects\n        /// </summary>\n        public IContainerProvider Container => _containerExtension;\n\n        /// <summary>\n        /// Gets the <see cref=\"IHost\" /> built when the Shell is loaded.\n        /// </summary>\n        public IHost Host => _host ??\n            throw new InvalidOperationException(\"The host has not yet been created. The Shell must first be loaded before the Host is created.\");\n\n        /// <summary>\n        /// Gets the <see cref=\"IRegionManager\" /> which can be used in the OnInitialized method to Navigation in the Shell once it has loaded\n        /// and the <see cref=\"IHost\" /> has been built and all <see cref=\"IModule\" />'s have been loaded by the <see cref=\"IModuleManager\" />\n        /// </summary>\n        protected IRegionManager RegionManager => _regionManager ??= Container.Resolve<IRegionManager>();\n\n        /// <summary>\n        /// Invoked when the application is launched.\n        /// </summary>\n        /// <param name=\"args\">Event data for the event.</param>\n        /// <remarks>If you need to change the behavior here you should override <see cref=\"Initialize(IApplicationBuilder)\"/>.</remarks>\n        protected sealed override void OnLaunched(LaunchActivatedEventArgs args)\n        {\n            base.OnLaunched(args);\n            InitializeInternal(this.CreateBuilder(args));\n        }\n\n        /// <summary>\n        /// Run the initialization process.\n        /// </summary>\n        void InitializeInternal(IApplicationBuilder builder)\n        {\n            ConfigureViewModelLocator();\n            Initialize(builder);\n        }\n\n        /// <summary>\n        /// Configures the <see cref=\"Prism.Mvvm.ViewModelLocator\"/> used by Prism.\n        /// </summary>\n        protected virtual void ConfigureViewModelLocator()\n        {\n            ViewModelLocationProvider.SetDefaultViewModelFactory((view, type) =>\n            {\n                return Container.Resolve(type);\n            });\n        }\n\n        /// <summary>\n        /// Allows you to configure the Application Host using the <see cref=\"IApplicationBuilder\" />\n        /// </summary>\n        /// <param name=\"builder\">The <see cref=\"IApplicationBuilder\" />.</param>\n        protected virtual void ConfigureApp(IApplicationBuilder builder) { }\n\n        /// <summary>\n        /// Allows you to configure the <see cref=\"IHostBuilder\"/>\n        /// </summary>\n        /// <param name=\"builder\">The <see cref=\"IHostBuilder\" />.</param>\n        protected virtual void ConfigureHost(IHostBuilder builder) { }\n\n        /// <summary>\n        /// Provides an opportunity to initialize services or otherwise prepare the application Window.\n        /// </summary>\n        /// <param name=\"window\">The primary application <see cref=\"Window\"/></param>\n        /// <example>\n        /// protected override void ConfigureWindow(Window window)\n        /// {\n        ///     #if DEBUG\n        ///     window.EnableHotReload();\n        ///     #endif\n        /// }\n        /// </example>\n        protected virtual void ConfigureWindow(Window window) { }\n\n        /// <summary>\n        /// Register Services with the <see cref=\"IServiceCollection\" />.\n        /// </summary>\n        /// <remarks>\n        /// Services registered here will not be available in Prism's <see cref=\"IContainerProvider\"/>\n        /// until the Shell has finished Loading.\n        /// </remarks>\n        /// <param name=\"services\">The <see cref=\"IServiceCollection\" /></param>\n        protected virtual void ConfigureServices(IServiceCollection services) { }\n\n        /// <summary>\n        /// Runs the initialization sequence to configure the Prism application.\n        /// </summary>\n        protected virtual void Initialize(IApplicationBuilder builder)\n        {\n            ConfigureApp(builder);\n            ConfigureWindow(builder.Window);\n            builder.Configure(ConfigureHost)\n                .Configure(x => x.ConfigureServices(ConfigureServices)\n                    .UseServiceProviderFactory(new PrismServiceProviderFactory(_containerExtension)));\n\n            _containerExtension.RegisterInstance(builder.Window);\n            RegisterRequiredTypes(_containerExtension);\n            RegisterTypes(_containerExtension);\n\n            ConfigureModuleCatalog(Container.Resolve<IModuleCatalog>());\n\n            var regionAdapterMappings = Container.Resolve<RegionAdapterMappings>();\n            ConfigureRegionAdapterMappings(regionAdapterMappings);\n\n            var defaultRegionBehaviors = Container.Resolve<IRegionBehaviorFactory>();\n            ConfigureDefaultRegionBehaviors(defaultRegionBehaviors);\n\n            RegisterFrameworkExceptionTypes();\n\n            var shell = CreateShell();\n\n            if (shell != null)\n            {\n                MvvmHelpers.AutowireViewModel(shell);\n                builder.Window.Content = shell;\n                builder.Window.Activate();\n\n                void FinalizeInitialization()\n                {\n                    Navigation.Regions.RegionManager.SetRegionManager(shell, Container.Resolve<IRegionManager>());\n                    Navigation.Regions.RegionManager.UpdateRegions();\n                    _host = builder.Build();\n                    InitializeModules();\n                    OnInitialized();\n                    if (shell is ILoadableShell loadableShell)\n                        loadableShell.FinishLoading();\n                    MvvmHelpers.ViewAndViewModelAction<IActiveAware>(shell, x => x.IsActive = true);\n                }\n\n                if (shell is FrameworkElement fe)\n                {\n                    void OnLoaded(object sender, object args)\n                    {\n                        FinalizeInitialization();\n                        fe.Loaded -= OnLoaded;\n                    }\n\n                    if (fe.IsLoaded)\n                    {\n                        FinalizeInitialization();\n                    }\n                    else\n                    {\n                        // We need to delay the initialization after the shell has been loaded, otherwise\n                        // the visual tree is not materialized for the RegionManager to be available.\n                        // See https://github.com/PrismLibrary/Prism/issues/2102 for more details.\n                        fe.Loaded += OnLoaded;\n                    }\n                }\n                else\n                {\n                    FinalizeInitialization();\n                }\n            }\n        }\n\n        /// <summary>\n        /// Creates the container used by Prism.\n        /// </summary>\n        /// <returns>The container</returns>\n        protected abstract IContainerExtension CreateContainerExtension();\n\n        /// <summary>\n        /// Registers all types that are required by Prism to function with the container.\n        /// </summary>\n        /// <param name=\"containerRegistry\"></param>\n        protected virtual void RegisterRequiredTypes(IContainerRegistry containerRegistry)\n        {\n            containerRegistry.RegisterRequiredTypes();\n        }\n\n        /// <summary>\n        /// Used to register types with the container that will be used by your application.\n        /// </summary>\n        protected abstract void RegisterTypes(IContainerRegistry containerRegistry);\n\n        /// <summary>\n        /// Configures the <see cref=\"IRegionBehaviorFactory\"/>.\n        /// This will be the list of default behaviors that will be added to a region.\n        /// </summary>\n        protected virtual void ConfigureDefaultRegionBehaviors(IRegionBehaviorFactory regionBehaviors)\n        {\n            regionBehaviors?.RegisterDefaultRegionBehaviors();\n        }\n\n        /// <summary>\n        /// Configures the default region adapter mappings to use in the application, in order\n        /// to adapt UI controls defined in XAML to use a region and register it automatically.\n        /// May be overwritten in a derived class to add specific mappings required by the application.\n        /// </summary>\n        /// <returns>The <see cref=\"RegionAdapterMappings\"/> instance containing all the mappings.</returns>\n        protected virtual void ConfigureRegionAdapterMappings(RegionAdapterMappings regionAdapterMappings)\n        {\n            regionAdapterMappings?.RegisterDefaultRegionAdapterMappings();\n        }\n\n        /// <summary>\n        /// Registers the <see cref=\"Type\"/>s of the Exceptions that are not considered\n        /// root exceptions by the <see cref=\"System.ExceptionExtensions\"/>.\n        /// </summary>\n        protected virtual void RegisterFrameworkExceptionTypes()\n        {\n        }\n\n        /// <summary>\n        /// Creates the shell or main window of the application.\n        /// </summary>\n        /// <returns>The shell of the application.</returns>\n        protected abstract UIElement CreateShell();\n\n        /// <summary>\n        /// Contains actions that should occur last.\n        /// </summary>\n        protected virtual void OnInitialized()\n        {\n        }\n\n        /// <summary>\n        /// Configures the <see cref=\"IModuleCatalog\"/> used by Prism.\n        /// </summary>\n        protected virtual void ConfigureModuleCatalog(IModuleCatalog moduleCatalog) { }\n\n        /// <summary>\n        /// Initializes the modules.\n        /// </summary>\n        protected virtual void InitializeModules()\n        {\n            PrismInitializationExtensions.RunModuleManager(Container);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Uno/Prism.Uno/Properties/Resources.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.42000\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace Prism.Properties {\n    using System;\n    \n    \n    /// <summary>\n    ///   A strongly-typed resource class, for looking up localized strings, etc.\n    /// </summary>\n    // This class was auto-generated by the StronglyTypedResourceBuilder\n    // class via a tool like ResGen or Visual Studio.\n    // To add or remove a member, edit your .ResX file then rerun ResGen\n    // with the /str option, or rebuild your VS project.\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"16.0.0.0\")]\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    internal class Resources {\n        \n        private static global::System.Resources.ResourceManager resourceMan;\n        \n        private static global::System.Globalization.CultureInfo resourceCulture;\n        \n        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        internal Resources() {\n        }\n        \n        /// <summary>\n        ///   Returns the cached ResourceManager instance used by this class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Resources.ResourceManager ResourceManager {\n            get {\n                if (object.ReferenceEquals(resourceMan, null)) {\n                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"Prism.Properties.Resources\", typeof(Resources).Assembly);\n                    resourceMan = temp;\n                }\n                return resourceMan;\n            }\n        }\n        \n        /// <summary>\n        ///   Overrides the current thread's CurrentUICulture property for all\n        ///   resource lookups using this strongly typed resource class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Globalization.CultureInfo Culture {\n            get {\n                return resourceCulture;\n            }\n            set {\n                resourceCulture = value;\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The object must be of type &apos;{0}&apos; in order to use the current region adapter..\n        /// </summary>\n        internal static string AdapterInvalidTypeException {\n            get {\n                return ResourceManager.GetString(\"AdapterInvalidTypeException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Cannot change the region name once is set. The current region name is &apos;{0}&apos;..\n        /// </summary>\n        internal static string CannotChangeRegionNameException {\n            get {\n                return ResourceManager.GetString(\"CannotChangeRegionNameException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Cannot create navigation target &apos;{0}&apos;..\n        /// </summary>\n        internal static string CannotCreateNavigationTarget {\n            get {\n                return ResourceManager.GetString(\"CannotCreateNavigationTarget\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Type &apos;{0}&apos; does not implement from IRegionBehavior..\n        /// </summary>\n        internal static string CanOnlyAddTypesThatInheritIFromRegionBehavior {\n            get {\n                return ResourceManager.GetString(\"CanOnlyAddTypesThatInheritIFromRegionBehavior\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The ConfigurationStore cannot contain a null value. .\n        /// </summary>\n        internal static string ConfigurationStoreCannotBeNull {\n            get {\n                return ResourceManager.GetString(\"ConfigurationStoreCannotBeNull\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to ContentControl&apos;s Content property is not empty. \n        ///    This control is being associated with a region, but the control is already bound to something else. \n        ///    If you did not explicitly set the control&apos;s Content property, \n        ///    this exception may be caused by a change in the value of the inherited RegionManager attached property..\n        /// </summary>\n        internal static string ContentControlHasContentException {\n            get {\n                return ResourceManager.GetString(\"ContentControlHasContentException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Deactivation is not possible in this type of region..\n        /// </summary>\n        internal static string DeactiveNotPossibleException {\n            get {\n                return ResourceManager.GetString(\"DeactiveNotPossibleException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to {1}: {2}. Priority: {3}. Timestamp:{0:u}..\n        /// </summary>\n        internal static string DefaultTextLoggerPattern {\n            get {\n                return ResourceManager.GetString(\"DefaultTextLoggerPattern\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Neither the executeMethod nor the canExecuteMethod delegates can be null..\n        /// </summary>\n        internal static string DelegateCommandDelegatesCannotBeNull {\n            get {\n                return ResourceManager.GetString(\"DelegateCommandDelegatesCannotBeNull\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to T for DelegateCommand&lt;T&gt; is not an object nor Nullable..\n        /// </summary>\n        internal static string DelegateCommandInvalidGenericPayloadType {\n            get {\n                return ResourceManager.GetString(\"DelegateCommandInvalidGenericPayloadType\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Directory {0} was not found..\n        /// </summary>\n        internal static string DirectoryNotFound {\n            get {\n                return ResourceManager.GetString(\"DirectoryNotFound\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to A duplicated module group with name {0} has been found by the loader..\n        /// </summary>\n        internal static string DuplicatedModuleGroup {\n            get {\n                return ResourceManager.GetString(\"DuplicatedModuleGroup\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to A duplicated module with name {0} has been found in the ModuleCatalog..\n        /// </summary>\n        internal static string DuplicatedModuleInCatalog {\n            get {\n                return ResourceManager.GetString(\"DuplicatedModuleInCatalog\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Unable to retrieve the module type {0} from the loaded assemblies.  You may need to specify a more fully-qualified type name..\n        /// </summary>\n        internal static string FailedToGetType {\n            get {\n                return ResourceManager.GetString(\"FailedToGetType\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to HostControl cannot have null value when behavior attaches. .\n        /// </summary>\n        internal static string HostControlCannotBeNull {\n            get {\n                return ResourceManager.GetString(\"HostControlCannotBeNull\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The HostControl property cannot be set after Attach method has been called..\n        /// </summary>\n        internal static string HostControlCannotBeSetAfterAttach {\n            get {\n                return ResourceManager.GetString(\"HostControlCannotBeSetAfterAttach\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to HostControl type must be a TabControl..\n        /// </summary>\n        internal static string HostControlMustBeATabControl {\n            get {\n                return ResourceManager.GetString(\"HostControlMustBeATabControl\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The IModuleEnumerator interface is no longer used and has been replaced by ModuleCatalog..\n        /// </summary>\n        internal static string IEnumeratorObsolete {\n            get {\n                return ResourceManager.GetString(\"IEnumeratorObsolete\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The argument must be a valid absolute Uri to an assembly file..\n        /// </summary>\n        internal static string InvalidArgumentAssemblyUri {\n            get {\n                return ResourceManager.GetString(\"InvalidArgumentAssemblyUri\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to ItemsControl&apos;s ItemsSource property is not empty. \n        ///    This control is being associated with a region, but the control is already bound to something else. \n        ///    If you did not explicitly set the control&apos;s ItemSource property, \n        ///    this exception may be caused by a change in the value of the inherited RegionManager attached property..\n        /// </summary>\n        internal static string ItemsControlHasItemsSourceException {\n            get {\n                return ResourceManager.GetString(\"ItemsControlHasItemsSourceException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Mapping with the given type is already registered: {0}..\n        /// </summary>\n        internal static string MappingExistsException {\n            get {\n                return ResourceManager.GetString(\"MappingExistsException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Module {0} was not found in the catalog..\n        /// </summary>\n        internal static string ModuleNotFound {\n            get {\n                return ResourceManager.GetString(\"ModuleNotFound\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The ModulePath cannot contain a null value or be empty.\n        /// </summary>\n        internal static string ModulePathCannotBeNullOrEmpty {\n            get {\n                return ResourceManager.GetString(\"ModulePathCannotBeNullOrEmpty\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Module Reference Location is not supported in Xamarin.Forms.\n        /// </summary>\n        internal static string ModuleRefLocationNotSupported {\n            get {\n                return ResourceManager.GetString(\"ModuleRefLocationNotSupported\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Failed to load type &apos;{0}&apos; from assembly &apos;{1}&apos;..\n        /// </summary>\n        internal static string ModuleTypeNotFound {\n            get {\n                return ResourceManager.GetString(\"ModuleTypeNotFound\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The ModuleCatalog must implement IModuleGroupCatalog to add groups.\n        /// </summary>\n        internal static string MustBeModuleGroupCatalog {\n            get {\n                return ResourceManager.GetString(\"MustBeModuleGroupCatalog\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Navigation is already in progress on region with name &apos;{0}&apos;..\n        /// </summary>\n        internal static string NavigationInProgress {\n            get {\n                return ResourceManager.GetString(\"NavigationInProgress\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to NavigationMode is not available.\n        /// </summary>\n        internal static string NavigationModeNotAvailable {\n            get {\n                return ResourceManager.GetString(\"NavigationModeNotAvailable\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Navigation cannot proceed until a region is set for the RegionNavigationService..\n        /// </summary>\n        internal static string NavigationServiceHasNoRegion {\n            get {\n                return ResourceManager.GetString(\"NavigationServiceHasNoRegion\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The IRegionAdapter for the type {0} is not registered in the region adapter mappings. You can register an IRegionAdapter for this control by overriding the ConfigureRegionAdapterMappings method in the bootstrapper..\n        /// </summary>\n        internal static string NoRegionAdapterException {\n            get {\n                return ResourceManager.GetString(\"NoRegionAdapterException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to There is currently no moduleTypeLoader in the ModuleManager that can retrieve the specified module..\n        /// </summary>\n        internal static string NoRetrieverCanRetrieveModule {\n            get {\n                return ResourceManager.GetString(\"NoRetrieverCanRetrieveModule\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to An exception has occurred while trying to add a view to region &apos;{0}&apos;. \n        ///    - The most likely causing exception was was: &apos;{1}&apos;.\n        ///    But also check the InnerExceptions for more detail or call .GetRootException(). .\n        /// </summary>\n        internal static string OnViewRegisteredException {\n            get {\n                return ResourceManager.GetString(\"OnViewRegisteredException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The member access expression does not access a property..\n        /// </summary>\n        internal static string PropertySupport_ExpressionNotProperty_Exception {\n            get {\n                return ResourceManager.GetString(\"PropertySupport_ExpressionNotProperty_Exception\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The expression is not a member access expression..\n        /// </summary>\n        internal static string PropertySupport_NotMemberAccessExpression_Exception {\n            get {\n                return ResourceManager.GetString(\"PropertySupport_NotMemberAccessExpression_Exception\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The referenced property is a static property..\n        /// </summary>\n        internal static string PropertySupport_StaticExpression_Exception {\n            get {\n                return ResourceManager.GetString(\"PropertySupport_StaticExpression_Exception\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The Attach method cannot be called when Region property is null..\n        /// </summary>\n        internal static string RegionBehaviorAttachCannotBeCallWithNullRegion {\n            get {\n                return ResourceManager.GetString(\"RegionBehaviorAttachCannotBeCallWithNullRegion\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The Region property cannot be set after Attach method has been called..\n        /// </summary>\n        internal static string RegionBehaviorRegionCannotBeSetAfterAttach {\n            get {\n                return ResourceManager.GetString(\"RegionBehaviorRegionCannotBeSetAfterAttach\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to An exception occurred while creating a region with name &apos;{0}&apos;. The exception was: {1}. .\n        /// </summary>\n        internal static string RegionCreationException {\n            get {\n                return ResourceManager.GetString(\"RegionCreationException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The region being added already has a name of &apos;{0}&apos; and cannot be added to the region manager with a different name (&apos;{1}&apos;)..\n        /// </summary>\n        internal static string RegionManagerWithDifferentNameException {\n            get {\n                return ResourceManager.GetString(\"RegionManagerWithDifferentNameException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The region name cannot be null or empty..\n        /// </summary>\n        internal static string RegionNameCannotBeEmptyException {\n            get {\n                return ResourceManager.GetString(\"RegionNameCannotBeEmptyException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Region with the given name is already registered: {0}.\n        /// </summary>\n        internal static string RegionNameExistsException {\n            get {\n                return ResourceManager.GetString(\"RegionNameExistsException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to This RegionManager does not contain a Region with the name &apos;{0}&apos;..\n        /// </summary>\n        internal static string RegionNotFound {\n            get {\n                return ResourceManager.GetString(\"RegionNotFound\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The region manager does not contain the {0} region..\n        /// </summary>\n        internal static string RegionNotInRegionManagerException {\n            get {\n                return ResourceManager.GetString(\"RegionNotInRegionManagerException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to View already exists in region..\n        /// </summary>\n        internal static string RegionViewExistsException {\n            get {\n                return ResourceManager.GetString(\"RegionViewExistsException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to View with name &apos;{0}&apos; already exists in the region..\n        /// </summary>\n        internal static string RegionViewNameExistsException {\n            get {\n                return ResourceManager.GetString(\"RegionViewNameExistsException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The ServiceProvider did not provide a &apos;IProvideValueTarget&apos;.\n        /// </summary>\n        internal static string ServiceProviderDidNotHaveIProvideValueTarget {\n            get {\n                return ResourceManager.GetString(\"ServiceProviderDidNotHaveIProvideValueTarget\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The provided String argument {0} must not be null or empty..\n        /// </summary>\n        internal static string StringCannotBeNullOrEmpty {\n            get {\n                return ResourceManager.GetString(\"StringCannotBeNullOrEmpty\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The provided String argument {0} must not be null or empty..\n        /// </summary>\n        internal static string StringCannotBeNullOrEmpty1 {\n            get {\n                return ResourceManager.GetString(\"StringCannotBeNullOrEmpty1\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to No BehaviorType with key &apos;{0}&apos; was registered..\n        /// </summary>\n        internal static string TypeWithKeyNotRegistered {\n            get {\n                return ResourceManager.GetString(\"TypeWithKeyNotRegistered\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to An exception occurred while trying to create region objects. \n        ///    - The most likely causing exception was: &apos;{0}&apos;.\n        ///    But also check the InnerExceptions for more detail or call .GetRootException(). .\n        /// </summary>\n        internal static string UpdateRegionException {\n            get {\n                return ResourceManager.GetString(\"UpdateRegionException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The value must be of type ModuleInfo..\n        /// </summary>\n        internal static string ValueMustBeOfTypeModuleInfo {\n            get {\n                return ResourceManager.GetString(\"ValueMustBeOfTypeModuleInfo\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to {0} not found..\n        /// </summary>\n        internal static string ValueNotFound {\n            get {\n                return ResourceManager.GetString(\"ValueNotFound\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The region does not contain the specified view..\n        /// </summary>\n        internal static string ViewNotInRegionException {\n            get {\n                return ResourceManager.GetString(\"ViewNotInRegionException\", resourceCulture);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Uno/Prism.Uno/Properties/Resources.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <data name=\"AdapterInvalidTypeException\" xml:space=\"preserve\">\n    <value>The object must be of type '{0}' in order to use the current region adapter.</value>\n  </data>\n  <data name=\"CannotChangeRegionNameException\" xml:space=\"preserve\">\n    <value>Cannot change the region name once is set. The current region name is '{0}'.</value>\n  </data>\n  <data name=\"CannotCreateNavigationTarget\" xml:space=\"preserve\">\n    <value>Cannot create navigation target '{0}'.</value>\n  </data>\n  <data name=\"CanOnlyAddTypesThatInheritIFromRegionBehavior\" xml:space=\"preserve\">\n    <value>Type '{0}' does not implement from IRegionBehavior.</value>\n  </data>\n  <data name=\"ConfigurationStoreCannotBeNull\" xml:space=\"preserve\">\n    <value>The ConfigurationStore cannot contain a null value. </value>\n  </data>\n  <data name=\"ContentControlHasContentException\" xml:space=\"preserve\">\n    <value>ContentControl's Content property is not empty. \n    This control is being associated with a region, but the control is already bound to something else. \n    If you did not explicitly set the control's Content property, \n    this exception may be caused by a change in the value of the inherited RegionManager attached property.</value>\n  </data>\n  <data name=\"DeactiveNotPossibleException\" xml:space=\"preserve\">\n    <value>Deactivation is not possible in this type of region.</value>\n  </data>\n  <data name=\"DefaultTextLoggerPattern\" xml:space=\"preserve\">\n    <value>{1}: {2}. Priority: {3}. Timestamp:{0:u}.</value>\n  </data>\n  <data name=\"DelegateCommandDelegatesCannotBeNull\" xml:space=\"preserve\">\n    <value>Neither the executeMethod nor the canExecuteMethod delegates can be null.</value>\n  </data>\n  <data name=\"DelegateCommandInvalidGenericPayloadType\" xml:space=\"preserve\">\n    <value>T for DelegateCommand&lt;T&gt; is not an object nor Nullable.</value>\n  </data>\n  <data name=\"DirectoryNotFound\" xml:space=\"preserve\">\n    <value>Directory {0} was not found.</value>\n  </data>\n  <data name=\"DuplicatedModuleGroup\" xml:space=\"preserve\">\n    <value>A duplicated module group with name {0} has been found by the loader.</value>\n  </data>\n  <data name=\"FailedToGetType\" xml:space=\"preserve\">\n    <value>Unable to retrieve the module type {0} from the loaded assemblies.  You may need to specify a more fully-qualified type name.</value>\n  </data>\n  <data name=\"HostControlCannotBeNull\" xml:space=\"preserve\">\n    <value>HostControl cannot have null value when behavior attaches. </value>\n  </data>\n  <data name=\"HostControlCannotBeSetAfterAttach\" xml:space=\"preserve\">\n    <value>The HostControl property cannot be set after Attach method has been called.</value>\n  </data>\n  <data name=\"HostControlMustBeATabControl\" xml:space=\"preserve\">\n    <value>HostControl type must be a TabControl.</value>\n  </data>\n  <data name=\"IEnumeratorObsolete\" xml:space=\"preserve\">\n    <value>The IModuleEnumerator interface is no longer used and has been replaced by ModuleCatalog.</value>\n  </data>\n  <data name=\"InvalidArgumentAssemblyUri\" xml:space=\"preserve\">\n    <value>The argument must be a valid absolute Uri to an assembly file.</value>\n  </data>\n  <data name=\"ItemsControlHasItemsSourceException\" xml:space=\"preserve\">\n    <value>ItemsControl's ItemsSource property is not empty. \n    This control is being associated with a region, but the control is already bound to something else. \n    If you did not explicitly set the control's ItemSource property, \n    this exception may be caused by a change in the value of the inherited RegionManager attached property.</value>\n  </data>\n  <data name=\"MappingExistsException\" xml:space=\"preserve\">\n    <value>Mapping with the given type is already registered: {0}.</value>\n  </data>\n  <data name=\"ModuleNotFound\" xml:space=\"preserve\">\n    <value>Module {0} was not found in the catalog.</value>\n  </data>\n  <data name=\"ModulePathCannotBeNullOrEmpty\" xml:space=\"preserve\">\n    <value>The ModulePath cannot contain a null value or be empty</value>\n  </data>\n  <data name=\"ModuleTypeNotFound\" xml:space=\"preserve\">\n    <value>Failed to load type '{0}' from assembly '{1}'.</value>\n  </data>\n  <data name=\"NavigationInProgress\" xml:space=\"preserve\">\n    <value>Navigation is already in progress on region with name '{0}'.</value>\n  </data>\n  <data name=\"NavigationServiceHasNoRegion\" xml:space=\"preserve\">\n    <value>Navigation cannot proceed until a region is set for the RegionNavigationService.</value>\n  </data>\n  <data name=\"NoRegionAdapterException\" xml:space=\"preserve\">\n    <value>The IRegionAdapter for the type {0} is not registered in the region adapter mappings. You can register an IRegionAdapter for this control by overriding the ConfigureRegionAdapterMappings method in the bootstrapper.</value>\n  </data>\n  <data name=\"NoRetrieverCanRetrieveModule\" xml:space=\"preserve\">\n    <value>There is currently no moduleTypeLoader in the ModuleManager that can retrieve the specified module.</value>\n  </data>\n  <data name=\"OnViewRegisteredException\" xml:space=\"preserve\">\n    <value>An exception has occurred while trying to add a view to region '{0}'. \n    - The most likely causing exception was was: '{1}'.\n    But also check the InnerExceptions for more detail or call .GetRootException(). </value>\n  </data>\n  <data name=\"PropertySupport_ExpressionNotProperty_Exception\" xml:space=\"preserve\">\n    <value>The member access expression does not access a property.</value>\n  </data>\n  <data name=\"PropertySupport_NotMemberAccessExpression_Exception\" xml:space=\"preserve\">\n    <value>The expression is not a member access expression.</value>\n  </data>\n  <data name=\"PropertySupport_StaticExpression_Exception\" xml:space=\"preserve\">\n    <value>The referenced property is a static property.</value>\n  </data>\n  <data name=\"RegionBehaviorAttachCannotBeCallWithNullRegion\" xml:space=\"preserve\">\n    <value>The Attach method cannot be called when Region property is null.</value>\n  </data>\n  <data name=\"RegionBehaviorRegionCannotBeSetAfterAttach\" xml:space=\"preserve\">\n    <value>The Region property cannot be set after Attach method has been called.</value>\n  </data>\n  <data name=\"RegionCreationException\" xml:space=\"preserve\">\n    <value>An exception occurred while creating a region with name '{0}'. The exception was: {1}. </value>\n  </data>\n  <data name=\"RegionManagerWithDifferentNameException\" xml:space=\"preserve\">\n    <value>The region being added already has a name of '{0}' and cannot be added to the region manager with a different name ('{1}').</value>\n  </data>\n  <data name=\"RegionNameCannotBeEmptyException\" xml:space=\"preserve\">\n    <value>The region name cannot be null or empty.</value>\n  </data>\n  <data name=\"RegionNameExistsException\" xml:space=\"preserve\">\n    <value>Region with the given name is already registered: {0}</value>\n  </data>\n  <data name=\"RegionNotFound\" xml:space=\"preserve\">\n    <value>This RegionManager does not contain a Region with the name '{0}'.</value>\n  </data>\n  <data name=\"RegionNotInRegionManagerException\" xml:space=\"preserve\">\n    <value>The region manager does not contain the {0} region.</value>\n  </data>\n  <data name=\"RegionViewExistsException\" xml:space=\"preserve\">\n    <value>View already exists in region.</value>\n  </data>\n  <data name=\"RegionViewNameExistsException\" xml:space=\"preserve\">\n    <value>View with name '{0}' already exists in the region.</value>\n  </data>\n  <data name=\"StringCannotBeNullOrEmpty\" xml:space=\"preserve\">\n    <value>The provided String argument {0} must not be null or empty.</value>\n  </data>\n  <data name=\"StringCannotBeNullOrEmpty1\" xml:space=\"preserve\">\n    <value>The provided String argument {0} must not be null or empty.</value>\n  </data>\n  <data name=\"TypeWithKeyNotRegistered\" xml:space=\"preserve\">\n    <value>No BehaviorType with key '{0}' was registered.</value>\n  </data>\n  <data name=\"UpdateRegionException\" xml:space=\"preserve\">\n    <value>An exception occurred while trying to create region objects. \n    - The most likely causing exception was: '{0}'.\n    But also check the InnerExceptions for more detail or call .GetRootException(). </value>\n  </data>\n  <data name=\"ValueMustBeOfTypeModuleInfo\" xml:space=\"preserve\">\n    <value>The value must be of type ModuleInfo.</value>\n  </data>\n  <data name=\"ValueNotFound\" xml:space=\"preserve\">\n    <value>{0} not found.</value>\n  </data>\n  <data name=\"ViewNotInRegionException\" xml:space=\"preserve\">\n    <value>The region does not contain the specified view.</value>\n  </data>\n  <data name=\"MustBeModuleGroupCatalog\" xml:space=\"preserve\">\n    <value>The ModuleCatalog must implement IModuleGroupCatalog to add groups</value>\n  </data>\n  <data name=\"DuplicatedModuleInCatalog\" xml:space=\"preserve\">\n    <value>A duplicated module with name {0} has been found in the ModuleCatalog.</value>\n  </data>\n  <data name=\"ModuleRefLocationNotSupported\" xml:space=\"preserve\">\n    <value>Module Reference Location is not supported in Xamarin.Forms</value>\n  </data>\n  <data name=\"NavigationModeNotAvailable\" xml:space=\"preserve\">\n    <value>NavigationMode is not available</value>\n  </data>\n  <data name=\"ServiceProviderDidNotHaveIProvideValueTarget\" xml:space=\"preserve\">\n    <value>The ServiceProvider did not provide a 'IProvideValueTarget'</value>\n  </data>\n</root>"
  },
  {
    "path": "src/Uno/Prism.Uno.Markup/AssemblyInfo.cs",
    "content": "﻿using Prism;\nusing Uno.Extensions.Markup.Generator;\n\n[assembly: GenerateMarkupForAssembly(typeof(PrismApplicationBase))]\n"
  },
  {
    "path": "src/Uno/Prism.Uno.Markup/Prism.Uno.WinUI.Markup.csproj",
    "content": "﻿<Project Sdk=\"Uno.Sdk\">\n  <PropertyGroup>\n    <TargetFrameworks>$(UnoTargetFrameworks)</TargetFrameworks>\n    <OutputType>Library</OutputType>\n    <GenerateLibraryLayout>true</GenerateLibraryLayout>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Uno.Extensions.Markup.Generators\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"Uno.WinUI.Markup\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Prism.Uno\\Prism.Uno.WinUI.csproj\" />\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": "src/Wpf/Prism.DryIoc.Wpf/GlobalSuppressions.cs",
    "content": "// This file is used by Code Analysis to maintain SuppressMessage \n// attributes that are applied to this project. \n// Project-level suppressions either have no target or are given \n// a specific target and scoped to a namespace, type, member, etc. \n//\n// To add a suppression to this file, right-click the message in the \n// Error List, point to \"Suppress Message(s)\", and click \n// \"In Project Suppression File\". \n// You do not need to add suppressions to this file manually. \n\n[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Design\", \"CA2210:AssembliesShouldHaveValidStrongNames\")]\n"
  },
  {
    "path": "src/Wpf/Prism.DryIoc.Wpf/Prism.DryIoc.Wpf.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project Sdk=\"Microsoft.NET.Sdk.WindowsDesktop\">\n\n  <PropertyGroup>\n    <TargetFrameworks>net462;net47;net8.0-windows;net9.0-windows;net10.0-windows</TargetFrameworks>\n    <UseWPF>true</UseWPF>\n    <RootNamespace>Prism.DryIoc</RootNamespace>\n    <PackageId>Prism.DryIoc</PackageId>\n    <!--<Summary>DryIoc extensions for Prism.</Summary>-->\n    <Description>Use these extensions to build Prism applications based on DryIoc.</Description>\n    <PackageTags>prism;dryioc;mvvm;wpf;xaml</PackageTags>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Prism.Container.DryIoc\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Prism.Wpf\\Prism.Wpf.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <Compile Update=\"Properties\\Resources.Designer.cs\" DesignTime=\"True\" AutoGen=\"True\" DependentUpon=\"Resources.resx\" />\n    <EmbeddedResource Update=\"Properties\\Resources.resx\" Generator=\"ResXFileCodeGenerator\" LastGenOutput=\"Resources.Designer.cs\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "src/Wpf/Prism.DryIoc.Wpf/PrismApplication.cs",
    "content": "using DryIoc;\nusing ExceptionExtensions = System.ExceptionExtensions;\n\nnamespace Prism.DryIoc\n{\n    /// <summary>\n    /// Base application class that uses <see cref=\"DryIocContainerExtension\"/> as it's container.\n    /// </summary>\n    public abstract class PrismApplication : PrismApplicationBase\n    {\n        /// <summary>\n        /// Create <see cref=\"Rules\" /> to alter behavior of <see cref=\"IContainer\" />\n        /// </summary>\n        /// <returns>An instance of <see cref=\"Rules\" /></returns>\n        protected virtual Rules CreateContainerRules() => DryIocContainerExtension.DefaultRules;\n\n        /// <summary>\n        /// Create a new <see cref=\"DryIocContainerExtension\"/> used by Prism.\n        /// </summary>\n        /// <returns>A new <see cref=\"DryIocContainerExtension\"/>.</returns>\n        protected override IContainerExtension CreateContainerExtension()\n        {\n            return new DryIocContainerExtension(CreateContainerRules());\n        }\n\n        /// <summary>\n        /// Registers the <see cref=\"Type\"/>s of the Exceptions that are not considered\n        /// root exceptions by the <see cref=\"ExceptionExtensions\"/>.\n        /// </summary>\n        protected override void RegisterFrameworkExceptionTypes()\n        {\n            ExceptionExtensions.RegisterFrameworkExceptionType(typeof(ContainerException));\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.DryIoc.Wpf/PrismBootstrapper.cs",
    "content": "using DryIoc;\n\nnamespace Prism.DryIoc\n{\n    /// <summary>\n    /// Base bootstrapper class that uses <see cref=\"DryIocContainerExtension\"/> as it's container.\n    /// </summary>\n    public abstract class PrismBootstrapper : PrismBootstrapperBase\n    {\n        /// <summary>\n        /// Create <see cref=\"Rules\" /> to alter behavior of <see cref=\"IContainer\" />\n        /// </summary>\n        /// <returns>An instance of <see cref=\"Rules\" /></returns>\n        protected virtual Rules CreateContainerRules() => DryIocContainerExtension.DefaultRules;\n\n        /// <summary>\n        /// Create a new <see cref=\"DryIocContainerExtension\"/> used by Prism.\n        /// </summary>\n        /// <returns>A new <see cref=\"DryIocContainerExtension\"/>.</returns>\n        protected override IContainerExtension CreateContainerExtension()\n        {\n            return new DryIocContainerExtension(CreateContainerRules());\n        }\n\n        /// <summary>\n        /// Registers the <see cref=\"Type\"/>s of the Exceptions that are not considered \n        /// root exceptions by the <see cref=\"ExceptionExtensions\"/>.\n        /// </summary>\n        protected override void RegisterFrameworkExceptionTypes()\n        {\n            ExceptionExtensions.RegisterFrameworkExceptionType(typeof(ContainerException));\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.DryIoc.Wpf/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\nusing System.Windows.Markup;\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n[assembly: XmlnsDefinition(\"http://prismlibrary.com/\", \"Prism.DryIoc\")]\n\n[assembly: InternalsVisibleTo(\"Prism.DryIoc.Wpf.Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001008f34b619d7a39e44cebe5ccbd5607eaa0784c9c124431ba336a14e4fecd874f151b57163961505e76943910c7cabea9c7229edc3553dfc33ac7b269087e5cef9404bdb491907ffd9f9b26d737fa2c359620a2cbf2802f54118471d7c0ead3b95c916783dd4b99b9b1a0cd2785e1b5d614d3d9140a60c8c64c217e1c2b0ec8296\")]\n"
  },
  {
    "path": "src/Wpf/Prism.DryIoc.Wpf/Properties/Resources.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.42000\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace Prism.DryIoc.Properties {\n    using System;\n    \n    \n    /// <summary>\n    ///   A strongly-typed resource class, for looking up localized strings, etc.\n    /// </summary>\n    // This class was auto-generated by the StronglyTypedResourceBuilder\n    // class via a tool like ResGen or Visual Studio.\n    // To add or remove a member, edit your .ResX file then rerun ResGen\n    // with the /str option, or rebuild your VS project.\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"16.0.0.0\")]\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    internal class Resources {\n        \n        private static global::System.Resources.ResourceManager resourceMan;\n        \n        private static global::System.Globalization.CultureInfo resourceCulture;\n        \n        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        internal Resources() {\n        }\n        \n        /// <summary>\n        ///   Returns the cached ResourceManager instance used by this class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Resources.ResourceManager ResourceManager {\n            get {\n                if (object.ReferenceEquals(resourceMan, null)) {\n                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"Prism.DryIoc.Properties.Resources\", typeof(Resources).Assembly);\n                    resourceMan = temp;\n                }\n                return resourceMan;\n            }\n        }\n        \n        /// <summary>\n        ///   Overrides the current thread's CurrentUICulture property for all\n        ///   resource lookups using this strongly typed resource class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Globalization.CultureInfo Culture {\n            get {\n                return resourceCulture;\n            }\n            set {\n                resourceCulture = value;\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The method &apos;GetModuleEnumerator&apos; of the bootstrapper must be overwritten in order to use the default module initialization logic..\n        /// </summary>\n        internal static string NotOverwrittenGetModuleEnumeratorException {\n            get {\n                return ResourceManager.GetString(\"NotOverwrittenGetModuleEnumeratorException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The ContainerBuilder is required and cannot be null..\n        /// </summary>\n        internal static string NullDryIocContainerBuilderException {\n            get {\n                return ResourceManager.GetString(\"NullDryIocContainerBuilderException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The IContainer is required and cannot be null..\n        /// </summary>\n        internal static string NullDryIocContainerException {\n            get {\n                return ResourceManager.GetString(\"NullDryIocContainerException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The ILoggerFacade is required and cannot be null..\n        /// </summary>\n        internal static string NullLoggerFacadeException {\n            get {\n                return ResourceManager.GetString(\"NullLoggerFacadeException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The IModuleCatalog is required and cannot be null in order to initialize the modules..\n        /// </summary>\n        internal static string NullModuleCatalogException {\n            get {\n                return ResourceManager.GetString(\"NullModuleCatalogException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Type &apos;{0}&apos; was already registered by the application. Skipping....\n        /// </summary>\n        internal static string TypeMappingAlreadyRegistered {\n            get {\n                return ResourceManager.GetString(\"TypeMappingAlreadyRegistered\", resourceCulture);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.DryIoc.Wpf/Properties/Resources.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <data name=\"NotOverwrittenGetModuleEnumeratorException\" xml:space=\"preserve\">\n    <value>The method 'GetModuleEnumerator' of the bootstrapper must be overwritten in order to use the default module initialization logic.</value>\n  </data>\n  <data name=\"NullDryIocContainerBuilderException\" xml:space=\"preserve\">\n    <value>The ContainerBuilder is required and cannot be null.</value>\n  </data>\n  <data name=\"NullDryIocContainerException\" xml:space=\"preserve\">\n    <value>The IContainer is required and cannot be null.</value>\n  </data>\n  <data name=\"NullLoggerFacadeException\" xml:space=\"preserve\">\n    <value>The ILoggerFacade is required and cannot be null.</value>\n  </data>\n  <data name=\"NullModuleCatalogException\" xml:space=\"preserve\">\n    <value>The IModuleCatalog is required and cannot be null in order to initialize the modules.</value>\n  </data>\n  <data name=\"TypeMappingAlreadyRegistered\" xml:space=\"preserve\">\n    <value>Type '{0}' was already registered by the application. Skipping...</value>\n  </data>\n</root>"
  },
  {
    "path": "src/Wpf/Prism.DryIoc.Wpf/build/Package.targets",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<Project>\n  <ItemGroup Condition=\" '$(ImplicitUsings)' == 'true' OR '$(ImplicitUsings)' == 'enable' \">\n    <Using Include=\"DryIoc\" />\n    <Using Include=\"Prism.DryIoc\" />\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": "src/Wpf/Prism.Unity.Wpf/GlobalSuppressions.cs",
    "content": "\n\n// This file is used by Code Analysis to maintain SuppressMessage \n// attributes that are applied to this project. \n// Project-level suppressions either have no target or are given \n// a specific target and scoped to a namespace, type, member, etc. \n//\n// To add a suppression to this file, right-click the message in the \n// Error List, point to \"Suppress Message(s)\", and click \n// \"In Project Suppression File\". \n// You do not need to add suppressions to this file manually. \n\n[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Design\", \"CA2210:AssembliesShouldHaveValidStrongNames\")]\n[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Design\", \"CA1020:AvoidNamespacesWithFewTypes\", Scope = \"namespace\", Target = \"Microsoft.Practices.Prism.UnityExtensions\")]\n[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Reliability\", \"CA2000:Dispose objects before losing scope\", Scope = \"member\", Target = \"Microsoft.Practices.Prism.UnityExtensions.UnityBootstrapper.#RegisterTypeIfMissing(System.Type,System.Type,System.Boolean)\")]\n"
  },
  {
    "path": "src/Wpf/Prism.Unity.Wpf/Prism.Unity.Wpf.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project Sdk=\"Microsoft.NET.Sdk.WindowsDesktop\">\n\n  <PropertyGroup>\n    <TargetFrameworks>net462;net47;net8.0-windows;net9.0-windows;net10.0-windows</TargetFrameworks>\n    <UseWPF>true</UseWPF>\n    <RootNamespace>Prism.Unity</RootNamespace>\n    <PackageId>Prism.Unity</PackageId>\n    <!--<Summary>Unity extensions for Prism.</Summary>-->\n    <Description>Use these extensions to build Prism applications based on Unity.</Description>\n    <PackageTags>prism;unity;mvvm;wpf;xaml</PackageTags>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Prism.Container.Unity\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Prism.Wpf\\Prism.Wpf.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <Compile Update=\"Properties\\Resources.Designer.cs\" DesignTime=\"True\" AutoGen=\"True\" DependentUpon=\"Resources.resx\" />\n    <EmbeddedResource Update=\"Properties\\Resources.resx\" Generator=\"ResXFileCodeGenerator\" LastGenOutput=\"Resources.Designer.cs\" />\n    <Compile Update=\"Properties\\Settings.Designer.cs\" DesignTimeSharedInput=\"True\" AutoGen=\"True\" DependentUpon=\"Settings.settings\" />\n    <None Update=\"Properties\\Settings.settings\" Generator=\"SettingsSingleFileGenerator\" LastGenOutput=\"Settings.Designer.cs\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "src/Wpf/Prism.Unity.Wpf/PrismApplication.cs",
    "content": "using Unity;\n\nnamespace Prism.Unity\n{\n    /// <summary>\n    /// Base application class that uses <see cref=\"UnityContainerExtension\"/> as it's container.\n    /// </summary>\n    public abstract class PrismApplication : PrismApplicationBase\n    {\n        /// <summary>\n        /// Create a new <see cref=\"UnityContainerExtension\"/> used by Prism.\n        /// </summary>\n        /// <returns>A new <see cref=\"UnityContainerExtension\"/>.</returns>\n        protected override IContainerExtension CreateContainerExtension()\n        {\n            return new UnityContainerExtension();\n        }\n\n        /// <summary>\n        /// Registers the <see cref=\"Type\"/>s of the Exceptions that are not considered \n        /// root exceptions by the <see cref=\"ExceptionExtensions\"/>.\n        /// </summary>\n        protected override void RegisterFrameworkExceptionTypes()\n        {\n            ExceptionExtensions.RegisterFrameworkExceptionType(typeof(ResolutionFailedException));\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Unity.Wpf/PrismBootstrapper.cs",
    "content": "using Unity;\n\nnamespace Prism.Unity\n{\n    /// <summary>\n    /// Base bootstrapper class that uses <see cref=\"UnityContainerExtension\"/> as it's container.\n    /// </summary>\n    public abstract class PrismBootstrapper : PrismBootstrapperBase\n    {\n        /// <summary>\n        /// Create a new <see cref=\"UnityContainerExtension\"/> used by Prism.\n        /// </summary>\n        /// <returns>A new <see cref=\"UnityContainerExtension\"/>.</returns>\n        protected override IContainerExtension CreateContainerExtension()\n        {\n            return new UnityContainerExtension();\n        }\n\n        /// <summary>\n        /// Registers the <see cref=\"Type\"/>s of the Exceptions that are not considered \n        /// root exceptions by the <see cref=\"ExceptionExtensions\"/>.\n        /// </summary>\n        protected override void RegisterFrameworkExceptionTypes()\n        {\n            ExceptionExtensions.RegisterFrameworkExceptionType(typeof(ResolutionFailedException));\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Unity.Wpf/Properties/AssemblyInfo.cs",
    "content": "﻿using System;\nusing System.Reflection;\nusing System.Resources;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\nusing System.Windows;\nusing System.Windows.Markup;\n\n[assembly: CLSCompliant(true)]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n//In order to begin building localizable applications, set \n//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file\n//inside a <PropertyGroup>.  For example, if you are using US english\n//in your source files, set the <UICulture> to en-US.  Then uncomment\n//the NeutralResourceLanguage attribute below.  Update the \"en-US\" in\n//the line below to match the UICulture setting in the project file.\n\n//[assembly: NeutralResourcesLanguage(\"en-US\", UltimateResourceFallbackLocation.Satellite)]\n\n\n[assembly: ThemeInfo(\n    ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located\n                                     //(used if a resource is not found in the page, \n                                     // or application resource dictionaries)\n    ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located\n                                              //(used if a resource is not found in the page, \n                                              // app, or any theme specific resource dictionaries)\n)]\n\n[assembly: XmlnsDefinition(\"http://prismlibrary.com/\", \"Prism.Unity\")]\n[assembly: InternalsVisibleTo(\"Prism.Unity.Wpf.Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001008f34b619d7a39e44cebe5ccbd5607eaa0784c9c124431ba336a14e4fecd874f151b57163961505e76943910c7cabea9c7229edc3553dfc33ac7b269087e5cef9404bdb491907ffd9f9b26d737fa2c359620a2cbf2802f54118471d7c0ead3b95c916783dd4b99b9b1a0cd2785e1b5d614d3d9140a60c8c64c217e1c2b0ec8296\")]\n"
  },
  {
    "path": "src/Wpf/Prism.Unity.Wpf/Properties/Resources.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.42000\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace Prism.Unity.Properties {\n    using System;\n    \n    \n    /// <summary>\n    ///   A strongly-typed resource class, for looking up localized strings, etc.\n    /// </summary>\n    // This class was auto-generated by the StronglyTypedResourceBuilder\n    // class via a tool like ResGen or Visual Studio.\n    // To add or remove a member, edit your .ResX file then rerun ResGen\n    // with the /str option, or rebuild your VS project.\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"16.0.0.0\")]\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    internal class Resources {\n        \n        private static global::System.Resources.ResourceManager resourceMan;\n        \n        private static global::System.Globalization.CultureInfo resourceCulture;\n        \n        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        internal Resources() {\n        }\n        \n        /// <summary>\n        ///   Returns the cached ResourceManager instance used by this class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Resources.ResourceManager ResourceManager {\n            get {\n                if (object.ReferenceEquals(resourceMan, null)) {\n                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"Prism.Unity.Properties.Resources\", typeof(Resources).Assembly);\n                    resourceMan = temp;\n                }\n                return resourceMan;\n            }\n        }\n        \n        /// <summary>\n        ///   Overrides the current thread's CurrentUICulture property for all\n        ///   resource lookups using this strongly typed resource class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Globalization.CultureInfo Culture {\n            get {\n                return resourceCulture;\n            }\n            set {\n                resourceCulture = value;\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The method &apos;GetModuleEnumerator&apos; of the bootstrapper must be overwritten in order to use the default module initialization logic..\n        /// </summary>\n        internal static string NotOverwrittenGetModuleEnumeratorException {\n            get {\n                return ResourceManager.GetString(\"NotOverwrittenGetModuleEnumeratorException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The ILoggerFacade is required and cannot be null..\n        /// </summary>\n        internal static string NullLoggerFacadeException {\n            get {\n                return ResourceManager.GetString(\"NullLoggerFacadeException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The IModuleCatalog is required and cannot be null in order to initialize the modules..\n        /// </summary>\n        internal static string NullModuleCatalogException {\n            get {\n                return ResourceManager.GetString(\"NullModuleCatalogException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The IUnityContainer is required and cannot be null..\n        /// </summary>\n        internal static string NullUnityContainerException {\n            get {\n                return ResourceManager.GetString(\"NullUnityContainerException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Setting the RegionManager..\n        /// </summary>\n        internal static string SettingTheRegionManager {\n            get {\n                return ResourceManager.GetString(\"SettingTheRegionManager\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Type &apos;{0}&apos; was already registered by the application. Skipping....\n        /// </summary>\n        internal static string TypeMappingAlreadyRegistered {\n            get {\n                return ResourceManager.GetString(\"TypeMappingAlreadyRegistered\", resourceCulture);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Unity.Wpf/Properties/Resources.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <data name=\"NotOverwrittenGetModuleEnumeratorException\" xml:space=\"preserve\">\n    <value>The method 'GetModuleEnumerator' of the bootstrapper must be overwritten in order to use the default module initialization logic.</value>\n  </data>\n  <data name=\"NullLoggerFacadeException\" xml:space=\"preserve\">\n    <value>The ILoggerFacade is required and cannot be null.</value>\n  </data>\n  <data name=\"NullModuleCatalogException\" xml:space=\"preserve\">\n    <value>The IModuleCatalog is required and cannot be null in order to initialize the modules.</value>\n  </data>\n  <data name=\"NullUnityContainerException\" xml:space=\"preserve\">\n    <value>The IUnityContainer is required and cannot be null.</value>\n  </data>\n  <data name=\"SettingTheRegionManager\" xml:space=\"preserve\">\n    <value>Setting the RegionManager.</value>\n  </data>\n  <data name=\"TypeMappingAlreadyRegistered\" xml:space=\"preserve\">\n    <value>Type '{0}' was already registered by the application. Skipping...</value>\n  </data>\n</root>"
  },
  {
    "path": "src/Wpf/Prism.Unity.Wpf/Properties/Settings.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.42000\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace Prism.Unity.Properties {\n    \n    \n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator\", \"16.5.0.0\")]\n    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {\n        \n        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));\n        \n        public static Settings Default {\n            get {\n                return defaultInstance;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Unity.Wpf/Properties/Settings.settings",
    "content": "﻿<?xml version='1.0' encoding='utf-8'?>\n<SettingsFile xmlns=\"uri:settings\" CurrentProfile=\"(Default)\">\n  <Profiles>\n    <Profile Name=\"(Default)\" />\n  </Profiles>\n  <Settings />\n</SettingsFile>"
  },
  {
    "path": "src/Wpf/Prism.Unity.Wpf/app.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <runtime>\n    <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n      <dependentAssembly>\n        <assemblyIdentity name=\"Microsoft.Practices.ServiceLocation\" publicKeyToken=\"31bf3856ad364e35\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-1.3.0.0\" newVersion=\"1.3.0.0\" />\n      </dependentAssembly>\n    </assemblyBinding>\n  </runtime>\n</configuration>"
  },
  {
    "path": "src/Wpf/Prism.Unity.Wpf/build/Package.targets",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<Project>\n  <ItemGroup Condition=\" '$(ImplicitUsings)' == 'true' OR '$(ImplicitUsings)' == 'enable' \">\n    <Using Include=\"Unity\" />\n    <Using Include=\"Prism.Unity\" />\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Common/MvvmHelpers.cs",
    "content": "using System.ComponentModel;\nusing Prism.Mvvm;\n\nnamespace Prism.Common\n{\n    /// <summary>\n    /// Helper class for MVVM.\n    /// </summary>\n    public static class MvvmHelpers\n    {\n#if UNO_WINUI\n        /// <summary>\n        /// Sets the AutowireViewModel property to true for the <paramref name=\"viewOrViewModel\"/>.\n        /// </summary>\n        /// <remarks>\n        /// The AutoWireViewModel property will only be set to true if the view\n        /// is a <see cref=\"FrameworkElement\"/>, the DataContext of the view is null, and\n        /// the AutoWireViewModel property of the view is null.\n        /// </remarks>\n        /// <param name=\"viewOrViewModel\">The View or ViewModel.</param>\n        [EditorBrowsable(EditorBrowsableState.Never)]\n        public static void AutowireViewModel(object viewOrViewModel)\n        {\n            if (viewOrViewModel is FrameworkElement view && view.DataContext is null && ViewModelLocator.GetAutowireViewModel(view) is null)\n            {\n                ViewModelLocator.SetAutowireViewModel(view, true);\n            }\n        }\n#else\n        /// <summary>\n        /// Sets the AutoWireViewModel property to true for the <paramref name=\"viewOrViewModel\"/>.\n        /// </summary>\n        /// <remarks>\n        /// The AutoWireViewModel property will only be set to true if the view\n        /// is a <see cref=\"FrameworkElement\"/>, the DataContext of the view is null, and\n        /// the AutoWireViewModel property of the view is null.\n        /// </remarks>\n        /// <param name=\"viewOrViewModel\">The View or ViewModel.</param>\n        [EditorBrowsable(EditorBrowsableState.Never)]\n        public static void AutowireViewModel(object viewOrViewModel)\n        {\n            if (viewOrViewModel is FrameworkElement view && view.DataContext is null && ViewModelLocator.GetAutoWireViewModel(view) is null)\n            {\n                ViewModelLocator.SetAutoWireViewModel(view, true);\n            }\n        }\n#endif\n\n        /// <summary>\n        /// Perform an <see cref=\"Action{T}\"/> on a view and ViewModel.\n        /// </summary>\n        /// <remarks>\n        /// The action will be performed on the view and its ViewModel if they implement <typeparamref name=\"T\"/>.\n        /// </remarks>\n        /// <typeparam name=\"T\">The <see cref=\"Action{T}\"/> parameter type.</typeparam>\n        /// <param name=\"view\">The view to perform the <see cref=\"Action{T}\"/> on.</param>\n        /// <param name=\"action\">The <see cref=\"Action{T}\"/> to perform.</param>\n        public static void ViewAndViewModelAction<T>(object view, Action<T> action) where T : class\n        {\n            if (view is T viewAsT)\n                action(viewAsT);\n\n            if (view is FrameworkElement element && element.DataContext is T viewModelAsT)\n            {\n                action(viewModelAsT);\n            }\n        }\n\n        /// <summary>\n        /// Get an implementer from a View or ViewModel.\n        /// </summary>\n        /// <remarks>\n        /// If the view implements <typeparamref name=\"T\"/> it will be returned.\n        /// Otherwise if the view's <see cref=\"FrameworkElement.DataContext\"/> implements <typeparamref name=\"T\"/> it will be returned instead.\n        /// </remarks>\n        /// <typeparam name=\"T\">The implementer type to get.</typeparam>\n        /// <param name=\"view\">The view to get <typeparamref name=\"T\"/> from.</param>\n        /// <returns>View or ViewModel as <typeparamref name=\"T\"/>.</returns>\n        public static T GetImplementerFromViewOrViewModel<T>(object view) where T : class\n        {\n            if (view is T viewAsT)\n            {\n                return viewAsT;\n            }\n\n            if (view is FrameworkElement element && element.DataContext is T vmAsT)\n            {\n                return vmAsT;\n            }\n\n            return null;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Common/ObservableObject.cs",
    "content": "using System.ComponentModel;\n\nnamespace Prism.Common\n{\n    /// <summary>\n    /// Class that wraps an object, so that other classes can notify for Change events. Typically, this class is set as\n    /// a Dependency Property on DependencyObjects, and allows other classes to observe any changes in the Value.\n    /// </summary>\n    /// <remarks>\n    /// This class is required, because in Silverlight, it's not possible to receive Change notifications for Dependency properties that you do not own.\n    /// </remarks>\n    /// <typeparam name=\"T\">The type of the property that's wrapped in the Observable object</typeparam>\n    public partial class ObservableObject<T> : FrameworkElement, INotifyPropertyChanged\n    {\n        /// <summary>\n        /// Identifies the Value property of the ObservableObject\n        /// </summary>\n        [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Design\", \"CA1000:DoNotDeclareStaticMembersOnGenericTypes\", Justification = \"This is the pattern for WPF dependency properties\")]\n        public static readonly DependencyProperty ValueProperty =\n                DependencyProperty.Register(nameof(Value), typeof(T), typeof(ObservableObject<T>), new PropertyMetadata(null, ValueChangedCallback));\n\n        /// <summary>\n        /// Event that gets invoked when the Value property changes.\n        /// </summary>\n        public event PropertyChangedEventHandler PropertyChanged;\n\n        /// <summary>\n        /// The value that's wrapped inside the ObservableObject.\n        /// </summary>\n        [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Naming\", \"CA1721:PropertyNamesShouldNotMatchGetMethods\")]\n        public T Value\n        {\n            get => (T)GetValue(ValueProperty);\n            set => SetValue(ValueProperty, value);\n        }\n\n        private static void ValueChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            ObservableObject<T> thisInstance = ((ObservableObject<T>)d);\n            thisInstance.PropertyChanged?.Invoke(thisInstance, new PropertyChangedEventArgs(nameof(Value)));\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Dialogs/Dialog.cs",
    "content": "namespace Prism.Dialogs\n{\n    /// <summary>\n    /// This class contains <see cref=\"IDialogWindow\"/> attached properties.\n    /// </summary>\n    public class Dialog\n    {\n        /// <summary>\n        /// Identifies the WindowStyle attached property.\n        /// </summary>\n        /// <remarks>\n        /// This attached property is used to specify the style of a <see cref=\"IDialogWindow\"/>.\n        /// </remarks>\n        public static readonly DependencyProperty WindowStyleProperty =\n            DependencyProperty.RegisterAttached(\"WindowStyle\", typeof(Style), typeof(Dialog), new PropertyMetadata(null));\n\n        /// <summary>\n        /// Gets the value for the <see cref=\"WindowStyleProperty\"/> attached property.\n        /// </summary>\n        /// <param name=\"obj\">The target element.</param>\n        /// <returns>The <see cref=\"WindowStyleProperty\"/> attached to the <paramref name=\"obj\"/> element.</returns>\n        public static Style GetWindowStyle(DependencyObject obj)\n        {\n            return (Style)obj.GetValue(WindowStyleProperty);\n        }\n\n        /// <summary>\n        /// Sets the <see cref=\"WindowStyleProperty\"/> attached property.\n        /// </summary>\n        /// <param name=\"obj\">The target element.</param>\n        /// <param name=\"value\">The Style to attach.</param>\n        public static void SetWindowStyle(DependencyObject obj, Style value)\n        {\n            obj.SetValue(WindowStyleProperty, value);\n        }\n\n#if !UNO_WINUI\n        /// <summary>\n        /// Identifies the WindowStartupLocation attached property.\n        /// </summary>\n        /// <remarks>\n        /// This attached property is used to specify the startup location of a <see cref=\"IDialogWindow\"/>.\n        /// </remarks>\n        public static readonly DependencyProperty WindowStartupLocationProperty =\n            DependencyProperty.RegisterAttached(\"WindowStartupLocation\", typeof(WindowStartupLocation), typeof(Dialog), new UIPropertyMetadata(OnWindowStartupLocationChanged));\n\n        /// <summary>\n        /// Gets the value for the <see cref=\"WindowStartupLocationProperty\"/> attached property.\n        /// </summary>\n        /// <param name=\"obj\">The target element.</param>\n        /// <returns>The <see cref=\"WindowStartupLocationProperty\"/> attached to the <paramref name=\"obj\"/> element.</returns>\n        public static WindowStartupLocation GetWindowStartupLocation(DependencyObject obj)\n        {\n            return (WindowStartupLocation)obj.GetValue(WindowStartupLocationProperty);\n        }\n\n        /// <summary>\n        /// Sets the <see cref=\"WindowStartupLocationProperty\"/> attached property.\n        /// </summary>\n        /// <param name=\"obj\">The target element.</param>\n        /// <param name=\"value\">The WindowStartupLocation to attach.</param>\n        public static void SetWindowStartupLocation(DependencyObject obj, WindowStartupLocation value)\n        {\n            obj.SetValue(WindowStartupLocationProperty, value);\n        }\n\n        private static void OnWindowStartupLocationChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)\n        {\n            if (sender is Window window)\n                window.WindowStartupLocation = (WindowStartupLocation)e.NewValue;\n        }\n#endif\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Dialogs/DialogService.cs",
    "content": "using System.ComponentModel;\nusing Prism.Common;\n\nnamespace Prism.Dialogs\n{\n    /// <summary>\n    /// Implements <see cref=\"IDialogService\"/> to show modal and non-modal dialogs.\n    /// </summary>\n    /// <remarks>\n    /// The dialog's ViewModel must implement IDialogAware.\n    /// </remarks>\n    public class DialogService : IDialogService\n    {\n        private readonly IContainerExtension _containerExtension;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DialogService\"/> class.\n        /// </summary>\n        /// <param name=\"containerExtension\">The <see cref=\"IContainerExtension\" /></param>\n        public DialogService(IContainerExtension containerExtension)\n        {\n            _containerExtension = containerExtension;\n        }\n\n        /// <summary>\n        /// Shows a modal dialog.\n        /// </summary>\n        /// <param name=\"name\">The name of the dialog to show.</param>\n        /// <param name=\"parameters\">The parameters to pass to the dialog.</param>\n        /// <param name=\"callback\">The action to perform when the dialog is closed.</param>\n        public void ShowDialog(string name, IDialogParameters parameters, DialogCallback callback)\n        {\n            parameters ??= new DialogParameters();\n            var isModal = parameters.TryGetValue<bool>(KnownDialogParameters.ShowNonModal, out var show) ? !show : true;\n            var windowName = parameters.TryGetValue<string>(KnownDialogParameters.WindowName, out var wName) ? wName : null;\n\n            IDialogWindow dialogWindow = CreateDialogWindow(windowName);\n            ConfigureDialogWindowEvents(dialogWindow, callback);\n            ConfigureDialogWindowContent(name, dialogWindow, parameters);\n\n            ShowDialogWindow(dialogWindow, isModal);\n        }\n\n        /// <summary>\n        /// Shows the dialog window.\n        /// </summary>\n        /// <param name=\"dialogWindow\">The dialog window to show.</param>\n        /// <param name=\"isModal\">If true; dialog is shown as a modal</param>\n        protected virtual void ShowDialogWindow(IDialogWindow dialogWindow, bool isModal)\n        {\n            if (isModal)\n                dialogWindow.ShowDialog();\n            else\n                dialogWindow.Show();\n        }\n\n        /// <summary>\n        /// Create a new <see cref=\"IDialogWindow\"/>.\n        /// </summary>\n        /// <param name=\"name\">The name of the hosting window registered with the IContainerRegistry.</param>\n        /// <returns>The created <see cref=\"IDialogWindow\"/>.</returns>\n        protected virtual IDialogWindow CreateDialogWindow(string name)\n        {\n            if (string.IsNullOrWhiteSpace(name))\n                return _containerExtension.Resolve<IDialogWindow>();\n            else\n                return _containerExtension.Resolve<IDialogWindow>(name);\n        }\n\n        /// <summary>\n        /// Configure <see cref=\"IDialogWindow\"/> content.\n        /// </summary>\n        /// <param name=\"dialogName\">The name of the dialog to show.</param>\n        /// <param name=\"window\">The hosting window.</param>\n        /// <param name=\"parameters\">The parameters to pass to the dialog.</param>\n        protected virtual void ConfigureDialogWindowContent(string dialogName, IDialogWindow window, IDialogParameters parameters)\n        {\n            var content = _containerExtension.Resolve<object>(dialogName);\n            if (!(content is FrameworkElement dialogContent))\n                throw new NullReferenceException(\"A dialog's content must be a FrameworkElement\");\n\n            MvvmHelpers.AutowireViewModel(dialogContent);\n\n            if (!(dialogContent.DataContext is IDialogAware viewModel))\n                throw new NullReferenceException(\"A dialog's ViewModel must implement the IDialogAware interface\");\n\n            ConfigureDialogWindowProperties(window, dialogContent, viewModel);\n\n            MvvmHelpers.ViewAndViewModelAction<IDialogAware>(viewModel, d => d.OnDialogOpened(parameters));\n        }\n\n        /// <summary>\n        /// Configure <see cref=\"IDialogWindow\"/> and <see cref=\"IDialogAware\"/> events.\n        /// </summary>\n        /// <param name=\"dialogWindow\">The hosting window.</param>\n        /// <param name=\"callback\">The action to perform when the dialog is closed.</param>\n        protected virtual void ConfigureDialogWindowEvents(IDialogWindow dialogWindow, DialogCallback callback)\n        {\n            Action<IDialogResult> requestCloseHandler = (r) =>\n            {\n                dialogWindow.Result = r;\n                dialogWindow.Close();\n            };\n\n            RoutedEventHandler loadedHandler = null;\n            loadedHandler = (o, e) =>\n            {\n                dialogWindow.Loaded -= loadedHandler;\n                DialogUtilities.InitializeListener(dialogWindow.GetDialogViewModel(), requestCloseHandler);\n            };\n            dialogWindow.Loaded += loadedHandler;\n\n            CancelEventHandler closingHandler = null;\n            closingHandler = (o, e) =>\n            {\n                if (!dialogWindow.GetDialogViewModel().CanCloseDialog())\n                    e.Cancel = true;\n            };\n            dialogWindow.Closing += closingHandler;\n\n            EventHandler closedHandler = null;\n            closedHandler = async (o, e) =>\n                {\n                    dialogWindow.Closed -= closedHandler;\n                    dialogWindow.Closing -= closingHandler;\n\n                    dialogWindow.GetDialogViewModel().OnDialogClosed();\n\n                    if (dialogWindow.Result == null)\n                        dialogWindow.Result = new DialogResult();\n\n                    await callback.Invoke(dialogWindow.Result);\n\n                    dialogWindow.DataContext = null;\n                    dialogWindow.Content = null;\n                };\n            dialogWindow.Closed += closedHandler;\n        }\n\n        /// <summary>\n        /// Configure <see cref=\"IDialogWindow\"/> properties.\n        /// </summary>\n        /// <param name=\"window\">The hosting window.</param>\n        /// <param name=\"dialogContent\">The dialog to show.</param>\n        /// <param name=\"viewModel\">The dialog's ViewModel.</param>\n        protected virtual void ConfigureDialogWindowProperties(IDialogWindow window, FrameworkElement dialogContent, IDialogAware viewModel)\n        {\n            var windowStyle = Dialog.GetWindowStyle(dialogContent);\n            if (windowStyle != null)\n                window.Style = windowStyle;\n\n            window.Content = dialogContent;\n            window.DataContext = viewModel; //we want the host window and the dialog to share the same data context\n\n            if (window.Owner == null)\n                window.Owner = Application.Current?.Windows.OfType<Window>().FirstOrDefault(x => x.IsActive);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Dialogs/DialogWindow.xaml",
    "content": "﻿<Window x:Class=\"Prism.Dialogs.DialogWindow\"\n        xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n        xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n        Title=\"{Binding Title}\"\n        WindowStartupLocation=\"CenterOwner\">\n    <Window.Style>\n        <Style TargetType=\"{x:Type Window}\" >\n            <Setter Property=\"SizeToContent\" Value=\"WidthAndHeight\" />\n        </Style>\n    </Window.Style>\n\n</Window>\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Dialogs/DialogWindow.xaml.cs",
    "content": "namespace Prism.Dialogs\n{\n    /// <summary>\n    /// Prism's default dialog host.\n    /// </summary>\n    public partial class DialogWindow : Window, IDialogWindow\n    {\n        /// <summary>\n        /// The <see cref=\"IDialogResult\"/> of the dialog.\n        /// </summary>\n        public IDialogResult Result { get; set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DialogWindow\"/> class.\n        /// </summary>\n        public DialogWindow()\n        {\n            InitializeComponent();\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Dialogs/IDialogServiceCompatExtensions.cs",
    "content": "namespace Prism.Dialogs\n{\n    /// <summary>\n    /// Extensions for the IDialogService\n    /// </summary>\n    public static class IDialogServiceCompatExtensions\n    {\n#if !UNO_WINUI\n        /// <summary>\n        /// Shows a non-modal dialog.\n        /// </summary>\n        /// <param name=\"dialogService\">The DialogService</param>\n        /// <param name=\"name\">The name of the dialog to show.</param>\n        public static void Show(this IDialogService dialogService, string name)\n        {\n            Show(dialogService, name, null, null, null);\n        }\n\n        /// <summary>\n        /// Shows a non-modal dialog.\n        /// </summary>\n        /// <param name=\"dialogService\">The DialogService</param>\n        /// <param name=\"name\">The name of the dialog to show.</param>\n        /// <param name=\"callback\">The action to perform when the dialog is closed.</param>\n        public static void Show(this IDialogService dialogService, string name, Action<IDialogResult> callback)\n        {\n            Show(dialogService, name, null, callback, null);\n        }\n\n        /// <summary>\n        /// Shows a non-modal dialog.\n        /// </summary>\n        /// <param name=\"dialogService\">The DialogService</param>\n        /// <param name=\"name\">The name of the dialog to show.</param>\n        /// <param name=\"parameters\">The parameters to pass to the dialog.</param>\n        /// <param name=\"callback\">The action to perform when the dialog is closed.</param>\n        public static void Show(this IDialogService dialogService, string name, IDialogParameters parameters, Action<IDialogResult> callback)\n        {\n            Show(dialogService, name, parameters, callback, null);\n        }\n\n        /// <summary>\n        /// Shows a non-modal dialog.\n        /// </summary>\n        /// <param name=\"dialogService\">The DialogService</param>\n        /// <param name=\"name\">The name of the dialog to show.</param>\n        /// <param name=\"parameters\">The parameters to pass to the dialog.</param>\n        /// <param name=\"callback\">The action to perform when the dialog is closed.</param>\n        /// <param name=\"windowName\">The name of the hosting window registered with the IContainerRegistry.</param>\n        public static void Show(this IDialogService dialogService, string name, IDialogParameters parameters, Action<IDialogResult> callback, string windowName)\n        {\n            ShowDialogInternal(dialogService, name, parameters, callback, windowName, true);\n        }\n\n        /// <summary>\n        /// Shows a modal dialog.\n        /// </summary>\n        /// <param name=\"dialogService\">The DialogService</param>\n        /// <param name=\"name\">The name of the dialog to show.</param>\n        /// <param name=\"parameters\">The parameters to pass to the dialog.</param>\n        /// <param name=\"callback\">The action to perform when the dialog is closed.</param>\n        /// <param name=\"windowName\">The name of the hosting window registered with the IContainerRegistry.</param>\n        public static void ShowDialog(this IDialogService dialogService, string name, IDialogParameters parameters, Action<IDialogResult> callback, string windowName)\n        {\n            ShowDialogInternal(dialogService, name, parameters, callback, windowName, false);\n        }\n\n        private static void ShowDialogInternal(IDialogService dialogService, string name, IDialogParameters parameters, Action<IDialogResult> callback, string windowName, bool isNonModal)\n        {\n            parameters ??= new DialogParameters();\n\n            if (!string.IsNullOrEmpty(windowName))\n                parameters.Add(KnownDialogParameters.WindowName, windowName);\n\n            if (isNonModal)\n                parameters.Add(KnownDialogParameters.ShowNonModal, true);\n\n            dialogService.ShowDialog(name, parameters, new DialogCallback().OnClose(callback));\n        }\n#endif\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Dialogs/IDialogWindow.cs",
    "content": "using System.ComponentModel;\n\nnamespace Prism.Dialogs\n{\n    /// <summary>\n    /// Interface for a dialog hosting window.\n    /// </summary>\n    public interface IDialogWindow\n    {\n        /// <summary>\n        /// Dialog content.\n        /// </summary>\n        object Content { get; set; }\n\n        /// <summary>\n        /// Close the window.\n        /// </summary>\n        void Close();\n\n        /// <summary>\n        /// The window's owner.\n        /// </summary>\n        Window Owner { get; set; }\n\n        /// <summary>\n        /// Show a non-modal dialog.\n        /// </summary>\n        void Show();\n\n        /// <summary>\n        /// Show a modal dialog.\n        /// </summary>\n        /// <returns></returns>\n        bool? ShowDialog();\n\n        /// <summary>\n        /// The data context of the window.\n        /// </summary>\n        /// <remarks>\n        /// The data context must implement <see cref=\"IDialogAware\"/>.\n        /// </remarks>\n        object DataContext { get; set; }\n\n        /// <summary>\n        /// Called when the window is loaded.\n        /// </summary>\n        event RoutedEventHandler Loaded;\n\n        /// <summary>\n        /// Called when the window is closed.\n        /// </summary>\n        event EventHandler Closed;\n\n        /// <summary>\n        /// Called when the window is closing.\n        /// </summary>\n        event CancelEventHandler Closing;\n\n        /// <summary>\n        /// The result of the dialog.\n        /// </summary>\n        IDialogResult Result { get; set; }\n\n        /// <summary>\n        /// The window style.\n        /// </summary>\n        Style Style { get; set; }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Dialogs/IDialogWindowExtensions.cs",
    "content": "﻿namespace Prism.Dialogs\n{\n    /// <summary>\n    /// <see cref=\"IDialogWindow\"/> extensions.\n    /// </summary>\n    internal static class IDialogWindowExtensions\n    {\n        /// <summary>\n        /// Get the <see cref=\"IDialogAware\"/> ViewModel from a <see cref=\"IDialogWindow\"/>.\n        /// </summary>\n        /// <param name=\"dialogWindow\"><see cref=\"IDialogWindow\"/> to get ViewModel from.</param>\n        /// <returns>ViewModel as a <see cref=\"IDialogAware\"/>.</returns>\n        internal static IDialogAware GetDialogViewModel(this IDialogWindow dialogWindow)\n        {\n            return (IDialogAware)dialogWindow.DataContext;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Dialogs/KnownDialogParameters.cs",
    "content": "﻿namespace Prism.Dialogs;\n\n/// <summary>\n/// Provides Dialog Parameter Keys for well known paramotors used by the <see cref=\"IDialogService\"/>\n/// </summary>\npublic static class KnownDialogParameters\n{\n    /// <summary>\n    /// The name of the window\n    /// </summary>\n    public const string WindowName = \"windowName\";\n\n#if UNO_WINUI\n    /// <summary>\n    /// The <see cref=\"Microsoft.UI.Xaml.Controls.ContentDialogPlacement\"/> to use when showing the dialog\n    /// </summary>\n    public const string DialogPlacement = \"dialogPlacement\";\n#else\n    /// <summary>\n    /// Flag to show the Dialog Modally or Non-Modally\n    /// </summary>\n    public const string ShowNonModal = \"nonModal\";\n#endif\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Extensions/CollectionExtensions.cs",
    "content": "namespace System.Collections.ObjectModel\n{\n    /// <summary>\n    /// Class that provides extension methods to Collection\n    /// </summary>\n    public static class CollectionExtensions\n    {\n        /// <summary>\n        /// Add a range of items to a collection.\n        /// </summary>\n        /// <typeparam name=\"T\">Type of objects within the collection.</typeparam>\n        /// <param name=\"collection\">The collection to add items to.</param>\n        /// <param name=\"items\">The items to add to the collection.</param>\n        /// <returns>The collection.</returns>\n        /// <exception cref=\"ArgumentNullException\">An <see cref=\"System.ArgumentNullException\"/> is thrown if <paramref name=\"collection\"/> or <paramref name=\"items\"/> is <see langword=\"null\"/>.</exception>\n        public static Collection<T> AddRange<T>(this Collection<T> collection, IEnumerable<T> items)\n        {\n            if (collection == null)\n                throw new ArgumentNullException(nameof(collection));\n            if (items == null)\n                throw new ArgumentNullException(nameof(items));\n\n            foreach (var each in items)\n            {\n                collection.Add(each);\n            }\n\n            return collection;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Extensions/DependencyObjectExtensions.cs",
    "content": "namespace Prism\n{\n    internal static partial class DependencyObjectExtensions\n    {\n        /// <summary>\n        /// Determines if a <see cref=\"DependencyProperty\"/> has a binding set\n        /// </summary>\n        /// <param name=\"instance\">The to use to search for the property</param>\n        /// <param name=\"property\">The property to search</param>\n        /// <returns><c>true</c> if there is an active binding, otherwise <c>false</c></returns>\n        public static bool HasBinding(this FrameworkElement instance, DependencyProperty property) =>\n            BindingOperations.GetBinding(instance, property) is not null;\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Interactivity/CommandBehaviorBase.cs",
    "content": "using System.Windows.Input;\n#if AVALONIA\nusing Avalonia.Controls;\n#endif\n\nnamespace Prism.Interactivity\n{\n    /// <summary>\n    /// Base behavior to handle connecting a <see cref=\"Control\"/> to a Command.\n    /// </summary>\n    /// <typeparam name=\"T\">The target object must derive from Control.</typeparam>\n    /// <remarks>\n    /// CommandBehaviorBase can be used to provide new behaviors for commands.\n    /// </remarks>\n#if !AVALONIA\n    public class CommandBehaviorBase<T> where T : UIElement\n#else\n    public class CommandBehaviorBase<T> where T : Control\n#endif\n    {\n        private ICommand _command;\n        private object _commandParameter;\n        private readonly WeakReference _targetObject;\n        private readonly EventHandler _commandCanExecuteChangedHandler;\n\n        /// <summary>\n        /// Constructor specifying the target object.\n        /// </summary>\n        /// <param name=\"targetObject\">The target object the behavior is attached to.</param>\n        public CommandBehaviorBase(T targetObject)\n        {\n            _targetObject = new WeakReference(targetObject);\n\n            _commandCanExecuteChangedHandler = CommandCanExecuteChanged;\n        }\n\n        bool _autoEnabled = true;\n        /// <summary>\n        /// If <c>true</c> the target object's IsEnabled property will update based on the commands ability to execute.\n        /// If <c>false</c> the target object's IsEnabled property will not update.\n        /// </summary>\n        public bool AutoEnable\n        {\n            get { return _autoEnabled; }\n            set\n            {\n                _autoEnabled = value;\n                UpdateEnabledState();\n            }\n        }\n\n        /// <summary>\n        /// Corresponding command to be execute and monitored for <see cref=\"ICommand.CanExecuteChanged\"/>.\n        /// </summary>\n        public ICommand Command\n        {\n            get { return _command; }\n            set\n            {\n                if (_command != null)\n                {\n                    _command.CanExecuteChanged -= _commandCanExecuteChangedHandler;\n                }\n\n                _command = value;\n                if (_command != null)\n                {\n                    _command.CanExecuteChanged += _commandCanExecuteChangedHandler;\n                    UpdateEnabledState();\n                }\n            }\n        }\n\n        /// <summary>\n        /// The parameter to supply the command during execution.\n        /// </summary>\n        public object CommandParameter\n        {\n            get { return _commandParameter; }\n            set\n            {\n                if (_commandParameter != value)\n                {\n                    _commandParameter = value;\n                    UpdateEnabledState();\n                }\n            }\n        }\n\n        /// <summary>\n        /// Object to which this behavior is attached.\n        /// </summary>\n        protected T TargetObject\n        {\n            get\n            {\n                return _targetObject.Target as T;\n            }\n        }\n\n        /// <summary>\n        /// Updates the target object's IsEnabled property based on the commands ability to execute.\n        /// </summary>\n        protected virtual void UpdateEnabledState()\n        {\n            if (TargetObject == null)\n            {\n                Command = null;\n                CommandParameter = null;\n            }\n            else if (Command != null)\n            {\n#if UNO_WINUI\n                if (AutoEnable && TargetObject is Control control)\n                    control.IsEnabled = Command.CanExecute(CommandParameter);\n#else\n                if (AutoEnable)\n                    TargetObject.IsEnabled = Command.CanExecute(CommandParameter);\n#endif\n            }\n        }\n\n        private void CommandCanExecuteChanged(object sender, EventArgs e)\n        {\n            UpdateEnabledState();\n        }\n\n        /// <summary>\n        /// Executes the command, if it's set, providing the <see cref=\"CommandParameter\"/>.\n        /// </summary>\n        protected virtual void ExecuteCommand(object parameter)\n        {\n            if (Command != null)\n                Command.Execute(CommandParameter ?? parameter);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Interactivity/InvokeCommandAction.cs",
    "content": "using System.Reflection;\nusing System.Windows.Input;\nusing Microsoft.Xaml.Behaviors;\n\nnamespace Prism.Interactivity\n{\n    /// <summary>\n    /// Trigger action that executes a command when invoked. \n    /// It also maintains the Enabled state of the target control based on the CanExecute method of the command.\n    /// </summary>\n    public class InvokeCommandAction : TriggerAction<UIElement>\n    {\n        private ExecutableCommandBehavior _commandBehavior;\n\n        /// <summary>\n        /// Dependency property identifying if the associated element should automatically be enabled or disabled based on the result of the Command's CanExecute\n        /// </summary>\n        public static readonly DependencyProperty AutoEnableProperty =\n            DependencyProperty.Register(nameof(AutoEnable), typeof(bool), typeof(InvokeCommandAction),\n                new PropertyMetadata(true, (d, e) => ((InvokeCommandAction)d).OnAllowDisableChanged((bool)e.NewValue)));\n\n        /// <summary>\n        /// Gets or sets whether or not the associated element will automatically be enabled or disabled based on the result of the commands CanExecute\n        /// </summary>\n        public bool AutoEnable\n        {\n            get { return (bool)GetValue(AutoEnableProperty); }\n            set { SetValue(AutoEnableProperty, value); }\n        }\n\n        private void OnAllowDisableChanged(bool newValue)\n        {\n            var behavior = GetOrCreateBehavior();\n            if (behavior != null)\n                behavior.AutoEnable = newValue;\n        }\n\n        /// <summary>\n        /// Dependency property identifying the command to execute when invoked.\n        /// </summary>\n        public static readonly DependencyProperty CommandProperty =\n            DependencyProperty.Register(nameof(Command), typeof(ICommand), typeof(InvokeCommandAction),\n                new PropertyMetadata(null, (d, e) => ((InvokeCommandAction)d).OnCommandChanged((ICommand)e.NewValue)));\n\n        /// <summary>\n        /// Gets or sets the command to execute when invoked.\n        /// </summary>\n        public ICommand Command\n        {\n            get { return GetValue(CommandProperty) as ICommand; }\n            set { SetValue(CommandProperty, value); }\n        }\n\n        private void OnCommandChanged(ICommand newValue)\n        {\n            var behavior = GetOrCreateBehavior();\n            if (behavior != null)\n                behavior.Command = newValue;\n        }\n\n        /// <summary>\n        /// Dependency property identifying the command parameter to supply on command execution.\n        /// </summary>\n        public static readonly DependencyProperty CommandParameterProperty =\n            DependencyProperty.Register(nameof(CommandParameter), typeof(object), typeof(InvokeCommandAction),\n                new PropertyMetadata(null, (d, e) => ((InvokeCommandAction)d).OnCommandParameterChanged(e.NewValue)));\n\n        /// <summary>\n        /// Gets or sets the command parameter to supply on command execution.\n        /// </summary>\n        public object CommandParameter\n        {\n            get { return GetValue(CommandParameterProperty); }\n            set { SetValue(CommandParameterProperty, value); }\n        }\n\n        private void OnCommandParameterChanged(object newValue)\n        {\n            var behavior = GetOrCreateBehavior();\n            if (behavior != null)\n                behavior.CommandParameter = newValue;\n        }\n\n        /// <summary>\n        /// Dependency property identifying the TriggerParameterPath to be parsed to identify the child property of the trigger parameter to be used as the command parameter.\n        /// </summary>\n        public static readonly DependencyProperty TriggerParameterPathProperty =\n            DependencyProperty.Register(nameof(TriggerParameterPath), typeof(string), typeof(InvokeCommandAction),\n                new PropertyMetadata(null, (d, e) => { }));\n\n        /// <summary>\n        /// Gets or sets the TriggerParameterPath value.\n        /// </summary>\n        public string TriggerParameterPath\n        {\n            get { return GetValue(TriggerParameterPathProperty) as string; }\n            set { SetValue(TriggerParameterPathProperty, value); }\n        }\n\n        /// <summary>\n        /// Public wrapper of the Invoke method.\n        /// </summary>\n        public void InvokeAction(object parameter)\n        {\n            Invoke(parameter);\n        }\n\n        /// <summary>\n        /// Executes the command\n        /// </summary>\n        /// <param name=\"parameter\">This parameter is passed to the command; the CommandParameter specified in the CommandParameterProperty is used for command invocation if not null.</param>\n        protected override void Invoke(object parameter)\n        {\n            if (!string.IsNullOrEmpty(TriggerParameterPath))\n            {\n                //Walk the ParameterPath for nested properties.\n                var propertyPathParts = TriggerParameterPath.Split('.');\n                object propertyValue = parameter;\n                foreach (var propertyPathPart in propertyPathParts)\n                {\n                    var propInfo = propertyValue.GetType().GetTypeInfo().GetProperty(propertyPathPart);\n                    propertyValue = propInfo.GetValue(propertyValue);\n                }\n                parameter = propertyValue;\n            }\n\n            var behavior = GetOrCreateBehavior();\n\n            if (behavior != null)\n            {\n                behavior.ExecuteCommand(parameter);\n            }\n        }\n\n        /// <summary>\n        /// Sets the Command and CommandParameter properties to null.\n        /// </summary>\n        protected override void OnDetaching()\n        {\n            base.OnDetaching();\n\n            Command = null;\n            CommandParameter = null;\n\n            _commandBehavior = null;\n        }\n\n        /// <summary>\n        /// This method is called after the behavior is attached.\n        /// It updates the command behavior's Command and CommandParameter properties if necessary.\n        /// </summary>\n        protected override void OnAttached()\n        {\n            base.OnAttached();\n\n            // In case this action is attached to a target object after the Command and/or CommandParameter properties are set,\n            // the command behavior would be created without a value for these properties.\n            // To cover this scenario, the Command and CommandParameter properties of the behavior are updated here.\n            var behavior = GetOrCreateBehavior();\n\n            behavior.AutoEnable = AutoEnable;\n\n            if (behavior.Command != Command)\n                behavior.Command = Command;\n\n            if (behavior.CommandParameter != CommandParameter)\n                behavior.CommandParameter = CommandParameter;\n        }\n\n        private ExecutableCommandBehavior GetOrCreateBehavior()\n        {\n            // In case this method is called prior to this action being attached, \n            // the CommandBehavior would always keep a null target object (which isn't changeable afterwards).\n            // Therefore, in that case the behavior shouldn't be created and this method should return null.\n            if (_commandBehavior == null && AssociatedObject != null)\n            {\n                _commandBehavior = new ExecutableCommandBehavior(AssociatedObject);\n            }\n\n            return _commandBehavior;\n        }\n\n        /// <summary>\n        /// A CommandBehavior that exposes a public ExecuteCommand method. It provides the functionality to invoke commands and update Enabled state of the target control.\n        /// It is not possible to make the <see cref=\"InvokeCommandAction\"/> inherit from <see cref=\"CommandBehaviorBase{T}\"/>, since the <see cref=\"InvokeCommandAction\"/>\n        /// must already inherit from <see cref=\"TriggerAction{T}\"/>, so we chose to follow the aggregation approach.\n        /// </summary>\n        private class ExecutableCommandBehavior : CommandBehaviorBase<UIElement>\n        {\n            /// <summary>\n            /// Constructor specifying the target object.\n            /// </summary>\n            /// <param name=\"target\">The target object the behavior is attached to.</param>\n            public ExecutableCommandBehavior(UIElement target)\n                : base(target)\n            {\n            }\n\n            /// <summary>\n            /// Executes the command, if it's set.\n            /// </summary>\n            public new void ExecuteCommand(object parameter)\n            {\n                base.ExecuteCommand(parameter);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Ioc/ContainerProviderExtension.cs",
    "content": "using System.Windows.Markup;\n\nnamespace Prism.Ioc\n{\n    /// <summary>\n    /// Provides Types and Services registered with the Container\n    /// <example>\n    /// <para>\n    /// Usage as markup extension:\n    /// <![CDATA[\n    ///   <TextBlock\n    ///     Text=\"{Binding\n    ///       Path=Foo,\n    ///       Converter={prism:ContainerProvider {x:Type local:MyConverter}}}\" />\n    /// ]]>\n    /// </para>\n    /// <para>\n    /// Usage as XML element:\n    /// <![CDATA[\n    ///   <Window>\n    ///     <Window.DataContext>\n    ///       <prism:ContainerProvider Type=\"{x:Type local:MyViewModel}\" />\n    ///     </Window.DataContext>\n    ///   </Window>\n    /// ]]>\n    /// </para>\n    /// </example>\n    /// </summary>\n    public class ContainerProviderExtension : MarkupExtension\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ContainerProviderExtension\"/> class.\n        /// </summary>\n        public ContainerProviderExtension()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ContainerProviderExtension\"/> class.\n        /// </summary>\n        /// <param name=\"type\">The type to Resolve</param>\n        public ContainerProviderExtension(Type type)\n        {\n            Type = type;\n        }\n\n        /// <summary>\n        /// The type to Resolve\n        /// </summary>\n        public Type Type { get; set; }\n\n        /// <summary>\n        /// The Name used to register the type with the Container\n        /// </summary>\n        public string Name { get; set; }\n\n        /// <summary>\n        /// Provide resolved object from <see cref=\"ContainerLocator\"/>\n        /// </summary>\n        /// <param name=\"serviceProvider\"></param>\n        /// <returns></returns>\n        public override object ProvideValue(IServiceProvider serviceProvider)\n        {\n            return string.IsNullOrEmpty(Name)\n                ? ContainerLocator.Container?.Resolve(Type)\n                : ContainerLocator.Container?.Resolve(Type, Name);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Ioc/IContainerRegistryExtensions.cs",
    "content": "using System.Diagnostics.CodeAnalysis;\nusing Prism.Mvvm;\n\nnamespace Prism.Ioc\n{\n    /// <summary>\n    /// <see cref=\"IContainerRegistry\"/> extensions.\n    /// </summary>\n    public static class IContainerRegistryExtensions\n    {\n        /// <summary>\n        /// Registers an object to be used as a dialog in the IDialogService.\n        /// </summary>\n        /// <typeparam name=\"TView\">The Type of object to register as the dialog</typeparam>\n        /// <param name=\"containerRegistry\"></param>\n        /// <param name=\"name\">The unique name to register with the dialog.</param>\n        public static IContainerRegistry RegisterDialog<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] TView>(this IContainerRegistry containerRegistry, string name = null) =>\n            containerRegistry.RegisterForNavigation<TView>(name);\n\n        /// <summary>\n        /// Registers an object to be used as a dialog in the IDialogService.\n        /// </summary>\n        /// <typeparam name=\"TView\">The Type of object to register as the dialog</typeparam>\n        /// <typeparam name=\"TViewModel\">The ViewModel to use as the DataContext for the dialog</typeparam>\n        /// <param name=\"containerRegistry\"></param>\n        /// <param name=\"name\">The unique name to register with the dialog.</param>\n        public static IContainerRegistry RegisterDialog<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] TView, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] TViewModel>(this IContainerRegistry containerRegistry, string name = null) where TViewModel : Dialogs.IDialogAware =>\n            containerRegistry.RegisterForNavigation<TView, TViewModel>(name);\n\n        /// <summary>\n        /// Registers an object that implements IDialogWindow to be used to host all dialogs in the IDialogService.\n        /// </summary>\n        /// <typeparam name=\"TWindow\">The Type of the Window class that will be used to host dialogs in the IDialogService</typeparam>\n        /// <param name=\"containerRegistry\"></param>\n        public static IContainerRegistry RegisterDialogWindow<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] TWindow>(this IContainerRegistry containerRegistry) where TWindow : Dialogs.IDialogWindow => \n            containerRegistry.Register(typeof(Dialogs.IDialogWindow), typeof(TWindow));\n\n        /// <summary>\n        /// Registers an object that implements IDialogWindow to be used to host all dialogs in the IDialogService.\n        /// </summary>\n        /// <typeparam name=\"TWindow\">The Type of the Window class that will be used to host dialogs in the IDialogService</typeparam>\n        /// <param name=\"containerRegistry\"></param>\n        /// <param name=\"name\">The name of the dialog window</param>\n        public static IContainerRegistry RegisterDialogWindow<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] TWindow>(this IContainerRegistry containerRegistry, string name) where TWindow : Dialogs.IDialogWindow =>\n            containerRegistry.Register(typeof(Dialogs.IDialogWindow), typeof(TWindow), name);\n\n        /// <summary>\n        /// Registers an object for navigation\n        /// </summary>\n        /// <param name=\"containerRegistry\"></param>\n        /// <param name=\"type\">The type of object to register</param>\n        /// <param name=\"name\">The unique name to register with the object.</param>\n        public static IContainerRegistry RegisterForNavigation(this IContainerRegistry containerRegistry, Type type, string name) =>\n            containerRegistry.Register(typeof(object), type, name);\n\n        /// <summary>\n        /// Registers an object for navigation.\n        /// </summary>\n        /// <typeparam name=\"T\">The Type of the object to register as the view</typeparam>\n        /// <param name=\"containerRegistry\"></param>\n        /// <param name=\"name\">The unique name to register with the object.</param>\n        public static IContainerRegistry RegisterForNavigation<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] T>(this IContainerRegistry containerRegistry, string name = null)\n        {\n            Type type = typeof(T);\n            string viewName = string.IsNullOrWhiteSpace(name) ? type.Name : name;\n            return containerRegistry.RegisterForNavigation(type, viewName);\n        }\n\n        /// <summary>\n        /// Registers an object for navigation with the ViewModel type to be used as the DataContext.\n        /// </summary>\n        /// <typeparam name=\"TView\">The Type of object to register as the view</typeparam>\n        /// <typeparam name=\"TViewModel\">The ViewModel to use as the DataContext for the view</typeparam>\n        /// <param name=\"containerRegistry\"></param>\n        /// <param name=\"name\">The unique name to register with the view</param>\n        public static IContainerRegistry RegisterForNavigation<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] TView, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] TViewModel>(this IContainerRegistry containerRegistry, string name = null) =>\n            containerRegistry.RegisterForNavigationWithViewModel<TViewModel>(typeof(TView), name);\n\n        private static IContainerRegistry RegisterForNavigationWithViewModel<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] TViewModel>(this IContainerRegistry containerRegistry, Type viewType, string name)\n        {\n            if (string.IsNullOrWhiteSpace(name))\n                name = viewType.Name;\n\n            ViewModelLocationProvider.Register(viewType.ToString(), typeof(TViewModel));\n            return containerRegistry.RegisterForNavigation(viewType, name);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Modularity/AssemblyResolver.Desktop.cs",
    "content": "using System.IO;\nusing System.Reflection;\nusing Prism.Properties;\n\nnamespace Prism.Modularity\n{\n    /// <summary>\n    /// Handles AppDomain's AssemblyResolve event to be able to load assemblies dynamically in \n    /// the LoadFrom context, but be able to reference the type from assemblies loaded in the Load context.\n    /// </summary>\n    public class AssemblyResolver : IAssemblyResolver, IDisposable\n    {\n        private readonly List<AssemblyInfo> registeredAssemblies = new List<AssemblyInfo>();\n\n        private bool _handlesAssemblyResolve;\n\n        /// <summary>\n        /// Registers the specified assembly and resolves the types in it when the AppDomain requests for it.\n        /// </summary>\n        /// <param name=\"assemblyFilePath\">The path to the assembly to load in the LoadFrom context.</param>\n        /// <remarks>This method does not load the assembly immediately, but lazily until someone requests a <see cref=\"Type\"/>\n        /// declared in the assembly.</remarks>\n        public void LoadAssemblyFrom(string assemblyFilePath)\n        {\n            if (!_handlesAssemblyResolve)\n            {\n                AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;\n                _handlesAssemblyResolve = true;\n            }\n\n            Uri assemblyUri = GetFileUri(assemblyFilePath);\n\n            if (assemblyUri == null)\n            {\n                throw new ArgumentException(Resources.InvalidArgumentAssemblyUri, nameof(assemblyFilePath));\n            }\n\n            if (!File.Exists(assemblyUri.LocalPath))\n            {\n                throw new FileNotFoundException(null, assemblyUri.LocalPath);\n            }\n\n            AssemblyName assemblyName = AssemblyName.GetAssemblyName(assemblyUri.LocalPath);\n            AssemblyInfo assemblyInfo = registeredAssemblies.FirstOrDefault(a => assemblyName == a.AssemblyName);\n\n            if (assemblyInfo != null)\n            {\n                return;\n            }\n\n            assemblyInfo = new AssemblyInfo() { AssemblyName = assemblyName, AssemblyUri = assemblyUri };\n            registeredAssemblies.Add(assemblyInfo);\n        }\n\n        private static Uri GetFileUri(string filePath)\n        {\n            if (String.IsNullOrEmpty(filePath))\n            {\n                return null;\n            }\n\n            Uri uri;\n            if (!Uri.TryCreate(filePath, UriKind.Absolute, out uri))\n            {\n                return null;\n            }\n\n            if (!uri.IsFile)\n            {\n                return null;\n            }\n\n            return uri;\n        }\n\n        [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Reliability\", \"CA2001:AvoidCallingProblematicMethods\", MessageId = \"System.Reflection.Assembly.LoadFrom\")]\n        private Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)\n        {\n            AssemblyName assemblyName = new AssemblyName(args.Name);\n\n            AssemblyInfo assemblyInfo = registeredAssemblies.FirstOrDefault(a => AssemblyName.ReferenceMatchesDefinition(assemblyName, a.AssemblyName));\n\n            if (assemblyInfo != null)\n            {\n                if (assemblyInfo.Assembly == null)\n                {\n                    assemblyInfo.Assembly = Assembly.LoadFrom(assemblyInfo.AssemblyUri.LocalPath);\n                }\n\n                return assemblyInfo.Assembly;\n            }\n\n            return null;\n        }\n\n        private class AssemblyInfo\n        {\n            public AssemblyName AssemblyName { get; set; }\n\n            public Uri AssemblyUri { get; set; }\n\n            public Assembly Assembly { get; set; }\n        }\n\n        #region Implementation of IDisposable\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        /// <remarks>Calls <see cref=\"Dispose(bool)\"/></remarks>.\n        /// <filterpriority>2</filterpriority>\n        public void Dispose()\n        {\n            Dispose(true);\n            GC.SuppressFinalize(this);\n        }\n\n        /// <summary>\n        /// Disposes the associated <see cref=\"AssemblyResolver\"/>.\n        /// </summary>\n        /// <param name=\"disposing\">When <see langword=\"true\"/>, it is being called from the Dispose method.</param>\n        protected virtual void Dispose(bool disposing)\n        {\n            if (_handlesAssemblyResolve)\n            {\n                AppDomain.CurrentDomain.AssemblyResolve -= CurrentDomain_AssemblyResolve;\n                _handlesAssemblyResolve = false;\n            }\n        }\n\n        #endregion\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Modularity/ConfigurationModuleCatalog.Desktop.cs",
    "content": "using System.Collections.ObjectModel;\nusing Prism.Properties;\n\nnamespace Prism.Modularity\n{\n\n    /// <summary>\n    /// A catalog built from a configuration file.\n    /// </summary>\n    public class ConfigurationModuleCatalog : ModuleCatalog\n    {\n        /// <summary>\n        /// Builds an instance of ConfigurationModuleCatalog with a <see cref=\"ConfigurationStore\"/> as the default store.\n        /// </summary>\n        public ConfigurationModuleCatalog()\n        {\n            Store = new ConfigurationStore();\n        }\n\n        /// <summary>\n        /// Gets or sets the store where the configuration is kept.\n        /// </summary>\n        public IConfigurationStore Store { get; set; }\n\n        /// <summary>\n        /// Loads the catalog from the configuration.\n        /// </summary>\n        protected override void InnerLoad()\n        {\n            if (Store == null)\n            {\n                throw new InvalidOperationException(Resources.ConfigurationStoreCannotBeNull);\n            }\n\n            EnsureModulesDiscovered();\n        }\n\n        private void EnsureModulesDiscovered()\n        {\n            ModulesConfigurationSection section = Store.RetrieveModuleConfigurationSection();\n\n            if (section != null)\n            {\n                foreach (ModuleConfigurationElement element in section.Modules)\n                {\n                    IList<string> dependencies = new List<string>();\n\n                    if (element.Dependencies.Count > 0)\n                    {\n                        foreach (ModuleDependencyConfigurationElement dependency in element.Dependencies)\n                        {\n                            dependencies.Add(dependency.ModuleName);\n                        }\n                    }\n\n                    ModuleInfo moduleInfo = new ModuleInfo(element.ModuleName, element.ModuleType)\n                    {\n                        Ref = GetFileAbsoluteUri(element.AssemblyFile),\n                        InitializationMode = element.StartupLoaded ? InitializationMode.WhenAvailable : InitializationMode.OnDemand\n                    };\n                    moduleInfo.DependsOn.AddRange(dependencies.ToArray());\n                    AddModule(moduleInfo);\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Modularity/ConfigurationStore.Desktop.cs",
    "content": "using System.Configuration;\n\nnamespace Prism.Modularity\n{\n    /// <summary>\n    /// Defines a store for the module metadata.\n    /// </summary>\n    public class ConfigurationStore : IConfigurationStore\n    {\n        /// <summary>\n        /// Gets the module configuration data.\n        /// </summary>\n        /// <returns>A <see cref=\"ModulesConfigurationSection\"/> instance.</returns>\n        public ModulesConfigurationSection RetrieveModuleConfigurationSection()\n        {\n            return ConfigurationManager.GetSection(\"modules\") as ModulesConfigurationSection;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Modularity/DirectoryModuleCatalog.net45.cs",
    "content": "using System.Collections.ObjectModel;\nusing System.Globalization;\nusing System.IO;\nusing System.Reflection;\nusing System.Security.Policy;\nusing Prism.Properties;\n\nnamespace Prism.Modularity\n{\n    /// <summary>\n    /// Represets a catalog created from a directory on disk.\n    /// </summary>\n    /// <remarks>\n    /// The directory catalog will scan the contents of a directory, locating classes that implement\n    /// <see cref=\"IModule\"/> and add them to the catalog based on contents in their associated <see cref=\"ModuleAttribute\"/>.\n    /// Assemblies are loaded into a new application domain with ReflectionOnlyLoad.  The application domain is destroyed\n    /// once the assemblies have been discovered.\n    ///\n    /// The diretory catalog does not continue to monitor the directory after it has created the initialze catalog.\n    /// </remarks>\n    public class DirectoryModuleCatalog : ModuleCatalog\n    {\n        /// <summary>\n        /// Directory containing modules to search for.\n        /// </summary>\n        public string ModulePath { get; set; }\n\n        /// <summary>\n        /// Drives the main logic of building the child domain and searching for the assemblies.\n        /// </summary>\n        protected override void InnerLoad()\n        {\n            if (string.IsNullOrEmpty(ModulePath))\n                throw new InvalidOperationException(Resources.ModulePathCannotBeNullOrEmpty);\n\n            if (!Directory.Exists(ModulePath))\n                throw new InvalidOperationException(\n                    string.Format(CultureInfo.CurrentCulture, Resources.DirectoryNotFound, ModulePath));\n\n            AppDomain childDomain = BuildChildDomain(AppDomain.CurrentDomain);\n\n            try\n            {\n                List<string> loadedAssemblies = new List<string>();\n\n                var assemblies = (\n                                     from Assembly assembly in AppDomain.CurrentDomain.GetAssemblies()\n                                     where !(assembly is System.Reflection.Emit.AssemblyBuilder)\n                                        && assembly.GetType().FullName != \"System.Reflection.Emit.InternalAssemblyBuilder\"\n                                        // TODO: Do this in a less hacky way... probably never gonna happen\n                                        && !assembly.GetName().Name.StartsWith(\"xunit\")\n                                        && !string.IsNullOrEmpty(assembly.Location)\n                                     select assembly.Location\n                                 );\n\n                loadedAssemblies.AddRange(assemblies);\n\n                Type loaderType = typeof(InnerModuleInfoLoader);\n\n                if (loaderType.Assembly != null)\n                {\n                    var loader =\n                        (InnerModuleInfoLoader)\n                        childDomain.CreateInstanceFrom(loaderType.Assembly.Location, loaderType.FullName).Unwrap();\n                    loader.LoadAssemblies(loadedAssemblies);\n                    Items.AddRange(loader.GetModuleInfos(ModulePath));\n                }\n            }\n            finally\n            {\n                AppDomain.Unload(childDomain);\n            }\n        }\n\n\n        /// <summary>\n        /// Creates a new child domain and copies the evidence from a parent domain.\n        /// </summary>\n        /// <param name=\"parentDomain\">The parent domain.</param>\n        /// <returns>The new child domain.</returns>\n        /// <remarks>\n        /// Grabs the <paramref name=\"parentDomain\"/> evidence and uses it to construct the new\n        /// <see cref=\"AppDomain\"/> because in a ClickOnce execution environment, creating an\n        /// <see cref=\"AppDomain\"/> will by default pick up the partial trust environment of\n        /// the AppLaunch.exe, which was the root executable. The AppLaunch.exe does a\n        /// create domain and applies the evidence from the ClickOnce manifests to\n        /// create the domain that the application is actually executing in. This will\n        /// need to be Full Trust for Prism applications.\n        /// </remarks>\n        /// <exception cref=\"ArgumentNullException\">An <see cref=\"ArgumentNullException\"/> is thrown if <paramref name=\"parentDomain\"/> is null.</exception>\n        protected virtual AppDomain BuildChildDomain(AppDomain parentDomain)\n        {\n            if (parentDomain == null)\n                throw new ArgumentNullException(nameof(parentDomain));\n\n            Evidence evidence = new Evidence(parentDomain.Evidence);\n            AppDomainSetup setup = parentDomain.SetupInformation;\n            return AppDomain.CreateDomain(\"DiscoveryRegion\", evidence, setup);\n        }\n\n        private class InnerModuleInfoLoader : MarshalByRefObject\n        {\n            [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Performance\", \"CA1822:MarkMembersAsStatic\")]\n            internal ModuleInfo[] GetModuleInfos(string path)\n            {\n                DirectoryInfo directory = new DirectoryInfo(path);\n\n                ResolveEventHandler resolveEventHandler =\n                    delegate (object sender, ResolveEventArgs args) { return OnReflectionOnlyResolve(args, directory); };\n\n                AppDomain.CurrentDomain.ReflectionOnlyAssemblyResolve += resolveEventHandler;\n\n                Assembly moduleReflectionOnlyAssembly =\n                    AppDomain.CurrentDomain.ReflectionOnlyGetAssemblies().First(\n                        asm => asm.FullName == typeof(IModule).Assembly.FullName);\n                Type IModuleType = moduleReflectionOnlyAssembly.GetType(typeof(IModule).FullName);\n\n                IEnumerable<ModuleInfo> modules = GetNotAlreadyLoadedModuleInfos(directory, IModuleType);\n\n                var array = modules.ToArray();\n                AppDomain.CurrentDomain.ReflectionOnlyAssemblyResolve -= resolveEventHandler;\n                return array;\n            }\n\n            private static IEnumerable<ModuleInfo> GetNotAlreadyLoadedModuleInfos(DirectoryInfo directory, Type IModuleType)\n            {\n                List<FileInfo> validAssemblies = new List<FileInfo>();\n                Assembly[] alreadyLoadedAssemblies = AppDomain.CurrentDomain.ReflectionOnlyGetAssemblies();\n\n                var fileInfos = directory.GetFiles(\"*.dll\")\n                    .Where(file => alreadyLoadedAssemblies\n                                       .FirstOrDefault(\n                                       assembly =>\n                                       String.Compare(Path.GetFileName(assembly.Location), file.Name,\n                                                      StringComparison.OrdinalIgnoreCase) == 0) == null);\n\n                foreach (FileInfo fileInfo in fileInfos)\n                {\n                    try\n                    {\n                        Assembly.ReflectionOnlyLoadFrom(fileInfo.FullName);\n                        validAssemblies.Add(fileInfo);\n                    }\n                    catch (BadImageFormatException)\n                    {\n                        // skip non-.NET Dlls\n                    }\n                }\n\n                return validAssemblies.SelectMany(file => Assembly.ReflectionOnlyLoadFrom(file.FullName)\n                                            .GetExportedTypes()\n                                            .Where(IModuleType.IsAssignableFrom)\n                                            .Where(t => t != IModuleType)\n                                            .Where(t => !t.IsAbstract)\n                                            .Select(type => CreateModuleInfo(type)));\n            }\n\n            private static Assembly OnReflectionOnlyResolve(ResolveEventArgs args, DirectoryInfo directory)\n            {\n                Assembly loadedAssembly = AppDomain.CurrentDomain.ReflectionOnlyGetAssemblies().FirstOrDefault(\n                    asm => string.Equals(asm.FullName, args.Name, StringComparison.OrdinalIgnoreCase));\n                if (loadedAssembly != null)\n                {\n                    return loadedAssembly;\n                }\n                AssemblyName assemblyName = new AssemblyName(args.Name);\n                string dependentAssemblyFilename = Path.Combine(directory.FullName, assemblyName.Name + \".dll\");\n                if (File.Exists(dependentAssemblyFilename))\n                {\n                    return Assembly.ReflectionOnlyLoadFrom(dependentAssemblyFilename);\n                }\n                return Assembly.ReflectionOnlyLoad(args.Name);\n            }\n\n            [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Performance\", \"CA1822:MarkMembersAsStatic\")]\n            internal void LoadAssemblies(IEnumerable<string> assemblies)\n            {\n                foreach (string assemblyPath in assemblies)\n                {\n                    try\n                    {\n                        Assembly.ReflectionOnlyLoadFrom(assemblyPath);\n                    }\n                    catch (FileNotFoundException)\n                    {\n                        // Continue loading assemblies even if an assembly can not be loaded in the new AppDomain\n                    }\n                }\n            }\n\n            private static ModuleInfo CreateModuleInfo(Type type)\n            {\n                string moduleName = type.Name;\n                List<string> dependsOn = new List<string>();\n                bool onDemand = false;\n                var moduleAttribute =\n                    CustomAttributeData.GetCustomAttributes(type).FirstOrDefault(\n                        cad => cad.Constructor.DeclaringType.FullName == typeof(ModuleAttribute).FullName);\n\n                if (moduleAttribute != null)\n                {\n                    foreach (CustomAttributeNamedArgument argument in moduleAttribute.NamedArguments)\n                    {\n                        string argumentName = argument.MemberInfo.Name;\n                        switch (argumentName)\n                        {\n                            case \"ModuleName\":\n                                moduleName = (string)argument.TypedValue.Value;\n                                break;\n\n                            case \"OnDemand\":\n                                onDemand = (bool)argument.TypedValue.Value;\n                                break;\n\n                            case \"StartupLoaded\":\n                                onDemand = !((bool)argument.TypedValue.Value);\n                                break;\n                        }\n                    }\n                }\n\n                var moduleDependencyAttributes =\n                    CustomAttributeData.GetCustomAttributes(type).Where(\n                        cad => cad.Constructor.DeclaringType.FullName == typeof(ModuleDependencyAttribute).FullName);\n\n                foreach (CustomAttributeData cad in moduleDependencyAttributes)\n                {\n                    dependsOn.Add((string)cad.ConstructorArguments[0].Value);\n                }\n\n                ModuleInfo moduleInfo = new ModuleInfo(moduleName, type.AssemblyQualifiedName)\n                {\n                    InitializationMode =\n                                                    onDemand\n                                                        ? InitializationMode.OnDemand\n                                                        : InitializationMode.WhenAvailable,\n                    Ref = type.Assembly.EscapedCodeBase,\n                };\n                moduleInfo.DependsOn.AddRange(dependsOn);\n                return moduleInfo;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Modularity/DirectoryModuleCatalog.netcore.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\nusing Prism.Properties;\n\nnamespace Prism.Modularity\n{\n    /// <summary>\n    /// Represents a catalog created from a directory on disk.\n    /// </summary>\n    /// <remarks>\n    /// The directory catalog will scan the contents of a directory, locating classes that implement\n    /// <see cref=\"IModule\"/> and add them to the catalog based on contents in their associated <see cref=\"ModuleAttribute\"/>.\n    /// Assemblies are loaded into a new application domain with ReflectionOnlyLoad.  The application domain is destroyed\n    /// once the assemblies have been discovered.\n    ///\n    /// The directory catalog does not continue to monitor the directory after it has created the initialize catalog.\n    /// </remarks>\n    public class DirectoryModuleCatalog : ModuleCatalog\n    {\n        /// <summary>\n        /// Directory containing modules to search for.\n        /// </summary>\n        public string ModulePath { get; set; }\n\n        /// <summary>\n        /// Drives the main logic of building the child domain and searching for the assemblies.\n        /// </summary>\n        protected override void InnerLoad()\n        {\n            if (string.IsNullOrEmpty(ModulePath))\n                throw new InvalidOperationException(Resources.ModulePathCannotBeNullOrEmpty);\n\n            if (!Directory.Exists(ModulePath))\n                throw new InvalidOperationException(\n                    string.Format(CultureInfo.CurrentCulture, Resources.DirectoryNotFound, ModulePath));\n\n            AppDomain childDomain = AppDomain.CurrentDomain;\n\n            try\n            {\n                List<string> loadedAssemblies = new List<string>();\n\n                var assemblies = (\n                    from Assembly assembly in AppDomain.CurrentDomain.GetAssemblies()\n                    where !(assembly is System.Reflection.Emit.AssemblyBuilder)\n                        && assembly.GetType().FullName != \"System.Reflection.Emit.InternalAssemblyBuilder\"\n                        && !String.IsNullOrEmpty(assembly.Location)\n                    select assembly.Location\n                );\n\n                loadedAssemblies.AddRange(assemblies);\n\n                Type loaderType = typeof(InnerModuleInfoLoader);\n\n                if (loaderType.Assembly != null)\n                {\n                    var loader =\n                        (InnerModuleInfoLoader)\n                        childDomain.CreateInstanceFrom(loaderType.Assembly.Location, loaderType.FullName).Unwrap();\n\n                    Items.AddRange(loader.GetModuleInfos(ModulePath));\n                }\n            }\n            catch (Exception ex)\n            {\n                throw new Exception(\"There was an error loading assemblies.\", ex);\n            }\n        }\n\n        private class InnerModuleInfoLoader : MarshalByRefObject\n        {\n            [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Performance\", \"CA1822:MarkMembersAsStatic\")]\n            internal ModuleInfo[] GetModuleInfos(string path)\n            {\n                DirectoryInfo directory = new DirectoryInfo(path);\n\n                ResolveEventHandler resolveEventHandler =\n                    delegate (object sender, ResolveEventArgs args) { return OnReflectionOnlyResolve(args, directory); };\n\n                AppDomain.CurrentDomain.ReflectionOnlyAssemblyResolve += resolveEventHandler;\n\n                Assembly moduleReflectionOnlyAssembly = AppDomain.CurrentDomain.GetAssemblies().First(asm => asm.FullName == typeof(IModule).Assembly.FullName);\n                Type IModuleType = moduleReflectionOnlyAssembly.GetType(typeof(IModule).FullName);\n\n                IEnumerable<ModuleInfo> modules = GetNotAlreadyLoadedModuleInfos(directory, IModuleType);\n\n                var array = modules.ToArray();\n                AppDomain.CurrentDomain.ReflectionOnlyAssemblyResolve -= resolveEventHandler;\n                return array;\n            }\n\n            private static IEnumerable<ModuleInfo> GetNotAlreadyLoadedModuleInfos(DirectoryInfo directory, Type IModuleType)\n            {\n                List<Assembly> validAssemblies = new List<Assembly>();\n                Assembly[] alreadyLoadedAssemblies = AppDomain.CurrentDomain.GetAssemblies().Where(p => !p.IsDynamic).ToArray();\n\n                var fileInfos = directory.GetFiles(\"*.dll\")\n                    .Where(file => alreadyLoadedAssemblies.FirstOrDefault(\n                        assembly => String.Compare(Path.GetFileName(assembly.Location),\n                        file.Name, StringComparison.OrdinalIgnoreCase) == 0) == null).ToList();\n\n                foreach (FileInfo fileInfo in fileInfos)\n                {\n                    try\n                    {\n                        validAssemblies.Add(Assembly.LoadFrom(fileInfo.FullName));\n                    }\n                    catch (BadImageFormatException)\n                    {\n                        // skip non-.NET Dlls\n                    }\n                }\n\n                return validAssemblies.SelectMany(assembly => assembly\n                            .GetExportedTypes()\n                            .Where(IModuleType.IsAssignableFrom)\n                            .Where(t => t != IModuleType)\n                            .Where(t => !t.IsAbstract)\n                            .Select(type => CreateModuleInfo(type)));\n            }\n\n            private static Assembly OnReflectionOnlyResolve(ResolveEventArgs args, DirectoryInfo directory)\n            {\n                Assembly loadedAssembly = AppDomain.CurrentDomain.ReflectionOnlyGetAssemblies().FirstOrDefault(\n                    asm => string.Equals(asm.FullName, args.Name, StringComparison.OrdinalIgnoreCase));\n                if (loadedAssembly != null)\n                {\n                    return loadedAssembly;\n                }\n\n                AssemblyName assemblyName = new AssemblyName(args.Name);\n                string dependentAssemblyFilename = Path.Combine(directory.FullName, assemblyName.Name + \".dll\");\n                if (File.Exists(dependentAssemblyFilename))\n                {\n                    return Assembly.ReflectionOnlyLoadFrom(dependentAssemblyFilename);\n                }\n\n                return Assembly.ReflectionOnlyLoad(args.Name);\n            }\n\n            [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Performance\", \"CA1822:MarkMembersAsStatic\")]\n            internal void LoadAssemblies(IEnumerable<string> assemblies)\n            {\n                foreach (string assemblyPath in assemblies)\n                {\n                    try\n                    {\n                        Assembly.ReflectionOnlyLoadFrom(assemblyPath);\n                    }\n                    catch (FileNotFoundException)\n                    {\n                        // Continue loading assemblies even if an assembly can not be loaded in the new AppDomain\n                    }\n                }\n            }\n\n            private static ModuleInfo CreateModuleInfo(Type type)\n            {\n                string moduleName = type.Name;\n                List<string> dependsOn = new List<string>();\n                bool onDemand = false;\n                var moduleAttribute =\n                    CustomAttributeData.GetCustomAttributes(type).FirstOrDefault(\n                        cad => cad.Constructor.DeclaringType.FullName == typeof(ModuleAttribute).FullName);\n\n                if (moduleAttribute != null)\n                {\n                    foreach (CustomAttributeNamedArgument argument in moduleAttribute.NamedArguments)\n                    {\n                        string argumentName = argument.MemberInfo.Name;\n                        switch (argumentName)\n                        {\n                            case \"ModuleName\":\n                                moduleName = (string)argument.TypedValue.Value;\n                                break;\n\n                            case \"OnDemand\":\n                                onDemand = (bool)argument.TypedValue.Value;\n                                break;\n\n                            case \"StartupLoaded\":\n                                onDemand = !((bool)argument.TypedValue.Value);\n                                break;\n                        }\n                    }\n                }\n\n                var moduleDependencyAttributes =\n                    CustomAttributeData.GetCustomAttributes(type).Where(\n                        cad => cad.Constructor.DeclaringType.FullName == typeof(ModuleDependencyAttribute).FullName);\n\n                foreach (CustomAttributeData cad in moduleDependencyAttributes)\n                {\n                    dependsOn.Add((string)cad.ConstructorArguments[0].Value);\n                }\n\n                ModuleInfo moduleInfo = new ModuleInfo(moduleName, type.AssemblyQualifiedName)\n                {\n                    InitializationMode = onDemand ? InitializationMode.OnDemand : InitializationMode.WhenAvailable,\n                    Ref = type.Assembly.EscapedCodeBase,\n                };\n\n                moduleInfo.DependsOn.AddRange(dependsOn);\n                return moduleInfo;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Modularity/FileModuleTypeLoader.Desktop.cs",
    "content": "using System.IO;\n\nnamespace Prism.Modularity\n{\n    /// <summary>\n    /// Loads modules from an arbitrary location on the filesystem. This typeloader is only called if\n    /// <see cref=\"ModuleInfo\"/> classes have a Ref parameter that starts with \"file://\".\n    /// This class is only used on the Desktop version of the Prism Library.\n    /// </summary>\n    public class FileModuleTypeLoader : IModuleTypeLoader, IDisposable\n    {\n        private const string RefFilePrefix = \"file://\";\n\n        private readonly IAssemblyResolver _assemblyResolver;\n        private HashSet<Uri> _downloadedUris = new HashSet<Uri>();\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FileModuleTypeLoader\"/> class.\n        /// </summary>\n        [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Reliability\", \"CA2000:Dispose objects before losing scope\", Justification = \"This is disposed of in the Dispose method.\")]\n        public FileModuleTypeLoader()\n            : this(new AssemblyResolver())\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FileModuleTypeLoader\"/> class.\n        /// </summary>\n        /// <param name=\"assemblyResolver\">The assembly resolver.</param>\n        public FileModuleTypeLoader(IAssemblyResolver assemblyResolver)\n        {\n            _assemblyResolver = assemblyResolver;\n        }\n\n        /// <summary>\n        /// Raised repeatedly to provide progress as modules are loaded in the background.\n        /// </summary>\n        public event EventHandler<ModuleDownloadProgressChangedEventArgs> ModuleDownloadProgressChanged;\n\n        private void RaiseModuleDownloadProgressChanged(IModuleInfo moduleInfo, long bytesReceived, long totalBytesToReceive)\n        {\n            RaiseModuleDownloadProgressChanged(new ModuleDownloadProgressChangedEventArgs(moduleInfo, bytesReceived, totalBytesToReceive));\n        }\n\n        private void RaiseModuleDownloadProgressChanged(ModuleDownloadProgressChangedEventArgs e)\n        {\n            ModuleDownloadProgressChanged?.Invoke(this, e);\n        }\n\n        /// <summary>\n        /// Raised when a module is loaded or fails to load.\n        /// </summary>\n        public event EventHandler<LoadModuleCompletedEventArgs> LoadModuleCompleted;\n\n        private void RaiseLoadModuleCompleted(IModuleInfo moduleInfo, Exception error)\n        {\n            RaiseLoadModuleCompleted(new LoadModuleCompletedEventArgs(moduleInfo, error));\n        }\n\n        private void RaiseLoadModuleCompleted(LoadModuleCompletedEventArgs e)\n        {\n            LoadModuleCompleted?.Invoke(this, e);\n        }\n\n        /// <summary>\n        /// Evaluates the <see cref=\"IModuleInfo.Ref\"/> property to see if the current typeloader will be able to retrieve the <paramref name=\"moduleInfo\"/>.\n        /// Returns true if the <see cref=\"IModuleInfo.Ref\"/> property starts with \"file://\", because this indicates that the file\n        /// is a local file.\n        /// </summary>\n        /// <param name=\"moduleInfo\">Module that should have it's type loaded.</param>\n        /// <returns>\n        /// \t<see langword=\"true\"/> if the current typeloader is able to retrieve the module, otherwise <see langword=\"false\"/>.\n        /// </returns>\n        /// <exception cref=\"ArgumentNullException\">An <see cref=\"ArgumentNullException\"/> is thrown if <paramref name=\"moduleInfo\"/> is null.</exception>\n        public bool CanLoadModuleType(IModuleInfo moduleInfo)\n        {\n            if (moduleInfo == null)\n            {\n                throw new ArgumentNullException(nameof(moduleInfo));\n            }\n\n            return moduleInfo.Ref != null && moduleInfo.Ref.StartsWith(RefFilePrefix, StringComparison.Ordinal);\n        }\n\n        /// <summary>\n        /// Retrieves the <paramref name=\"moduleInfo\"/>.\n        /// </summary>\n        /// <param name=\"moduleInfo\">Module that should have it's type loaded.</param>\n        [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Design\", \"CA1031:DoNotCatchGeneralExceptionTypes\", Justification = \"Exception is rethrown as part of a completion event\")]\n        public void LoadModuleType(IModuleInfo moduleInfo)\n        {\n            if (moduleInfo == null)\n            {\n                throw new ArgumentNullException(nameof(moduleInfo));\n            }\n\n            try\n            {\n                Uri uri = new Uri(moduleInfo.Ref, UriKind.RelativeOrAbsolute);\n\n                // If this module has already been downloaded, I fire the completed event.\n                if (IsSuccessfullyDownloaded(uri))\n                {\n                    RaiseLoadModuleCompleted(moduleInfo, null);\n                }\n                else\n                {\n                    string path = uri.LocalPath;\n\n                    long fileSize = -1L;\n                    if (File.Exists(path))\n                    {\n                        FileInfo fileInfo = new FileInfo(path);\n                        fileSize = fileInfo.Length;\n                    }\n\n                    // Although this isn't asynchronous, nor expected to take very long, I raise progress changed for consistency.\n                    RaiseModuleDownloadProgressChanged(moduleInfo, 0, fileSize);\n\n                    _assemblyResolver.LoadAssemblyFrom(moduleInfo.Ref);\n\n                    // Although this isn't asynchronous, nor expected to take very long, I raise progress changed for consistency.\n                    RaiseModuleDownloadProgressChanged(moduleInfo, fileSize, fileSize);\n\n                    // I remember the downloaded URI.\n                    RecordDownloadSuccess(uri);\n\n                    RaiseLoadModuleCompleted(moduleInfo, null);\n                }\n            }\n            catch (Exception ex)\n            {\n                RaiseLoadModuleCompleted(moduleInfo, ex);\n            }\n        }\n\n        private bool IsSuccessfullyDownloaded(Uri uri)\n        {\n            lock (_downloadedUris)\n            {\n                return _downloadedUris.Contains(uri);\n            }\n        }\n\n        private void RecordDownloadSuccess(Uri uri)\n        {\n            lock (_downloadedUris)\n            {\n                _downloadedUris.Add(uri);\n            }\n        }\n\n        #region Implementation of IDisposable\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        /// <remarks>Calls <see cref=\"Dispose(bool)\"/></remarks>.\n        /// <filterpriority>2</filterpriority>\n        public void Dispose()\n        {\n            Dispose(true);\n            GC.SuppressFinalize(this);\n        }\n\n        /// <summary>\n        /// Disposes the associated <see cref=\"AssemblyResolver\"/>.\n        /// </summary>\n        /// <param name=\"disposing\">When <see langword=\"true\"/>, it is being called from the Dispose method.</param>\n        protected virtual void Dispose(bool disposing)\n        {\n            if (_assemblyResolver is IDisposable disposableResolver)\n            {\n                disposableResolver.Dispose();\n            }\n        }\n\n        #endregion\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Modularity/IAssemblyResolver.Desktop.cs",
    "content": "namespace Prism.Modularity\n{\n    /// <summary>\n    /// Interface for classes that are responsible for resolving and loading assembly files. \n    /// </summary>\n    public interface IAssemblyResolver\n    {\n        /// <summary>\n        /// Load an assembly when it's required by the application. \n        /// </summary>\n        /// <param name=\"assemblyFilePath\"></param>\n        void LoadAssemblyFrom(string assemblyFilePath);\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Modularity/IConfigurationStore.Desktop.cs",
    "content": "namespace Prism.Modularity\n{\n    /// <summary>\n    /// Defines a store for the module metadata.\n    /// </summary>\n    public interface IConfigurationStore\n    {\n        /// <summary>\n        /// Gets the module configuration data.\n        /// </summary>\n        /// <returns>A <see cref=\"ModulesConfigurationSection\"/> instance.</returns>\n        ModulesConfigurationSection RetrieveModuleConfigurationSection();\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Modularity/IModuleCatalogExtensions.cs",
    "content": "using Prism.Properties;\n\nnamespace Prism.Modularity\n{\n    /// <summary>\n    /// <see cref=\"IModuleCatalog\"/> extensions.\n    /// </summary>\n    public static class IModuleCatalogExtensions\n    {\n        /// <summary>\n        /// Adds the module to the <see cref=\"IModuleCatalog\"/>.\n        /// </summary>\n        /// <param name=\"catalog\">The catalog to add the module to.</param>\n        /// <param name=\"mode\">The <see cref=\"InitializationMode\"/> to use.</param>\n        /// <param name=\"dependsOn\">Collection of module names (<see cref=\"IModuleInfo.ModuleName\"/>) of the modules on which the module to be added logically depends on.</param>\n        /// <typeparam name=\"T\">The <see cref=\"IModule\"/> type parameter.</typeparam>\n        /// <returns>The same <see cref=\"IModuleCatalog\"/> instance with the added module.</returns>\n        public static IModuleCatalog AddModule<T>(this IModuleCatalog catalog, InitializationMode mode = InitializationMode.WhenAvailable, params string[] dependsOn)\n            where T : IModule\n        {\n            return catalog.AddModule<T>(typeof(T).Name, mode, dependsOn);\n        }\n\n        /// <summary>\n        /// Adds the module to the <see cref=\"IModuleCatalog\"/>.\n        /// </summary>\n        /// <param name=\"catalog\">The catalog to add the module to.</param>\n        /// <param name=\"name\">Name of the module to be added.</param>\n        /// <param name=\"mode\">The <see cref=\"InitializationMode\"/> to use.</param>\n        /// <param name=\"dependsOn\">Collection of module names (<see cref=\"IModuleInfo.ModuleName\"/>) of the modules on which the module to be added logically depends on.</param>\n        /// <typeparam name=\"T\">The <see cref=\"IModule\"/> type parameter.</typeparam>\n        /// <returns>The same <see cref=\"IModuleCatalog\"/> instance with the added module.</returns>\n        public static IModuleCatalog AddModule<T>(this IModuleCatalog catalog, string name, InitializationMode mode = InitializationMode.WhenAvailable, params string[] dependsOn)\n            where T : IModule\n        {\n            return catalog.AddModule(name, typeof(T).AssemblyQualifiedName, mode, dependsOn);\n        }\n\n        /// <summary>\n        /// Adds a groupless <see cref=\"IModuleInfo\"/> to the catalog.\n        /// </summary>\n        /// <param name=\"catalog\">The catalog to add the module to.</param>\n        /// <param name=\"moduleType\"><see cref=\"Type\"/> of the module to be added.</param>\n        /// <param name=\"dependsOn\">Collection of module names (<see cref=\"IModuleInfo.ModuleName\"/>) of the modules on which the module to be added logically depends on.</param>\n        /// <returns>The same <see cref=\"IModuleCatalog\"/> instance with the added module.</returns>\n        public static IModuleCatalog AddModule(this IModuleCatalog catalog, Type moduleType, params string[] dependsOn)\n        {\n            return catalog.AddModule(moduleType, InitializationMode.WhenAvailable, dependsOn);\n        }\n\n        /// <summary>\n        /// Adds a groupless <see cref=\"IModuleInfo\"/> to the catalog.\n        /// </summary>\n        /// <param name=\"catalog\">The catalog to add the module to.</param>\n        /// <param name=\"moduleType\"><see cref=\"Type\"/> of the module to be added.</param>\n        /// <param name=\"initializationMode\">Stage on which the module to be added will be initialized.</param>\n        /// <param name=\"dependsOn\">Collection of module names (<see cref=\"IModuleInfo.ModuleName\"/>) of the modules on which the module to be added logically depends on.</param>\n        /// <returns>The same <see cref=\"IModuleCatalog\"/> instance with the added module.</returns>\n        public static IModuleCatalog AddModule(this IModuleCatalog catalog, Type moduleType, InitializationMode initializationMode, params string[] dependsOn)\n        {\n            if (moduleType == null)\n                throw new ArgumentNullException(nameof(moduleType));\n\n            return catalog.AddModule(moduleType.Name, moduleType.AssemblyQualifiedName, initializationMode, dependsOn);\n        }\n\n        /// <summary>\n        /// Adds a groupless <see cref=\"IModuleInfo\"/> to the catalog.\n        /// </summary>\n        /// <param name=\"catalog\">The catalog to add the module to.</param>\n        /// <param name=\"moduleName\">Name of the module to be added.</param>\n        /// <param name=\"moduleType\"><see cref=\"Type\"/> of the module to be added.</param>\n        /// <param name=\"dependsOn\">Collection of module names (<see cref=\"IModuleInfo.ModuleName\"/>) of the modules on which the module to be added logically depends on.</param>\n        /// <returns>The same <see cref=\"IModuleCatalog\"/> instance with the added module.</returns>\n        public static IModuleCatalog AddModule(this IModuleCatalog catalog, string moduleName, string moduleType, params string[] dependsOn)\n        {\n            return catalog.AddModule(moduleName, moduleType, InitializationMode.WhenAvailable, dependsOn);\n        }\n\n        /// <summary>\n        /// Adds a groupless <see cref=\"ModuleInfo\"/> to the catalog.\n        /// </summary>\n        /// <param name=\"catalog\">The catalog to add the module to.</param>\n        /// <param name=\"moduleName\">Name of the module to be added.</param>\n        /// <param name=\"moduleType\"><see cref=\"Type\"/> of the module to be added.</param>\n        /// <param name=\"initializationMode\">Stage on which the module to be added will be initialized.</param>\n        /// <param name=\"dependsOn\">Collection of module names (<see cref=\"ModuleInfo.ModuleName\"/>) of the modules on which the module to be added logically depends on.</param>\n        /// <returns>The same <see cref=\"IModuleCatalog\"/> instance with the added module.</returns>\n        public static IModuleCatalog AddModule(this IModuleCatalog catalog, string moduleName, string moduleType, InitializationMode initializationMode, params string[] dependsOn)\n        {\n            return catalog.AddModule(moduleName, moduleType, null, initializationMode, dependsOn);\n        }\n\n        /// <summary>\n        /// Adds a groupless <see cref=\"ModuleInfo\"/> to the catalog.\n        /// </summary>\n        /// <param name=\"catalog\">The catalog to add the module to.</param>\n        /// <param name=\"moduleName\">Name of the module to be added.</param>\n        /// <param name=\"moduleType\"><see cref=\"Type\"/> of the module to be added.</param>\n        /// <param name=\"refValue\">Reference to the location of the module to be added assembly.</param>\n        /// <param name=\"initializationMode\">Stage on which the module to be added will be initialized.</param>\n        /// <param name=\"dependsOn\">Collection of module names (<see cref=\"ModuleInfo.ModuleName\"/>) of the modules on which the module to be added logically depends on.</param>\n        /// <returns>The same <see cref=\"IModuleCatalog\"/> instance with the added module.</returns>\n        public static IModuleCatalog AddModule(this IModuleCatalog catalog, string moduleName, string moduleType, string refValue, InitializationMode initializationMode, params string[] dependsOn)\n        {\n            if (moduleName == null)\n                throw new ArgumentNullException(nameof(moduleName));\n\n            if (moduleType == null)\n                throw new ArgumentNullException(nameof(moduleType));\n\n            ModuleInfo moduleInfo = new ModuleInfo(moduleName, moduleType, dependsOn)\n            {\n                InitializationMode = initializationMode,\n                Ref = refValue\n            };\n            return catalog.AddModule(moduleInfo);\n        }\n\n        /// <summary>\n        /// Adds the module to the <see cref=\"IModuleCatalog\"/>.\n        /// </summary>\n        /// <param name=\"catalog\">The catalog to add the module to.</param>\n        /// <param name=\"mode\">The <see cref=\"InitializationMode\"/> to use.</param>\n        /// <typeparam name=\"T\">The <see cref=\"IModule\"/> type parameter.</typeparam>\n        /// <returns>The same <see cref=\"IModuleCatalog\"/> instance with the added module.</returns>\n        public static IModuleCatalog AddModule<T>(this IModuleCatalog catalog, InitializationMode mode = InitializationMode.WhenAvailable)\n            where T : IModule =>\n            catalog.AddModule<T>(typeof(T).Name, mode);\n\n        /// <summary>\n        /// Adds the module to the <see cref=\"IModuleCatalog\"/>.\n        /// </summary>\n        /// <param name=\"catalog\">The catalog to add the module to.</param>\n        /// <param name=\"name\">Name of the module to be added.</param>\n        /// <typeparam name=\"T\">The <see cref=\"IModule\"/> type parameter.</typeparam>\n        /// <returns>The same <see cref=\"IModuleCatalog\"/> instance with the added module.</returns>\n        public static IModuleCatalog AddModule<T>(this IModuleCatalog catalog, string name)\n            where T : IModule =>\n            catalog.AddModule<T>(name, InitializationMode.WhenAvailable);\n\n        /// <summary>\n        /// Adds the module to the <see cref=\"IModuleCatalog\"/>.\n        /// </summary>\n        /// <param name=\"catalog\">The catalog to add the module to.</param>\n        /// <param name=\"name\">Name of the module to be added.</param>\n        /// <param name=\"mode\">The <see cref=\"InitializationMode\"/> to use.</param>\n        /// <typeparam name=\"T\">The <see cref=\"IModule\"/> type parameter.</typeparam>\n        /// <returns>The same <see cref=\"IModuleCatalog\"/> instance with the added module.</returns>\n        public static IModuleCatalog AddModule<T>(this IModuleCatalog catalog, string name, InitializationMode mode)\n            where T : IModule =>\n            catalog.AddModule(new ModuleInfo(typeof(T), name, mode));\n\n        /// <summary>\n        /// Creates and adds a <see cref=\"ModuleInfoGroup\"/> to the catalog.\n        /// </summary>\n        /// <param name=\"catalog\">The catalog to add the module to.</param>\n        /// <param name=\"initializationMode\">Stage on which the module group to be added will be initialized.</param>\n        /// <param name=\"refValue\">Reference to the location of the module group to be added.</param>\n        /// <param name=\"moduleInfos\">Collection of <see cref=\"ModuleInfo\"/> included in the group.</param>\n        /// <returns>The same <see cref=\"IModuleCatalog\"/> with the added module group.</returns>\n        public static IModuleCatalog AddGroup(this IModuleCatalog catalog, InitializationMode initializationMode, string refValue, params ModuleInfo[] moduleInfos)\n        {\n            if (!(catalog is IModuleGroupsCatalog groupSupport))\n                throw new NotSupportedException(Resources.MustBeModuleGroupCatalog);\n\n            if (moduleInfos == null)\n                throw new ArgumentNullException(nameof(moduleInfos));\n\n            ModuleInfoGroup newGroup = new ModuleInfoGroup\n            {\n                InitializationMode = initializationMode,\n                Ref = refValue\n            };\n\n            foreach (var info in moduleInfos)\n            {\n                newGroup.Add(info);\n            }\n\n            groupSupport.Items.Add(newGroup);\n\n            return catalog;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Modularity/IModuleGroupsCatalog.cs",
    "content": "﻿using System.Collections.ObjectModel;\n\nnamespace Prism.Modularity\n{\n    /// <summary>\n    /// Defines a model that can get the collection of <see cref=\"IModuleCatalogItem\"/>.\n    /// </summary>\n    public interface IModuleGroupsCatalog\n    {\n        /// <summary>\n        /// Gets the items in the <see cref=\"IModuleCatalog\"/>. This property is mainly used to add <see cref=\"IModuleInfoGroup\"/>s or\n        /// <see cref=\"IModuleInfo\"/>s through XAML.\n        /// </summary>\n        /// <value>The items in the catalog.</value>\n        Collection<IModuleCatalogItem> Items { get; }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Modularity/IModuleTypeLoader.cs",
    "content": "namespace Prism.Modularity\n{\n    /// <summary>\n    /// Defines the interface for moduleTypeLoaders\n    /// </summary>\n    public interface IModuleTypeLoader\n    {\n        /// <summary>\n        /// Evaluates the <see cref=\"IModuleInfo.Ref\"/> property to see if the current typeloader will be able to retrieve the <paramref name=\"moduleInfo\"/>.\n        /// </summary>\n        /// <param name=\"moduleInfo\">Module that should have it's type loaded.</param>\n        /// <returns><see langword=\"true\"/> if the current typeloader is able to retrieve the module, otherwise <see langword=\"false\"/>.</returns>\n        bool CanLoadModuleType(IModuleInfo moduleInfo);\n\n        /// <summary>\n        /// Retrieves the <paramref name=\"moduleInfo\"/>.\n        /// </summary>\n        /// <param name=\"moduleInfo\">Module that should have it's type loaded.</param>\n        void LoadModuleType(IModuleInfo moduleInfo);\n\n        /// <summary>\n        /// Raised repeatedly to provide progress as modules are downloaded in the background.\n        /// </summary>\n        event EventHandler<ModuleDownloadProgressChangedEventArgs> ModuleDownloadProgressChanged;\n\n        /// <summary>\n        /// Raised when a module is loaded or fails to load.\n        /// </summary>\n        /// <remarks>\n        /// This event is raised once per ModuleInfo instance requested in <see cref=\"LoadModuleType\"/>.\n        /// </remarks>\n        event EventHandler<LoadModuleCompletedEventArgs> LoadModuleCompleted;\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Modularity/ModuleAttribute.Desktop.cs",
    "content": "namespace Prism.Modularity\n{\n    /// <summary>\n    /// Indicates that the class should be considered a named module using the\n    /// provided module name.\n    /// </summary>\n    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]\n    public sealed class ModuleAttribute : Attribute\n    {\n        /// <summary>\n        /// Gets or sets the name of the module.\n        /// </summary>\n        /// <value>The name of the module.</value>\n        public string ModuleName { get; set; }\n\n        /// <summary>\n        /// Gets or sets the value indicating whether the module should be loaded OnDemand.\n        /// </summary>\n        /// When <see langword=\"false\"/> (default value), it indicates the module should be loaded as soon as it's dependencies are satisfied.\n        /// Otherwise you should explicitly load this module via the <see cref=\"ModuleManager\"/>.\n        public bool OnDemand { get; set; }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Modularity/ModuleCatalog.cs",
    "content": "using System.IO;\n#if !AVALONIA\nusing System.Windows.Markup;\n#else\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing Avalonia.Metadata;\n#endif\n\nnamespace Prism.Modularity\n{\n    /// <summary>\n    /// The <see cref=\"ModuleCatalog\"/> holds information about the modules that can be used by the\n    /// application. Each module is described in a <see cref=\"ModuleInfo\"/> class, that records the\n    /// name, type and location of the module.\n    ///\n    /// It also verifies that the <see cref=\"ModuleCatalog\"/> is internally valid. That means that\n    /// it does not have:\n    /// <list>\n    ///     <item>Circular dependencies</item>\n    ///     <item>Missing dependencies</item>\n    ///     <item>\n    ///         Invalid dependencies, such as a Module that's loaded at startup that depends on a module\n    ///         that might need to be retrieved.\n    ///     </item>\n    /// </list>\n    /// The <see cref=\"ModuleCatalog\"/> also serves as a baseclass for more specialized Catalogs .\n    /// </summary>\n    /// <remarks>Avalonia does use, System.Windows.Markup. See property, `Items` below.</remarks>\n#if !AVALONIA\n    [ContentProperty(\"Items\")]\n#endif\n    public class ModuleCatalog : ModuleCatalogBase, IModuleGroupsCatalog\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ModuleCatalog\"/> class.\n        /// </summary>\n        public ModuleCatalog() : base()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ModuleCatalog\"/> class while providing an\n        /// initial list of <see cref=\"ModuleInfo\"/>s.\n        /// </summary>\n        /// <param name=\"modules\">The initial list of modules.</param>\n        public ModuleCatalog(IEnumerable<ModuleInfo> modules) : base(modules)\n        {\n        }\n\n#if AVALONIA\n        /// <summary>\n        /// Gets the items in the Prism.Modularity.IModuleCatalog. This property is mainly\n        /// used to add Prism.Modularity.IModuleInfoGroups or Prism.Modularity.IModuleInfos\n        /// through XAML.\n        /// </summary>\n        [Content]\n        public new Collection<IModuleCatalogItem> Items => base.Items;\n#endif\n\n        /// <summary>\n        /// Creates a valid file uri to locate the module assembly file\n        /// </summary>\n        /// <param name=\"filePath\">The relative path to the file</param>\n        /// <returns>The valid absolute file path</returns>\n        protected virtual string GetFileAbsoluteUri(string filePath)\n        {\n            UriBuilder uriBuilder = new UriBuilder();\n            uriBuilder.Host = String.Empty;\n            uriBuilder.Scheme = Uri.UriSchemeFile;\n            uriBuilder.Path = Path.GetFullPath(filePath);\n            Uri fileUri = uriBuilder.Uri;\n\n            return fileUri.ToString();\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Modularity/ModuleConfigurationElement.Desktop.cs",
    "content": "using System.Configuration;\n\nnamespace Prism.Modularity\n{\n    /// <summary>\n    /// A configuration element to declare module metadata.\n    /// </summary>\n    public class ModuleConfigurationElement : ConfigurationElement\n    {\n        /// <summary>\n        /// Initializes a new instance of <see cref=\"ModuleConfigurationElement\"/>.\n        /// </summary>\n        public ModuleConfigurationElement()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of <see cref=\"ModuleConfigurationElement\"/>.\n        /// </summary>\n        /// <param name=\"assemblyFile\">The assembly file where the module is located.</param>\n        /// <param name=\"moduleType\">The type of the module.</param>\n        /// <param name=\"moduleName\">The name of the module.</param>\n        /// <param name=\"startupLoaded\">This attribute specifies whether the module is loaded at startup.</param>\n        public ModuleConfigurationElement(string assemblyFile, string moduleType, string moduleName, bool startupLoaded)\n        {\n            base[\"assemblyFile\"] = assemblyFile;\n            base[\"moduleType\"] = moduleType;\n            base[\"moduleName\"] = moduleName;\n            base[\"startupLoaded\"] = startupLoaded;\n        }\n\n        /// <summary>\n        /// Gets or sets the assembly file.\n        /// </summary>\n        /// <value>The assembly file.</value>\n        [ConfigurationProperty(\"assemblyFile\", IsRequired = true)]\n        public string AssemblyFile\n        {\n            get { return (string)base[\"assemblyFile\"]; }\n            set { base[\"assemblyFile\"] = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets the module type.\n        /// </summary>\n        /// <value>The module's type.</value>\n        [ConfigurationProperty(\"moduleType\", IsRequired = true)]\n        public string ModuleType\n        {\n            get { return (string)base[\"moduleType\"]; }\n            set { base[\"moduleType\"] = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets the module name.\n        /// </summary>\n        /// <value>The module's name.</value>\n        [ConfigurationProperty(\"moduleName\", IsRequired = true)]\n        public string ModuleName\n        {\n            get { return (string)base[\"moduleName\"]; }\n            set { base[\"moduleName\"] = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets a value indicating whether the module should be loaded at startup.\n        /// </summary>\n        /// <value>A value indicating whether the module should be loaded at startup.</value>\n        [ConfigurationProperty(\"startupLoaded\", IsRequired = false, DefaultValue = true)]\n        public bool StartupLoaded\n        {\n            get { return (bool)base[\"startupLoaded\"]; }\n            set { base[\"startupLoaded\"] = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets the modules this module depends on.\n        /// </summary>\n        /// <value>The names of the modules that this depends on.</value>\n        [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Usage\", \"CA2227:CollectionPropertiesShouldBeReadOnly\")]\n        [ConfigurationProperty(\"dependencies\", IsDefaultCollection = true, IsKey = false)]\n        public ModuleDependencyCollection Dependencies\n        {\n            get { return (ModuleDependencyCollection)base[\"dependencies\"]; }\n            set { base[\"dependencies\"] = value; }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Modularity/ModuleConfigurationElementCollection.Desktop.cs",
    "content": "using System.Configuration;\n\nnamespace Prism.Modularity\n{\n    /// <summary>\n    /// A collection of <see cref=\"ModuleConfigurationElement\"/>.\n    /// </summary>\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Design\", \"CA1010:CollectionsShouldImplementGenericInterface\")]\n    public class ModuleConfigurationElementCollection : ConfigurationElementCollection\n    {\n        /// <summary>\n        /// Initializes a new instance of <see cref=\"ModuleConfigurationElementCollection\"/>.\n        /// </summary>\n        public ModuleConfigurationElementCollection()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new <see cref=\"ModuleConfigurationElementCollection\"/>.\n        /// </summary>\n        /// <param name=\"modules\">The initial set of <see cref=\"ModuleConfigurationElement\"/>.</param>\n        /// <exception cref=\"ArgumentNullException\">An <see cref=\"ArgumentNullException\"/> is thrown if <paramref name=\"modules\"/> is <see langword=\"null\"/>.</exception>\n        [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Usage\", \"CA2214:DoNotCallOverridableMethodsInConstructors\")]\n        public ModuleConfigurationElementCollection(ModuleConfigurationElement[] modules)\n        {\n            if (modules == null)\n                throw new ArgumentNullException(nameof(modules));\n\n            foreach (ModuleConfigurationElement module in modules)\n            {\n                BaseAdd(module);\n            }\n        }\n\n        /// <summary>\n        /// Gets a value indicating whether an exception should be raised if a duplicate element is found.\n        /// This property will always return true.\n        /// </summary>\n        /// <value>A <see cref=\"bool\"/> value.</value>\n        protected override bool ThrowOnDuplicate\n        {\n            get { return true; }\n        }\n\n        ///<summary>\n        ///Gets the type of the <see cref=\"T:System.Configuration.ConfigurationElementCollection\" />.\n        ///</summary>\n        ///<value>\n        ///The <see cref=\"T:System.Configuration.ConfigurationElementCollectionType\" /> of this collection.\n        ///</value>\n        public override ConfigurationElementCollectionType CollectionType\n        {\n            get { return ConfigurationElementCollectionType.BasicMap; }\n        }\n\n        ///<summary>\n        ///Gets the name used to identify this collection of elements in the configuration file when overridden in a derived class.\n        ///</summary>\n        ///<value>\n        ///The name of the collection; otherwise, an empty string.\n        ///</value>\n        protected override string ElementName\n        {\n            get { return \"module\"; }\n        }\n\n        /// <summary>\n        /// Gets the <see cref=\"ModuleConfigurationElement\"/> located at the specified index in the collection.\n        /// </summary>\n        /// <param name=\"index\">The index of the element in the collection.</param>\n        /// <returns>A <see cref=\"ModuleConfigurationElement\"/>.</returns>\n        public ModuleConfigurationElement this[int index]\n        {\n            get { return (ModuleConfigurationElement)base.BaseGet(index); }\n        }\n\n        /// <summary>\n        /// Adds a <see cref=\"ModuleConfigurationElement\"/> to the collection.\n        /// </summary>\n        /// <param name=\"module\">A <see cref=\"ModuleConfigurationElement\"/> instance.</param>\n        public void Add(ModuleConfigurationElement module)\n        {\n            BaseAdd(module);\n        }\n\n        /// <summary>\n        /// Tests if the collection contains the configuration for the specified module name.\n        /// </summary>\n        /// <param name=\"moduleName\">The name of the module to search the configuration for.</param>\n        /// <returns><see langword=\"true\"/> if a configuration for the module is present; otherwise <see langword=\"false\"/>.</returns>\n        public bool Contains(string moduleName)\n        {\n            return base.BaseGet(moduleName) != null;\n        }\n\n        /// <summary>\n        /// Searches the collection for all the <see cref=\"ModuleConfigurationElement\"/> that match the specified predicate.\n        /// </summary>\n        /// <param name=\"match\">A <see cref=\"Predicate{T}\"/> that implements the match test.</param>\n        /// <returns>A <see cref=\"List{T}\"/> with the successful matches.</returns>\n        /// <exception cref=\"ArgumentNullException\">An <see cref=\"ArgumentNullException\"/> is thrown if <paramref name=\"match\"/> is null.</exception>\n        public IList<ModuleConfigurationElement> FindAll(Predicate<ModuleConfigurationElement> match)\n        {\n            if (match == null)\n                throw new ArgumentNullException(nameof(match));\n\n            IList<ModuleConfigurationElement> found = new List<ModuleConfigurationElement>();\n            foreach (ModuleConfigurationElement moduleElement in this)\n            {\n                if (match(moduleElement))\n                {\n                    found.Add(moduleElement);\n                }\n            }\n            return found;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"ModuleConfigurationElement\"/>.\n        /// </summary>\n        /// <returns>A <see cref=\"ModuleConfigurationElement\"/>.</returns>\n        protected override ConfigurationElement CreateNewElement()\n        {\n            return new ModuleConfigurationElement();\n        }\n\n        /// <summary>\n        /// Gets the element key for a specified configuration element when overridden in a derived class.\n        /// </summary>\n        /// <param name=\"element\">The <see cref=\"T:System.Configuration.ConfigurationElement\" /> to return the key for. </param>\n        /// <returns>\n        /// An <see cref=\"T:System.Object\" /> that acts as the key for the specified <see cref=\"T:System.Configuration.ConfigurationElement\" />.\n        /// </returns>\n        protected override object GetElementKey(ConfigurationElement element)\n        {\n            return ((ModuleConfigurationElement)element).ModuleName;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Modularity/ModuleDependencyCollection.Desktop.cs",
    "content": "using System.Configuration;\n\nnamespace Prism.Modularity\n{\n    /// <summary>\n    /// A collection of <see cref=\"ModuleDependencyConfigurationElement\"/>.\n    /// </summary>\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Design\", \"CA1010:CollectionsShouldImplementGenericInterface\")]\n    public class ModuleDependencyCollection : ConfigurationElementCollection\n    {\n        /// <summary>\n        /// Initializes a new instance of <see cref=\"ModuleDependencyCollection\"/>.\n        /// </summary>\n        public ModuleDependencyCollection()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of <see cref=\"ModuleDependencyCollection\"/>.\n        /// </summary>\n        /// <param name=\"dependencies\">An array of <see cref=\"ModuleDependencyConfigurationElement\"/> with initial list of dependencies.</param>\n        [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Usage\", \"CA2214:DoNotCallOverridableMethodsInConstructors\")]\n        public ModuleDependencyCollection(ModuleDependencyConfigurationElement[] dependencies)\n        {\n            if (dependencies == null)\n                throw new ArgumentNullException(nameof(dependencies));\n\n            foreach (ModuleDependencyConfigurationElement dependency in dependencies)\n            {\n                BaseAdd(dependency);\n            }\n        }\n\n        ///<summary>\n        ///Gets the type of the <see cref=\"T:System.Configuration.ConfigurationElementCollection\" />.\n        ///</summary>\n        ///<value>\n        ///The <see cref=\"T:System.Configuration.ConfigurationElementCollectionType\" /> of this collection.\n        ///</value>\n        public override ConfigurationElementCollectionType CollectionType\n        {\n            get { return ConfigurationElementCollectionType.BasicMap; }\n        }\n\n        ///<summary>\n        ///Gets the name used to identify this collection of elements in the configuration file when overridden in a derived class.\n        ///</summary>\n        ///<value>\n        ///The name of the collection; otherwise, an empty string.\n        ///</value>\n        protected override string ElementName\n        {\n            get { return \"dependency\"; }\n        }\n\n        /// <summary>\n        /// Gets the <see cref=\"ModuleDependencyConfigurationElement\"/> located at the specified index in the collection.\n        /// </summary>\n        /// <param name=\"index\">The index of the element in the collection.</param>\n        /// <returns>A <see cref=\"ModuleDependencyConfigurationElement\"/>.</returns>\n        public ModuleDependencyConfigurationElement this[int index]\n        {\n            get { return (ModuleDependencyConfigurationElement)base.BaseGet(index); }\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"ModuleDependencyConfigurationElement\"/>.\n        /// </summary>\n        /// <returns>A <see cref=\"ModuleDependencyConfigurationElement\"/>.</returns>\n        protected override ConfigurationElement CreateNewElement()\n        {\n            return new ModuleDependencyConfigurationElement();\n        }\n\n        ///<summary>\n        ///Gets the element key for a specified configuration element when overridden in a derived class.\n        ///</summary>\n        ///<param name=\"element\">The <see cref=\"T:System.Configuration.ConfigurationElement\" /> to return the key for. </param>\n        ///<returns>\n        ///An <see cref=\"T:System.Object\" /> that acts as the key for the specified <see cref=\"T:System.Configuration.ConfigurationElement\" />.\n        ///</returns>\n        protected override object GetElementKey(ConfigurationElement element)\n        {\n            return ((ModuleDependencyConfigurationElement)element).ModuleName;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Modularity/ModuleDependencyConfigurationElement.Desktop.cs",
    "content": "using System.Configuration;\n\nnamespace Prism.Modularity\n{\n    /// <summary>\n    /// A <see cref=\"ConfigurationElement\"/> for module dependencies.\n    /// </summary>\n    public class ModuleDependencyConfigurationElement : ConfigurationElement\n    {\n        /// <summary>\n        /// Initializes a new instance of <see cref=\"ModuleDependencyConfigurationElement\"/>.\n        /// </summary>\n        public ModuleDependencyConfigurationElement()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of <see cref=\"ModuleDependencyConfigurationElement\"/>.\n        /// </summary>\n        /// <param name=\"moduleName\">A module name.</param>\n        public ModuleDependencyConfigurationElement(string moduleName)\n        {\n            base[\"moduleName\"] = moduleName;\n        }\n\n        /// <summary>\n        /// Gets or sets the name of a module another module depends on.\n        /// </summary>\n        /// <value>The name of a module another module depends on.</value>\n        [ConfigurationProperty(\"moduleName\", IsRequired = true, IsKey = true)]\n        public string ModuleName\n        {\n            get { return (string)base[\"moduleName\"]; }\n            set { base[\"moduleName\"] = value; }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Modularity/ModuleInfo.Desktop.cs",
    "content": "namespace Prism.Modularity\n{\n    [Serializable]\n    public partial class ModuleInfo\n    {\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Modularity/ModuleInfo.cs",
    "content": "using System.Collections.ObjectModel;\n\nnamespace Prism.Modularity\n{\n    /// <summary>\n    /// Defines the metadata that describes a module.\n    /// </summary>\n    public partial class ModuleInfo : IModuleInfo\n    {\n        /// <summary>\n        /// Initializes a new empty instance of <see cref=\"ModuleInfo\"/>.\n        /// </summary>\n        public ModuleInfo()\n            : this(null, null, [])\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of <see cref=\"ModuleInfo\"/>.\n        /// </summary>\n        /// <param name=\"name\">The module's name.</param>\n        /// <param name=\"type\">The module <see cref=\"Type\"/>'s AssemblyQualifiedName.</param>\n        /// <param name=\"dependsOn\">The modules this instance depends on.</param>\n        /// <exception cref=\"ArgumentNullException\">An <see cref=\"ArgumentNullException\"/> is thrown if <paramref name=\"dependsOn\"/> is <see langword=\"null\"/>.</exception>\n        public ModuleInfo(string name, string type, params string[] dependsOn)\n        {\n            if (dependsOn == null)\n                throw new ArgumentNullException(nameof(dependsOn));\n\n            ModuleName = name;\n            ModuleType = type;\n            DependsOn = [.. dependsOn];\n        }\n\n        /// <summary>\n        /// Initializes a new instance of <see cref=\"ModuleInfo\"/>.\n        /// </summary>\n        /// <param name=\"name\">The module's name.</param>\n        /// <param name=\"type\">The module's type.</param>\n        public ModuleInfo(string name, string type) : this(name, type, [])\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of <see cref=\"ModuleInfo\"/>.\n        /// </summary>\n        /// <param name=\"moduleType\">The module's type.</param>\n        public ModuleInfo(Type moduleType)\n            : this(moduleType, moduleType.Name) { }\n\n        /// <summary>\n        /// Initializes a new instance of <see cref=\"ModuleInfo\"/>.\n        /// </summary>\n        /// <param name=\"moduleType\">The module's type.</param>\n        /// <param name=\"moduleName\">The module's name.</param>\n        public ModuleInfo(Type moduleType, string moduleName)\n            : this(moduleType, moduleName, InitializationMode.WhenAvailable) { }\n\n        /// <summary>\n        /// Initializes a new instance of <see cref=\"ModuleInfo\"/>.\n        /// </summary>\n        /// <param name=\"moduleType\">The module's type.</param>\n        /// <param name=\"moduleName\">The module's name.</param>\n        /// <param name=\"initializationMode\">The module's <see cref=\"InitializationMode\"/>.</param>\n        public ModuleInfo(Type moduleType, string moduleName, InitializationMode initializationMode)\n            : this(moduleName, moduleType.AssemblyQualifiedName)\n        {\n            InitializationMode = initializationMode;\n        }\n\n        /// <summary>\n        /// Gets or sets the name of the module.\n        /// </summary>\n        /// <value>The name of the module.</value>\n        public string ModuleName { get; set; }\n\n        /// <summary>\n        /// Gets or sets the module <see cref=\"Type\"/>'s AssemblyQualifiedName.\n        /// </summary>\n        /// <value>The type of the module.</value>\n        public string ModuleType { get; set; }\n\n        /// <summary>\n        /// Gets or sets the list of modules that this module depends upon.\n        /// </summary>\n        /// <value>The list of modules that this module depends upon.</value>\n        [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Usage\", \"CA2227:CollectionPropertiesShouldBeReadOnly\", Justification = \"The setter is here to work around a Silverlight issue with setting properties from within Xaml.\")]\n        public Collection<string> DependsOn { get; set; }\n\n        /// <summary>\n        /// Specifies on which stage the Module will be initialized.\n        /// </summary>\n        public InitializationMode InitializationMode { get; set; }\n\n        /// <summary>\n        /// Reference to the location of the module assembly.\n        /// <example>The following are examples of valid <see cref=\"ModuleInfo.Ref\"/> values:\n        /// file://c:/MyProject/Modules/MyModule.dll for a loose DLL in WPF.\n        /// </example>\n        /// </summary>\n        public string Ref { get; set; }\n\n        /// <summary>\n        /// Gets or sets the state of the <see cref=\"ModuleInfo\"/> with regards to the module loading and initialization process.\n        /// </summary>\n        public ModuleState State { get; set; }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Modularity/ModuleInfoGroup.cs",
    "content": "using System.Collections;\nusing System.Collections.ObjectModel;\nusing Prism.Properties;\n\nnamespace Prism.Modularity\n{\n    /// <summary>\n    /// Represents a group of <see cref=\"IModuleInfo\"/> instances that are usually deployed together. <see cref=\"ModuleInfoGroup\"/>s\n    /// are also used by the <see cref=\"IModuleCatalog\"/> to prevent common deployment problems such as having a module that's required\n    /// at startup that depends on modules that will only be downloaded on demand.\n    ///\n    /// The group also forwards <see cref=\"Ref\"/> and <see cref=\"InitializationMode\"/> values to the <see cref=\"IModuleInfo\"/>s that it\n    /// contains.\n    /// </summary>\n    [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Naming\", \"CA1710:IdentifiersShouldHaveCorrectSuffix\")]\n    public class ModuleInfoGroup : IModuleInfoGroup\n    {\n        private readonly Collection<IModuleInfo> _modules = new Collection<IModuleInfo>();\n\n        /// <summary>\n        /// Gets or sets the <see cref=\"IModuleInfo.InitializationMode\"/> for the whole group. Any <see cref=\"IModuleInfo\"/> classes that are\n        /// added after setting this value will also get this <see cref=\"InitializationMode\"/>.\n        /// </summary>\n        /// <see cref=\"IModuleInfo.InitializationMode\"/>\n        /// <value>The initialization mode.</value>\n        public InitializationMode InitializationMode { get; set; }\n\n        /// <summary>\n        /// Gets or sets the <see cref=\"IModuleInfo.Ref\"/> value for the whole group. Any <see cref=\"IModuleInfo\"/> classes that are\n        /// added after setting this value will also get this <see cref=\"Ref\"/>.\n        ///\n        /// The ref value will also be used by the <see cref=\"IModuleManager\"/> to determine which  <see cref=\"IModuleTypeLoader\"/> to use.\n        /// For example, using an \"file://\" prefix with a valid URL will cause the FileModuleTypeLoader to be used\n        /// (Only available in the desktop version of CAL).\n        /// </summary>\n        /// <see cref=\"ModuleInfo.Ref\"/>\n        /// <value>The ref value that will be used.</value>\n        public string Ref { get; set; }\n\n        /// <summary>\n        /// Adds an <see cref=\"IModuleInfo\"/> moduleInfo to the <see cref=\"ModuleInfoGroup\"/>.\n        /// </summary>\n        /// <param name=\"item\">The <see cref=\"IModuleInfo\"/> to the <see cref=\"ModuleInfoGroup\"/>.</param>\n        public void Add(IModuleInfo item)\n        {\n            ForwardValues(item);\n            _modules.Add(item);\n        }\n\n        internal void UpdateModulesRef()\n        {\n            foreach (var module in _modules)\n            {\n                module.Ref = Ref;\n            }\n        }\n\n        /// <summary>\n        /// Forwards <see cref=\"InitializationMode\"/> and <see cref=\"Ref\"/> properties from this <see cref=\"ModuleInfoGroup\"/>\n        /// to <paramref name=\"moduleInfo\"/>.\n        /// </summary>\n        /// <param name=\"moduleInfo\">The module info to forward values to.</param>\n        /// <exception cref=\"ArgumentNullException\">An <see cref=\"ArgumentNullException\"/> is thrown if <paramref name=\"moduleInfo\"/> is <see langword=\"null\"/>.</exception>\n        protected void ForwardValues(IModuleInfo moduleInfo)\n        {\n            if (moduleInfo == null)\n                throw new ArgumentNullException(nameof(moduleInfo));\n\n            if (moduleInfo.Ref == null)\n            {\n                moduleInfo.Ref = Ref;\n            }\n\n            if (moduleInfo.InitializationMode == InitializationMode.WhenAvailable && InitializationMode != InitializationMode.WhenAvailable)\n            {\n                moduleInfo.InitializationMode = InitializationMode;\n            }\n        }\n\n        /// <summary>\n        /// Removes all <see cref=\"IModuleInfo\"/>s from the <see cref=\"ModuleInfoGroup\"/>.\n        /// </summary>\n        public void Clear() => _modules.Clear();\n\n        /// <summary>\n        /// Determines whether the <see cref=\"ModuleInfoGroup\"/> contains a specific value.\n        /// </summary>\n        /// <param name=\"item\">The object to locate in the <see cref=\"ModuleInfoGroup\"/>.</param>\n        /// <returns>\n        /// true if <paramref name=\"item\"/> is found in the <see cref=\"ModuleInfoGroup\"/>; otherwise, false.\n        /// </returns>\n        public bool Contains(IModuleInfo item) => _modules.Contains(item);\n\n        /// <summary>\n        /// Copies the elements of the <see cref=\"ModuleInfoGroup\"/> to an <see cref=\"T:System.Array\"/>, starting at a particular <see cref=\"T:System.Array\"/> index.\n        /// </summary>\n        /// <param name=\"array\">The one-dimensional <see cref=\"T:System.Array\"/> that is the destination of the elements copied from <see cref=\"ModuleInfoGroup\"/>. The <see cref=\"T:System.Array\"/> must have zero-based indexing.</param>\n        /// <param name=\"arrayIndex\">The zero-based index in <paramref name=\"array\"/> at which copying begins.</param>\n        /// <exception cref=\"T:System.ArgumentNullException\">\n        /// \t<paramref name=\"array\"/> is null.\n        /// </exception>\n        /// <exception cref=\"T:System.ArgumentOutOfRangeException\">\n        /// \t<paramref name=\"arrayIndex\"/> is less than 0.\n        /// </exception>\n        /// <exception cref=\"T:System.ArgumentException\">\n        /// \t<paramref name=\"array\"/> is multidimensional.\n        /// -or-\n        /// <paramref name=\"arrayIndex\"/> is equal to or greater than the length of <paramref name=\"array\"/>.\n        /// -or-\n        /// The number of elements in the source <see cref=\"ModuleInfoGroup\"/> is greater than the available space from <paramref name=\"arrayIndex\"/> to the end of the destination <paramref name=\"array\"/>.\n        /// </exception>\n        public void CopyTo(IModuleInfo[] array, int arrayIndex)\n        {\n            _modules.CopyTo(array, arrayIndex);\n        }\n\n        /// <summary>\n        /// Gets the number of elements contained in the <see cref=\"ModuleInfoGroup\"/>.\n        /// </summary>\n        /// <value></value>\n        /// <returns>\n        /// The number of elements contained in the <see cref=\"ModuleInfoGroup\"/>.\n        /// </returns>\n        public int Count => _modules.Count;\n\n        /// <summary>\n        /// Gets a value indicating whether the <see cref=\"ModuleInfoGroup\"/> is read-only.\n        /// </summary>\n        /// <value></value>\n        /// <returns>false, because the <see cref=\"ModuleInfoGroup\"/> is not Read-Only.\n        /// </returns>\n        public bool IsReadOnly => false;\n\n        /// <summary>\n        /// Removes the first occurrence of a specific object from the <see cref=\"ModuleInfoGroup\"/>.\n        /// </summary>\n        /// <param name=\"item\">The object to remove from the <see cref=\"ModuleInfoGroup\"/>.</param>\n        /// <returns>\n        /// true if <paramref name=\"item\"/> was successfully removed from the <see cref=\"ModuleInfoGroup\"/>; otherwise, false. This method also returns false if <paramref name=\"item\"/> is not found in the original <see cref=\"ModuleInfoGroup\"/>.\n        /// </returns>\n        public bool Remove(IModuleInfo item) => _modules.Remove(item);\n\n        /// <summary>\n        /// Returns an enumerator that iterates through the collection.\n        /// </summary>\n        /// <returns>\n        /// A <see cref=\"T:System.Collections.Generic.IEnumerator`1\"/> that can be used to iterate through the collection.\n        /// </returns>\n        public IEnumerator<IModuleInfo> GetEnumerator() => _modules.GetEnumerator();\n\n        /// <summary>\n        /// Returns an enumerator that iterates through a collection.\n        /// </summary>\n        /// <returns>\n        /// An <see cref=\"T:System.Collections.IEnumerator\"/> object that can be used to iterate through the collection.\n        /// </returns>\n        IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();\n\n        /// <summary>\n        /// Adds an item to the <see cref=\"ModuleInfoGroup\"/>.\n        /// </summary>\n        /// <param name=\"value\">\n        /// The <see cref=\"T:System.Object\"/> to add to the <see cref=\"ModuleInfoGroup\"/>.\n        /// Must be of type <see cref=\"ModuleInfo\"/>\n        /// </param>\n        /// <returns>\n        /// The position into which the new element was inserted.\n        /// </returns>\n        int IList.Add(object value)\n        {\n            Add((IModuleInfo)value);\n            return 1;\n        }\n\n        /// <summary>\n        /// Determines whether the <see cref=\"ModuleInfoGroup\"/> contains a specific value.\n        /// </summary>\n        /// <param name=\"value\">\n        /// The <see cref=\"T:System.Object\"/> to locate in the <see cref=\"ModuleInfoGroup\"/>.\n        /// Must be of type <see cref=\"IModuleInfo\"/>\n        /// </param>\n        /// <returns>\n        /// true if the <see cref=\"T:System.Object\"/> is found in the <see cref=\"ModuleInfoGroup\"/>; otherwise, false.\n        /// </returns>\n        bool IList.Contains(object value)\n        {\n            if (value == null)\n                throw new ArgumentNullException(nameof(value));\n\n            if (!(value is IModuleInfo moduleInfo))\n                throw new ArgumentException(Resources.ValueMustBeOfTypeModuleInfo, nameof(value));\n\n            return Contains(moduleInfo);\n        }\n\n        /// <summary>\n        /// Determines the index of a specific item in the <see cref=\"ModuleInfoGroup\"/>.\n        /// </summary>\n        /// <param name=\"value\">\n        /// The <see cref=\"T:System.Object\"/> to locate in the <see cref=\"ModuleInfoGroup\"/>.\n        /// Must be of type <see cref=\"ModuleInfo\"/>\n        /// </param>\n        /// <returns>\n        /// The index of <paramref name=\"value\"/> if found in the list; otherwise, -1.\n        /// </returns>\n        public int IndexOf(object value) => _modules.IndexOf((IModuleInfo)value);\n\n        /// <summary>\n        /// Inserts an item to the <see cref=\"ModuleInfoGroup\"/> at the specified index.\n        /// </summary>\n        /// <param name=\"index\">The zero-based index at which <paramref name=\"value\"/> should be inserted.</param>\n        /// <param name=\"value\">\n        /// The <see cref=\"T:System.Object\"/> to insert into the <see cref=\"ModuleInfoGroup\"/>.\n        /// Must be of type <see cref=\"IModuleInfo\"/>\n        /// </param>\n        /// <exception cref=\"T:System.ArgumentOutOfRangeException\">\n        /// \t<paramref name=\"index\"/> is not a valid index in the <see cref=\"ModuleInfoGroup\"/>.\n        /// </exception>\n        /// <exception cref=\"ArgumentNullException\">\n        /// If <paramref name=\"value\"/> is null.\n        /// </exception>\n        /// <exception cref=\"ArgumentException\">\n        /// If <paramref name=\"value\"/> is not of type <see cref=\"IModuleInfo\"/>\n        /// </exception>\n        public void Insert(int index, object value)\n        {\n            if (value == null)\n                throw new ArgumentNullException(nameof(value));\n\n            if (!(value is IModuleInfo moduleInfo))\n                throw new ArgumentException(Resources.ValueMustBeOfTypeModuleInfo, nameof(value));\n\n            _modules.Insert(index, moduleInfo);\n        }\n\n        /// <summary>\n        /// Gets a value indicating whether the <see cref=\"ModuleInfoGroup\"/> has a fixed size.\n        /// </summary>\n        /// <returns>false, because the <see cref=\"ModuleInfoGroup\"/> does not have a fixed length.\n        /// </returns>\n        public bool IsFixedSize => false;\n\n        /// <summary>\n        /// Removes the first occurrence of a specific object from the <see cref=\"ModuleInfoGroup\"/>.\n        /// </summary>\n        /// <param name=\"value\">\n        /// The <see cref=\"T:System.Object\"/> to remove from the <see cref=\"ModuleInfoGroup\"/>.\n        /// Must be of type <see cref=\"ModuleInfo\"/>\n        /// </param>\n        void IList.Remove(object value)\n        {\n            Remove((IModuleInfo)value);\n        }\n\n        /// <summary>\n        /// Removes the <see cref=\"T:System.Collections.Generic.IList`1\"/> item at the specified index.\n        /// </summary>\n        /// <param name=\"index\">The zero-based index of the item to remove.</param>\n        /// <exception cref=\"T:System.ArgumentOutOfRangeException\">\n        /// \t<paramref name=\"index\"/> is not a valid index in the <see cref=\"T:System.Collections.Generic.IList`1\"/>.\n        /// </exception>\n        /// <exception cref=\"T:System.NotSupportedException\">\n        /// The <see cref=\"T:System.Collections.Generic.IList`1\"/> is read-only.\n        /// </exception>\n        public void RemoveAt(int index) => _modules.RemoveAt(index);\n\n        /// <summary>\n        /// Gets or sets the <see cref=\"object\"/> at the specified index.\n        /// </summary>\n        /// <value></value>\n        object IList.this[int index]\n        {\n            get => this[index];\n            set => this[index] = (ModuleInfo)value;\n        }\n\n        /// <summary>\n        /// Copies the elements of the <see cref=\"T:System.Collections.ICollection\"/> to an <see cref=\"T:System.Array\"/>, starting at a particular <see cref=\"T:System.Array\"/> index.\n        /// </summary>\n        /// <param name=\"array\">The one-dimensional <see cref=\"T:System.Array\"/> that is the destination of the elements copied from <see cref=\"T:System.Collections.ICollection\"/>. The <see cref=\"T:System.Array\"/> must have zero-based indexing.</param>\n        /// <param name=\"index\">The zero-based index in <paramref name=\"array\"/> at which copying begins.</param>\n        /// <exception cref=\"T:System.ArgumentNullException\">\n        /// \t<paramref name=\"array\"/> is null.\n        /// </exception>\n        /// <exception cref=\"T:System.ArgumentOutOfRangeException\">\n        /// \t<paramref name=\"index\"/> is less than zero.\n        /// </exception>\n        /// <exception cref=\"T:System.ArgumentException\">\n        /// \t<paramref name=\"array\"/> is multidimensional.\n        /// -or-\n        /// <paramref name=\"index\"/> is equal to or greater than the length of <paramref name=\"array\"/>.\n        /// -or-\n        /// The number of elements in the source <see cref=\"T:System.Collections.ICollection\"/> is greater than the available space from <paramref name=\"index\"/> to the end of the destination <paramref name=\"array\"/>.\n        /// </exception>\n        /// <exception cref=\"T:System.ArgumentException\">\n        /// The type of the source <see cref=\"T:System.Collections.ICollection\"/> cannot be cast automatically to the type of the destination <paramref name=\"array\"/>.\n        /// </exception>\n        void ICollection.CopyTo(Array array, int index) =>\n            ((ICollection)_modules).CopyTo(array, index);\n\n        /// <summary>\n        /// Gets a value indicating whether access to the <see cref=\"T:System.Collections.ICollection\"/> is synchronized (thread safe).\n        /// </summary>\n        /// <value></value>\n        /// <returns>true if access to the <see cref=\"T:System.Collections.ICollection\"/> is synchronized (thread safe); otherwise, false.\n        /// </returns>\n        public bool IsSynchronized => ((ICollection)_modules).IsSynchronized;\n\n        /// <summary>\n        /// Gets an object that can be used to synchronize access to the <see cref=\"T:System.Collections.ICollection\"/>.\n        /// </summary>\n        /// <value></value>\n        /// <returns>\n        /// An object that can be used to synchronize access to the <see cref=\"T:System.Collections.ICollection\"/>.\n        /// </returns>\n        public object SyncRoot => ((ICollection)_modules).SyncRoot;\n\n        /// <summary>\n        /// Determines the index of a specific item in the <see cref=\"T:System.Collections.Generic.IList`1\"/>.\n        /// </summary>\n        /// <param name=\"item\">The object to locate in the <see cref=\"T:System.Collections.Generic.IList`1\"/>.</param>\n        /// <returns>\n        /// The index of <paramref name=\"item\"/> if found in the list; otherwise, -1.\n        /// </returns>\n        public int IndexOf(IModuleInfo item) => _modules.IndexOf(item);\n\n        /// <summary>\n        /// Inserts an item to the <see cref=\"T:System.Collections.Generic.IList`1\"/> at the specified index.\n        /// </summary>\n        /// <param name=\"index\">The zero-based index at which <paramref name=\"item\"/> should be inserted.</param>\n        /// <param name=\"item\">The object to insert into the <see cref=\"T:System.Collections.Generic.IList`1\"/>.</param>\n        /// <exception cref=\"T:System.ArgumentOutOfRangeException\">\n        /// \t<paramref name=\"index\"/> is not a valid index in the <see cref=\"T:System.Collections.Generic.IList`1\"/>.\n        /// </exception>\n        public void Insert(int index, IModuleInfo item) => _modules.Insert(index, item);\n\n        /// <summary>\n        /// Gets or sets the <see cref=\"IModuleInfo\"/> at the specified index.\n        /// </summary>\n        /// <value>The <see cref=\"IModuleInfo\"/> at the specified index </value>\n        public IModuleInfo this[int index]\n        {\n            get => _modules[index];\n            set => _modules[index] = value;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Modularity/ModuleInfoGroupExtensions.cs",
    "content": "using System.Collections.ObjectModel;\n\nnamespace Prism.Modularity\n{\n    /// <summary>\n    /// Defines extension methods for the <see cref=\"ModuleInfoGroup\"/> class.\n    /// </summary>\n    public static class ModuleInfoGroupExtensions\n    {\n        /// <summary>\n        /// Adds a new module that is statically referenced to the specified module info group.\n        /// </summary>\n        /// <param name=\"moduleInfoGroup\">The group where to add the module info in.</param>\n        /// <param name=\"moduleName\">The name for the module.</param>\n        /// <param name=\"moduleType\">The type for the module. This type should be a descendant of <see cref=\"IModule\"/>.</param>\n        /// <param name=\"dependsOn\">The names for the modules that this module depends on.</param>\n        /// <returns>Returns the instance of the passed in module info group, to provide a fluid interface.</returns>\n        public static ModuleInfoGroup AddModule(\n                    this ModuleInfoGroup moduleInfoGroup,\n                    string moduleName,\n                    Type moduleType,\n                    params string[] dependsOn)\n        {\n            if (moduleType == null)\n                throw new ArgumentNullException(nameof(moduleType));\n\n            if (moduleInfoGroup == null)\n                throw new ArgumentNullException(nameof(moduleInfoGroup));\n\n            ModuleInfo moduleInfo = new ModuleInfo(moduleName, moduleType.AssemblyQualifiedName);\n            moduleInfo.DependsOn.AddRange(dependsOn);\n            moduleInfoGroup.Add(moduleInfo);\n            return moduleInfoGroup;\n        }\n\n        /// <summary>\n        /// Adds a new module that is statically referenced to the specified module info group.\n        /// </summary>\n        /// <param name=\"moduleInfoGroup\">The group where to add the module info in.</param>\n        /// <param name=\"moduleType\">The type for the module. This type should be a descendant of <see cref=\"IModule\"/>.</param>\n        /// <param name=\"dependsOn\">The names for the modules that this module depends on.</param>\n        /// <returns>Returns the instance of the passed in module info group, to provide a fluid interface.</returns>\n        /// <remarks>The name of the module will be the type name.</remarks>\n        public static ModuleInfoGroup AddModule(\n                    this ModuleInfoGroup moduleInfoGroup,\n                    Type moduleType,\n                    params string[] dependsOn)\n        {\n            if (moduleType == null)\n                throw new ArgumentNullException(nameof(moduleType));\n\n            return AddModule(moduleInfoGroup, moduleType.Name, moduleType, dependsOn);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Modularity/ModuleInitializer.cs",
    "content": "using System.Globalization;\n\nnamespace Prism.Modularity\n{\n    /// <summary>\n    /// Implements the <see cref=\"IModuleInitializer\"/> interface. Handles loading of a module based on a type.\n    /// </summary>\n    public class ModuleInitializer : IModuleInitializer\n    {\n        private readonly IContainerExtension _containerExtension;\n\n        /// <summary>\n        /// Initializes a new instance of <see cref=\"ModuleInitializer\"/>.\n        /// </summary>\n        /// <param name=\"containerExtension\">The container that will be used to resolve the modules by specifying its type.</param>\n        public ModuleInitializer(IContainerExtension containerExtension)\n        {\n            _containerExtension = containerExtension ?? throw new ArgumentNullException(nameof(containerExtension));\n        }\n\n        /// <summary>\n        /// Initializes the specified module.\n        /// </summary>\n        /// <param name=\"moduleInfo\">The module to initialize</param>\n        [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Design\", \"CA1031:DoNotCatchGeneralExceptionTypes\", Justification = \"Catches Exception to handle any exception thrown during the initialization process with the HandleModuleInitializationError method.\")]\n        public void Initialize(IModuleInfo moduleInfo)\n        {\n            if (moduleInfo == null)\n                throw new ArgumentNullException(nameof(moduleInfo));\n\n            IModule moduleInstance = null;\n            try\n            {\n                moduleInstance = CreateModule(moduleInfo);\n                if (moduleInstance != null)\n                {\n                    moduleInstance.RegisterTypes(_containerExtension);\n                    moduleInstance.OnInitialized(_containerExtension);\n                }\n            }\n            catch (Exception ex)\n            {\n                HandleModuleInitializationError(\n                    moduleInfo,\n                    moduleInstance?.GetType().Assembly.FullName,\n                    ex);\n            }\n        }\n\n        /// <summary>\n        /// Handles any exception occurred in the module Initialization process,\n        /// This method can be overridden to provide a different behavior.\n        /// </summary>\n        /// <param name=\"moduleInfo\">The module metadata where the error happened.</param>\n        /// <param name=\"assemblyName\">The assembly name.</param>\n        /// <param name=\"exception\">The exception thrown that is the cause of the current error.</param>\n        /// <exception cref=\"ModuleInitializeException\"></exception>\n        public virtual void HandleModuleInitializationError(IModuleInfo moduleInfo, string assemblyName, Exception exception)\n        {\n            if (moduleInfo == null)\n                throw new ArgumentNullException(nameof(moduleInfo));\n\n            if (exception == null)\n                throw new ArgumentNullException(nameof(exception));\n\n            Exception moduleException;\n\n            if (exception is ModuleInitializeException)\n            {\n                moduleException = exception;\n            }\n            else\n            {\n                if (!string.IsNullOrEmpty(assemblyName))\n                {\n                    moduleException = new ModuleInitializeException(moduleInfo.ModuleName, assemblyName, exception.Message, exception);\n                }\n                else\n                {\n                    moduleException = new ModuleInitializeException(moduleInfo.ModuleName, exception.Message, exception);\n                }\n            }\n\n            throw moduleException;\n        }\n\n        /// <summary>\n        /// Uses the container to resolve a new <see cref=\"IModule\"/> by specifying its <see cref=\"Type\"/>.\n        /// </summary>\n        /// <param name=\"moduleInfo\">The module to create.</param>\n        /// <returns>A new instance of the module specified by <paramref name=\"moduleInfo\"/>.</returns>\n        protected virtual IModule CreateModule(IModuleInfo moduleInfo)\n        {\n            if (moduleInfo == null)\n                throw new ArgumentNullException(nameof(moduleInfo));\n\n            return CreateModule(moduleInfo.ModuleType);\n        }\n\n        /// <summary>\n        /// Uses the container to resolve a new <see cref=\"IModule\"/> by specifying its <see cref=\"Type\"/>.\n        /// </summary>\n        /// <param name=\"typeName\">The type name to resolve. This type must implement <see cref=\"IModule\"/>.</param>\n        /// <returns>A new instance of <paramref name=\"typeName\"/>.</returns>\n        protected virtual IModule CreateModule(string typeName)\n        {\n            Type moduleType = Type.GetType(typeName);\n            if (moduleType == null)\n            {\n                throw new ModuleInitializeException(string.Format(CultureInfo.CurrentCulture, Properties.Resources.FailedToGetType, typeName));\n            }\n\n            return (IModule)_containerExtension.Resolve(moduleType);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Modularity/ModuleManager.Desktop.cs",
    "content": "namespace Prism.Modularity\n{\n    /// <summary>\n    /// Component responsible for coordinating the modules' type loading and module initialization process.\n    /// </summary>\n    public partial class ModuleManager\n    {\n        /// <summary>\n        /// Returns the list of registered <see cref=\"IModuleTypeLoader\"/> instances that will be\n        /// used to load the types of modules.\n        /// </summary>\n        /// <value>The module type loaders.</value>\n        public virtual IEnumerable<IModuleTypeLoader> ModuleTypeLoaders\n        {\n            get => _typeLoaders ??= [new FileModuleTypeLoader()];\n            set => _typeLoaders = value;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Modularity/ModuleManager.cs",
    "content": "using System.Globalization;\nusing Prism.Properties;\n\nnamespace Prism.Modularity\n{\n    /// <summary>\n    /// Component responsible for coordinating the modules' type loading and module initialization process.\n    /// </summary>\n    public partial class ModuleManager : IModuleManager, IDisposable\n    {\n        private readonly IModuleInitializer moduleInitializer;\n        private IEnumerable<IModuleTypeLoader> _typeLoaders;\n        private HashSet<IModuleTypeLoader> subscribedToModuleTypeLoaders = new HashSet<IModuleTypeLoader>();\n\n        /// <summary>\n        /// Initializes an instance of the <see cref=\"ModuleManager\"/> class.\n        /// </summary>\n        /// <param name=\"moduleInitializer\">Service used for initialization of modules.</param>\n        /// <param name=\"moduleCatalog\">Catalog that enumerates the modules to be loaded and initialized.</param>\n        public ModuleManager(IModuleInitializer moduleInitializer, IModuleCatalog moduleCatalog)\n        {\n            this.moduleInitializer = moduleInitializer ?? throw new ArgumentNullException(nameof(moduleInitializer));\n            ModuleCatalog = moduleCatalog ?? throw new ArgumentNullException(nameof(moduleCatalog));\n        }\n\n        /// <summary>\n        /// The module catalog specified in the constructor.\n        /// </summary>\n        protected IModuleCatalog ModuleCatalog { get; }\n\n        /// <summary>\n        /// Gets all the <see cref=\"IModuleInfo\"/> classes that are in the <see cref=\"IModuleCatalog\"/>.\n        /// </summary>\n        public IEnumerable<IModuleInfo> Modules => ModuleCatalog.Modules;\n\n        /// <summary>\n        /// Raised repeatedly to provide progress as modules are loaded in the background.\n        /// </summary>\n        public event EventHandler<ModuleDownloadProgressChangedEventArgs> ModuleDownloadProgressChanged;\n\n        private void RaiseModuleDownloadProgressChanged(ModuleDownloadProgressChangedEventArgs e)\n        {\n            ModuleDownloadProgressChanged?.Invoke(this, e);\n        }\n\n        /// <summary>\n        /// Raised when a module is loaded or fails to load.\n        /// </summary>\n        public event EventHandler<LoadModuleCompletedEventArgs> LoadModuleCompleted;\n\n        private void RaiseLoadModuleCompleted(IModuleInfo moduleInfo, Exception error)\n        {\n            RaiseLoadModuleCompleted(new LoadModuleCompletedEventArgs(moduleInfo, error));\n        }\n\n        private void RaiseLoadModuleCompleted(LoadModuleCompletedEventArgs e)\n        {\n            LoadModuleCompleted?.Invoke(this, e);\n        }\n\n        /// <summary>\n        /// Initializes the modules marked as <see cref=\"InitializationMode.WhenAvailable\"/> on the <see cref=\"ModuleCatalog\"/>.\n        /// </summary>\n        public void Run()\n        {\n            ModuleCatalog.Initialize();\n\n            LoadModulesWhenAvailable();\n        }\n\n\n        /// <summary>\n        /// Loads and initializes the module on the <see cref=\"IModuleCatalog\"/> with the name <paramref name=\"moduleName\"/>.\n        /// </summary>\n        /// <param name=\"moduleName\">Name of the module requested for initialization.</param>\n        public void LoadModule(string moduleName)\n        {\n            var module = ModuleCatalog.Modules.Where(m => m.ModuleName == moduleName);\n            if (module == null || module.Count() != 1)\n            {\n                throw new ModuleNotFoundException(moduleName, string.Format(CultureInfo.CurrentCulture, Resources.ModuleNotFound, moduleName));\n            }\n\n            var modulesToLoad = ModuleCatalog.CompleteListWithDependencies(module);\n\n            LoadModuleTypes(modulesToLoad);\n        }\n\n        /// <summary>\n        /// Checks if the module needs to be retrieved before it's initialized.\n        /// </summary>\n        /// <param name=\"moduleInfo\">Module that is being checked if needs retrieval.</param>\n        /// <returns></returns>\n        protected virtual bool ModuleNeedsRetrieval(IModuleInfo moduleInfo)\n        {\n            if (moduleInfo == null)\n                throw new ArgumentNullException(nameof(moduleInfo));\n\n            if (moduleInfo.State == ModuleState.NotStarted)\n            {\n                // If we can instantiate the type, that means the module's assembly is already loaded into\n                // the AppDomain and we don't need to retrieve it.\n                bool isAvailable = Type.GetType(moduleInfo.ModuleType) != null;\n                if (isAvailable)\n                {\n                    moduleInfo.State = ModuleState.ReadyForInitialization;\n                }\n\n                return !isAvailable;\n            }\n\n            return false;\n        }\n\n        private void LoadModulesWhenAvailable()\n        {\n            var whenAvailableModules = ModuleCatalog.Modules.Where(m => m.InitializationMode == InitializationMode.WhenAvailable);\n            var modulesToLoadTypes = ModuleCatalog.CompleteListWithDependencies(whenAvailableModules);\n            if (modulesToLoadTypes != null)\n            {\n                LoadModuleTypes(modulesToLoadTypes);\n            }\n        }\n\n        private void LoadModuleTypes(IEnumerable<IModuleInfo> moduleInfos)\n        {\n            if (moduleInfos == null)\n            {\n                return;\n            }\n\n            foreach (var moduleInfo in moduleInfos)\n            {\n                if (moduleInfo.State == ModuleState.NotStarted)\n                {\n                    if (ModuleNeedsRetrieval(moduleInfo))\n                    {\n                        BeginRetrievingModule(moduleInfo);\n                    }\n                    else\n                    {\n                        moduleInfo.State = ModuleState.ReadyForInitialization;\n                    }\n                }\n            }\n\n            LoadModulesThatAreReadyForLoad();\n        }\n\n        /// <summary>\n        /// Loads the modules that are not initialized and have their dependencies loaded.\n        /// </summary>\n        protected virtual void LoadModulesThatAreReadyForLoad()\n        {\n            bool keepLoading = true;\n            while (keepLoading)\n            {\n                keepLoading = false;\n                var availableModules = ModuleCatalog.Modules.Where(m => m.State == ModuleState.ReadyForInitialization);\n\n                foreach (var moduleInfo in availableModules)\n                {\n                    if ((moduleInfo.State != ModuleState.Initialized) && (AreDependenciesLoaded(moduleInfo)))\n                    {\n                        moduleInfo.State = ModuleState.Initializing;\n                        InitializeModule(moduleInfo);\n                        keepLoading = true;\n                        break;\n                    }\n                }\n            }\n        }\n\n        private void BeginRetrievingModule(IModuleInfo moduleInfo)\n        {\n            var moduleInfoToLoadType = moduleInfo;\n            IModuleTypeLoader moduleTypeLoader = GetTypeLoaderForModule(moduleInfoToLoadType);\n            moduleInfoToLoadType.State = ModuleState.LoadingTypes;\n\n            // Delegate += works differently between SL and WPF.\n            // We only want to subscribe to each instance once.\n            if (!subscribedToModuleTypeLoaders.Contains(moduleTypeLoader))\n            {\n                moduleTypeLoader.ModuleDownloadProgressChanged += IModuleTypeLoader_ModuleDownloadProgressChanged;\n                moduleTypeLoader.LoadModuleCompleted += IModuleTypeLoader_LoadModuleCompleted;\n                subscribedToModuleTypeLoaders.Add(moduleTypeLoader);\n            }\n\n            moduleTypeLoader.LoadModuleType(moduleInfo);\n        }\n\n        private void IModuleTypeLoader_ModuleDownloadProgressChanged(object sender, ModuleDownloadProgressChangedEventArgs e)\n        {\n            RaiseModuleDownloadProgressChanged(e);\n        }\n\n        private void IModuleTypeLoader_LoadModuleCompleted(object sender, LoadModuleCompletedEventArgs e)\n        {\n            if (e.Error == null)\n            {\n                if ((e.ModuleInfo.State != ModuleState.Initializing) && (e.ModuleInfo.State != ModuleState.Initialized))\n                {\n                    e.ModuleInfo.State = ModuleState.ReadyForInitialization;\n                }\n\n                // This callback may call back on the UI thread, but we are not guaranteeing it.\n                // If you were to add a custom retriever that retrieved in the background, you\n                // would need to consider dispatching to the UI thread.\n                LoadModulesThatAreReadyForLoad();\n            }\n            else\n            {\n                RaiseLoadModuleCompleted(e);\n\n                // If the error is not handled then I log it and raise an exception.\n                if (!e.IsErrorHandled)\n                {\n                    HandleModuleTypeLoadingError(e.ModuleInfo, e.Error);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Handles any exception occurred in the module typeloading process,\n        /// and throws a <see cref=\"ModuleTypeLoadingException\"/>.\n        /// This method can be overridden to provide a different behavior.\n        /// </summary>\n        /// <param name=\"moduleInfo\">The module metadata where the error happened.</param>\n        /// <param name=\"exception\">The exception thrown that is the cause of the current error.</param>\n        /// <exception cref=\"ModuleTypeLoadingException\"></exception>\n        [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Design\", \"CA1062:Validate arguments of public methods\", MessageId = \"1\")]\n        protected virtual void HandleModuleTypeLoadingError(IModuleInfo moduleInfo, Exception exception)\n        {\n            if (moduleInfo == null)\n                throw new ArgumentNullException(nameof(moduleInfo));\n\n\n            if (!(exception is ModuleTypeLoadingException moduleTypeLoadingException))\n            {\n                moduleTypeLoadingException = new ModuleTypeLoadingException(moduleInfo.ModuleName, exception.Message, exception);\n            }\n\n            throw moduleTypeLoadingException;\n        }\n\n        private bool AreDependenciesLoaded(IModuleInfo moduleInfo)\n        {\n            var requiredModules = ModuleCatalog.GetDependentModules(moduleInfo);\n            if (requiredModules == null)\n            {\n                return true;\n            }\n\n            int notReadyRequiredModuleCount =\n                requiredModules.Count(requiredModule => requiredModule.State != ModuleState.Initialized);\n\n            return notReadyRequiredModuleCount == 0;\n        }\n\n        private IModuleTypeLoader GetTypeLoaderForModule(IModuleInfo moduleInfo)\n        {\n            foreach (IModuleTypeLoader typeLoader in ModuleTypeLoaders)\n            {\n                if (typeLoader.CanLoadModuleType(moduleInfo))\n                {\n                    return typeLoader;\n                }\n            }\n\n            throw new ModuleTypeLoaderNotFoundException(moduleInfo.ModuleName, string.Format(CultureInfo.CurrentCulture, Resources.NoRetrieverCanRetrieveModule, moduleInfo.ModuleName), null);\n        }\n\n        private void InitializeModule(IModuleInfo moduleInfo)\n        {\n            if (moduleInfo.State == ModuleState.Initializing)\n            {\n                moduleInitializer.Initialize(moduleInfo);\n                moduleInfo.State = ModuleState.Initialized;\n                RaiseLoadModuleCompleted(moduleInfo, null);\n            }\n        }\n\n        #region Implementation of IDisposable\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        /// <remarks>Calls <see cref=\"Dispose(bool)\"/></remarks>.\n        /// <filterpriority>2</filterpriority>\n        public void Dispose()\n        {\n            Dispose(true);\n            GC.SuppressFinalize(this);\n        }\n\n        /// <summary>\n        /// Disposes the associated <see cref=\"IModuleTypeLoader\"/>s.\n        /// </summary>\n        /// <param name=\"disposing\">When <see langword=\"true\"/>, it is being called from the Dispose method.</param>\n        protected virtual void Dispose(bool disposing)\n        {\n            foreach (IModuleTypeLoader typeLoader in ModuleTypeLoaders)\n            {\n                if (typeLoader is IDisposable disposableTypeLoader)\n                {\n                    disposableTypeLoader.Dispose();\n                }\n            }\n        }\n\n        #endregion\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Modularity/ModuleTypeLoaderNotFoundException.Desktop.cs",
    "content": "using System.Runtime.Serialization;\n\nnamespace Prism.Modularity\n{\n    [Serializable]\n    public partial class ModuleTypeLoaderNotFoundException\n    {\n        /// <summary>\n        /// Initializes a new instance with serialized data.\n        /// </summary>\n        /// <param name=\"info\">The <see cref=\"SerializationInfo\"/> that holds the serialized object data about the exception being thrown.</param>\n        /// <param name=\"context\">The <see cref=\"StreamingContext\"/> that contains contextual information about the source or destination.</param>\n        protected ModuleTypeLoaderNotFoundException(SerializationInfo info, StreamingContext context)\n            : base(info, context)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Modularity/ModuleTypeLoaderNotFoundException.cs",
    "content": "namespace Prism.Modularity\n{\n    /// <summary>\n    /// Exception that's thrown when there is no <see cref=\"IModuleTypeLoader\"/> registered in\n    /// <see cref=\"ModuleManager.ModuleTypeLoaders\"/> that can handle this particular type of module.\n    /// </summary>\n    public partial class ModuleTypeLoaderNotFoundException : ModularityException\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ModuleTypeLoaderNotFoundException\"/> class.\n        /// </summary>\n        public ModuleTypeLoaderNotFoundException()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ModuleTypeLoaderNotFoundException\" /> class with a specified error message.\n        /// </summary>\n        /// <param name=\"message\">\n        /// The message that describes the error.\n        /// </param>\n        public ModuleTypeLoaderNotFoundException(string message)\n            : base(message)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ModuleTypeLoaderNotFoundException\" /> class with a specified error message.\n        /// </summary>\n        /// <param name=\"message\">\n        /// The message that describes the error.\n        /// </param>\n        /// <param name=\"innerException\">The inner exception</param>\n        public ModuleTypeLoaderNotFoundException(string message, Exception innerException)\n            : base(message, innerException)\n        {\n        }\n\n        /// <summary>\n        /// Initializes the exception with a particular module, error message and inner exception that happened.\n        /// </summary>\n        /// <param name=\"moduleName\">The name of the module.</param>\n        /// <param name=\"message\">The error message that explains the reason for the exception.</param>\n        /// <param name=\"innerException\">The exception that is the cause of the current exception,\n        /// or a <see langword=\"null\"/> reference if no inner exception is specified.</param>\n        public ModuleTypeLoaderNotFoundException(string moduleName, string message, Exception innerException)\n            : base(moduleName, message, innerException)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Modularity/ModulesConfigurationSection.Desktop.cs",
    "content": "using System.Configuration;\n\nnamespace Prism.Modularity\n{\n    /// <summary>\n    /// A <see cref=\"ConfigurationSection\"/> for module configuration.\n    /// </summary>\n    public class ModulesConfigurationSection : ConfigurationSection\n    {\n        /// <summary>\n        /// Gets or sets the collection of modules configuration.\n        /// </summary>\n        /// <value>A <see cref=\"ModuleConfigurationElementCollection\"/> of <see cref=\"ModuleConfigurationElement\"/>.</value>\n        [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Usage\", \"CA2227:CollectionPropertiesShouldBeReadOnly\")]\n        [ConfigurationProperty(\"\", IsDefaultCollection = true, IsKey = false)]\n        public ModuleConfigurationElementCollection Modules\n        {\n            get { return (ModuleConfigurationElementCollection)base[\"\"]; }\n            set { base[\"\"] = value; }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Modularity/XamlModuleCatalog.cs",
    "content": "using System.IO;\nusing System.Windows.Markup;\n\nnamespace Prism.Modularity\n{\n    /// <summary>\n    /// A catalog built from a XAML file.\n    /// </summary>\n    public class XamlModuleCatalog : ModuleCatalog\n    {\n        private readonly Uri _resourceUri;\n\n        private const string _refFilePrefix = \"file://\";\n        private int _refFilePrefixLength = _refFilePrefix.Length;\n\n        /// <summary>\n        /// Creates an instance of a XamlResourceCatalog.\n        /// </summary>\n        /// <param name=\"fileName\">The name of the XAML file</param>\n        public XamlModuleCatalog(string fileName)\n            : this(new Uri(fileName, UriKind.Relative))\n        {\n        }\n\n        /// <summary>\n        /// Creates an instance of a XamlResourceCatalog.\n        /// </summary>\n        /// <param name=\"resourceUri\">The pack url of the XAML file resource</param>\n        public XamlModuleCatalog(Uri resourceUri)\n        {\n            _resourceUri = resourceUri;\n        }\n\n        /// <summary>\n        /// Loads the catalog from the XAML file.\n        /// </summary>\n        protected override void InnerLoad()\n        {\n            var catalog = CreateFromXaml(_resourceUri);\n\n            foreach (IModuleCatalogItem item in catalog.Items)\n            {\n                if (item is ModuleInfo mi)\n                {\n                    if (!string.IsNullOrWhiteSpace(mi.Ref))\n                        mi.Ref = GetFileAbsoluteUri(mi.Ref);\n                }\n                else if (item is ModuleInfoGroup mg)\n                {\n                    if (!string.IsNullOrWhiteSpace(mg.Ref))\n                    {\n                        mg.Ref = GetFileAbsoluteUri(mg.Ref);\n                        mg.UpdateModulesRef();\n                    }\n                    else\n                    {\n                        foreach (var module in mg)\n                        {\n                            module.Ref = GetFileAbsoluteUri(module.Ref);\n                        }\n                    }\n                }\n\n                Items.Add(item);\n            }\n        }\n\n        /// <inheritdoc />\n        protected override string GetFileAbsoluteUri(string path)\n        {\n            //this is to maintain backwards compatibility with the old file:/// and file:// syntax for Xaml module catalog Ref property\n            if (path.StartsWith(_refFilePrefix + \"/\", StringComparison.Ordinal))\n            {\n                path = path.Substring(_refFilePrefixLength + 1);\n            }\n            else if (path.StartsWith(_refFilePrefix, StringComparison.Ordinal))\n            {\n                path = path.Substring(_refFilePrefixLength);\n            }\n\n            return base.GetFileAbsoluteUri(path);\n        }\n\n        /// <summary>\n        /// Creates a <see cref=\"ModuleCatalog\"/> from XAML.\n        /// </summary>\n        /// <param name=\"xamlStream\"><see cref=\"Stream\"/> that contains the XAML declaration of the catalog.</param>\n        /// <returns>An instance of <see cref=\"ModuleCatalog\"/> built from the XAML.</returns>\n        private static ModuleCatalog CreateFromXaml(Stream xamlStream)\n        {\n            if (xamlStream == null)\n            {\n                throw new ArgumentNullException(nameof(xamlStream));\n            }\n\n            return XamlReader.Load(xamlStream) as ModuleCatalog;\n        }\n\n        /// <summary>\n        /// Creates a <see cref=\"ModuleCatalog\"/> from a XAML included as an Application Resource.\n        /// </summary>\n        /// <param name=\"builderResourceUri\">Relative <see cref=\"Uri\"/> that identifies the XAML included as an Application Resource.</param>\n        /// <returns>An instance of <see cref=\"ModuleCatalog\"/> build from the XAML.</returns>\n        private static ModuleCatalog CreateFromXaml(Uri builderResourceUri)\n        {\n            var streamInfo = System.Windows.Application.GetResourceStream(builderResourceUri);\n\n            if ((streamInfo != null) && (streamInfo.Stream != null))\n            {\n                return CreateFromXaml(streamInfo.Stream);\n            }\n\n            return null;\n        }\n    }\n}"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Mvvm/ViewModelLocator.cs",
    "content": "using System.ComponentModel;\n\nnamespace Prism.Mvvm\n{\n    /// <summary>\n    /// This class defines the attached property and related change handler that calls the ViewModelLocator in Prism.Mvvm.\n    /// </summary>\n    public static class ViewModelLocator\n    {\n#if AVALONIA\n        static ViewModelLocator()\n        {\n            // Bind AutoWireViewModelProperty.Changed to its callback\n            AutoWireViewModelProperty.Changed.Subscribe(args => AutoWireViewModelChanged(args?.Sender, args));\n        }\n\n        /// <summary>\n        /// The AutoWireViewModel attached property.\n        /// </summary>\n        public static AvaloniaProperty AutoWireViewModelProperty =\n            AvaloniaProperty.RegisterAttached<Control, bool?>(\n                name: \"AutoWireViewModel\",\n                ownerType: typeof(ViewModelLocator),\n                defaultValue: null);\n#else\n        /// <summary>\n        /// The AutoWireViewModel attached property.\n        /// </summary>\n        public static DependencyProperty AutoWireViewModelProperty = DependencyProperty.RegisterAttached(\"AutoWireViewModel\", typeof(bool?), typeof(ViewModelLocator), new PropertyMetadata(defaultValue: null, propertyChangedCallback: AutoWireViewModelChanged));\n#endif\n\n        /// <summary>\n        /// Gets the value for the <see cref=\"AutoWireViewModelProperty\"/> attached property.\n        /// </summary>\n        /// <param name=\"obj\">The target element.</param>\n        /// <returns>The <see cref=\"AutoWireViewModelProperty\"/> attached to the <paramref name=\"obj\"/> element.</returns>\n        public static bool? GetAutoWireViewModel(DependencyObject obj)\n        {\n            return (bool?)obj.GetValue(AutoWireViewModelProperty);\n        }\n\n        /// <summary>\n        /// Sets the <see cref=\"AutoWireViewModelProperty\"/> attached property.\n        /// </summary>\n        /// <param name=\"obj\">The target element.</param>\n        /// <param name=\"value\">The value to attach.</param>\n        public static void SetAutoWireViewModel(DependencyObject obj, bool? value)\n        {\n            obj.SetValue(AutoWireViewModelProperty, value);\n        }\n\n        private static void AutoWireViewModelChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n#if AVALONIA\n            if (!Design.IsDesignMode)\n#else\n            if (!DesignerProperties.GetIsInDesignMode(d))\n#endif\n            {\n                var value = (bool?)e.NewValue;\n                if (value.HasValue && value.Value)\n                {\n                    ViewModelLocationProvider.AutoWireViewModelChanged(d, Bind);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Sets the DataContext of a View.\n        /// </summary>\n        /// <param name=\"view\">The View to set the DataContext on.</param>\n        /// <param name=\"viewModel\">The object to use as the DataContext for the View.</param>\n        static void Bind(object view, object viewModel)\n        {\n            if (view is FrameworkElement element)\n                element.DataContext = viewModel;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Navigation/Regions/AllActiveRegion.cs",
    "content": "using Prism.Properties;\n\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Region that keeps all the views in it as active. Deactivation of views is not allowed.\n    /// </summary>\n    public class AllActiveRegion : Region\n    {\n        /// <summary>\n        /// Gets a readonly view of the collection of all the active views in the region. These are all the added views.\n        /// </summary>\n        /// <value>An <see cref=\"IViewsCollection\"/> of all the active views.</value>\n        public override IViewsCollection ActiveViews => Views;\n\n        /// <summary>\n        /// Deactivate is not valid in this Region. This method will always throw <see cref=\"InvalidOperationException\"/>.\n        /// </summary>\n        /// <param name=\"view\">The view to deactivate.</param>\n        /// <exception cref=\"InvalidOperationException\">Every time this method is called.</exception>\n        public override void Deactivate(object view)\n        {\n            throw new InvalidOperationException(Resources.DeactiveNotPossibleException);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Navigation/Regions/Behaviors/AutoPopulateRegionBehavior.cs",
    "content": "namespace Prism.Navigation.Regions.Behaviors\n{\n    /// <summary>\n    /// Populates the target region with the views registered to it in the <see cref=\"IRegionViewRegistry\"/>.\n    /// </summary>\n    public class AutoPopulateRegionBehavior : RegionBehavior\n    {\n        /// <summary>\n        /// The key of this behavior.\n        /// </summary>\n        public const string BehaviorKey = \"AutoPopulate\";\n\n        private readonly IRegionViewRegistry regionViewRegistry;\n\n        /// <summary>\n        /// Creates a new instance of the AutoPopulateRegionBehavior\n        /// associated with the <see cref=\"IRegionViewRegistry\"/> received.\n        /// </summary>\n        /// <param name=\"regionViewRegistry\"><see cref=\"IRegionViewRegistry\"/> that the behavior will monitor for views to populate the region.</param>\n        public AutoPopulateRegionBehavior(IRegionViewRegistry regionViewRegistry)\n        {\n            this.regionViewRegistry = regionViewRegistry;\n        }\n\n        /// <summary>\n        /// Attaches the AutoPopulateRegionBehavior to the Region.\n        /// </summary>\n        protected override void OnAttach()\n        {\n            if (string.IsNullOrEmpty(Region.Name))\n            {\n                Region.PropertyChanged += Region_PropertyChanged;\n            }\n            else\n            {\n                StartPopulatingContent();\n            }\n        }\n\n        private void StartPopulatingContent()\n        {\n            foreach (object view in CreateViewsToAutoPopulate())\n            {\n                AddViewIntoRegion(view);\n            }\n\n            regionViewRegistry.ContentRegistered += OnViewRegistered;\n        }\n\n        /// <summary>\n        /// Returns a collection of views that will be added to the\n        /// View collection.\n        /// </summary>\n        /// <returns></returns>\n        protected virtual IEnumerable<object> CreateViewsToAutoPopulate()\n        {\n            return regionViewRegistry.GetContents(Region.Name);\n        }\n\n        /// <summary>\n        /// Adds a view into the views collection of this region.\n        /// </summary>\n        /// <param name=\"viewToAdd\"></param>\n        protected virtual void AddViewIntoRegion(object viewToAdd)\n        {\n            Region.Add(viewToAdd);\n        }\n\n        private void Region_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)\n        {\n            if (e.PropertyName == \"Name\" && !string.IsNullOrEmpty(Region.Name))\n            {\n                Region.PropertyChanged -= Region_PropertyChanged;\n                StartPopulatingContent();\n            }\n        }\n\n        /// <summary>\n        /// Handler of the event that fires when a new viewtype is registered to the registry.\n        /// </summary>\n        /// <remarks>Although this is a public method to support Weak Delegates in Silverlight, it should not be called by the user.</remarks>\n        /// <param name=\"sender\"></param>\n        /// <param name=\"e\"></param>\n        [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Security\", \"CA2109:ReviewVisibleEventHandlers\", Justification = \"This has to be public in order to work with weak references in partial trust or Silverlight environments.\")]\n        public virtual void OnViewRegistered(object sender, ViewRegisteredEventArgs e)\n        {\n            if (e == null)\n                throw new ArgumentNullException(nameof(e));\n\n            if (e.RegionName == Region.Name)\n            {\n                AddViewIntoRegion(e.GetView(ContainerLocator.Container));\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Navigation/Regions/Behaviors/BindRegionContextToDependencyObjectBehavior.cs",
    "content": "using System.Collections;\nusing System.Collections.Specialized;\nusing System.ComponentModel;\nusing Prism.Common;\n\nnamespace Prism.Navigation.Regions.Behaviors\n{\n    /// <summary>\n    /// Defines a behavior that forwards the <see cref=\"RegionManager.RegionContextProperty\"/>\n    /// to the views in the region.\n    /// </summary>\n    public class BindRegionContextToDependencyObjectBehavior : IRegionBehavior\n    {\n        /// <summary>\n        /// The key of this behavior.\n        /// </summary>\n        public const string BehaviorKey = \"ContextToDependencyObject\";\n\n        /// <summary>\n        /// Behavior's attached region.\n        /// </summary>\n        public IRegion Region { get; set; }\n\n        /// <summary>\n        /// Attaches the behavior to the specified region.\n        /// </summary>\n        public void Attach()\n        {\n            Region.Views.CollectionChanged += Views_CollectionChanged;\n            Region.PropertyChanged += Region_PropertyChanged;\n            SetContextToViews(Region.Views, Region.Context);\n            AttachNotifyChangeEvent(Region.Views);\n        }\n\n        private static void SetContextToViews(IEnumerable views, object context)\n        {\n            foreach (var view in views)\n            {\n                DependencyObject dependencyObjectView = view as DependencyObject;\n                if (dependencyObjectView != null)\n                {\n                    ObservableObject<object> contextWrapper = RegionContext.GetObservableContext(dependencyObjectView);\n                    contextWrapper.Value = context;\n                }\n            }\n        }\n\n        private void AttachNotifyChangeEvent(IEnumerable views)\n        {\n            foreach (var view in views)\n            {\n                var dependencyObject = view as DependencyObject;\n                if (dependencyObject != null)\n                {\n                    ObservableObject<object> viewRegionContext = RegionContext.GetObservableContext(dependencyObject);\n                    viewRegionContext.PropertyChanged += ViewRegionContext_OnPropertyChangedEvent;\n                }\n            }\n        }\n\n        private void DetachNotifyChangeEvent(IEnumerable views)\n        {\n            foreach (var view in views)\n            {\n                var dependencyObject = view as DependencyObject;\n                if (dependencyObject != null)\n                {\n                    ObservableObject<object> viewRegionContext = RegionContext.GetObservableContext(dependencyObject);\n                    viewRegionContext.PropertyChanged -= ViewRegionContext_OnPropertyChangedEvent;\n                }\n            }\n        }\n\n        private void ViewRegionContext_OnPropertyChangedEvent(object sender, PropertyChangedEventArgs args)\n        {\n            if (args.PropertyName == \"Value\")\n            {\n                var context = (ObservableObject<object>)sender;\n                Region.Context = context.Value;\n            }\n        }\n\n        private void Views_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)\n        {\n            if (e.Action == NotifyCollectionChangedAction.Add)\n            {\n                SetContextToViews(e.NewItems, Region.Context);\n                AttachNotifyChangeEvent(e.NewItems);\n            }\n            else if (e.Action == NotifyCollectionChangedAction.Remove && Region.Context != null)\n            {\n                DetachNotifyChangeEvent(e.OldItems);\n                SetContextToViews(e.OldItems, null);\n\n            }\n        }\n\n        private void Region_PropertyChanged(object sender, PropertyChangedEventArgs e)\n        {\n            if (e.PropertyName == \"Context\")\n            {\n                SetContextToViews(Region.Views, Region.Context);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Navigation/Regions/Behaviors/ClearChildViewsRegionBehavior.cs",
    "content": "namespace Prism.Navigation.Regions.Behaviors\n{\n    /// <summary>\n    /// Behavior that removes the RegionManager attached property of all the views in a region once the RegionManager property of a region becomes null.\n    /// This is useful when removing views with nested regions, to ensure these nested regions get removed from the RegionManager as well.\n    /// <remarks>\n    /// This behavior does not apply by default.\n    /// In order to activate it, the ClearChildViews attached property must be set to True in the view containing the affected child regions.\n    /// </remarks>\n    /// </summary>\n    public class ClearChildViewsRegionBehavior : RegionBehavior\n    {\n        /// <summary>\n        /// The behavior key.\n        /// </summary>\n        public const string BehaviorKey = \"ClearChildViews\";\n\n        /// <summary>\n        /// This attached property can be defined on a view to indicate that regions defined in it must be removed from the region manager when the parent view gets removed from a region.\n        /// </summary>\n#if !AVALONIA\n        public static readonly DependencyProperty ClearChildViewsProperty =\n            DependencyProperty.RegisterAttached(\"ClearChildViews\", typeof(bool), typeof(ClearChildViewsRegionBehavior), new PropertyMetadata(false));\n#else\n        public static readonly AvaloniaProperty ClearChildViewsProperty =\n            AvaloniaProperty.RegisterAttached<Control, bool>(\"ClearChildViews\", typeof(ClearChildViewsRegionBehavior));\n#endif\n\n        /// <summary>\n        /// Gets the ClearChildViews attached property from a DependencyObject.\n        /// </summary>\n        /// <param name=\"target\">The object from which to get the value.</param>\n        /// <returns>The value of the ClearChildViews attached property in the target specified.</returns>\n        public static bool GetClearChildViews(DependencyObject target)\n        {\n            if (target == null)\n                throw new ArgumentNullException(nameof(target));\n\n            return (bool)target.GetValue(ClearChildViewsRegionBehavior.ClearChildViewsProperty);\n        }\n\n        /// <summary>\n        /// Sets the ClearChildViews attached property in a DependencyObject.\n        /// </summary>\n        /// <param name=\"target\">The object in which to set the value.</param>\n        /// <param name=\"value\">The value of to set in the target object's ClearChildViews attached property.</param>\n        public static void SetClearChildViews(DependencyObject target, bool value)\n        {\n            if (target == null)\n                throw new ArgumentNullException(nameof(target));\n\n            target.SetValue(ClearChildViewsRegionBehavior.ClearChildViewsProperty, value);\n        }\n\n        /// <summary>\n        /// Subscribes to the <see cref=\"Region\"/>'s PropertyChanged method to monitor its <see cref=\"RegionManager\"/> property.\n        /// </summary>\n        protected override void OnAttach()\n        {\n            Region.PropertyChanged += Region_PropertyChanged;\n        }\n\n        private static void ClearChildViews(IRegion region)\n        {\n            foreach (var view in region.Views)\n            {\n                DependencyObject dependencyObject = view as DependencyObject;\n                if (dependencyObject != null)\n                {\n                    if (GetClearChildViews(dependencyObject))\n                    {\n                        dependencyObject.ClearValue(RegionManager.RegionManagerProperty);\n                    }\n                }\n            }\n        }\n\n        private void Region_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)\n        {\n            if (e.PropertyName == \"RegionManager\")\n            {\n                if (Region.RegionManager == null)\n                {\n                    ClearChildViews(Region);\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Navigation/Regions/Behaviors/DelayedRegionCreationBehavior.cs",
    "content": "using System.Collections.ObjectModel;\nusing System.Globalization;\nusing Prism.Properties;\n#if AVALONIA\nusing Avalonia.Threading;\n#endif\n\nnamespace Prism.Navigation.Regions.Behaviors\n{\n    /// <summary>\n    /// Behavior that creates a new <see cref=\"IRegion\"/>, when the control that will host the <see cref=\"IRegion\"/> (see <see cref=\"TargetElement\"/>)\n    /// is added to the VisualTree. This behavior will use the <see cref=\"RegionAdapterMappings\"/> class to find the right type of adapter to create\n    /// the region. After the region is created, this behavior will detach.\n    /// </summary>\n    /// <remarks>\n    /// Attached property value inheritance is not available in Silverlight, so the current approach walks up the visual tree when requesting a region from a region manager.\n    /// The <see cref=\"RegionManagerRegistrationBehavior\"/> is now responsible for walking up the Tree.\n    /// </remarks>\n    public class DelayedRegionCreationBehavior\n    {\n        private readonly RegionAdapterMappings _regionAdapterMappings;\n        private WeakReference elementWeakReference;\n        private bool regionCreated;\n\n        private static ICollection<DelayedRegionCreationBehavior> _instanceTracker = new Collection<DelayedRegionCreationBehavior>();\n        private object _trackerLock = new object();\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DelayedRegionCreationBehavior\"/> class.\n        /// </summary>\n        /// <param name=\"regionAdapterMappings\">\n        /// The region adapter mappings, that are used to find the correct adapter for\n        /// a given control type. The control type is determined by the <see name=\"TargetElement\"/> value.\n        /// </param>\n        public DelayedRegionCreationBehavior(RegionAdapterMappings regionAdapterMappings)\n        {\n            _regionAdapterMappings = regionAdapterMappings;\n            RegionManagerAccessor = new DefaultRegionManagerAccessor();\n        }\n\n        /// <summary>\n        /// Sets a class that interfaces between the <see cref=\"RegionManager\"/> 's static properties/events and this behavior,\n        /// so this behavior can be tested in isolation.\n        /// </summary>\n        /// <value>The region manager accessor.</value>\n        public IRegionManagerAccessor RegionManagerAccessor { get; set; }\n\n        /// <summary>\n        /// The element that will host the Region.\n        /// </summary>\n        /// <value>The target element.</value>\n        public DependencyObject TargetElement\n        {\n            get { return elementWeakReference != null ? elementWeakReference.Target as DependencyObject : null; }\n            set { elementWeakReference = new WeakReference(value); }\n        }\n\n        /// <summary>\n        /// Start monitoring the <see cref=\"RegionManager\"/> and the <see cref=\"TargetElement\"/> to detect when the <see cref=\"TargetElement\"/> becomes\n        /// part of the Visual Tree. When that happens, the Region will be created and the behavior will <see cref=\"Detach\"/>.\n        /// </summary>\n        public void Attach()\n        {\n            RegionManagerAccessor.UpdatingRegions += OnUpdatingRegions;\n            WireUpTargetElement();\n        }\n\n        /// <summary>\n        /// Stop monitoring the <see cref=\"RegionManager\"/> and the  <see cref=\"TargetElement\"/>, so that this behavior can be garbage collected.\n        /// </summary>\n        public void Detach()\n        {\n            RegionManagerAccessor.UpdatingRegions -= OnUpdatingRegions;\n            UnWireTargetElement();\n        }\n\n        /// <summary>\n        /// Called when the <see cref=\"RegionManager\"/> is updating it's <see cref=\"RegionManager.Regions\"/> collection.\n        /// </summary>\n        /// <remarks>\n        /// This method has to be public, because it has to be callable using weak references in silverlight and other partial trust environments.\n        /// </remarks>\n        /// <param name=\"sender\">The <see cref=\"RegionManager\"/>. </param>\n        /// <param name=\"e\">The <see cref=\"System.EventArgs\"/> instance containing the event data.</param>\n        [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Security\", \"CA2109:ReviewVisibleEventHandlers\", Justification = \"This has to be public in order to work with weak references in partial trust or Silverlight environments.\")]\n        public void OnUpdatingRegions(object sender, EventArgs e)\n        {\n            TryCreateRegion();\n        }\n\n        private void TryCreateRegion()\n        {\n            DependencyObject targetElement = TargetElement;\n            if (targetElement == null)\n            {\n                Detach();\n                return;\n            }\n\n#if !AVALONIA\n            if (targetElement.CheckAccess())\n#else\n            if (Dispatcher.UIThread.CheckAccess())\n#endif\n            {\n                Detach();\n\n                if (!regionCreated)\n                {\n                    string regionName = RegionManagerAccessor.GetRegionName(targetElement);\n                    CreateRegion(targetElement, regionName);\n                    regionCreated = true;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Method that will create the region, by calling the right <see cref=\"IRegionAdapter\"/>.\n        /// </summary>\n        /// <param name=\"targetElement\">The target element that will host the <see cref=\"IRegion\"/>.</param>\n        /// <param name=\"regionName\">Name of the region.</param>\n        /// <returns>The created <see cref=\"IRegion\"/></returns>\n        protected virtual IRegion CreateRegion(DependencyObject targetElement, string regionName)\n        {\n            if (targetElement == null)\n                throw new ArgumentNullException(nameof(targetElement));\n\n            try\n            {\n                // Build the region\n                IRegionAdapter regionAdapter = _regionAdapterMappings.GetMapping(targetElement.GetType());\n                IRegion region = regionAdapter.Initialize(targetElement, regionName);\n\n                return region;\n            }\n            catch (Exception ex)\n            {\n                throw new RegionCreationException(string.Format(CultureInfo.CurrentCulture, Resources.RegionCreationException, regionName, ex), ex);\n            }\n        }\n\n#if !AVALONIA\n        private void ElementLoaded(object sender, RoutedEventArgs e)\n#else\n        private void ElementLoaded(object sender, VisualTreeAttachmentEventArgs e)\n#endif\n        {\n            UnWireTargetElement();\n            TryCreateRegion();\n        }\n\n        private void WireUpTargetElement()\n        {\n            FrameworkElement element = TargetElement as FrameworkElement;\n            if (element != null)\n            {\n#if !AVALONIA\n                element.Loaded += ElementLoaded;\n#else\n                element.AttachedToVisualTree += ElementLoaded;\n#endif\n                return;\n            }\n\n#if (!UNO_WINUI && !AVALONIA)\n            FrameworkContentElement fcElement = TargetElement as FrameworkContentElement;\n            if (fcElement != null)\n            {\n                fcElement.Loaded += ElementLoaded;\n                return;\n            }\n#endif\n\n            //if the element is a dependency/avalonia object, and not a FrameworkElement/Avalonia.Control, nothing is holding onto the reference after the DelayedRegionCreationBehavior\n            //is instantiated inside RegionManager.CreateRegion(DependencyObject element). If the GC runs before RegionManager.UpdateRegions is called, the region will\n            //never get registered because it is gone from the updatingRegionsListeners list inside RegionManager. So we need to hold on to it. This should be rare.\n            DependencyObject depObj = TargetElement as DependencyObject;\n            if (depObj != null)\n            {\n                Track();\n                return;\n            }\n        }\n\n        private void UnWireTargetElement()\n        {\n            FrameworkElement element = TargetElement as FrameworkElement;\n            if (element != null)\n            {\n#if !AVALONIA\n                element.Loaded -= ElementLoaded;\n#else\n                element.AttachedToVisualTree -= ElementLoaded;\n#endif\n                return;\n            }\n\n#if (!UNO_WINUI && !AVALONIA)\n            FrameworkContentElement fcElement = TargetElement as FrameworkContentElement;\n            if (fcElement != null)\n            {\n                fcElement.Loaded -= ElementLoaded;\n                return;\n            }\n#endif\n\n            DependencyObject depObj = TargetElement as DependencyObject;\n            if (depObj != null)\n            {\n                Untrack();\n                return;\n            }\n        }\n\n        /// <summary>\n        /// Add the instance of this class to <see cref=\"_instanceTracker\"/> to keep it alive\n        /// </summary>\n        private void Track()\n        {\n            lock (_trackerLock)\n            {\n                if (!_instanceTracker.Contains(this))\n                {\n                    _instanceTracker.Add(this);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Remove the instance of this class from <see cref=\"_instanceTracker\"/>\n        /// so it can eventually be garbage collected\n        /// </summary>\n        private void Untrack()\n        {\n            lock (_trackerLock)\n            {\n                _instanceTracker.Remove(this);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Navigation/Regions/Behaviors/DestructibleRegionBehavior.cs",
    "content": "using System.Collections.Specialized;\nusing Prism.Common;\n\nnamespace Prism.Navigation.Regions.Behaviors\n{\n    /// <summary>\n    /// Calls <see cref=\"IDestructible.Destroy\"/> on Views and ViewModels\n    /// removed from the <see cref=\"IRegion.Views\"/> collection.\n    /// </summary>\n    /// <remarks>\n    /// The View and/or ViewModels must implement <see cref=\"IDestructible\"/> for this behavior to work.\n    /// </remarks>\n    public class DestructibleRegionBehavior : RegionBehavior\n    {\n        /// <summary>\n        /// The key of this behavior.\n        /// </summary>\n        public const string BehaviorKey = \"IDestructibleRegionBehavior\";\n\n        /// <summary>\n        /// Attaches the <see cref=\"DestructibleRegionBehavior\"/> to the <see cref=\"IRegion.Views\"/> collection.\n        /// </summary>\n        protected override void OnAttach()\n        {\n            Region.Views.CollectionChanged += Views_CollectionChanged;\n        }\n\n        private void Views_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)\n        {\n            if (e.Action == NotifyCollectionChangedAction.Remove)\n            {\n                foreach (var item in e.OldItems)\n                {\n                    Action<IDestructible> invocation = destructible => destructible.Destroy();\n                    MvvmHelpers.ViewAndViewModelAction(item, invocation);\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Navigation/Regions/Behaviors/IHostAwareRegionBehavior.cs",
    "content": "namespace Prism.Navigation.Regions.Behaviors\n{\n    /// <summary>\n    /// Defines a <see cref=\"IRegionBehavior\"/> that not allows extensible behaviors on regions which also interact\n    /// with the target element that the <see cref=\"IRegion\"/> is attached to.\n    /// </summary>\n    public interface IHostAwareRegionBehavior : IRegionBehavior\n    {\n        /// <summary>\n        /// Gets or sets the <see cref=\"DependencyObject\"/> that the <see cref=\"IRegion\"/> is attached to.\n        /// </summary>\n        /// <value>A <see cref=\"DependencyObject\"/> that the <see cref=\"IRegion\"/> is attached to.\n        /// This is usually a <see cref=\"FrameworkElement\"/> that is part of the tree.</value>\n        DependencyObject HostControl { get; set; }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Navigation/Regions/Behaviors/RegionActiveAwareBehavior.cs",
    "content": "using System.Collections.Specialized;\nusing Prism.Common;\n\nnamespace Prism.Navigation.Regions.Behaviors\n{\n    /// <summary>\n    /// Behavior that monitors a <see cref=\"IRegion\"/> object and\n    /// changes the value for the <see cref=\"IActiveAware.IsActive\"/> property when\n    /// an object that implements <see cref=\"IActiveAware\"/> gets added or removed\n    /// from the collection.\n    /// </summary>\n    /// <remarks>\n    /// This class can also sync the active state for any scoped regions directly on the view based on the <see cref=\"SyncActiveStateAttribute\"/>.\n    /// If you use the <see cref=\"Region.Add(object,string,bool)\" /> method with the createRegionManagerScope option, the scoped manager will be attached to the view.\n    /// </remarks>\n    public class RegionActiveAwareBehavior : IRegionBehavior\n    {\n        /// <summary>\n        /// Name that identifies the <see cref=\"RegionActiveAwareBehavior\"/> behavior in a collection of <see cref=\"IRegionBehavior\"/>.\n        /// </summary>\n        public const string BehaviorKey = \"ActiveAware\";\n\n        /// <summary>\n        /// The region that this behavior is extending\n        /// </summary>\n        public IRegion Region { get; set; }\n\n        /// <summary>\n        /// Attaches the behavior to the specified region\n        /// </summary>\n        public void Attach()\n        {\n            INotifyCollectionChanged collection = GetCollection();\n            if (collection != null)\n            {\n                collection.CollectionChanged += OnCollectionChanged;\n            }\n        }\n\n        /// <summary>\n        /// Detaches the behavior from the <see cref=\"INotifyCollectionChanged\"/>.\n        /// </summary>\n        public void Detach()\n        {\n            INotifyCollectionChanged collection = GetCollection();\n            if (collection != null)\n            {\n                collection.CollectionChanged -= OnCollectionChanged;\n            }\n        }\n\n        private void OnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)\n        {\n            if (e.Action == NotifyCollectionChangedAction.Add)\n            {\n                foreach (object item in e.NewItems)\n                {\n                    Action<IActiveAware> invocation = activeAware => activeAware.IsActive = true;\n\n                    MvvmHelpers.ViewAndViewModelAction(item, invocation);\n                    InvokeOnSynchronizedActiveAwareChildren(item, invocation);\n                }\n            }\n            else if (e.Action == NotifyCollectionChangedAction.Remove)\n            {\n                foreach (object item in e.OldItems)\n                {\n                    Action<IActiveAware> invocation = activeAware => activeAware.IsActive = false;\n\n                    MvvmHelpers.ViewAndViewModelAction(item, invocation);\n                    InvokeOnSynchronizedActiveAwareChildren(item, invocation);\n                }\n            }\n\n            // May need to handle other action values (reset, replace). Currently the ViewsCollection class does not raise CollectionChanged with these values.\n        }\n\n        private void InvokeOnSynchronizedActiveAwareChildren(object item, Action<IActiveAware> invocation)\n        {\n            var dependencyObjectView = item as DependencyObject;\n\n            if (dependencyObjectView != null)\n            {\n                // We are assuming that any scoped region managers are attached directly to the\n                // view.\n                var regionManager = RegionManager.GetRegionManager(dependencyObjectView);\n\n                // If the view's RegionManager attached property is different from the region's RegionManager,\n                // then the view's region manager is a scoped region manager.\n                if (regionManager == null || regionManager == Region.RegionManager) return;\n\n                var activeViews = regionManager.Regions.SelectMany(e => e.ActiveViews);\n\n                var syncActiveViews = activeViews.Where(ShouldSyncActiveState);\n\n                foreach (var syncActiveView in syncActiveViews)\n                {\n                    MvvmHelpers.ViewAndViewModelAction(syncActiveView, invocation);\n                }\n            }\n        }\n\n        private bool ShouldSyncActiveState(object view)\n        {\n            if (Attribute.IsDefined(view.GetType(), typeof(SyncActiveStateAttribute)))\n            {\n                return true;\n            }\n\n            var viewAsFrameworkElement = view as FrameworkElement;\n\n            if (viewAsFrameworkElement != null)\n            {\n                var viewModel = viewAsFrameworkElement.DataContext;\n\n                return viewModel != null && Attribute.IsDefined(viewModel.GetType(), typeof(SyncActiveStateAttribute));\n            }\n\n            return false;\n        }\n\n        private INotifyCollectionChanged GetCollection()\n        {\n            return Region.ActiveViews;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Navigation/Regions/Behaviors/RegionManagerRegistrationBehavior.cs",
    "content": "using System.ComponentModel;\n#if AVALONIA\nusing Avalonia;\nusing Avalonia.Controls;\nusing Avalonia.VisualTree;\n#endif\nusing Prism.Properties;\n\nnamespace Prism.Navigation.Regions.Behaviors\n{\n    /// <summary>\n    /// Subscribes to a static event from the <see cref=\"RegionManager\"/> in order to register the target <see cref=\"IRegion\"/>\n    /// in a <see cref=\"IRegionManager\"/> when one is available on the host control by walking up the tree and finding\n    /// a control whose <see cref=\"RegionManager.RegionManagerProperty\"/> property is not <see langword=\"null\"/>.\n    /// </summary>\n    public class RegionManagerRegistrationBehavior : RegionBehavior, IHostAwareRegionBehavior\n    {\n        /// <summary>\n        /// The key of this behavior.\n        /// </summary>\n        public static readonly string BehaviorKey = \"RegionManagerRegistration\";\n\n        private WeakReference attachedRegionManagerWeakReference;\n        private DependencyObject hostControl;\n\n        /// <summary>\n        /// Initializes a new instance of <see cref=\"RegionManagerRegistrationBehavior\"/>.\n        /// </summary>\n        public RegionManagerRegistrationBehavior()\n        {\n            RegionManagerAccessor = new DefaultRegionManagerAccessor();\n        }\n\n        /// <summary>\n        /// Provides an abstraction on top of the RegionManager static members.\n        /// </summary>\n        public IRegionManagerAccessor RegionManagerAccessor { get; set; }\n\n        /// <summary>\n        /// Gets or sets the <see cref=\"DependencyObject\"/> that the <see cref=\"IRegion\"/> is attached to.\n        /// </summary>\n        /// <value>A <see cref=\"DependencyObject\"/> that the <see cref=\"IRegion\"/> is attached to.\n        /// This is usually a <see cref=\"FrameworkElement\"/> that is part of the tree.</value>\n        /// <exception cref=\"InvalidOperationException\">When this member is set after the <see cref=\"IRegionBehavior.Attach\"/> method has being called.</exception>\n        public DependencyObject HostControl\n        {\n            get\n            {\n                return hostControl;\n            }\n            set\n            {\n                if (IsAttached)\n                {\n                    throw new InvalidOperationException(Resources.HostControlCannotBeSetAfterAttach);\n                }\n\n                hostControl = value;\n            }\n        }\n\n        /// <summary>\n        /// When the <see cref=\"IRegion\"/> has a name assigned, the behavior will start monitoring the ancestor controls in the element tree\n        /// to look for an <see cref=\"IRegionManager\"/> where to register the region in.\n        /// </summary>\n        protected override void OnAttach()\n        {\n            if (string.IsNullOrEmpty(Region.Name))\n            {\n                Region.PropertyChanged += Region_PropertyChanged;\n            }\n            else\n            {\n                StartMonitoringRegionManager();\n            }\n        }\n\n        private void Region_PropertyChanged(object sender, PropertyChangedEventArgs e)\n        {\n            if (e.PropertyName == \"Name\" && !string.IsNullOrEmpty(Region.Name))\n            {\n                Region.PropertyChanged -= Region_PropertyChanged;\n                StartMonitoringRegionManager();\n            }\n        }\n\n        private void StartMonitoringRegionManager()\n        {\n            RegionManagerAccessor.UpdatingRegions += OnUpdatingRegions;\n            TryRegisterRegion();\n        }\n\n        private void TryRegisterRegion()\n        {\n            DependencyObject targetElement = HostControl;\n            if (targetElement.CheckAccess())\n            {\n                IRegionManager regionManager = FindRegionManager(targetElement);\n\n                IRegionManager attachedRegionManager = GetAttachedRegionManager();\n\n                if (regionManager != attachedRegionManager)\n                {\n                    if (attachedRegionManager != null)\n                    {\n                        attachedRegionManagerWeakReference = null;\n                        attachedRegionManager.Regions.Remove(Region.Name);\n                    }\n\n                    if (regionManager != null)\n                    {\n                        attachedRegionManagerWeakReference = new WeakReference(regionManager);\n                        regionManager.Regions.Add(Region);\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// This event handler gets called when a RegionManager is requering the instances of a region to be registered if they are not already.\n        /// <remarks>Although this is a public method to support Weak Delegates in Silverlight, it should not be called by the user.</remarks>\n        /// </summary>\n        /// <param name=\"sender\">The sender.</param>\n        /// <param name=\"e\">The arguments.</param>\n        [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Security\", \"CA2109:ReviewVisibleEventHandlers\", Justification = \"This has to be public in order to work with weak references in partial trust or Silverlight environments.\")]\n        public void OnUpdatingRegions(object sender, EventArgs e)\n        {\n            TryRegisterRegion();\n        }\n\n        private IRegionManager FindRegionManager(DependencyObject dependencyObject)\n        {\n            var regionmanager = RegionManagerAccessor.GetRegionManager(dependencyObject);\n            if (regionmanager != null)\n            {\n                return regionmanager;\n            }\n\n            DependencyObject parent = null;\n#if UNO_WINUI\n            parent = VisualTreeHelper.GetParent(dependencyObject);\n#elif AVALONIA\n            parent = ((dependencyObject as Avalonia.Visual)?.GetVisualParent() ?? null) as Avalonia.AvaloniaObject;\n#else\n            parent = LogicalTreeHelper.GetParent(dependencyObject);\n#endif\n            if (parent != null)\n            {\n                return FindRegionManager(parent);\n            }\n\n            return null;\n        }\n\n        private IRegionManager GetAttachedRegionManager()\n        {\n            if (attachedRegionManagerWeakReference != null)\n            {\n                return attachedRegionManagerWeakReference.Target as IRegionManager;\n            }\n\n            return null;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Navigation/Regions/Behaviors/RegionMemberLifetimeBehavior.cs",
    "content": "using System.Collections.Specialized;\nusing Prism.Common;\n\nnamespace Prism.Navigation.Regions.Behaviors\n{\n    /// <summary>\n    /// The RegionMemberLifetimeBehavior determines if items should be removed from the <see cref=\"IRegion\"/>\n    /// when they are deactivated.\n    /// </summary>\n    /// <remarks>\n    /// The <see cref=\"RegionMemberLifetimeBehavior\"/> monitors the <see cref=\"IRegion.ActiveViews\"/>\n    /// collection to discover items that transition into a deactivated state.\n    /// <p/>\n    /// The behavior checks the removed items for either the <see cref=\"IRegionMemberLifetime\"/>\n    /// or the <see cref=\"RegionMemberLifetimeAttribute\"/> (in that order) to determine if it should be kept\n    /// alive on removal.\n    /// <p/>\n    /// If the item in the collection is a <see cref=\"FrameworkElement\"/>, it will\n    /// also check it's DataContext for <see cref=\"IRegionMemberLifetime\"/> or the <see cref=\"RegionMemberLifetimeAttribute\"/>.\n    /// <p/>\n    /// The order of checks are:\n    /// <list type=\"number\">\n    ///     <item>Region Item's IRegionMemberLifetime.KeepAlive value.</item>\n    ///     <item>Region Item's DataContext's IRegionMemberLifetime.KeepAlive value.</item>\n    ///     <item>Region Item's RegionMemberLifetimeAttribute.KeepAlive value.</item>\n    ///     <item>Region Item's DataContext's RegionMemberLifetimeAttribute.KeepAlive value.</item>\n    /// </list>\n    /// </remarks>\n    public class RegionMemberLifetimeBehavior : RegionBehavior\n    {\n        /// <summary>\n        /// The key for this behavior.\n        /// </summary>\n        public const string BehaviorKey = \"RegionMemberLifetimeBehavior\";\n\n        /// <summary>\n        /// Override this method to perform the logic after the behavior has been attached.\n        /// </summary>\n        protected override void OnAttach()\n        {\n            Region.ActiveViews.CollectionChanged += OnActiveViewsChanged;\n        }\n\n        private void OnActiveViewsChanged(object sender, NotifyCollectionChangedEventArgs e)\n        {\n            // We only pay attention to items removed from the ActiveViews list.\n            // Thus, we expect that any ICollectionView implementation would\n            // always raise a remove and we don't handle any resets\n            // unless we wanted to start tracking views that used to be active.\n            if (e.Action != NotifyCollectionChangedAction.Remove) return;\n\n            var inactiveViews = e.OldItems;\n            foreach (var inactiveView in inactiveViews)\n            {\n                if (!ShouldKeepAlive(inactiveView))\n                {\n                    if (Region.Views.Contains(inactiveView))\n                        Region.Remove(inactiveView);\n                }\n            }\n        }\n\n        private static bool ShouldKeepAlive(object inactiveView)\n        {\n            IRegionMemberLifetime lifetime = MvvmHelpers.GetImplementerFromViewOrViewModel<IRegionMemberLifetime>(inactiveView);\n            if (lifetime != null)\n            {\n                return lifetime.KeepAlive;\n            }\n\n            RegionMemberLifetimeAttribute lifetimeAttribute = GetItemOrContextLifetimeAttribute(inactiveView);\n            if (lifetimeAttribute != null)\n            {\n                return lifetimeAttribute.KeepAlive;\n            }\n\n            return true;\n        }\n\n        private static RegionMemberLifetimeAttribute GetItemOrContextLifetimeAttribute(object inactiveView)\n        {\n            var lifetimeAttribute = GetCustomAttributes<RegionMemberLifetimeAttribute>(inactiveView.GetType()).FirstOrDefault();\n            if (lifetimeAttribute != null)\n            {\n                return lifetimeAttribute;\n            }\n\n            var frameworkElement = inactiveView as FrameworkElement;\n            if (frameworkElement != null && frameworkElement.DataContext != null)\n            {\n                var dataContext = frameworkElement.DataContext;\n                var contextLifetimeAttribute =\n                    GetCustomAttributes<RegionMemberLifetimeAttribute>(dataContext.GetType()).FirstOrDefault();\n                return contextLifetimeAttribute;\n            }\n\n            return null;\n        }\n\n        private static IEnumerable<T> GetCustomAttributes<T>(Type type)\n        {\n            return type.GetCustomAttributes(typeof(T), true).OfType<T>();\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Navigation/Regions/Behaviors/SelectorItemsSourceSyncBehavior.cs",
    "content": "using System.Collections.Specialized;\nusing Prism.Properties;\n\nnamespace Prism.Navigation.Regions.Behaviors\n{\n    /// <summary>\n    /// Defines the attached behavior that keeps the items of the <see cref=\"Selector\"/> host control in synchronization with the <see cref=\"IRegion\"/>.\n    ///\n    /// This behavior also makes sure that, if you activate a view in a region, the SelectedItem is set. If you set the SelectedItem or SelectedItems (ListBox)\n    /// then this behavior will also call Activate on the selected items.\n    /// <remarks>\n    /// When calling Activate on a view, you can only select a single active view at a time. By setting the SelectedItems property of a listbox, you can set\n    /// multiple views to active.\n    /// </remarks>\n    /// </summary>\n    public class SelectorItemsSourceSyncBehavior : RegionBehavior, IHostAwareRegionBehavior\n    {\n        /// <summary>\n        /// Name that identifies the SelectorItemsSourceSyncBehavior behavior in a collection of RegionsBehaviors.\n        /// </summary>\n        public static readonly string BehaviorKey = \"SelectorItemsSourceSyncBehavior\";\n        private bool updatingActiveViewsInHostControlSelectionChanged;\n        private Selector _hostControl;\n\n        /// <summary>\n        /// Gets or sets the <see cref=\"DependencyObject\"/> that the <see cref=\"IRegion\"/> is attached to.\n        /// </summary>\n        /// <value>\n        /// A <see cref=\"DependencyObject\"/> that the <see cref=\"IRegion\"/> is attached to.\n        /// </value>\n        /// <remarks>For this behavior, the host control must always be a <see cref=\"Selector\"/> or an inherited class.</remarks>\n        public DependencyObject HostControl\n        {\n            get\n            {\n                return _hostControl;\n            }\n\n            set\n            {\n                _hostControl = value as Selector;\n            }\n        }\n\n        /// <summary>\n        /// Starts to monitor the <see cref=\"IRegion\"/> to keep it in sync with the items of the <see cref=\"HostControl\"/>.\n        /// </summary>\n        protected override void OnAttach()\n        {\n            bool itemsSourceIsSet = _hostControl.ItemsSource != null;\n            itemsSourceIsSet = itemsSourceIsSet || _hostControl.HasBinding(ItemsControl.ItemsSourceProperty);\n\n            if (itemsSourceIsSet)\n            {\n                throw new InvalidOperationException(Resources.ItemsControlHasItemsSourceException);\n            }\n\n            SynchronizeItems();\n\n            _hostControl.SelectionChanged += HostControlSelectionChanged;\n            Region.ActiveViews.CollectionChanged += ActiveViews_CollectionChanged;\n            Region.Views.CollectionChanged += Views_CollectionChanged;\n        }\n\n        private void Views_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)\n        {\n            if (e.Action == NotifyCollectionChangedAction.Add)\n            {\n                int startIndex = e.NewStartingIndex;\n                foreach (object newItem in e.NewItems)\n                {\n                    _hostControl.Items.Insert(startIndex++, newItem);\n                }\n            }\n            else if (e.Action == NotifyCollectionChangedAction.Remove)\n            {\n                foreach (object oldItem in e.OldItems)\n                {\n                    _hostControl.Items.Remove(oldItem);\n                }\n            }\n        }\n\n        private void SynchronizeItems()\n        {\n            List<object> existingItems =\n            [\n                // Control must be empty before \"Binding\" to a region\n                .. _hostControl.Items,\n            ];\n\n            foreach (object view in Region.Views)\n            {\n                _hostControl.Items.Add(view);\n            }\n\n            foreach (object existingItem in existingItems)\n            {\n                Region.Add(existingItem);\n            }\n        }\n\n\n        private void ActiveViews_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)\n        {\n            if (updatingActiveViewsInHostControlSelectionChanged)\n            {\n                // If we are updating the ActiveViews collection in the HostControlSelectionChanged, that\n                // means the user has set the SelectedItem or SelectedItems himself and we don't need to do that here now\n                return;\n            }\n\n            if (e.Action == NotifyCollectionChangedAction.Add)\n            {\n                if (_hostControl.SelectedItem != null\n                    && _hostControl.SelectedItem != e.NewItems[0]\n                    && Region.ActiveViews.Contains(_hostControl.SelectedItem))\n                {\n                    Region.Deactivate(_hostControl.SelectedItem);\n                }\n\n                _hostControl.SelectedItem = e.NewItems[0];\n            }\n            else if (e.Action == NotifyCollectionChangedAction.Remove &&\n                     e.OldItems.Contains(_hostControl.SelectedItem))\n            {\n                _hostControl.SelectedItem = null;\n            }\n        }\n\n        private void HostControlSelectionChanged(object sender, SelectionChangedEventArgs e)\n        {\n            try\n            {\n                // Record the fact that we are now updating active views in the HostControlSelectionChanged method.\n                // This is needed to prevent the ActiveViews_CollectionChanged() method from firing.\n                updatingActiveViewsInHostControlSelectionChanged = true;\n\n                object source;\n                source = e.OriginalSource;\n\n                if (source == sender)\n                {\n                    foreach (object item in e.RemovedItems)\n                    {\n                        // check if the view is in both Views and ActiveViews collections (there may be out of sync)\n                        if (Region.Views.Contains(item) && Region.ActiveViews.Contains(item))\n                        {\n                            Region.Deactivate(item);\n                        }\n                    }\n\n                    foreach (object item in e.AddedItems)\n                    {\n                        if (Region.Views.Contains(item) && !Region.ActiveViews.Contains(item))\n                        {\n                            Region.Activate(item);\n                        }\n                    }\n                }\n            }\n            finally\n            {\n                updatingActiveViewsInHostControlSelectionChanged = false;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Navigation/Regions/Behaviors/SyncRegionContextWithHostBehavior.cs",
    "content": "using Prism.Common;\nusing Prism.Properties;\n\nnamespace Prism.Navigation.Regions.Behaviors\n{\n    /// <summary>\n    /// Behavior that synchronizes the <see cref=\"IRegion.Context\"/> property of a <see cref=\"IRegion\"/> with\n    /// the control that hosts the Region. It does this by setting the <see cref=\"RegionManager.RegionContextProperty\"/>\n    /// Dependency Property on the host control.\n    ///\n    /// This behavior allows the usage of two way data binding of the RegionContext from XAML.\n    /// </summary>\n    public class SyncRegionContextWithHostBehavior : RegionBehavior, IHostAwareRegionBehavior\n    {\n        private const string RegionContextPropertyName = \"Context\";\n        private DependencyObject _hostControl;\n\n        /// <summary>\n        /// Name that identifies the SyncRegionContextWithHostBehavior behavior in a collection of RegionsBehaviors.\n        /// </summary>\n        public static readonly string BehaviorKey = \"SyncRegionContextWithHost\";\n\n        private ObservableObject<object> HostControlRegionContext\n        {\n            get\n            {\n                return RegionContext.GetObservableContext(_hostControl);\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the <see cref=\"DependencyObject\"/> that the <see cref=\"IRegion\"/> is attached to.\n        /// </summary>\n        /// <value>\n        /// A <see cref=\"DependencyObject\"/> that the <see cref=\"IRegion\"/> is attached to.\n        /// This is usually a <see cref=\"FrameworkElement\"/> that is part of the tree.\n        /// </value>\n        public DependencyObject HostControl\n        {\n            get\n            {\n                return _hostControl;\n            }\n            set\n            {\n                if (IsAttached)\n                {\n                    throw new InvalidOperationException(Resources.HostControlCannotBeSetAfterAttach);\n                }\n\n                _hostControl = value;\n            }\n        }\n\n        /// <summary>\n        /// Override this method to perform the logic after the behavior has been attached.\n        /// </summary>\n        protected override void OnAttach()\n        {\n            if (HostControl != null)\n            {\n                // Sync values initially.\n                SynchronizeRegionContext();\n\n                // Now register for events to keep them in sync\n                HostControlRegionContext.PropertyChanged += RegionContextObservableObject_PropertyChanged;\n                Region.PropertyChanged += Region_PropertyChanged;\n            }\n        }\n\n        private void Region_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)\n        {\n            if (e.PropertyName == RegionContextPropertyName)\n            {\n                if (RegionManager.GetRegionContext(HostControl) != Region.Context)\n                {\n                    // Setting this Dependency Property will automatically also change the HostControlRegionContext.Value\n                    // (see RegionManager.OnRegionContextChanged())\n                    RegionManager.SetRegionContext(_hostControl, Region.Context);\n                }\n            }\n        }\n\n        private void RegionContextObservableObject_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)\n        {\n            if (e.PropertyName == \"Value\")\n            {\n                SynchronizeRegionContext();\n            }\n        }\n\n        private void SynchronizeRegionContext()\n        {\n            // Forward this value to the Region\n            if (Region.Context != HostControlRegionContext.Value)\n            {\n                Region.Context = HostControlRegionContext.Value;\n            }\n\n            // Also make sure the region's DependencyProperty was changed (this can occur if the value\n            // was changed only on the HostControlRegionContext)\n            if (RegionManager.GetRegionContext(HostControl) != HostControlRegionContext.Value)\n            {\n                RegionManager.SetRegionContext(HostControl, HostControlRegionContext.Value);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Navigation/Regions/ContentControlRegionAdapter.cs",
    "content": "using System.Collections.Specialized;\nusing Prism.Properties;\n\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Adapter that creates a new <see cref=\"SingleActiveRegion\"/> and monitors its\n    /// active view to set it on the adapted <see cref=\"ContentControl\"/>.\n    /// </summary>\n    public class ContentControlRegionAdapter : RegionAdapterBase<ContentControl>\n    {\n        /// <summary>\n        /// Initializes a new instance of <see cref=\"ContentControlRegionAdapter\"/>.\n        /// </summary>\n        /// <param name=\"regionBehaviorFactory\">The factory used to create the region behaviors to attach to the created regions.</param>\n        public ContentControlRegionAdapter(IRegionBehaviorFactory regionBehaviorFactory)\n            : base(regionBehaviorFactory)\n        {\n        }\n\n        /// <summary>\n        /// Adapts a <see cref=\"ContentControl\"/> to an <see cref=\"IRegion\"/>.\n        /// </summary>\n        /// <param name=\"region\">The new region being used.</param>\n        /// <param name=\"regionTarget\">The object to adapt.</param>\n        protected override void Adapt(IRegion region, ContentControl regionTarget)\n        {\n            if (regionTarget == null)\n                throw new ArgumentNullException(nameof(regionTarget));\n\n            bool contentIsSet = regionTarget.Content != null;\n#if !AVALONIA\n            contentIsSet = contentIsSet || regionTarget.HasBinding(ContentControl.ContentProperty);\n#else\n            contentIsSet = contentIsSet || regionTarget[ContentControl.ContentProperty] != null;\n#endif\n\n            if (contentIsSet)\n                throw new InvalidOperationException(Resources.ContentControlHasContentException);\n\n            region.ActiveViews.CollectionChanged += delegate\n            {\n                regionTarget.Content = region.ActiveViews.FirstOrDefault();\n            };\n\n            region.Views.CollectionChanged +=\n                (sender, e) =>\n                {\n                    if (e.Action == NotifyCollectionChangedAction.Add && region.ActiveViews.Count() == 0)\n                    {\n                        region.Activate(e.NewItems[0]);\n                    }\n                };\n        }\n\n        /// <summary>\n        /// Creates a new instance of <see cref=\"SingleActiveRegion\"/>.\n        /// </summary>\n        /// <returns>A new instance of <see cref=\"SingleActiveRegion\"/>.</returns>\n        protected override IRegion CreateRegion()\n        {\n            return new SingleActiveRegion();\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Navigation/Regions/DefaultRegionManagerAccessor.cs",
    "content": "namespace Prism.Navigation.Regions\n{\n    internal class DefaultRegionManagerAccessor : IRegionManagerAccessor\n    {\n        /// <summary>\n        /// Notification used by attached behaviors to update the region managers appropriately if needed to.\n        /// </summary>\n        /// <remarks>This event uses weak references to the event handler to prevent this static event of keeping the\n        /// target element longer than expected.</remarks>\n        public event EventHandler UpdatingRegions\n        {\n            add { RegionManager.UpdatingRegions += value; }\n            remove { RegionManager.UpdatingRegions -= value; }\n        }\n\n        /// <summary>\n        /// Gets the value for the RegionName attached property.\n        /// </summary>\n        /// <param name=\"element\">The object to adapt. This is typically a container (i.e a control).</param>\n        /// <returns>The name of the region that should be created when\n        /// the RegionManager is also set in this element.</returns>\n        public string GetRegionName(DependencyObject element)\n        {\n            if (element == null)\n                throw new ArgumentNullException(nameof(element));\n\n            return element.GetValue(RegionManager.RegionNameProperty) as string;\n        }\n\n        /// <summary>\n        /// Gets the value of the RegionName attached property.\n        /// </summary>\n        /// <param name=\"element\">The target element.</param>\n        /// <returns>The <see cref=\"IRegionManager\"/> attached to the <paramref name=\"element\"/> element.</returns>\n        public IRegionManager GetRegionManager(DependencyObject element)\n        {\n            if (element == null)\n                throw new ArgumentNullException(nameof(element));\n\n            return element.GetValue(RegionManager.RegionManagerProperty) as IRegionManager;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Navigation/Regions/INavigationAware.cs",
    "content": "#if (WPF || AVALONIA)\n\n// NOTE: This is for Legacy support for WPF/Avalonia apps only\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Provides a way for objects involved in navigation to be notified of navigation activities.\n    /// </summary>\n    /// <remarks>\n    /// Provides compatibility for Legacy Prism.Wpf and Prism.Avalonia apps.\n    /// </remarks>\n    public interface INavigationAware : IRegionAware\n    {\n    }\n}\n#endif\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Navigation/Regions/IRegionManagerAccessor.cs",
    "content": "namespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Provides an abstraction on top of the RegionManager static members.\n    /// </summary>\n    public interface IRegionManagerAccessor\n    {\n        /// <summary>\n        /// Notification used by attached behaviors to update the region managers appropriately if needed to.\n        /// </summary>\n        /// <remarks>This event uses weak references to the event handler to prevent this static event of keeping the\n        /// target element longer than expected.</remarks>\n        event EventHandler UpdatingRegions;\n\n        /// <summary>\n        /// Gets the value for the RegionName attached property.\n        /// </summary>\n        /// <param name=\"element\">The object to adapt. This is typically a container (i.e a control).</param>\n        /// <returns>The name of the region that should be created when\n        /// the RegionManager is also set in this element.</returns>\n#if !AVALONIA\n        string GetRegionName(DependencyObject element);\n#else\n        string GetRegionName(AvaloniaObject element);\n#endif\n\n        /// <summary>\n        /// Gets the value of the RegionName attached property.\n        /// </summary>\n        /// <param name=\"element\">The target element.</param>\n        /// <returns>The <see cref=\"IRegionManager\"/> attached to the <paramref name=\"element\"/> element.</returns>\n#if !AVALONIA\n        IRegionManager GetRegionManager(DependencyObject element);\n#else\n        IRegionManager GetRegionManager(AvaloniaObject element);\n#endif\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Navigation/Regions/ItemMetadata.cs",
    "content": "namespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Defines a class that wraps an item and adds metadata for it.\n    /// </summary>\n    public partial class ItemMetadata : DependencyObject\n    {\n        /// <summary>\n        /// The name of the wrapped item.\n        /// </summary>\n        public static readonly DependencyProperty NameProperty =\n            DependencyProperty.Register(nameof(Name), typeof(string), typeof(ItemMetadata), null);\n\n        /// <summary>\n        /// Value indicating whether the wrapped item is considered active.\n        /// </summary>\n        public static readonly DependencyProperty IsActiveProperty =\n            DependencyProperty.Register(nameof(IsActive), typeof(bool), typeof(ItemMetadata), new PropertyMetadata(defaultValue: false, propertyChangedCallback: DependencyPropertyChanged));\n\n        /// <summary>\n        /// Initializes a new instance of <see cref=\"ItemMetadata\"/>.\n        /// </summary>\n        /// <param name=\"item\">The item to wrap.</param>\n        public ItemMetadata(object item)\n        {\n            // check for null\n            Item = item;\n        }\n\n        /// <summary>\n        /// Gets the wrapped item.\n        /// </summary>\n        /// <value>The wrapped item.</value>\n        public object Item { get; private set; }\n\n        /// <summary>\n        /// Gets or sets a name for the wrapped item.\n        /// </summary>\n        /// <value>The name of the wrapped item.</value>\n        public string Name\n        {\n            get => (string)GetValue(NameProperty);\n            set => SetValue(NameProperty, value);\n        }\n\n        /// <summary>\n        /// Gets or sets a value indicating whether the wrapped item is considered active.\n        /// </summary>\n        /// <value><see langword=\"true\" /> if the item should be considered active; otherwise <see langword=\"false\" />.</value>\n        public bool IsActive\n        {\n            get => (bool)GetValue(IsActiveProperty);\n            set => SetValue(IsActiveProperty, value);\n        }\n\n        /// <summary>\n        /// Occurs when metadata on the item changes.\n        /// </summary>\n        public event EventHandler MetadataChanged;\n\n        /// <summary>\n        /// Explicitly invokes <see cref=\"MetadataChanged\"/> to notify listeners.\n        /// </summary>\n        public void InvokeMetadataChanged()\n        {\n            EventHandler metadataChangedHandler = MetadataChanged;\n            if (metadataChangedHandler != null) metadataChangedHandler(this, EventArgs.Empty);\n        }\n\n        private static void DependencyPropertyChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs args)\n        {\n            ItemMetadata itemMetadata = dependencyObject as ItemMetadata;\n            if (itemMetadata != null)\n            {\n                itemMetadata.InvokeMetadataChanged();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Navigation/Regions/ItemsControlRegionAdapter.cs",
    "content": "using Prism.Properties;\n\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Adapter that creates a new <see cref=\"AllActiveRegion\"/> and binds all\n    /// the views to the adapted <see cref=\"ItemsControl\"/>.\n    /// </summary>\n    public class ItemsControlRegionAdapter : RegionAdapterBase<ItemsControl>\n    {\n        /// <summary>\n        /// Initializes a new instance of <see cref=\"ItemsControlRegionAdapter\"/>.\n        /// </summary>\n        /// <param name=\"regionBehaviorFactory\">The factory used to create the region behaviors to attach to the created regions.</param>\n        public ItemsControlRegionAdapter(IRegionBehaviorFactory regionBehaviorFactory)\n            : base(regionBehaviorFactory)\n        {\n        }\n\n        /// <summary>\n        /// Adapts an <see cref=\"ItemsControl\"/> to an <see cref=\"IRegion\"/>.\n        /// </summary>\n        /// <param name=\"region\">The new region being used.</param>\n        /// <param name=\"regionTarget\">The object to adapt.</param>\n        protected override void Adapt(IRegion region, ItemsControl regionTarget)\n        {\n            if (region == null)\n                throw new ArgumentNullException(nameof(region));\n\n            if (regionTarget == null)\n                throw new ArgumentNullException(nameof(regionTarget));\n\n            // NOTE: In Avalonia, regionTarget.ItemsSource will not be null. Keep it rollin' baby!\n#if !AVALONIA\n            bool itemsSourceIsSet = regionTarget.ItemsSource != null;\n            itemsSourceIsSet = itemsSourceIsSet || regionTarget.HasBinding(ItemsControl.ItemsSourceProperty);\n\n            if (itemsSourceIsSet)\n            {\n                throw new InvalidOperationException(Resources.ItemsControlHasItemsSourceException);\n            }\n\n            // If control has child items, move them to the region and then bind control to region. Can't set ItemsSource if child items exist.\n            if (regionTarget.Items.Count > 0)\n            {\n                foreach (object childItem in regionTarget.Items)\n                {\n                    region.Add(childItem);\n                }\n                // Control must be empty before setting ItemsSource\n                regionTarget.Items.Clear();\n            }\n\n            regionTarget.ItemsSource = region.Views;\n#else\n            // If control has child items, move them to the region and then bind control to region. Can't set ItemsSource if child items exist.\n            if (regionTarget.ItemCount > 0)\n            {\n                foreach (object childItem in regionTarget.Items)\n                    region.Add(childItem);\n\n                // Control must be empty before setting ItemsSource\n                regionTarget.Items.Clear();\n            }\n\n            // Detect when an item has been added/removed to the ItemsControl's backing region. Copy\n            // all items to a new collection and bind to the region's ItemsSource\n            region.Views.CollectionChanged += (s, e) =>\n            {\n                var enumerator = region.Views.GetEnumerator();\n                List<object> items = new();\n                while (enumerator.MoveNext())\n                {\n                    items.Add(enumerator.Current);\n                }\n\n                regionTarget.ItemsSource = items;\n            };\n#endif\n        }\n\n        /// <summary>\n        /// Creates a new instance of <see cref=\"AllActiveRegion\"/>.\n        /// </summary>\n        /// <returns>A new instance of <see cref=\"AllActiveRegion\"/>.</returns>\n        protected override IRegion CreateRegion()\n        {\n            return new AllActiveRegion();\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Navigation/Regions/Region.cs",
    "content": "using System.Collections.ObjectModel;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Globalization;\nusing Prism.Properties;\n\n#if AVALONIA\nusing Avalonia;\n#endif\n\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Implementation of <see cref=\"IRegion\"/> that allows multiple active views.\n    /// </summary>\n    public class Region : IRegion\n    {\n        private ObservableCollection<ItemMetadata> _itemMetadataCollection;\n        private string _name;\n        private ViewsCollection _views;\n        private ViewsCollection _activeViews;\n        private object _context;\n        private IRegionManager _regionManager;\n        private IRegionNavigationService _regionNavigationService;\n\n        private Comparison<object> _sort;\n\n        /// <summary>\n        /// Initializes a new instance of <see cref=\"Region\"/>.\n        /// </summary>\n        public Region()\n        {\n            Behaviors = new RegionBehaviorCollection(this);\n\n            _sort = DefaultSortComparison;\n        }\n\n        /// <summary>\n        /// Occurs when a property value changes.\n        /// </summary>\n        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;\n\n        /// <summary>\n        /// Gets the collection of <see cref=\"IRegionBehavior\"/>s that can extend the behavior of regions.\n        /// </summary>\n        public IRegionBehaviorCollection Behaviors { get; }\n\n        /// <summary>\n        /// Gets or sets a context for the region. This value can be used by the user to share context with the views.\n        /// </summary>\n        /// <value>The context value to be shared.</value>\n        public object Context\n        {\n            get => _context;\n\n            set\n            {\n                if (_context != value)\n                {\n                    _context = value;\n                    OnPropertyChanged(nameof(Context));\n                }\n            }\n        }\n\n        /// <summary>\n        /// Gets the name of the region that uniquely identifies the region within a <see cref=\"IRegionManager\"/>.\n        /// </summary>\n        /// <value>The name of the region.</value>\n        public string Name\n        {\n            get => _name;\n\n            set\n            {\n                if (_name != null && _name != value)\n                {\n                    throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, Resources.CannotChangeRegionNameException, _name));\n                }\n\n                if (string.IsNullOrEmpty(value))\n                {\n                    throw new ArgumentException(Resources.RegionNameCannotBeEmptyException);\n                }\n\n                _name = value;\n                OnPropertyChanged(nameof(Name));\n            }\n        }\n\n        /// <summary>\n        /// Gets a readonly view of the collection of views in the region.\n        /// </summary>\n        /// <value>An <see cref=\"IViewsCollection\"/> of all the added views.</value>\n        public virtual IViewsCollection Views\n        {\n            get\n            {\n                if (_views == null)\n                {\n                    _views = new ViewsCollection(ItemMetadataCollection, x => true)\n                    {\n                        SortComparison = _sort\n                    };\n                }\n\n                return _views;\n            }\n        }\n\n        /// <summary>\n        /// Gets a readonly view of the collection of all the active views in the region.\n        /// </summary>\n        /// <value>An <see cref=\"IViewsCollection\"/> of all the active views.</value>\n        public virtual IViewsCollection ActiveViews\n        {\n            get\n            {\n                if (_views == null)\n                {\n                    _views = new ViewsCollection(ItemMetadataCollection, x => true)\n                    {\n                        SortComparison = _sort\n                    };\n                }\n\n                if (_activeViews == null)\n                {\n                    _activeViews = new ViewsCollection(ItemMetadataCollection, x => x.IsActive)\n                    {\n                        SortComparison = _sort\n                    };\n                }\n\n                return _activeViews;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the comparison used to sort the views.\n        /// </summary>\n        /// <value>The comparison to use.</value>\n        public Comparison<object> SortComparison\n        {\n            get => _sort;\n            set\n            {\n                _sort = value;\n\n                if (_activeViews != null)\n                {\n                    _activeViews.SortComparison = _sort;\n                }\n\n                if (_views != null)\n                {\n                    _views.SortComparison = _sort;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the <see cref=\"IRegionManager\"/> that will be passed to the views when adding them to the region, unless the view is added by specifying createRegionManagerScope as <see langword=\"true\" />.\n        /// </summary>\n        /// <value>The <see cref=\"IRegionManager\"/> where this <see cref=\"IRegion\"/> is registered.</value>\n        /// <remarks>This is usually used by implementations of <see cref=\"IRegionManager\"/> and should not be\n        /// used by the developer explicitly.</remarks>\n        public IRegionManager RegionManager\n        {\n            get => _regionManager;\n\n            set\n            {\n                if (_regionManager != value)\n                {\n                    _regionManager = value;\n                    OnPropertyChanged(nameof(RegionManager));\n                }\n            }\n        }\n\n        /// <summary>\n        /// Gets the navigation service.\n        /// </summary>\n        /// <value>The navigation service.</value>\n        public IRegionNavigationService NavigationService\n        {\n            get\n            {\n                if (_regionNavigationService == null)\n                {\n                    _regionNavigationService = ContainerLocator.Container.Resolve<IRegionNavigationService>();\n                    _regionNavigationService.Region = this;\n                }\n\n                return _regionNavigationService;\n            }\n\n            set => _regionNavigationService = value;\n        }\n\n        /// <summary>\n        /// Gets the collection with all the views along with their metadata.\n        /// </summary>\n        /// <value>An <see cref=\"ObservableCollection{T}\"/> of <see cref=\"ItemMetadata\"/> with all the added views.</value>\n        protected virtual ObservableCollection<ItemMetadata> ItemMetadataCollection\n        {\n            get\n            {\n                _itemMetadataCollection ??= new ObservableCollection<ItemMetadata>();\n\n                return _itemMetadataCollection;\n            }\n        }\n\n        /// <overloads>Adds a new view to the region.</overloads>\n        /// <summary>\n        /// Adds a new view to the region.\n        /// </summary>\n        /// <param name=\"viewName\">The view to add.</param>\n#if !AVALONIA\n        /// <returns>The <see cref=\"IRegionManager\"/> that is set on the view if it is a <see cref=\"DependencyObject\"/>. It will be the current region manager when using this overload.</returns>\n#else\n        /// <returns>The <see cref=\"IRegionManager\"/> that is set on the view if it is a <see cref=\"AvaloniaObject\"/>. It will be the current region manager when using this overload.</returns>\n#endif\n        public IRegionManager Add(string viewName)\n        {\n            var view = ContainerLocator.Container.Resolve<object>(viewName);\n            return Add(view, viewName, false);\n        }\n\n        /// <overloads>Adds a new view to the region.</overloads>\n        /// <summary>\n        /// Adds a new view to the region.\n        /// </summary>\n        /// <param name=\"view\">The view to add.</param>\n\n#if !AVALONIA\n        /// <returns>The <see cref=\"IRegionManager\"/> that is set on the view if it is a <see cref=\"DependencyObject\"/>. It will be the current region manager when using this overload.</returns>\n#else\n        /// <returns>The <see cref=\"IRegionManager\"/> that is set on the view if it is a <see cref=\"AvaloniaObject\"/>. It will be the current region manager when using this overload.</returns>\n#endif\n        public IRegionManager Add(object view)\n        {\n            return Add(view, null, false);\n        }\n\n        /// <summary>\n        /// Adds a new view to the region.\n        /// </summary>\n        /// <param name=\"view\">The view to add.</param>\n        /// <param name=\"viewName\">The name of the view. This can be used to retrieve it later by calling <see cref=\"IRegion.GetView\"/>.</param>\n\n#if !AVALONIA\n        /// <returns>The <see cref=\"IRegionManager\"/> that is set on the view if it is a <see cref=\"DependencyObject\"/>. It will be the current region manager when using this overload.</returns>\n#else\n        /// <returns>The <see cref=\"IRegionManager\"/> that is set on the view if it is a <see cref=\"AvaloniaObject\"/>. It will be the current region manager when using this overload.</returns>\n#endif\n        public IRegionManager Add(object view, string viewName)\n        {\n            if (string.IsNullOrEmpty(viewName))\n            {\n                throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Resources.StringCannotBeNullOrEmpty, \"viewName\"));\n            }\n\n            return Add(view, viewName, false);\n        }\n\n        /// <summary>\n        /// Adds a new view to the region.\n        /// </summary>\n        /// <param name=\"view\">The view to add.</param>\n        /// <param name=\"viewName\">The name of the view. This can be used to retrieve it later by calling <see cref=\"IRegion.GetView\"/>.</param>\n        /// <param name=\"createRegionManagerScope\">When <see langword=\"true\"/>, the added view will receive a new instance of <see cref=\"IRegionManager\"/>, otherwise it will use the current region manager for this region.</param>\n\n#if !AVALONIA\n        /// <returns>The <see cref=\"IRegionManager\"/> that is set on the view if it is a <see cref=\"DependencyObject\"/>.</returns>\n#else\n        /// <returns>The <see cref=\"IRegionManager\"/> that is set on the view if it is a <see cref=\"AvaloniaObject\"/>.</returns>\n#endif\n        public virtual IRegionManager Add(object view, string viewName, bool createRegionManagerScope)\n        {\n            IRegionManager manager = createRegionManagerScope ? RegionManager.CreateRegionManager() : RegionManager;\n            InnerAdd(view, viewName, manager);\n            return manager;\n        }\n\n        /// <summary>\n        /// Removes the specified view from the region.\n        /// </summary>\n        /// <param name=\"view\">The view to remove.</param>\n        public virtual void Remove(object view)\n        {\n            ItemMetadata itemMetadata = GetItemMetadataOrThrow(view);\n\n            ItemMetadataCollection.Remove(itemMetadata);\n\n#if !AVALONIA\n            if (view is DependencyObject dependencyObject && Regions.RegionManager.GetRegionManager(dependencyObject) == RegionManager)\n            {\n                dependencyObject.ClearValue(Regions.RegionManager.RegionManagerProperty);\n            }\n#else\n            if (view is AvaloniaObject avaloniaObject && Regions.RegionManager.GetRegionManager(avaloniaObject) == RegionManager)\n            {\n                avaloniaObject.ClearValue(Regions.RegionManager.RegionManagerProperty);\n            }\n#endif\n        }\n\n        /// <summary>\n        /// Removes all views from the region.\n        /// </summary>\n        public void RemoveAll()\n        {\n            foreach (var view in Views)\n            {\n                Remove(view);\n            }\n        }\n\n        /// <summary>\n        /// Marks the specified view as active.\n        /// </summary>\n        /// <param name=\"view\">The view to activate.</param>\n        public virtual void Activate(object view)\n        {\n            ItemMetadata itemMetadata = GetItemMetadataOrThrow(view);\n\n            if (!itemMetadata.IsActive)\n            {\n                itemMetadata.IsActive = true;\n            }\n        }\n\n        /// <summary>\n        /// Marks the specified view as inactive.\n        /// </summary>\n        /// <param name=\"view\">The view to deactivate.</param>\n        public virtual void Deactivate(object view)\n        {\n            ItemMetadata itemMetadata = GetItemMetadataOrThrow(view);\n\n            if (itemMetadata.IsActive)\n            {\n                itemMetadata.IsActive = false;\n            }\n        }\n\n        /// <summary>\n        /// Returns the view instance that was added to the region using a specific name.\n        /// </summary>\n        /// <param name=\"viewName\">The name used when adding the view to the region.</param>\n        /// <returns>Returns the named view or <see langword=\"null\"/> if the view with <paramref name=\"viewName\"/> does not exist in the current region.</returns>\n        public virtual object GetView(string viewName)\n        {\n            if (string.IsNullOrEmpty(viewName))\n            {\n                throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Resources.StringCannotBeNullOrEmpty, \"viewName\"));\n            }\n\n            ItemMetadata metadata = ItemMetadataCollection.FirstOrDefault(x => x.Name == viewName);\n\n            if (metadata != null)\n            {\n                return metadata.Item;\n            }\n\n            return null;\n        }\n\n        /// <summary>\n        /// Initiates navigation to the specified target.\n        /// </summary>\n        /// <param name=\"target\">The target.</param>\n        /// <param name=\"navigationCallback\">A callback to execute when the navigation request is completed.</param>\n        public void RequestNavigate(Uri target, Action<NavigationResult> navigationCallback)\n        {\n            RequestNavigate(target, navigationCallback, null);\n        }\n\n        /// <summary>\n        /// Initiates navigation to the specified target.\n        /// </summary>\n        /// <param name=\"target\">The target.</param>\n        /// <param name=\"navigationCallback\">A callback to execute when the navigation request is completed.</param>\n        /// <param name=\"navigationParameters\">The navigation parameters specific to the navigation request.</param>\n        public void RequestNavigate(Uri target, Action<NavigationResult> navigationCallback, INavigationParameters navigationParameters)\n        {\n            NavigationService.RequestNavigate(target, navigationCallback, navigationParameters);\n        }\n\n        private void InnerAdd(object view, string viewName, IRegionManager scopedRegionManager)\n        {\n            if (ItemMetadataCollection.FirstOrDefault(x => x.Item == view) != null)\n            {\n                throw new InvalidOperationException(Resources.RegionViewExistsException);\n            }\n\n            var itemMetadata = new ItemMetadata(view);\n            if (!string.IsNullOrEmpty(viewName))\n            {\n                if (ItemMetadataCollection.FirstOrDefault(x => x.Name == viewName) != null)\n                {\n                    throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, Resources.RegionViewNameExistsException, viewName));\n                }\n\n                itemMetadata.Name = viewName;\n            }\n\n#if !AVALONIA\n            if (view is DependencyObject dependencyObject)\n            {\n                Regions.RegionManager.SetRegionManager(dependencyObject, scopedRegionManager);\n            }\n#else\n            if (view is AvaloniaObject avaloniaObject)\n            {\n                Regions.RegionManager.SetRegionManager(avaloniaObject, scopedRegionManager);\n            }\n#endif\n\n            ItemMetadataCollection.Add(itemMetadata);\n        }\n\n        private ItemMetadata GetItemMetadataOrThrow(object view)\n        {\n            if (view == null)\n                throw new ArgumentNullException(nameof(view));\n\n            ItemMetadata itemMetadata = ItemMetadataCollection.FirstOrDefault(x => x.Item == view);\n\n            if (itemMetadata == null)\n                throw new ArgumentException(Resources.ViewNotInRegionException, nameof(view));\n\n            return itemMetadata;\n        }\n\n        private void OnPropertyChanged(string propertyName)\n        {\n            PropertyChanged?.Invoke(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));\n        }\n\n        /// <summary>\n        /// The default sort algorithm.\n        /// </summary>\n        /// <param name=\"x\">The first view to compare.</param>\n        /// <param name=\"y\">The second view to compare.</param>\n        /// <returns></returns>\n        [SuppressMessage(\"Microsoft.Naming\", \"CA1704:IdentifiersShouldBeSpelledCorrectly\", MessageId = \"y\")]\n        [SuppressMessage(\"Microsoft.Naming\", \"CA1704:IdentifiersShouldBeSpelledCorrectly\", MessageId = \"x\")]\n        public static int DefaultSortComparison(object x, object y)\n        {\n            if (x == null)\n            {\n                if (y == null)\n                {\n                    return 0;\n                }\n                else\n                {\n                    return -1;\n                }\n            }\n            else\n            {\n                if (y == null)\n                {\n                    return 1;\n                }\n                else\n                {\n                    Type xType = x.GetType();\n                    Type yType = y.GetType();\n\n                    ViewSortHintAttribute xAttribute = xType.GetCustomAttributes(typeof(ViewSortHintAttribute), true).FirstOrDefault() as ViewSortHintAttribute;\n                    ViewSortHintAttribute yAttribute = yType.GetCustomAttributes(typeof(ViewSortHintAttribute), true).FirstOrDefault() as ViewSortHintAttribute;\n\n                    return ViewSortHintAttributeComparison(xAttribute, yAttribute);\n                }\n            }\n        }\n\n        private static int ViewSortHintAttributeComparison(ViewSortHintAttribute x, ViewSortHintAttribute y)\n        {\n            if (x == null)\n            {\n                if (y == null)\n                {\n                    return 0;\n                }\n                else\n                {\n                    return -1;\n                }\n            }\n            else\n            {\n                if (y == null)\n                {\n                    return 1;\n                }\n                else\n                {\n                    return string.Compare(x.Hint, y.Hint, StringComparison.Ordinal);\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Navigation/Regions/RegionAdapterBase.cs",
    "content": "using System.Globalization;\nusing Prism.Navigation.Regions.Behaviors;\nusing Prism.Properties;\n\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Base class to facilitate the creation of <see cref=\"IRegionAdapter\"/> implementations.\n    /// </summary>\n    /// <typeparam name=\"T\">Type of object to adapt.</typeparam>\n    public abstract class RegionAdapterBase<T> : IRegionAdapter where T : class\n    {\n        /// <summary>\n        /// Initializes a new instance of <see cref=\"RegionAdapterBase{T}\"/>.\n        /// </summary>\n        /// <param name=\"regionBehaviorFactory\">The factory used to create the region behaviors to attach to the created regions.</param>\n        protected RegionAdapterBase(IRegionBehaviorFactory regionBehaviorFactory)\n        {\n            RegionBehaviorFactory = regionBehaviorFactory;\n        }\n\n        /// <summary>\n        /// Gets or sets the factory used to create the region behaviors to attach to the created regions.\n        /// </summary>\n        protected IRegionBehaviorFactory RegionBehaviorFactory { get; set; }\n\n        /// <summary>\n        /// Adapts an object and binds it to a new <see cref=\"IRegion\"/>.\n        /// </summary>\n        /// <param name=\"regionTarget\">The object to adapt.</param>\n        /// <param name=\"regionName\">The name of the region to be created.</param>\n        /// <returns>The new instance of <see cref=\"IRegion\"/> that the <paramref name=\"regionTarget\"/> is bound to.</returns>\n        public IRegion Initialize(T regionTarget, string regionName)\n        {\n            if (regionName == null)\n                throw new ArgumentNullException(nameof(regionName));\n\n            IRegion region = CreateRegion();\n            region.Name = regionName;\n\n            SetObservableRegionOnHostingControl(region, regionTarget);\n\n            Adapt(region, regionTarget);\n            AttachBehaviors(region, regionTarget);\n            AttachDefaultBehaviors(region, regionTarget);\n            return region;\n        }\n\n        /// <summary>\n        /// Adapts an object and binds it to a new <see cref=\"IRegion\"/>.\n        /// </summary>\n        /// <param name=\"regionTarget\">The object to adapt.</param>\n        /// <param name=\"regionName\">The name of the region to be created.</param>\n        /// <returns>The new instance of <see cref=\"IRegion\"/> that the <paramref name=\"regionTarget\"/> is bound to.</returns>\n        /// <remarks>This methods performs validation to check that <paramref name=\"regionTarget\"/>\n        /// is of type <typeparamref name=\"T\"/>.</remarks>\n        /// <exception cref=\"ArgumentNullException\">When <paramref name=\"regionTarget\"/> is <see langword=\"null\" />.</exception>\n        /// <exception cref=\"InvalidOperationException\">When <paramref name=\"regionTarget\"/> is not of type <typeparamref name=\"T\"/>.</exception>\n        IRegion IRegionAdapter.Initialize(object regionTarget, string regionName)\n        {\n            return Initialize(GetCastedObject(regionTarget), regionName);\n        }\n\n        /// <summary>\n        /// This method adds the default behaviors by using the <see cref=\"IRegionBehaviorFactory\"/> object.\n        /// </summary>\n        /// <param name=\"region\">The region being used.</param>\n        /// <param name=\"regionTarget\">The object to adapt.</param>\n        protected virtual void AttachDefaultBehaviors(IRegion region, T regionTarget)\n        {\n            if (region == null)\n                throw new ArgumentNullException(nameof(region));\n\n            if (regionTarget == null)\n                throw new ArgumentNullException(nameof(regionTarget));\n\n            IRegionBehaviorFactory behaviorFactory = RegionBehaviorFactory;\n            if (behaviorFactory != null)\n            {\n                DependencyObject dependencyObjectRegionTarget = regionTarget as DependencyObject;\n\n                foreach (string behaviorKey in behaviorFactory)\n                {\n                    if (!region.Behaviors.ContainsKey(behaviorKey))\n                    {\n                        IRegionBehavior behavior = behaviorFactory.CreateFromKey(behaviorKey);\n\n                        if (dependencyObjectRegionTarget != null)\n                        {\n                            IHostAwareRegionBehavior hostAwareRegionBehavior = behavior as IHostAwareRegionBehavior;\n                            if (hostAwareRegionBehavior != null)\n                            {\n                                hostAwareRegionBehavior.HostControl = dependencyObjectRegionTarget;\n                            }\n                        }\n\n                        region.Behaviors.Add(behaviorKey, behavior);\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Template method to attach new behaviors.\n        /// </summary>\n        /// <param name=\"region\">The region being used.</param>\n        /// <param name=\"regionTarget\">The object to adapt.</param>\n        protected virtual void AttachBehaviors(IRegion region, T regionTarget)\n        {\n        }\n\n        /// <summary>\n        /// Template method to adapt the object to an <see cref=\"IRegion\"/>.\n        /// </summary>\n        /// <param name=\"region\">The new region being used.</param>\n        /// <param name=\"regionTarget\">The object to adapt.</param>\n        protected abstract void Adapt(IRegion region, T regionTarget);\n\n        /// <summary>\n        /// Template method to create a new instance of <see cref=\"IRegion\"/>\n        /// that will be used to adapt the object.\n        /// </summary>\n        /// <returns>A new instance of <see cref=\"IRegion\"/>.</returns>\n        protected abstract IRegion CreateRegion();\n\n        private static T GetCastedObject(object regionTarget)\n        {\n            if (regionTarget == null)\n                throw new ArgumentNullException(nameof(regionTarget));\n\n            T castedObject = regionTarget as T;\n\n            if (castedObject == null)\n                throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, Resources.AdapterInvalidTypeException, typeof(T).Name));\n\n            return castedObject;\n        }\n\n        private static void SetObservableRegionOnHostingControl(IRegion region, T regionTarget)\n        {\n            DependencyObject targetElement = regionTarget as DependencyObject;\n\n            if (targetElement != null)\n            {\n                // Set the region as a dependency property on the control hosting the region\n                // Because we are using an observable region, the hosting control can detect that the\n                // region has actually been created. This is an ideal moment to hook up custom behaviors\n                RegionManager.GetObservableRegion(targetElement).Value = region;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Navigation/Regions/RegionAdapterMappings.cs",
    "content": "using System.Diagnostics.CodeAnalysis;\nusing System.Globalization;\nusing Prism.Properties;\n\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// This class maps <see cref=\"Type\"/> with <see cref=\"IRegionAdapter\"/>.\n    /// </summary>\n    public class RegionAdapterMappings\n    {\n        private readonly Dictionary<Type, IRegionAdapter> mappings = new Dictionary<Type, IRegionAdapter>();\n\n        /// <summary>\n        /// Registers the mapping between a type and an adapter.\n        /// </summary>\n        /// <param name=\"controlType\">The type of the control.</param>\n        /// <param name=\"adapter\">The adapter to use with the <paramref name=\"controlType\"/> type.</param>\n        /// <exception cref=\"ArgumentNullException\">When any of <paramref name=\"controlType\"/> or <paramref name=\"adapter\"/> are <see langword=\"null\" />.</exception>\n        /// <exception cref=\"InvalidOperationException\">If a mapping for <paramref name=\"controlType\"/> already exists.</exception>\n        public void RegisterMapping(Type controlType, IRegionAdapter adapter)\n        {\n            if (controlType == null)\n                throw new ArgumentNullException(nameof(controlType));\n\n            if (adapter == null)\n                throw new ArgumentNullException(nameof(adapter));\n\n            if (mappings.ContainsKey(controlType))\n                throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture,\n                                                                  Resources.MappingExistsException, controlType.Name));\n\n            mappings.Add(controlType, adapter);\n        }\n\n        /// <summary>\n        /// Registers the mapping between a type and an adapter.\n        /// </summary>\n        /// <typeparam name=\"TControl\">The type of the control</typeparam>\n        public void RegisterMapping<TControl>(IRegionAdapter adapter)\n        {\n            RegisterMapping(typeof(TControl), adapter);\n        }\n\n        /// <summary>\n        /// Registers the mapping between a type and an adapter.\n        /// </summary>\n        /// <typeparam name=\"TControl\">The type of the control</typeparam>\n        /// <typeparam name=\"TAdapter\">The type of the IRegionAdapter to use with the TControl</typeparam>\n        public void RegisterMapping<TControl, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] TAdapter>() where TAdapter : IRegionAdapter\n        {\n            RegisterMapping(typeof(TControl), ContainerLocator.Container.Resolve<TAdapter>());\n        }\n\n        /// <summary>\n        /// Returns the adapter associated with the type provided.\n        /// </summary>\n        /// <param name=\"controlType\">The type to obtain the <see cref=\"IRegionAdapter\"/> mapped.</param>\n        /// <returns>The <see cref=\"IRegionAdapter\"/> mapped to the <paramref name=\"controlType\"/>.</returns>\n        /// <remarks>This class will look for a registered type for <paramref name=\"controlType\"/> and if there is not any,\n        /// it will look for a registered type for any of its ancestors in the class hierarchy.\n        /// If there is no registered type for <paramref name=\"controlType\"/> or any of its ancestors,\n        /// an exception will be thrown.</remarks>\n        /// <exception cref=\"KeyNotFoundException\">When there is no registered type for <paramref name=\"controlType\"/> or any of its ancestors.</exception>\n        [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Naming\", \"CA2204:Literals should be spelled correctly\", MessageId = \"controlType\")]\n        public IRegionAdapter GetMapping(Type controlType)\n        {\n            Type currentType = controlType;\n\n            while (currentType != null)\n            {\n                if (mappings.ContainsKey(currentType))\n                {\n                    return mappings[currentType];\n                }\n\n                currentType = currentType.BaseType;\n            }\n\n            throw new KeyNotFoundException(string.Format(CultureInfo.CurrentCulture, Resources.NoRegionAdapterException, controlType));\n        }\n\n        /// <summary>\n        /// Returns the adapter associated with the type provided.\n        /// </summary>\n        /// <typeparam name=\"T\">The control type used to obtain the <see cref=\"IRegionAdapter\"/> mapped.</typeparam>\n        /// <returns>The <see cref=\"IRegionAdapter\"/> mapped to the <typeparamref name=\"T\"/>.</returns>\n        /// <remarks>This class will look for a registered type for <typeparamref name=\"T\"/> and if there is not any,\n        /// it will look for a registered type for any of its ancestors in the class hierarchy.\n        /// If there is no registered type for <typeparamref name=\"T\"/> or any of its ancestors,\n        /// an exception will be thrown.</remarks>\n        /// <exception cref=\"KeyNotFoundException\">When there is no registered type for <typeparamref name=\"T\"/> or any of its ancestors.</exception>\n        public IRegionAdapter GetMapping<T>()\n        {\n            return GetMapping(typeof(T));\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Navigation/Regions/RegionContext.cs",
    "content": "using Prism.Common;\nusing Prism.Navigation.Regions.Behaviors;\n#if AVALONIA\nusing BindRegionContextToDependencyObjectBehavior = Prism.Navigation.Regions.Behaviors.BindRegionContextToAvaloniaObjectBehavior;\n#endif\n\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Class that holds methods to Set and Get the RegionContext from a <see cref=\"DependencyObject\"/>.\n    ///\n    /// RegionContext allows sharing of contextual information between the view that's hosting a <see cref=\"IRegion\"/>\n    /// and any views that are inside the Region.\n    /// </summary>\n    public static class RegionContext\n    {\n#if !AVALONIA\n        private static readonly DependencyProperty ObservableRegionContextProperty =\n            DependencyProperty.RegisterAttached(\"ObservableRegionContext\", typeof(ObservableObject<object>), typeof(RegionContext), null);\n#else\n        private static readonly AvaloniaProperty ObservableRegionContextProperty =\n            AvaloniaProperty.RegisterAttached<Visual, ObservableObject<object>>(\"ObservableRegionContext\", typeof(RegionContext));\n#endif\n\n        /// <summary>\n        /// Returns an <see cref=\"ObservableObject{T}\"/> wrapper around the RegionContext value. The RegionContext\n        /// will be set on any views (dependency objects) that are inside the <see cref=\"IRegion.Views\"/> collection by\n        /// the <see cref=\"BindRegionContextToDependencyObjectBehavior\"/> Behavior.\n        /// The RegionContext will also be set to the control that hosts the Region, by the <see cref=\"Behaviors.SyncRegionContextWithHostBehavior\"/> Behavior.\n        ///\n        /// If the <see cref=\"ObservableObject{T}\"/> wrapper does not already exist, an empty one will be created. This way, an observer can\n        /// notify when the value is set for the first time.\n        /// </summary>\n        /// <param name=\"view\">Any view that hold the RegionContext value.</param>\n        /// <returns>Wrapper around the <see cref=\"RegionContext\"/> value.</returns>\n        public static ObservableObject<object> GetObservableContext(DependencyObject view)\n        {\n            if (view == null)\n                throw new ArgumentNullException(nameof(view));\n\n            ObservableObject<object> context = view.GetValue(ObservableRegionContextProperty) as ObservableObject<object>;\n\n            if (context == null)\n            {\n                context = new ObservableObject<object>();\n                view.SetValue(ObservableRegionContextProperty, context);\n            }\n\n            return context;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Navigation/Regions/RegionManager.cs",
    "content": "using System.Collections;\nusing System.Collections.Specialized;\nusing System.ComponentModel;\nusing System.Globalization;\nusing System.Reflection;\nusing Prism.Common;\nusing Prism.Events;\nusing Prism.Ioc.Internals;\nusing Prism.Navigation.Regions.Behaviors;\nusing Prism.Properties;\n\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// This class is responsible for maintaining a collection of regions and attaching regions to controls.\n    /// </summary>\n    /// <remarks>\n    /// This class supplies the attached properties that can be used for simple region creation from XAML.\n    /// </remarks>\n    public class RegionManager : IRegionManager\n    {\n        #region Static members (for XAML support)\n\n        private static readonly WeakDelegatesManager updatingRegionsListeners = new WeakDelegatesManager();\n\n        /// <summary>\n        /// Identifies the RegionName attached property.\n        /// </summary>\n        /// <remarks>\n        /// When a control has both the <see cref=\"RegionNameProperty\"/> and\n        /// <see cref=\"RegionManagerProperty\"/> attached properties set to\n        /// a value different than <see langword=\"null\" /> and there is a\n        /// <see cref=\"IRegionAdapter\"/> mapping registered for the control, it\n        /// will create and adapt a new region for that control, and register it\n        /// in the <see cref=\"IRegionManager\"/> with the specified region name.\n        /// </remarks>\n#if !AVALONIA\n        public static readonly DependencyProperty RegionNameProperty = DependencyProperty.RegisterAttached(\n            \"RegionName\",\n            typeof(string),\n            typeof(RegionManager),\n            new PropertyMetadata(defaultValue: null, propertyChangedCallback: OnSetRegionNameCallback));\n#else\n        public static readonly AvaloniaProperty RegionNameProperty = AvaloniaProperty.RegisterAttached<AvaloniaObject, string>(\n            \"RegionName\",\n            typeof(RegionManager));\n#endif\n\n        /// <summary>\n        /// Sets the <see cref=\"RegionNameProperty\"/> attached property.\n        /// </summary>\n        /// <param name=\"regionTarget\">The object to adapt. This is typically a container (i.e a control).</param>\n        /// <param name=\"regionName\">The name of the region to register.</param>\n        public static void SetRegionName(DependencyObject regionTarget, string regionName)\n        {\n            if (regionTarget == null)\n                throw new ArgumentNullException(nameof(regionTarget));\n\n            regionTarget.SetValue(RegionNameProperty, regionName);\n        }\n\n        /// <summary>\n        /// Gets the value for the <see cref=\"RegionNameProperty\"/> attached property.\n        /// </summary>\n        /// <param name=\"regionTarget\">The object to adapt. This is typically a container (i.e a control).</param>\n        /// <returns>The name of the region that should be created when\n        /// <see cref=\"RegionManagerProperty\"/> is also set in this element.</returns>\n        public static string GetRegionName(DependencyObject regionTarget)\n        {\n            if (regionTarget == null)\n                throw new ArgumentNullException(nameof(regionTarget));\n\n            return regionTarget.GetValue(RegionNameProperty) as string;\n        }\n\n#if !AVALONIA\n        private static readonly DependencyProperty ObservableRegionProperty =\n        DependencyProperty.RegisterAttached(\"ObservableRegion\", typeof(ObservableObject<IRegion>), typeof(RegionManager), null);\n#else\n        private static readonly AvaloniaProperty ObservableRegionProperty =\n            AvaloniaProperty.RegisterAttached<AvaloniaObject, ObservableObject<IRegion>>(\"ObservableRegion\", typeof(RegionManager));\n#endif\n\n        /// <summary>\n        /// Returns an <see cref=\"ObservableObject{T}\"/> wrapper that can hold an <see cref=\"IRegion\"/>. Using this wrapper\n        /// you can detect when an <see cref=\"IRegion\"/> has been created by the <see cref=\"RegionAdapterBase{T}\"/>.\n        ///\n        /// If the <see cref=\"ObservableObject{T}\"/> wrapper does not yet exist, a new wrapper will be created. When the region\n        /// gets created and assigned to the wrapper, you can use the <see cref=\"ObservableObject{T}.PropertyChanged\"/> event\n        /// to get notified of that change.\n        /// </summary>\n        /// <param name=\"view\">The view that will host the region. </param>\n        /// <returns>Wrapper that can hold an <see cref=\"IRegion\"/> value and can notify when the <see cref=\"IRegion\"/> value changes. </returns>\n        public static ObservableObject<IRegion> GetObservableRegion(DependencyObject view)\n        {\n            if (view == null) throw new ArgumentNullException(nameof(view));\n\n            ObservableObject<IRegion> regionWrapper = view.GetValue(ObservableRegionProperty) as ObservableObject<IRegion>;\n\n            if (regionWrapper == null)\n            {\n                regionWrapper = new ObservableObject<IRegion>();\n                view.SetValue(ObservableRegionProperty, regionWrapper);\n            }\n\n            return regionWrapper;\n        }\n\n        private static void OnSetRegionNameCallback(DependencyObject element, DependencyPropertyChangedEventArgs args)\n        {\n            if (!IsInDesignMode(element))\n            {\n                CreateRegion(element);\n            }\n        }\n\n        private static void CreateRegion(DependencyObject element)\n        {\n            var container = ContainerLocator.Container;\n            DelayedRegionCreationBehavior regionCreationBehavior = container.Resolve<DelayedRegionCreationBehavior>();\n            regionCreationBehavior.TargetElement = element;\n            regionCreationBehavior.Attach();\n        }\n\n        /// <summary>\n        /// Identifies the RegionManager attached property.\n        /// </summary>\n        /// <remarks>\n        /// When a control has both the <see cref=\"RegionNameProperty\"/> and\n        /// <see cref=\"RegionManagerProperty\"/> attached properties set to\n        /// a value different than <see langword=\"null\" /> and there is a\n        /// <see cref=\"IRegionAdapter\"/> mapping registered for the control, it\n        /// will create and adapt a new region for that control, and register it\n        /// in the <see cref=\"IRegionManager\"/> with the specified region name.\n        /// </remarks>\n#if !AVALONIA\n        public static readonly DependencyProperty RegionManagerProperty =\n            DependencyProperty.RegisterAttached(\"RegionManager\", typeof(IRegionManager), typeof(RegionManager), null);\n#else\n        public static readonly AvaloniaProperty RegionManagerProperty =\n            AvaloniaProperty.RegisterAttached<AvaloniaObject, IRegionManager>(\"RegionManager\", typeof(RegionManager));\n#endif\n\n        /// <summary>\n        /// Gets the value of the <see cref=\"RegionNameProperty\"/> attached property.\n        /// </summary>\n        /// <param name=\"target\">The target element.</param>\n        /// <returns>The <see cref=\"IRegionManager\"/> attached to the <paramref name=\"target\"/> element.</returns>\n        public static IRegionManager GetRegionManager(DependencyObject target)\n        {\n            if (target == null)\n                throw new ArgumentNullException(nameof(target));\n\n            return (IRegionManager)target.GetValue(RegionManagerProperty);\n        }\n\n        /// <summary>\n        /// Sets the <see cref=\"RegionManagerProperty\"/> attached property.\n        /// </summary>\n        /// <param name=\"target\">The target element.</param>\n        /// <param name=\"value\">The value.</param>\n        public static void SetRegionManager(DependencyObject target, IRegionManager value)\n        {\n            if (target == null)\n                throw new ArgumentNullException(nameof(target));\n\n            target.SetValue(RegionManagerProperty, value);\n        }\n\n        /// <summary>\n        /// Identifies the RegionContext attached property.\n        /// </summary>\n#if !AVALONIA\n        public static readonly DependencyProperty RegionContextProperty =\n        DependencyProperty.RegisterAttached(\"RegionContext\", typeof(object), typeof(RegionManager), new PropertyMetadata(defaultValue: null, propertyChangedCallback: OnRegionContextChanged));\n#else\n        public static readonly AvaloniaProperty RegionContextProperty =\n                    AvaloniaProperty.RegisterAttached<AvaloniaObject, object>(\"RegionContext\", typeof(RegionManager));\n#endif\n\n        private static void OnRegionContextChanged(DependencyObject depObj, DependencyPropertyChangedEventArgs e)\n        {\n            if (RegionContext.GetObservableContext(depObj).Value != e.NewValue)\n            {\n                RegionContext.GetObservableContext(depObj).Value = e.NewValue;\n            }\n        }\n\n        /// <summary>\n        /// Gets the value of the <see cref=\"RegionContextProperty\"/> attached property.\n        /// </summary>\n        /// <param name=\"target\">The target element.</param>\n        /// <returns>The region context to pass to the contained views.</returns>\n        public static object GetRegionContext(DependencyObject target)\n        {\n            if (target == null)\n                throw new ArgumentNullException(nameof(target));\n\n            return target.GetValue(RegionContextProperty);\n        }\n\n        /// <summary>\n        /// Sets the <see cref=\"RegionContextProperty\"/> attached property.\n        /// </summary>\n        /// <param name=\"target\">The target element.</param>\n        /// <param name=\"value\">The value.</param>\n        public static void SetRegionContext(DependencyObject target, object value)\n        {\n            if (target == null)\n                throw new ArgumentNullException(nameof(target));\n\n            target.SetValue(RegionContextProperty, value);\n        }\n\n        /// <summary>\n        /// Notification used by attached behaviors to update the region managers appropriately if needed to.\n        /// </summary>\n        /// <remarks>This event uses weak references to the event handler to prevent this static event of keeping the\n        /// target element longer than expected.</remarks>\n        public static event EventHandler UpdatingRegions\n        {\n            add { updatingRegionsListeners.AddListener(value); }\n            remove { updatingRegionsListeners.RemoveListener(value); }\n        }\n\n        /// <summary>\n        /// Notifies attached behaviors to update the region managers appropriately if needed to.\n        /// </summary>\n        /// <remarks>\n        /// This method is normally called internally, and there is usually no need to call this from user code.\n        /// </remarks>\n        public static void UpdateRegions()\n        {\n\n            try\n            {\n                updatingRegionsListeners.Raise(null, EventArgs.Empty);\n            }\n            catch (TargetInvocationException ex)\n            {\n                Exception rootException = ex.GetRootException();\n\n                throw new UpdateRegionsException(string.Format(CultureInfo.CurrentCulture,\n                    Resources.UpdateRegionException, rootException), ex.InnerException);\n            }\n        }\n\n        private static bool IsInDesignMode(DependencyObject element)\n        {\n#if !AVALONIA\n            return DesignerProperties.GetIsInDesignMode(element);\n#else\n            return Design.IsDesignMode;\n#endif\n        }\n\n        #endregion\n\n        private readonly RegionCollection regionCollection;\n\n        /// <summary>\n        /// Initializes a new instance of <see cref=\"RegionManager\"/>.\n        /// </summary>\n        public RegionManager()\n        {\n            regionCollection = new RegionCollection(this);\n        }\n\n#if AVALONIA\n        static RegionManager()\n        {\n            // TODO: Could this go into the default constructor?\n            RegionNameProperty.Changed.Subscribe(args => OnSetRegionNameCallback(args?.Sender, args));\n            RegionContextProperty.Changed.Subscribe(args => OnRegionContextChanged(args?.Sender, args));\n        }\n#endif\n\n        /// <summary>\n        /// Gets a collection of <see cref=\"IRegion\"/> that identify each region by name. You can use this collection to add or remove regions to the current region manager.\n        /// </summary>\n        /// <value>A <see cref=\"IRegionCollection\"/> with all the registered regions.</value>\n        public IRegionCollection Regions\n        {\n            get { return regionCollection; }\n        }\n\n        /// <summary>\n        /// Creates a new region manager.\n        /// </summary>\n        /// <returns>A new region manager that can be used as a different scope from the current region manager.</returns>\n        public IRegionManager CreateRegionManager()\n        {\n            return new RegionManager();\n        }\n\n        /// <summary>\n        ///     Add a view to the Views collection of a Region. Note that the region must already exist in this <see cref=\"IRegionManager\"/>.\n        /// </summary>\n        /// <param name=\"regionName\">The name of the region to add a view to</param>\n        /// <param name=\"view\">The view to add to the views collection</param>\n        /// <returns>The RegionManager, to easily add several views. </returns>\n        public IRegionManager AddToRegion(string regionName, object view)\n        {\n            if (!Regions.ContainsRegionWithName(regionName))\n                throw new ArgumentException(string.Format(Thread.CurrentThread.CurrentCulture, Resources.RegionNotFound, regionName), nameof(regionName));\n\n            return Regions[regionName].Add(view);\n        }\n\n        /// <summary>\n        /// Add a view to the Views collection of a Region. Note that the region must already exist in this <see cref=\"IRegionManager\"/>.\n        /// </summary>\n        /// <param name=\"regionName\">The name of the region to add a view to</param>\n        /// <param name=\"targetName\">The view to add to the views collection</param>\n        /// <returns>The RegionManager, to easily add several views. </returns>\n        public IRegionManager AddToRegion(string regionName, string targetName)\n        {\n            if (!Regions.ContainsRegionWithName(regionName))\n                throw new ArgumentException(string.Format(Thread.CurrentThread.CurrentCulture, Resources.RegionNotFound, regionName), nameof(regionName));\n\n            var view = CreateNewRegionItem(targetName);\n\n            return Regions[regionName].Add(view);\n        }\n\n        /// <summary>\n        /// Associate a view with a region, by registering a type. When the region get's displayed\n        /// this type will be resolved using the ServiceLocator into a concrete instance. The instance\n        /// will be added to the Views collection of the region\n        /// </summary>\n        /// <param name=\"regionName\">The name of the region to associate the view with.</param>\n        /// <param name=\"viewType\">The type of the view to register with the </param>\n        /// <returns>The <see cref=\"IRegionManager\"/>, for adding several views easily</returns>\n        public IRegionManager RegisterViewWithRegion(string regionName, Type viewType)\n        {\n            var regionViewRegistry = ContainerLocator.Container.Resolve<IRegionViewRegistry>();\n\n            regionViewRegistry.RegisterViewWithRegion(regionName, viewType);\n\n            return this;\n        }\n\n        /// <summary>\n        /// Associate a view with a region, by registering a type. When the region get's displayed\n        /// this type will be resolved using the ServiceLocator into a concrete instance. The instance\n        /// will be added to the Views collection of the region\n        /// </summary>\n        /// <param name=\"regionName\">The name of the region to associate the view with.</param>\n        /// <param name=\"targetName\">The type of the view to register with the </param>\n        /// <returns>The <see cref=\"IRegionManager\"/>, for adding several views easily</returns>\n        public IRegionManager RegisterViewWithRegion(string regionName, string targetName)\n        {\n            var viewType = ContainerLocator.Current.GetRegistrationType(targetName);\n\n            return RegisterViewWithRegion(regionName, viewType);\n        }\n\n        /// <summary>\n        /// Associate a view with a region, using a delegate to resolve a concrete instance of the view.\n        /// When the region get's displayed, this delegate will be called and the result will be added to the\n        /// views collection of the region.\n        /// </summary>\n        /// <param name=\"regionName\">The name of the region to associate the view with.</param>\n        /// <param name=\"getContentDelegate\">The delegate used to resolve a concrete instance of the view.</param>\n        /// <returns>The <see cref=\"IRegionManager\"/>, for adding several views easily</returns>\n        public IRegionManager RegisterViewWithRegion(string regionName, Func<IContainerProvider, object> getContentDelegate)\n        {\n            var regionViewRegistry = ContainerLocator.Container.Resolve<IRegionViewRegistry>();\n\n            regionViewRegistry.RegisterViewWithRegion(regionName, getContentDelegate);\n\n            return this;\n        }\n\n        /// <summary>\n        /// Navigates the specified region manager.\n        /// </summary>\n        /// <param name=\"regionName\">The name of the region to call Navigate on.</param>\n        /// <param name=\"source\">The URI of the content to display.</param>\n        /// <param name=\"navigationCallback\">The navigation callback.</param>\n        public void RequestNavigate(string regionName, Uri source, Action<NavigationResult> navigationCallback)\n        {\n            if (navigationCallback == null)\n                throw new ArgumentNullException(nameof(navigationCallback));\n\n            if (Regions.ContainsRegionWithName(regionName))\n            {\n                Regions[regionName].RequestNavigate(source, navigationCallback);\n            }\n            else\n            {\n                navigationCallback(new NavigationResult(new NavigationContext(null, source), false));\n            }\n        }\n\n        /// <summary>\n        /// This method allows an IRegionManager to locate a specified region and navigate in it to the specified target Uri, passing a navigation callback and an instance of <see cref=\"NavigationParameters\"/>, which holds a collection of object parameters.\n        /// </summary>\n        /// <param name=\"regionName\">The name of the region where the navigation will occur.</param>\n        /// <param name=\"target\">A Uri that represents the target where the region will navigate.</param>\n        /// <param name=\"navigationCallback\">The navigation callback that will be executed after the navigation is completed.</param>\n        /// <param name=\"navigationParameters\">An instance of <see cref=\"NavigationParameters\"/>, which holds a collection of object parameters.</param>\n        public void RequestNavigate(string regionName, Uri target, Action<NavigationResult> navigationCallback, INavigationParameters navigationParameters)\n        {\n            if (navigationCallback == null)\n                throw new ArgumentNullException(nameof(navigationCallback));\n\n            if (Regions.ContainsRegionWithName(regionName))\n            {\n                Regions[regionName].RequestNavigate(target, navigationCallback, navigationParameters);\n            }\n            else\n            {\n                navigationCallback(new NavigationResult(new NavigationContext(null, target, navigationParameters), false));\n            }\n        }\n\n        /// <summary>\n        /// Provides a new item for the region based on the supplied candidate target contract name.\n        /// </summary>\n        /// <param name=\"candidateTargetContract\">The target contract to build.</param>\n        /// <returns>An instance of an item to put into the <see cref=\"IRegion\"/>.</returns>\n        protected virtual object CreateNewRegionItem(string candidateTargetContract)\n        {\n            try\n            {\n                var view = ContainerLocator.Container.Resolve<object>(candidateTargetContract);\n\n                MvvmHelpers.AutowireViewModel(view);\n\n                return view;\n            }\n            catch (ContainerResolutionException)\n            {\n                throw;\n            }\n            catch (Exception e)\n            {\n                throw new InvalidOperationException(\n                    string.Format(CultureInfo.CurrentCulture, Resources.CannotCreateNavigationTarget, candidateTargetContract),\n                    e);\n            }\n        }\n\n        private class RegionCollection : IRegionCollection\n        {\n            private readonly IRegionManager _regionManager;\n            private readonly List<IRegion> _regions;\n\n            public RegionCollection(IRegionManager regionManager)\n            {\n                _regionManager = regionManager;\n                _regions = new List<IRegion>();\n            }\n\n            public event NotifyCollectionChangedEventHandler CollectionChanged;\n\n            public IEnumerator<IRegion> GetEnumerator()\n            {\n                UpdateRegions();\n\n                return _regions.GetEnumerator();\n            }\n\n            IEnumerator IEnumerable.GetEnumerator()\n            {\n                return GetEnumerator();\n            }\n\n            public IRegion this[string regionName]\n            {\n                get\n                {\n                    UpdateRegions();\n\n                    IRegion region = GetRegionByName(regionName);\n                    if (region == null)\n                    {\n                        throw new KeyNotFoundException(string.Format(CultureInfo.CurrentUICulture, Resources.RegionNotInRegionManagerException, regionName));\n                    }\n\n                    return region;\n                }\n            }\n\n            public void Add(IRegion region)\n            {\n                if (region == null)\n                    throw new ArgumentNullException(nameof(region));\n\n                UpdateRegions();\n\n                if (region.Name == null)\n                {\n                    throw new InvalidOperationException(Resources.RegionNameCannotBeEmptyException);\n                }\n\n                if (GetRegionByName(region.Name) != null)\n                {\n                    throw new ArgumentException(string.Format(CultureInfo.InvariantCulture,\n                                                              Resources.RegionNameExistsException, region.Name));\n                }\n\n                _regions.Add(region);\n                region.RegionManager = _regionManager;\n\n                OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, region, 0));\n            }\n\n            public bool Remove(string regionName)\n            {\n                UpdateRegions();\n\n                bool removed = false;\n\n                IRegion region = GetRegionByName(regionName);\n                if (region != null)\n                {\n                    removed = true;\n                    _regions.Remove(region);\n                    region.RegionManager = null;\n\n                    OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, region, 0));\n                }\n\n                return removed;\n            }\n\n            public bool ContainsRegionWithName(string regionName)\n            {\n                UpdateRegions();\n\n                return GetRegionByName(regionName) != null;\n            }\n\n            /// <summary>\n            /// Adds a region to the <see cref=\"RegionManager\"/> with the name received as argument.\n            /// </summary>\n            /// <param name=\"regionName\">The name to be given to the region.</param>\n            /// <param name=\"region\">The region to be added to the <see cref=\"RegionManager\"/>.</param>\n            /// <exception cref=\"ArgumentNullException\">Thrown if <paramref name=\"region\"/> is <see langword=\"null\"/>.</exception>\n            /// <exception cref=\"ArgumentException\">Thrown if <paramref name=\"regionName\"/> and <paramref name=\"region\"/>'s name do not match and the <paramref name=\"region\"/> <see cref=\"IRegion.Name\"/> is not <see langword=\"null\"/>.</exception>\n            public void Add(string regionName, IRegion region)\n            {\n                if (region == null)\n                    throw new ArgumentNullException(nameof(region));\n\n                if (region.Name != null && region.Name != regionName)\n                    throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Resources.RegionManagerWithDifferentNameException, region.Name, regionName), nameof(regionName));\n\n                region.Name ??= regionName;\n\n                Add(region);\n            }\n\n            private IRegion GetRegionByName(string regionName)\n            {\n                return _regions.FirstOrDefault(r => r.Name == regionName);\n            }\n\n            private void OnCollectionChanged(NotifyCollectionChangedEventArgs notifyCollectionChangedEventArgs)\n            {\n                CollectionChanged?.Invoke(this, notifyCollectionChangedEventArgs);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Navigation/Regions/RegionNavigationContentLoader.cs",
    "content": "using System.Globalization;\nusing Prism.Common;\nusing Prism.Ioc.Internals;\nusing Prism.Properties;\n\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Implementation of <see cref=\"IRegionNavigationContentLoader\"/> that relies on a <see cref=\"IContainerProvider\"/>\n    /// to create new views when necessary.\n    /// </summary>\n    public class RegionNavigationContentLoader : IRegionNavigationContentLoader\n    {\n        private readonly IContainerExtension _container;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"RegionNavigationContentLoader\"/> class with a service locator.\n        /// </summary>\n        /// <param name=\"container\">The <see cref=\"IContainerExtension\" />.</param>\n        public RegionNavigationContentLoader(IContainerExtension container)\n        {\n            _container = container;\n        }\n\n        /// <summary>\n        /// Gets the view to which the navigation request represented by <paramref name=\"navigationContext\"/> applies.\n        /// </summary>\n        /// <param name=\"region\">The region.</param>\n        /// <param name=\"navigationContext\">The context representing the navigation request.</param>\n        /// <returns>\n        /// The view to be the target of the navigation request.\n        /// </returns>\n        /// <remarks>\n        /// If none of the views in the region can be the target of the navigation request, a new view\n        /// is created and added to the region.\n        /// </remarks>\n        /// <exception cref=\"ArgumentException\">when a new view cannot be created for the navigation request.</exception>\n        public object LoadContent(IRegion region, NavigationContext navigationContext)\n        {\n            if (region == null)\n                throw new ArgumentNullException(nameof(region));\n\n            if (navigationContext == null)\n                throw new ArgumentNullException(nameof(navigationContext));\n\n            string candidateTargetContract = GetContractFromNavigationContext(navigationContext);\n\n            var candidates = GetCandidatesFromRegion(region, candidateTargetContract);\n\n            var acceptingCandidates =\n                candidates.Where(\n                    v =>\n                    {\n                        if (v is IRegionAware navigationAware && !navigationAware.IsNavigationTarget(navigationContext))\n                        {\n                            return false;\n                        }\n\n                        if (!(v is FrameworkElement frameworkElement))\n                        {\n                            return true;\n                        }\n\n                        navigationAware = frameworkElement.DataContext as IRegionAware;\n                        return navigationAware == null || navigationAware.IsNavigationTarget(navigationContext);\n                    });\n\n            var view = acceptingCandidates.FirstOrDefault();\n\n            if (view != null)\n            {\n                return view;\n            }\n\n            view = CreateNewRegionItem(candidateTargetContract);\n\n            AddViewToRegion(region, view);\n\n            return view;\n        }\n\n        /// <summary>\n        /// Adds the view to the region.\n        /// </summary>\n        /// <param name=\"region\">The region to add the view to</param>\n        /// <param name=\"view\">The view to add to the region</param>\n        protected virtual void AddViewToRegion(IRegion region, object view)\n        {\n            region.Add(view);\n        }\n\n        /// <summary>\n        /// Provides a new item for the region based on the supplied candidate target contract name.\n        /// </summary>\n        /// <param name=\"candidateTargetContract\">The target contract to build.</param>\n        /// <returns>An instance of an item to put into the <see cref=\"IRegion\"/>.</returns>\n        protected virtual object CreateNewRegionItem(string candidateTargetContract)\n        {\n            try\n            {\n                var newRegionItem = _container.Resolve<object>(candidateTargetContract);\n                MvvmHelpers.AutowireViewModel(newRegionItem);\n                return newRegionItem;\n            }\n            catch (ContainerResolutionException)\n            {\n                throw;\n            }\n            catch (Exception e)\n            {\n                throw new InvalidOperationException(\n                    string.Format(CultureInfo.CurrentCulture, Resources.CannotCreateNavigationTarget, candidateTargetContract),\n                    e);\n            }\n        }\n\n        /// <summary>\n        /// Returns the candidate TargetContract based on the <see cref=\"NavigationContext\"/>.\n        /// </summary>\n        /// <param name=\"navigationContext\">The navigation contract.</param>\n        /// <returns>The candidate contract to seek within the <see cref=\"IRegion\"/> and to use, if not found, when resolving from the container.</returns>\n        protected virtual string GetContractFromNavigationContext(NavigationContext navigationContext)\n        {\n            if (navigationContext == null) throw new ArgumentNullException(nameof(navigationContext));\n\n            var candidateTargetContract = UriParsingHelper.GetAbsolutePath(navigationContext.Uri);\n            candidateTargetContract = candidateTargetContract.TrimStart('/');\n            return candidateTargetContract;\n        }\n\n        /// <summary>\n        /// Returns the set of candidates that may satisfy this navigation request.\n        /// </summary>\n        /// <param name=\"region\">The region containing items that may satisfy the navigation request.</param>\n        /// <param name=\"candidateNavigationContract\">The candidate navigation target as determined by <see cref=\"GetContractFromNavigationContext\"/></param>\n        /// <returns>An enumerable of candidate objects from the <see cref=\"IRegion\"/></returns>\n        protected virtual IEnumerable<object> GetCandidatesFromRegion(IRegion region, string candidateNavigationContract)\n        {\n            if (region is null)\n            {\n                throw new ArgumentNullException(nameof(region));\n            }\n\n            if (string.IsNullOrEmpty(candidateNavigationContract))\n            {\n                throw new ArgumentNullException(nameof(candidateNavigationContract));\n            }\n\n            var contractCandidates = GetCandidatesFromRegionViews(region, candidateNavigationContract);\n\n            if (!contractCandidates.Any())\n            {\n                var matchingType = _container.GetRegistrationType(candidateNavigationContract);\n                if (matchingType is null)\n                {\n                    return Array.Empty<object>();\n                }\n\n                return GetCandidatesFromRegionViews(region, matchingType.FullName);\n            }\n\n            return contractCandidates;\n        }\n\n        private IEnumerable<object> GetCandidatesFromRegionViews(IRegion region, string candidateNavigationContract)\n        {\n            return region.Views.Where(v => v is not null && ViewIsMatch(v.GetType(), candidateNavigationContract));\n        }\n\n        private static bool ViewIsMatch(Type viewType, string navigationSegment)\n        {\n            var names = new[] { viewType.Name, viewType.FullName };\n            return names.Any(x => x.Equals(navigationSegment, StringComparison.Ordinal));\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Navigation/Regions/RegionNavigationService.cs",
    "content": "using System.Diagnostics.CodeAnalysis;\nusing Prism.Common;\nusing Prism.Properties;\n\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Provides navigation for regions.\n    /// </summary>\n    public class RegionNavigationService : IRegionNavigationService\n    {\n        private readonly IContainerProvider _container;\n        private readonly IRegionNavigationContentLoader _regionNavigationContentLoader;\n        private NavigationContext _currentNavigationContext;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"RegionNavigationService\"/> class.\n        /// </summary>\n        /// <param name=\"container\">The <see cref=\"IContainerExtension\" />.</param>\n        /// <param name=\"regionNavigationContentLoader\">The navigation target handler.</param>\n        /// <param name=\"journal\">The journal.</param>\n        public RegionNavigationService(IContainerExtension container, IRegionNavigationContentLoader regionNavigationContentLoader, IRegionNavigationJournal journal)\n        {\n            _container = container ?? throw new ArgumentNullException(nameof(container));\n            _regionNavigationContentLoader = regionNavigationContentLoader ?? throw new ArgumentNullException(nameof(regionNavigationContentLoader));\n            Journal = journal ?? throw new ArgumentNullException(nameof(journal));\n            Journal.NavigationTarget = this;\n        }\n\n        /// <summary>\n        /// Gets or sets the region.\n        /// </summary>\n        /// <value>The region.</value>\n        public IRegion Region { get; set; }\n\n        /// <summary>\n        /// Gets the journal.\n        /// </summary>\n        /// <value>The journal.</value>\n        public IRegionNavigationJournal Journal { get; private set; }\n\n        /// <summary>\n        /// Raised when the region is about to be navigated to content.\n        /// </summary>\n        public event EventHandler<RegionNavigationEventArgs> Navigating;\n\n        private void RaiseNavigating(NavigationContext navigationContext)\n        {\n            Navigating?.Invoke(this, new RegionNavigationEventArgs(navigationContext));\n        }\n\n        /// <summary>\n        /// Raised when the region is navigated to content.\n        /// </summary>\n        public event EventHandler<RegionNavigationEventArgs> Navigated;\n\n        private void RaiseNavigated(NavigationContext navigationContext)\n        {\n            Navigated?.Invoke(this, new RegionNavigationEventArgs(navigationContext));\n        }\n\n        /// <summary>\n        /// Raised when a navigation request fails.\n        /// </summary>\n        public event EventHandler<RegionNavigationFailedEventArgs> NavigationFailed;\n\n        private void RaiseNavigationFailed(NavigationContext navigationContext, Exception error)\n        {\n            NavigationFailed?.Invoke(this, new RegionNavigationFailedEventArgs(navigationContext, error));\n        }\n\n        /// <summary>\n        /// Initiates navigation to the specified target.\n        /// </summary>\n        /// <param name=\"target\">The target.</param>\n        /// <param name=\"navigationCallback\">A callback to execute when the navigation request is completed.</param>\n        [SuppressMessage(\"Microsoft.Design\", \"CA1031:DoNotCatchGeneralExceptionTypes\", Justification = \"Exception is marshalled to callback\")]\n        public void RequestNavigate(Uri target, Action<NavigationResult> navigationCallback)\n        {\n            RequestNavigate(target, navigationCallback, null);\n        }\n\n        /// <summary>\n        /// Initiates navigation to the specified target.\n        /// </summary>\n        /// <param name=\"target\">The target.</param>\n        /// <param name=\"navigationCallback\">A callback to execute when the navigation request is completed.</param>\n        /// <param name=\"navigationParameters\">The navigation parameters specific to the navigation request.</param>\n        public void RequestNavigate(Uri target, Action<NavigationResult> navigationCallback, INavigationParameters navigationParameters)\n        {\n            if (navigationCallback == null)\n                throw new ArgumentNullException(nameof(navigationCallback));\n\n            try\n            {\n                DoNavigate(target, navigationCallback, navigationParameters);\n            }\n            catch (Exception e)\n            {\n                NotifyNavigationFailed(new NavigationContext(this, target), navigationCallback, e);\n            }\n        }\n\n        private void DoNavigate(Uri source, Action<NavigationResult> navigationCallback, INavigationParameters navigationParameters)\n        {\n            if (source == null)\n                throw new ArgumentNullException(nameof(source));\n\n            if (Region == null)\n                throw new InvalidOperationException(Resources.NavigationServiceHasNoRegion);\n\n            _currentNavigationContext = new NavigationContext(this, source, navigationParameters);\n\n            // starts querying the active views\n            RequestCanNavigateFromOnCurrentlyActiveView(\n                _currentNavigationContext,\n                navigationCallback,\n                Region.ActiveViews.ToArray(),\n                0);\n        }\n\n        private void RequestCanNavigateFromOnCurrentlyActiveView(\n            NavigationContext navigationContext,\n            Action<NavigationResult> navigationCallback,\n            object[] activeViews,\n            int currentViewIndex)\n        {\n            if (currentViewIndex < activeViews.Length)\n            {\n                if (activeViews[currentViewIndex] is IConfirmNavigationRequest vetoingView)\n                {\n                    // the current active view implements IConfirmNavigationRequest, request confirmation\n                    // providing a callback to resume the navigation request\n                    vetoingView.ConfirmNavigationRequest(\n                        navigationContext,\n                        canNavigate =>\n                        {\n                            if (_currentNavigationContext == navigationContext && canNavigate)\n                            {\n                                RequestCanNavigateFromOnCurrentlyActiveViewModel(\n                                    navigationContext,\n                                    navigationCallback,\n                                    activeViews,\n                                    currentViewIndex);\n                            }\n                            else\n                            {\n                                NotifyNavigationFailed(navigationContext, navigationCallback, null);\n                            }\n                        });\n                }\n                else\n                {\n                    RequestCanNavigateFromOnCurrentlyActiveViewModel(\n                        navigationContext,\n                        navigationCallback,\n                        activeViews,\n                        currentViewIndex);\n                }\n            }\n            else\n            {\n                ExecuteNavigation(navigationContext, activeViews, navigationCallback);\n            }\n        }\n\n        private void RequestCanNavigateFromOnCurrentlyActiveViewModel(\n            NavigationContext navigationContext,\n            Action<NavigationResult> navigationCallback,\n            object[] activeViews,\n            int currentViewIndex)\n        {\n            if (activeViews[currentViewIndex] is FrameworkElement frameworkElement)\n            {\n                if (frameworkElement.DataContext is IConfirmNavigationRequest vetoingViewModel)\n                {\n                    // the data model for the current active view implements IConfirmNavigationRequest, request confirmation\n                    // providing a callback to resume the navigation request\n                    vetoingViewModel.ConfirmNavigationRequest(\n                        navigationContext,\n                        canNavigate =>\n                        {\n                            if (_currentNavigationContext == navigationContext && canNavigate)\n                            {\n                                RequestCanNavigateFromOnCurrentlyActiveView(\n                                    navigationContext,\n                                    navigationCallback,\n                                    activeViews,\n                                    currentViewIndex + 1);\n                            }\n                            else\n                            {\n                                NotifyNavigationFailed(navigationContext, navigationCallback, null);\n                            }\n                        });\n\n                    return;\n                }\n            }\n\n            RequestCanNavigateFromOnCurrentlyActiveView(\n                navigationContext,\n                navigationCallback,\n                activeViews,\n                currentViewIndex + 1);\n        }\n\n        [SuppressMessage(\"Microsoft.Design\", \"CA1031:DoNotCatchGeneralExceptionTypes\", Justification = \"Exception is marshalled to callback\")]\n        private void ExecuteNavigation(NavigationContext navigationContext, object[] activeViews, Action<NavigationResult> navigationCallback)\n        {\n            try\n            {\n                NotifyActiveViewsNavigatingFrom(navigationContext, activeViews);\n\n                object view = _regionNavigationContentLoader.LoadContent(Region, navigationContext);\n\n                // Raise the navigating event just before activating the view.\n                RaiseNavigating(navigationContext);\n\n                Region.Activate(view);\n\n                // Update the navigation journal before notifying others of navigation\n                IRegionNavigationJournalEntry journalEntry = _container.Resolve<IRegionNavigationJournalEntry>();\n                journalEntry.Uri = navigationContext.Uri;\n                journalEntry.Parameters = navigationContext.Parameters;\n\n                bool persistInHistory = PersistInHistory(view);\n\n                Journal.RecordNavigation(journalEntry, persistInHistory);\n\n                // The view can be informed of navigation\n                Action<IRegionAware> action = (n) => n.OnNavigatedTo(navigationContext);\n                MvvmHelpers.ViewAndViewModelAction(view, action);\n\n                navigationCallback(new NavigationResult(navigationContext, true));\n\n                // Raise the navigated event when navigation is completed.\n                RaiseNavigated(navigationContext);\n            }\n            catch (Exception e)\n            {\n                NotifyNavigationFailed(navigationContext, navigationCallback, e);\n            }\n        }\n\n        private static bool PersistInHistory(object view)\n        {\n            bool persist = true;\n            MvvmHelpers.ViewAndViewModelAction<IJournalAware>(view, ija => { persist &= ija.PersistInHistory(); });\n            return persist;\n        }\n\n        private void NotifyNavigationFailed(NavigationContext navigationContext, Action<NavigationResult> navigationCallback, Exception e)\n        {\n            var navigationResult =\n                e != null ? new NavigationResult(navigationContext, e) : new NavigationResult(navigationContext, false);\n\n            navigationCallback(navigationResult);\n            RaiseNavigationFailed(navigationContext, e);\n        }\n\n        private static void NotifyActiveViewsNavigatingFrom(NavigationContext navigationContext, object[] activeViews)\n        {\n            InvokeOnNavigationAwareElements(activeViews, (n) => n.OnNavigatedFrom(navigationContext));\n        }\n\n        private static void InvokeOnNavigationAwareElements(IEnumerable<object> items, Action<IRegionAware> invocation)\n        {\n            foreach (var item in items)\n            {\n                MvvmHelpers.ViewAndViewModelAction(item, invocation);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Navigation/Regions/RegionViewRegistry.cs",
    "content": "using System.Globalization;\nusing System.Reflection;\nusing Prism.Common;\nusing Prism.Events;\nusing Prism.Properties;\n\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Defines a registry for the content of the regions used on View Discovery composition.\n    /// </summary>\n    public class RegionViewRegistry : IRegionViewRegistry\n    {\n        private readonly IContainerProvider _container;\n        private readonly ListDictionary<string, Func<IContainerProvider, object>> _registeredContent = new ListDictionary<string, Func<IContainerProvider, object>>();\n        private readonly WeakDelegatesManager _contentRegisteredListeners = new WeakDelegatesManager();\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"RegionViewRegistry\"/> class.\n        /// </summary>\n        /// <param name=\"container\"><see cref=\"IContainerExtension\"/> used to create the instance of the views from its <see cref=\"Type\"/>.</param>\n        public RegionViewRegistry(IContainerExtension container)\n        {\n            _container = container;\n        }\n\n        /// <summary>\n        /// Occurs whenever a new view is registered.\n        /// </summary>\n        public event EventHandler<ViewRegisteredEventArgs> ContentRegistered\n        {\n            add => _contentRegisteredListeners.AddListener(value);\n            remove => _contentRegisteredListeners.RemoveListener(value);\n        }\n\n        /// <summary>\n        /// Returns the contents registered for a region.\n        /// </summary>\n        /// <param name=\"regionName\">Name of the region which content is being requested.</param>\n        /// <param name=\"container\">The <see cref=\"IContainerProvider\"/> to use to get the View.</param>\n        /// <returns>Collection of contents registered for the region.</returns>\n        public IEnumerable<object> GetContents(string regionName, IContainerProvider container)\n        {\n            var items = new List<object>();\n            foreach (Func<IContainerProvider, object> getContentDelegate in _registeredContent[regionName])\n            {\n                items.Add(getContentDelegate(container));\n            }\n\n            return items;\n        }\n\n        /// <summary>\n        /// Registers a content type with a region name.\n        /// </summary>\n        /// <param name=\"regionName\">Region name to which the <paramref name=\"viewType\"/> will be registered.</param>\n        /// <param name=\"viewType\">Content type to be registered for the <paramref name=\"regionName\"/>.</param>\n        public void RegisterViewWithRegion(string regionName, Type viewType)\n        {\n            RegisterViewWithRegion(regionName, _ => CreateInstance(viewType));\n        }\n\n        /// <summary>\n        /// Registers a delegate that can be used to retrieve the content associated with a region name.\n        /// </summary>\n        /// <param name=\"regionName\">Region name to which the <paramref name=\"getContentDelegate\"/> will be registered.</param>\n        /// <param name=\"getContentDelegate\">Delegate used to retrieve the content associated with the <paramref name=\"regionName\"/>.</param>\n        public void RegisterViewWithRegion(string regionName, Func<IContainerProvider, object> getContentDelegate)\n        {\n            _registeredContent.Add(regionName, getContentDelegate);\n            OnContentRegistered(new ViewRegisteredEventArgs(regionName, getContentDelegate));\n        }\n\n        /// <summary>\n        /// Associate a view with a region, by registering a type. When the region get's displayed\n        /// this type will be resolved using the ServiceLocator into a concrete instance. The instance\n        /// will be added to the Views collection of the region\n        /// </summary>\n        /// <param name=\"regionName\">The name of the region to associate the view with.</param>\n        /// <param name=\"targetName\">The type of the view to register with the </param>\n        /// <returns>The <see cref=\"IRegionManager\"/>, for adding several views easily</returns>\n        public void RegisterViewWithRegion(string regionName, string targetName) =>\n            RegisterViewWithRegion(regionName, c => c.Resolve<object>(targetName));\n\n        /// <summary>\n        /// Creates an instance of a registered view <see cref=\"Type\"/>.\n        /// </summary>\n        /// <param name=\"type\">Type of the registered view.</param>\n        /// <returns>Instance of the registered view.</returns>\n        protected virtual object CreateInstance(Type type)\n        {\n            var view = _container.Resolve(type);\n            MvvmHelpers.AutowireViewModel(view);\n            return view;\n        }\n\n        private void OnContentRegistered(ViewRegisteredEventArgs e)\n        {\n            try\n            {\n                _contentRegisteredListeners.Raise(this, e);\n            }\n            catch (TargetInvocationException ex)\n            {\n                Exception rootException;\n                if (ex.InnerException != null)\n                {\n                    rootException = ex.InnerException.GetRootException();\n                }\n                else\n                {\n                    rootException = ex.GetRootException();\n                }\n\n                throw new ViewRegistrationException(string.Format(CultureInfo.CurrentCulture,\n                    Resources.OnViewRegisteredException, e.RegionName, rootException), ex.InnerException);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Navigation/Regions/SelectorRegionAdapter.cs",
    "content": "using Prism.Navigation.Regions.Behaviors;\n\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Adapter that creates a new <see cref=\"Region\"/> and binds all\n    /// the views to the adapted <see cref=\"Selector\"/>.\n    /// It also keeps the <see cref=\"IRegion.ActiveViews\"/> and the selected items\n    /// of the <see cref=\"Selector\"/> in sync.\n    /// </summary>\n    public class SelectorRegionAdapter : RegionAdapterBase<Selector>\n    {\n        /// <summary>\n        /// Initializes a new instance of <see cref=\"SelectorRegionAdapter\"/>.\n        /// </summary>\n        /// <param name=\"regionBehaviorFactory\">The factory used to create the region behaviors to attach to the created regions.</param>\n        public SelectorRegionAdapter(IRegionBehaviorFactory regionBehaviorFactory)\n            : base(regionBehaviorFactory)\n        {\n        }\n\n        /// <summary>\n        /// Adapts an <see cref=\"Selector\"/> to an <see cref=\"IRegion\"/>.\n        /// </summary>\n        /// <param name=\"region\">The new region being used.</param>\n        /// <param name=\"regionTarget\">The object to adapt.</param>\n        protected override void Adapt(IRegion region, Selector regionTarget)\n        {\n        }\n\n        /// <summary>\n        /// Attach new behaviors.\n        /// </summary>\n        /// <param name=\"region\">The region being used.</param>\n        /// <param name=\"regionTarget\">The object to adapt.</param>\n        /// <remarks>\n        /// This class attaches the base behaviors and also listens for changes in the\n        /// activity of the region or the control selection and keeps the in sync.\n        /// </remarks>\n        protected override void AttachBehaviors(IRegion region, Selector regionTarget)\n        {\n            if (region == null)\n                throw new ArgumentNullException(nameof(region));\n\n            // Add the behavior that syncs the items source items with the rest of the items\n            region.Behaviors.Add(SelectorItemsSourceSyncBehavior.BehaviorKey, new SelectorItemsSourceSyncBehavior()\n            {\n                HostControl = regionTarget\n            });\n\n            base.AttachBehaviors(region, regionTarget);\n        }\n\n        /// <summary>\n        /// Creates a new instance of <see cref=\"Region\"/>.\n        /// </summary>\n        /// <returns>A new instance of <see cref=\"Region\"/>.</returns>\n        protected override IRegion CreateRegion()\n        {\n            return new Region();\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Navigation/Regions/SingleActiveRegion.cs",
    "content": "namespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Region that allows a maximum of one active view at a time.\n    /// </summary>\n    public class SingleActiveRegion : Region\n    {\n        /// <summary>\n        /// Marks the specified view as active.\n        /// </summary>\n        /// <param name=\"view\">The view to activate.</param>\n        /// <remarks>If there is an active view before calling this method,\n        /// that view will be deactivated automatically.</remarks>\n        public override void Activate(object view)\n        {\n            object currentActiveView = ActiveViews.FirstOrDefault();\n\n            if (currentActiveView != null && currentActiveView != view && Views.Contains(currentActiveView))\n            {\n                base.Deactivate(currentActiveView);\n            }\n\n            base.Activate(view);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Navigation/Regions/ViewsCollection.cs",
    "content": "using System.Collections;\nusing System.Collections.ObjectModel;\nusing System.Collections.Specialized;\n\nnamespace Prism.Navigation.Regions\n{\n    /// <summary>\n    /// Implementation of <see cref=\"IViewsCollection\"/> that takes an <see cref=\"ObservableCollection{T}\"/> of <see cref=\"ItemMetadata\"/>\n    /// and filters it to display an <see cref=\"INotifyCollectionChanged\"/> collection of\n    /// <see cref=\"object\"/> elements (the items which the <see cref=\"ItemMetadata\"/> wraps).\n    /// </summary>\n    public class ViewsCollection : IViewsCollection\n    {\n        private readonly ObservableCollection<ItemMetadata> _subjectCollection;\n\n        private readonly Dictionary<ItemMetadata, MonitorInfo> monitoredItems =\n            new Dictionary<ItemMetadata, MonitorInfo>();\n\n        private readonly Predicate<ItemMetadata> _filter;\n        private Comparison<object> sort;\n        private List<object> filteredItems = new List<object>();\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ViewsCollection\"/> class.\n        /// </summary>\n        /// <param name=\"list\">The list to wrap and filter.</param>\n        /// <param name=\"filter\">A predicate to filter the <paramref name=\"list\"/> collection.</param>\n        public ViewsCollection(ObservableCollection<ItemMetadata> list, Predicate<ItemMetadata> filter)\n        {\n            _subjectCollection = list;\n            _filter = filter;\n            MonitorAllMetadataItems();\n            _subjectCollection.CollectionChanged += SourceCollectionChanged;\n            UpdateFilteredItemsList();\n        }\n\n        /// <summary>\n        /// Occurs when the collection changes.\n        /// </summary>\n        public event NotifyCollectionChangedEventHandler CollectionChanged;\n\n        /// <summary>\n        /// Gets or sets the comparison used to sort the views.\n        /// </summary>\n        /// <value>The comparison to use.</value>\n        public Comparison<object> SortComparison\n        {\n            get { return sort; }\n            set\n            {\n                if (sort != value)\n                {\n                    sort = value;\n                    UpdateFilteredItemsList();\n                    OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));\n                }\n            }\n        }\n\n        /// <summary>\n        /// Determines whether the collection contains a specific value.\n        /// </summary>\n        /// <param name=\"value\">The object to locate in the collection.</param>\n        /// <returns><see langword=\"true\" /> if <paramref name=\"value\"/> is found in the collection; otherwise, <see langword=\"false\" />.</returns>\n        public bool Contains(object value)\n        {\n            return filteredItems.Contains(value);\n        }\n\n        ///<summary>\n        ///Returns an enumerator that iterates through the collection.\n        ///</summary>\n        ///<returns>\n        ///A <see cref=\"T:System.Collections.Generic.IEnumerator`1\" /> that can be used to iterate through the collection.\n        ///</returns>\n        public IEnumerator<object> GetEnumerator()\n        {\n            return filteredItems.GetEnumerator();\n        }\n\n        ///<summary>\n        ///Returns an enumerator that iterates through a collection.\n        ///</summary>\n        ///<returns>\n        ///An <see cref=\"T:System.Collections.IEnumerator\" /> object that can be used to iterate through the collection.\n        ///</returns>\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return GetEnumerator();\n        }\n\n        /// <summary>\n        /// Used to invoked the <see cref=\"CollectionChanged\"/> event.\n        /// </summary>\n        /// <param name=\"e\"></param>\n        private void OnCollectionChanged(NotifyCollectionChangedEventArgs e)\n        {\n            CollectionChanged?.Invoke(this, e);\n        }\n\n        private void NotifyReset()\n        {\n            OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));\n        }\n\n        /// <summary>\n        /// Removes all monitoring of underlying MetadataItems and re-adds them.\n        /// </summary>\n        private void ResetAllMonitors()\n        {\n            RemoveAllMetadataMonitors();\n            MonitorAllMetadataItems();\n        }\n\n        /// <summary>\n        /// Adds all underlying MetadataItems to the list from the subjectCollection\n        /// </summary>\n        private void MonitorAllMetadataItems()\n        {\n            foreach (var item in _subjectCollection)\n            {\n                AddMetadataMonitor(item, _filter(item));\n            }\n        }\n\n        /// <summary>\n        /// Removes all monitored items from our monitoring list.\n        /// </summary>\n        private void RemoveAllMetadataMonitors()\n        {\n            foreach (var item in monitoredItems)\n            {\n                item.Key.MetadataChanged -= OnItemMetadataChanged;\n            }\n\n            monitoredItems.Clear();\n        }\n\n        /// <summary>\n        /// Adds handler to monitor the MetadataItem and adds it to our monitoring list.\n        /// </summary>\n        /// <param name=\"itemMetadata\"></param>\n        /// <param name=\"isInList\"></param>\n        private void AddMetadataMonitor(ItemMetadata itemMetadata, bool isInList)\n        {\n            itemMetadata.MetadataChanged += OnItemMetadataChanged;\n            monitoredItems.Add(\n                itemMetadata,\n                new MonitorInfo\n                {\n                    IsInList = isInList\n                });\n        }\n\n        /// <summary>\n        /// Unhooks from the MetadataItem change event and removes from our monitoring list.\n        /// </summary>\n        /// <param name=\"itemMetadata\"></param>\n        private void RemoveMetadataMonitor(ItemMetadata itemMetadata)\n        {\n            itemMetadata.MetadataChanged -= OnItemMetadataChanged;\n            monitoredItems.Remove(itemMetadata);\n        }\n\n        /// <summary>\n        /// Invoked when any of the underlying ItemMetadata items we're monitoring changes.\n        /// </summary>\n        /// <param name=\"sender\"></param>\n        /// <param name=\"e\"></param>\n        private void OnItemMetadataChanged(object sender, EventArgs e)\n        {\n            ItemMetadata itemMetadata = (ItemMetadata)sender;\n\n            // Our monitored item may have been removed during another event before\n            // our OnItemMetadataChanged got called back, so it's not unexpected\n            // that we may not have it in our list.\n            MonitorInfo monitorInfo;\n            bool foundInfo = monitoredItems.TryGetValue(itemMetadata, out monitorInfo);\n            if (!foundInfo) return;\n\n            if (_filter(itemMetadata))\n            {\n                if (!monitorInfo.IsInList)\n                {\n                    // This passes our filter and wasn't marked\n                    // as in our list so we can consider this\n                    // an Add.\n                    monitorInfo.IsInList = true;\n                    UpdateFilteredItemsList();\n                    NotifyAdd(itemMetadata.Item);\n                }\n            }\n            else\n            {\n                // This doesn't fit our filter, we remove from our\n                // tracking list, but should not remove any monitoring in\n                // case it fits our filter in the future.\n                monitorInfo.IsInList = false;\n                RemoveFromFilteredList(itemMetadata.Item);\n            }\n        }\n\n        /// <summary>\n        /// The event handler due to changes in the underlying collection.\n        /// </summary>\n        /// <param name=\"sender\"></param>\n        /// <param name=\"e\"></param>\n        private void SourceCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)\n        {\n            switch (e.Action)\n            {\n                case NotifyCollectionChangedAction.Add:\n                    UpdateFilteredItemsList();\n                    foreach (ItemMetadata itemMetadata in e.NewItems)\n                    {\n                        bool isInFilter = _filter(itemMetadata);\n                        AddMetadataMonitor(itemMetadata, isInFilter);\n                        if (isInFilter)\n                        {\n                            NotifyAdd(itemMetadata.Item);\n                        }\n                    }\n\n                    // If we're sorting we can't predict how\n                    // the collection has changed on an add so we\n                    // resort to a reset notification.\n                    if (sort != null)\n                    {\n                        NotifyReset();\n                    }\n\n                    break;\n\n                case NotifyCollectionChangedAction.Remove:\n                    foreach (ItemMetadata itemMetadata in e.OldItems)\n                    {\n                        RemoveMetadataMonitor(itemMetadata);\n                        if (_filter(itemMetadata))\n                        {\n                            RemoveFromFilteredList(itemMetadata.Item);\n                        }\n                    }\n\n                    break;\n\n                default:\n                    ResetAllMonitors();\n                    UpdateFilteredItemsList();\n                    NotifyReset();\n\n                    break;\n            }\n        }\n\n        private void NotifyAdd(object item)\n        {\n            int newIndex = filteredItems.IndexOf(item);\n            NotifyAdd(new[] { item }, newIndex);\n        }\n\n        private void RemoveFromFilteredList(object item)\n        {\n            int index = filteredItems.IndexOf(item);\n            UpdateFilteredItemsList();\n            NotifyRemove(new[] { item }, index);\n        }\n\n        private void UpdateFilteredItemsList()\n        {\n            filteredItems = _subjectCollection.Where(i => _filter(i)).Select(i => i.Item)\n                .OrderBy<object, object>(o => o, new RegionItemComparer(SortComparison)).ToList();\n        }\n\n        private class MonitorInfo\n        {\n            public bool IsInList { get; set; }\n        }\n\n        private class RegionItemComparer : Comparer<object>\n        {\n            private readonly Comparison<object> comparer;\n\n            public RegionItemComparer(Comparison<object> comparer)\n            {\n                this.comparer = comparer;\n            }\n\n            public override int Compare(object x, object y)\n            {\n                if (comparer == null)\n                {\n                    return 0;\n                }\n\n                return comparer(x, y);\n            }\n        }\n\n        private void NotifyAdd(IList items, int newStartingIndex)\n        {\n            if (items.Count > 0)\n            {\n                OnCollectionChanged(new NotifyCollectionChangedEventArgs(\n                                            NotifyCollectionChangedAction.Add,\n                                            items,\n                                            newStartingIndex));\n            }\n        }\n\n        private void NotifyRemove(IList items, int originalIndex)\n        {\n            if (items.Count > 0)\n            {\n                OnCollectionChanged(new NotifyCollectionChangedEventArgs(\n                    NotifyCollectionChangedAction.Remove,\n                    items,\n                    originalIndex));\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Prism.Wpf.csproj",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project Sdk=\"Microsoft.NET.Sdk.WindowsDesktop\">\n\n  <PropertyGroup>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Prism</RootNamespace>\n    <TargetFrameworks>net462;net47;net8.0-windows;net9.0-windows;net10.0-windows</TargetFrameworks>\n    <UseWPF>true</UseWPF>\n    <!--<Summary>Prism libraries related to user interface composition, regions, and modularity for WPF.</Summary>-->\n    <Description>Prism provides an implementation of a collection of design patterns that are helpful in writing well structured, maintainable, and testable XAML applications, including MVVM, dependency injection, commanding, event aggregation, and more. Prism's core functionality is a shared library targeting the .NET Framework and .NET. Features that need to be platform specific are implemented in the respective libraries for the target platform (WPF, Uno Platform, .NET MAUI and Xamarin Forms).\n\nPrism.Wpf helps you more easily design and build rich, flexible, and easy to maintain Windows Presentation Foundation (WPF) desktop applications. This library provides user interface composition as well as modularity support.</Description>\n    <PackageTags>prism;mvvm;xaml;wpf</PackageTags>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <None Remove=\"Dialogs\\DialogWindow.xaml\" />\n  </ItemGroup>\n\n  <ItemGroup Condition=\" $(TargetFramework.StartsWith('net4')) \">\n    <Compile Remove=\"**\\*.netcore.cs\" />\n    <None Include=\"**\\*.netcore.cs\" />\n    <Reference Include=\"System.Configuration\" />\n  </ItemGroup>\n\n  <ItemGroup Condition=\" $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows' \">\n    <Compile Remove=\"**\\*.net45.cs\" />\n    <None Include=\"**\\*.net45.cs\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Microsoft.Xaml.Behaviors.Wpf\" />\n    <PackageReference Include=\"PolySharp\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n    </PackageReference>\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\Prism.Core\\Prism.Core.csproj\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/PrismApplicationBase.cs",
    "content": "using Prism.Common;\nusing Prism.Modularity;\nusing Prism.Navigation.Regions;\n\nnamespace Prism\n{\n    /// <summary>\n    /// Base application class that provides a basic initialization sequence\n    /// </summary>\n    /// <remarks>\n    /// This class must be overridden to provide application specific configuration.\n    /// </remarks>\n    public abstract class PrismApplicationBase : Application\n    {\n        IContainerExtension _containerExtension;\n        IModuleCatalog _moduleCatalog;\n\n        /// <summary>\n        /// The dependency injection container used to resolve objects\n        /// </summary>\n        public IContainerProvider Container => _containerExtension;\n\n        /// <summary>\n        /// Raises the System.Windows.Application.Startup event.\n        /// </summary>\n        /// <param name=\"e\">A System.Windows.StartupEventArgs that contains the event data.</param>\n        protected override void OnStartup(StartupEventArgs e)\n        {\n            base.OnStartup(e);\n            InitializeInternal();\n        }\n\n        /// <summary>\n        /// Run the initialization process.\n        /// </summary>\n        void InitializeInternal()\n        {\n            ConfigureViewModelLocator();\n            Initialize();\n            OnInitialized();\n        }\n\n        /// <summary>\n        /// Configures the <see cref=\"Prism.Mvvm.ViewModelLocator\"/> used by Prism.\n        /// </summary>\n        protected virtual void ConfigureViewModelLocator()\n        {\n            PrismInitializationExtensions.ConfigureViewModelLocator();\n        }\n\n        /// <summary>\n        /// Runs the initialization sequence to configure the Prism application.\n        /// </summary>\n        protected virtual void Initialize()\n        {\n            ContainerLocator.SetContainerExtension(CreateContainerExtension());\n            _containerExtension = ContainerLocator.Current;\n            _moduleCatalog = CreateModuleCatalog();\n            RegisterRequiredTypes(_containerExtension);\n            RegisterTypes(_containerExtension);\n\n            ConfigureModuleCatalog(_moduleCatalog);\n\n            var regionAdapterMappings = _containerExtension.Resolve<RegionAdapterMappings>();\n            ConfigureRegionAdapterMappings(regionAdapterMappings);\n\n            var defaultRegionBehaviors = _containerExtension.Resolve<IRegionBehaviorFactory>();\n            ConfigureDefaultRegionBehaviors(defaultRegionBehaviors);\n\n            RegisterFrameworkExceptionTypes();\n\n            var shell = CreateShell();\n            if (shell != null)\n            {\n                MvvmHelpers.AutowireViewModel(shell);\n                RegionManager.SetRegionManager(shell, _containerExtension.Resolve<IRegionManager>());\n                RegionManager.UpdateRegions();\n                InitializeShell(shell);\n            }\n\n            InitializeModules();\n        }\n\n        /// <summary>\n        /// Creates the container used by Prism.\n        /// </summary>\n        /// <returns>The container</returns>\n        protected abstract IContainerExtension CreateContainerExtension();\n\n        /// <summary>\n        /// Creates the <see cref=\"IModuleCatalog\"/> used by Prism.\n        /// </summary>\n        ///  <remarks>\n        /// The base implementation returns a new ModuleCatalog.\n        /// </remarks>\n        protected virtual IModuleCatalog CreateModuleCatalog()\n        {\n            return new ModuleCatalog();\n        }\n\n        /// <summary>\n        /// Registers all types that are required by Prism to function with the container.\n        /// </summary>\n        /// <param name=\"containerRegistry\"></param>\n        protected virtual void RegisterRequiredTypes(IContainerRegistry containerRegistry)\n        {\n            containerRegistry.RegisterRequiredTypes(_moduleCatalog);\n        }\n\n        /// <summary>\n        /// Used to register types with the container that will be used by your application.\n        /// </summary>\n        protected abstract void RegisterTypes(IContainerRegistry containerRegistry);\n\n        /// <summary>\n        /// Configures the <see cref=\"IRegionBehaviorFactory\"/>.\n        /// This will be the list of default behaviors that will be added to a region.\n        /// </summary>\n        protected virtual void ConfigureDefaultRegionBehaviors(IRegionBehaviorFactory regionBehaviors)\n        {\n            regionBehaviors?.RegisterDefaultRegionBehaviors();\n        }\n\n        /// <summary>\n        /// Configures the default region adapter mappings to use in the application, in order\n        /// to adapt UI controls defined in XAML to use a region and register it automatically.\n        /// May be overwritten in a derived class to add specific mappings required by the application.\n        /// </summary>\n        /// <returns>The <see cref=\"RegionAdapterMappings\"/> instance containing all the mappings.</returns>\n        protected virtual void ConfigureRegionAdapterMappings(RegionAdapterMappings regionAdapterMappings)\n        {\n            regionAdapterMappings?.RegisterDefaultRegionAdapterMappings();\n        }\n\n        /// <summary>\n        /// Registers the <see cref=\"Type\"/>s of the Exceptions that are not considered\n        /// root exceptions by the <see cref=\"ExceptionExtensions\"/>.\n        /// </summary>\n        protected virtual void RegisterFrameworkExceptionTypes()\n        {\n        }\n\n        /// <summary>\n        /// Creates the shell or main window of the application.\n        /// </summary>\n        /// <returns>The shell of the application.</returns>\n        protected abstract Window CreateShell();\n\n        /// <summary>\n        /// Initializes the shell.\n        /// </summary>\n        protected virtual void InitializeShell(Window shell)\n        {\n            MainWindow = shell;\n        }\n\n        /// <summary>\n        /// Contains actions that should occur last.\n        /// </summary>\n        protected virtual void OnInitialized()\n        {\n            MainWindow?.Show();\n        }\n\n        /// <summary>\n        /// Configures the <see cref=\"IModuleCatalog\"/> used by Prism.\n        /// </summary>\n        protected virtual void ConfigureModuleCatalog(IModuleCatalog moduleCatalog) { }\n\n        /// <summary>\n        /// Initializes the modules.\n        /// </summary>\n        protected virtual void InitializeModules()\n        {\n            PrismInitializationExtensions.RunModuleManager(Container);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/PrismBootstrapperBase.cs",
    "content": "using Prism.Common;\nusing Prism.Modularity;\nusing Prism.Navigation.Regions;\n\nnamespace Prism\n{\n    /// <summary>\n    /// Base class that provides a basic bootstrapping sequence and hooks\n    /// that specific implementations can override\n    /// </summary>\n    /// <remarks>\n    /// This class must be overridden to provide application specific configuration.\n    /// </remarks>\n    public abstract class PrismBootstrapperBase\n    {\n        IContainerExtension _containerExtension;\n        IModuleCatalog _moduleCatalog;\n\n        /// <summary>\n        /// The dependency injection container used to resolve objects\n        /// </summary>\n        public IContainerProvider Container => _containerExtension;\n\n        /// <summary>\n        /// Gets the shell user interface\n        /// </summary>\n        /// <value>The shell user interface.</value>\n        protected DependencyObject Shell { get; set; }\n\n        /// <summary>\n        /// Runs the bootstrapper process.\n        /// </summary>\n        public void Run()\n        {\n            ConfigureViewModelLocator();\n            Initialize();\n            OnInitialized();\n        }\n\n        /// <summary>\n        /// Configures the <see cref=\"Prism.Mvvm.ViewModelLocator\"/> used by Prism.\n        /// </summary>\n        protected virtual void ConfigureViewModelLocator()\n        {\n            PrismInitializationExtensions.ConfigureViewModelLocator();\n        }\n\n        /// <summary>\n        /// Runs the initialization sequence to configure the Prism application.\n        /// </summary>\n        protected virtual void Initialize()\n        {\n            ContainerLocator.SetContainerExtension(CreateContainerExtension());\n            _containerExtension = ContainerLocator.Current;\n            _moduleCatalog = CreateModuleCatalog();\n            RegisterRequiredTypes(_containerExtension);\n            RegisterTypes(_containerExtension);\n\n            ConfigureModuleCatalog(_moduleCatalog);\n\n            var regionAdapterMappings = _containerExtension.Resolve<RegionAdapterMappings>();\n            ConfigureRegionAdapterMappings(regionAdapterMappings);\n\n            var defaultRegionBehaviors = _containerExtension.Resolve<IRegionBehaviorFactory>();\n            ConfigureDefaultRegionBehaviors(defaultRegionBehaviors);\n\n            RegisterFrameworkExceptionTypes();\n\n            var shell = CreateShell();\n            if (shell != null)\n            {\n                MvvmHelpers.AutowireViewModel(shell);\n                RegionManager.SetRegionManager(shell, _containerExtension.Resolve<IRegionManager>());\n                RegionManager.UpdateRegions();\n                InitializeShell(shell);\n            }\n\n            InitializeModules();\n        }\n\n        /// <summary>\n        /// Creates the container used by Prism.\n        /// </summary>\n        /// <returns>The container</returns>\n        protected abstract IContainerExtension CreateContainerExtension();\n\n        /// <summary>\n        /// Creates the <see cref=\"IModuleCatalog\"/> used by Prism.\n        /// </summary>\n        ///  <remarks>\n        /// The base implementation returns a new ModuleCatalog.\n        /// </remarks>\n        protected virtual IModuleCatalog CreateModuleCatalog()\n        {\n            return new ModuleCatalog();\n        }\n\n        /// <summary>\n        /// Registers all types that are required by Prism to function with the container.\n        /// </summary>\n        /// <param name=\"containerRegistry\"></param>\n        protected virtual void RegisterRequiredTypes(IContainerRegistry containerRegistry)\n        {\n            if (_moduleCatalog == null)\n                throw new InvalidOperationException(\"IModuleCatalog\");\n\n            containerRegistry.RegisterRequiredTypes(_moduleCatalog);\n        }\n\n        /// <summary>\n        /// Used to register types with the container that will be used by your application.\n        /// </summary>\n        protected abstract void RegisterTypes(IContainerRegistry containerRegistry);\n\n        /// <summary>\n        /// Configures the <see cref=\"IRegionBehaviorFactory\"/>.\n        /// This will be the list of default behaviors that will be added to a region.\n        /// </summary>\n        protected virtual void ConfigureDefaultRegionBehaviors(IRegionBehaviorFactory regionBehaviors)\n        {\n            regionBehaviors?.RegisterDefaultRegionBehaviors();\n        }\n\n        /// <summary>\n        /// Configures the default region adapter mappings to use in the application, in order\n        /// to adapt UI controls defined in XAML to use a region and register it automatically.\n        /// May be overwritten in a derived class to add specific mappings required by the application.\n        /// </summary>\n        /// <returns>The <see cref=\"RegionAdapterMappings\"/> instance containing all the mappings.</returns>\n        protected virtual void ConfigureRegionAdapterMappings(RegionAdapterMappings regionAdapterMappings)\n        {\n            regionAdapterMappings?.RegisterDefaultRegionAdapterMappings();\n        }\n\n        /// <summary>\n        /// Registers the <see cref=\"Type\"/>s of the Exceptions that are not considered\n        /// root exceptions by the <see cref=\"ExceptionExtensions\"/>.\n        /// </summary>\n        protected virtual void RegisterFrameworkExceptionTypes()\n        {\n        }\n\n        /// <summary>\n        /// Creates the shell or main window of the application.\n        /// </summary>\n        /// <returns>The shell of the application.</returns>\n        protected abstract DependencyObject CreateShell();\n\n        /// <summary>\n        /// Initializes the shell.\n        /// </summary>\n        protected virtual void InitializeShell(DependencyObject shell)\n        {\n            Shell = shell;\n        }\n\n        /// <summary>\n        /// Contains actions that should occur last.\n        /// </summary>\n        protected virtual void OnInitialized()\n        {\n            if (Shell is Window window)\n                window.Show();\n        }\n\n        /// <summary>\n        /// Configures the <see cref=\"IModuleCatalog\"/> used by Prism.\n        /// </summary>\n        protected virtual void ConfigureModuleCatalog(IModuleCatalog moduleCatalog) { }\n\n        /// <summary>\n        /// Initializes the modules.\n        /// </summary>\n        protected virtual void InitializeModules()\n        {\n            PrismInitializationExtensions.RunModuleManager(Container);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/PrismInitializationExtensions.cs",
    "content": "using Prism.Dialogs;\nusing Prism.Events;\nusing Prism.Modularity;\nusing Prism.Mvvm;\nusing Prism.Navigation.Regions;\nusing Prism.Navigation.Regions.Behaviors;\n\nnamespace Prism\n{\n    internal static class PrismInitializationExtensions\n    {\n        internal static void ConfigureViewModelLocator()\n        {\n            ViewModelLocationProvider.SetDefaultViewModelFactory((view, type) =>\n            {\n                return ContainerLocator.Container.Resolve(type);\n            });\n        }\n\n#if UNO_WINUI\n        internal static void RegisterRequiredTypes(this IContainerRegistry containerRegistry)\n        {\n            containerRegistry.TryRegisterSingleton<IModuleCatalog, ModuleCatalog>();\n#else\n        internal static void RegisterRequiredTypes(this IContainerRegistry containerRegistry, IModuleCatalog moduleCatalog)\n        {\n            containerRegistry.TryRegisterInstance(moduleCatalog);\n#endif\n            containerRegistry.TryRegisterSingleton<IDialogService, DialogService>();\n            containerRegistry.TryRegisterSingleton<IModuleInitializer, ModuleInitializer>();\n            containerRegistry.TryRegisterSingleton<IModuleManager, ModuleManager>();\n            containerRegistry.TryRegisterSingleton<RegionAdapterMappings>();\n            containerRegistry.TryRegisterSingleton<IRegionManager, RegionManager>();\n            containerRegistry.TryRegisterSingleton<IRegionNavigationContentLoader, RegionNavigationContentLoader>();\n            containerRegistry.TryRegisterSingleton<IEventAggregator, EventAggregator>();\n            containerRegistry.TryRegisterSingleton<IRegionViewRegistry, RegionViewRegistry>();\n            containerRegistry.TryRegisterSingleton<IRegionBehaviorFactory, RegionBehaviorFactory>();\n            containerRegistry.TryRegister<IRegionNavigationJournalEntry, RegionNavigationJournalEntry>();\n            containerRegistry.TryRegister<IRegionNavigationJournal, RegionNavigationJournal>();\n            containerRegistry.TryRegister<IRegionNavigationService, RegionNavigationService>();\n            containerRegistry.TryRegister<IDialogWindow, DialogWindow>(); //default dialog host\n        }\n\n        internal static void RegisterDefaultRegionBehaviors(this IRegionBehaviorFactory regionBehaviors)\n        {\n#if AVALONIA\n            regionBehaviors.AddIfMissing<BindRegionContextToAvaloniaObjectBehavior>(BindRegionContextToAvaloniaObjectBehavior.BehaviorKey);\n#else\n            regionBehaviors.AddIfMissing<BindRegionContextToDependencyObjectBehavior>(BindRegionContextToDependencyObjectBehavior.BehaviorKey);\n#endif\n            regionBehaviors.AddIfMissing<RegionActiveAwareBehavior>(RegionActiveAwareBehavior.BehaviorKey);\n            regionBehaviors.AddIfMissing<SyncRegionContextWithHostBehavior>(SyncRegionContextWithHostBehavior.BehaviorKey);\n            regionBehaviors.AddIfMissing<RegionManagerRegistrationBehavior>(RegionManagerRegistrationBehavior.BehaviorKey);\n            regionBehaviors.AddIfMissing<RegionMemberLifetimeBehavior>(RegionMemberLifetimeBehavior.BehaviorKey);\n            regionBehaviors.AddIfMissing<ClearChildViewsRegionBehavior>(ClearChildViewsRegionBehavior.BehaviorKey);\n            regionBehaviors.AddIfMissing<AutoPopulateRegionBehavior>(AutoPopulateRegionBehavior.BehaviorKey);\n            regionBehaviors.AddIfMissing<DestructibleRegionBehavior>(DestructibleRegionBehavior.BehaviorKey);\n        }\n\n        internal static void RegisterDefaultRegionAdapterMappings(this RegionAdapterMappings regionAdapterMappings)\n        {\n#if !AVALONIA\n            regionAdapterMappings.RegisterMapping<Selector, SelectorRegionAdapter>();\n#endif\n            regionAdapterMappings.RegisterMapping<ItemsControl, ItemsControlRegionAdapter>();\n            regionAdapterMappings.RegisterMapping<ContentControl, ContentControlRegionAdapter>();\n#if UNO_WINUI\n            regionAdapterMappings.RegisterMapping<NavigationView, NavigationViewRegionAdapter>();\n#endif\n        }\n\n        internal static void RunModuleManager(IContainerProvider containerProvider)\n        {\n            IModuleManager manager = containerProvider.Resolve<IModuleManager>();\n            manager.Run();\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Properties/AssemblyInfo.cs",
    "content": "using System.Runtime.InteropServices;\nusing System.Windows.Markup;\n\n[assembly: ComVisible(false)]\n\n[assembly: CLSCompliant(true)]\n\n[assembly: XmlnsDefinition(\"http://prismlibrary.com/\", \"Prism.Navigation.Regions\")]\n[assembly: XmlnsDefinition(\"http://prismlibrary.com/\", \"Prism.Navigation.Regions.Behaviors\")]\n[assembly: XmlnsDefinition(\"http://prismlibrary.com/\", \"Prism.Mvvm\")]\n[assembly: XmlnsDefinition(\"http://prismlibrary.com/\", \"Prism.Interactivity\")]\n[assembly: XmlnsDefinition(\"http://prismlibrary.com/\", \"Prism.Dialogs\")]\n[assembly: XmlnsDefinition(\"http://prismlibrary.com/\", \"Prism.Ioc\")]\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Properties/Resources.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.42000\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace Prism.Properties {\n    using System;\n    \n    \n    /// <summary>\n    ///   A strongly-typed resource class, for looking up localized strings, etc.\n    /// </summary>\n    // This class was auto-generated by the StronglyTypedResourceBuilder\n    // class via a tool like ResGen or Visual Studio.\n    // To add or remove a member, edit your .ResX file then rerun ResGen\n    // with the /str option, or rebuild your VS project.\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"15.0.0.0\")]\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    internal class Resources {\n        \n        private static global::System.Resources.ResourceManager resourceMan;\n        \n        private static global::System.Globalization.CultureInfo resourceCulture;\n        \n        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        internal Resources() {\n        }\n        \n        /// <summary>\n        ///   Returns the cached ResourceManager instance used by this class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Resources.ResourceManager ResourceManager {\n            get {\n                if (object.ReferenceEquals(resourceMan, null)) {\n                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"Prism.Properties.Resources\", typeof(Resources).Assembly);\n                    resourceMan = temp;\n                }\n                return resourceMan;\n            }\n        }\n        \n        /// <summary>\n        ///   Overrides the current thread's CurrentUICulture property for all\n        ///   resource lookups using this strongly typed resource class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Globalization.CultureInfo Culture {\n            get {\n                return resourceCulture;\n            }\n            set {\n                resourceCulture = value;\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The object must be of type &apos;{0}&apos; in order to use the current region adapter..\n        /// </summary>\n        internal static string AdapterInvalidTypeException {\n            get {\n                return ResourceManager.GetString(\"AdapterInvalidTypeException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Cannot change the region name once is set. The current region name is &apos;{0}&apos;..\n        /// </summary>\n        internal static string CannotChangeRegionNameException {\n            get {\n                return ResourceManager.GetString(\"CannotChangeRegionNameException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Cannot create navigation target &apos;{0}&apos;..\n        /// </summary>\n        internal static string CannotCreateNavigationTarget {\n            get {\n                return ResourceManager.GetString(\"CannotCreateNavigationTarget\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Type &apos;{0}&apos; does not implement from IRegionBehavior..\n        /// </summary>\n        internal static string CanOnlyAddTypesThatInheritIFromRegionBehavior {\n            get {\n                return ResourceManager.GetString(\"CanOnlyAddTypesThatInheritIFromRegionBehavior\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The ConfigurationStore cannot contain a null value. .\n        /// </summary>\n        internal static string ConfigurationStoreCannotBeNull {\n            get {\n                return ResourceManager.GetString(\"ConfigurationStoreCannotBeNull\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to ContentControl&apos;s Content property is not empty. \n        ///    This control is being associated with a region, but the control is already bound to something else. \n        ///    If you did not explicitly set the control&apos;s Content property, \n        ///    this exception may be caused by a change in the value of the inherited RegionManager attached property..\n        /// </summary>\n        internal static string ContentControlHasContentException {\n            get {\n                return ResourceManager.GetString(\"ContentControlHasContentException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Deactivation is not possible in this type of region..\n        /// </summary>\n        internal static string DeactiveNotPossibleException {\n            get {\n                return ResourceManager.GetString(\"DeactiveNotPossibleException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to {1}: {2}. Priority: {3}. Timestamp:{0:u}..\n        /// </summary>\n        internal static string DefaultTextLoggerPattern {\n            get {\n                return ResourceManager.GetString(\"DefaultTextLoggerPattern\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Neither the executeMethod nor the canExecuteMethod delegates can be null..\n        /// </summary>\n        internal static string DelegateCommandDelegatesCannotBeNull {\n            get {\n                return ResourceManager.GetString(\"DelegateCommandDelegatesCannotBeNull\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to T for DelegateCommand&lt;T&gt; is not an object nor Nullable..\n        /// </summary>\n        internal static string DelegateCommandInvalidGenericPayloadType {\n            get {\n                return ResourceManager.GetString(\"DelegateCommandInvalidGenericPayloadType\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Directory {0} was not found..\n        /// </summary>\n        internal static string DirectoryNotFound {\n            get {\n                return ResourceManager.GetString(\"DirectoryNotFound\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to A duplicated module group with name {0} has been found by the loader..\n        /// </summary>\n        internal static string DuplicatedModuleGroup {\n            get {\n                return ResourceManager.GetString(\"DuplicatedModuleGroup\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Unable to retrieve the module type {0} from the loaded assemblies.  You may need to specify a more fully-qualified type name..\n        /// </summary>\n        internal static string FailedToGetType {\n            get {\n                return ResourceManager.GetString(\"FailedToGetType\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to HostControl cannot have null value when behavior attaches. .\n        /// </summary>\n        internal static string HostControlCannotBeNull {\n            get {\n                return ResourceManager.GetString(\"HostControlCannotBeNull\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The HostControl property cannot be set after Attach method has been called..\n        /// </summary>\n        internal static string HostControlCannotBeSetAfterAttach {\n            get {\n                return ResourceManager.GetString(\"HostControlCannotBeSetAfterAttach\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to HostControl type must be a TabControl..\n        /// </summary>\n        internal static string HostControlMustBeATabControl {\n            get {\n                return ResourceManager.GetString(\"HostControlMustBeATabControl\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The IModuleEnumerator interface is no longer used and has been replaced by ModuleCatalog..\n        /// </summary>\n        internal static string IEnumeratorObsolete {\n            get {\n                return ResourceManager.GetString(\"IEnumeratorObsolete\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The argument must be a valid absolute Uri to an assembly file..\n        /// </summary>\n        internal static string InvalidArgumentAssemblyUri {\n            get {\n                return ResourceManager.GetString(\"InvalidArgumentAssemblyUri\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The Target of the IDelegateReference should be of type {0}..\n        /// </summary>\n        internal static string InvalidDelegateRerefenceTypeException {\n            get {\n                return ResourceManager.GetString(\"InvalidDelegateRerefenceTypeException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to ItemsControl&apos;s ItemsSource property is not empty. \n        ///    This control is being associated with a region, but the control is already bound to something else. \n        ///    If you did not explicitly set the control&apos;s ItemSource property, \n        ///    this exception may be caused by a change in the value of the inherited RegionManager attached property..\n        /// </summary>\n        internal static string ItemsControlHasItemsSourceException {\n            get {\n                return ResourceManager.GetString(\"ItemsControlHasItemsSourceException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Mapping with the given type is already registered: {0}..\n        /// </summary>\n        internal static string MappingExistsException {\n            get {\n                return ResourceManager.GetString(\"MappingExistsException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Module {0} was not found in the catalog..\n        /// </summary>\n        internal static string ModuleNotFound {\n            get {\n                return ResourceManager.GetString(\"ModuleNotFound\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The ModulePath cannot contain a null value or be empty.\n        /// </summary>\n        internal static string ModulePathCannotBeNullOrEmpty {\n            get {\n                return ResourceManager.GetString(\"ModulePathCannotBeNullOrEmpty\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Failed to load type &apos;{0}&apos; from assembly &apos;{1}&apos;..\n        /// </summary>\n        internal static string ModuleTypeNotFound {\n            get {\n                return ResourceManager.GetString(\"ModuleTypeNotFound\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The ModuleCatalog must implement IModuleGroupCatalog to add groups.\n        /// </summary>\n        internal static string MustBeModuleGroupCatalog {\n            get {\n                return ResourceManager.GetString(\"MustBeModuleGroupCatalog\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Navigation is already in progress on region with name &apos;{0}&apos;..\n        /// </summary>\n        internal static string NavigationInProgress {\n            get {\n                return ResourceManager.GetString(\"NavigationInProgress\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Navigation cannot proceed until a region is set for the RegionNavigationService..\n        /// </summary>\n        internal static string NavigationServiceHasNoRegion {\n            get {\n                return ResourceManager.GetString(\"NavigationServiceHasNoRegion\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The IRegionAdapter for the type {0} is not registered in the region adapter mappings. You can register an IRegionAdapter for this control by overriding the ConfigureRegionAdapterMappings method in the bootstrapper..\n        /// </summary>\n        internal static string NoRegionAdapterException {\n            get {\n                return ResourceManager.GetString(\"NoRegionAdapterException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to There is currently no moduleTypeLoader in the ModuleManager that can retrieve the specified module..\n        /// </summary>\n        internal static string NoRetrieverCanRetrieveModule {\n            get {\n                return ResourceManager.GetString(\"NoRetrieverCanRetrieveModule\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to An exception has occurred while trying to add a view to region &apos;{0}&apos;. \n        ///    - The most likely causing exception was was: &apos;{1}&apos;.\n        ///    But also check the InnerExceptions for more detail or call .GetRootException(). .\n        /// </summary>\n        internal static string OnViewRegisteredException {\n            get {\n                return ResourceManager.GetString(\"OnViewRegisteredException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The member access expression does not access a property..\n        /// </summary>\n        internal static string PropertySupport_ExpressionNotProperty_Exception {\n            get {\n                return ResourceManager.GetString(\"PropertySupport_ExpressionNotProperty_Exception\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The expression is not a member access expression..\n        /// </summary>\n        internal static string PropertySupport_NotMemberAccessExpression_Exception {\n            get {\n                return ResourceManager.GetString(\"PropertySupport_NotMemberAccessExpression_Exception\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The referenced property is a static property..\n        /// </summary>\n        internal static string PropertySupport_StaticExpression_Exception {\n            get {\n                return ResourceManager.GetString(\"PropertySupport_StaticExpression_Exception\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The Attach method cannot be called when Region property is null..\n        /// </summary>\n        internal static string RegionBehaviorAttachCannotBeCallWithNullRegion {\n            get {\n                return ResourceManager.GetString(\"RegionBehaviorAttachCannotBeCallWithNullRegion\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The Region property cannot be set after Attach method has been called..\n        /// </summary>\n        internal static string RegionBehaviorRegionCannotBeSetAfterAttach {\n            get {\n                return ResourceManager.GetString(\"RegionBehaviorRegionCannotBeSetAfterAttach\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to An exception occurred while creating a region with name &apos;{0}&apos;. The exception was: {1}. .\n        /// </summary>\n        internal static string RegionCreationException {\n            get {\n                return ResourceManager.GetString(\"RegionCreationException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The region being added already has a name of &apos;{0}&apos; and cannot be added to the region manager with a different name (&apos;{1}&apos;)..\n        /// </summary>\n        internal static string RegionManagerWithDifferentNameException {\n            get {\n                return ResourceManager.GetString(\"RegionManagerWithDifferentNameException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The region name cannot be null or empty..\n        /// </summary>\n        internal static string RegionNameCannotBeEmptyException {\n            get {\n                return ResourceManager.GetString(\"RegionNameCannotBeEmptyException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Region with the given name is already registered: {0}.\n        /// </summary>\n        internal static string RegionNameExistsException {\n            get {\n                return ResourceManager.GetString(\"RegionNameExistsException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to This RegionManager does not contain a Region with the name &apos;{0}&apos;..\n        /// </summary>\n        internal static string RegionNotFound {\n            get {\n                return ResourceManager.GetString(\"RegionNotFound\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The region manager does not contain the {0} region..\n        /// </summary>\n        internal static string RegionNotInRegionManagerException {\n            get {\n                return ResourceManager.GetString(\"RegionNotInRegionManagerException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to View already exists in region..\n        /// </summary>\n        internal static string RegionViewExistsException {\n            get {\n                return ResourceManager.GetString(\"RegionViewExistsException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to View with name &apos;{0}&apos; already exists in the region..\n        /// </summary>\n        internal static string RegionViewNameExistsException {\n            get {\n                return ResourceManager.GetString(\"RegionViewNameExistsException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The provided String argument {0} must not be null or empty..\n        /// </summary>\n        internal static string StringCannotBeNullOrEmpty {\n            get {\n                return ResourceManager.GetString(\"StringCannotBeNullOrEmpty\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The provided String argument {0} must not be null or empty..\n        /// </summary>\n        internal static string StringCannotBeNullOrEmpty1 {\n            get {\n                return ResourceManager.GetString(\"StringCannotBeNullOrEmpty1\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to No BehaviorType with key &apos;{0}&apos; was registered..\n        /// </summary>\n        internal static string TypeWithKeyNotRegistered {\n            get {\n                return ResourceManager.GetString(\"TypeWithKeyNotRegistered\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to An exception occurred while trying to create region objects. \n        ///    - The most likely causing exception was: &apos;{0}&apos;.\n        ///    But also check the InnerExceptions for more detail or call .GetRootException(). .\n        /// </summary>\n        internal static string UpdateRegionException {\n            get {\n                return ResourceManager.GetString(\"UpdateRegionException\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The value must be of type ModuleInfo..\n        /// </summary>\n        internal static string ValueMustBeOfTypeModuleInfo {\n            get {\n                return ResourceManager.GetString(\"ValueMustBeOfTypeModuleInfo\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to {0} not found..\n        /// </summary>\n        internal static string ValueNotFound {\n            get {\n                return ResourceManager.GetString(\"ValueNotFound\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to The region does not contain the specified view..\n        /// </summary>\n        internal static string ViewNotInRegionException {\n            get {\n                return ResourceManager.GetString(\"ViewNotInRegionException\", resourceCulture);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Properties/Resources.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <data name=\"AdapterInvalidTypeException\" xml:space=\"preserve\">\n    <value>The object must be of type '{0}' in order to use the current region adapter.</value>\n  </data>\n  <data name=\"CannotChangeRegionNameException\" xml:space=\"preserve\">\n    <value>Cannot change the region name once is set. The current region name is '{0}'.</value>\n  </data>\n  <data name=\"CannotCreateNavigationTarget\" xml:space=\"preserve\">\n    <value>Cannot create navigation target '{0}'.</value>\n  </data>\n  <data name=\"ConfigurationStoreCannotBeNull\" xml:space=\"preserve\">\n    <value>The ConfigurationStore cannot contain a null value. </value>\n  </data>\n  <data name=\"ContentControlHasContentException\" xml:space=\"preserve\">\n    <value>ContentControl's Content property is not empty. \n    This control is being associated with a region, but the control is already bound to something else. \n    If you did not explicitly set the control's Content property, \n    this exception may be caused by a change in the value of the inherited RegionManager attached property.</value>\n  </data>\n  <data name=\"DeactiveNotPossibleException\" xml:space=\"preserve\">\n    <value>Deactivation is not possible in this type of region.</value>\n  </data>\n  <data name=\"DefaultTextLoggerPattern\" xml:space=\"preserve\">\n    <value>{1}: {2}. Priority: {3}. Timestamp:{0:u}.</value>\n  </data>\n  <data name=\"DelegateCommandDelegatesCannotBeNull\" xml:space=\"preserve\">\n    <value>Neither the executeMethod nor the canExecuteMethod delegates can be null.</value>\n  </data>\n  <data name=\"DelegateCommandInvalidGenericPayloadType\" xml:space=\"preserve\">\n    <value>T for DelegateCommand&lt;T&gt; is not an object nor Nullable.</value>\n  </data>\n  <data name=\"DirectoryNotFound\" xml:space=\"preserve\">\n    <value>Directory {0} was not found.</value>\n  </data>\n  <data name=\"DuplicatedModuleGroup\" xml:space=\"preserve\">\n    <value>A duplicated module group with name {0} has been found by the loader.</value>\n  </data>\n  <data name=\"FailedToGetType\" xml:space=\"preserve\">\n    <value>Unable to retrieve the module type {0} from the loaded assemblies.  You may need to specify a more fully-qualified type name.</value>\n  </data>\n  <data name=\"HostControlCannotBeNull\" xml:space=\"preserve\">\n    <value>HostControl cannot have null value when behavior attaches. </value>\n  </data>\n  <data name=\"HostControlCannotBeSetAfterAttach\" xml:space=\"preserve\">\n    <value>The HostControl property cannot be set after Attach method has been called.</value>\n  </data>\n  <data name=\"HostControlMustBeATabControl\" xml:space=\"preserve\">\n    <value>HostControl type must be a TabControl.</value>\n  </data>\n  <data name=\"IEnumeratorObsolete\" xml:space=\"preserve\">\n    <value>The IModuleEnumerator interface is no longer used and has been replaced by ModuleCatalog.</value>\n  </data>\n  <data name=\"InvalidArgumentAssemblyUri\" xml:space=\"preserve\">\n    <value>The argument must be a valid absolute Uri to an assembly file.</value>\n  </data>\n  <data name=\"InvalidDelegateRerefenceTypeException\" xml:space=\"preserve\">\n    <value>The Target of the IDelegateReference should be of type {0}.</value>\n  </data>\n  <data name=\"ItemsControlHasItemsSourceException\" xml:space=\"preserve\">\n    <value>ItemsControl's ItemsSource property is not empty. \n    This control is being associated with a region, but the control is already bound to something else. \n    If you did not explicitly set the control's ItemSource property, \n    this exception may be caused by a change in the value of the inherited RegionManager attached property.</value>\n  </data>\n  <data name=\"MappingExistsException\" xml:space=\"preserve\">\n    <value>Mapping with the given type is already registered: {0}.</value>\n  </data>\n  <data name=\"ModuleNotFound\" xml:space=\"preserve\">\n    <value>Module {0} was not found in the catalog.</value>\n  </data>\n  <data name=\"ModulePathCannotBeNullOrEmpty\" xml:space=\"preserve\">\n    <value>The ModulePath cannot contain a null value or be empty</value>\n  </data>\n  <data name=\"ModuleTypeNotFound\" xml:space=\"preserve\">\n    <value>Failed to load type '{0}' from assembly '{1}'.</value>\n  </data>\n  <data name=\"NavigationInProgress\" xml:space=\"preserve\">\n    <value>Navigation is already in progress on region with name '{0}'.</value>\n  </data>\n  <data name=\"NavigationServiceHasNoRegion\" xml:space=\"preserve\">\n    <value>Navigation cannot proceed until a region is set for the RegionNavigationService.</value>\n  </data>\n  <data name=\"NoRegionAdapterException\" xml:space=\"preserve\">\n    <value>The IRegionAdapter for the type {0} is not registered in the region adapter mappings. You can register an IRegionAdapter for this control by overriding the ConfigureRegionAdapterMappings method in the bootstrapper.</value>\n  </data>\n  <data name=\"NoRetrieverCanRetrieveModule\" xml:space=\"preserve\">\n    <value>There is currently no moduleTypeLoader in the ModuleManager that can retrieve the specified module.</value>\n  </data>\n  <data name=\"OnViewRegisteredException\" xml:space=\"preserve\">\n    <value>An exception has occurred while trying to add a view to region '{0}'. \n    - The most likely causing exception was was: '{1}'.\n    But also check the InnerExceptions for more detail or call .GetRootException(). </value>\n  </data>\n  <data name=\"PropertySupport_ExpressionNotProperty_Exception\" xml:space=\"preserve\">\n    <value>The member access expression does not access a property.</value>\n  </data>\n  <data name=\"PropertySupport_NotMemberAccessExpression_Exception\" xml:space=\"preserve\">\n    <value>The expression is not a member access expression.</value>\n  </data>\n  <data name=\"PropertySupport_StaticExpression_Exception\" xml:space=\"preserve\">\n    <value>The referenced property is a static property.</value>\n  </data>\n  <data name=\"RegionCreationException\" xml:space=\"preserve\">\n    <value>An exception occurred while creating a region with name '{0}'. The exception was: {1}. </value>\n  </data>\n  <data name=\"RegionManagerWithDifferentNameException\" xml:space=\"preserve\">\n    <value>The region being added already has a name of '{0}' and cannot be added to the region manager with a different name ('{1}').</value>\n  </data>\n  <data name=\"RegionNameCannotBeEmptyException\" xml:space=\"preserve\">\n    <value>The region name cannot be null or empty.</value>\n  </data>\n  <data name=\"RegionNameExistsException\" xml:space=\"preserve\">\n    <value>Region with the given name is already registered: {0}</value>\n  </data>\n  <data name=\"RegionNotFound\" xml:space=\"preserve\">\n    <value>This RegionManager does not contain a Region with the name '{0}'.</value>\n  </data>\n  <data name=\"RegionNotInRegionManagerException\" xml:space=\"preserve\">\n    <value>The region manager does not contain the {0} region.</value>\n  </data>\n  <data name=\"RegionViewExistsException\" xml:space=\"preserve\">\n    <value>View already exists in region.</value>\n  </data>\n  <data name=\"RegionViewNameExistsException\" xml:space=\"preserve\">\n    <value>View with name '{0}' already exists in the region.</value>\n  </data>\n  <data name=\"StringCannotBeNullOrEmpty\" xml:space=\"preserve\">\n    <value>The provided String argument {0} must not be null or empty.</value>\n  </data>\n  <data name=\"StringCannotBeNullOrEmpty1\" xml:space=\"preserve\">\n    <value>The provided String argument {0} must not be null or empty.</value>\n  </data>\n  <data name=\"UpdateRegionException\" xml:space=\"preserve\">\n    <value>An exception occurred while trying to create region objects. \n    - The most likely causing exception was: '{0}'.\n    But also check the InnerExceptions for more detail or call .GetRootException(). </value>\n  </data>\n  <data name=\"ValueMustBeOfTypeModuleInfo\" xml:space=\"preserve\">\n    <value>The value must be of type ModuleInfo.</value>\n  </data>\n  <data name=\"ValueNotFound\" xml:space=\"preserve\">\n    <value>{0} not found.</value>\n  </data>\n  <data name=\"ViewNotInRegionException\" xml:space=\"preserve\">\n    <value>The region does not contain the specified view.</value>\n  </data>\n  <data name=\"MustBeModuleGroupCatalog\" xml:space=\"preserve\">\n    <value>The ModuleCatalog must implement IModuleGroupCatalog to add groups</value>\n  </data>\n</root>"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Properties/Settings.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.42000\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace Prism.Properties {\n    \n    \n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator\", \"15.8.0.0\")]\n    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {\n        \n        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));\n        \n        public static Settings Default {\n            get {\n                return defaultInstance;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Wpf/Prism.Wpf/Properties/Settings.settings",
    "content": "﻿<?xml version='1.0' encoding='utf-8'?>\n<SettingsFile xmlns=\"uri:settings\" CurrentProfile=\"(Default)\">\n  <Profiles>\n    <Profile Name=\"(Default)\" />\n  </Profiles>\n  <Settings />\n</SettingsFile>"
  },
  {
    "path": "src/winappsdk-workaround.targets",
    "content": "<Project>\n\t<!-- Workaround to avoid including Uno.Toolkit.UI XBFs in the PRI file -->\n\t<Target Name=\"AdjustGetPackagingOutput1\" AfterTargets=\"GetMrtPackagingOutputs\">\n\t\t<Message Importance=\"high\" Text=\"Applying NuGet packaging workaround for dependent PRI files exclusion\" />\n\t\t<ItemGroup>\n\t\t\t<_OtherPriFiles Include=\"@(PackagingOutputs)\" Condition=\"'%(Extension)' == '.pri' and ('%(PackagingOutputs.ReferenceSourceTarget)' == 'ProjectReference' or '%(PackagingOutputs.NugetSourceType)'=='Package')\" />\n\t\t\t<PackagingOutputs Remove=\"@(_OtherPriFiles)\" />\n\t\t</ItemGroup>\n\t</Target>\n\n\t<Target Name=\"AdjustGetPackagingOutput2\" BeforeTargets=\"AddPriPayloadFilesToCopyToOutputDirectoryItems\">\n\t\t<Message Importance=\"high\" Text=\"Applying NuGet packaging workaround for dependent PRI files exclusion\" />\n\t\t<ItemGroup>\n\t\t\t<_OtherPriFiles1 Include=\"@(_ReferenceRelatedPaths)\" Condition=\"'%(Extension)' == '.pri' and ('%(_ReferenceRelatedPaths.ReferenceSourceTarget)' == 'ProjectReference' or '%(_ReferenceRelatedPaths.NugetSourceType)'=='Package')\" />\n\t\t\t<_ReferenceRelatedPaths Remove=\"@(_OtherPriFiles1)\" />\n\n\t\t\t<_OtherPriFiles2 Include=\"@(ReferenceCopyLocalPaths)\" Condition=\"'%(Extension)' == '.pri' and ('%(ReferenceCopyLocalPaths.ReferenceSourceTarget)' == 'ProjectReference' or '%(ReferenceCopyLocalPaths.NugetSourceType)'=='Package')\" />\n\t\t\t<ReferenceCopyLocalPaths Remove=\"@(_OtherPriFiles2)\" />\n\t\t</ItemGroup>\n\t</Target>\n</Project>\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/CollectionChangedTracker.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Collections.Specialized;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Prism.Avalonia.Tests\n{\n    public class CollectionChangedTracker\n    {\n        private readonly List<NotifyCollectionChangedEventArgs> eventList = new List<NotifyCollectionChangedEventArgs>();\n\n        public CollectionChangedTracker(INotifyCollectionChanged collection)\n        {\n            collection.CollectionChanged += OnCollectionChanged;\n        }\n\n        public IEnumerable<NotifyCollectionChangedAction> ActionsFired { get { return this.eventList.Select(e => e.Action); } }\n        public IEnumerable<NotifyCollectionChangedEventArgs> NotifyEvents { get { return this.eventList; } }\n\n        private void OnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)\n        {\n            this.eventList.Add(e);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/CollectionExtensionsFixture.cs",
    "content": "using System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing Xunit;\n\nnamespace Prism.Avalonia.Tests\n{\n\n    public class CollectionExtensionsFixture\n    {\n        [Fact]\n        public void CanAddRangeToCollection()\n        {\n            Collection<object> col = new Collection<object>();\n            List<object> itemsToAdd = new List<object> { \"1\", \"2\" };\n\n            col.AddRange(itemsToAdd);\n\n            Assert.Equal(2, col.Count);\n            Assert.Equal(\"1\", col[0]);\n            Assert.Equal(\"2\", col[1]);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/CompilerHelper.Desktop.cs",
    "content": "﻿using System;\nusing System.CodeDom.Compiler;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Reflection;\nusing System.Text;\nusing Microsoft.CSharp;\nusing Prism.Ioc;\nusing Prism.Modularity;\nusing Xunit;\n\nnamespace Prism.Avalonia.Tests\n{\n    // Warning:\n    //  CompileCode() method is not supported by .NET 6\n    //  DotNet Runtime Issue 18768 - https://github.com/dotnet/runtime/issues/18768#issuecomment-265381303\n    // Workaround: Upgrade to RosylnCompiler (https://github.com/npolyak/RoslynAssembly)\n    public class CompilerHelper\n    {\n        private static string moduleTemplate =\n            @\"using System;\n            using Prism.Ioc;\n            using Prism.Modularity;\n            namespace TestModules\n            {\n                #module#\n\t            public class #className#Class : IModule\n\t            {\n                    public void OnInitialized(IContainerProvider containerProvider)\n                    {\n                        Console.WriteLine(\"\"#className#.Start\"\");\n                    }\n                    public void RegisterTypes(IContainerRegistry containerRegistry)\n                    {\n                        \n                    }\n                }\n            }\";\n\n        public static Assembly CompileFileAndLoadAssembly(string input, string output, params string[] references)\n        {\n            return CompileFile(input, output, references).CompiledAssembly;\n        }\n\n        public static CompilerResults CompileFile(string input, string output, params string[] references)\n        {\n            CreateOutput(output);\n\n            List<string> referencedAssemblies = new List<string>(references.Length + 3);\n\n            referencedAssemblies.AddRange(references);\n            referencedAssemblies.Add(\"System.dll\");\n            referencedAssemblies.Add(typeof(IContainerRegistry).Assembly.CodeBase.Replace(@\"file:///\", \"\"));\n            referencedAssemblies.Add(typeof(IModule).Assembly.CodeBase.Replace(@\"file:///\", \"\"));\n            referencedAssemblies.Add(typeof(ModuleAttribute).Assembly.CodeBase.Replace(@\"file:///\", \"\"));\n\n            CSharpCodeProvider codeProvider = new CSharpCodeProvider();\n            CompilerParameters cp = new CompilerParameters(referencedAssemblies.ToArray(), output);\n\n            using var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(input);\n\n            if (stream == null)\n            {\n                throw new ArgumentException(\"input\");\n            }\n\n            StreamReader reader = new StreamReader(stream);\n            string source = reader.ReadToEnd();\n            CompilerResults results = codeProvider.CompileAssemblyFromSource(cp, source);\n            ThrowIfCompilerError(results);\n            return results;\n        }\n\n        public static void CreateOutput(string output)\n        {\n            string dir = Path.GetDirectoryName(output);\n            if (!Directory.Exists(dir))\n            {\n                Directory.CreateDirectory(dir);\n            }\n            else\n            {\n                //Delete the file if exists\n                if (File.Exists(output))\n                {\n                    try\n                    {\n                        File.Delete(output);\n                    }\n                    catch (UnauthorizedAccessException)\n                    {\n                        //The file might be locked by Visual Studio, so rename it\n                        if (File.Exists(output + \".locked\"))\n                            File.Delete(output + \".locked\");\n                        File.Move(output, output + \".locked\");\n                    }\n                }\n            }\n        }\n\n        public static CompilerResults CompileCode(string code, string output)\n        {\n            CreateOutput(output);\n            List<string> referencedAssemblies = new List<string>();\n            referencedAssemblies.Add(\"System.dll\");\n            referencedAssemblies.Add(typeof(IContainerExtension).Assembly.CodeBase.Replace(@\"file:///\", \"\"));\n            referencedAssemblies.Add(typeof(IModule).Assembly.CodeBase.Replace(@\"file:///\", \"\"));\n            referencedAssemblies.Add(typeof(ModuleAttribute).Assembly.CodeBase.Replace(@\"file:///\", \"\"));\n\n            CompilerResults results = new CSharpCodeProvider().CompileAssemblyFromSource(\n                new CompilerParameters(referencedAssemblies.ToArray(), output), code);\n\n            ThrowIfCompilerError(results);\n\n            return results;\n        }\n\n        public static string GenerateDynamicModule(string assemblyName, string moduleName, string outpath, params string[] dependencies)\n        {\n            CreateOutput(outpath);\n\n            // Create temporary module.\n            string moduleCode = moduleTemplate.Replace(\"#className#\", assemblyName);\n            if (!string.IsNullOrEmpty(moduleName))\n            {\n                moduleCode = moduleCode.Replace(\"#module#\", String.Format(\"[Module(ModuleName = \\\"{0}\\\") #dependencies#]\", moduleName));\n            }\n            else\n            {\n                moduleCode = moduleCode.Replace(\"#module#\", \"\");\n            }\n\n            string depString = string.Empty;\n\n            foreach (string module in dependencies)\n            {\n                depString += String.Format(\", ModuleDependency(\\\"{0}\\\")\", module);\n            }\n\n            moduleCode = moduleCode.Replace(\"#dependencies#\", depString);\n\n            CompileCode(moduleCode, outpath);\n\n            return outpath;\n        }\n\n        public static string GenerateDynamicModule(string assemblyName, string moduleName, params string[] dependencies)\n        {\n            string assemblyFile = assemblyName + \".dll\";\n            string outpath = Path.Combine(assemblyName, assemblyFile);\n\n            return GenerateDynamicModule(assemblyName, moduleName, outpath, dependencies);\n        }\n\n        public static void ThrowIfCompilerError(CompilerResults results)\n        {\n            if (results.Errors.HasErrors)\n            {\n                StringBuilder sb = new StringBuilder();\n                sb.AppendLine(\"Compilation failed.\");\n                foreach (CompilerError error in results.Errors)\n                {\n                    sb.AppendLine(error.ToString());\n                }\n\n                Assert.False(results.Errors.HasErrors, sb.ToString());\n            }\n        }\n\n        public static void CleanUpDirectory(string path)\n        {\n            if (!Directory.Exists(path))\n            {\n                Directory.CreateDirectory(path);\n            }\n            else\n            {\n                foreach (string file in Directory.GetFiles(path))\n                {\n                    try\n                    {\n                        File.Delete(file);\n                    }\n                    catch (UnauthorizedAccessException)\n                    {\n                        //The file might be locked by Visual Studio, so rename it\n                        if (File.Exists(file + \".locked\"))\n                            File.Delete(file + \".locked\");\n                        File.Move(file, file + \".locked\");\n                    }\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/ExceptionAssert.cs",
    "content": "using System;\nusing Xunit;\n\nnamespace Prism.Avalonia.Tests\n{\n    public static class ExceptionAssert\n    {\n        public static void Throws<TException>(Action action)\n            where TException : Exception\n        {\n            Throws(typeof(TException), action);\n        }\n\n        public static void Throws(Type expectedExceptionType, Action action)\n        {\n            try\n            {\n                action();\n            }\n            catch (Exception ex)\n            {\n                Assert.IsType(expectedExceptionType, ex);\n                return;\n            }\n\n            //Assert.Fail(\"No exception thrown.  Expected exception type of {0}.\", expectedExceptionType.Name);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Interactivity/CommandBehaviorBaseFixture.cs",
    "content": "using System;\nusing System.Windows.Input;\nusing Avalonia.Controls;\nusing Prism.Interactivity;\nusing Xunit;\n\nnamespace Prism.Avalonia.Tests.Interactivity\n{\n\n    public class CommandBehaviorBaseFixture\n    {\n        [Fact]\n        public void ExecuteUsesCommandParameterWhenSet()\n        {\n            var targetUIElement = new Control();\n            var target = new TestableCommandBehaviorBase(targetUIElement);\n            target.CommandParameter = \"123\";\n            TestCommand testCommand = new TestCommand();\n            target.Command = testCommand;\n\n            target.ExecuteCommand(\"testparam\");\n\n            Assert.Equal(\"123\", testCommand.ExecuteCalledWithParameter);\n        }\n\n        [Fact]\n        public void ExecuteUsesParameterWhenCommandParameterNotSet()\n        {\n            var targetUIElement = new Control();\n            var target = new TestableCommandBehaviorBase(targetUIElement);\n            TestCommand testCommand = new TestCommand();\n            target.Command = testCommand;\n\n            target.ExecuteCommand(\"testparam\");\n\n            Assert.Equal(\"testparam\", testCommand.ExecuteCalledWithParameter);\n        }\n\n        [Fact]\n        public void CommandBehaviorBaseAllowsDisableByDefault()\n        {\n            var targetUIElement = new Control();\n            var target = new TestableCommandBehaviorBase(targetUIElement);\n\n            Assert.True(target.AutoEnable);\n        }\n\n        [StaFact]\n        public void CommandBehaviorBaseEnablesUIElement()\n        {\n            var targetUIElement = new Control();\n            targetUIElement.IsEnabled = false;\n\n            var target = new TestableCommandBehaviorBase(targetUIElement);\n            TestCommand testCommand = new TestCommand();\n            target.Command = testCommand;\n            target.ExecuteCommand(null);\n\n            Assert.True(targetUIElement.IsEnabled);\n        }\n\n        [StaFact]\n        public void CommandBehaviorBaseDisablesUIElement()\n        {\n            var targetUIElement = new Control();\n            targetUIElement.IsEnabled = true;\n\n            var target = new TestableCommandBehaviorBase(targetUIElement);\n            TestCommand testCommand = new TestCommand();\n            testCommand.CanExecuteResult = false;\n            target.Command = testCommand;\n            target.ExecuteCommand(null);\n\n            Assert.False(targetUIElement.IsEnabled);\n        }\n\n        [StaFact]\n        public void WhenAutoEnableIsFalse_ThenDisabledUIElementRemainsDisabled()\n        {\n            var targetUIElement = new Control();\n            targetUIElement.IsEnabled = false;\n\n            var target = new TestableCommandBehaviorBase(targetUIElement);\n            target.AutoEnable = false;\n            TestCommand testCommand = new TestCommand();\n            target.Command = testCommand;\n            target.ExecuteCommand(null);\n\n            Assert.False(targetUIElement.IsEnabled);\n        }\n\n        [StaFact]\n        public void WhenAutoEnableIsUpdated_ThenDisabledUIElementIsEnabled()\n        {\n            var targetUIElement = new Control();\n            targetUIElement.IsEnabled = false;\n\n            var target = new TestableCommandBehaviorBase(targetUIElement);\n            target.AutoEnable = false;\n            TestCommand testCommand = new TestCommand();\n            target.Command = testCommand;\n            target.ExecuteCommand(null);\n\n            Assert.False(targetUIElement.IsEnabled);\n\n            target.AutoEnable = true;\n\n            Assert.True(targetUIElement.IsEnabled);\n        }\n\n        [StaFact]\n        public void WhenAutoEnableIsUpdated_ThenEnabledUIElementIsDisabled()\n        {\n            var targetUIElement = new Control();\n            targetUIElement.IsEnabled = true;\n\n            var target = new TestableCommandBehaviorBase(targetUIElement);\n            target.AutoEnable = false;\n            TestCommand testCommand = new TestCommand();\n            testCommand.CanExecuteResult = false;\n            target.Command = testCommand;\n            target.ExecuteCommand(null);\n\n            Assert.True(targetUIElement.IsEnabled);\n\n            target.AutoEnable = true;\n\n            Assert.False(targetUIElement.IsEnabled);\n        }\n    }\n\n    class TestableCommandBehaviorBase : CommandBehaviorBase<Control>\n    {\n        public TestableCommandBehaviorBase(Control targetObject)\n            : base(targetObject)\n        { }\n\n        public new void ExecuteCommand(object parameter)\n        {\n            base.ExecuteCommand(parameter);\n        }\n    }\n\n    class TestCommand : ICommand\n    {\n        bool _canExecte = true;\n        public bool CanExecuteResult\n        {\n            get { return _canExecte; }\n            set { _canExecte = value; }\n        }\n\n        public object CanExecuteCalledWithParameter { get; set; }\n\n        public bool CanExecute(object parameter)\n        {\n            CanExecuteCalledWithParameter = parameter;\n            return CanExecuteResult;\n        }\n\n        public event EventHandler CanExecuteChanged;\n\n        public object ExecuteCalledWithParameter { get; set; }\n        public void Execute(object parameter)\n        {\n            ExecuteCalledWithParameter = parameter;\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Interactivity/InvokeCommandActionFixture.cs",
    "content": "using System;\nusing System.Windows.Input;\nusing Avalonia;\nusing Avalonia.Controls;\nusing Prism.Avalonia.Tests.Mocks;\nusing Xunit;\n\nnamespace Prism.Avalonia.Tests.Interactivity\n{\n    // Override Prism.Interactivity.InvokeCommandAction until it can be implemented.\n    //// Reference:\n    //// https://github.com/wieslawsoltes/AvaloniaBehaviors/blob/master/src/Avalonia.Xaml.Interactions/Core/InvokeCommandAction.cs\n    public class InvokeCommandAction : AvaloniaObject\n    {\n        /// <summary>\n        /// Dependency property identifying if the associated element should automatically be enabled or disabled based on the result of the Command's CanExecute\n        /// </summary>\n        public static readonly StyledProperty<bool> AutoEnableProperty =\n            AvaloniaProperty.Register<InvokeCommandAction, bool>(nameof(AutoEnable));\n\n        /// <summary>Identifies the <seealso cref=\"Command\"/> avalonia property.</summary>\n        public static readonly StyledProperty<ICommand?> CommandProperty =\n            AvaloniaProperty.Register<InvokeCommandAction, ICommand?>(nameof(Command));\n\n        /// <summary>Identifies the <seealso cref=\"CommandParameter\"/> avalonia property.</summary>\n        public static readonly StyledProperty<object?> CommandParameterProperty =\n            AvaloniaProperty.Register<InvokeCommandAction, object?>(nameof(CommandParameter));\n\n        /// <summary>\n        /// Dependency property identifying the TriggerParameterPath to be parsed to identify the child property of the trigger parameter to be used as the command parameter.\n        /// </summary>\n        public static readonly StyledProperty<string> TriggerParameterPathProperty =\n            AvaloniaProperty.Register<InvokeCommandAction, string>(nameof(TriggerParameterPath));\n\n        /// <summary>\n        /// Gets or sets whether or not the associated element will automatically be enabled or disabled based on the result of the commands CanExecute\n        /// </summary>\n        public bool AutoEnable\n        {\n            get { return (bool)GetValue(AutoEnableProperty); }\n            set { SetValue(AutoEnableProperty, value); }\n        }\n\n        public ICommand? Command { get; set; }\n\n        public object? CommandParameter\n        {\n            get => GetValue(CommandParameterProperty);\n            set => SetValue(CommandParameterProperty, value);\n        }\n\n        public string TriggerParameterPath\n        {\n            get => GetValue(TriggerParameterPathProperty) as string;\n            set => SetValue(TriggerParameterPathProperty, value);\n        }\n\n        public void Attach(Control? ctrl)\n        { }\n\n        public void Detach()\n        { }\n\n        public void InvokeAction(object? action)\n        { }\n    }\n\n    public class InvokeCommandActionFixture\n    {\n        [StaFact(Skip = \"InvokeCommandAction is not implmented.\")]\n        public void WhenCommandPropertyIsSet_ThenHooksUpCommandBehavior()\n        {\n            var someControl = new TextBox();\n            var commandAction = new InvokeCommandAction();\n            var command = new MockCommand();\n            commandAction.Attach(someControl);\n            commandAction.Command = command;\n\n            Assert.False(command.ExecuteCalled);\n\n            commandAction.InvokeAction(null);\n\n            Assert.True(command.ExecuteCalled);\n            Assert.Same(command, commandAction.GetValue(InvokeCommandAction.CommandProperty));\n        }\n\n        [StaFact(Skip = \"InvokeCommandAction is not implmented.\")]\n        public void WhenAttachedAfterCommandPropertyIsSetAndInvoked_ThenInvokesCommand()\n        {\n            var someControl = new TextBox();\n            var commandAction = new InvokeCommandAction();\n            var command = new MockCommand();\n            commandAction.Command = command;\n            commandAction.Attach(someControl);\n\n            Assert.False(command.ExecuteCalled);\n\n            commandAction.InvokeAction(null);\n\n            Assert.True(command.ExecuteCalled);\n            Assert.Same(command, commandAction.GetValue(InvokeCommandAction.CommandProperty));\n        }\n\n        [StaFact(Skip = \"InvokeCommandAction is not implmented.\")]\n        public void WhenChangingProperty_ThenUpdatesCommand()\n        {\n            var someControl = new TextBox();\n            var oldCommand = new MockCommand();\n            var newCommand = new MockCommand();\n            var commandAction = new InvokeCommandAction();\n            commandAction.Attach(someControl);\n            commandAction.Command = oldCommand;\n            commandAction.Command = newCommand;\n            commandAction.InvokeAction(null);\n\n            Assert.True(newCommand.ExecuteCalled);\n            Assert.False(oldCommand.ExecuteCalled);\n        }\n\n        [StaFact(Skip = \"InvokeCommandAction is not implmented.\")]\n        public void WhenInvokedWithCommandParameter_ThenPassesCommandParaeterToExecute()\n        {\n            var someControl = new TextBox();\n            var command = new MockCommand();\n            var parameter = new object();\n            var commandAction = new InvokeCommandAction();\n            commandAction.Attach(someControl);\n            commandAction.Command = command;\n            commandAction.CommandParameter = parameter;\n\n            Assert.Null(command.ExecuteParameter);\n\n            commandAction.InvokeAction(null);\n\n            Assert.True(command.ExecuteCalled);\n            Assert.NotNull(command.ExecuteParameter);\n            Assert.Same(parameter, command.ExecuteParameter);\n        }\n\n        [StaFact(Skip = \"InvokeCommandAction is not implmented.\")]\n        public void WhenCommandParameterChanged_ThenUpdatesIsEnabledState()\n        {\n            var someControl = new TextBox();\n            var command = new MockCommand();\n            var parameter = new object();\n            var commandAction = new InvokeCommandAction();\n            commandAction.Attach(someControl);\n            commandAction.Command = command;\n\n            Assert.Null(command.CanExecuteParameter);\n            Assert.True(someControl.IsEnabled);\n\n            command.CanExecuteReturnValue = false;\n            commandAction.CommandParameter = parameter;\n\n            Assert.NotNull(command.CanExecuteParameter);\n            Assert.Same(parameter, command.CanExecuteParameter);\n            Assert.False(someControl.IsEnabled);\n        }\n\n        [StaFact(Skip = \"InvokeCommandAction is not implmented.\")]\n        public void WhenCanExecuteChanged_ThenUpdatesIsEnabledState()\n        {\n            var someControl = new TextBox();\n            var command = new MockCommand();\n            var parameter = new object();\n            var commandAction = new InvokeCommandAction();\n            commandAction.Attach(someControl);\n            commandAction.Command = command;\n            commandAction.CommandParameter = parameter;\n\n            Assert.True(someControl.IsEnabled);\n\n            command.CanExecuteReturnValue = false;\n            command.RaiseCanExecuteChanged();\n\n            Assert.NotNull(command.CanExecuteParameter);\n            Assert.Same(parameter, command.CanExecuteParameter);\n            Assert.False(someControl.IsEnabled);\n        }\n\n        [StaFact(Skip = \"InvokeCommandAction is not implmented.\")]\n        public void WhenDetatched_ThenSetsCommandAndCommandParameterToNull()\n        {\n            var someControl = new TextBox();\n            var command = new MockCommand();\n            var parameter = new object();\n            var commandAction = new InvokeCommandAction();\n            commandAction.Attach(someControl);\n            commandAction.Command = command;\n            commandAction.CommandParameter = parameter;\n\n            Assert.NotNull(commandAction.Command);\n            Assert.NotNull(commandAction.CommandParameter);\n\n            commandAction.Detach();\n\n            Assert.Null(commandAction.Command);\n            Assert.Null(commandAction.CommandParameter);\n        }\n\n        [StaFact(Skip = \"InvokeCommandAction is not implmented.\")]\n        public void WhenCommandIsSetAndThenBehaviorIsAttached_ThenCommandsCanExecuteIsCalledOnce()\n        {\n            var someControl = new TextBox();\n            var command = new MockCommand();\n            var commandAction = new InvokeCommandAction();\n            commandAction.Command = command;\n            commandAction.Attach(someControl);\n\n            Assert.Equal(1, command.CanExecuteTimesCalled);\n        }\n\n        [StaFact(Skip = \"InvokeCommandAction is not implmented.\")]\n        public void WhenCommandAndCommandParameterAreSetPriorToBehaviorBeingAttached_ThenCommandIsExecutedCorrectlyOnInvoke()\n        {\n            var someControl = new TextBox();\n            var command = new MockCommand();\n            var parameter = new object();\n            var commandAction = new InvokeCommandAction();\n            commandAction.Command = command;\n            commandAction.CommandParameter = parameter;\n            commandAction.Attach(someControl);\n\n            commandAction.InvokeAction(null);\n\n            Assert.True(command.ExecuteCalled);\n        }\n\n        [StaFact(Skip = \"InvokeCommandAction is not implmented.\")]\n        public void WhenCommandParameterNotSet_ThenEventArgsPassed()\n        {\n            var eventArgs = new TestEventArgs(null);\n            var someControl = new TextBox();\n            var command = new MockCommand();\n            var parameter = new object();\n            var commandAction = new InvokeCommandAction();\n            commandAction.Command = command;\n            commandAction.Attach(someControl);\n\n            commandAction.InvokeAction(eventArgs);\n\n            Assert.IsType<TestEventArgs>(command.ExecuteParameter);\n        }\n\n        [StaFact(Skip = \"InvokeCommandAction is not implmented.\")]\n        public void WhenCommandParameterNotSetAndEventArgsParameterPathSet_ThenPathedValuePassed()\n        {\n            var eventArgs = new TestEventArgs(\"testname\");\n            var someControl = new TextBox();\n            var command = new MockCommand();\n            var parameter = new object();\n            var commandAction = new InvokeCommandAction();\n            commandAction.Command = command;\n            commandAction.TriggerParameterPath = \"Thing1.Thing2.Name\";\n            commandAction.Attach(someControl);\n\n            commandAction.InvokeAction(eventArgs);\n\n            Assert.Equal(\"testname\", command.ExecuteParameter);\n        }\n\n        [StaFact(Skip = \"InvokeCommandAction is not implmented.\")]\n        public void WhenAttachedAndCanExecuteReturnsTrue_ThenDisabledUIElementIsEnabled()\n        {\n            var someControl = new TextBox();\n            someControl.IsEnabled = false;\n\n            var command = new MockCommand();\n            command.CanExecuteReturnValue = true;\n            var commandAction = new InvokeCommandAction();\n            commandAction.Command = command;\n            commandAction.Attach(someControl);\n\n            Assert.True(someControl.IsEnabled);\n        }\n\n        [StaFact(Skip = \"InvokeCommandAction is not implmented.\")]\n        public void WhenAttachedAndCanExecuteReturnsFalse_ThenEnabledUIElementIsDisabled()\n        {\n            var someControl = new TextBox();\n            someControl.IsEnabled = true;\n\n            var command = new MockCommand();\n            command.CanExecuteReturnValue = false;\n            var commandAction = new InvokeCommandAction();\n            commandAction.Command = command;\n            commandAction.Attach(someControl);\n\n            Assert.False(someControl.IsEnabled);\n        }\n\n        [StaFact(Skip = \"InvokeCommandAction is not implmented.\")]\n        public void WhenAutoEnableIsFalse_ThenDisabledUIElementRemainsDisabled()\n        {\n            var someControl = new TextBox();\n            someControl.IsEnabled = false;\n\n            var command = new MockCommand();\n            command.CanExecuteReturnValue = true;\n            var commandAction = new InvokeCommandAction();\n            commandAction.AutoEnable = false;\n            commandAction.Command = command;\n            commandAction.Attach(someControl);\n\n            Assert.False(someControl.IsEnabled);\n        }\n\n        [StaFact(Skip = \"InvokeCommandAction is not implmented.\")]\n        public void WhenAutoEnableIsFalse_ThenEnabledUIElementRemainsEnabled()\n        {\n            var someControl = new TextBox();\n            someControl.IsEnabled = true;\n\n            var command = new MockCommand();\n            command.CanExecuteReturnValue = false;\n            var commandAction = new InvokeCommandAction();\n            commandAction.AutoEnable = false;\n            commandAction.Command = command;\n            commandAction.Attach(someControl);\n\n            Assert.True(someControl.IsEnabled);\n        }\n\n        [StaFact(Skip = \"InvokeCommandAction is not implmented.\")]\n        public void WhenAutoEnableIsUpdated_ThenDisabledUIElementIsEnabled()\n        {\n            var someControl = new TextBox();\n            someControl.IsEnabled = false;\n\n            var command = new MockCommand();\n            var commandAction = new InvokeCommandAction();\n            commandAction.AutoEnable = false;\n            commandAction.Command = command;\n            commandAction.Attach(someControl);\n\n            Assert.False(someControl.IsEnabled);\n\n            commandAction.AutoEnable = true;\n\n            Assert.True(someControl.IsEnabled);\n        }\n\n        [StaFact(Skip = \"InvokeCommandAction is not implmented.\")]\n        public void WhenAutoEnableIsUpdated_ThenEnabledUIElementIsDisabled()\n        {\n            var someControl = new TextBox();\n            someControl.IsEnabled = true;\n\n            var command = new MockCommand();\n            command.CanExecuteReturnValue = false;\n            var commandAction = new InvokeCommandAction();\n            commandAction.AutoEnable = false;\n            commandAction.Command = command;\n            commandAction.Attach(someControl);\n\n            Assert.True(someControl.IsEnabled);\n\n            commandAction.AutoEnable = true;\n\n            Assert.False(someControl.IsEnabled);\n        }\n    }\n\n    internal class TestEventArgs : EventArgs\n    {\n        public TestEventArgs(string name)\n        {\n            Thing1 = new Thing1 { Thing2 = new Thing2 { Name = name } };\n        }\n\n        public Thing1 Thing1 { get; set; }\n    }\n\n    internal class Thing1\n    {\n        public Thing2 Thing2 { get; set; }\n    }\n\n    internal class Thing2\n    {\n        public string Name { get; set; }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Interactivity/ObservableBehaviorFixture.cs",
    "content": "﻿using Avalonia;\nusing Xunit;\nusing Prism.Extensions;\n\nnamespace Prism.Avalonia.Tests.Interactivity\n{\n    public class ObservableBehaviorFixture\n    {\n        [Fact]\n        public void SubscribeWorksOnIObservableWithLambda()\n        {\n            var targetUIElement = new TestAvaloniaObject();\n            targetUIElement.Test = \"123\";\n\n            Assert.Equal(\"123\", targetUIElement.OutTest);\n        }\n    }\n\n    class TestAvaloniaObject : AvaloniaObject\n    {\n        /// <summary>\n        /// The property to subscribe on.\n        /// </summary>\n        public static readonly StyledProperty<string> TestProperty =\n            AvaloniaProperty.Register<TestAvaloniaObject, string>(\"Test\");\n\n        /// <summary>\n        /// Gets or sets a value to the TestProperty.\n        /// </summary>\n        public string Test\n        {\n            get { return (string)GetValue(TestProperty); }\n            set { SetValue(TestProperty, value); }\n        }\n\n        /// <summary>\n        /// The out test property to check after TestProperty change\n        /// </summary>\n        public string OutTest { get; set; }\n\n        /// <summary>\n        /// Initializes a new instance of <see cref=\"TestAvaloniaObject\"/>.\n        /// </summary>\n#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.\n        public TestAvaloniaObject()\n#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.\n        {\n            TestProperty.Changed.Subscribe(args => OnPropertyChanged(args));\n        }\n\n        private void OnPropertyChanged(AvaloniaPropertyChangedEventArgs<string> args)\n        {\n            OutTest = args.NewValue.Value;\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/ListDictionaryFixture.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing Prism.Common;\nusing Xunit;\n\nnamespace Prism.Avalonia.Tests\n{\n    public class ListDictionaryFixture\n    {\n        static ListDictionary<string, object> list;\n\n        public ListDictionaryFixture()\n        {\n            list = new ListDictionary<string, object>();\n        }\n\n        [Fact]\n        public void AddThrowsIfKeyNull()\n        {\n            var ex = Assert.Throws<ArgumentNullException>(() =>\n            {\n                list.Add(null, new object());\n            });\n\n        }\n\n        [Fact]\n        public void AddThrowsIfValueNull()\n        {\n            var ex = Assert.Throws<ArgumentNullException>(() =>\n            {\n                list.Add(\"\", null);\n            });\n\n        }\n\n        [Fact]\n        public void CanAddValue()\n        {\n            object value1 = new object();\n            object value2 = new object();\n\n            list.Add(\"foo\", value1);\n            list.Add(\"foo\", value2);\n\n            Assert.Equal(2, list[\"foo\"].Count);\n            Assert.Same(value1, list[\"foo\"][0]);\n            Assert.Same(value2, list[\"foo\"][1]);\n        }\n\n        [Fact]\n        public void CanIndexValuesByKey()\n        {\n            list.Add(\"foo\", new object());\n            list.Add(\"foo\", new object());\n\n            Assert.Equal(2, list[\"foo\"].Count);\n        }\n\n        [Fact]\n        public void ThrowsIfRemoveKeyNull()\n        {\n            var ex = Assert.Throws<ArgumentNullException>(() =>\n            {\n                list.RemoveValue(null, new object());\n            });\n\n        }\n\n        [Fact]\n        public void CanRemoveValue()\n        {\n            object value = new object();\n\n            list.Add(\"foo\", value);\n            list.RemoveValue(\"foo\", value);\n\n            Assert.Equal(0, list[\"foo\"].Count);\n        }\n\n        [Fact]\n        public void CanRemoveValueFromAllLists()\n        {\n            object value = new object();\n            list.Add(\"foo\", value);\n            list.Add(\"bar\", value);\n\n            list.RemoveValue(value);\n\n            Assert.Equal(0, list.Values.Count);\n        }\n\n        [Fact]\n        public void RemoveNonExistingValueNoOp()\n        {\n            list.Add(\"foo\", new object());\n\n            list.RemoveValue(\"foo\", new object());\n        }\n\n        [Fact]\n        public void RemoveNonExistingKeyNoOp()\n        {\n            list.RemoveValue(\"foo\", new object());\n        }\n\n        [Fact]\n        public void ThrowsIfRemoveListKeyNull()\n        {\n            var ex = Assert.Throws<ArgumentNullException>(() =>\n            {\n                list.Remove(null);\n            });\n        }\n\n        [Fact]\n        public void CanRemoveList()\n        {\n            list.Add(\"foo\", new object());\n            list.Add(\"foo\", new object());\n\n            bool removed = list.Remove(\"foo\");\n\n            Assert.True(removed);\n            Assert.Equal(0, list.Keys.Count);\n        }\n\n        [Fact]\n        public void CanSetList()\n        {\n            List<object> values = new List<object>();\n            values.Add(new object());\n            list.Add(\"foo\", new object());\n            list.Add(\"foo\", new object());\n\n            list[\"foo\"] = values;\n\n            Assert.Equal(1, list[\"foo\"].Count);\n        }\n\n        [Fact]\n        public void CanEnumerateKeyValueList()\n        {\n            int count = 0;\n            list.Add(\"foo\", new object());\n            list.Add(\"foo\", new object());\n\n            foreach (KeyValuePair<string, IList<object>> pair in list)\n            {\n                foreach (object value in pair.Value)\n                {\n                    count++;\n                }\n\n                Assert.Equal(\"foo\", pair.Key);\n            }\n\n            Assert.Equal(2, count);\n        }\n\n        [Fact]\n        public void CanGetFlatListOfValues()\n        {\n            list.Add(\"foo\", new object());\n            list.Add(\"foo\", new object());\n            list.Add(\"bar\", new object());\n\n            IList<object> values = list.Values;\n\n            Assert.Equal(3, values.Count);\n        }\n\n        [Fact]\n        public void IndexerAccessAlwaysSucceeds()\n        {\n            IList<object> values = list[\"foo\"];\n\n            Assert.NotNull(values);\n        }\n\n        [Fact]\n        public void ThrowsIfContainsKeyNull()\n        {\n            var ex = Assert.Throws<ArgumentNullException>(() =>\n            {\n                list.ContainsKey(null);\n            });\n        }\n\n        [Fact]\n        public void CanAskContainsKey()\n        {\n            Assert.False(list.ContainsKey(\"foo\"));\n        }\n\n        [Fact]\n        public void CanAskContainsValueInAnyList()\n        {\n            object obj = new object();\n            list.Add(\"foo\", new object());\n            list.Add(\"bar\", new object());\n            list.Add(\"baz\", obj);\n\n            bool contains = list.ContainsValue(obj);\n\n            Assert.True(contains);\n        }\n\n        [Fact]\n        public void CanClearDictionary()\n        {\n            list.Add(\"foo\", new object());\n            list.Add(\"bar\", new object());\n            list.Add(\"baz\", new object());\n\n            list.Clear();\n\n            Assert.Empty(list);\n        }\n\n        [Fact]\n        public void CanGetFilteredValuesByKeys()\n        {\n            list.Add(\"foo\", new object());\n            list.Add(\"bar\", new object());\n            list.Add(\"baz\", new object());\n\n            IEnumerable<object> filtered = list.FindAllValuesByKey(delegate (string key)\n            {\n                return key.StartsWith(\"b\");\n            });\n\n            int count = 0;\n            foreach (object obj in filtered)\n            {\n                count++;\n            }\n\n            Assert.Equal(2, count);\n        }\n\n        [Fact]\n        public void CanGetFilteredValues()\n        {\n            list.Add(\"foo\", DateTime.Now);\n            list.Add(\"bar\", new object());\n            list.Add(\"baz\", DateTime.Today);\n\n            IEnumerable<object> filtered = list.FindAllValues(delegate (object value)\n            {\n                return value is DateTime;\n            });\n            int count = 0;\n            foreach (object obj in filtered)\n            {\n                count++;\n            }\n\n            Assert.Equal(2, count);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Mocks/MockAsyncModuleTypeLoader.cs",
    "content": "using System;\nusing System.Threading;\nusing Prism.Modularity;\n\nnamespace Prism.Avalonia.Tests.Mocks\n{\n    public class MockAsyncModuleTypeLoader : IModuleTypeLoader\n    {\n        private ManualResetEvent callbackEvent;\n\n        public MockAsyncModuleTypeLoader(ManualResetEvent callbackEvent)\n        {\n            this.callbackEvent = callbackEvent;\n        }\n\n        public int SleepTimeOut { get; set; }\n\n        public Exception CallbackArgumentError { get; set; }\n\n        public bool CanLoadModuleType(IModuleInfo moduleInfo)\n        {\n            return true;\n        }\n\n        public void LoadModuleType(IModuleInfo moduleInfo)\n        {\n            Thread retrieverThread = new Thread(() =>\n            {\n                Thread.Sleep(SleepTimeOut);\n\n                RaiseLoadModuleCompleted(new LoadModuleCompletedEventArgs(moduleInfo, CallbackArgumentError));\n                callbackEvent.Set();\n            });\n            retrieverThread.Start();\n        }\n\n        public event EventHandler<ModuleDownloadProgressChangedEventArgs> ModuleDownloadProgressChanged;\n\n        private void RaiseLoadModuleProgressChanged(ModuleDownloadProgressChangedEventArgs e)\n        {\n            ModuleDownloadProgressChanged?.Invoke(this, e);\n        }\n\n        public event EventHandler<LoadModuleCompletedEventArgs> LoadModuleCompleted;\n\n        private void RaiseLoadModuleCompleted(LoadModuleCompletedEventArgs e)\n        {\n            LoadModuleCompleted?.Invoke(this, e);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Mocks/MockClickableObject.cs",
    "content": "using Avalonia.Controls;\n\nnamespace Prism.Avalonia.Tests.Mocks\n{\n    internal class MockClickableObject : Button // : ButtonBase\n    {\n        public void RaiseClick()\n        {\n            OnClick();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Mocks/MockCommand.cs",
    "content": "using System;\nusing System.Windows.Input;\n\nnamespace Prism.Avalonia.Tests.Mocks\n{\n    internal class MockCommand : ICommand\n    {\n        public bool ExecuteCalled { get; set; }\n        public bool CanExecuteReturnValue = true;\n        public object ExecuteParameter;\n        public object CanExecuteParameter;\n        public int CanExecuteTimesCalled;\n\n        public event EventHandler CanExecuteChanged;\n\n        public void Execute(object parameter)\n        {\n            ExecuteCalled = true;\n            ExecuteParameter = parameter;\n        }\n\n        public bool CanExecute(object parameter)\n        {\n            CanExecuteTimesCalled++;\n            CanExecuteParameter = parameter;\n            return CanExecuteReturnValue;\n        }\n\n        public void RaiseCanExecuteChanged()\n        {\n            if (CanExecuteChanged != null)\n                CanExecuteChanged(this, EventArgs.Empty);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Mocks/MockConfigurationStore.Desktop.cs",
    "content": "using Prism.Modularity;\n\nnamespace Prism.Avalonia.Tests.Mocks\n{\n    public class MockConfigurationStore : IConfigurationStore\n    {\n        private ModulesConfigurationSection _section = new ModulesConfigurationSection();\n\n        public ModuleConfigurationElement[] Modules\n        {\n            set { _section.Modules = new ModuleConfigurationElementCollection(value); }\n        }\n\n        public ModulesConfigurationSection RetrieveModuleConfigurationSection()\n        {\n            return _section;\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Mocks/MockContainerAdapter.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing Prism.Ioc;\n\nnamespace Prism.Avalonia.Tests.Mocks\n{\n    internal class MockContainerAdapter : IContainerExtension\n    {\n        public Dictionary<Type, object> ResolvedInstances = new Dictionary<Type, object>();\n\n        public IScopedProvider CurrentScope { get; }\n\n        public void CreateScope()\n        {\n            throw new NotImplementedException();\n        }\n\n        public void FinalizeExtension()\n        {\n\n        }\n\n        public bool IsRegistered(Type type)\n        {\n            throw new NotImplementedException();\n        }\n\n        public bool IsRegistered(Type type, string name)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IContainerRegistry Register(Type from, Type to)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IContainerRegistry Register(Type from, Type to, string name)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IContainerRegistry Register(Type type, Func<object> factoryMethod)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IContainerRegistry Register(Type type, Func<IContainerProvider, object> factoryMethod)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IContainerRegistry RegisterInstance(Type type, object instance)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IContainerRegistry RegisterInstance(Type type, object instance, string name)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IContainerRegistry RegisterMany(Type type, params Type[] serviceTypes)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IContainerRegistry RegisterManySingleton(Type type, params Type[] serviceTypes)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IContainerRegistry RegisterScoped(Type from, Type to)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IContainerRegistry RegisterScoped(Type type, Func<object> factoryMethod)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IContainerRegistry RegisterScoped(Type type, Func<IContainerProvider, object> factoryMethod)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IContainerRegistry RegisterSingleton(Type from, Type to)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IContainerRegistry RegisterSingleton(Type from, Type to, string name)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IContainerRegistry RegisterSingleton(Type type, Func<object> factoryMethod)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IContainerRegistry RegisterSingleton(Type type, Func<IContainerProvider, object> factoryMethod)\n        {\n            throw new NotImplementedException();\n        }\n\n        public object Resolve(Type type)\n        {\n            object resolvedInstance;\n            if (!ResolvedInstances.ContainsKey(type))\n            {\n                resolvedInstance = Activator.CreateInstance(type);\n                ResolvedInstances.Add(type, resolvedInstance);\n            }\n            else\n            {\n                resolvedInstance = ResolvedInstances[type];\n            }\n\n            return resolvedInstance;\n        }\n\n        public object Resolve(Type type, string name)\n        {\n            throw new NotImplementedException();\n        }\n\n        public object Resolve(Type type, params (Type Type, object Instance)[] parameters)\n        {\n            throw new NotImplementedException();\n        }\n\n        public object Resolve(Type type, string name, params (Type Type, object Instance)[] parameters)\n        {\n            throw new NotImplementedException();\n        }\n\n        IScopedProvider IContainerProvider.CreateScope()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Mocks/MockDelegateReference.cs",
    "content": "using System;\nusing Prism.Events;\n\nnamespace Prism.Avalonia.Tests.Mocks\n{\n    class MockDelegateReference : IDelegateReference\n    {\n        public Delegate Target { get; set; }\n\n        public MockDelegateReference()\n        {\n        }\n\n        public MockDelegateReference(Delegate target)\n        {\n            Target = target;\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Mocks/MockDependencyObject.cs",
    "content": "﻿using Avalonia;\n\nnamespace Prism.Avalonia.Tests.Mocks\n{\n    /// <summary>MockAvaloniaObject.</summary>\n    /// <remarks>TODO: Rename to MockAvaloniaObject.</remarks>\n    public class MockDependencyObject : AvaloniaObject\n    {\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Mocks/MockFrameworkContentElement.cs",
    "content": "﻿using Avalonia.Controls;\nusing Avalonia.Interactivity;\n\nnamespace Prism.Avalonia.Tests.Mocks\n{\n    /// <summary>Mock Framework Content Element</summary>\n    /// <remarks>\n    ///   The Avalonia.Control's LoadedEvent and UnloadedEvent will\n    ///   arrive in Avalonia v0.11.0.\n    ///   Discussion: https://github.com/AvaloniaUI/Avalonia/issues/7908\n    ///   PR: https://github.com/AvaloniaUI/Avalonia/pull/8277\n    /// </remarks>\n    public class MockFrameworkContentElement : Control\n    {\n        public void RaiseLoaded()\n        {\n            ////this.RaiseEvent(new RoutedEventArgs(LoadedEvent));\n            this.RaiseEvent(new RoutedEventArgs());\n        }\n\n        public void RaiseUnloaded()\n        {\n            //// this.RaiseEvent(new RoutedEventArgs(UnloadedEvent));\n            this.RaiseEvent(new RoutedEventArgs());\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Mocks/MockFrameworkElement.cs",
    "content": "﻿using Avalonia.Controls;\nusing Avalonia.Interactivity;\n\nnamespace Prism.Avalonia.Tests.Mocks\n{\n    /// <summary>Mock Content Element</summary>\n    /// <remarks>\n    ///   TODO:\n    ///   The Avalonia.Control's LoadedEvent and UnloadedEvent will\n    ///   arrive in Avalonia v0.11.0.\n    ///   Discussion: https://github.com/AvaloniaUI/Avalonia/issues/7908\n    ///   PR: https://github.com/AvaloniaUI/Avalonia/pull/8277\n    /// </remarks>\n    public class MockFrameworkElement : Control\n    {\n        public void RaiseLoaded()\n        {\n            //// WPF: this.RaiseEvent(new RoutedEventArgs(LoadedEvent));\n            this.RaiseEvent(new RoutedEventArgs());\n        }\n\n        public void RaiseUnloaded()\n        {\n            //// WPF: this.RaiseEvent(new RoutedEventArgs(UnloadedEvent));\n            this.RaiseEvent(new RoutedEventArgs());\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Mocks/MockHostAwareRegionBehavior.cs",
    "content": "using Avalonia;\nusing Prism.Navigation.Regions;\nusing Prism.Navigation.Regions.Behaviors;\n\nnamespace Prism.Avalonia.Tests.Mocks\n{\n    public class MockHostAwareRegionBehavior : IHostAwareRegionBehavior\n    {\n        public IRegion Region { get; set; }\n\n        public void Attach()\n        {\n\n        }\n\n        public AvaloniaObject HostControl { get; set; }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Mocks/MockInteractionRequestAwareElement.cs",
    "content": "﻿using System;\nusing System.Windows;\nusing Avalonia;\nusing Avalonia.Controls;\nusing Prism.Interactivity.InteractionRequest;\n\nnamespace Prism.Avalonia.Tests.Mocks\n{\n    public class MockInteractionRequestAwareElement : StyledElement, IInteractionRequestAware\n    {\n        public INotification Notification { get; set; }\n\n        public Action FinishInteraction { get; set; }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Mocks/MockModuleTypeLoader.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing Prism.Modularity;\n\nnamespace Prism.Avalonia.Tests.Mocks\n{\n    public class MockModuleTypeLoader : IModuleTypeLoader\n    {\n        public List<IModuleInfo> LoadedModules = new List<IModuleInfo>();\n        public bool canLoadModuleTypeReturnValue = true;\n        public Exception LoadCompletedError;\n\n        public bool CanLoadModuleType(IModuleInfo moduleInfo)\n        {\n            return canLoadModuleTypeReturnValue;\n        }\n\n        public void LoadModuleType(IModuleInfo moduleInfo)\n        {\n            LoadedModules.Add(moduleInfo);\n            RaiseLoadModuleCompleted(new LoadModuleCompletedEventArgs(moduleInfo, LoadCompletedError));\n        }\n\n        public event EventHandler<ModuleDownloadProgressChangedEventArgs> ModuleDownloadProgressChanged;\n\n        public void RaiseLoadModuleProgressChanged(ModuleDownloadProgressChangedEventArgs e)\n        {\n            ModuleDownloadProgressChanged?.Invoke(this, e);\n        }\n\n        public event EventHandler<LoadModuleCompletedEventArgs> LoadModuleCompleted;\n\n        public void RaiseLoadModuleCompleted(ModuleInfo moduleInfo, Exception error)\n        {\n            RaiseLoadModuleCompleted(new LoadModuleCompletedEventArgs(moduleInfo, error));\n        }\n\n        public void RaiseLoadModuleCompleted(LoadModuleCompletedEventArgs e)\n        {\n            LoadModuleCompleted?.Invoke(this, e);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Mocks/MockPresentationRegion.cs",
    "content": "using System;\nusing System.ComponentModel;\nusing Prism.Navigation;\nusing Prism.Navigation.Regions;\n\nnamespace Prism.Avalonia.Tests.Mocks\n{\n    class MockPresentationRegion : IRegion\n    {\n        public MockViewsCollection MockViews = new MockViewsCollection();\n        public MockViewsCollection MockActiveViews = new MockViewsCollection();\n\n        public MockPresentationRegion()\n        {\n            Behaviors = new MockRegionBehaviorCollection();\n        }\n\n        public IRegionManager Add(string viewName) => throw new NotImplementedException();\n\n        public IRegionManager Add(object view)\n        {\n            MockViews.Items.Add(view);\n\n            return null;\n        }\n\n        public void Remove(object view)\n        {\n            MockViews.Items.Remove(view);\n            MockActiveViews.Items.Remove(view);\n        }\n\n        public void Activate(object view)\n        {\n            MockActiveViews.Items.Add(view);\n        }\n\n        public IRegionManager Add(object view, string viewName)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IRegionManager Add(object view, string viewName, bool createRegionManagerScope)\n        {\n            throw new NotImplementedException();\n        }\n\n        public object GetView(string viewName)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IRegionManager RegionManager { get; set; }\n\n        public IRegionBehaviorCollection Behaviors { get; set; }\n\n        public IViewsCollection Views\n        {\n            get { return MockViews; }\n        }\n\n        public IViewsCollection ActiveViews\n        {\n            get { return MockActiveViews; }\n        }\n\n        public void Deactivate(object view)\n        {\n            MockActiveViews.Items.Remove(view);\n        }\n\n        private object context;\n        public object Context\n        {\n            get { return context; }\n            set\n            {\n                context = value;\n                OnPropertyChange(\"Context\");\n            }\n        }\n\n        public INavigationParameters NavigationParameters\n        {\n            get { throw new System.NotImplementedException(); }\n            set { throw new System.NotImplementedException(); }\n        }\n\n        private string name;\n        public string Name\n        {\n            get { return name; }\n            set\n            {\n                name = value;\n                OnPropertyChange(\"Name\");\n            }\n        }\n\n        public event PropertyChangedEventHandler PropertyChanged;\n\n        public void OnPropertyChange(string propertyName)\n        {\n            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));\n        }\n\n        public bool Navigate(Uri source)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RequestNavigate(Uri target, Action<NavigationResult> navigationCallback)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RequestNavigate(Uri target, Action<NavigationResult> navigationCallback, INavigationParameters navigationParameters)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RemoveAll()\n        {\n            throw new NotImplementedException();\n        }\n\n        public IRegionNavigationService NavigationService\n        {\n            get { throw new NotImplementedException(); }\n            set { throw new System.NotImplementedException(); }\n        }\n\n        public Comparison<object> SortComparison\n        {\n            get\n            {\n                throw new NotImplementedException();\n            }\n            set\n            {\n                throw new NotImplementedException();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Mocks/MockRegion.cs",
    "content": "using System;\nusing System.ComponentModel;\nusing Prism.Navigation;\nusing Prism.Navigation.Regions;\n\nnamespace Prism.Avalonia.Tests.Mocks\n{\n    internal class MockRegion : IRegion\n    {\n        public event PropertyChangedEventHandler PropertyChanged;\n\n        public Func<string, object> GetViewStringDelegate { get; set; }\n\n        private MockViewsCollection views = new MockViewsCollection();\n\n        public IViewsCollection Views\n        {\n            get { return views; }\n        }\n\n        public IViewsCollection ActiveViews\n        {\n            get { throw new System.NotImplementedException(); }\n        }\n\n        public object Context\n        {\n            get { throw new System.NotImplementedException(); }\n            set { throw new System.NotImplementedException(); }\n        }\n\n        public INavigationParameters NavigationParameters\n        {\n            get { throw new System.NotImplementedException(); }\n            set { throw new System.NotImplementedException(); }\n        }\n\n        public string Name { get; set; }\n\n        public IRegionManager Add(string viewName) => throw new NotImplementedException();\n\n        public IRegionManager Add(object view)\n        {\n            views.Add(view);\n            return null;\n        }\n\n        public IRegionManager Add(object view, string viewName)\n        {\n            return Add(view);\n        }\n\n        public IRegionManager Add(object view, string viewName, bool createRegionManagerScope)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public void Remove(object view)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public void Activate(object view)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public void Deactivate(object view)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public object GetView(string viewName)\n        {\n            return GetViewStringDelegate(viewName);\n        }\n\n        public IRegionManager RegionManager { get; set; }\n\n        public IRegionBehaviorCollection Behaviors\n        {\n            get { throw new System.NotImplementedException(); }\n        }\n\n        public bool Navigate(System.Uri source)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public void RequestNavigate(System.Uri target, System.Action<NavigationResult> navigationCallback)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public void RequestNavigate(System.Uri target, System.Action<NavigationResult> navigationCallback, INavigationParameters navigationParameters)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public void RemoveAll()\n        {\n            throw new NotImplementedException();\n        }\n\n        public IRegionNavigationService NavigationService\n        {\n            get { throw new System.NotImplementedException(); }\n            set { throw new System.NotImplementedException(); }\n        }\n\n        public System.Comparison<object> SortComparison\n        {\n            get { throw new System.NotImplementedException(); }\n            set { throw new System.NotImplementedException(); }\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Mocks/MockRegionAdapter.cs",
    "content": "using System.Collections.Generic;\nusing Avalonia;\nusing Prism.Navigation.Regions;\n\nnamespace Prism.Avalonia.Tests.Mocks\n{\n    internal class MockRegionAdapter : IRegionAdapter\n    {\n        public List<string> CreatedRegions = new List<string>();\n        public MockRegionManagerAccessor Accessor;\n\n        public IRegion Initialize(object regionTarget, string regionName)\n        {\n            CreatedRegions.Add(regionName);\n\n            var region = new MockPresentationRegion();\n            RegionManager.GetObservableRegion(regionTarget as AvaloniaObject).Value = region;\n\n            // Fire update regions again. This also happens if a region is created and added to the regionmanager\n            if (Accessor != null)\n                Accessor.UpdateRegions();\n\n            return region;\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Mocks/MockRegionBehavior.cs",
    "content": "using System;\nusing Prism.Navigation.Regions;\n\nnamespace Prism.Avalonia.Tests.Mocks\n{\n    public class MockRegionBehavior : IRegionBehavior\n    {\n        public IRegion Region\n        {\n            get; set;\n        }\n\n        public Func<object> OnAttach;\n\n        public void Attach()\n        {\n            if (OnAttach != null)\n                OnAttach();\n\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Mocks/MockRegionBehaviorCollection.cs",
    "content": "using System.Collections;\nusing System.Collections.Generic;\nusing Prism.Navigation.Regions;\n\nnamespace Prism.Avalonia.Tests.Mocks\n{\n    internal class MockRegionBehaviorCollection : Dictionary<string, IRegionBehavior>, IRegionBehaviorCollection\n    {\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return GetEnumerator();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Mocks/MockRegionManager.cs",
    "content": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing Prism.Ioc;\nusing Prism.Navigation;\nusing Prism.Navigation.Regions;\n\nnamespace Prism.Avalonia.Tests.Mocks\n{\n    internal class MockRegionManager : IRegionManager\n    {\n        private IRegionCollection regions = new MockRegionCollection();\n        internal MockRegionCollection MockRegionCollection\n        {\n            get\n            {\n                return regions as MockRegionCollection;\n            }\n        }\n\n        public IRegionCollection Regions\n        {\n            get { return regions; }\n        }\n\n        public IRegionManager CreateRegionManager()\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public IRegionManager AddToRegion(string regionName, object view)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public IRegionManager RegisterViewWithRegion(string regionName, Type viewType)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IRegionManager RegisterViewWithRegion(string regionName, Func<IContainerProvider, object> getContentDelegate)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RequestNavigate(string regionName, Uri source, Action<NavigationResult> navigationCallback)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RequestNavigate(string regionName, Uri source)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RequestNavigate(string regionName, string source, Action<NavigationResult> navigationCallback)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RequestNavigate(string regionName, string source)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RequestNavigate(string regionName, Uri target, Action<NavigationResult> navigationCallback, INavigationParameters navigationParameters)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RequestNavigate(string regionName, string target, Action<NavigationResult> navigationCallback, INavigationParameters navigationParameters)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RequestNavigate(string regionName, Uri target, INavigationParameters navigationParameters)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RequestNavigate(string regionName, string target, INavigationParameters navigationParameters)\n        {\n            throw new NotImplementedException();\n        }\n\n        public bool Navigate(System.Uri source)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public IRegionManager AddToRegion(string regionName, string viewName)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IRegionManager RegisterViewWithRegion(string regionName, string viewName)\n        {\n            throw new NotImplementedException();\n        }\n    }\n\n    internal class MockRegionCollection : List<IRegion>, IRegionCollection\n    {\n        IEnumerator<IRegion> IEnumerable<IRegion>.GetEnumerator()\n        {\n            throw new System.NotImplementedException();\n        }\n\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return GetEnumerator();\n        }\n\n        public IRegion this[string regionName]\n        {\n            get { return this[0]; }\n        }\n\n        void IRegionCollection.Add(IRegion region)\n        {\n            Add(region);\n        }\n\n        public bool Remove(string regionName)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public bool ContainsRegionWithName(string regionName)\n        {\n            return true;\n        }\n\n        public void Add(string regionName, IRegion region)\n        {\n            throw new NotImplementedException();\n        }\n\n        public event System.Collections.Specialized.NotifyCollectionChangedEventHandler CollectionChanged;\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Mocks/MockRegionManagerAccessor.cs",
    "content": "using System;\nusing Avalonia;\nusing Prism.Navigation.Regions;\n\nnamespace Prism.Avalonia.Tests.Mocks\n{\n    internal class MockRegionManagerAccessor : IRegionManagerAccessor\n    {\n        public Func<AvaloniaObject, string> GetRegionName;\n        public Func<AvaloniaObject, IRegionManager> GetRegionManager;\n\n        public event EventHandler UpdatingRegions;\n\n        string IRegionManagerAccessor.GetRegionName(AvaloniaObject element)\n        {\n            return GetRegionName(element);\n        }\n\n        IRegionManager IRegionManagerAccessor.GetRegionManager(AvaloniaObject element)\n        {\n            if (GetRegionManager != null)\n                return GetRegionManager(element);\n\n            return null;\n        }\n\n        public void UpdateRegions()\n        {\n            if (UpdatingRegions != null)\n                UpdatingRegions(this, EventArgs.Empty);\n        }\n\n        public int GetSubscribersCount()\n        {\n            return UpdatingRegions != null ? UpdatingRegions.GetInvocationList().Length : 0;\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Mocks/MockSortableViews.cs",
    "content": "using Prism.Navigation.Regions;\n\nnamespace Prism.Avalonia.Tests.Mocks\n{\n    [ViewSortHint(\"01\")]\n    internal class MockSortableView1\n    {\n    }\n\n    [ViewSortHint(\"02\")]\n    internal class MockSortableView2\n    {\n    }\n\n    [ViewSortHint(\"03\")]\n    internal class MockSortableView3\n    {\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Mocks/MockViewsCollection.cs",
    "content": "using System.Collections;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Collections.Specialized;\nusing Prism.Navigation.Regions;\n\nnamespace Prism.Avalonia.Tests.Mocks\n{\n    class MockViewsCollection : IViewsCollection\n    {\n        public ObservableCollection<object> Items = new ObservableCollection<object>();\n\n        public void Add(object view)\n        {\n            Items.Add(view);\n        }\n\n        public bool Contains(object value)\n        {\n            return Items.Contains(value);\n        }\n\n        public IEnumerator<object> GetEnumerator()\n        {\n            return Items.GetEnumerator();\n        }\n\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return GetEnumerator();\n        }\n\n        public event NotifyCollectionChangedEventHandler CollectionChanged\n        {\n            add { Items.CollectionChanged += value; }\n            remove { Items.CollectionChanged -= value; }\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Mocks/Modules/MockAbstractModule.cs",
    "content": "using Prism.Ioc;\nusing Prism.Modularity;\nusing System;\n\nnamespace Prism.Avalonia.Tests.Mocks.Modules\n{\n    public abstract class MockAbstractModule : IModule\n    {\n        public void OnInitialized(IContainerProvider containerProvider)\n        {\n\n        }\n\n        public void RegisterTypes(IContainerRegistry containerRegistry)\n        {\n\n        }\n    }\n\n    public class MockInheritingModule : MockAbstractModule\n    {\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Mocks/Modules/MockAttributedModule.cs",
    "content": "using System;\nusing Prism.Ioc;\nusing Prism.Modularity;\n\nnamespace Prism.Avalonia.Tests.Mocks.Modules\n{\n    [Module(ModuleName = \"TestModule\", OnDemand = true)]\n    public class MockAttributedModule : IModule\n    {\n        public void OnInitialized(IContainerProvider containerProvider)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RegisterTypes(IContainerRegistry containerRegistry)\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Mocks/Modules/MockDependantModule.cs",
    "content": "using System;\nusing Prism.Ioc;\nusing Prism.Modularity;\n\nnamespace Prism.Avalonia.Tests.Mocks.Modules\n{\n    [Module(ModuleName = \"DependantModule\")]\n    [ModuleDependency(\"DependencyModule\")]\n    public class DependantModule : IModule\n    {\n        public void OnInitialized(IContainerProvider containerProvider)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RegisterTypes(IContainerRegistry containerRegistry)\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Mocks/Modules/MockDependencyModule.cs",
    "content": "using System;\nusing Prism.Ioc;\nusing Prism.Modularity;\n\nnamespace Prism.Avalonia.Tests.Mocks.Modules\n{\n    [Module(ModuleName = \"DependencyModule\")]\n    public class DependencyModule : IModule\n    {\n        public void OnInitialized(IContainerProvider containerProvider)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RegisterTypes(IContainerRegistry containerRegistry)\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Mocks/Modules/MockExposingTypeFromGacAssemblyModule.cs",
    "content": "using System;\nusing Prism.Ioc;\nusing Prism.Modularity;\n\nnamespace Prism.Avalonia.Tests.Mocks.Modules\n{\n    public class MockExposingTypeFromGacAssemblyModule : IModule\n    {\n        public void OnInitialized(IContainerProvider containerProvider)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RegisterTypes(IContainerRegistry containerRegistry)\n        {\n            throw new NotImplementedException();\n        }\n    }\n\n    public class SomeContractReferencingTransactionsAssembly : System.Transactions.IDtcTransaction\n    {\n        public void Commit(int retaining, int commitType, int reserved)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public void Abort(IntPtr reason, int retaining, int async)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public void GetTransactionInfo(IntPtr transactionInformation)\n        {\n            throw new System.NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Mocks/Modules/MockModuleA.cs",
    "content": "using System;\nusing Prism.Ioc;\nusing Prism.Modularity;\n\nnamespace Prism.Avalonia.Tests.Mocks.Modules\n{\n    public class MockModuleA : IModule\n    {\n        public void OnInitialized(IContainerProvider containerProvider)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RegisterTypes(IContainerRegistry containerRegistry)\n        {\n            throw new NotImplementedException();\n        }\n    }\n\n    public class DummyClass\n    {\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Mocks/Modules/MockModuleReferencedAssembly.cs",
    "content": "namespace Prism.Avalonia.Tests.Mocks.Modules\n{\n    public class MockReferencedModule\n    {\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Mocks/Modules/MockModuleReferencingAssembly.cs",
    "content": "using System;\nusing Prism.Ioc;\nusing Prism.Modularity;\n\nnamespace Prism.Avalonia.Tests.Mocks.Modules\n{\n    public class MockModuleReferencingAssembly : IModule\n    {\n        public void OnInitialized(IContainerProvider containerProvider)\n        {\n            MockReferencedModule instance = new MockReferencedModule();\n        }\n\n        public void RegisterTypes(IContainerRegistry containerRegistry)\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Mocks/Modules/MockModuleReferencingOtherModule.cs",
    "content": "using System;\nusing Prism.Ioc;\nusing Prism.Modularity;\n\nnamespace Prism.Avalonia.Tests.Mocks.Modules\n{\n    public class MockModuleReferencingOtherModule : IModule\n    {\n        public void OnInitialized(IContainerProvider containerProvider)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RegisterTypes(IContainerRegistry containerRegistry)\n        {\n            throw new NotImplementedException();\n        }\n    }\n\n    public class MyDummyClass : DummyClass\n    { }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Mocks/Modules/MockModuleThrowingException.cs",
    "content": "using System;\nusing Prism.Ioc;\nusing Prism.Modularity;\n\nnamespace Prism.Avalonia.Tests.Mocks.Modules\n{\n    public class MockModuleThrowingException : IModule\n    {\n        public void OnInitialized(IContainerProvider containerProvider)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RegisterTypes(IContainerRegistry containerRegistry)\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Mocks/ViewModels/MockOptOutViewModel.cs",
    "content": "﻿using Prism.Mvvm;\n\nnamespace Prism.Avalonia.Tests.Mocks.ViewModels\n{\n    public class MockOptOutViewModel : BindableBase\n    {\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Mocks/ViewModels/MockViewModel.cs",
    "content": "﻿using Prism.Mvvm;\n\nnamespace Prism.Avalonia.Tests.Mocks.ViewModels\n{\n    public class MockViewModel : BindableBase\n    {\n        private int mockProperty;\n\n        public int MockProperty\n        {\n            get\n            {\n                return this.mockProperty;\n            }\n\n            set\n            {\n                this.SetProperty(ref mockProperty, value);\n            }\n        }\n\n        internal void InvokeOnPropertyChanged()\n        {\n            this.RaisePropertyChanged(nameof(MockProperty));\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Mocks/Views/Mock.cs",
    "content": "﻿using Avalonia.Controls;\n\nnamespace Prism.Avalonia.Tests.Mocks.Views\n{\n    public class Mock : Control\n    {\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Mocks/Views/MockOptOut.cs",
    "content": "using Avalonia.Controls;\nusing Prism.Mvvm;\n\nnamespace Prism.Avalonia.Tests.Mocks.Views\n{\n    public class MockOptOut : Control\n    {\n        public MockOptOut()\n        {\n            ViewModelLocator.SetAutoWireViewModel(this, false);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Mocks/Views/MockView.cs",
    "content": "﻿using Avalonia.Controls;\n\nnamespace Prism.Avalonia.Tests.Mocks.Views\n{\n    public class MockView : Control\n    {\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Modularity/AssemblyResolverFixture.Desktop.cs",
    "content": "using System;\nusing System.IO;\nusing Prism.Modularity;\nusing Xunit;\n\nnamespace Prism.Avalonia.Tests.Modularity\n{\n    public class AssemblyResolverFixture : IDisposable\n    {\n        private const string ModulesDirectory1 = @\".\\DynamicModules\\MocksModulesAssemblyResolve\";\n\n        public AssemblyResolverFixture()\n        {\n            CleanUpDirectories();\n        }\n\n        private void CleanUpDirectories()\n        {\n            CompilerHelper.CleanUpDirectory(ModulesDirectory1);\n        }\n\n        [Fact]\n        public void ShouldThrowOnInvalidAssemblyFilePath()\n        {\n            bool exceptionThrown = false;\n\n            using var resolver = new AssemblyResolver();\n\n            try\n            {\n                resolver.LoadAssemblyFrom(null);\n            }\n            catch (ArgumentException)\n            {\n                exceptionThrown = true;\n            }\n\n            Assert.True(exceptionThrown);\n\n            try\n            {\n                resolver.LoadAssemblyFrom(\"file://InexistentFile.dll\");\n                exceptionThrown = false;\n            }\n            catch (FileNotFoundException)\n            {\n                exceptionThrown = true;\n            }\n\n            Assert.True(exceptionThrown);\n\n            try\n            {\n                resolver.LoadAssemblyFrom(\"InvalidUri.dll\");\n                exceptionThrown = false;\n            }\n            catch (ArgumentException)\n            {\n                exceptionThrown = true;\n            }\n\n            Assert.True(exceptionThrown);\n        }\n\n        [Fact(Skip = \"Operation is not supported on this platform\")]\n        public void ShouldResolveTypeFromAbsoluteUriToAssembly()\n        {\n            string assemblyPath = CompilerHelper.GenerateDynamicModule(\"ModuleInLoadedFromContext1\", \"Module\", ModulesDirectory1 + @\"\\ModuleInLoadedFromContext1.dll\");\n            var uriBuilder = new UriBuilder\n            {\n                Host = String.Empty,\n                Scheme = Uri.UriSchemeFile,\n                Path = Path.GetFullPath(assemblyPath)\n            };\n            var assemblyUri = uriBuilder.Uri;\n\n            using var resolver = new AssemblyResolver();\n\n            Type resolvedType =\n                Type.GetType(\n                    \"TestModules.ModuleInLoadedFromContext1Class, ModuleInLoadedFromContext1, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null\");\n            Assert.Null(resolvedType);\n\n            resolver.LoadAssemblyFrom(assemblyUri.ToString());\n\n            resolvedType =\n                Type.GetType(\n                    \"TestModules.ModuleInLoadedFromContext1Class, ModuleInLoadedFromContext1, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null\");\n            Assert.NotNull(resolvedType);\n        }\n\n        [Fact(Skip = \"Operation is not supported on this platform\")]\n        public void ShouldResolvePartialAssemblyName()\n        {\n            string assemblyPath = CompilerHelper.GenerateDynamicModule(\"ModuleInLoadedFromContext2\", \"Module\", ModulesDirectory1 + @\"\\ModuleInLoadedFromContext2.dll\");\n            var uriBuilder = new UriBuilder\n            {\n                Host = String.Empty,\n                Scheme = Uri.UriSchemeFile,\n                Path = Path.GetFullPath(assemblyPath)\n            };\n            var assemblyUri = uriBuilder.Uri;\n\n            using var resolver = new AssemblyResolver();\n\n            resolver.LoadAssemblyFrom(assemblyUri.ToString());\n\n            Type resolvedType =\n                Type.GetType(\"TestModules.ModuleInLoadedFromContext2Class, ModuleInLoadedFromContext2\");\n\n            Assert.NotNull(resolvedType);\n\n            resolvedType =\n                Type.GetType(\"TestModules.ModuleInLoadedFromContext2Class, ModuleInLoadedFromContext2, Version=0.0.0.0\");\n\n            Assert.NotNull(resolvedType);\n\n            resolvedType =\n                Type.GetType(\"TestModules.ModuleInLoadedFromContext2Class, ModuleInLoadedFromContext2, Version=0.0.0.0, Culture=neutral\");\n\n            Assert.NotNull(resolvedType);\n        }\n\n        public void Dispose()\n        {\n            CleanUpDirectories();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Modularity/ConfigurationModuleCatalogFixture.Desktop.cs",
    "content": "using System;\nusing System.Configuration;\nusing System.Linq;\nusing Prism.Avalonia.Tests.Mocks;\nusing Prism.Modularity;\nusing Xunit;\n\nnamespace Prism.Avalonia.Tests.Modularity\n{\n    public class ConfigurationModuleCatalogFixture\n    {\n        [Fact]\n        public void CanInitConfigModuleEnumerator()\n        {\n            MockConfigurationStore store = new MockConfigurationStore();\n            ConfigurationModuleCatalog catalog = new ConfigurationModuleCatalog\n            {\n                Store = store\n            };\n            Assert.NotNull(catalog);\n        }\n\n        [Fact]\n        public void NullConfigurationStoreThrows()\n        {\n            var ex = Assert.Throws<InvalidOperationException>(() =>\n            {\n                ConfigurationModuleCatalog catalog = new ConfigurationModuleCatalog() { Store = null };\n                catalog.Load();\n            });\n\n        }\n\n        [Fact]\n        public void ShouldReturnAListOfModuleInfo()\n        {\n            MockConfigurationStore store = new MockConfigurationStore\n            {\n                Modules = new[] { new ModuleConfigurationElement(@\"MocksModules\\MockModuleA.dll\", \"TestModules.MockModuleAClass\", \"MockModuleA\", false) }\n            };\n\n            ConfigurationModuleCatalog catalog = new ConfigurationModuleCatalog() { Store = store };\n            catalog.Load();\n\n            var modules = catalog.Modules;\n\n            Assert.NotNull(modules);\n            Assert.Single(modules);\n            Assert.NotEqual(InitializationMode.WhenAvailable, modules.First().InitializationMode);\n            Assert.NotNull(modules.First().Ref);\n            Assert.StartsWith(\"file://\", modules.First().Ref);\n            Assert.Contains(@\"MocksModules/MockModuleA.dll\", modules.First().Ref);\n            Assert.NotNull(modules.First().ModuleType);\n            Assert.Equal(\"TestModules.MockModuleAClass\", modules.First().ModuleType);\n\n        }\n\n        [Fact]\n        public void GetZeroModules()\n        {\n            MockConfigurationStore store = new MockConfigurationStore();\n            ConfigurationModuleCatalog catalog = new ConfigurationModuleCatalog() { Store = store };\n            catalog.Load();\n\n            Assert.Empty(catalog.Modules);\n        }\n\n        [Fact]\n        public void EnumeratesThreeModulesWithDependencies()\n        {\n            var store = new MockConfigurationStore();\n            var module1 = new ModuleConfigurationElement(\"Module1.dll\", \"Test.Module1\", \"Module1\", false)\n            {\n                Dependencies = new ModuleDependencyCollection(\n                new[] { new ModuleDependencyConfigurationElement(\"Module2\") })\n            };\n\n            var module2 = new ModuleConfigurationElement(\"Module2.dll\", \"Test.Module2\", \"Module2\", false)\n            {\n                Dependencies = new ModuleDependencyCollection(\n                new[] { new ModuleDependencyConfigurationElement(\"Module3\") })\n            };\n\n            var module3 = new ModuleConfigurationElement(\"Module3.dll\", \"Test.Module3\", \"Module3\", false);\n            store.Modules = new[] { module3, module2, module1 };\n\n            ConfigurationModuleCatalog catalog = new ConfigurationModuleCatalog() { Store = store };\n            catalog.Load();\n\n            var modules = catalog.Modules;\n\n            Assert.Equal(3, modules.Count());\n            Assert.Contains(modules, module => module.ModuleName == \"Module1\");\n            Assert.Contains(modules, module => module.ModuleName == \"Module2\");\n            Assert.Contains(modules, module => module.ModuleName == \"Module3\");\n        }\n\n        [Fact]\n        public void EnumerateThrowsIfDuplicateNames()\n        {\n            var ex = Assert.Throws<ConfigurationErrorsException>(() =>\n            {\n                MockConfigurationStore store = new MockConfigurationStore();\n                var module1 = new ModuleConfigurationElement(\"Module1.dll\", \"Test.Module1\", \"Module1\", false);\n                var module2 = new ModuleConfigurationElement(\"Module2.dll\", \"Test.Module2\", \"Module1\", false);\n                store.Modules = new[] { module2, module1 };\n                ConfigurationModuleCatalog catalog = new ConfigurationModuleCatalog() { Store = store };\n                catalog.Load();\n            });\n\n        }\n\n        [Fact]\n        public void EnumerateNotThrowsIfDuplicateAssemblyFile()\n        {\n            MockConfigurationStore store = new MockConfigurationStore();\n            var module1 = new ModuleConfigurationElement(\"Module1.dll\", \"Test.Module1\", \"Module1\", false);\n            var module2 = new ModuleConfigurationElement(\"Module1.dll\", \"Test.Module2\", \"Module2\", false);\n            store.Modules = new[] { module2, module1 };\n            ConfigurationModuleCatalog catalog = new ConfigurationModuleCatalog() { Store = store };\n            catalog.Load();\n\n            Assert.Equal(2, catalog.Modules.Count());\n        }\n\n        [Fact]\n        public void GetStartupLoadedModulesDoesntRetrieveOnDemandLoaded()\n        {\n            MockConfigurationStore store = new MockConfigurationStore();\n            var module1 = new ModuleConfigurationElement(\"Module1.dll\", \"Test.Module1\", \"Module1\", false);\n            store.Modules = new[] { module1 };\n\n            ConfigurationModuleCatalog catalog = new ConfigurationModuleCatalog() { Store = store };\n            catalog.Load();\n\n            Assert.Single(catalog.Modules);\n            Assert.Equal<int>(0, catalog.Modules.Count(m => m.InitializationMode != InitializationMode.OnDemand));\n        }\n\n        [Fact]\n        public void GetModulesNotThrownIfModuleSectionIsNotDeclared()\n        {\n            MockNullConfigurationStore store = new MockNullConfigurationStore();\n\n            ConfigurationModuleCatalog catalog = new ConfigurationModuleCatalog() { Store = store };\n            catalog.Load();\n\n            var modules = catalog.Modules;\n\n            Assert.NotNull(modules);\n            Assert.Empty(modules);\n        }\n\n        internal class MockNullConfigurationStore : IConfigurationStore\n        {\n            public ModulesConfigurationSection RetrieveModuleConfigurationSection()\n            {\n                return null;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Modularity/ConfigurationStoreFixture.Desktop.cs",
    "content": "﻿using Prism.Modularity;\nusing Xunit;\n\nnamespace Prism.Avalonia.Tests.Modularity\n{\n    public class ConfigurationStoreFixture\n    {\n        [Fact(Skip = \"Needs upgraded to Avalonia\")]\n        public void ShouldRetrieveModuleConfiguration()\n        {\n            ConfigurationStore store = new ConfigurationStore();\n            var section = store.RetrieveModuleConfigurationSection();\n\n            Assert.NotNull(section);\n            Assert.NotNull(section.Modules);\n            Assert.Single(section.Modules);\n            Assert.NotNull(section.Modules[0].AssemblyFile);\n            Assert.Equal(\"MockModuleA\", section.Modules[0].ModuleName);\n            Assert.NotNull(section.Modules[0].AssemblyFile);\n            Assert.Contains(@\"MocksModules\\MockModuleA.dll\", section.Modules[0].AssemblyFile);\n            Assert.NotNull(section.Modules[0].ModuleType);\n            Assert.True(section.Modules[0].StartupLoaded);\n            Assert.Equal(\"Prism.Avalonia.Tests.Mocks.Modules.MockModuleA\", section.Modules[0].ModuleType);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Modularity/DirectoryModuleCatalogFixture.Desktop.cs",
    "content": "﻿/*\n#if DEBUG\n\nusing System;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\nusing System.Reflection.Emit;\nusing System.Security.Policy;\nusing System.Threading;\nusing Prism.Modularity;\nusing Xunit;\n\nnamespace Prism.Avalonia.Tests.Modularity\n{\n    public class DirectoryModuleCatalogFixture : IDisposable\n    {\n        private const string ModulesDirectory1 = @\".\\DynamicModules\\MocksModules1\";\n        private const string ModulesDirectory2 = @\".\\DynamicModules\\AttributedModules\";\n        private const string ModulesDirectory3 = @\".\\DynamicModules\\DependantModules\";\n        private const string ModulesDirectory4 = @\".\\DynamicModules\\MocksModules2\";\n        private const string ModulesDirectory5 = @\".\\DynamicModules\\ModulesMainDomain\\\";\n        private const string ModulesDirectory6 = @\".\\DynamicModules\\Special char #\";\n        private const string InvalidModulesDirectory = @\".\\Modularity\";\n\n        public DirectoryModuleCatalogFixture()\n        {\n            CleanUpDirectories();\n        }\n\n        private void CleanUpDirectories()\n        {\n            CompilerHelper.CleanUpDirectory(ModulesDirectory1);\n            CompilerHelper.CleanUpDirectory(ModulesDirectory2);\n            CompilerHelper.CleanUpDirectory(ModulesDirectory3);\n            CompilerHelper.CleanUpDirectory(ModulesDirectory4);\n            CompilerHelper.CleanUpDirectory(ModulesDirectory5);\n            CompilerHelper.CleanUpDirectory(InvalidModulesDirectory);\n        }\n\n        [Fact]\n        public void NullPathThrows()\n        {\n            var ex = Assert.Throws<InvalidOperationException>(() =>\n            {\n                DirectoryModuleCatalog catalog = new DirectoryModuleCatalog();\n                catalog.Load();\n            });\n        }\n\n        [Fact]\n        public void EmptyPathThrows()\n        {\n            var ex = Assert.Throws<InvalidOperationException>(() =>\n            {\n                DirectoryModuleCatalog catalog = new DirectoryModuleCatalog\n                {\n                    ModulePath = string.Empty\n                };\n                catalog.Load();\n            });\n\n        }\n\n        [Fact]\n        public void NonExistentPathThrows()\n        {\n            var ex = Assert.Throws<InvalidOperationException>(() =>\n            {\n                DirectoryModuleCatalog catalog = new DirectoryModuleCatalog\n                {\n                    ModulePath = \"NonExistentPath\"\n                };\n                catalog.Load();\n            });\n        }\n\n        [Fact]\n        public void ShouldReturnAListOfModuleInfo()\n        {\n            CompilerHelper.CompileFile(@\"Prism.Avalonia.Tests.Mocks.Modules.MockModuleA.cs\",\n                                       ModulesDirectory1 + @\"\\MockModuleA.dll\");\n\n            DirectoryModuleCatalog catalog = new DirectoryModuleCatalog\n            {\n                ModulePath = ModulesDirectory1\n            };\n            catalog.Load();\n\n            var modules = catalog.Modules.ToArray();\n\n            Assert.NotNull(modules);\n            Assert.Single(modules);\n            Assert.NotNull(modules[0].Ref);\n            Assert.StartsWith(\"file://\", modules[0].Ref);\n            Assert.Contains(@\"MockModuleA.dll\", modules[0].Ref);\n            Assert.NotNull(modules[0].ModuleType);\n            Assert.Contains(\"Prism.Avalonia.Tests.Mocks.Modules.MockModuleA\", modules[0].ModuleType);\n        }\n\n        [Fact]\n        public void ShouldCorrectlyEscapeRef()\n        {\n            string assemblyPath = ModulesDirectory6 + @\"\\Mock Module #.dll\";\n            CompilerHelper.CompileFile(@\"Prism.Avalonia.Tests.Mocks.Modules.MockModuleA.cs\", assemblyPath);\n            string fullAssemblyPath = Path.GetFullPath(assemblyPath);\n\n            DirectoryModuleCatalog catalog = new DirectoryModuleCatalog\n            {\n                ModulePath = ModulesDirectory6\n            };\n            catalog.Load();\n\n            var modules = catalog.Modules.ToArray();\n\n            Assert.NotNull(modules);\n            Assert.Single(modules);\n            Assert.NotNull(modules[0].Ref);\n\n            string moduleRef = modules[0].Ref;\n            // = new Uri(moduleRef);\n            Assert.True(Uri.TryCreate(moduleRef, UriKind.Absolute, out Uri moduleUri));\n\n            Assert.Equal(fullAssemblyPath, moduleUri.LocalPath);\n        }\n\n        //TODO: figure out how ot translat ehtese tests to Xunit\n        //[Fact]\n        //[DeploymentItem(@\"Modularity\\NotAValidDotNetDll.txt.dll\", @\".\\Modularity\")]\n        //public void ShouldNotThrowWithNonValidDotNetAssembly()\n        //{\n        //    DirectoryModuleCatalog catalog = new DirectoryModuleCatalog\n        //    {\n        //        ModulePath = InvalidModulesDirectory\n        //    };\n        //    try\n        //    {\n        //        catalog.Load();\n        //    }\n        //    catch (Exception)\n        //    {\n        //        //Assert.Fail(\"Should not have thrown.\");\n        //    }\n\n        //    var modules = catalog.Modules.ToArray();\n        //    Assert.NotNull(modules);\n        //    Assert.Equal(0, modules.Length);\n        //}\n\n        //[Fact]\n        //[DeploymentItem(@\"Modularity\\NotAValidDotNetDll.txt.dll\", InvalidModulesDirectory)]\n        //public void LoadsValidAssembliesWhenInvalidDllsArePresent()\n        //{\n        //    CompilerHelper.CompileFile(@\"Prism.Avalonia.Tests.Mocks.Modules.MockModuleA.cs\",\n        //                               InvalidModulesDirectory + @\"\\MockModuleA.dll\");\n\n        //    DirectoryModuleCatalog catalog = new DirectoryModuleCatalog\n        //    {\n        //        ModulePath = InvalidModulesDirectory\n        //    };\n        //    try\n        //    {\n        //        catalog.Load();\n        //    }\n        //    catch (Exception)\n        //    {\n        //        //Assert.Fail(\"Should not have thrown.\");\n        //    }\n\n        //    var modules = catalog.Modules.ToArray();\n\n        //    Assert.NotNull(modules);\n        //    Assert.Equal(1, modules.Length);\n        //    Assert.NotNull(modules[0].Ref);\n        //    Assert.StartsWith(modules[0].Ref, \"file://\");\n        //    Assert.True(modules[0].Ref.Contains(@\"MockModuleA.dll\"));\n        //    Assert.NotNull(modules[0].ModuleType);\n        //    Assert.Contains(modules[0].ModuleType, \"Prism.Avalonia.Tests.Mocks.Modules.MockModuleA\");\n        //}\n\n        [Fact]\n        public void ShouldNotThrowWithLoadFromByteAssemblies()\n        {\n            CompilerHelper.CleanUpDirectory(@\".\\CompileOutput\\\");\n            CompilerHelper.CleanUpDirectory(@\".\\IgnoreLoadFromByteAssembliesTestDir\\\");\n            var results = CompilerHelper.CompileFile(@\"Prism.Avalonia.Tests.Mocks.Modules.MockModuleA.cs\",\n                                                     @\".\\CompileOutput\\MockModuleA.dll\");\n\n            CompilerHelper.CompileFile(@\"Prism.Avalonia.Tests.Mocks.Modules.MockAttributedModule.cs\",\n                                       @\".\\IgnoreLoadFromByteAssembliesTestDir\\MockAttributedModule.dll\");\n\n            string path = @\".\\IgnoreLoadFromByteAssembliesTestDir\";\n\n            AppDomain testDomain = null;\n            try\n            {\n                testDomain = CreateAppDomain();\n                RemoteDirectoryLookupCatalog remoteEnum = CreateRemoteDirectoryModuleCatalogInAppDomain(testDomain);\n\n                remoteEnum.LoadDynamicEmittedModule();\n\n                remoteEnum.LoadAssembliesByByte(@\".\\CompileOutput\\MockModuleA.dll\");\n\n                var infos = remoteEnum.DoEnumeration(path);\n\n                Assert.NotNull(\n                    infos.FirstOrDefault(x => x.ModuleType.IndexOf(\"Prism.Avalonia.Tests.Mocks.Modules.MockAttributedModule\") >= 0)\n                    );\n            }\n            finally\n            {\n                if (testDomain != null)\n                    AppDomain.Unload(testDomain);\n            }\n        }\n\n        [Fact]\n        public void ShouldGetModuleNameFromAttribute()\n        {\n            CompilerHelper.CompileFile(@\"Prism.Avalonia.Tests.Mocks.Modules.MockAttributedModule.cs\",\n                                       ModulesDirectory2 + @\"\\MockAttributedModule.dll\");\n\n            DirectoryModuleCatalog catalog = new DirectoryModuleCatalog\n            {\n                ModulePath = ModulesDirectory2\n            };\n            catalog.Load();\n\n            var modules = catalog.Modules.ToArray();\n\n            Assert.Single(modules);\n            Assert.Equal(\"TestModule\", modules[0].ModuleName);\n        }\n\n        [Fact]\n        public void ShouldGetDependantModulesFromAttribute()\n        {\n            CompilerHelper.CompileFile(@\"Prism.Avalonia.Tests.Mocks.Modules.MockDependencyModule.cs\",\n                                       ModulesDirectory3 + @\"\\DependencyModule.dll\");\n\n            CompilerHelper.CompileFile(@\"Prism.Avalonia.Tests.Mocks.Modules.MockDependantModule.cs\",\n                                       ModulesDirectory3 + @\"\\DependantModule.dll\");\n\n            DirectoryModuleCatalog catalog = new DirectoryModuleCatalog\n            {\n                ModulePath = ModulesDirectory3\n            };\n            catalog.Load();\n\n            var modules = catalog.Modules.ToArray();\n\n            Assert.Equal(2, modules.Length);\n            var dependantModule = modules.First(module => module.ModuleName == \"DependantModule\");\n            var dependencyModule = modules.First(module => module.ModuleName == \"DependencyModule\");\n            Assert.NotNull(dependantModule);\n            Assert.NotNull(dependencyModule);\n            Assert.NotNull(dependantModule.DependsOn);\n            Assert.Single(dependantModule.DependsOn);\n            Assert.Equal(dependencyModule.ModuleName, dependantModule.DependsOn[0]);\n        }\n\n        [Fact]\n        public void UseClassNameAsModuleNameWhenNotSpecifiedInAttribute()\n        {\n            CompilerHelper.CompileFile(@\"Prism.Avalonia.Tests.Mocks.Modules.MockModuleA.cs\",\n                                       ModulesDirectory1 + @\"\\MockModuleA.dll\");\n\n            DirectoryModuleCatalog catalog = new DirectoryModuleCatalog\n            {\n                ModulePath = ModulesDirectory1\n            };\n            catalog.Load();\n\n            var modules = catalog.Modules.ToArray();\n\n            Assert.NotNull(modules);\n            Assert.Equal(\"MockModuleA\", modules[0].ModuleName);\n        }\n\n        [Fact]\n        public void ShouldDefaultInitializationModeToWhenAvailable()\n        {\n            CompilerHelper.CompileFile(@\"Prism.Avalonia.Tests.Mocks.Modules.MockModuleA.cs\",\n                                       ModulesDirectory1 + @\"\\MockModuleA.dll\");\n\n            DirectoryModuleCatalog catalog = new DirectoryModuleCatalog\n            {\n                ModulePath = ModulesDirectory1\n            };\n            catalog.Load();\n\n            var modules = catalog.Modules.ToArray();\n\n            Assert.NotNull(modules);\n            Assert.Equal(InitializationMode.WhenAvailable, modules[0].InitializationMode);\n        }\n\n        [Fact]\n        public void ShouldGetOnDemandFromAttribute()\n        {\n            CompilerHelper.CompileFile(@\"Prism.Avalonia.Tests.Mocks.Modules.MockAttributedModule.cs\",\n                                       ModulesDirectory3 + @\"\\MockAttributedModule.dll\");\n\n            DirectoryModuleCatalog catalog = new DirectoryModuleCatalog\n            {\n                ModulePath = ModulesDirectory3\n            };\n            catalog.Load();\n\n            var modules = catalog.Modules.ToArray();\n\n            Assert.Single(modules);\n            Assert.Equal(InitializationMode.OnDemand, modules[0].InitializationMode);\n\n        }\n\n        [Fact]\n        public void ShouldNotLoadAssembliesInCurrentAppDomain()\n        {\n            CompilerHelper.CompileFile(@\"Prism.Avalonia.Tests.Mocks.Modules.MockModuleA.cs\",\n                                       ModulesDirectory4 + @\"\\MockModuleA.dll\");\n\n            DirectoryModuleCatalog catalog = new DirectoryModuleCatalog\n            {\n                ModulePath = ModulesDirectory4\n            };\n            catalog.Load();\n\n            var modules = catalog.Modules.ToArray();\n\n            // filtering out dynamic assemblies due to using a dynamic mocking framework.\n            Assembly loadedAssembly = AppDomain.CurrentDomain.GetAssemblies().Where(assembly => !assembly.IsDynamic)\n                .Where(assembly => assembly.Location.Equals(modules[0].Ref, StringComparison.InvariantCultureIgnoreCase))\n                .FirstOrDefault();\n            Assert.Null(loadedAssembly);\n        }\n\n        [Fact]\n        public void ShouldNotGetModuleInfoForAnAssemblyAlreadyLoadedInTheMainDomain()\n        {\n            var assemblyPath = Assembly.GetCallingAssembly().Location;\n            DirectoryModuleCatalog catalog = new DirectoryModuleCatalog\n            {\n                ModulePath = ModulesDirectory5\n            };\n            catalog.Load();\n\n            var modules = catalog.Modules.ToArray();\n\n            Assert.Empty(modules);\n        }\n\n        [Fact]\n        public void ShouldLoadAssemblyEvenIfTheyAreReferencingEachOther()\n        {\n            CompilerHelper.CompileFile(@\"Prism.Avalonia.Tests.Mocks.Modules.MockModuleA.cs\",\n                                       ModulesDirectory4 + @\"\\MockModuleZZZ.dll\");\n\n            CompilerHelper.CompileFile(@\"Prism.Avalonia.Tests.Mocks.Modules.MockModuleReferencingOtherModule.cs\",\n                                       ModulesDirectory4 + @\"\\MockModuleReferencingOtherModule.dll\", ModulesDirectory4 + @\"\\MockModuleZZZ.dll\");\n\n            DirectoryModuleCatalog catalog = new DirectoryModuleCatalog\n            {\n                ModulePath = ModulesDirectory4\n            };\n            catalog.Load();\n\n            var modules = catalog.Modules.ToArray();\n\n            Assert.Equal(2, modules.Count());\n        }\n        //Disabled Warning\t\n        // 'System.Security.Policy.Evidence.Count' is obsolete: '\n        // \"Evidence should not be treated as an ICollection. Please use GetHostEnumerator and GetAssemblyEnumerator to \n        // iterate over the evidence to collect a count.\"'\n#pragma warning disable 0618\n        [Fact]\n        public void CreateChildAppDomainHasParentEvidenceAndSetup()\n        {\n            TestableDirectoryModuleCatalog catalog = new TestableDirectoryModuleCatalog\n            {\n                ModulePath = ModulesDirectory4\n            };\n            catalog.Load();\n            Evidence parentEvidence = new Evidence();\n            AppDomainSetup parentSetup = new AppDomainSetup\n            {\n                ApplicationName = \"Test Parent\"\n            };\n            AppDomain parentAppDomain = AppDomain.CreateDomain(\"Parent\", parentEvidence, parentSetup);\n            AppDomain childDomain = catalog.BuildChildDomain(parentAppDomain);\n\n            Assert.Equal(parentEvidence.Count, childDomain.Evidence.Count);\n            Assert.Equal(\"Test Parent\", childDomain.SetupInformation.ApplicationName);\n            Assert.NotEqual(AppDomain.CurrentDomain.Evidence.Count, childDomain.Evidence.Count);\n            Assert.NotEqual(AppDomain.CurrentDomain.SetupInformation.ApplicationName, childDomain.SetupInformation.ApplicationName);\n        }\n#pragma warning restore 0618\n\n        [Fact]\n        public void ShouldLoadFilesEvenIfDynamicAssemblyExists()\n        {\n            CompilerHelper.CleanUpDirectory(@\".\\CompileOutput\\\");\n            CompilerHelper.CleanUpDirectory(@\".\\IgnoreDynamicGeneratedFilesTestDir\\\");\n            CompilerHelper.CompileFile(@\"Prism.Avalonia.Tests.Mocks.Modules.MockAttributedModule.cs\",\n                                       @\".\\IgnoreDynamicGeneratedFilesTestDir\\MockAttributedModule.dll\");\n\n            string path = @\".\\IgnoreDynamicGeneratedFilesTestDir\";\n\n            AppDomain testDomain = null;\n            try\n            {\n                testDomain = CreateAppDomain();\n                RemoteDirectoryLookupCatalog remoteEnum = CreateRemoteDirectoryModuleCatalogInAppDomain(testDomain);\n\n                remoteEnum.LoadDynamicEmittedModule();\n\n                var infos = remoteEnum.DoEnumeration(path);\n\n                Assert.NotNull(\n                    infos.FirstOrDefault(x => x.ModuleType.IndexOf(\"Prism.Avalonia.Tests.Mocks.Modules.MockAttributedModule\") >= 0)\n                    );\n            }\n            finally\n            {\n                if (testDomain != null)\n                    AppDomain.Unload(testDomain);\n            }\n        }\n\n        [Fact]\n        public void ShouldLoadAssemblyEvenIfIsExposingTypesFromAnAssemblyInTheGac()\n        {\n            CompilerHelper.CompileFile(@\"Prism.Avalonia.Tests.Mocks.Modules.MockExposingTypeFromGacAssemblyModule.cs\",\n                                       ModulesDirectory4 + @\"\\MockExposingTypeFromGacAssemblyModule.dll\", @\"System.Transactions.dll\");\n\n            DirectoryModuleCatalog catalog = new DirectoryModuleCatalog\n            {\n                ModulePath = ModulesDirectory4\n            };\n            catalog.Load();\n\n            var modules = catalog.Modules.ToArray();\n\n            Assert.Single(modules);\n        }\n\n        [Fact]\n        public void ShouldNotFailWhenAlreadyLoadedAssembliesAreAlsoFoundOnTargetDirectory()\n        {\n            CompilerHelper.CompileFile(@\"Prism.Avalonia.Tests.Mocks.Modules.MockModuleA.cs\",\n                                       ModulesDirectory1 + @\"\\MockModuleA.dll\");\n\n            string filename = typeof(DirectoryModuleCatalog).Assembly.Location;\n            string destinationFileName = Path.Combine(ModulesDirectory1, Path.GetFileName(filename));\n            File.Copy(filename, destinationFileName);\n\n            DirectoryModuleCatalog catalog = new DirectoryModuleCatalog\n            {\n                ModulePath = ModulesDirectory1\n            };\n            catalog.Load();\n\n            var modules = catalog.Modules.ToArray();\n            Assert.Single(modules);\n        }\n\n        [Fact]\n        public void ShouldIgnoreAbstractClassesThatImplementIModule()\n        {\n            CompilerHelper.CleanUpDirectory(ModulesDirectory1);\n            CompilerHelper.CompileFile(@\"Prism.Avalonia.Tests.Mocks.Modules.MockAbstractModule.cs\",\n                                     ModulesDirectory1 + @\"\\MockAbstractModule.dll\");\n\n            string filename = typeof(DirectoryModuleCatalog).Assembly.Location;\n            string destinationFileName = Path.Combine(ModulesDirectory1, Path.GetFileName(filename));\n            File.Copy(filename, destinationFileName);\n\n            DirectoryModuleCatalog catalog = new DirectoryModuleCatalog\n            {\n                ModulePath = ModulesDirectory1\n            };\n            catalog.Load();\n\n            var modules = catalog.Modules.ToArray();\n            Assert.Single(modules);\n            Assert.Equal(\"MockInheritingModule\", modules[0].ModuleName);\n\n            CompilerHelper.CleanUpDirectory(ModulesDirectory1);\n        }\n\n        private AppDomain CreateAppDomain()\n        {\n            Evidence evidence = AppDomain.CurrentDomain.Evidence;\n            AppDomainSetup setup = AppDomain.CurrentDomain.SetupInformation;\n\n            return AppDomain.CreateDomain(\"TestDomain\", evidence, setup);\n        }\n\n        private RemoteDirectoryLookupCatalog CreateRemoteDirectoryModuleCatalogInAppDomain(AppDomain testDomain)\n        {\n            RemoteDirectoryLookupCatalog remoteEnum;\n            Type remoteEnumType = typeof(RemoteDirectoryLookupCatalog);\n\n            remoteEnum = (RemoteDirectoryLookupCatalog)testDomain.CreateInstanceFrom(\n                                               remoteEnumType.Assembly.Location, remoteEnumType.FullName).Unwrap();\n            return remoteEnum;\n        }\n\n        public void Dispose()\n        {\n            CleanUpDirectories();\n        }\n\n        private class TestableDirectoryModuleCatalog : DirectoryModuleCatalog\n        {\n            public new AppDomain BuildChildDomain(AppDomain currentDomain)\n            {\n                return base.BuildChildDomain(currentDomain);\n            }\n        }\n\n        private class RemoteDirectoryLookupCatalog : MarshalByRefObject\n        {\n\n            public void LoadAssembliesByByte(string assemblyPath)\n            {\n                byte[] assemblyBytes = File.ReadAllBytes(assemblyPath);\n                AppDomain.CurrentDomain.Load(assemblyBytes);\n            }\n\n            public IModuleInfo[] DoEnumeration(string path)\n            {\n                DirectoryModuleCatalog catalog = new DirectoryModuleCatalog\n                {\n                    ModulePath = path\n                };\n                catalog.Load();\n                return catalog.Modules.ToArray();\n            }\n\n            public void LoadDynamicEmittedModule()\n            {\n                // create a dynamic assembly and module \n                AssemblyName assemblyName = new AssemblyName\n                {\n                    Name = \"DynamicBuiltAssembly\"\n                };\n                AssemblyBuilder assemblyBuilder = Thread.GetDomain().DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.RunAndSave);\n                ModuleBuilder module = assemblyBuilder.DefineDynamicModule(\"DynamicBuiltAssembly.dll\");\n\n                // create a new type\n                TypeBuilder typeBuilder = module.DefineType(\"DynamicBuiltType\", TypeAttributes.Public | TypeAttributes.Class);\n\n                // Create the type\n                Type helloWorldType = typeBuilder.CreateType();\n\n            }\n        }\n    }\n}\n#endif\n*/\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Modularity/FileModuleTypeLoaderFixture.Desktop.cs",
    "content": "using System;\nusing System.Collections.ObjectModel;\nusing Moq;\nusing Prism.Modularity;\nusing Xunit;\n\nnamespace Prism.Avalonia.Tests.Modularity\n{\n    public class FileModuleTypeLoaderFixture\n    {\n        [Fact(Skip = \"CompilerHelper.CompileCode needs updated\")]\n        public void CanRetrieveModule()\n        {\n            var assemblyResolver = new MockAssemblyResolver();\n            var retriever = new FileModuleTypeLoader(assemblyResolver);\n            string assembly = CompilerHelper.GenerateDynamicModule(\"FileModuleA\", null);\n            string assemblyRef = \"file://\" + assembly;\n            var fileModuleInfo = CreateModuleInfo(assemblyRef, \"TestModules.FileModuleAClass\", \"ModuleA\", true, null);\n\n            bool loadCompleted = false;\n            retriever.LoadModuleCompleted += delegate (object sender, LoadModuleCompletedEventArgs e)\n            {\n                loadCompleted = true;\n            };\n\n            retriever.LoadModuleType(fileModuleInfo);\n\n            Assert.True(loadCompleted);\n            Assert.Equal(assemblyRef, assemblyResolver.LoadAssemblyFromArgument);\n        }\n\n        [Fact]\n        public void ShouldReturnErrorToCallback()\n        {\n            var assemblyResolver = new MockAssemblyResolver();\n            var retriever = new FileModuleTypeLoader(assemblyResolver);\n            var fileModuleInfo = CreateModuleInfo(\"NonExistentFile.dll\", \"NonExistentModule\", \"NonExistent\", true, null);\n\n            assemblyResolver.ThrowOnLoadAssemblyFrom = true;\n            Exception resultException = null;\n\n            bool loadCompleted = false;\n            retriever.LoadModuleCompleted += delegate (object sender, LoadModuleCompletedEventArgs e)\n            {\n                loadCompleted = true;\n                resultException = e.Error;\n            };\n\n            retriever.LoadModuleType(fileModuleInfo);\n\n            Assert.True(loadCompleted);\n            Assert.NotNull(resultException);\n        }\n\n        [Fact]\n        public void CanRetrieveWithCorrectRef()\n        {\n            var retriever = new FileModuleTypeLoader();\n            var moduleInfo = new ModuleInfo() { Ref = \"file://somefile\" };\n\n            Assert.True(retriever.CanLoadModuleType(moduleInfo));\n        }\n\n        [Fact]\n        public void CannotRetrieveWithIncorrectRef()\n        {\n            var retriever = new FileModuleTypeLoader();\n            var moduleInfo = new ModuleInfo() { Ref = \"NotForLocalRetrieval\" };\n\n            Assert.False(retriever.CanLoadModuleType(moduleInfo));\n        }\n\n        [Fact]\n        public void FileModuleTypeLoaderCanBeDisposed()\n        {\n            var typeLoader = new FileModuleTypeLoader();\n            var disposable = typeLoader as IDisposable;\n\n            Assert.NotNull(disposable);\n        }\n\n        [Fact]\n        public void FileModuleTypeLoaderDisposeNukesAssemblyResolver()\n        {\n            Mock<IAssemblyResolver> mockResolver = new Mock<IAssemblyResolver>();\n            var disposableMockResolver = mockResolver.As<IDisposable>();\n            disposableMockResolver.Setup(resolver => resolver.Dispose());\n\n            var typeLoader = new FileModuleTypeLoader(mockResolver.Object);\n\n            typeLoader.Dispose();\n\n            disposableMockResolver.Verify(resolver => resolver.Dispose(), Times.Once());\n        }\n\n        [Fact]\n        public void FileModuleTypeLoaderDisposeDoesNotThrowWithNonDisposableAssemblyResolver()\n        {\n            Mock<IAssemblyResolver> mockResolver = new Mock<IAssemblyResolver>();\n            var typeLoader = new FileModuleTypeLoader(mockResolver.Object);\n            try\n            {\n                typeLoader.Dispose();\n            }\n            catch (Exception)\n            {\n                //Assert.Fail();\n            }\n        }\n\n        private static ModuleInfo CreateModuleInfo(string assemblyFile, string moduleType, string moduleName, bool startupLoaded, params string[] dependsOn)\n        {\n            ModuleInfo moduleInfo = new ModuleInfo(moduleName, moduleType)\n            {\n                InitializationMode = startupLoaded ? InitializationMode.WhenAvailable : InitializationMode.OnDemand,\n                Ref = assemblyFile,\n            };\n            if (dependsOn != null)\n            {\n                moduleInfo.DependsOn.AddRange(dependsOn);\n            }\n\n            return moduleInfo;\n        }\n    }\n\n    internal class MockAssemblyResolver : IAssemblyResolver\n    {\n        public string LoadAssemblyFromArgument;\n        public bool ThrowOnLoadAssemblyFrom;\n\n        public void LoadAssemblyFrom(string assemblyFilePath)\n        {\n            LoadAssemblyFromArgument = assemblyFilePath;\n            if (ThrowOnLoadAssemblyFrom)\n                throw new Exception();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Modularity/ModuleAttributeFixture.Desktop.cs",
    "content": "using Prism.Modularity;\nusing Xunit;\n\nnamespace Prism.Avalonia.Tests.Modularity\n{\n    public class ModuleAttributeFixture\n    {\n        [Fact]\n        public void StartupLoadedDefaultsToTrue()\n        {\n            var moduleAttribute = new ModuleAttribute();\n\n            Assert.False(moduleAttribute.OnDemand);\n        }\n\n        [Fact]\n        public void CanGetAndSetProperties()\n        {\n            var moduleAttribute = new ModuleAttribute();\n            moduleAttribute.ModuleName = \"Test\";\n            moduleAttribute.OnDemand = true;\n\n            Assert.Equal(\"Test\", moduleAttribute.ModuleName);\n            Assert.True(moduleAttribute.OnDemand);\n        }\n\n        [Fact]\n        public void ModuleDependencyAttributeStoresModuleName()\n        {\n            var moduleDependencyAttribute = new ModuleDependencyAttribute(\"Test\");\n\n            Assert.Equal(\"Test\", moduleDependencyAttribute.ModuleName);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Modularity/ModuleCatalogFixture.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Linq;\nusing Prism.Modularity;\nusing Xunit;\n\nnamespace Prism.Avalonia.Tests.Modularity\n{\n    public class ModuleCatalogFixture\n    {\n        [Fact]\n        public void CanCreateCatalogFromList()\n        {\n            var moduleInfo = new ModuleInfo(\"MockModule\", \"type\");\n            List<ModuleInfo> moduleInfos = new List<ModuleInfo> { moduleInfo };\n\n            var moduleCatalog = new ModuleCatalog(moduleInfos);\n\n            Assert.Single(moduleCatalog.Modules);\n            Assert.Equal(moduleInfo, moduleCatalog.Modules.ElementAt(0));\n        }\n\n        [Fact]\n        public void CanGetDependenciesForModule()\n        {\n            // A <- B\n            var moduleInfoA = CreateModuleInfo(\"A\");\n            var moduleInfoB = CreateModuleInfo(\"B\", \"A\");\n            List<ModuleInfo> moduleInfos = new List<ModuleInfo>\n                                               {\n                                                   moduleInfoA\n                                                   , moduleInfoB\n                                               };\n            var moduleCatalog = new ModuleCatalog(moduleInfos);\n\n            var dependentModules = moduleCatalog.GetDependentModules(moduleInfoB);\n\n            Assert.Single(dependentModules);\n            Assert.Equal(moduleInfoA, dependentModules.ElementAt(0));\n        }\n\n        [Fact]\n        public void CanCompleteListWithTheirDependencies()\n        {\n            // A <- B <- C\n            var moduleInfoA = CreateModuleInfo(\"A\");\n            var moduleInfoB = CreateModuleInfo(\"B\", \"A\");\n            var moduleInfoC = CreateModuleInfo(\"C\", \"B\");\n            var moduleInfoOrphan = CreateModuleInfo(\"X\", \"B\");\n\n            List<ModuleInfo> moduleInfos = new List<ModuleInfo>\n                                               {\n                                                   moduleInfoA\n                                                   , moduleInfoB\n                                                   , moduleInfoC\n                                                   , moduleInfoOrphan\n                                               };\n            var moduleCatalog = new ModuleCatalog(moduleInfos);\n\n            var dependantModules = moduleCatalog.CompleteListWithDependencies(new[] { moduleInfoC });\n\n            Assert.Equal(3, dependantModules.Count());\n            Assert.Contains(moduleInfoA, dependantModules);\n            Assert.Contains(moduleInfoB, dependantModules);\n            Assert.Contains(moduleInfoC, dependantModules);\n        }\n\n        [Fact]\n        public void ShouldThrowOnCyclicDependency()\n        {\n            var ex = Assert.Throws<CyclicDependencyFoundException>(() =>\n            {\n                // A <- B <- C <- A\n                var moduleInfoA = CreateModuleInfo(\"A\", \"C\");\n                var moduleInfoB = CreateModuleInfo(\"B\", \"A\");\n                var moduleInfoC = CreateModuleInfo(\"C\", \"B\");\n\n                List<ModuleInfo> moduleInfos = new List<ModuleInfo>\n                {\n                    moduleInfoA,\n                    moduleInfoB,\n                    moduleInfoC,\n                };\n                new ModuleCatalog(moduleInfos).Validate();\n            });\n\n        }\n\n        [Fact]\n        public void ShouldThrowOnDuplicateModule()\n        {\n            var ex = Assert.Throws<DuplicateModuleException>(() =>\n            {\n                var moduleInfoA1 = CreateModuleInfo(\"A\");\n                var moduleInfoA2 = CreateModuleInfo(\"A\");\n\n                List<ModuleInfo> moduleInfos = new List<ModuleInfo>\n                {\n                    moduleInfoA1,\n                    moduleInfoA2,\n                };\n                new ModuleCatalog(moduleInfos).Validate();\n            });\n        }\n\n        [Fact]\n        public void ShouldThrowOnMissingDependency()\n        {\n            var ex = Assert.Throws<ModularityException>(() =>\n            {\n                var moduleInfoA = CreateModuleInfo(\"A\", \"B\");\n\n                List<ModuleInfo> moduleInfos = new List<ModuleInfo>\n                {\n                    moduleInfoA,\n                };\n                new ModuleCatalog(moduleInfos).Validate();\n            });\n        }\n\n        [Fact]\n        public void CanAddModules()\n        {\n            var catalog = new ModuleCatalog();\n\n            catalog.AddModule(typeof(MockModule));\n\n            Assert.Single(catalog.Modules);\n            Assert.Equal(\"MockModule\", catalog.Modules.First().ModuleName);\n        }\n\n        [Fact]\n        public void CanAddGroups()\n        {\n            var catalog = new ModuleCatalog();\n\n            ModuleInfo moduleInfo = new ModuleInfo();\n            ModuleInfoGroup group = new ModuleInfoGroup { moduleInfo };\n            catalog.Items.Add(group);\n\n            Assert.Single(catalog.Modules);\n            Assert.Same(moduleInfo, catalog.Modules.ElementAt(0));\n        }\n\n        [Fact]\n        public void ShouldAggregateGroupsAndLooseModuleInfos()\n        {\n            var catalog = new ModuleCatalog();\n            ModuleInfo moduleInfo1 = new ModuleInfo();\n            ModuleInfo moduleInfo2 = new ModuleInfo();\n            ModuleInfo moduleInfo3 = new ModuleInfo();\n\n            catalog.Items.Add(new ModuleInfoGroup() { moduleInfo1 });\n            catalog.Items.Add(new ModuleInfoGroup() { moduleInfo2 });\n            catalog.AddModule(moduleInfo3);\n\n            Assert.Equal(3, catalog.Modules.Count());\n            Assert.Contains(moduleInfo1, catalog.Modules);\n            Assert.Contains(moduleInfo2, catalog.Modules);\n            Assert.Contains(moduleInfo3, catalog.Modules);\n        }\n\n        [Fact]\n        public void CompleteListWithDependenciesThrowsWithNull()\n        {\n            var ex = Assert.Throws<ArgumentNullException>(() =>\n            {\n                var catalog = new ModuleCatalog();\n                catalog.CompleteListWithDependencies(null);\n            });\n\n        }\n\n        [Fact]\n        public void LooseModuleIfDependentOnModuleInGroupThrows()\n        {\n            var catalog = new ModuleCatalog();\n            catalog.Items.Add(new ModuleInfoGroup() { CreateModuleInfo(\"ModuleA\") });\n            catalog.AddModule(CreateModuleInfo(\"ModuleB\", \"ModuleA\"));\n\n            try\n            {\n                catalog.Validate();\n            }\n            catch (Exception ex)\n            {\n                Assert.IsType<ModularityException>(ex);\n                Assert.Equal(\"ModuleB\", ((ModularityException)ex).ModuleName);\n\n                return;\n            }\n\n            //Assert.Fail(\"Exception not thrown.\");\n        }\n\n        [Fact]\n        public void ModuleInGroupDependsOnModuleInOtherGroupThrows()\n        {\n            var catalog = new ModuleCatalog();\n            catalog.Items.Add(new ModuleInfoGroup() { CreateModuleInfo(\"ModuleA\") });\n            catalog.Items.Add(new ModuleInfoGroup() { CreateModuleInfo(\"ModuleB\", \"ModuleA\") });\n\n            try\n            {\n                catalog.Validate();\n            }\n            catch (Exception ex)\n            {\n                Assert.IsType<ModularityException>(ex);\n                Assert.Equal(\"ModuleB\", ((ModularityException)ex).ModuleName);\n\n                return;\n            }\n\n            //Assert.Fail(\"Exception not thrown.\");\n        }\n\n        [Fact]\n        public void ShouldRevalidateWhenAddingNewModuleIfValidated()\n        {\n            var testableCatalog = new TestableModuleCatalog();\n            testableCatalog.Items.Add(new ModuleInfoGroup() { CreateModuleInfo(\"ModuleA\") });\n            testableCatalog.Validate();\n            testableCatalog.Items.Add(new ModuleInfoGroup() { CreateModuleInfo(\"ModuleB\") });\n            Assert.True(testableCatalog.ValidateCalled);\n        }\n\n        [Fact]\n        public void ModuleInGroupCanDependOnModuleInSameGroup()\n        {\n            var catalog = new ModuleCatalog();\n            var moduleA = CreateModuleInfo(\"ModuleA\");\n            var moduleB = CreateModuleInfo(\"ModuleB\", \"ModuleA\");\n            catalog.Items.Add(new ModuleInfoGroup()\n            {\n                moduleA,\n                moduleB,\n            });\n\n            var moduleBDependencies = catalog.GetDependentModules(moduleB);\n\n            Assert.Single(moduleBDependencies);\n            Assert.Equal(moduleA, moduleBDependencies.First());\n\n        }\n\n        [Fact]\n        public void StartupModuleDependentOnAnOnDemandModuleThrows()\n        {\n            var catalog = new ModuleCatalog();\n            var moduleOnDemand = CreateModuleInfo(\"ModuleA\");\n            moduleOnDemand.InitializationMode = InitializationMode.OnDemand;\n            catalog.AddModule(moduleOnDemand);\n            catalog.AddModule(CreateModuleInfo(\"ModuleB\", \"ModuleA\"));\n\n            try\n            {\n                catalog.Validate();\n            }\n            catch (Exception ex)\n            {\n                Assert.IsType<ModularityException>(ex);\n                Assert.Equal(\"ModuleB\", ((ModularityException)ex).ModuleName);\n\n                return;\n            }\n\n            //Assert.Fail(\"Exception not thrown.\");\n        }\n\n        [Fact]\n        public void ShouldReturnInCorrectRetrieveOrderWhenCompletingListWithDependencies()\n        {\n            // A <- B <- C <- D,    C <- X\n            var moduleA = CreateModuleInfo(\"A\");\n            var moduleB = CreateModuleInfo(\"B\", \"A\");\n            var moduleC = CreateModuleInfo(\"C\", \"B\");\n            var moduleD = CreateModuleInfo(\"D\", \"C\");\n            var moduleX = CreateModuleInfo(\"X\", \"C\");\n\n            var moduleCatalog = new ModuleCatalog();\n            // Add the modules in random order\n            moduleCatalog.AddModule(moduleB);\n            moduleCatalog.AddModule(moduleA);\n            moduleCatalog.AddModule(moduleD);\n            moduleCatalog.AddModule(moduleX);\n            moduleCatalog.AddModule(moduleC);\n\n            var dependantModules = moduleCatalog.CompleteListWithDependencies(new[] { moduleD, moduleX }).ToList();\n\n            Assert.Equal(5, dependantModules.Count);\n            Assert.True(dependantModules.IndexOf(moduleA) < dependantModules.IndexOf(moduleB));\n            Assert.True(dependantModules.IndexOf(moduleB) < dependantModules.IndexOf(moduleC));\n            Assert.True(dependantModules.IndexOf(moduleC) < dependantModules.IndexOf(moduleD));\n            Assert.True(dependantModules.IndexOf(moduleC) < dependantModules.IndexOf(moduleX));\n        }\n\n        [Fact]\n        public void ShouldLoadAndValidateOnInitialize()\n        {\n            var catalog = new TestableModuleCatalog();\n\n            var testableCatalog = new TestableModuleCatalog();\n            Assert.False(testableCatalog.LoadCalled);\n            Assert.False(testableCatalog.ValidateCalled);\n\n            testableCatalog.Initialize();\n            Assert.True(testableCatalog.LoadCalled);\n            Assert.True(testableCatalog.ValidateCalled);\n            Assert.True(testableCatalog.LoadCalledFirst);\n        }\n\n        [Fact]\n        public void ShouldNotLoadAgainIfInitializedCalledMoreThanOnce()\n        {\n            var catalog = new TestableModuleCatalog();\n\n            var testableCatalog = new TestableModuleCatalog();\n            Assert.False(testableCatalog.LoadCalled);\n            Assert.False(testableCatalog.ValidateCalled);\n\n            testableCatalog.Initialize();\n            Assert.Equal<int>(1, testableCatalog.LoadCalledCount);\n            testableCatalog.Initialize();\n            Assert.Equal<int>(1, testableCatalog.LoadCalledCount);\n        }\n\n        [Fact]\n        public void ShouldNotLoadAgainDuringInitialize()\n        {\n            var catalog = new TestableModuleCatalog();\n\n            var testableCatalog = new TestableModuleCatalog();\n            Assert.False(testableCatalog.LoadCalled);\n            Assert.False(testableCatalog.ValidateCalled);\n\n            testableCatalog.Load();\n            Assert.Equal<int>(1, testableCatalog.LoadCalledCount);\n            testableCatalog.Initialize();\n            Assert.Equal<int>(1, testableCatalog.LoadCalledCount);\n        }\n\n        [Fact]\n        public void ShouldAllowLoadToBeInvokedTwice()\n        {\n            var catalog = new TestableModuleCatalog();\n\n            var testableCatalog = new TestableModuleCatalog();\n            testableCatalog.Load();\n            Assert.Equal<int>(1, testableCatalog.LoadCalledCount);\n            testableCatalog.Load();\n            Assert.Equal<int>(2, testableCatalog.LoadCalledCount);\n        }\n\n        [Fact]\n        public void CanAddModule1()\n        {\n            ModuleCatalog catalog = new ModuleCatalog();\n\n            catalog.AddModule(\"Module\", \"ModuleType\", InitializationMode.OnDemand, \"DependsOn1\", \"DependsOn2\");\n\n            Assert.Single(catalog.Modules);\n            Assert.Equal(\"Module\", catalog.Modules.First().ModuleName);\n            Assert.Equal(\"ModuleType\", catalog.Modules.First().ModuleType);\n            Assert.Equal(InitializationMode.OnDemand, catalog.Modules.First().InitializationMode);\n            Assert.Equal(2, catalog.Modules.First().DependsOn.Count);\n            Assert.Equal(\"DependsOn1\", catalog.Modules.First().DependsOn[0]);\n            Assert.Equal(\"DependsOn2\", catalog.Modules.First().DependsOn[1]);\n        }\n\n        [Fact]\n        public void CanAddModule2()\n        {\n            ModuleCatalog catalog = new ModuleCatalog();\n\n            catalog.AddModule(\"Module\", \"ModuleType\", \"DependsOn1\", \"DependsOn2\");\n\n            Assert.Single(catalog.Modules);\n            Assert.Equal(\"Module\", catalog.Modules.First().ModuleName);\n            Assert.Equal(\"ModuleType\", catalog.Modules.First().ModuleType);\n            Assert.Equal(InitializationMode.WhenAvailable, catalog.Modules.First().InitializationMode);\n            Assert.Equal(2, catalog.Modules.First().DependsOn.Count);\n            Assert.Equal(\"DependsOn1\", catalog.Modules.First().DependsOn[0]);\n            Assert.Equal(\"DependsOn2\", catalog.Modules.First().DependsOn[1]);\n\n        }\n        [Fact]\n        public void CanAddModule3()\n        {\n            ModuleCatalog catalog = new ModuleCatalog();\n\n            catalog.AddModule(typeof(MockModule), InitializationMode.OnDemand, \"DependsOn1\", \"DependsOn2\");\n\n            Assert.Single(catalog.Modules);\n            Assert.Equal(\"MockModule\", catalog.Modules.First().ModuleName);\n            Assert.Equal(typeof(MockModule).AssemblyQualifiedName, catalog.Modules.First().ModuleType);\n            Assert.Equal(InitializationMode.OnDemand, catalog.Modules.First().InitializationMode);\n            Assert.Equal(2, catalog.Modules.First().DependsOn.Count);\n            Assert.Equal(\"DependsOn1\", catalog.Modules.First().DependsOn[0]);\n            Assert.Equal(\"DependsOn2\", catalog.Modules.First().DependsOn[1]);\n\n        }\n\n        [Fact]\n        public void CanAddModule4()\n        {\n            ModuleCatalog catalog = new ModuleCatalog();\n\n            catalog.AddModule(typeof(MockModule), \"DependsOn1\", \"DependsOn2\");\n\n            Assert.Single(catalog.Modules);\n            Assert.Equal(\"MockModule\", catalog.Modules.First().ModuleName);\n            Assert.Equal(typeof(MockModule).AssemblyQualifiedName, catalog.Modules.First().ModuleType);\n            Assert.Equal(InitializationMode.WhenAvailable, catalog.Modules.First().InitializationMode);\n            Assert.Equal(2, catalog.Modules.First().DependsOn.Count);\n            Assert.Equal(\"DependsOn1\", catalog.Modules.First().DependsOn[0]);\n            Assert.Equal(\"DependsOn2\", catalog.Modules.First().DependsOn[1]);\n\n        }\n\n        [Fact]\n        public void CanAddGroup()\n        {\n            ModuleCatalog catalog = new ModuleCatalog();\n\n            catalog.Items.Add(new ModuleInfoGroup());\n\n            catalog.AddGroup(InitializationMode.OnDemand, \"Ref1\",\n                             new ModuleInfo(\"M1\", \"T1\"),\n                             new ModuleInfo(\"M2\", \"T2\", \"M1\"));\n\n            Assert.Equal(2, catalog.Modules.Count());\n\n            var module1 = catalog.Modules.First();\n            var module2 = catalog.Modules.Skip(1).First();\n\n            Assert.Equal(\"M1\", module1.ModuleName);\n            Assert.Equal(\"T1\", module1.ModuleType);\n            Assert.Equal(\"Ref1\", module1.Ref);\n            Assert.Equal(InitializationMode.OnDemand, module1.InitializationMode);\n\n            Assert.Equal(\"M2\", module2.ModuleName);\n            Assert.Equal(\"T2\", module2.ModuleType);\n            Assert.Equal(\"Ref1\", module2.Ref);\n            Assert.Equal(InitializationMode.OnDemand, module2.InitializationMode);\n        }\n\n        private class TestableModuleCatalog : ModuleCatalog\n        {\n            public bool ValidateCalled { get; set; }\n            public bool LoadCalledFirst { get; set; }\n            public bool LoadCalled\n            {\n                get { return LoadCalledCount > 0; }\n            }\n            public int LoadCalledCount { get; set; }\n\n            public override void Validate()\n            {\n                ValidateCalled = true;\n                Validated = true;\n            }\n\n            protected override void InnerLoad()\n            {\n                if (ValidateCalled == false && !LoadCalled)\n                    LoadCalledFirst = true;\n\n                LoadCalledCount++;\n            }\n        }\n\n        private static ModuleInfo CreateModuleInfo(string name, params string[] dependsOn)\n        {\n            ModuleInfo moduleInfo = new ModuleInfo(name, name);\n            moduleInfo.DependsOn.AddRange(dependsOn);\n            return moduleInfo;\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Modularity/ModuleCatalogXaml/InvalidDependencyModuleCatalog.xaml",
    "content": "﻿<Modularity:ModuleCatalog xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n                          xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n                          xmlns:sys=\"clr-namespace:System;assembly=mscorlib\"\n                          xmlns:Modularity=\"clr-namespace:Prism.Modularity;assembly=Prism.Avalonia\">\n\n  <Modularity:ModuleInfoGroup Ref=\"ModuleGroup1\" InitializationMode=\"WhenAvailable\">\n\n    <Modularity:ModuleInfo ModuleName=\"Module1InModuleGroup2\" ModuleType=\"Module2Type\">\n      <Modularity:ModuleInfo.DependsOn>\n        <sys:String>InvalidModuleDependency</sys:String>\n      </Modularity:ModuleInfo.DependsOn>\n    </Modularity:ModuleInfo>\n\n    <Modularity:ModuleInfo ModuleName=\"Module2InModuleGroup2\" ModuleType=\"ModuleType\" />\n\n  </Modularity:ModuleInfoGroup>\n\n</Modularity:ModuleCatalog>\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Modularity/ModuleCatalogXaml/SimpleModuleCatalog.xaml",
    "content": "﻿<Modularity:ModuleCatalog xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n                          xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n                          xmlns:sys=\"clr-namespace:System;assembly=mscorlib\"\n                          xmlns:Modularity=\"clr-namespace:Prism.Modularity;assembly=Prism.Avalonia\">\n\n  <Modularity:ModuleInfoGroup Ref=\"ModuleGroup1\" InitializationMode=\"OnDemand\">\n    <Modularity:ModuleInfo ModuleName=\"Module1\" ModuleType=\"Module1Type\" />\n  </Modularity:ModuleInfoGroup>\n\n  <Modularity:ModuleInfoGroup Ref=\"ModuleGroup2\" InitializationMode=\"WhenAvailable\">\n\n    <Modularity:ModuleInfo ModuleName=\"Module2InModuleGroup2\" ModuleType=\"Module2Type\">\n      <Modularity:ModuleInfo.DependsOn>\n        <sys:String>Module3InModuleGroup2</sys:String>\n      </Modularity:ModuleInfo.DependsOn>\n    </Modularity:ModuleInfo>\n\n    <Modularity:ModuleInfo ModuleName=\"Module3InModuleGroup2\" ModuleType=\"ModuleType\" />\n\n  </Modularity:ModuleInfoGroup>\n\n  <Modularity:ModuleInfo Ref=\"file://Module3\" ModuleName=\"Module3\" ModuleType=\"Module3Type\" />\n\n  <Modularity:ModuleInfoGroup InitializationMode=\"OnDemand\">\n    <Modularity:ModuleInfo Ref=\"Module4\" ModuleName=\"Module4\" ModuleType=\"Module1Type\" />\n  </Modularity:ModuleInfoGroup>\n\n</Modularity:ModuleCatalog>\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Modularity/ModuleDependencySolverFixture.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing Prism.Modularity;\nusing Xunit;\n\nnamespace Prism.Avalonia.Tests.Modularity\n{\n    public class ModuleDependencySolverFixture\n    {\n        private ModuleDependencySolver solver;\n\n        public ModuleDependencySolverFixture()\n        {\n            solver = new ModuleDependencySolver();\n        }\n\n        [Fact]\n        public void ModuleDependencySolverIsAvailable()\n        {\n            Assert.NotNull(solver);\n        }\n\n        [Fact]\n        public void CanAddModuleName()\n        {\n            solver.AddModule(\"ModuleA\");\n            Assert.Equal(1, solver.ModuleCount);\n        }\n\n        [Fact]\n        public void CannotAddNullModuleName()\n        {\n            var ex = Assert.Throws<ArgumentException>(() =>\n            {\n                solver.AddModule(null);\n            });\n\n        }\n\n        [Fact]\n        public void CannotAddEmptyModuleName()\n        {\n            var ex = Assert.Throws<ArgumentException>(() =>\n            {\n                solver.AddModule(String.Empty);\n            });\n\n        }\n\n        [Fact]\n        public void CannotAddDependencyWithoutAddingModule()\n        {\n            var ex = Assert.Throws<ArgumentException>(() =>\n            {\n                solver.AddDependency(\"ModuleA\", \"ModuleB\");\n            });\n\n        }\n\n        [Fact]\n        public void CanAddModuleDepedency()\n        {\n            solver.AddModule(\"ModuleA\");\n            solver.AddModule(\"ModuleB\");\n            solver.AddDependency(\"ModuleB\", \"ModuleA\");\n            Assert.Equal(2, solver.ModuleCount);\n        }\n\n        [Fact]\n        public void CanSolveAcyclicDependencies()\n        {\n            solver.AddModule(\"ModuleA\");\n            solver.AddModule(\"ModuleB\");\n            solver.AddDependency(\"ModuleB\", \"ModuleA\");\n            string[] result = solver.Solve();\n            Assert.Equal(2, result.Length);\n            Assert.Equal(\"ModuleA\", result[0]);\n            Assert.Equal(\"ModuleB\", result[1]);\n        }\n\n        [Fact]\n        public void FailsWithSimpleCycle()\n        {\n            var ex = Assert.Throws<CyclicDependencyFoundException>(() =>\n            {\n                solver.AddModule(\"ModuleB\");\n                solver.AddDependency(\"ModuleB\", \"ModuleB\");\n                string[] result = solver.Solve();\n            });\n\n        }\n\n        [Fact]\n        public void CanSolveForest()\n        {\n            solver.AddModule(\"ModuleA\");\n            solver.AddModule(\"ModuleB\");\n            solver.AddModule(\"ModuleC\");\n            solver.AddModule(\"ModuleD\");\n            solver.AddModule(\"ModuleE\");\n            solver.AddModule(\"ModuleF\");\n            solver.AddDependency(\"ModuleC\", \"ModuleB\");\n            solver.AddDependency(\"ModuleB\", \"ModuleA\");\n            solver.AddDependency(\"ModuleE\", \"ModuleD\");\n            string[] result = solver.Solve();\n            Assert.Equal(6, result.Length);\n            List<string> test = new List<string>(result);\n            Assert.True(test.IndexOf(\"ModuleA\") < test.IndexOf(\"ModuleB\"));\n            Assert.True(test.IndexOf(\"ModuleB\") < test.IndexOf(\"ModuleC\"));\n            Assert.True(test.IndexOf(\"ModuleD\") < test.IndexOf(\"ModuleE\"));\n        }\n\n        [Fact]\n        public void FailsWithComplexCycle()\n        {\n            var ex = Assert.Throws<CyclicDependencyFoundException>(() =>\n            {\n                solver.AddModule(\"ModuleA\");\n                solver.AddModule(\"ModuleB\");\n                solver.AddModule(\"ModuleC\");\n                solver.AddModule(\"ModuleD\");\n                solver.AddModule(\"ModuleE\");\n                solver.AddModule(\"ModuleF\");\n                solver.AddDependency(\"ModuleC\", \"ModuleB\");\n                solver.AddDependency(\"ModuleB\", \"ModuleA\");\n                solver.AddDependency(\"ModuleE\", \"ModuleD\");\n                solver.AddDependency(\"ModuleE\", \"ModuleC\");\n                solver.AddDependency(\"ModuleF\", \"ModuleE\");\n                solver.AddDependency(\"ModuleD\", \"ModuleF\");\n                solver.AddDependency(\"ModuleB\", \"ModuleD\");\n                solver.Solve();\n            });\n\n        }\n\n        [Fact]\n        public void FailsWithMissingModule()\n        {\n            var ex = Assert.Throws<ModularityException>(() =>\n            {\n                solver.AddModule(\"ModuleA\");\n                solver.AddDependency(\"ModuleA\", \"ModuleB\");\n                solver.Solve();\n            });\n\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Modularity/ModuleInfoGroupExtensionsFixture.cs",
    "content": "using System;\nusing System.Linq;\nusing Prism.Ioc;\nusing Prism.Modularity;\nusing Xunit;\n\nnamespace Prism.Avalonia.Tests.Modularity\n{\n    /// <summary>\n    /// Summary description for ModuleInfoGroupExtensionsFixture\n    /// </summary>\n\n    public class ModuleInfoGroupExtensionsFixture\n    {\n        [Fact]\n        public void ShouldAddModuleToModuleInfoGroup()\n        {\n            string moduleName = \"MockModule\";\n            ModuleInfoGroup groupInfo = new ModuleInfoGroup();\n            groupInfo.AddModule(moduleName, typeof(MockModule));\n\n            Assert.Single(groupInfo);\n            Assert.Equal(moduleName, groupInfo.ElementAt(0).ModuleName);\n        }\n\n        [Fact]\n        public void ShouldSetModuleTypeCorrectly()\n        {\n            ModuleInfoGroup groupInfo = new ModuleInfoGroup();\n            groupInfo.AddModule(\"MockModule\", typeof(MockModule));\n\n            Assert.Single(groupInfo);\n            Assert.Equal(typeof(MockModule).AssemblyQualifiedName, groupInfo.ElementAt(0).ModuleType);\n        }\n\n        [Fact]\n        public void NullTypeThrows()\n        {\n            var ex = Assert.Throws<ArgumentNullException>(() =>\n            {\n                ModuleInfoGroup groupInfo = new ModuleInfoGroup();\n                groupInfo.AddModule(\"NullModule\", null);\n            });\n        }\n\n        [Fact]\n        public void ShouldSetDependencies()\n        {\n            string dependency1 = \"ModuleA\";\n            string dependency2 = \"ModuleB\";\n\n            ModuleInfoGroup groupInfo = new ModuleInfoGroup();\n            groupInfo.AddModule(\"MockModule\", typeof(MockModule), dependency1, dependency2);\n\n            Assert.NotNull(groupInfo.ElementAt(0).DependsOn);\n            Assert.Equal(2, groupInfo.ElementAt(0).DependsOn.Count);\n            Assert.Contains(dependency1, groupInfo.ElementAt(0).DependsOn);\n            Assert.Contains(dependency2, groupInfo.ElementAt(0).DependsOn);\n        }\n\n        [Fact]\n        public void ShouldUseTypeNameIfNoNameSpecified()\n        {\n            ModuleInfoGroup groupInfo = new ModuleInfoGroup();\n            groupInfo.AddModule(typeof(MockModule));\n\n            Assert.Single(groupInfo);\n            Assert.Equal(typeof(MockModule).Name, groupInfo.ElementAt(0).ModuleName);\n        }\n\n        public class MockModule : IModule\n        {\n            public void OnInitialized(IContainerProvider containerProvider)\n            {\n\n            }\n\n            public void RegisterTypes(IContainerRegistry containerRegistry)\n            {\n\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Modularity/ModuleInfoGroupFixture.cs",
    "content": "using Prism.Modularity;\nusing Xunit;\n\nnamespace Prism.Avalonia.Tests.Modularity\n{\n    public class ModuleInfoGroupFixture\n    {\n        [Fact]\n        public void ShouldForwardValuesToModuleInfo()\n        {\n            ModuleInfoGroup group = new ModuleInfoGroup();\n            group.Ref = \"MyCustomGroupRef\";\n            ModuleInfo moduleInfo = new ModuleInfo();\n            Assert.Null(moduleInfo.Ref);\n\n            group.Add(moduleInfo);\n\n            Assert.Equal(group.Ref, moduleInfo.Ref);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Modularity/ModuleInitializerFixture.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing Prism.Ioc;\nusing Prism.Modularity;\nusing Prism.Avalonia.Tests.Mocks;\nusing Xunit;\n\nnamespace Prism.Avalonia.Tests.Modularity\n{\n    /// <summary>\n    /// Summary description for ModuleInitializerFixture\n    /// </summary>\n    public class ModuleInitializerFixture\n    {\n        [Fact]\n        public void NullContainerThrows()\n        {\n            var ex = Assert.Throws<ArgumentNullException>(() =>\n            {\n                ModuleInitializer loader = new ModuleInitializer(null);\n            });\n        }\n\n        [Fact]\n        public void InitializationExceptionsAreWrapped()\n        {\n            var ex = Assert.Throws<ModuleInitializeException>(() =>\n            {\n                var moduleInfo = CreateModuleInfo(typeof(ExceptionThrowingModule));\n\n                ModuleInitializer loader = new ModuleInitializer(new MockContainerAdapter());\n\n                loader.Initialize(moduleInfo);\n            });\n        }\n\n        [Fact]\n        public void ShouldResolveModuleAndInitializeSingleModule()\n        {\n            IContainerExtension containerFacade = new MockContainerAdapter();\n            var service = new ModuleInitializer(containerFacade);\n            FirstTestModule.wasInitializedOnce = false;\n            var info = CreateModuleInfo(typeof(FirstTestModule));\n            service.Initialize(info);\n            Assert.True(FirstTestModule.wasInitializedOnce);\n        }\n\n        [Fact]\n        public void ShouldLogModuleInitializeErrorsAndContinueLoading()\n        {\n            IContainerExtension containerFacade = new MockContainerAdapter();\n            var service = new CustomModuleInitializerService(containerFacade);\n            var invalidModule = CreateModuleInfo(typeof(InvalidModule));\n\n            Assert.False(service.HandleModuleInitializerrorCalled);\n            service.Initialize(invalidModule);\n            Assert.True(service.HandleModuleInitializerrorCalled);\n        }\n\n        [Fact]\n        public void ShouldLogModuleInitializationError()\n        {\n            IContainerExtension containerFacade = new MockContainerAdapter();\n            var service = new ModuleInitializer(containerFacade);\n            ExceptionThrowingModule.wasInitializedOnce = false;\n            var exceptionModule = CreateModuleInfo(typeof(ExceptionThrowingModule));\n\n            try\n            {\n                service.Initialize(exceptionModule);\n            }\n            catch (ModuleInitializeException mie)\n            {\n                Assert.Contains(\"ExceptionThrowingModule\", mie.Message);\n            }\n        }\n\n        [Fact]\n        public void ShouldThrowExceptionIfBogusType()\n        {\n            var moduleInfo = new ModuleInfo(\"TestModule\", \"BadAssembly.BadType\");\n\n            ModuleInitializer loader = new ModuleInitializer(new MockContainerAdapter());\n\n            try\n            {\n                loader.Initialize(moduleInfo);\n                //Assert.Fail(\"Did not throw exception\");\n            }\n            catch (ModuleInitializeException ex)\n            {\n                Assert.Contains(\"BadAssembly.BadType\", ex.Message);\n            }\n            catch (Exception)\n            {\n                //Assert.Fail();\n            }\n        }\n\n        private static ModuleInfo CreateModuleInfo(Type type, params string[] dependsOn)\n        {\n            ModuleInfo moduleInfo = new ModuleInfo(type.Name, type.AssemblyQualifiedName);\n            moduleInfo.DependsOn.AddRange(dependsOn);\n            return moduleInfo;\n        }\n\n        public static class ModuleLoadTracker\n        {\n            public static readonly Stack<Type> ModuleLoadStack = new Stack<Type>();\n        }\n\n        public class FirstTestModule : IModule\n        {\n            public static bool wasInitializedOnce;\n\n            public void OnInitialized(IContainerProvider containerProvider)\n            {\n                wasInitializedOnce = true;\n                ModuleLoadTracker.ModuleLoadStack.Push(GetType());\n            }\n\n            public void RegisterTypes(IContainerRegistry containerRegistry)\n            {\n\n            }\n        }\n\n        public class SecondTestModule : IModule\n        {\n            public static bool wasInitializedOnce;\n            public static long initializedOnTickCount;\n\n            public void OnInitialized(IContainerProvider containerProvider)\n            {\n                wasInitializedOnce = true;\n                ModuleLoadTracker.ModuleLoadStack.Push(GetType());\n            }\n\n            public void RegisterTypes(IContainerRegistry containerRegistry)\n            {\n\n            }\n        }\n\n        public class DependantModule : IModule\n        {\n            public static bool wasInitializedOnce;\n\n            public void OnInitialized(IContainerProvider containerProvider)\n            {\n                wasInitializedOnce = true;\n                ModuleLoadTracker.ModuleLoadStack.Push(GetType());\n            }\n\n            public void RegisterTypes(IContainerRegistry containerRegistry)\n            {\n\n            }\n        }\n\n        public class DependencyModule : IModule\n        {\n            public static bool wasInitializedOnce;\n            public static long initializedOnTickCount;\n\n            public void OnInitialized(IContainerProvider containerProvider)\n            {\n                wasInitializedOnce = true;\n                ModuleLoadTracker.ModuleLoadStack.Push(GetType());\n            }\n\n            public void RegisterTypes(IContainerRegistry containerRegistry)\n            {\n\n            }\n        }\n\n        public class ExceptionThrowingModule : IModule\n        {\n            public static bool wasInitializedOnce;\n            public static long initializedOnTickCount;\n\n            public void OnInitialized(IContainerProvider containerProvider)\n            {\n                throw new InvalidOperationException(\"Intialization can't be performed\");\n            }\n\n            public void RegisterTypes(IContainerRegistry containerRegistry)\n            {\n                throw new NotImplementedException();\n            }\n        }\n\n        public class InvalidModule { }\n\n        public class CustomModuleInitializerService : ModuleInitializer\n        {\n            public bool HandleModuleInitializerrorCalled;\n\n            public CustomModuleInitializerService(IContainerExtension containerFacade)\n                : base(containerFacade)\n            {\n            }\n\n            public override void HandleModuleInitializationError(IModuleInfo moduleInfo, string assemblyName, Exception exception)\n            {\n                HandleModuleInitializerrorCalled = true;\n            }\n        }\n\n        public class Module1 : IModule\n        {\n            void IModule.OnInitialized(IContainerProvider containerProvider) { }\n            void IModule.RegisterTypes(IContainerRegistry containerRegistry) { }\n        }\n        public class Module2 : IModule\n        {\n            void IModule.OnInitialized(IContainerProvider containerProvider) { }\n            void IModule.RegisterTypes(IContainerRegistry containerRegistry) { }\n        }\n        public class Module3 : IModule\n        {\n            void IModule.OnInitialized(IContainerProvider containerProvider) { }\n            void IModule.RegisterTypes(IContainerRegistry containerRegistry) { }\n        }\n        public class Module4 : IModule\n        {\n            void IModule.OnInitialized(IContainerProvider containerProvider) { }\n            void IModule.RegisterTypes(IContainerRegistry containerRegistry) { }\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Modularity/ModuleManagerFixture.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing Moq;\nusing Prism.Avalonia.Tests.Mocks;\nusing Prism.Ioc;\nusing Prism.Modularity;\nusing Xunit;\n\nnamespace Prism.Avalonia.Tests.Modularity\n{\n    public class ModuleManagerFixture\n    {\n        [Fact]\n        public void NullLoaderThrows()\n        {\n            var ex = Assert.Throws<ArgumentNullException>(() =>\n            {\n                new ModuleManager(null, new MockModuleCatalog());\n            });\n        }\n\n        [Fact]\n        public void NullCatalogThrows()\n        {\n            var ex = Assert.Throws<ArgumentNullException>(() =>\n            {\n                new ModuleManager(new MockModuleInitializer(), null);\n            });\n        }\n\n        [Fact]\n        public void ShouldInvokeRetrieverForModules()\n        {\n            var loader = new MockModuleInitializer();\n            var moduleInfo = CreateModuleInfo(\"needsRetrieval\", InitializationMode.WhenAvailable);\n            var catalog = new MockModuleCatalog { Modules = { moduleInfo } };\n            ModuleManager manager = new ModuleManager(loader, catalog);\n            var moduleTypeLoader = new MockModuleTypeLoader();\n            manager.ModuleTypeLoaders = new List<IModuleTypeLoader> { moduleTypeLoader };\n\n            manager.Run();\n\n            Assert.Contains(moduleInfo, moduleTypeLoader.LoadedModules);\n        }\n\n        [Fact]\n        public void ShouldInitializeModulesOnRetrievalCompleted()\n        {\n            var loader = new MockModuleInitializer();\n            var backgroungModuleInfo = CreateModuleInfo(\"NeedsRetrieval\", InitializationMode.WhenAvailable);\n            var catalog = new MockModuleCatalog { Modules = { backgroungModuleInfo } };\n            ModuleManager manager = new ModuleManager(loader, catalog);\n            var moduleTypeLoader = new MockModuleTypeLoader();\n            manager.ModuleTypeLoaders = new List<IModuleTypeLoader> { moduleTypeLoader };\n            Assert.False(loader.InitializeCalled);\n\n            manager.Run();\n\n            Assert.True(loader.InitializeCalled);\n            Assert.Single(loader.InitializedModules);\n            Assert.Equal(backgroungModuleInfo, loader.InitializedModules[0]);\n        }\n\n        [Fact]\n        public void ShouldInitializeModuleOnDemand()\n        {\n            var loader = new MockModuleInitializer();\n            var onDemandModule = CreateModuleInfo(\"NeedsRetrieval\", InitializationMode.OnDemand);\n            var catalog = new MockModuleCatalog { Modules = { onDemandModule } };\n            ModuleManager manager = new ModuleManager(loader, catalog);\n            var moduleRetriever = new MockModuleTypeLoader();\n            manager.ModuleTypeLoaders = new List<IModuleTypeLoader> { moduleRetriever };\n            manager.Run();\n\n            Assert.False(loader.InitializeCalled);\n            Assert.Empty(moduleRetriever.LoadedModules);\n\n            manager.LoadModule(\"NeedsRetrieval\");\n\n            Assert.Single(moduleRetriever.LoadedModules);\n            Assert.True(loader.InitializeCalled);\n            Assert.Single(loader.InitializedModules);\n            Assert.Equal(onDemandModule, loader.InitializedModules[0]);\n        }\n\n        [Fact]\n        public void InvalidOnDemandModuleNameThrows()\n        {\n            var ex = Assert.Throws<ModuleNotFoundException>(() =>\n            {\n                var loader = new MockModuleInitializer();\n\n                var catalog = new MockModuleCatalog { Modules = new List<IModuleInfo> { CreateModuleInfo(\"Missing\", InitializationMode.OnDemand) } };\n\n                ModuleManager manager = new ModuleManager(loader, catalog);\n                var moduleTypeLoader = new MockModuleTypeLoader();\n\n                manager.ModuleTypeLoaders = new List<IModuleTypeLoader> { moduleTypeLoader };\n                manager.Run();\n\n                manager.LoadModule(\"NonExistent\");\n            });\n        }\n\n        [Fact]\n        public void EmptyOnDemandModuleReturnedThrows()\n        {\n            var ex = Assert.Throws<ModuleNotFoundException>(() =>\n            {\n                var loader = new MockModuleInitializer();\n\n                var catalog = new MockModuleCatalog { CompleteListWithDependencies = modules => new List<ModuleInfo>() };\n                ModuleManager manager = new ModuleManager(loader, catalog);\n                var moduleRetriever = new MockModuleTypeLoader();\n                manager.ModuleTypeLoaders = new List<IModuleTypeLoader> { moduleRetriever };\n                manager.Run();\n\n                manager.LoadModule(\"NullModule\");\n            });\n        }\n\n        [Fact]\n        public void ShouldNotLoadTypeIfModuleInitialized()\n        {\n            var loader = new MockModuleInitializer();\n            var alreadyPresentModule = CreateModuleInfo(typeof(MockModule), InitializationMode.WhenAvailable);\n            alreadyPresentModule.State = ModuleState.ReadyForInitialization;\n            var catalog = new MockModuleCatalog { Modules = { alreadyPresentModule } };\n            var manager = new ModuleManager(loader, catalog);\n            var moduleTypeLoader = new MockModuleTypeLoader();\n            manager.ModuleTypeLoaders = new List<IModuleTypeLoader> { moduleTypeLoader };\n\n            manager.Run();\n\n            Assert.DoesNotContain(alreadyPresentModule, moduleTypeLoader.LoadedModules);\n            Assert.True(loader.InitializeCalled);\n            Assert.Single(loader.InitializedModules);\n            Assert.Equal(alreadyPresentModule, loader.InitializedModules[0]);\n        }\n\n        [Fact]\n        public void ShouldNotLoadSameModuleTwice()\n        {\n            var loader = new MockModuleInitializer();\n            var onDemandModule = CreateModuleInfo(typeof(MockModule), InitializationMode.OnDemand);\n            var catalog = new MockModuleCatalog { Modules = { onDemandModule } };\n            var manager = new ModuleManager(loader, catalog);\n            manager.Run();\n            manager.LoadModule(\"MockModule\");\n            loader.InitializeCalled = false;\n            manager.LoadModule(\"MockModule\");\n\n            Assert.False(loader.InitializeCalled);\n        }\n\n        [Fact]\n        public void ShouldNotLoadModuleThatNeedsRetrievalTwice()\n        {\n            var loader = new MockModuleInitializer();\n            var onDemandModule = CreateModuleInfo(\"ModuleThatNeedsRetrieval\", InitializationMode.OnDemand);\n            var catalog = new MockModuleCatalog { Modules = { onDemandModule } };\n            var manager = new ModuleManager(loader, catalog);\n            var moduleTypeLoader = new MockModuleTypeLoader();\n            manager.ModuleTypeLoaders = new List<IModuleTypeLoader> { moduleTypeLoader };\n            manager.Run();\n            manager.LoadModule(\"ModuleThatNeedsRetrieval\");\n            moduleTypeLoader.RaiseLoadModuleCompleted(new LoadModuleCompletedEventArgs(onDemandModule, null));\n            loader.InitializeCalled = false;\n\n            manager.LoadModule(\"ModuleThatNeedsRetrieval\");\n\n            Assert.False(loader.InitializeCalled);\n        }\n\n        [Fact]\n        public void ShouldCallValidateCatalogBeforeGettingGroupsFromCatalog()\n        {\n            var loader = new MockModuleInitializer();\n            var catalog = new MockModuleCatalog();\n            var manager = new ModuleManager(loader, catalog);\n            bool validateCatalogCalled = false;\n            bool getModulesCalledBeforeValidate = false;\n\n            catalog.ValidateCatalog = () => validateCatalogCalled = true;\n            catalog.CompleteListWithDependencies = f =>\n            {\n                if (!validateCatalogCalled)\n                {\n                    getModulesCalledBeforeValidate = true;\n                }\n\n                return null;\n            };\n            manager.Run();\n\n            Assert.True(validateCatalogCalled);\n            Assert.False(getModulesCalledBeforeValidate);\n        }\n\n        [Fact]\n        public void ShouldNotInitializeIfDependenciesAreNotMet()\n        {\n            var loader = new MockModuleInitializer();\n            var requiredModule = CreateModuleInfo(\"ModuleThatNeedsRetrieval1\", InitializationMode.WhenAvailable);\n            requiredModule.ModuleName = \"RequiredModule\";\n            var dependantModuleInfo = CreateModuleInfo(\"ModuleThatNeedsRetrieval2\", InitializationMode.WhenAvailable, \"RequiredModule\");\n\n            var catalog = new MockModuleCatalog { Modules = { requiredModule, dependantModuleInfo } };\n            catalog.GetDependentModules = m => new[] { requiredModule };\n\n            ModuleManager manager = new ModuleManager(loader, catalog);\n            var moduleTypeLoader = new MockModuleTypeLoader();\n            manager.ModuleTypeLoaders = new List<IModuleTypeLoader> { moduleTypeLoader };\n\n            manager.Run();\n\n            moduleTypeLoader.RaiseLoadModuleCompleted(new LoadModuleCompletedEventArgs(dependantModuleInfo, null));\n\n            Assert.False(loader.InitializeCalled);\n            Assert.Empty(loader.InitializedModules);\n        }\n\n        [Fact]\n        public void ShouldInitializeIfDependenciesAreMet()\n        {\n            var initializer = new MockModuleInitializer();\n            var requiredModule = CreateModuleInfo(\"ModuleThatNeedsRetrieval1\", InitializationMode.WhenAvailable);\n            requiredModule.ModuleName = \"RequiredModule\";\n            var dependantModuleInfo = CreateModuleInfo(\"ModuleThatNeedsRetrieval2\", InitializationMode.WhenAvailable, \"RequiredModule\");\n\n            var catalog = new MockModuleCatalog { Modules = { requiredModule, dependantModuleInfo } };\n            catalog.GetDependentModules = delegate (IModuleInfo module)\n            {\n                if (module == dependantModuleInfo)\n                    return new[] { requiredModule };\n                else\n                    return null;\n            };\n\n            ModuleManager manager = new ModuleManager(initializer, catalog);\n            var moduleTypeLoader = new MockModuleTypeLoader();\n            manager.ModuleTypeLoaders = new List<IModuleTypeLoader> { moduleTypeLoader };\n\n            manager.Run();\n\n            Assert.True(initializer.InitializeCalled);\n            Assert.Equal(2, initializer.InitializedModules.Count);\n        }\n\n        [Fact]\n        public void ShouldThrowOnRetrieverErrorAndWrapException()\n        {\n            var loader = new MockModuleInitializer();\n            var moduleInfo = CreateModuleInfo(\"NeedsRetrieval\", InitializationMode.WhenAvailable);\n            var catalog = new MockModuleCatalog { Modules = { moduleInfo } };\n            ModuleManager manager = new ModuleManager(loader, catalog);\n            var moduleTypeLoader = new MockModuleTypeLoader();\n\n            Exception retrieverException = new Exception();\n            moduleTypeLoader.LoadCompletedError = retrieverException;\n\n            manager.ModuleTypeLoaders = new List<IModuleTypeLoader> { moduleTypeLoader };\n            Assert.False(loader.InitializeCalled);\n\n            try\n            {\n                manager.Run();\n            }\n            catch (Exception ex)\n            {\n                Assert.IsType<ModuleTypeLoadingException>(ex);\n                Assert.Equal(moduleInfo.ModuleName, ((ModularityException)ex).ModuleName);\n                Assert.Contains(moduleInfo.ModuleName, ex.Message);\n                Assert.Same(retrieverException, ex.InnerException);\n                return;\n            }\n\n            //Assert.Fail(\"Exception not thrown.\");\n        }\n\n        [Fact]\n        public void ShouldThrowIfNoRetrieverCanRetrieveModule()\n        {\n            var ex = Assert.Throws<ModuleTypeLoaderNotFoundException>(() =>\n            {\n\n                var loader = new MockModuleInitializer();\n                var catalog = new MockModuleCatalog { Modules = { CreateModuleInfo(\"ModuleThatNeedsRetrieval\", InitializationMode.WhenAvailable) } };\n                ModuleManager manager = new ModuleManager(loader, catalog)\n                {\n                    ModuleTypeLoaders = new List<IModuleTypeLoader> { new MockModuleTypeLoader() { canLoadModuleTypeReturnValue = false } }\n                };\n                manager.Run();\n            });\n        }\n\n        [Fact]\n        public void ShouldWorkIfModuleLoadsAnotherOnDemandModuleWhenInitializing()\n        {\n            var initializer = new StubModuleInitializer();\n            var onDemandModule = CreateModuleInfo(typeof(MockModule), InitializationMode.OnDemand);\n            onDemandModule.ModuleName = \"OnDemandModule\";\n            var moduleThatLoadsOtherModule = CreateModuleInfo(typeof(MockModule), InitializationMode.WhenAvailable);\n            var catalog = new MockModuleCatalog { Modules = { moduleThatLoadsOtherModule, onDemandModule } };\n            ModuleManager manager = new ModuleManager(initializer, catalog);\n\n            bool onDemandModuleWasInitialized = false;\n            initializer.Initialize = m =>\n            {\n                if (m == moduleThatLoadsOtherModule)\n                {\n                    manager.LoadModule(\"OnDemandModule\");\n                }\n                else if (m == onDemandModule)\n                {\n                    onDemandModuleWasInitialized = true;\n                }\n            };\n\n            manager.Run();\n\n            Assert.True(onDemandModuleWasInitialized);\n        }\n\n        [Fact]\n        public void ModuleManagerIsDisposable()\n        {\n            Mock<IModuleInitializer> mockInit = new Mock<IModuleInitializer>();\n            var moduleInfo = CreateModuleInfo(\"needsRetrieval\", InitializationMode.WhenAvailable);\n            var catalog = new Mock<IModuleCatalog>();\n            ModuleManager manager = new ModuleManager(mockInit.Object, catalog.Object);\n\n            IDisposable disposableManager = manager as IDisposable;\n            Assert.NotNull(disposableManager);\n        }\n\n        [Fact]\n        public void DisposeDoesNotThrowWithNonDisposableTypeLoaders()\n        {\n            Mock<IModuleInitializer> mockInit = new Mock<IModuleInitializer>();\n            var moduleInfo = CreateModuleInfo(\"needsRetrieval\", InitializationMode.WhenAvailable);\n            var catalog = new Mock<IModuleCatalog>();\n            ModuleManager manager = new ModuleManager(mockInit.Object, catalog.Object);\n\n            var mockTypeLoader = new Mock<IModuleTypeLoader>();\n            manager.ModuleTypeLoaders = new List<IModuleTypeLoader> { mockTypeLoader.Object };\n\n            try\n            {\n                manager.Dispose();\n            }\n            catch (Exception)\n            {\n                //Assert.Fail();\n            }\n        }\n\n        [Fact]\n        public void DisposeCleansUpDisposableTypeLoaders()\n        {\n            Mock<IModuleInitializer> mockInit = new Mock<IModuleInitializer>();\n            var moduleInfo = CreateModuleInfo(\"needsRetrieval\", InitializationMode.WhenAvailable);\n            var catalog = new Mock<IModuleCatalog>();\n            ModuleManager manager = new ModuleManager(mockInit.Object, catalog.Object);\n\n            var mockTypeLoader = new Mock<IModuleTypeLoader>();\n            var disposableMockTypeLoader = mockTypeLoader.As<IDisposable>();\n            disposableMockTypeLoader.Setup(loader => loader.Dispose());\n\n            manager.ModuleTypeLoaders = new List<IModuleTypeLoader> { mockTypeLoader.Object };\n\n            manager.Dispose();\n\n            disposableMockTypeLoader.Verify(loader => loader.Dispose(), Times.Once());\n        }\n\n        [Fact]\n        public void DisposeDoesNotThrowWithMixedTypeLoaders()\n        {\n            Mock<IModuleInitializer> mockInit = new Mock<IModuleInitializer>();\n            var moduleInfo = CreateModuleInfo(\"needsRetrieval\", InitializationMode.WhenAvailable);\n            var catalog = new Mock<IModuleCatalog>();\n            ModuleManager manager = new ModuleManager(mockInit.Object, catalog.Object);\n\n            var mockTypeLoader1 = new Mock<IModuleTypeLoader>();\n\n            var mockTypeLoader = new Mock<IModuleTypeLoader>();\n            var disposableMockTypeLoader = mockTypeLoader.As<IDisposable>();\n            disposableMockTypeLoader.Setup(loader => loader.Dispose());\n\n            manager.ModuleTypeLoaders = new List<IModuleTypeLoader>() { mockTypeLoader1.Object, mockTypeLoader.Object };\n\n            try\n            {\n                manager.Dispose();\n            }\n            catch (Exception)\n            {\n                //Assert.Fail();\n            }\n\n            disposableMockTypeLoader.Verify(loader => loader.Dispose(), Times.Once());\n        }\n        private static ModuleInfo CreateModuleInfo(string name, InitializationMode initializationMode, params string[] dependsOn)\n        {\n            ModuleInfo moduleInfo = new ModuleInfo(name, name)\n            {\n                InitializationMode = initializationMode\n            };\n            moduleInfo.DependsOn.AddRange(dependsOn);\n            return moduleInfo;\n        }\n\n        private static ModuleInfo CreateModuleInfo(Type type, InitializationMode initializationMode, params string[] dependsOn)\n        {\n            ModuleInfo moduleInfo = new ModuleInfo(type.Name, type.AssemblyQualifiedName)\n            {\n                InitializationMode = initializationMode\n            };\n            moduleInfo.DependsOn.AddRange(dependsOn);\n            return moduleInfo;\n        }\n    }\n\n    internal class MockModule : IModule\n    {\n        public void OnInitialized(IContainerProvider containerProvider)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RegisterTypes(IContainerRegistry containerRegistry)\n        {\n            throw new NotImplementedException();\n        }\n    }\n\n    internal class MockModuleCatalog : IModuleCatalog\n    {\n        public List<IModuleInfo> Modules = new List<IModuleInfo>();\n        public Func<IModuleInfo, IEnumerable<IModuleInfo>> GetDependentModules;\n\n        public Func<IEnumerable<IModuleInfo>, IEnumerable<IModuleInfo>> CompleteListWithDependencies;\n        public Action ValidateCatalog;\n\n        public void Initialize()\n        {\n            this.ValidateCatalog?.Invoke();\n        }\n\n        IEnumerable<IModuleInfo> IModuleCatalog.Modules => Modules;\n\n        IEnumerable<IModuleInfo> IModuleCatalog.GetDependentModules(IModuleInfo moduleInfo)\n        {\n            if (GetDependentModules == null)\n                return new List<IModuleInfo>();\n\n            return GetDependentModules(moduleInfo);\n        }\n\n        IEnumerable<IModuleInfo> IModuleCatalog.CompleteListWithDependencies(IEnumerable<IModuleInfo> modules)\n        {\n            if (CompleteListWithDependencies != null)\n                return CompleteListWithDependencies(modules);\n            return modules;\n        }\n\n        public IModuleCatalog AddModule(IModuleInfo moduleInfo)\n        {\n            this.Modules.Add(moduleInfo);\n            return this;\n        }\n    }\n\n    internal class MockModuleInitializer : IModuleInitializer\n    {\n        public bool InitializeCalled;\n        public List<IModuleInfo> InitializedModules = new List<IModuleInfo>();\n\n        public void Initialize(IModuleInfo moduleInfo)\n        {\n            InitializeCalled = true;\n            this.InitializedModules.Add(moduleInfo);\n        }\n    }\n\n    internal class StubModuleInitializer : IModuleInitializer\n    {\n        public Action<ModuleInfo> Initialize;\n\n        void IModuleInitializer.Initialize(IModuleInfo moduleInfo)\n        {\n            this.Initialize((ModuleInfo)moduleInfo);\n        }\n    }\n\n    internal class MockDelegateModuleInitializer : IModuleInitializer\n    {\n        public Action<ModuleInfo> LoadBody;\n\n        public void Initialize(IModuleInfo moduleInfo)\n        {\n            LoadBody((ModuleInfo)moduleInfo);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Mvvm/ViewModelLocatorFixture.cs",
    "content": "using System;\nusing System.Reflection;\nusing Prism.Mvvm;\nusing Prism.Avalonia.Tests.Mocks.ViewModels;\nusing Prism.Avalonia.Tests.Mocks.Views;\nusing Xunit;\n\nnamespace Prism.Avalonia.Tests.Mvvm\n{\n    public class ViewModelLocatorFixture\n    {\n        [StaFact(Skip = \"Runs alone but not in a group\")]\n        public void ShouldLocateViewModelWithDefaultSettings()\n        {\n            // Warning: flaky test. This runs by itself but not as a whole.\n            ResetViewModelLocationProvider();\n\n            Mock view = new Mock();\n            Assert.Null(view.DataContext);\n\n            ViewModelLocator.SetAutoWireViewModel(view, true);\n            Assert.NotNull(view.DataContext);\n            Assert.IsType<MockViewModel>(view.DataContext);\n        }\n\n        [StaFact]\n        public void ShouldLocateViewModelWithDefaultSettingsForViewsThatEndWithView()\n        {\n            ResetViewModelLocationProvider();\n\n            MockView view = new MockView();\n            Assert.Null(view.DataContext);\n\n            ViewModelLocator.SetAutoWireViewModel(view, true);\n            Assert.NotNull(view.DataContext);\n            Assert.IsType<MockViewModel>(view.DataContext);\n        }\n\n        [StaFact]\n        public void ShouldUseCustomDefaultViewModelFactoryWhenSet()\n        {\n            ResetViewModelLocationProvider();\n\n            Mock view = new Mock();\n            Assert.Null(view.DataContext);\n\n            object mockObject = new object();\n            ViewModelLocationProvider.SetDefaultViewModelFactory(viewType => mockObject);\n\n            ViewModelLocator.SetAutoWireViewModel(view, true);\n            Assert.NotNull(view.DataContext);\n            ReferenceEquals(view.DataContext, mockObject);\n        }\n\n        [StaFact]\n        public void ShouldUseCustomDefaultViewTypeToViewModelTypeResolverWhenSet()\n        {\n            ResetViewModelLocationProvider();\n\n            Mock view = new Mock();\n            Assert.Null(view.DataContext);\n\n            ViewModelLocationProvider.SetDefaultViewTypeToViewModelTypeResolver(viewType => typeof(ViewModelLocatorFixture));\n\n            ViewModelLocator.SetAutoWireViewModel(view, true);\n            Assert.NotNull(view.DataContext);\n            Assert.IsType<ViewModelLocatorFixture>(view.DataContext);\n        }\n\n        [StaFact]\n        public void ShouldUseCustomFactoryWhenSet()\n        {\n            ResetViewModelLocationProvider();\n\n            Mock view = new Mock();\n            Assert.Null(view.DataContext);\n\n            string viewModel = \"Test String\";\n            ViewModelLocationProvider.Register(view.GetType().ToString(), () => viewModel);\n\n            ViewModelLocator.SetAutoWireViewModel(view, true);\n            Assert.NotNull(view.DataContext);\n            ReferenceEquals(view.DataContext, viewModel);\n        }\n\n        internal static void ResetViewModelLocationProvider()\n        {\n            Type staticType = typeof(ViewModelLocationProvider);\n            ConstructorInfo ci = staticType.TypeInitializer;\n            object[] parameters = new object[0];\n            ci.Invoke(null, parameters);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Prism.Avalonia.Tests.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFramework>net10.0</TargetFramework>\n    <ImplicitUsings>false</ImplicitUsings>\n    <Nullable>enable</Nullable>\n    <IsPackable>false</IsPackable>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <Compile Remove=\"Mocks\\MockInteractionRequestAwareElement.cs\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"GitHubActionsTestLogger\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"Microsoft.NET.Test.Sdk\" />\n    <PackageReference Include=\"Moq\" />\n    <PackageReference Include=\"System.CodeDom\" />\n    <PackageReference Include=\"xunit\" />\n    <PackageReference Include=\"xunit.runner.visualstudio\">\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n      <PrivateAssets>all</PrivateAssets>\n    </PackageReference>\n    <PackageReference Include=\"coverlet.collector\">\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n      <PrivateAssets>all</PrivateAssets>\n    </PackageReference>\n    <PackageReference Include=\"Xunit.StaFact\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\..\\src\\Avalonia\\Prism.Avalonia\\Prism.Avalonia.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <Compile Include=\"..\\..\\..\\src\\Wpf\\Prism.Wpf\\Mvvm\\*.cs\" LinkBase=\"Mvvm\" />\n    <Using Include=\"Prism.Extensions\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <None Update=\"Modularity\\ModuleCatalogXaml\\InvalidDependencyModuleCatalog.xaml\">\n      <Generator>MSBuild:Compile</Generator>\n    </None>\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/PrismApplicationBaseFixture.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Avalonia.Controls;\nusing Avalonia.Styling;\nusing Moq;\nusing Prism.Events;\nusing Prism.Ioc;\nusing Prism.Modularity;\nusing Prism.Dialogs;\nusing Xunit;\nusing Prism.Navigation.Regions.Behaviors;\nusing Prism.Navigation.Regions;\n\nnamespace Prism.Avalonia.Tests\n{\n    /// <summary>Application Base Fixture</summary>\n    /// <remarks>\n    ///   TODO:\n    ///     - Application.Shutdown();\n    /// </remarks>\n    public class PrismApplicationSetup : IDisposable\n    {\n        public PrismApplication Application { get; set; }\n\n        public PrismApplicationSetup()\n        {\n            ContainerLocator.ResetContainer();\n            Application = new PrismApplication();\n            Application.Initialize();\n        }\n\n        public void Dispose()\n        {\n            ContainerLocator.ResetContainer();\n            //// WPF: Application.Shutdown();\n        }\n    }\n\n    public class PrismApplicationBaseFixture : IClassFixture<PrismApplicationSetup>\n    {\n        PrismApplication application = null;\n\n        public PrismApplicationBaseFixture(PrismApplicationSetup setup)\n        {\n            application = setup.Application;\n        }\n\n        [Fact]\n        public void applicationShouldCallConfigureViewModelLocator()\n        {\n            Assert.True(application.ConfigureViewModelLocatorWasCalled);\n        }\n\n        [Fact]\n        public void applicationShouldCallInitialize()\n        {\n            Assert.True(application.InitializeCalled);\n        }\n\n        [Fact]\n        public void applicationShouldCallCreateContainerExtension()\n        {\n            Assert.True(application.CreateContainerExtensionCalled);\n        }\n\n        [Fact]\n        public void applicationShouldCallCreateModuleCatalog()\n        {\n            Assert.True(application.CreateModuleCatalogCalled);\n        }\n\n        [Fact]\n        public void applicationShouldCallRegisterRequiredTypes()\n        {\n            Assert.True(application.RegisterRequiredTypesCalled);\n        }\n\n        [Fact]\n        public void applicationShouldCallRegisterTypes()\n        {\n            Assert.True(application.RegisterTypesWasCalled);\n        }\n\n        [Fact]\n        public void applicationShouldCallConfigureDefaultRegionBehaviors()\n        {\n            Assert.True(application.ConfigureDefaultRegionBehaviorsCalled);\n        }\n\n        [Fact]\n        public void applicationShouldCallConfigureRegionAdapterMappings()\n        {\n            Assert.True(application.ConfigureRegionAdapterMappingsCalled);\n        }\n\n        [Fact]\n        public void applicationShouldCallRegisterFrameworkExceptionTypes()\n        {\n            Assert.True(application.RegisterFrameworkExceptionTypesCalled);\n        }\n\n        [Fact]\n        public void applicationShouldCallCreateShell()\n        {\n            Assert.True(application.CreateShellWasCalled);\n        }\n\n        [Fact]\n        public void applicationShouldCallInitializeShell()\n        {\n            //in our mock Shell is null, so this INitializeShell should not be called by the application\n            Assert.False(application.InitializeShellWasCalled);\n        }\n\n        [Fact]\n        public void applicationShouldCallOnInitialized()\n        {\n            Assert.True(application.OnInitializedWasCalled);\n        }\n\n        [Fact]\n        public void applicationShouldCallConfigureModuleCatalog()\n        {\n            Assert.True(application.ConfigureModuleCatalogCalled);\n        }\n\n        [Fact]\n        public void applicationShouldCallInitializeModules()\n        {\n            Assert.True(application.InitializeModulesCalled);\n        }\n\n        [Fact]\n        public void CreateModuleCatalogShouldReturnDefaultModuleCatalog()\n        {\n            Assert.NotNull(application.DefaultModuleCatalog);\n        }\n\n        [Fact]\n        public void ConfigureRegionAdapterMappingsShouldRegisterItemsControlMapping()\n        {\n            Assert.NotNull(application.DefaultRegionAdapterMappings);\n            Assert.NotNull(application.DefaultRegionAdapterMappings.GetMapping(typeof(ItemsControl)));\n        }\n\n        [Fact(Skip = \"Selector is currently not implemented.\")]\n        public void ConfigureRegionAdapterMappingsShouldRegisterSelectorMapping()\n        {\n            Assert.NotNull(application.DefaultRegionAdapterMappings);\n            Assert.NotNull(application.DefaultRegionAdapterMappings.GetMapping(typeof(Selector)));\n        }\n\n        [Fact]\n        public void ConfigureRegionAdapterMappingsShouldRegisterContentControlMapping()\n        {\n            Assert.NotNull(application.DefaultRegionAdapterMappings);\n            Assert.NotNull(application.DefaultRegionAdapterMappings.GetMapping(typeof(ContentControl)));\n        }\n\n        [Fact]\n        public void ConfigureDefaultRegionBehaviorsShouldAddAutoPopulateRegionBehavior()\n        {\n            Assert.True(application.DefaultRegionBehaviorTypes.ContainsKey(AutoPopulateRegionBehavior.BehaviorKey));\n        }\n\n        [Fact]\n        public void ConfigureDefaultRegionBehaviorsShouldBindRegionContextToAvaloniaObjectBehavior()\n        {\n            Assert.True(application.DefaultRegionBehaviorTypes.ContainsKey(BindRegionContextToAvaloniaObjectBehavior.BehaviorKey));\n        }\n\n        [Fact]\n        public void ConfigureDefaultRegionBehaviorsShouldAddRegionActiveAwareBehavior()\n        {\n            Assert.True(application.DefaultRegionBehaviorTypes.ContainsKey(RegionActiveAwareBehavior.BehaviorKey));\n        }\n\n        [Fact]\n        public void ConfigureDefaultRegionBehaviorsShouldAddSyncRegionContextWithHostBehavior()\n        {\n            Assert.True(application.DefaultRegionBehaviorTypes.ContainsKey(SyncRegionContextWithHostBehavior.BehaviorKey));\n        }\n\n        [Fact]\n        public void ConfigureDefaultRegionBehaviorsShouldAddRegionManagerRegistrationBehavior()\n        {\n            Assert.True(application.DefaultRegionBehaviorTypes.ContainsKey(RegionManagerRegistrationBehavior.BehaviorKey));\n        }\n\n        [Fact]\n        public void ConfigureDefaultRegionBehaviorsShouldAddRegionLifetimeBehavior()\n        {\n            Assert.True(application.DefaultRegionBehaviorTypes.ContainsKey(RegionMemberLifetimeBehavior.BehaviorKey));\n        }\n\n        [Fact]\n        public void RequiredTypesAreRegistered()\n        {\n            application.MockContainer.Verify(x => x.RegisterInstance(typeof(IModuleCatalog), It.IsAny<IModuleCatalog>()), Times.Once);\n\n            application.MockContainer.Verify(x => x.RegisterSingleton(typeof(IDialogService), typeof(DialogService)), Times.Once);\n            application.MockContainer.Verify(x => x.RegisterSingleton(typeof(IModuleInitializer), typeof(ModuleInitializer)), Times.Once);\n            application.MockContainer.Verify(x => x.RegisterSingleton(typeof(IModuleManager), typeof(ModuleManager)), Times.Once);\n            application.MockContainer.Verify(x => x.RegisterSingleton(typeof(RegionAdapterMappings), typeof(RegionAdapterMappings)), Times.Once);\n            application.MockContainer.Verify(x => x.RegisterSingleton(typeof(IRegionManager), typeof(RegionManager)), Times.Once);\n            application.MockContainer.Verify(x => x.RegisterSingleton(typeof(IRegionNavigationContentLoader), typeof(RegionNavigationContentLoader)), Times.Once);\n            application.MockContainer.Verify(x => x.RegisterSingleton(typeof(IEventAggregator), typeof(EventAggregator)), Times.Once);\n            application.MockContainer.Verify(x => x.RegisterSingleton(typeof(IRegionViewRegistry), typeof(RegionViewRegistry)), Times.Once);\n            application.MockContainer.Verify(x => x.RegisterSingleton(typeof(IRegionBehaviorFactory), typeof(RegionBehaviorFactory)), Times.Once);\n\n            application.MockContainer.Verify(x => x.Register(typeof(IRegionNavigationJournalEntry), typeof(RegionNavigationJournalEntry)), Times.Once);\n            application.MockContainer.Verify(x => x.Register(typeof(IRegionNavigationJournal), typeof(RegionNavigationJournal)), Times.Once);\n            application.MockContainer.Verify(x => x.Register(typeof(IRegionNavigationService), typeof(RegionNavigationService)), Times.Once);\n            application.MockContainer.Verify(x => x.Register(typeof(IDialogWindow), typeof(DialogWindow)), Times.Once);\n        }\n    }\n\n    public class PrismApplication : PrismApplicationBase\n    {\n        public Mock<IContainerExtension> MockContainer { get; private set; }\n\n        public IModuleCatalog DefaultModuleCatalog => Container.Resolve<IModuleCatalog>();\n\n        public IRegionBehaviorFactory DefaultRegionBehaviorTypes => Container.Resolve<IRegionBehaviorFactory>();\n\n        public RegionAdapterMappings DefaultRegionAdapterMappings => Container.Resolve<RegionAdapterMappings>();\n\n        public bool ConfigureViewModelLocatorWasCalled { get; set; }\n        public bool CreateShellWasCalled { get; set; }\n        public bool InitializeShellWasCalled { get; set; }\n        public bool OnInitializedWasCalled { get; set; }\n        public bool RegisterTypesWasCalled { get; set; }\n        public bool InitializeModulesCalled { get; internal set; }\n        public bool ConfigureModuleCatalogCalled { get; internal set; }\n        public bool RegisterFrameworkExceptionTypesCalled { get; internal set; }\n        public bool ConfigureRegionAdapterMappingsCalled { get; internal set; }\n        public bool ConfigureDefaultRegionBehaviorsCalled { get; internal set; }\n        public bool RegisterRequiredTypesCalled { get; internal set; }\n        public bool CreateModuleCatalogCalled { get; internal set; }\n        public bool CreateContainerExtensionCalled { get; internal set; }\n        public bool InitializeCalled { get; internal set; }\n\n        public override void Initialize()\n        {\n            InitializeCalled = true;\n\n            ContainerLocator.ResetContainer();\n            MockContainer = new Mock<IContainerExtension>();\n\n            base.Initialize();\n        }\n\n        protected override IContainerExtension CreateContainerExtension()\n        {\n            CreateContainerExtensionCalled = true;\n            return MockContainer.Object;\n        }\n\n        protected override void ConfigureViewModelLocator()\n        {\n            ConfigureViewModelLocatorWasCalled = true;\n            //setting this breaks other tests using VML. \n            //We need to revist those tests to ensure it is being reset each time.\n            //base.ConfigureViewModelLocator();\n        }\n\n        protected override IModuleCatalog CreateModuleCatalog()\n        {\n            CreateModuleCatalogCalled = true;\n\n            var moduleCatalog = base.CreateModuleCatalog();\n            MockContainer.Setup(x => x.Resolve(typeof(IModuleCatalog))).Returns(moduleCatalog);\n            return moduleCatalog;\n        }\n\n        protected override Window CreateShell()\n        {\n            CreateShellWasCalled = true;\n            return null;\n        }\n\n        protected virtual void InitializeShell(Window shell)\n        {\n            InitializeShellWasCalled = false;\n            base.InitializeShell(shell);\n        }\n\n        protected override void RegisterRequiredTypes(IContainerRegistry containerRegistry)\n        {\n            RegisterRequiredTypesCalled = true;\n\n            base.RegisterRequiredTypes(containerRegistry);\n\n            var moduleInitializer = new ModuleInitializer(MockContainer.Object);\n            MockContainer.Setup(x => x.Resolve(typeof(IModuleInitializer))).Returns(moduleInitializer);\n            MockContainer.Setup(x => x.Resolve(typeof(IModuleManager))).Returns(new ModuleManager(moduleInitializer, DefaultModuleCatalog));\n            MockContainer.Setup(x => x.Resolve(typeof(IRegionBehaviorFactory))).Returns(new RegionBehaviorFactory(MockContainer.Object));\n\n            var regionBehaviorFactory = new RegionBehaviorFactory(MockContainer.Object);\n            MockContainer.Setup(x => x.Resolve(typeof(IRegionBehaviorFactory))).Returns(regionBehaviorFactory);\n\n            MockContainer.Setup(x => x.Resolve(typeof(RegionAdapterMappings))).Returns(new RegionAdapterMappings());\n            ////MockContainer.Setup(x => x.Resolve(typeof(SelectorRegionAdapter))).Returns(new SelectorRegionAdapter(regionBehaviorFactory));       // From Prism.WPF\n            MockContainer.Setup(x => x.Resolve(typeof(ItemsControlRegionAdapter))).Returns(new ItemsControlRegionAdapter(regionBehaviorFactory));\n            MockContainer.Setup(x => x.Resolve(typeof(ContentControlRegionAdapter))).Returns(new ContentControlRegionAdapter(regionBehaviorFactory));\n        }\n\n        protected override void RegisterTypes(IContainerRegistry containerRegistry)\n        {\n            RegisterTypesWasCalled = true;\n        }\n\n        protected override void OnInitialized()\n        {\n            OnInitializedWasCalled = true;\n        }\n\n        protected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog)\n        {\n            ConfigureModuleCatalogCalled = true;\n            base.ConfigureModuleCatalog(moduleCatalog);\n        }\n\n        protected override void InitializeModules()\n        {\n            InitializeModulesCalled = true;\n            base.InitializeModules();\n        }\n\n        protected override void RegisterFrameworkExceptionTypes()\n        {\n            RegisterFrameworkExceptionTypesCalled = true;\n            base.RegisterFrameworkExceptionTypes();\n        }\n\n        protected override void ConfigureRegionAdapterMappings(RegionAdapterMappings regionAdapterMappings)\n        {\n            ConfigureRegionAdapterMappingsCalled = true;\n            base.ConfigureRegionAdapterMappings(regionAdapterMappings);\n        }\n\n        protected override void ConfigureDefaultRegionBehaviors(IRegionBehaviorFactory regionBehaviors)\n        {\n            ConfigureDefaultRegionBehaviorsCalled = true;\n            base.ConfigureDefaultRegionBehaviors(regionBehaviors);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/PrismBootstrapperBaseFixture.cs",
    "content": "using Avalonia;\nusing Avalonia.Controls;\nusing Moq;\nusing Prism.Events;\nusing Prism.Ioc;\nusing Prism.Modularity;\nusing Prism.Dialogs;\nusing Xunit;\nusing Prism.Navigation.Regions.Behaviors;\nusing Prism.Navigation.Regions;\nusing System;\n\nnamespace Prism\n{\n    /// <summary>Bootstrapper Fixture</summary>\n    /// <remarks>\n    ///   TODO Items:\n    ///     - public void ConfigureRegionAdapterMappingsShouldRegisterSelectorMapping() ...\n    ///     - MockContainer.Setup(x => x.Resolve(typeof(SelectorRegionAdapter...\n    /// </remarks>\n    public class PrismBootstapperSetup : IDisposable\n    {\n        public PrismBootstrapper Bootstrapper { get; set; }\n\n        public PrismBootstapperSetup()\n        {\n            ContainerLocator.ResetContainer();\n            Bootstrapper = new PrismBootstrapper();\n            Bootstrapper.Run();\n        }\n\n        public void Dispose()\n        {\n            ContainerLocator.ResetContainer();\n        }\n    }\n\n    /// <summary>Bootstrapping base fixture</summary>\n    /// <remarks>This passes when running by itself; fails when ran as a whole.</remarks>\n    public class PrismBootstapperBaseFixture : IClassFixture<PrismBootstapperSetup>\n    {\n        PrismBootstrapper bootstrapper = null;\n\n        public PrismBootstapperBaseFixture(PrismBootstapperSetup setup)\n        {\n            bootstrapper = setup.Bootstrapper;\n        }\n\n        [Fact]\n        public void BootstrapperShouldCallConfigureViewModelLocator()\n        {\n            Assert.True(bootstrapper.ConfigureViewModelLocatorWasCalled);\n        }\n\n        [Fact]\n        public void BootstrapperShouldCallInitialize()\n        {\n            Assert.True(bootstrapper.InitializeCalled);\n        }\n\n        [Fact]\n        public void BootstrapperShouldCallCreateContainerExtension()\n        {\n            Assert.True(bootstrapper.CreateContainerExtensionCalled);\n        }\n\n        [Fact]\n        public void BootstrapperShouldCallCreateModuleCatalog()\n        {\n            Assert.True(bootstrapper.CreateModuleCatalogCalled);\n        }\n\n        [Fact]\n        public void BootstrapperShouldCallRegisterRequiredTypes()\n        {\n            Assert.True(bootstrapper.RegisterRequiredTypesCalled);\n        }\n\n        [Fact]\n        public void BootstrapperShouldCallRegisterTypes()\n        {\n            Assert.True(bootstrapper.RegisterTypesWasCalled);\n        }\n\n        [Fact]\n        public void BootstrapperShouldCallConfigureDefaultRegionBehaviors()\n        {\n            Assert.True(bootstrapper.ConfigureDefaultRegionBehaviorsCalled);\n        }\n\n        [Fact]\n        public void BootstrapperShouldCallConfigureRegionAdapterMappings()\n        {\n            Assert.True(bootstrapper.ConfigureRegionAdapterMappingsCalled);\n        }\n\n        [Fact]\n        public void BootstrapperShouldCallRegisterFrameworkExceptionTypes()\n        {\n            Assert.True(bootstrapper.RegisterFrameworkExceptionTypesCalled);\n        }\n\n        [Fact]\n        public void BootstrapperShouldCallCreateShell()\n        {\n            Assert.True(bootstrapper.CreateShellWasCalled);\n        }\n\n        [Fact]\n        public void BootstrapperShouldCallInitializeShell()\n        {\n            //in our mock Shell is null, so this INitializeShell should not be called by the bootstrapper\n            Assert.False(bootstrapper.InitializeShellWasCalled);\n        }\n\n        [Fact]\n        public void BootstrapperShouldCallOnInitialized()\n        {\n            Assert.True(bootstrapper.OnInitializedWasCalled);\n        }\n\n        [Fact]\n        public void BootstrapperShouldCallConfigureModuleCatalog()\n        {\n            Assert.True(bootstrapper.ConfigureModuleCatalogCalled);\n        }\n\n        [Fact]\n        public void BootstrapperShouldCallInitializeModules()\n        {\n            Assert.True(bootstrapper.InitializeModulesCalled);\n        }\n\n        [Fact]\n        public void CreateModuleCatalogShouldReturnDefaultModuleCatalog()\n        {\n            Assert.NotNull(bootstrapper.DefaultModuleCatalog);\n        }\n\n        [Fact]\n        public void ConfigureRegionAdapterMappingsShouldRegisterItemsControlMapping()\n        {\n            Assert.NotNull(bootstrapper.DefaultRegionAdapterMappings);\n            Assert.NotNull(bootstrapper.DefaultRegionAdapterMappings.GetMapping(typeof(ItemsControl)));\n        }\n\n        ////[Fact]\n        ////public void ConfigureRegionAdapterMappingsShouldRegisterSelectorMapping()\n        ////{\n        ////    Assert.NotNull(bootstrapper.DefaultRegionAdapterMappings);\n        ////    Assert.NotNull(bootstrapper.DefaultRegionAdapterMappings.GetMapping(typeof(Selector)));\n        ////}\n\n        [Fact]\n        public void ConfigureRegionAdapterMappingsShouldRegisterContentControlMapping()\n        {\n            Assert.NotNull(bootstrapper.DefaultRegionAdapterMappings);\n            Assert.NotNull(bootstrapper.DefaultRegionAdapterMappings.GetMapping(typeof(ContentControl)));\n        }\n\n        [Fact]\n        public void ConfigureDefaultRegionBehaviorsShouldAddAutoPopulateRegionBehavior()\n        {\n            Assert.True(bootstrapper.DefaultRegionBehaviorTypes.ContainsKey(AutoPopulateRegionBehavior.BehaviorKey));\n        }\n\n        [Fact]\n        public void ConfigureDefaultRegionBehaviorsShouldBindRegionContextToAvaloniaObjectBehavior()\n        {\n            Assert.True(bootstrapper.DefaultRegionBehaviorTypes.ContainsKey(BindRegionContextToAvaloniaObjectBehavior.BehaviorKey));\n        }\n\n        [Fact]\n        public void ConfigureDefaultRegionBehaviorsShouldAddRegionActiveAwareBehavior()\n        {\n            Assert.True(bootstrapper.DefaultRegionBehaviorTypes.ContainsKey(RegionActiveAwareBehavior.BehaviorKey));\n        }\n\n        [Fact]\n        public void ConfigureDefaultRegionBehaviorsShouldAddSyncRegionContextWithHostBehavior()\n        {\n            Assert.True(bootstrapper.DefaultRegionBehaviorTypes.ContainsKey(SyncRegionContextWithHostBehavior.BehaviorKey));\n        }\n\n        [Fact]\n        public void ConfigureDefaultRegionBehaviorsShouldAddRegionManagerRegistrationBehavior()\n        {\n            Assert.True(bootstrapper.DefaultRegionBehaviorTypes.ContainsKey(RegionManagerRegistrationBehavior.BehaviorKey));\n        }\n\n        [Fact]\n        public void ConfigureDefaultRegionBehaviorsShouldAddRegionLifetimeBehavior()\n        {\n            Assert.True(bootstrapper.DefaultRegionBehaviorTypes.ContainsKey(RegionMemberLifetimeBehavior.BehaviorKey));\n        }\n\n        [Fact]\n        public void RequiredTypesAreRegistered()\n        {\n            bootstrapper.MockContainer.Verify(x => x.RegisterInstance(typeof(IModuleCatalog), It.IsAny<IModuleCatalog>()), Times.Once);\n\n            bootstrapper.MockContainer.Verify(x => x.RegisterSingleton(typeof(IDialogService), typeof(DialogService)), Times.Once);\n            bootstrapper.MockContainer.Verify(x => x.RegisterSingleton(typeof(IModuleInitializer), typeof(ModuleInitializer)), Times.Once);\n            bootstrapper.MockContainer.Verify(x => x.RegisterSingleton(typeof(IModuleManager), typeof(ModuleManager)), Times.Once);\n            bootstrapper.MockContainer.Verify(x => x.RegisterSingleton(typeof(RegionAdapterMappings), typeof(RegionAdapterMappings)), Times.Once);\n            bootstrapper.MockContainer.Verify(x => x.RegisterSingleton(typeof(IRegionManager), typeof(RegionManager)), Times.Once);\n            bootstrapper.MockContainer.Verify(x => x.RegisterSingleton(typeof(IRegionNavigationContentLoader), typeof(RegionNavigationContentLoader)), Times.Once);\n            bootstrapper.MockContainer.Verify(x => x.RegisterSingleton(typeof(IEventAggregator), typeof(EventAggregator)), Times.Once);\n            bootstrapper.MockContainer.Verify(x => x.RegisterSingleton(typeof(IRegionViewRegistry), typeof(RegionViewRegistry)), Times.Once);\n            bootstrapper.MockContainer.Verify(x => x.RegisterSingleton(typeof(IRegionBehaviorFactory), typeof(RegionBehaviorFactory)), Times.Once);\n\n            bootstrapper.MockContainer.Verify(x => x.Register(typeof(IRegionNavigationJournalEntry), typeof(RegionNavigationJournalEntry)), Times.Once);\n            bootstrapper.MockContainer.Verify(x => x.Register(typeof(IRegionNavigationJournal), typeof(RegionNavigationJournal)), Times.Once);\n            bootstrapper.MockContainer.Verify(x => x.Register(typeof(IRegionNavigationService), typeof(RegionNavigationService)), Times.Once);\n            bootstrapper.MockContainer.Verify(x => x.Register(typeof(IDialogWindow), typeof(DialogWindow)), Times.Once);\n        }\n    }\n\n    public class PrismBootstrapper : PrismBootstrapperBase\n    {\n        public Mock<IContainerExtension> MockContainer { get; private set; }\n\n        public IModuleCatalog DefaultModuleCatalog => Container.Resolve<IModuleCatalog>();\n\n        public IRegionBehaviorFactory DefaultRegionBehaviorTypes => Container.Resolve<IRegionBehaviorFactory>();\n\n        public RegionAdapterMappings DefaultRegionAdapterMappings => Container.Resolve<RegionAdapterMappings>();\n\n        public bool ConfigureViewModelLocatorWasCalled { get; set; }\n        public bool CreateShellWasCalled { get; set; }\n        public bool InitializeShellWasCalled { get; set; }\n        public bool OnInitializedWasCalled { get; set; }\n        public bool RegisterTypesWasCalled { get; set; }\n        public bool InitializeModulesCalled { get; internal set; }\n        public bool ConfigureModuleCatalogCalled { get; internal set; }\n        public bool RegisterFrameworkExceptionTypesCalled { get; internal set; }\n        public bool ConfigureRegionAdapterMappingsCalled { get; internal set; }\n        public bool ConfigureDefaultRegionBehaviorsCalled { get; internal set; }\n        public bool RegisterRequiredTypesCalled { get; internal set; }\n        public bool CreateModuleCatalogCalled { get; internal set; }\n        public bool CreateContainerExtensionCalled { get; internal set; }\n        public bool InitializeCalled { get; internal set; }\n\n        protected override void Initialize()\n        {\n            InitializeCalled = true;\n\n            ContainerLocator.ResetContainer();\n            MockContainer = new Mock<IContainerExtension>();\n\n            base.Initialize();\n        }\n\n        protected override IContainerExtension CreateContainerExtension()\n        {\n            CreateContainerExtensionCalled = true;\n            return MockContainer.Object;\n        }\n\n        protected override void ConfigureViewModelLocator()\n        {\n            ConfigureViewModelLocatorWasCalled = true;\n            //setting this breaks other tests using VML. \n            //We need to revist those tests to ensure it is being reset each time.\n            //base.ConfigureViewModelLocator();\n        }\n\n        protected override IModuleCatalog CreateModuleCatalog()\n        {\n            CreateModuleCatalogCalled = true;\n\n            var moduleCatalog = base.CreateModuleCatalog();\n            MockContainer.Setup(x => x.Resolve(typeof(IModuleCatalog))).Returns(moduleCatalog);\n            return moduleCatalog;\n        }\n\n        protected override AvaloniaObject CreateShell()\n        {\n            CreateShellWasCalled = true;\n            return null;\n        }\n\n        protected override void InitializeShell(AvaloniaObject shell)\n        {\n            InitializeShellWasCalled = false;\n        }\n\n        protected override void RegisterRequiredTypes(IContainerRegistry containerRegistry)\n        {\n            RegisterRequiredTypesCalled = true;\n\n            base.RegisterRequiredTypes(containerRegistry);\n\n            var moduleInitializer = new ModuleInitializer(MockContainer.Object);\n            MockContainer.Setup(x => x.Resolve(typeof(IModuleInitializer))).Returns(moduleInitializer);\n            MockContainer.Setup(x => x.Resolve(typeof(IModuleManager))).Returns(new ModuleManager(moduleInitializer, DefaultModuleCatalog));\n            MockContainer.Setup(x => x.Resolve(typeof(IRegionBehaviorFactory))).Returns(new RegionBehaviorFactory(MockContainer.Object));\n\n            var regionBehaviorFactory = new RegionBehaviorFactory(MockContainer.Object);\n            MockContainer.Setup(x => x.Resolve(typeof(IRegionBehaviorFactory))).Returns(regionBehaviorFactory);\n\n            MockContainer.Setup(x => x.Resolve(typeof(RegionAdapterMappings))).Returns(new RegionAdapterMappings());\n            //// TODO: MockContainer.Setup(x => x.Resolve(typeof(SelectorRegionAdapter))).Returns(new SelectorRegionAdapter(regionBehaviorFactory));\n            MockContainer.Setup(x => x.Resolve(typeof(ItemsControlRegionAdapter))).Returns(new ItemsControlRegionAdapter(regionBehaviorFactory));\n            MockContainer.Setup(x => x.Resolve(typeof(ContentControlRegionAdapter))).Returns(new ContentControlRegionAdapter(regionBehaviorFactory));\n        }\n\n        protected override void RegisterTypes(IContainerRegistry containerRegistry)\n        {\n            RegisterTypesWasCalled = true;\n        }\n\n        protected override void OnInitialized()\n        {\n            OnInitializedWasCalled = true;\n        }\n\n        protected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog)\n        {\n            ConfigureModuleCatalogCalled = true;\n            base.ConfigureModuleCatalog(moduleCatalog);\n        }\n\n        protected override void InitializeModules()\n        {\n            InitializeModulesCalled = true;\n            base.InitializeModules();\n        }\n\n        protected override void RegisterFrameworkExceptionTypes()\n        {\n            RegisterFrameworkExceptionTypesCalled = true;\n            base.RegisterFrameworkExceptionTypes();\n        }\n\n        protected override void ConfigureRegionAdapterMappings(RegionAdapterMappings regionAdapterMappings)\n        {\n            ConfigureRegionAdapterMappingsCalled = true;\n            base.ConfigureRegionAdapterMappings(regionAdapterMappings);\n        }\n\n        protected override void ConfigureDefaultRegionBehaviors(IRegionBehaviorFactory regionBehaviors)\n        {\n            ConfigureDefaultRegionBehaviorsCalled = true;\n            base.ConfigureDefaultRegionBehaviors(regionBehaviors);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Regions/AllActiveRegionFixture.cs",
    "content": "using System;\nusing Prism.Navigation.Regions;\nusing Xunit;\n\nnamespace Prism.Avalonia.Tests.Regions\n{\n    public class AllActiveRegionFixture\n    {\n        [Fact]\n        public void AddingViewsToRegionMarksThemAsActive()\n        {\n            IRegion region = new AllActiveRegion();\n            var view = new object();\n\n            region.Add(view);\n\n            Assert.True(region.ActiveViews.Contains(view));\n        }\n\n        [Fact]\n        public void DeactivateThrows()\n        {\n            var ex = Assert.Throws<InvalidOperationException>(() =>\n            {\n                IRegion region = new AllActiveRegion();\n                var view = new object();\n                region.Add(view);\n\n                region.Deactivate(view);\n            });\n\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Regions/Behaviors/AutoPopulateRegionBehaviorFixture.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing Moq;\nusing Prism.Avalonia.Tests.Mocks;\nusing Prism.Ioc;\nusing Prism.Navigation.Regions;\nusing Prism.Navigation.Regions.Behaviors;\nusing Xunit;\n\nnamespace Prism.Avalonia.Tests.Regions.Behaviors\n{\n    public class AutoPopulateRegionBehaviorFixture\n    {\n        [Fact]\n        public void ShouldGetViewsFromRegistryOnAttach()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            var region = new MockPresentationRegion() { Name = \"MyRegion\" };\n            var viewFactory = new MockRegionContentRegistry();\n            var view = new object();\n            viewFactory.GetContentsReturnValue.Add(view);\n            var behavior = new AutoPopulateRegionBehavior(viewFactory)\n            {\n                Region = region\n            };\n\n            behavior.Attach();\n\n            Assert.Equal(\"MyRegion\", viewFactory.GetContentsArgumentRegionName);\n            Assert.Single(region.MockViews.Items);\n            Assert.Equal(view, region.MockViews.Items[0]);\n        }\n\n        [Fact]\n        public void ShouldGetViewsFromRegistryWhenRegisteringItAfterAttach()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            var region = new MockPresentationRegion() { Name = \"MyRegion\" };\n            var viewFactory = new MockRegionContentRegistry();\n            var behavior = new AutoPopulateRegionBehavior(viewFactory)\n            {\n                Region = region\n            };\n            var view = new object();\n\n            behavior.Attach();\n            viewFactory.GetContentsReturnValue.Add(view);\n            viewFactory.RaiseContentRegistered(\"MyRegion\", view);\n\n            Assert.Equal(\"MyRegion\", viewFactory.GetContentsArgumentRegionName);\n            Assert.Single(region.MockViews.Items);\n            Assert.Equal(view, region.MockViews.Items[0]);\n        }\n\n        [Fact]\n        public void NullRegionThrows()\n        {\n            var ex = Assert.Throws<InvalidOperationException>(() =>\n            {\n                var behavior = new AutoPopulateRegionBehavior(new MockRegionContentRegistry());\n\n                behavior.Attach();\n            });\n\n        }\n\n        [Fact]\n        public void CanAttachBeforeSettingName()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            var region = new MockPresentationRegion() { Name = null };\n            var viewFactory = new MockRegionContentRegistry();\n            var view = new object();\n            viewFactory.GetContentsReturnValue.Add(view);\n            var behavior = new AutoPopulateRegionBehavior(viewFactory)\n            {\n                Region = region\n            };\n\n            behavior.Attach();\n            Assert.False(viewFactory.GetContentsCalled);\n\n            region.Name = \"MyRegion\";\n\n            Assert.True(viewFactory.GetContentsCalled);\n            Assert.Equal(\"MyRegion\", viewFactory.GetContentsArgumentRegionName);\n            Assert.Single(region.MockViews.Items);\n            Assert.Equal(view, region.MockViews.Items[0]);\n        }\n\n        private class MockRegionContentRegistry : IRegionViewRegistry\n        {\n            public readonly List<object> GetContentsReturnValue = new List<object>();\n            public string GetContentsArgumentRegionName;\n            public bool GetContentsCalled;\n\n            public event EventHandler<ViewRegisteredEventArgs> ContentRegistered;\n\n            public IEnumerable<object> GetContents(string regionName, IContainerProvider container)\n            {\n                GetContentsCalled = true;\n                GetContentsArgumentRegionName = regionName;\n                return GetContentsReturnValue;\n            }\n\n            public void RaiseContentRegistered(string regionName, object view)\n            {\n                ContentRegistered(this, new ViewRegisteredEventArgs(regionName, _ => view));\n            }\n\n            public void RegisterViewWithRegion(string regionName, Type viewType)\n            {\n                throw new NotImplementedException();\n            }\n\n            public void RegisterViewWithRegion(string regionName, Func<IContainerProvider, object> getContentDelegate)\n            {\n                throw new NotImplementedException();\n            }\n\n            public void RegisterViewWithRegion(string regionName, string targetName)\n            {\n                throw new NotImplementedException();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Regions/Behaviors/BindRegionContextToAvaloniaObjectBehaviorFixture.cs",
    "content": "using Prism.Avalonia.Tests.Mocks;\nusing Prism.Navigation.Regions;\nusing Prism.Navigation.Regions.Behaviors;\nusing Xunit;\n\nnamespace Prism.Avalonia.Tests.Regions.Behaviors\n{\n    public class BindRegionContextToAvaloniaObjectBehaviorFixture\n    {\n        [StaFact(Skip = \"Review: Potentially not supported\")]\n        public void ShouldSetRegionContextOnAddedView()\n        {\n            var behavior = new BindRegionContextToAvaloniaObjectBehavior();\n            var region = new MockPresentationRegion();\n            behavior.Region = region;\n            region.Context = \"MyContext\";\n            var view = new MockDependencyObject();\n\n            behavior.Attach();\n            region.Add(view);\n\n            var context = RegionContext.GetObservableContext(view);\n            Assert.NotNull(context.Value);\n            Assert.Equal(\"MyContext\", context.Value);\n        }\n\n        [StaFact(Skip = \"Review: Potentially not supported\")]\n        public void ShouldSetRegionContextOnAlreadyAddedViews()\n        {\n            var behavior = new BindRegionContextToAvaloniaObjectBehavior();\n            var region = new MockPresentationRegion();\n            var view = new MockDependencyObject();\n            region.Add(view);\n            behavior.Region = region;\n            region.Context = \"MyContext\";\n\n            behavior.Attach();\n\n            var context = RegionContext.GetObservableContext(view);\n            Assert.NotNull(context.Value);\n            Assert.Equal(\"MyContext\", context.Value);\n        }\n\n        [StaFact(Skip = \"Review: Potentially not supported\")]\n        public void ShouldRemoveContextToViewRemovedFromRegion()\n        {\n            var behavior = new BindRegionContextToAvaloniaObjectBehavior();\n            var region = new MockPresentationRegion();\n            var view = new MockDependencyObject();\n            region.Add(view);\n            behavior.Region = region;\n            region.Context = \"MyContext\";\n            behavior.Attach();\n\n            region.Remove(view);\n\n            var context = RegionContext.GetObservableContext(view);\n            Assert.Null(context.Value);\n        }\n\n        [StaFact(Skip = \"Avalonia doesn't auto-create ObservableObject in RegionContext\")]\n        public void ShouldSetRegionContextOnContextChange()\n        {\n            var behavior = new BindRegionContextToAvaloniaObjectBehavior();\n            var region = new MockPresentationRegion();\n            var view = new MockDependencyObject();\n            region.Add(view);\n            behavior.Region = region;\n            region.Context = \"MyContext\";\n            behavior.Attach();\n            Assert.Equal(\"MyContext\", RegionContext.GetObservableContext(view).Value);\n\n            region.Context = \"MyNewContext\";\n            region.OnPropertyChange(\"Context\");\n\n            Assert.Equal(\"MyNewContext\", RegionContext.GetObservableContext(view).Value);\n        }\n\n        [StaFact]\n        public void WhenAViewIsRemovedFromARegion_ThenRegionContextIsNotClearedInRegion()\n        {\n            var behavior = new BindRegionContextToAvaloniaObjectBehavior();\n            var region = new MockPresentationRegion();\n\n            behavior.Region = region;\n            behavior.Attach();\n\n            var myView = new MockFrameworkElement();\n\n            region.Add(myView);\n            region.Context = \"new context\";\n\n            region.Remove(myView);\n\n            Assert.NotNull(region.Context);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Regions/Behaviors/ClearChildViewsRegionBehaviorFixture.cs",
    "content": "using Prism.Navigation.Regions;\nusing Prism.Avalonia.Tests.Mocks;\nusing Prism.Navigation.Regions.Behaviors;\nusing Xunit;\n\nnamespace Prism.Avalonia.Tests.Regions.Behaviors\n{\n    public class ClearChildViewsRegionBehaviorFixture\n    {\n        [StaFact]\n        public void WhenClearChildViewsPropertyIsNotSet_ThenChildViewsRegionManagerIsNotCleared()\n        {\n            var regionManager = new MockRegionManager();\n\n            var region = new Region();\n            region.RegionManager = regionManager;\n\n            var behavior = new ClearChildViewsRegionBehavior();\n            behavior.Region = region;\n            behavior.Attach();\n\n            var childView = new MockFrameworkElement();\n            region.Add(childView);\n\n            Assert.Equal(regionManager, childView.GetValue(RegionManager.RegionManagerProperty));\n\n            region.RegionManager = null;\n\n            Assert.Equal(regionManager, childView.GetValue(RegionManager.RegionManagerProperty));\n        }\n\n        [StaFact]\n        public void WhenClearChildViewsPropertyIsTrue_ThenChildViewsRegionManagerIsCleared()\n        {\n            var regionManager = new MockRegionManager();\n\n            var region = new Region();\n            region.RegionManager = regionManager;\n\n            var behavior = new ClearChildViewsRegionBehavior();\n            behavior.Region = region;\n            behavior.Attach();\n\n            var childView = new MockFrameworkElement();\n            region.Add(childView);\n\n            ClearChildViewsRegionBehavior.SetClearChildViews(childView, true);\n\n            Assert.Equal(regionManager, childView.GetValue(RegionManager.RegionManagerProperty));\n\n            region.RegionManager = null;\n\n            Assert.Null(childView.GetValue(RegionManager.RegionManagerProperty));\n        }\n\n        [StaFact]\n        public void WhenRegionManagerChangesToNotNullValue_ThenChildViewsRegionManagerIsNotCleared()\n        {\n            var regionManager = new MockRegionManager();\n\n            var region = new Region();\n            region.RegionManager = regionManager;\n\n            var behavior = new ClearChildViewsRegionBehavior();\n            behavior.Region = region;\n            behavior.Attach();\n\n            var childView = new MockFrameworkElement();\n            region.Add(childView);\n\n            childView.SetValue(ClearChildViewsRegionBehavior.ClearChildViewsProperty, true);\n\n            Assert.Equal(regionManager, childView.GetValue(RegionManager.RegionManagerProperty));\n\n            region.RegionManager = new MockRegionManager();\n\n            Assert.NotNull(childView.GetValue(RegionManager.RegionManagerProperty));\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Regions/Behaviors/DelayedRegionCreationBehaviorFixture.cs",
    "content": "using System;\nusing System.Linq;\nusing Avalonia;\nusing Prism.Avalonia.Tests.Mocks;\nusing Prism.Navigation.Regions;\nusing Prism.Navigation.Regions.Behaviors;\nusing Xunit;\n\nnamespace Prism.Avalonia.Tests.Regions.Behaviors\n{\n    public class DelayedRegionCreationBehaviorFixture\n    {\n        private DelayedRegionCreationBehavior GetBehavior(AvaloniaObject control, MockRegionManagerAccessor accessor, MockRegionAdapter adapter)\n        {\n            var mappings = new RegionAdapterMappings();\n            mappings.RegisterMapping(control.GetType(), adapter);\n            var behavior = new DelayedRegionCreationBehavior(mappings);\n            behavior.RegionManagerAccessor = accessor;\n            behavior.TargetElement = control;\n            return behavior;\n        }\n\n        private DelayedRegionCreationBehavior GetBehavior(AvaloniaObject control, MockRegionManagerAccessor accessor)\n        {\n            return GetBehavior(control, accessor, new MockRegionAdapter());\n        }\n\n        [StaFact]\n        public void RegionWillNotGetCreatedTwiceWhenThereAreMoreRegions()\n        {\n            var control1 = new MockFrameworkElement();\n            var control2 = new MockFrameworkElement();\n\n            var accessor = new MockRegionManagerAccessor\n            {\n                GetRegionName = d => d == control1 ? \"Region1\" : \"Region2\"\n            };\n\n            var adapter = new MockRegionAdapter();\n            adapter.Accessor = accessor;\n\n            var behavior1 = GetBehavior(control1, accessor, adapter);\n            var behavior2 = GetBehavior(control2, accessor, adapter);\n\n            behavior1.Attach();\n            behavior2.Attach();\n\n            accessor.UpdateRegions();\n\n            Assert.Contains(\"Region1\", adapter.CreatedRegions);\n            Assert.Contains(\"Region2\", adapter.CreatedRegions);\n            Assert.Equal(1, adapter.CreatedRegions.Count((name) => name == \"Region2\"));\n        }\n\n        [StaFact]\n        public void RegionGetsCreatedWhenAccessingRegions()\n        {\n            var control1 = new MockFrameworkElement();\n            var control2 = new MockFrameworkContentElement();\n\n            var accessor = new MockRegionManagerAccessor\n            {\n                GetRegionName = d => \"myRegionName\"\n            };\n\n            var behavior1 = GetBehavior(control1, accessor);\n            behavior1.Attach();\n            var behavior2 = GetBehavior(control2, accessor);\n            behavior2.Attach();\n\n            accessor.UpdateRegions();\n\n            Assert.NotNull(RegionManager.GetObservableRegion(control1).Value);\n            Assert.IsAssignableFrom<IRegion>(RegionManager.GetObservableRegion(control1).Value);\n            Assert.NotNull(RegionManager.GetObservableRegion(control2).Value);\n            Assert.IsAssignableFrom<IRegion>(RegionManager.GetObservableRegion(control2).Value);\n        }\n\n        [StaFact]\n        public void RegionDoesNotGetCreatedTwiceWhenUpdatingRegions()\n        {\n            var control = new MockFrameworkElement();\n\n            var accessor = new MockRegionManagerAccessor\n            {\n                GetRegionName = d => \"myRegionName\"\n            };\n\n            var behavior = GetBehavior(control, accessor);\n            behavior.Attach();\n            accessor.UpdateRegions();\n            IRegion region = RegionManager.GetObservableRegion(control).Value;\n\n            accessor.UpdateRegions();\n\n            Assert.Same(region, RegionManager.GetObservableRegion(control).Value);\n        }\n\n        [StaFact(Skip = \"Review: Potentially not supported\")]\n        public void BehaviorDoesNotPreventControlFromBeingGarbageCollected()\n        {\n            var control = new MockFrameworkElement();\n            WeakReference controlWeakReference = new WeakReference(control);\n\n            var accessor = new MockRegionManagerAccessor\n            {\n                GetRegionName = d => \"myRegionName\"\n            };\n\n            var behavior = GetBehavior(control, accessor);\n            behavior.Attach();\n\n            Assert.True(controlWeakReference.IsAlive);\n            GC.KeepAlive(control);\n\n            control = null;\n            GC.Collect();\n\n            Assert.False(controlWeakReference.IsAlive);\n        }\n\n        [StaFact(Skip = \"Review: Potentially not supported\")]\n        public void BehaviorDoesNotPreventControlFromBeingGarbageCollectedWhenRegionWasCreated()\n        {\n            var control = new MockFrameworkElement();\n            WeakReference controlWeakReference = new WeakReference(control);\n\n            var accessor = new MockRegionManagerAccessor\n            {\n                GetRegionName = d => \"myRegionName\"\n            };\n\n            var behavior = GetBehavior(control, accessor);\n            behavior.Attach();\n            accessor.UpdateRegions();\n\n            Assert.True(controlWeakReference.IsAlive);\n            GC.KeepAlive(control);\n\n            control = null;\n            GC.Collect();\n\n            Assert.False(controlWeakReference.IsAlive);\n        }\n\n        [StaFact]\n        public void BehaviorShouldUnhookEventWhenDetaching()\n        {\n            var control = new MockFrameworkElement();\n\n            var accessor = new MockRegionManagerAccessor\n            {\n                GetRegionName = d => \"myRegionName\",\n            };\n            var behavior = GetBehavior(control, accessor);\n            behavior.Attach();\n\n            int startingCount = accessor.GetSubscribersCount();\n\n            behavior.Detach();\n\n            Assert.Equal<int>(startingCount - 1, accessor.GetSubscribersCount());\n        }\n\n        [StaFact(Skip = \"Review: Potentially not supported\")]\n        public void ShouldCleanupBehaviorOnceRegionIsCreated()\n        {\n            var control = new MockFrameworkElement();\n            var control2 = new MockFrameworkContentElement();\n\n            var accessor = new MockRegionManagerAccessor\n            {\n                GetRegionName = d => \"myRegionName\"\n            };\n\n            var behavior = GetBehavior(control, accessor);\n            WeakReference behaviorWeakReference = new WeakReference(behavior);\n            behavior.Attach();\n            accessor.UpdateRegions();\n            Assert.True(behaviorWeakReference.IsAlive);\n            GC.KeepAlive(behavior);\n\n            behavior = null;\n            GC.Collect();\n\n            Assert.False(behaviorWeakReference.IsAlive);\n\n            var behavior2 = GetBehavior(control2, accessor);\n            WeakReference behaviorWeakReference2 = new WeakReference(behavior2);\n            behavior2.Attach();\n            accessor.UpdateRegions();\n            Assert.True(behaviorWeakReference2.IsAlive);\n            GC.KeepAlive(behavior2);\n\n            behavior2 = null;\n            GC.Collect();\n\n            Assert.False(behaviorWeakReference2.IsAlive);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Regions/Behaviors/RegionActiveAwareBehaviorFixture.cs",
    "content": "using System;\nusing Avalonia.Controls;\nusing Avalonia.Input;\nusing Moq;\nusing Prism.Avalonia.Tests.Mocks;\nusing Prism.Navigation.Regions;\nusing Prism.Navigation.Regions.Behaviors;\nusing Xunit;\n\nnamespace Prism.Avalonia.Tests.Regions.Behaviors\n{\n    public class RegionActiveAwareBehaviorFixture\n    {\n        [StaFact]\n        public void SetsIsActivePropertyOnIActiveAwareObjects()\n        {\n            var region = new MockPresentationRegion();\n            region.RegionManager = new MockRegionManager();\n            var behavior = new RegionActiveAwareBehavior { Region = region };\n            behavior.Attach();\n            var collection = region.MockActiveViews.Items;\n\n            ActiveAwareFrameworkElement activeAwareObject = new ActiveAwareFrameworkElement();\n\n            Assert.False(activeAwareObject.IsActive);\n            collection.Add(activeAwareObject);\n\n            Assert.True(activeAwareObject.IsActive);\n\n            collection.Remove(activeAwareObject);\n            Assert.False(activeAwareObject.IsActive);\n        }\n\n        [StaFact]\n        public void SetsIsActivePropertyOnIActiveAwareDataContexts()\n        {\n            var region = new MockPresentationRegion();\n            var behavior = new RegionActiveAwareBehavior { Region = region };\n            behavior.Attach();\n            var collection = region.MockActiveViews.Items;\n\n            ActiveAwareFrameworkElement activeAwareObject = new ActiveAwareFrameworkElement();\n\n            var frameworkElementMock = new Mock<Control>();\n            var frameworkElement = frameworkElementMock.Object;\n            frameworkElement.DataContext = activeAwareObject;\n\n            Assert.False(activeAwareObject.IsActive);\n            collection.Add(frameworkElement);\n\n            Assert.True(activeAwareObject.IsActive);\n\n            collection.Remove(frameworkElement);\n            Assert.False(activeAwareObject.IsActive);\n        }\n\n        [StaFact]\n        public void SetsIsActivePropertyOnBothIActiveAwareViewAndDataContext()\n        {\n            var region = new MockPresentationRegion();\n            var behavior = new RegionActiveAwareBehavior { Region = region };\n            behavior.Attach();\n            var collection = region.MockActiveViews.Items;\n\n            var activeAwareMock = new Mock<IActiveAware>();\n            activeAwareMock.SetupProperty(o => o.IsActive);\n            var activeAwareObject = activeAwareMock.Object;\n\n            var frameworkElementMock = new Mock<Control>();\n            frameworkElementMock.As<IActiveAware>().SetupProperty(o => o.IsActive);\n            var frameworkElement = frameworkElementMock.Object;\n            frameworkElement.DataContext = activeAwareObject;\n\n            Assert.False(((IActiveAware)frameworkElement).IsActive);\n            Assert.False(activeAwareObject.IsActive);\n            collection.Add(frameworkElement);\n\n            Assert.True(((IActiveAware)frameworkElement).IsActive);\n            Assert.True(activeAwareObject.IsActive);\n\n            collection.Remove(frameworkElement);\n            Assert.False(((IActiveAware)frameworkElement).IsActive);\n            Assert.False(activeAwareObject.IsActive);\n        }\n\n        [StaFact]\n        public void DetachStopsListeningForChanges()\n        {\n            var region = new MockPresentationRegion();\n            var behavior = new RegionActiveAwareBehavior { Region = region };\n            var collection = region.MockActiveViews.Items;\n            behavior.Attach();\n            behavior.Detach();\n            ActiveAwareFrameworkElement activeAwareObject = new ActiveAwareFrameworkElement();\n\n            collection.Add(activeAwareObject);\n\n            Assert.False(activeAwareObject.IsActive);\n        }\n\n        [StaFact]\n        public void DoesNotThrowWhenAddingNonActiveAwareObjects()\n        {\n            var region = new MockPresentationRegion();\n            var behavior = new RegionActiveAwareBehavior { Region = region };\n            behavior.Attach();\n            var collection = region.MockActiveViews.Items;\n\n            collection.Add(new object());\n        }\n\n        [StaFact]\n        public void DoesNotThrowWhenAddingNonActiveAwareDataContexts()\n        {\n            var region = new MockPresentationRegion();\n            var behavior = new RegionActiveAwareBehavior { Region = region };\n            behavior.Attach();\n            var collection = region.MockActiveViews.Items;\n\n            var frameworkElementMock = new Mock<Control>();\n            var frameworkElement = frameworkElementMock.Object;\n            frameworkElement.DataContext = new object();\n\n            collection.Add(frameworkElement);\n        }\n\n        [StaFact]\n        public void WhenParentViewGetsActivatedOrDeactivated_ThenChildViewIsNotUpdated()\n        {\n            var scopedRegionManager = new RegionManager();\n            var scopedRegion = new Region { Name = \"MyScopedRegion\", RegionManager = scopedRegionManager };\n            scopedRegionManager.Regions.Add(scopedRegion);\n            var behaviorForScopedRegion = new RegionActiveAwareBehavior { Region = scopedRegion };\n            behaviorForScopedRegion.Attach();\n            var childActiveAwareView = new ActiveAwareFrameworkElement();\n\n            var region = new MockPresentationRegion();\n            var behavior = new RegionActiveAwareBehavior { Region = region };\n            behavior.Attach();\n\n            var view = new MockFrameworkElement();\n            region.Add(view);\n            RegionManager.SetRegionManager(view, scopedRegionManager);\n            region.Activate(view);\n\n            scopedRegion.Add(childActiveAwareView);\n            scopedRegion.Activate(childActiveAwareView);\n\n            Assert.True(childActiveAwareView.IsActive);\n\n            region.Deactivate(view);\n\n            Assert.True(childActiveAwareView.IsActive);\n        }\n\n        [StaFact]\n        public void WhenParentViewGetsActivatedOrDeactivated_ThenSyncedChildViewIsUpdated()\n        {\n            var scopedRegionManager = new RegionManager();\n            var scopedRegion = new Region { Name = \"MyScopedRegion\", RegionManager = scopedRegionManager };\n            scopedRegionManager.Regions.Add(scopedRegion);\n            var behaviorForScopedRegion = new RegionActiveAwareBehavior { Region = scopedRegion };\n            behaviorForScopedRegion.Attach();\n            var childActiveAwareView = new SyncedActiveAwareObject();\n\n            var region = new MockPresentationRegion();\n            var behavior = new RegionActiveAwareBehavior { Region = region };\n            behavior.Attach();\n\n            var view = new MockFrameworkElement();\n            region.Add(view);\n            RegionManager.SetRegionManager(view, scopedRegionManager);\n            region.Activate(view);\n\n            scopedRegion.Add(childActiveAwareView);\n            scopedRegion.Activate(childActiveAwareView);\n\n            Assert.True(childActiveAwareView.IsActive);\n\n            region.Deactivate(view);\n\n            Assert.False(childActiveAwareView.IsActive);\n        }\n\n        [StaFact]\n        public void WhenParentViewGetsActivatedOrDeactivated_ThenSyncedChildViewWithAttributeInVMIsUpdated()\n        {\n            var scopedRegionManager = new RegionManager();\n            var scopedRegion = new Region { Name = \"MyScopedRegion\", RegionManager = scopedRegionManager };\n            scopedRegionManager.Regions.Add(scopedRegion);\n            var behaviorForScopedRegion = new RegionActiveAwareBehavior { Region = scopedRegion };\n            behaviorForScopedRegion.Attach();\n            var childActiveAwareView = new ActiveAwareFrameworkElement();\n            childActiveAwareView.DataContext = new SyncedActiveAwareObjectViewModel();\n\n            var region = new MockPresentationRegion();\n            var behavior = new RegionActiveAwareBehavior { Region = region };\n            behavior.Attach();\n\n            var view = new MockFrameworkElement();\n            region.Add(view);\n            RegionManager.SetRegionManager(view, scopedRegionManager);\n            region.Activate(view);\n\n            scopedRegion.Add(childActiveAwareView);\n            scopedRegion.Activate(childActiveAwareView);\n\n            Assert.True(childActiveAwareView.IsActive);\n\n            region.Deactivate(view);\n\n            Assert.False(childActiveAwareView.IsActive);\n        }\n\n        [StaFact]\n        public void WhenParentViewGetsActivatedOrDeactivated_ThenSyncedChildViewModelThatIsNotAFrameworkElementIsNotUpdated()\n        {\n            var scopedRegionManager = new RegionManager();\n            var scopedRegion = new Region { Name = \"MyScopedRegion\", RegionManager = scopedRegionManager };\n            scopedRegionManager.Regions.Add(scopedRegion);\n            var behaviorForScopedRegion = new RegionActiveAwareBehavior { Region = scopedRegion };\n            behaviorForScopedRegion.Attach();\n            var childActiveAwareView = new ActiveAwareObject();\n\n            var region = new MockPresentationRegion();\n            var behavior = new RegionActiveAwareBehavior { Region = region };\n            behavior.Attach();\n\n            var view = new MockFrameworkElement();\n            region.Add(view);\n            RegionManager.SetRegionManager(view, scopedRegionManager);\n            region.Activate(view);\n\n            scopedRegion.Add(childActiveAwareView);\n            scopedRegion.Activate(childActiveAwareView);\n\n            Assert.True(childActiveAwareView.IsActive);\n\n            region.Deactivate(view);\n\n            Assert.True(childActiveAwareView.IsActive);\n        }\n\n        [StaFact]\n        public void WhenParentViewGetsActivatedOrDeactivated_ThenSyncedChildViewNotInActiveViewsIsNotUpdated()\n        {\n            var scopedRegionManager = new RegionManager();\n            var scopedRegion = new Region { Name = \"MyScopedRegion\", RegionManager = scopedRegionManager };\n            scopedRegionManager.Regions.Add(scopedRegion);\n            var behaviorForScopedRegion = new RegionActiveAwareBehavior { Region = scopedRegion };\n            behaviorForScopedRegion.Attach();\n            var childActiveAwareView = new SyncedActiveAwareObject();\n\n            var region = new MockPresentationRegion();\n            var behavior = new RegionActiveAwareBehavior { Region = region };\n            behavior.Attach();\n\n            var view = new MockFrameworkElement();\n            region.Add(view);\n            RegionManager.SetRegionManager(view, scopedRegionManager);\n            region.Activate(view);\n\n            scopedRegion.Add(childActiveAwareView);\n            scopedRegion.Deactivate(childActiveAwareView);\n\n            Assert.False(childActiveAwareView.IsActive);\n\n            region.Deactivate(view);\n\n            Assert.False(childActiveAwareView.IsActive);\n\n            region.Activate(view);\n\n            Assert.False(childActiveAwareView.IsActive);\n        }\n\n        [StaFact]\n        public void WhenParentViewWithoutScopedRegionGetsActivatedOrDeactivated_ThenSyncedChildViewIsNotUpdated()\n        {\n            var commonRegionManager = new RegionManager();\n            var nonScopedRegion = new Region { Name = \"MyRegion\", RegionManager = commonRegionManager };\n            commonRegionManager.Regions.Add(nonScopedRegion);\n            var behaviorForScopedRegion = new RegionActiveAwareBehavior { Region = nonScopedRegion };\n            behaviorForScopedRegion.Attach();\n            var childActiveAwareView = new SyncedActiveAwareObject();\n\n            var region = new MockPresentationRegion { RegionManager = commonRegionManager };\n            var behavior = new RegionActiveAwareBehavior { Region = region };\n            behavior.Attach();\n\n            var view = new MockFrameworkElement();\n            region.Add(view);\n            RegionManager.SetRegionManager(view, commonRegionManager);\n            region.Activate(view);\n\n            nonScopedRegion.Add(childActiveAwareView);\n            nonScopedRegion.Activate(childActiveAwareView);\n\n            Assert.True(childActiveAwareView.IsActive);\n\n            region.Deactivate(view);\n\n            Assert.True(childActiveAwareView.IsActive);\n        }\n\n        class ActiveAwareObject : IActiveAware\n        {\n            public bool IsActive { get; set; }\n            public event EventHandler IsActiveChanged;\n        }\n\n        class ActiveAwareFrameworkElement : Control, IActiveAware\n        {\n            public bool IsActive { get; set; }\n            public event EventHandler IsActiveChanged;\n        }\n\n        [SyncActiveState]\n        class SyncedActiveAwareObject : IActiveAware\n        {\n            public bool IsActive { get; set; }\n            public event EventHandler IsActiveChanged;\n        }\n\n        [SyncActiveState]\n        class SyncedActiveAwareObjectViewModel : IActiveAware\n        {\n            public bool IsActive { get; set; }\n            public event EventHandler IsActiveChanged;\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Regions/Behaviors/RegionManagerRegistrationBehaviorFixture.cs",
    "content": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\nusing Avalonia.Controls;\nusing Prism.Avalonia.Tests.Mocks;\nusing Prism.Ioc;\nusing Prism.Navigation;\nusing Prism.Navigation.Regions;\nusing Prism.Navigation.Regions.Behaviors;\nusing Xunit;\n\nnamespace Prism.Avalonia.Tests.Regions.Behaviors\n{\n    /// <summary>\n    /// Region Manager Registration Behavior Fixture tests.\n    /// </summary>\n    /// <remarks>\n    ///   The MockFrameworkElement depends on the following:\n    ///   Avalonia.Control's LoadedEvent and UnloadedEvent wont arrive until Avalonia v0.11.0.\n    ///   Discussion: https://github.com/AvaloniaUI/Avalonia/issues/7908\n    ///   PR: https://github.com/AvaloniaUI/Avalonia/pull/8277\n    /// </remarks>\n    public class RegionManagerRegistrationBehaviorFixture\n    {\n        [StaFact]\n        public void ShouldRegisterRegionIfRegionManagerIsSet()\n        {\n            var control = new ItemsControl();\n            var regionManager = new MockRegionManager();\n            var accessor = new MockRegionManagerAccessor\n            {\n                GetRegionManager = d => regionManager\n            };\n            var region = new MockPresentationRegion() { Name = \"myRegionName\" };\n            var behavior = new RegionManagerRegistrationBehavior()\n            {\n                RegionManagerAccessor = accessor,\n                Region = region,\n                HostControl = control\n            };\n\n            behavior.Attach();\n\n            Assert.True(regionManager.MockRegionCollection.AddCalled);\n            Assert.Same(region, regionManager.MockRegionCollection.AddArgument);\n        }\n\n        [StaFact]\n        public void DoesNotFailIfRegionManagerIsNotSet()\n        {\n            var control = new ItemsControl();\n            var accessor = new MockRegionManagerAccessor();\n\n            var behavior = new RegionManagerRegistrationBehavior()\n            {\n                RegionManagerAccessor = accessor,\n                Region = new MockPresentationRegion() { Name = \"myRegionWithoutManager\" },\n                HostControl = control\n            };\n            behavior.Attach();\n        }\n\n        [StaFact(Skip = \"Review: Potentially not supported\")]\n        public void RegionGetsAddedInRegionManagerWhenAddedIntoAScopeAndAccessingRegions()\n        {\n            var regionManager = new MockRegionManager();\n            var control = new MockFrameworkElement();\n\n            var regionScopeControl = new ContentControl();\n            var accessor = new MockRegionManagerAccessor\n            {\n                GetRegionManager = d => d == regionScopeControl ? regionManager : null\n            };\n\n            var behavior = new RegionManagerRegistrationBehavior()\n            {\n                RegionManagerAccessor = accessor,\n                Region = new MockPresentationRegion() { Name = \"myRegionName\" },\n                HostControl = control\n            };\n            behavior.Attach();\n\n            Assert.False(regionManager.MockRegionCollection.AddCalled);\n\n            regionScopeControl.Content = control;\n            accessor.UpdateRegions();\n\n            Assert.True(regionManager.MockRegionCollection.AddCalled);\n        }\n\n        [StaFact(Skip = \"Review: Potentially not supported\")]\n        public void RegionDoesNotGetAddedTwiceWhenUpdatingRegions()\n        {\n            var regionManager = new MockRegionManager();\n            var control = new MockFrameworkElement();\n\n            var regionScopeControl = new ContentControl();\n            var accessor = new MockRegionManagerAccessor\n            {\n                GetRegionManager = d => d == regionScopeControl ? regionManager : null\n            };\n\n            var behavior = new RegionManagerRegistrationBehavior()\n            {\n                RegionManagerAccessor = accessor,\n                Region = new MockPresentationRegion() { Name = \"myRegionName\" },\n                HostControl = control\n            };\n            behavior.Attach();\n\n            Assert.False(regionManager.MockRegionCollection.AddCalled);\n\n            regionScopeControl.Content = control;\n            accessor.UpdateRegions();\n\n            Assert.True(regionManager.MockRegionCollection.AddCalled);\n            regionManager.MockRegionCollection.AddCalled = false;\n\n            accessor.UpdateRegions();\n            Assert.False(regionManager.MockRegionCollection.AddCalled);\n        }\n\n        [StaFact(Skip = \"Review: Potentially not supported\")]\n        public void RegionGetsRemovedFromRegionManagerWhenRemovedFromScope()\n        {\n            var regionManager = new MockRegionManager();\n            var control = new MockFrameworkElement();\n            var regionScopeControl = new ContentControl();\n            var accessor = new MockRegionManagerAccessor\n            {\n                GetRegionManager = d => d == regionScopeControl ? regionManager : null\n            };\n\n            var region = new MockPresentationRegion() { Name = \"myRegionName\" };\n            var behavior = new RegionManagerRegistrationBehavior()\n            {\n                RegionManagerAccessor = accessor,\n                Region = region,\n                HostControl = control\n            };\n            behavior.Attach();\n\n            regionScopeControl.Content = control;\n            accessor.UpdateRegions();\n            Assert.True(regionManager.MockRegionCollection.AddCalled);\n            Assert.Same(region, regionManager.MockRegionCollection.AddArgument);\n\n            regionScopeControl.Content = null;\n            accessor.UpdateRegions();\n\n            Assert.True(regionManager.MockRegionCollection.RemoveCalled);\n        }\n\n        [StaFact]\n        public void CanAttachBeforeSettingName()\n        {\n            var control = new ItemsControl();\n            var regionManager = new MockRegionManager();\n            var accessor = new MockRegionManagerAccessor\n            {\n                GetRegionManager = d => regionManager\n            };\n            var region = new MockPresentationRegion() { Name = null };\n            var behavior = new RegionManagerRegistrationBehavior()\n            {\n                RegionManagerAccessor = accessor,\n                Region = region,\n                HostControl = control\n            };\n\n            behavior.Attach();\n            Assert.False(regionManager.MockRegionCollection.AddCalled);\n\n            region.Name = \"myRegionName\";\n\n            Assert.True(regionManager.MockRegionCollection.AddCalled);\n            Assert.Same(region, regionManager.MockRegionCollection.AddArgument);\n        }\n\n        [StaFact]\n        public void HostControlSetAfterAttachThrows()\n        {\n            var ex = Assert.Throws<InvalidOperationException>(() =>\n            {\n                var behavior = new RegionManagerRegistrationBehavior();\n                var hostControl1 = new MockDependencyObject();\n                var hostControl2 = new MockDependencyObject();\n                behavior.HostControl = hostControl1;\n                behavior.Attach();\n                behavior.HostControl = hostControl2;\n            });\n\n        }\n\n        [StaFact]\n        public async Task BehaviorDoesNotPreventRegionManagerFromBeingGarbageCollected()\n        {\n            var control = new MockFrameworkElement();\n            var regionManager = new MockRegionManager();\n            var regionManagerWeakReference = new WeakReference(regionManager);\n\n            var accessor = new MockRegionManagerAccessor\n            {\n                GetRegionName = d => \"myRegionName\",\n                GetRegionManager = d => regionManager\n            };\n\n            var behavior = new RegionManagerRegistrationBehavior()\n            {\n                RegionManagerAccessor = accessor,\n                Region = new MockPresentationRegion(),\n                HostControl = control\n            };\n\n            behavior.Attach();\n\n            Assert.True(regionManagerWeakReference.IsAlive);\n            GC.KeepAlive(regionManager);\n\n            regionManager = null;\n            await Task.Delay(50);\n\n            GC.Collect();\n\n            Assert.False(regionManagerWeakReference.IsAlive);\n        }\n\n        internal class MockRegionManager : IRegionManager\n        {\n            public MockRegionCollection MockRegionCollection = new MockRegionCollection();\n\n            #region IRegionManager Members\n\n            public IRegionCollection Regions\n            {\n                get { return MockRegionCollection; }\n            }\n\n            IRegionManager IRegionManager.CreateRegionManager()\n            {\n                throw new System.NotImplementedException();\n            }\n\n            public IRegionManager AddToRegion(string regionName, object view)\n            {\n                throw new NotImplementedException();\n            }\n\n            public IRegionManager RegisterViewWithRegion(string regionName, Type viewType)\n            {\n                throw new NotImplementedException();\n            }\n\n            public IRegionManager RegisterViewWithRegion(string regionName, Func<IContainerProvider, object> getContentDelegate)\n            { \n                throw new NotImplementedException();\n            }\n\n            public void RequestNavigate(string regionName, Uri source, Action<NavigationResult> navigationCallback)\n            {\n                throw new NotImplementedException();\n            }\n\n            public void RequestNavigate(string regionName, Uri source)\n            {\n                throw new NotImplementedException();\n            }\n\n            public void RequestNavigate(string regionName, string source, Action<NavigationResult> navigationCallback)\n            {\n                throw new NotImplementedException();\n            }\n\n            public void RequestNavigate(string regionName, string source)\n            {\n                throw new NotImplementedException();\n            }\n\n            public void RequestNavigate(string regionName, Uri target, Action<NavigationResult> navigationCallback, INavigationParameters navigationParameters)\n            {\n                throw new NotImplementedException();\n            }\n\n            public void RequestNavigate(string regionName, string target, Action<NavigationResult> navigationCallback, INavigationParameters navigationParameters)\n            {\n                throw new NotImplementedException();\n            }\n\n            public void RequestNavigate(string regionName, Uri target, INavigationParameters navigationParameters)\n            {\n                throw new NotImplementedException();\n            }\n\n            public void RequestNavigate(string regionName, string target, INavigationParameters navigationParameters)\n            {\n                throw new NotImplementedException();\n            }\n\n            #endregion\n\n            public bool Navigate(Uri source)\n            {\n                throw new NotImplementedException();\n            }\n\n            public IRegionManager AddToRegion(string regionName, string viewName)\n            {\n                throw new NotImplementedException();\n            }\n\n            public IRegionManager RegisterViewWithRegion(string regionName, string viewName)\n            {\n                throw new NotImplementedException();\n            }\n        }\n    }\n\n    internal class MockRegionCollection : IRegionCollection\n    {\n        public bool RemoveCalled;\n        public bool AddCalled;\n        public IRegion AddArgument;\n\n        IEnumerator<IRegion> IEnumerable<IRegion>.GetEnumerator()\n        {\n            throw new System.NotImplementedException();\n        }\n\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public IRegion this[string regionName]\n        {\n            get { throw new System.NotImplementedException(); }\n        }\n\n        public void Add(IRegion region)\n        {\n            AddCalled = true;\n            AddArgument = region;\n        }\n\n        public bool Remove(string regionName)\n        {\n            RemoveCalled = true;\n            return true;\n        }\n\n        public bool ContainsRegionWithName(string regionName)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public void Add(string regionName, IRegion region)\n        {\n            throw new NotImplementedException();\n        }\n\n        public event System.Collections.Specialized.NotifyCollectionChangedEventHandler CollectionChanged;\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Regions/Behaviors/RegionMemberLifetimeBehaviorFixture.cs",
    "content": "using Moq;\nusing Prism.Avalonia.Tests.Mocks;\nusing Prism.Navigation.Regions;\nusing Prism.Navigation.Regions.Behaviors;\nusing Xunit;\n\nnamespace Prism.Avalonia.Tests.Regions.Behaviors\n{\n    public class RegionMemberLifetimeBehaviorFixture\n    {\n        protected Region Region { get; set; } = new();\n\n        protected RegionMemberLifetimeBehavior Behavior { get; set; } = new();\n\n        public RegionMemberLifetimeBehaviorFixture()\n        {\n            Arrange();\n        }\n\n        protected virtual void Arrange()\n        {\n            Region = new Region();\n            Behavior = new RegionMemberLifetimeBehavior();\n            Behavior.Region = Region;\n            Behavior.Attach();\n        }\n\n        [Fact]\n        public void WhenBehaviorAttachedThenReportsIsAttached()\n        {\n            Assert.True(Behavior.IsAttached);\n        }\n\n        [Fact]\n        public void WhenIRegionMemberLifetimeItemReturnsKeepAliveFalseRemovesWhenInactive()\n        {\n            // Arrange\n            var regionItemMock = new Mock<IRegionMemberLifetime>();\n            regionItemMock.Setup(i => i.KeepAlive).Returns(false);\n\n            Region.Add(regionItemMock.Object);\n            Region.Activate(regionItemMock.Object);\n\n            // Act\n            Region.Deactivate(regionItemMock.Object);\n\n            // Assert\n            Assert.False(Region.Views.Contains(regionItemMock.Object));\n        }\n\n        [Fact]\n        public void WhenIRegionMemberLifetimeItemReturnsKeepAliveTrueDoesNotRemoveOnDeactivation()\n        {\n            // Arrange\n            var regionItemMock = new Mock<IRegionMemberLifetime>();\n            regionItemMock.Setup(i => i.KeepAlive).Returns(true);\n\n            Region.Add(regionItemMock.Object);\n            Region.Activate(regionItemMock.Object);\n\n            // Act\n            Region.Deactivate(regionItemMock.Object);\n\n            // Assert\n            Assert.True(Region.Views.Contains(regionItemMock.Object));\n\n        }\n\n        [Fact]\n        public void WhenIRegionMemberLifetimeItemReturnsKeepAliveFalseCanRemoveFromRegion()\n        {\n            // Arrange\n            var regionItemMock = new Mock<IRegionMemberLifetime>();\n            regionItemMock.Setup(i => i.KeepAlive).Returns(false);\n\n            var view = regionItemMock.Object;\n\n            Region.Add(view);\n            Region.Activate(view);\n\n            // The presence of the following two lines is essential for the test:\n            // we want to access both ActiveView and Views in that order\n            Assert.True(Region.ActiveViews.Contains(view));\n            Assert.True(Region.Views.Contains(view));\n\n            // Act\n            // This may throw\n            Region.Remove(view);\n\n            // Assert\n            Assert.False(Region.Views.Contains(view));\n            Assert.False(Region.ActiveViews.Contains(view));\n        }\n\n        [Fact]\n        public void WhenRegionContainsMultipleMembers_OnlyRemovesThoseDeactivated()\n        {\n            // Arrange\n            var firstMockItem = new Mock<IRegionMemberLifetime>();\n            firstMockItem.Setup(i => i.KeepAlive).Returns(true);\n\n            var secondMockItem = new Mock<IRegionMemberLifetime>();\n            secondMockItem.Setup(i => i.KeepAlive).Returns(false);\n\n            Region.Add(firstMockItem.Object);\n            Region.Activate(firstMockItem.Object);\n\n            Region.Add(secondMockItem.Object);\n            Region.Activate(secondMockItem.Object);\n\n            // Act\n            Region.Deactivate(secondMockItem.Object);\n\n            // Assert\n            Assert.True(Region.Views.Contains(firstMockItem.Object));\n            Assert.False(Region.Views.Contains(secondMockItem.Object));\n        }\n\n        [Fact]\n        public void WhenMemberNeverActivatedThenIsNotRemovedOnAnothersDeactivation()\n        {\n            // Arrange\n            var firstMockItem = new Mock<IRegionMemberLifetime>();\n            firstMockItem.Setup(i => i.KeepAlive).Returns(false);\n\n            var secondMockItem = new Mock<IRegionMemberLifetime>();\n            secondMockItem.Setup(i => i.KeepAlive).Returns(false);\n\n            Region.Add(firstMockItem.Object);  // Never activated\n\n            Region.Add(secondMockItem.Object);\n            Region.Activate(secondMockItem.Object);\n\n            // Act\n            Region.Deactivate(secondMockItem.Object);\n\n            // Assert\n            Assert.True(Region.Views.Contains(firstMockItem.Object));\n            Assert.False(Region.Views.Contains(secondMockItem.Object));\n        }\n\n        [StaFact]\n        public virtual void RemovesRegionItemIfDataContextReturnsKeepAliveFalse()\n        {\n            // Arrange\n            var regionItemMock = new Mock<IRegionMemberLifetime>();\n            regionItemMock.Setup(i => i.KeepAlive).Returns(false);\n\n            var regionItem = new MockFrameworkElement();\n            regionItem.DataContext = regionItemMock.Object;\n\n            Region.Add(regionItem);\n            Region.Activate(regionItem);\n\n            // Act\n            Region.Deactivate(regionItem);\n\n            // Assert\n            Assert.False(Region.Views.Contains(regionItem));\n        }\n\n        [StaFact]\n        public virtual void RemovesOnlyDeactivatedItemsInRegionBasedOnDataContextKeepAlive()\n        {\n            // Arrange\n            var regionItemDataContextToKeepAlive = new Mock<IRegionMemberLifetime>();\n            regionItemDataContextToKeepAlive.Setup(i => i.KeepAlive).Returns(true);\n\n            var regionItemToKeepAlive = new MockFrameworkElement();\n            regionItemToKeepAlive.DataContext = regionItemDataContextToKeepAlive.Object;\n            Region.Add(regionItemToKeepAlive);\n            Region.Activate(regionItemToKeepAlive);\n\n            var regionItemMock = new Mock<IRegionMemberLifetime>();\n            regionItemMock.Setup(i => i.KeepAlive).Returns(false);\n\n            var regionItem = new MockFrameworkElement();\n            regionItem.DataContext = regionItemMock.Object;\n\n            Region.Add(regionItem);\n            Region.Activate(regionItem);\n\n            // Act\n            Region.Deactivate(regionItem);\n\n            // Assert\n            Assert.False(Region.Views.Contains(regionItem));\n            Assert.True(Region.Views.Contains(regionItemToKeepAlive));\n        }\n\n        [Fact]\n        public virtual void WillRemoveDeactivatedItemIfKeepAliveAttributeFalse()\n        {\n            // Arrange\n            var regionItem = new RegionMemberNotKeptAlive();\n\n            Region.Add(regionItem);\n            Region.Activate(regionItem);\n\n            // Act\n            Region.Deactivate(regionItem);\n\n            // Assert\n            Assert.False(Region.Views.Contains((object)regionItem));\n        }\n\n        [Fact]\n        public virtual void WillNotRemoveDeactivatedItemIfKeepAliveAttributeTrue()\n        {\n            // Arrange\n            var regionItem = new RegionMemberKeptAlive();\n\n            Region.Add(regionItem);\n            Region.Activate(regionItem);\n\n            // Act\n            Region.Deactivate(regionItem);\n\n            // Assert\n            Assert.True(Region.Views.Contains((object)regionItem));\n        }\n\n        [StaFact]\n        public virtual void WillRemoveDeactivatedItemIfDataContextKeepAliveAttributeFalse()\n        {\n            // Arrange\n            var regionItemDataContext = new RegionMemberNotKeptAlive();\n            var regionItem = new MockFrameworkElement() { DataContext = regionItemDataContext };\n            Region.Add(regionItem);\n            Region.Activate(regionItem);\n\n            // Act\n            Region.Deactivate(regionItem);\n\n            // Assert\n            Assert.False(Region.Views.Contains(regionItem));\n        }\n\n        [RegionMemberLifetime(KeepAlive = false)]\n        public class RegionMemberNotKeptAlive\n        {\n        }\n\n        [RegionMemberLifetime(KeepAlive = true)]\n        public class RegionMemberKeptAlive\n        {\n        }\n    }\n\n    public class RegionMemberLifetimeBehaviorAgainstSingleActiveRegionFixture\n                : RegionMemberLifetimeBehaviorFixture\n    {\n        protected override void Arrange()\n        {\n            Region = new SingleActiveRegion();\n            Behavior = new RegionMemberLifetimeBehavior();\n            Behavior.Region = Region;\n            Behavior.Attach();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Regions/Behaviors/SelectorItemsSourceSyncRegionBehaviorFixture.cs",
    "content": "﻿// This feature is currently disabled\n// See, Prism.Avalonia.Regions.Behaviors.SelectorItemsSourceSyncBehavior.cs for more info.\n/*\nusing System;\nusing System.Collections;\nusing System.Linq;\nusing Avalonia.Controls;\nusing Avalonia.Controls.Primitives;\nusing Avalonia.Data;\nusing Prism.Navigation.Regions;\nusing Prism.Navigation.Regions.Behaviors;\nusing Prism.Avalonia.Tests.Mocks;\nusing Xunit;\n\nnamespace Prism.Avalonia.Tests.Regions.Behaviors\n{\n    public class SelectorItemsSourceSyncRegionBehaviorFixture\n    {\n        [StaFact]\n        public void CanAttachToSelector()\n        {\n            SelectorItemsSourceSyncBehavior behavior = CreateBehavior();\n            behavior.Attach();\n\n            Assert.True(behavior.IsAttached);\n        }\n\n        [StaFact]\n        public void AttachSetsItemsSourceOfSelector()\n        {\n            SelectorItemsSourceSyncBehavior behavior = CreateBehavior();\n\n            var v1 = new Button();\n            var v2 = new Button();\n\n            behavior.Region.Add(v1);\n            behavior.Region.Add(v2);\n\n            behavior.Attach();\n\n            Assert.Equal(2, (behavior.HostControl as Selector).Items.Count);\n        }\n\n        [StaFact]\n        public void IfViewsHaveSortHintThenViewsAreProperlySorted()\n        {\n            SelectorItemsSourceSyncBehavior behavior = CreateBehavior();\n\n            var v1 = new MockSortableView1();\n            var v2 = new MockSortableView2();\n            var v3 = new MockSortableView3();\n            behavior.Attach();\n\n            behavior.Region.Add(v3);\n            behavior.Region.Add(v2);\n            behavior.Region.Add(v1);\n\n            Assert.Equal(3, (behavior.HostControl as Selector).Items.Count);\n\n            Assert.Same(v1, (behavior.HostControl as Selector).Items[0]);\n            Assert.Same(v2, (behavior.HostControl as Selector).Items[1]);\n            Assert.Same(v3, (behavior.HostControl as Selector).Items[2]);\n        }\n\n\n        [StaFact]\n        public void SelectionChangedShouldChangeActiveViews()\n        {\n            SelectorItemsSourceSyncBehavior behavior = CreateBehavior();\n\n            var v1 = new Button();\n            var v2 = new Button();\n\n            behavior.Region.Add(v1);\n            behavior.Region.Add(v2);\n\n            behavior.Attach();\n\n            (behavior.HostControl as Selector).SelectedItem = v1;\n            var activeViews = behavior.Region.ActiveViews;\n\n            Assert.Single(activeViews);\n            Assert.Equal(v1, activeViews.First());\n\n            (behavior.HostControl as Selector).SelectedItem = v2;\n\n            Assert.Single(activeViews);\n            Assert.Equal(v2, activeViews.First());\n        }\n\n        [StaFact]\n        public void ActiveViewChangedShouldChangeSelectedItem()\n        {\n            SelectorItemsSourceSyncBehavior behavior = CreateBehavior();\n\n            var v1 = new Button();\n            var v2 = new Button();\n\n            behavior.Region.Add(v1);\n            behavior.Region.Add(v2);\n\n            behavior.Attach();\n\n            behavior.Region.Activate(v1);\n            Assert.Equal(v1, (behavior.HostControl as Selector).SelectedItem);\n\n            behavior.Region.Activate(v2);\n            Assert.Equal(v2, (behavior.HostControl as Selector).SelectedItem);\n        }\n\n        [StaFact]\n        public void ItemsSourceSetThrows()\n        {\n            var ex = Assert.Throws<InvalidOperationException>(() =>\n            {\n                SelectorItemsSourceSyncBehavior behavior = CreateBehavior();\n\n                (behavior.HostControl as Selector).ItemsSource = new[] { new Button() };\n\n                behavior.Attach();\n            });\n\n        }\n\n        [StaFact]\n        public void ControlWithExistingBindingOnItemsSourceWithNullValueThrows()\n        {\n            var behavor = CreateBehavior();\n\n            Binding binding = new Binding(\"Enumerable\");\n            binding.Source = new SimpleModel() { Enumerable = null };\n            (behavor.HostControl as Selector).SetBinding(ItemsControl.ItemsSourceProperty, binding);\n\n            try\n            {\n                behavor.Attach();\n\n            }\n            catch (Exception ex)\n            {\n                Assert.IsType<InvalidOperationException>(ex);\n                Assert.Contains(\"ItemsControl's ItemsSource property is not empty.\", ex.Message);\n            }\n        }\n\n        [StaFact]\n        public void AddingViewToTwoRegionsThrows()\n        {\n            var ex = Assert.Throws<InvalidOperationException>(() =>\n            {\n                var behavior1 = CreateBehavior();\n                var behavior2 = CreateBehavior();\n\n                behavior1.Attach();\n                behavior2.Attach();\n                var v1 = new Button();\n\n                behavior1.Region.Add(v1);\n                behavior2.Region.Add(v1);\n            });\n\n        }\n\n        [StaFact]\n        public void ReactivatingViewAddsViewToTab()\n        {\n            var behavior1 = CreateBehavior();\n            behavior1.Attach();\n\n            var v1 = new Button();\n            var v2 = new Button();\n\n            behavior1.Region.Add(v1);\n            behavior1.Region.Add(v2);\n\n            behavior1.Region.Activate(v1);\n            Assert.True(behavior1.Region.ActiveViews.First() == v1);\n\n            behavior1.Region.Activate(v2);\n            Assert.True(behavior1.Region.ActiveViews.First() == v2);\n\n            behavior1.Region.Activate(v1);\n            Assert.True(behavior1.Region.ActiveViews.First() == v1);\n        }\n\n        [StaFact]\n        public void ShouldAllowMultipleSelectedItemsForListBox()\n        {\n            var behavior1 = CreateBehavior();\n            ListBox listBox = new ListBox();\n            listBox.SelectionMode = SelectionMode.Multiple;\n            behavior1.HostControl = listBox;\n            behavior1.Attach();\n\n            var v1 = new Button();\n            var v2 = new Button();\n\n            behavior1.Region.Add(v1);\n            behavior1.Region.Add(v2);\n\n            listBox.SelectedItems.Add(v1);\n            listBox.SelectedItems.Add(v2);\n\n            Assert.True(behavior1.Region.ActiveViews.Contains(v1));\n            Assert.True(behavior1.Region.ActiveViews.Contains(v2));\n\n        }\n\n        private SelectorItemsSourceSyncBehavior CreateBehavior()\n        {\n            Region region = new Region();\n            Selector selector = new TabControl();\n\n            var behavior = new SelectorItemsSourceSyncBehavior();\n            behavior.HostControl = selector;\n            behavior.Region = region;\n            return behavior;\n        }\n\n        private class SimpleModel\n        {\n            public IEnumerable Enumerable { get; set; }\n        }\n    }\n}\n*/\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Regions/Behaviors/SyncRegionContextWithHostBehaviorFixture.cs",
    "content": "using System;\nusing Avalonia;\nusing Prism.Avalonia.Tests.Mocks;\nusing Prism.Common;\nusing Prism.Navigation.Regions;\nusing Prism.Navigation.Regions.Behaviors;\nusing Xunit;\n\nnamespace Prism.Avalonia.Tests.Regions.Behaviors\n{\n    public class SyncRegionContextWithHostBehaviorFixture\n    {\n        [StaFact(Skip = \"System.ArgumentNullException : Value cannot be null. (Parameter 'view')\")]\n        public void ShouldForwardRegionContextValueToHostControl()\n        {\n            MockPresentationRegion region = new MockPresentationRegion();\n\n            SyncRegionContextWithHostBehavior behavior = new SyncRegionContextWithHostBehavior();\n            behavior.Region = region;\n            AvaloniaObject mockDependencyObject = new MockDependencyObject();\n            behavior.HostControl = mockDependencyObject;\n\n            behavior.Attach();\n            Assert.Null(region.Context);\n            RegionContext.GetObservableContext(mockDependencyObject).Value = \"NewValue\";\n\n            Assert.Equal(\"NewValue\", region.Context);\n\n        }\n\n        [StaFact(Skip = \"System.ArgumentNullException : Value cannot be null. (Parameter 'view')\")]\n        public void ShouldUpdateHostControlRegionContextValueWhenContextOfRegionChanges()\n        {\n            MockPresentationRegion region = new MockPresentationRegion();\n\n            SyncRegionContextWithHostBehavior behavior = new SyncRegionContextWithHostBehavior();\n            behavior.Region = region;\n            AvaloniaObject mockDependencyObject = new MockDependencyObject();\n            behavior.HostControl = mockDependencyObject;\n\n            ObservableObject<object> observableRegionContext = RegionContext.GetObservableContext(mockDependencyObject);\n\n            behavior.Attach();\n            Assert.Null(observableRegionContext.Value);\n            region.Context = \"NewValue\";\n\n            Assert.Equal(\"NewValue\", observableRegionContext.Value);\n\n        }\n\n        [StaFact(Skip = \"System.ArgumentNullException : Value cannot be null. (Parameter 'view')\")]\n        public void ShouldGetInitialValueFromHostAndSetOnRegion()\n        {\n            MockPresentationRegion region = new MockPresentationRegion();\n\n            SyncRegionContextWithHostBehavior behavior = new SyncRegionContextWithHostBehavior();\n            behavior.Region = region;\n            AvaloniaObject mockDependencyObject = new MockDependencyObject();\n            behavior.HostControl = mockDependencyObject;\n\n            RegionContext.GetObservableContext(mockDependencyObject).Value = \"NewValue\";\n\n            Assert.Null(region.Context);\n            behavior.Attach();\n            Assert.Equal(\"NewValue\", region.Context);\n\n        }\n\n        [StaFact]\n        public void AttachShouldNotThrowWhenHostControlNull()\n        {\n            MockPresentationRegion region = new MockPresentationRegion();\n\n            SyncRegionContextWithHostBehavior behavior = new SyncRegionContextWithHostBehavior();\n            behavior.Region = region;\n            behavior.Attach();\n        }\n\n        [StaFact]\n        public void AttachShouldNotThrowWhenHostControlNullAndRegionContextSet()\n        {\n            MockPresentationRegion region = new MockPresentationRegion();\n\n            SyncRegionContextWithHostBehavior behavior = new SyncRegionContextWithHostBehavior();\n            behavior.Region = region;\n            behavior.Attach();\n            region.Context = \"Changed\";\n        }\n\n        [StaFact(Skip = \"System.ArgumentNullException : Value cannot be null. (Parameter 'view')\")]\n        public void ChangingRegionContextObservableObjectValueShouldAlsoChangeRegionContextDependencyProperty()\n        {\n            MockPresentationRegion region = new MockPresentationRegion();\n\n            SyncRegionContextWithHostBehavior behavior = new SyncRegionContextWithHostBehavior();\n            behavior.Region = region;\n            AvaloniaObject hostControl = new MockDependencyObject();\n            behavior.HostControl = hostControl;\n\n            behavior.Attach();\n\n            Assert.Null(RegionManager.GetRegionContext(hostControl));\n            RegionContext.GetObservableContext(hostControl).Value = \"NewValue\";\n\n            Assert.Equal(\"NewValue\", RegionManager.GetRegionContext(hostControl));\n        }\n\n        [StaFact(Skip = \"Value cannot be null. (Parameter 'view')\")]\n        public void AttachShouldChangeRegionContextDependencyProperty()\n        {\n            MockPresentationRegion region = new MockPresentationRegion();\n\n            SyncRegionContextWithHostBehavior behavior = new SyncRegionContextWithHostBehavior();\n            behavior.Region = region;\n            AvaloniaObject hostControl = new MockDependencyObject();\n            behavior.HostControl = hostControl;\n\n            RegionContext.GetObservableContext(hostControl).Value = \"NewValue\";\n\n            Assert.Null(RegionManager.GetRegionContext(hostControl));\n            behavior.Attach();\n            Assert.Equal(\"NewValue\", RegionManager.GetRegionContext(hostControl));\n        }\n\n        [StaFact]\n        public void SettingHostControlAfterAttachThrows()\n        {\n            var ex = Assert.Throws<InvalidOperationException>(() =>\n            {\n                SyncRegionContextWithHostBehavior behavior = new SyncRegionContextWithHostBehavior();\n                AvaloniaObject hostControl1 = new MockDependencyObject();\n                behavior.HostControl = hostControl1;\n\n                behavior.Attach();\n                AvaloniaObject hostControl2 = new MockDependencyObject();\n                behavior.HostControl = hostControl2;\n            });\n\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Regions/ContentControlRegionAdapterFixture.cs",
    "content": "using System;\nusing System.Linq;\nusing Avalonia.Controls;\nusing Avalonia.Data;\nusing Prism.Avalonia.Tests.Mocks;\nusing Prism.Navigation.Regions;\nusing Xunit;\n\nnamespace Prism.Avalonia.Tests.Regions\n{\n    public class ContentControlRegionAdapterFixture\n    {\n        [StaFact]\n        public void AdapterAssociatesSelectorWithRegionActiveViews()\n        {\n            var control = new ContentControl();\n            IRegionAdapter adapter = new TestableContentControlRegionAdapter();\n\n            MockPresentationRegion region = (MockPresentationRegion)adapter.Initialize(control, \"Region1\");\n            Assert.NotNull(region);\n\n            Assert.Null(control.Content);\n            region.MockActiveViews.Items.Add(new object());\n\n            Assert.NotNull(control.Content);\n            Assert.Same(control.Content, region.ActiveViews.ElementAt(0));\n\n            region.MockActiveViews.Items.Add(new object());\n            Assert.Same(control.Content, region.ActiveViews.ElementAt(0));\n\n            region.MockActiveViews.Items.RemoveAt(0);\n            Assert.Same(control.Content, region.ActiveViews.ElementAt(0));\n\n            region.MockActiveViews.Items.RemoveAt(0);\n            Assert.Null(control.Content);\n        }\n\n        [StaFact]\n        public void ControlWithExistingContentThrows()\n        {\n            var control = new ContentControl() { Content = new object() };\n\n            IRegionAdapter adapter = new TestableContentControlRegionAdapter();\n\n            try\n            {\n                var region = (MockPresentationRegion)adapter.Initialize(control, \"Region1\");\n                //Assert.Fail();\n            }\n            catch (Exception ex)\n            {\n                Assert.IsType<InvalidOperationException>(ex);\n                Assert.Contains(\"ContentControl's Content property is not empty.\", ex.Message);\n            }\n        }\n\n        [StaFact]\n        public void ControlWithExistingBindingOnContentWithNullValueThrows()\n        {\n            var control = new ContentControl();\n            Binding binding = new Binding(\"ObjectContents\");\n            binding.Source = new SimpleModel() { ObjectContents = null };\n            control.SetValue(ContentControl.ContentProperty, binding);\n            /// WPF: control.SetBinding(ContentControl.ContentProperty, binding);\n\n            IRegionAdapter adapter = new TestableContentControlRegionAdapter();\n\n            try\n            {\n                var region = (MockPresentationRegion)adapter.Initialize(control, \"Region1\");\n                //Assert.Fail();\n            }\n            catch (Exception ex)\n            {\n                Assert.IsType<InvalidOperationException>(ex);\n                Assert.Contains(\"ContentControl's Content property is not empty.\", ex.Message);\n            }\n        }\n\n        [StaFact]\n        public void AddedItemShouldBeActivated()\n        {\n            var control = new ContentControl();\n            IRegionAdapter adapter = new TestableContentControlRegionAdapter();\n\n            MockPresentationRegion region = (MockPresentationRegion)adapter.Initialize(control, \"Region1\");\n\n            var mockView = new object();\n            region.Add(mockView);\n\n            Assert.Single(region.ActiveViews);\n            Assert.True(region.ActiveViews.Contains(mockView));\n        }\n\n        [StaFact]\n        public void ShouldNotActivateAdditionalViewsAdded()\n        {\n            var control = new ContentControl();\n            IRegionAdapter adapter = new TestableContentControlRegionAdapter();\n\n            MockPresentationRegion region = (MockPresentationRegion)adapter.Initialize(control, \"Region1\");\n\n            var mockView = new object();\n            region.Add(mockView);\n            region.Add(new object());\n\n            Assert.Single(region.ActiveViews);\n            Assert.True(region.ActiveViews.Contains(mockView));\n        }\n\n        [StaFact]\n        public void ShouldActivateAddedViewWhenNoneIsActive()\n        {\n            var control = new ContentControl();\n            IRegionAdapter adapter = new TestableContentControlRegionAdapter();\n\n            MockPresentationRegion region = (MockPresentationRegion)adapter.Initialize(control, \"Region1\");\n\n            var mockView1 = new object();\n            region.Add(mockView1);\n            region.Deactivate(mockView1);\n\n            var mockView2 = new object();\n            region.Add(mockView2);\n\n            Assert.Single(region.ActiveViews);\n            Assert.True(region.ActiveViews.Contains(mockView2));\n        }\n\n        [StaFact]\n        public void CanRemoveViewWhenNoneActive()\n        {\n            var control = new ContentControl();\n            IRegionAdapter adapter = new TestableContentControlRegionAdapter();\n\n            MockPresentationRegion region = (MockPresentationRegion)adapter.Initialize(control, \"Region1\");\n\n            var mockView1 = new object();\n            region.Add(mockView1);\n            region.Deactivate(mockView1);\n            region.Remove(mockView1);\n            Assert.Empty(region.ActiveViews);\n        }\n\n        class SimpleModel\n        {\n            public Object ObjectContents { get; set; }\n        }\n\n        private class TestableContentControlRegionAdapter : ContentControlRegionAdapter\n        {\n            public TestableContentControlRegionAdapter() : base(null)\n            {\n            }\n\n            private MockPresentationRegion region = new MockPresentationRegion();\n\n            protected override IRegion CreateRegion()\n            {\n                return region;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Regions/ItemsControlRegionAdapterFixture.cs",
    "content": "﻿// TODO: 2022-07-12\n// REF: https://github.com/AvaloniaUI/Avalonia/issues/7553\n// Cannot perform the following. Check out, ContentControlRegionAdapterFixture.cs\n// However, ItemsControl.Items is `IEnumerable` and doesn't play nicely.\n//  `control.Items.Add(view);`\n//  `control.Items[0]`\n//  Needs Tested: `control.SetBinding(ItemsControl.ItemsSourceProperty, binding);`\n/*\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Prism.Navigation.Regions;\nusing Prism.Avalonia.Tests.Mocks;\nusing Avalonia.Controls;\nusing Avalonia.Data;\nusing Xunit;\n\nnamespace Prism.Avalonia.Tests.Regions\n{\n    public class ItemsControlRegionAdapterFixture\n    {\n        [StaFact]\n        public void AdapterAssociatesItemsControlWithRegion()\n        {\n            var control = new ItemsControl();\n            IRegionAdapter adapter = new TestableItemsControlRegionAdapter();\n\n            IRegion region = adapter.Initialize(control, \"Region1\");\n            Assert.NotNull(region);\n\n            //// WPF: Assert.Same(control.ItemsSource, region.Views);\n            Assert.Same(control.Items, region.Views);\n        }\n\n        [StaFact]\n        public void AdapterAssignsARegionThatHasAllViewsActive()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            var control = new ItemsControl();\n            IRegionAdapter adapter = new ItemsControlRegionAdapter(null);\n\n            IRegion region = adapter.Initialize(control, \"Region1\");\n            Assert.NotNull(region);\n            Assert.IsType<AllActiveRegion>(region);\n        }\n\n        [StaFact]\n        public void ShouldMoveAlreadyExistingContentInControlToRegion()\n        {\n            var control = new ItemsControl();\n            var view = new object();\n            control.Items.Add(view);\n            IRegionAdapter adapter = new TestableItemsControlRegionAdapter();\n\n            var region = (MockPresentationRegion)adapter.Initialize(control, \"Region1\");\n\n            Assert.Single(region.MockViews);\n            Assert.Same(view, region.MockViews.ElementAt(0));\n            Assert.Same(view, control.Items[0]);\n        }\n\n        [StaFact]\n        public void ControlWithExistingItemSourceThrows()\n        {\n            var control = new ItemsControl() { Items = new List<string>() };\n\n            IRegionAdapter adapter = new TestableItemsControlRegionAdapter();\n\n            try\n            {\n                var region = (MockPresentationRegion)adapter.Initialize(control, \"Region1\");\n                //Assert.Fail();\n            }\n            catch (Exception ex)\n            {\n                Assert.IsType<InvalidOperationException>(ex);\n                Assert.Contains(\"ItemsControl's ItemsSource property is not empty.\", ex.Message);\n            }\n        }\n\n        [StaFact]\n        public void ControlWithExistingBindingOnItemsSourceWithNullValueThrows()\n        {\n            var control = new ItemsControl();\n            Binding binding = new Binding(\"Enumerable\");\n            binding.Source = new SimpleModel() { Enumerable = null };\n            // WPF: control.SetBinding(ItemsControl.ItemsSourceProperty, binding);\n            // NEEDS TESTED - (From, Suess):\n            control.SetValue(ItemsControl.ItemsProperty, binding);\n\n            IRegionAdapter adapter = new TestableItemsControlRegionAdapter();\n\n            try\n            {\n                var region = (MockPresentationRegion)adapter.Initialize(control, \"Region1\");\n                //Assert.Fail();\n            }\n            catch (Exception ex)\n            {\n                Assert.IsType<InvalidOperationException>(ex);\n                Assert.Contains(\"ItemsControl's ItemsSource property is not empty.\", ex.Message);\n            }\n        }\n\n        class SimpleModel\n        {\n            public IEnumerable Enumerable { get; set; }\n        }\n\n        private class TestableItemsControlRegionAdapter : ItemsControlRegionAdapter\n        {\n            public TestableItemsControlRegionAdapter() : base(null)\n            {\n            }\n\n            private MockPresentationRegion region = new MockPresentationRegion();\n\n            protected override IRegion CreateRegion()\n            {\n                return region;\n            }\n        }\n    }\n}\n*/\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Regions/LocatorNavigationTargetHandlerFixture.cs",
    "content": "using System;\nusing Avalonia.Controls;\nusing Moq;\nusing Prism.Ioc;\nusing Prism.Navigation.Regions;\nusing Xunit;\nusing static Prism.Avalonia.Tests.Regions.LocatorNavigationTargetHandlerFixture;\n\nnamespace Prism.Avalonia.Tests.Regions\n{\n    public class LocatorNavigationTargetHandlerFixture\n    {\n        [Fact]\n        public void WhenViewExistsAndDoesNotImplementINavigationAware_ThenReturnsView()\n        {\n            // Arrange\n            var containerMock = new Mock<IContainerExtension>();\n            ContainerLocator.SetContainerExtension(containerMock.Object);\n\n            var region = new Region();\n\n            var view = new TestView();\n\n            region.Add(view);\n\n            var navigationContext = new NavigationContext(null, new Uri(view.GetType().Name, UriKind.Relative));\n\n            var navigationTargetHandler = new TestRegionNavigationContentLoader(containerMock.Object);\n\n            // Act\n            var returnedView = navigationTargetHandler.LoadContent(region, navigationContext);\n\n            // Assert\n            Assert.Same(view, returnedView);\n        }\n\n        [Fact]\n        public void WhenRegionHasMultipleViews_ThenViewsWithMatchingTypeNameAreConsidered()\n        {\n            // Arrange\n\n            var containerMock = new Mock<IContainerExtension>();\n            ContainerLocator.SetContainerExtension(containerMock.Object);\n\n            var region = new Region();\n\n            var view1 = new TestView();\n            var view2 = new Test2View();\n\n            region.Add(view1);\n            region.Add(view2);\n            var navigationContext = new NavigationContext(null, new Uri(view2.GetType().Name, UriKind.Relative));\n            var navigationTargetHandler = new TestRegionNavigationContentLoader(containerMock.Object);\n            // Act\n            var returnedView = navigationTargetHandler.LoadContent(region, navigationContext);\n            // Assert\n            Assert.Same(view2, returnedView);\n        }\n\n        [Fact]\n        public void WhenRegionHasMultipleViews_ThenViewsWithMatchingFullTypeNameAreConsidered()\n        {\n            // Arrange\n            var containerMock = new Mock<IContainerExtension>();\n            ContainerLocator.SetContainerExtension(containerMock.Object);\n\n            var region = new Region();\n\n            var view1 = new TestView();\n            var view2 = new Test2View();\n\n            region.Add(view1);\n            region.Add(view2);\n\n            var navigationContext = new NavigationContext(null, new Uri(view2.GetType().FullName, UriKind.Relative));\n\n            var navigationTargetHandler = new TestRegionNavigationContentLoader(containerMock.Object);\n\n            // Act\n            var returnedView = navigationTargetHandler.LoadContent(region, navigationContext);\n\n            // Assert\n            Assert.Same(view2, returnedView);\n        }\n\n        [Fact]\n        public void WhenViewExistsAndImplementsINavigationAware_ThenViewIsQueriedForNavigationAndIsReturnedIfAcceptsIt()\n        {\n            // Arrange\n            var containerMock = new Mock<IContainerExtension>();\n            ContainerLocator.SetContainerExtension(containerMock.Object);\n\n            var region = new Region();\n\n            var viewMock = new Mock<INavigationAware>();\n            viewMock\n                .Setup(v => v.IsNavigationTarget(It.IsAny<NavigationContext>()))\n                .Returns(true)\n                .Verifiable();\n\n            region.Add(viewMock.Object);\n\n            var navigationContext = new NavigationContext(null, new Uri(viewMock.Object.GetType().Name, UriKind.Relative));\n\n            var navigationTargetHandler = new TestRegionNavigationContentLoader(containerMock.Object);\n\n            // Act\n            var returnedView = navigationTargetHandler.LoadContent(region, navigationContext);\n\n            // Assert\n            Assert.Same(viewMock.Object, returnedView);\n            viewMock.VerifyAll();\n        }\n\n        [StaFact]\n        public void WhenViewExistsAndHasDataContextThatImplementsINavigationAware_ThenDataContextIsQueriedForNavigationAndIsReturnedIfAcceptsIt()\n        {\n            // Arrange\n            var containerMock = new Mock<IContainerExtension>();\n            ContainerLocator.SetContainerExtension(containerMock.Object);\n\n            var region = new Region();\n\n            var dataContextMock = new Mock<INavigationAware>();\n            dataContextMock\n                .Setup(v => v.IsNavigationTarget(It.IsAny<NavigationContext>()))\n                .Returns(true)\n                .Verifiable();\n            var viewMock = new Mock<Control>();\n            viewMock.Object.DataContext = dataContextMock.Object;\n\n            region.Add(viewMock.Object);\n\n            var navigationContext = new NavigationContext(null, new Uri(viewMock.Object.GetType().Name, UriKind.Relative));\n\n            var navigationTargetHandler = new TestRegionNavigationContentLoader(containerMock.Object);\n\n            // Act\n            var returnedView = navigationTargetHandler.LoadContent(region, navigationContext);\n\n            // Assert\n            Assert.Same(viewMock.Object, returnedView);\n            dataContextMock.VerifyAll();\n        }\n\n        [Fact]\n        public void WhenNoCurrentMatchingViewExists_ThenReturnsNewlyCreatedInstanceWithServiceLocatorAddedToTheRegion()\n        {\n            // Arrange\n            var containerMock = new Mock<IContainerExtension>();\n            ContainerLocator.SetContainerExtension(containerMock.Object);\n\n            var region = new Region();\n\n            var view = new TestView();\n\n            containerMock.Setup(sl => sl.Resolve(typeof(object), view.GetType().Name)).Returns(view);\n\n            var navigationContext = new NavigationContext(null, new Uri(view.GetType().Name, UriKind.Relative));\n\n            var navigationTargetHandler = new TestRegionNavigationContentLoader(containerMock.Object);\n\n            // Act\n            var returnedView = navigationTargetHandler.LoadContent(region, navigationContext);\n\n            // Assert\n            Assert.Same(view, returnedView);\n            Assert.True(region.Views.Contains(view));\n        }\n\n        [Fact]\n        public void WhenViewExistsAndImplementsINavigationAware_ThenViewIsQueriedForNavigationAndNewInstanceIsCreatedIfItRejectsIt()\n        {\n            // Arrange\n            var containerMock = new Mock<IContainerExtension>();\n            ContainerLocator.SetContainerExtension(containerMock.Object);\n\n            var region = new Region();\n\n            var viewMock = new Mock<INavigationAware>();\n            viewMock\n                .Setup(v => v.IsNavigationTarget(It.IsAny<NavigationContext>()))\n                .Returns(false)\n                .Verifiable();\n\n            region.Add(viewMock.Object);\n\n            var newView = new TestView();\n\n            containerMock.Setup(sl => sl.Resolve(typeof(object), viewMock.Object.GetType().Name)).Returns(newView);\n\n            var navigationContext = new NavigationContext(null, new Uri(viewMock.Object.GetType().Name, UriKind.Relative));\n\n            var navigationTargetHandler = new TestRegionNavigationContentLoader(containerMock.Object);\n\n            // Act\n            var returnedView = navigationTargetHandler.LoadContent(region, navigationContext);\n\n            // Assert\n            Assert.Same(newView, returnedView);\n            Assert.True(region.Views.Contains(newView));\n            viewMock.VerifyAll();\n        }\n\n        [StaFact]\n        public void WhenViewExistsAndHasDataContextThatImplementsINavigationAware_ThenDataContextIsQueriedForNavigationAndNewInstanceIsCreatedIfItRejectsIt()\n        {\n            // Arrange\n            var containerMock = new Mock<IContainerExtension>();\n            ContainerLocator.SetContainerExtension(containerMock.Object);\n\n            var region = new Region();\n\n            var dataContextMock = new Mock<INavigationAware>();\n            dataContextMock\n                .Setup(v => v.IsNavigationTarget(It.IsAny<NavigationContext>()))\n                .Returns(false)\n                .Verifiable();\n\n            var viewMock = new Mock<Control>();\n            viewMock.Object.DataContext = dataContextMock.Object;\n\n            region.Add(viewMock.Object);\n\n            var newView = new TestView();\n\n            containerMock.Setup(sl => sl.Resolve(typeof(object), viewMock.Object.GetType().Name)).Returns(newView);\n\n            var navigationContext = new NavigationContext(null, new Uri(viewMock.Object.GetType().Name, UriKind.Relative));\n\n            var navigationTargetHandler = new TestRegionNavigationContentLoader(containerMock.Object);\n\n            // Act\n            var returnedView = navigationTargetHandler.LoadContent(region, navigationContext);\n\n            // Assert\n            Assert.Same(newView, returnedView);\n            Assert.True(region.Views.Contains(newView));\n            dataContextMock.VerifyAll();\n        }\n\n        [Fact]\n        public void WhenViewCannotBeCreated_ThenThrowsAnException()\n        {\n            var containerMock = new Mock<IContainerExtension>();\n            ContainerLocator.SetContainerExtension(containerMock.Object);\n\n            containerMock.Setup(sl => sl.Resolve(typeof(object), typeof(TestView).Name)).Throws<ActivationException>();\n\n            var region = new Region();\n\n            var navigationContext = new NavigationContext(null, new Uri(typeof(TestView).Name, UriKind.Relative));\n\n            var navigationTargetHandler = new TestRegionNavigationContentLoader(containerMock.Object);\n\n            // Act\n            ExceptionAssert.Throws<InvalidOperationException>(\n                () =>\n                {\n                    navigationTargetHandler.LoadContent(region, navigationContext);\n\n                });\n        }\n\n        [Fact]\n        public void WhenViewAddedByHandlerDoesNotImplementINavigationAware_ThenReturnsView()\n        {\n            // Arrange\n            var containerMock = new Mock<IContainerExtension>();\n            ContainerLocator.SetContainerExtension(containerMock.Object);\n\n            var region = new Region();\n\n            var view = new TestView();\n\n            containerMock.Setup(sl => sl.Resolve(typeof(object), view.GetType().Name)).Returns(view);\n\n            var navigationContext = new NavigationContext(null, new Uri(view.GetType().Name, UriKind.Relative));\n\n            var navigationTargetHandler = new TestRegionNavigationContentLoader(containerMock.Object);\n\n            // Act\n            var firstReturnedView = navigationTargetHandler.LoadContent(region, navigationContext);\n            var secondReturnedView = navigationTargetHandler.LoadContent(region, navigationContext);\n\n            // Assert\n            Assert.Same(view, firstReturnedView);\n            Assert.Same(view, secondReturnedView);\n            containerMock.Verify(sl => sl.Resolve(typeof(object), view.GetType().Name), Times.Once());\n        }\n\n        [Fact]\n        public void WhenRequestingContentForNullRegion_ThenThrows()\n        {\n            var containerMock = new Mock<IContainerExtension>();\n\n            var navigationContext = new NavigationContext(null, new Uri(\"/\", UriKind.Relative));\n\n            var navigationTargetHandler = new TestRegionNavigationContentLoader(containerMock.Object);\n\n            ExceptionAssert.Throws<ArgumentNullException>(\n                () =>\n                {\n                    navigationTargetHandler.LoadContent(null, navigationContext);\n\n                });\n        }\n\n        [Fact]\n        public void WhenRequestingContentForNullContext_ThenThrows()\n        {\n            var containerMock = new Mock<IContainerExtension>();\n            ContainerLocator.SetContainerExtension(containerMock.Object);\n\n            var region = new Region();\n\n            var navigationTargetHandler = new TestRegionNavigationContentLoader(containerMock.Object);\n\n            ExceptionAssert.Throws<ArgumentNullException>(\n                () =>\n                {\n                    navigationTargetHandler.LoadContent(region, null);\n\n                });\n        }\n\n        public class TestRegionNavigationContentLoader : RegionNavigationContentLoader\n        {\n            public TestRegionNavigationContentLoader(IContainerExtension container)\n                : base(container)\n            { }\n        }\n\n        public class TestView { }\n\n        public class Test2View { }\n    }\n\n    public class ActivationException : Exception\n    {\n        public ActivationException()\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Regions/NavigationAsyncExtensionsFixture.cs",
    "content": "using System;\nusing Moq;\nusing Prism.Navigation;\nusing Prism.Navigation.Regions;\nusing Xunit;\n\nnamespace Prism.Avalonia.Tests.Regions\n{\n    public class NavigationAsyncExtensionsFixture\n    {\n        [Fact]\n        public void WhenNavigatingWithANullThis_ThenThrows()\n        {\n            INavigateAsync navigate = null;\n            string target = \"\";\n\n            ExceptionAssert.Throws<ArgumentNullException>(\n                () =>\n                {\n                    navigate.RequestNavigate(target);\n                });\n        }\n\n        [Fact]\n        public void WhenNavigatingWithANullStringTarget_ThenThrows()\n        {\n            INavigateAsync navigate = new Mock<INavigateAsync>().Object;\n            string target = null;\n\n            ExceptionAssert.Throws<ArgumentNullException>(\n                () =>\n                {\n                    navigate.RequestNavigate(target);\n                });\n        }\n\n        [Fact]\n        public void WhenNavigatingWithARelativeStringTarget_ThenNavigatesToRelativeUri()\n        {\n            var navigateMock = new Mock<INavigateAsync>();\n            navigateMock\n                .Setup(nv =>\n                    nv.RequestNavigate(\n                        It.Is<Uri>(u => !u.IsAbsoluteUri && u.OriginalString == \"relative\"),\n                        It.Is<Action<NavigationResult>>(c => c != null),\n                        It.IsAny<INavigationParameters>()))\n                .Verifiable();\n\n            string target = \"relative\";\n\n            navigateMock.Object.RequestNavigate(target);\n\n            navigateMock.VerifyAll();\n        }\n\n        [Fact]\n        public void WhenNavigatingWithAnAbsoluteStringTarget_ThenNavigatesToAbsoluteUri()\n        {\n            var navigateMock = new Mock<INavigateAsync>();\n            navigateMock\n                .Setup(nv =>\n                    nv.RequestNavigate(\n                        It.Is<Uri>(u => u.IsAbsoluteUri && u.Host == \"test\" && u.AbsolutePath == \"/path\"),\n                        It.Is<Action<NavigationResult>>(c => c != null),\n                        It.IsAny<INavigationParameters>()))\n                .Verifiable();\n\n            string target = \"http://test/path\";\n\n            navigateMock.Object.RequestNavigate(target);\n\n            navigateMock.VerifyAll();\n        }\n\n        [Fact]\n        public void WhenNavigatingWithANullThisAndAUri_ThenThrows()\n        {\n            INavigateAsync navigate = null;\n            Uri target = new Uri(\"test\", UriKind.Relative);\n\n            ExceptionAssert.Throws<ArgumentNullException>(\n                () =>\n                {\n                    navigate.RequestNavigate(target);\n                });\n        }\n\n        [Fact]\n        public void WhenNavigatingWithAUri_ThenNavigatesToUriWithCallback()\n        {\n            Uri target = new Uri(\"relative\", UriKind.Relative);\n\n            var navigateMock = new Mock<INavigateAsync>();\n            navigateMock\n                .Setup(nv =>\n                    nv.RequestNavigate(\n                        target,\n                        It.Is<Action<NavigationResult>>(c => c != null),\n                        It.IsAny<INavigationParameters>()))\n                .Verifiable();\n\n            navigateMock.Object.RequestNavigate(target);\n\n            navigateMock.VerifyAll();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Regions/NavigationContextFixture.cs",
    "content": "using System;\nusing Moq;\nusing Prism.Navigation.Regions;\nusing Xunit;\n\nnamespace Prism.Avalonia.Tests.Regions\n{\n    public class NavigationContextFixture\n    {\n        [Fact]\n        public void WhenCreatingANewContextForAUriWithAQuery_ThenNewContextInitializesPropertiesAndExtractsTheQuery()\n        {\n            var uri = new Uri(\"test?name=value\", UriKind.Relative);\n\n            var navigationJournalMock = new Mock<IRegionNavigationJournal>();\n            var navigationServiceMock = new Mock<IRegionNavigationService>();\n\n            IRegion region = new Region();\n            navigationServiceMock.SetupGet(n => n.Region).Returns(region);\n            navigationServiceMock.SetupGet(x => x.Journal).Returns(navigationJournalMock.Object);\n\n            var context = new NavigationContext(navigationServiceMock.Object, uri);\n\n            Assert.Same(navigationServiceMock.Object, context.NavigationService);\n            Assert.Equal(uri, context.Uri);\n            Assert.Single(context.Parameters);\n            Assert.Equal(\"value\", context.Parameters[\"name\"]);\n        }\n\n        [Fact]\n        public void WhenCreatingANewContextForAUriWithNoQuery_ThenNewContextInitializesPropertiesGetsEmptyQuery()\n        {\n            var uri = new Uri(\"test\", UriKind.Relative);\n\n            var navigationJournalMock = new Mock<IRegionNavigationJournal>();\n\n            var navigationServiceMock = new Mock<IRegionNavigationService>();\n            navigationServiceMock.SetupGet(x => x.Journal).Returns(navigationJournalMock.Object);\n\n            var context = new NavigationContext(navigationServiceMock.Object, uri);\n\n            Assert.Same(navigationServiceMock.Object, context.NavigationService);\n            Assert.Equal(uri, context.Uri);\n            Assert.Empty(context.Parameters);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Regions/RegionAdapterBaseFixture.cs",
    "content": "using System;\nusing Prism.Avalonia.Tests.Mocks;\nusing Prism.Navigation.Regions;\nusing Xunit;\n\nnamespace Prism.Avalonia.Tests.Regions\n{\n    public class RegionAdapterBaseFixture\n    {\n        [Fact]\n        public void IncorrectTypeThrows()\n        {\n            var ex = Assert.Throws<InvalidOperationException>(() =>\n            {\n                IRegionAdapter adapter = new TestableRegionAdapterBase();\n                adapter.Initialize(new MockDependencyObject(), \"Region1\");\n            });\n        }\n\n        [Fact]\n        public void InitializeSetsRegionName()\n        {\n            IRegionAdapter adapter = new TestableRegionAdapterBase();\n            var region = adapter.Initialize(new MockRegionTarget(), \"Region1\");\n            Assert.Equal(\"Region1\", region.Name);\n        }\n\n        [Fact]\n        public void NullRegionNameThrows()\n        {\n            var ex = Assert.Throws<ArgumentNullException>(() =>\n            {\n                IRegionAdapter adapter = new TestableRegionAdapterBase();\n                var region = adapter.Initialize(new MockRegionTarget(), null);\n            });\n\n        }\n\n        [Fact]\n        public void NullObjectThrows()\n        {\n            var ex = Assert.Throws<ArgumentNullException>(() =>\n            {\n                IRegionAdapter adapter = new TestableRegionAdapterBase();\n                adapter.Initialize(null, \"Region1\");\n            });\n\n        }\n\n        [Fact]\n        public void CreateRegionReturnValueIsPassedToAdapt()\n        {\n            var regionTarget = new MockRegionTarget();\n            var adapter = new TestableRegionAdapterBase();\n\n            adapter.Initialize(regionTarget, \"Region1\");\n\n            Assert.Same(adapter.CreateRegionReturnValue, adapter.AdaptArgumentRegion);\n            Assert.Same(regionTarget, adapter.adaptArgumentRegionTarget);\n        }\n\n        [Fact]\n        public void CreateRegionReturnValueIsPassedToAttachBehaviors()\n        {\n            var regionTarget = new MockRegionTarget();\n            var adapter = new TestableRegionAdapterBase();\n\n            var region = adapter.Initialize(regionTarget, \"Region1\");\n\n            Assert.Same(adapter.CreateRegionReturnValue, adapter.AttachBehaviorsArgumentRegion);\n            Assert.Same(regionTarget, adapter.attachBehaviorsArgumentTargetToAdapt);\n        }\n\n        class TestableRegionAdapterBase : RegionAdapterBase<MockRegionTarget>\n        {\n            public IRegion CreateRegionReturnValue = new MockPresentationRegion();\n            public IRegion AdaptArgumentRegion;\n            public MockRegionTarget adaptArgumentRegionTarget;\n            public IRegion AttachBehaviorsArgumentRegion;\n            public MockRegionTarget attachBehaviorsArgumentTargetToAdapt;\n\n            public TestableRegionAdapterBase() : base(null)\n            {\n\n            }\n\n            protected override void Adapt(IRegion region, MockRegionTarget regionTarget)\n            {\n                AdaptArgumentRegion = region;\n                adaptArgumentRegionTarget = regionTarget;\n            }\n\n            protected override IRegion CreateRegion()\n            {\n                return CreateRegionReturnValue;\n            }\n\n            protected override void AttachBehaviors(IRegion region, MockRegionTarget regionTarget)\n            {\n                AttachBehaviorsArgumentRegion = region;\n                attachBehaviorsArgumentTargetToAdapt = regionTarget;\n                base.AttachBehaviors(region, regionTarget);\n            }\n        }\n\n        class MockRegionTarget\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Regions/RegionAdapterMappingsFixture.cs",
    "content": "using Prism.Navigation.Regions;\nusing Prism.Avalonia.Tests.Mocks;\nusing Avalonia.Controls;\nusing Moq;\nusing Prism.Ioc;\nusing Xunit;\nusing System;\nusing System.Collections.Generic;\n\nnamespace Prism.Avalonia.Tests.Regions\n{\n    public class RegionAdapterMappingsFixture\n    {\n        [Fact]\n        public void ShouldGetRegisteredMapping()\n        {\n            var regionAdapterMappings = new RegionAdapterMappings();\n            Type registeredType = typeof(ItemsControl);\n            var regionAdapter = new MockRegionAdapter();\n\n            regionAdapterMappings.RegisterMapping(registeredType, regionAdapter);\n            var returnedAdapter = regionAdapterMappings.GetMapping(registeredType);\n\n            Assert.NotNull(returnedAdapter);\n            Assert.Same(regionAdapter, returnedAdapter);\n        }\n\n        [Fact]\n        public void ShouldGetRegisteredMapping_UsingGenericControl()\n        {\n            var regionAdapterMappings = new RegionAdapterMappings();\n            var regionAdapter = new MockRegionAdapter();\n\n            regionAdapterMappings.RegisterMapping<ItemsControl>(regionAdapter);\n\n            var returnedAdapter = regionAdapterMappings.GetMapping<ItemsControl>();\n\n            Assert.NotNull(returnedAdapter);\n            Assert.Same(regionAdapter, returnedAdapter);\n        }\n\n        [Fact]\n        public void ShouldGetRegisteredMapping_UsingGenericControlAndAdapter()\n        {\n            try\n            {\n                var regionAdapterMappings = new RegionAdapterMappings();\n                var regionAdapter = new MockRegionAdapter();\n\n                var containerMock = new Mock<IContainerExtension>();\n                containerMock.Setup(c => c.Resolve(typeof(MockRegionAdapter)))\n                             .Returns(regionAdapter);\n                ContainerLocator.ResetContainer();\n                ContainerLocator.SetContainerExtension(containerMock.Object);\n\n                regionAdapterMappings.RegisterMapping<ItemsControl, MockRegionAdapter>();\n\n                var returnedAdapter = regionAdapterMappings.GetMapping<ItemsControl>();\n\n                Assert.NotNull(returnedAdapter);\n                Assert.Same(regionAdapter, returnedAdapter);\n            }\n            finally\n            {\n                ContainerLocator.ResetContainer();\n            }\n        }\n\n        [Fact]\n        public void ShouldGetMappingForDerivedTypesThanTheRegisteredOnes()\n        {\n            var regionAdapterMappings = new RegionAdapterMappings();\n            var regionAdapter = new MockRegionAdapter();\n\n            regionAdapterMappings.RegisterMapping(typeof(ItemsControl), regionAdapter);\n            var returnedAdapter = regionAdapterMappings.GetMapping(typeof(ItemsControlDescendant));\n\n            Assert.NotNull(returnedAdapter);\n            Assert.Same(regionAdapter, returnedAdapter);\n        }\n\n        [Fact]\n        public void GetMappingOfUnregisteredTypeThrows()\n        {\n            var ex = Assert.Throws<KeyNotFoundException>(() =>\n            {\n                var regionAdapterMappings = new RegionAdapterMappings();\n                regionAdapterMappings.GetMapping(typeof(object));\n            });\n\n        }\n\n        [Fact]\n        public void ShouldGetTheMostSpecializedMapping()\n        {\n            var regionAdapterMappings = new RegionAdapterMappings();\n            var genericAdapter = new MockRegionAdapter();\n            var specializedAdapter = new MockRegionAdapter();\n\n            regionAdapterMappings.RegisterMapping(typeof(ItemsControl), genericAdapter);\n            regionAdapterMappings.RegisterMapping(typeof(ItemsControlDescendant), specializedAdapter);\n            var returnedAdapter = regionAdapterMappings.GetMapping(typeof(ItemsControlDescendant));\n\n            Assert.NotNull(returnedAdapter);\n            Assert.Same(specializedAdapter, returnedAdapter);\n        }\n\n        [Fact]\n        public void RegisterAMappingThatAlreadyExistsThrows()\n        {\n            var ex = Assert.Throws<InvalidOperationException>(() =>\n            {\n                var regionAdapterMappings = new RegionAdapterMappings();\n                var regionAdapter = new MockRegionAdapter();\n\n                regionAdapterMappings.RegisterMapping(typeof(ItemsControl), regionAdapter);\n                regionAdapterMappings.RegisterMapping(typeof(ItemsControl), regionAdapter);\n            });\n        }\n\n        [Fact]\n        public void NullControlThrows()\n        {\n            var ex = Assert.Throws<ArgumentNullException>(() =>\n            {\n                var regionAdapterMappings = new RegionAdapterMappings();\n                var regionAdapter = new MockRegionAdapter();\n\n                regionAdapterMappings.RegisterMapping(null, regionAdapter);\n            });\n\n        }\n\n        [Fact]\n        public void NullAdapterThrows()\n        {\n            var ex = Assert.Throws<ArgumentNullException>(() =>\n            {\n                var regionAdapterMappings = new RegionAdapterMappings();\n\n                regionAdapterMappings.RegisterMapping(typeof(ItemsControl), null);\n            });\n\n        }\n\n        class ItemsControlDescendant : ItemsControl { }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Regions/RegionBehaviorCollectionFixture.cs",
    "content": "using Prism.Avalonia.Tests.Mocks;\nusing Prism.Navigation.Regions;\nusing Xunit;\n\nnamespace Prism.Avalonia.Tests.Regions\n{\n    public class RegionBehaviorCollectionFixture\n    {\n        [Fact]\n        public void CanAttachRegionBehaviors()\n        {\n            RegionBehaviorCollection behaviorCollection = new RegionBehaviorCollection(new MockPresentationRegion());\n\n            var mock1 = new MockRegionBehavior();\n            bool mock1Attached = false;\n            mock1.OnAttach = () => mock1Attached = true;\n            behaviorCollection.Add(\"Mock1\", mock1);\n\n            var mock2 = new MockRegionBehavior();\n            bool mock2Attached = false;\n            mock2.OnAttach = () => mock2Attached = true;\n            behaviorCollection.Add(\"Mock2\", mock2);\n\n            Assert.True(mock1Attached);\n            Assert.True(mock2Attached);\n        }\n\n        [Fact]\n        public void ShouldAddRegionWhenAddingBehavior()\n        {\n            var region = new MockPresentationRegion();\n            RegionBehaviorCollection behaviorCollection = new RegionBehaviorCollection(region);\n            var behavior = new MockRegionBehavior();\n\n            behaviorCollection.Add(\"Mock\", behavior);\n\n            Assert.NotNull(behavior.Region);\n            Assert.Same(region, behavior.Region);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Regions/RegionBehaviorFactoryFixture.cs",
    "content": "using Prism.Avalonia.Tests.Mocks;\nusing Moq;\nusing Prism.Ioc;\nusing Xunit;\nusing Prism.Navigation.Regions;\nusing System.Linq;\nusing System;\n\nnamespace Prism.Avalonia.Tests.Regions\n{\n    public class RegionBehaviorFactoryFixture\n    {\n        [Fact]\n        public void CanRegisterType()\n        {\n            RegionBehaviorFactory factory = new RegionBehaviorFactory(null);\n\n            factory.AddIfMissing(\"key1\", typeof(MockRegionBehavior));\n            factory.AddIfMissing(\"key2\", typeof(MockRegionBehavior));\n\n            Assert.Equal(2, factory.Count());\n            Assert.True(factory.ContainsKey(\"key1\"));\n\n        }\n\n        [Fact]\n        public void WillNotAddTypesWithDuplicateKeys()\n        {\n            RegionBehaviorFactory factory = new RegionBehaviorFactory(null);\n\n            factory.AddIfMissing(\"key1\", typeof(MockRegionBehavior));\n            factory.AddIfMissing(\"key1\", typeof(MockRegionBehavior));\n\n            Assert.Single(factory);\n        }\n\n        [Fact]\n        public void AddTypeThatDoesNotInheritFromIRegionBehaviorThrows()\n        {\n            var ex = Assert.Throws<ArgumentException>(() =>\n            {\n                RegionBehaviorFactory factory = new RegionBehaviorFactory(null);\n\n                factory.AddIfMissing(\"key1\", typeof(object));\n            });\n\n        }\n\n        [Fact]\n        public void CanCreateRegisteredType()\n        {\n            var expectedBehavior = new MockRegionBehavior();\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(c => c.Resolve(typeof(MockRegionBehavior))).Returns(expectedBehavior);\n            RegionBehaviorFactory factory = new RegionBehaviorFactory(containerMock.Object);\n\n            factory.AddIfMissing(\"key1\", typeof(MockRegionBehavior));\n            var behavior = factory.CreateFromKey(\"key1\");\n\n            Assert.Same(expectedBehavior, behavior);\n        }\n\n        [Fact]\n        public void CreateWithUnknownKeyThrows()\n        {\n            var ex = Assert.Throws<ArgumentException>(() =>\n            {\n                RegionBehaviorFactory factory = new RegionBehaviorFactory(null);\n\n                factory.CreateFromKey(\"Key1\");\n            });\n\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Regions/RegionBehaviorFixture.cs",
    "content": "using System;\nusing Prism.Avalonia.Tests.Mocks;\nusing Prism.Navigation.Regions;\nusing Xunit;\n\nnamespace Prism.Avalonia.Tests.Regions\n{\n    public class RegionBehaviorFixture\n    {\n        [Fact]\n        public void CannotChangeRegionAfterAttach()\n        {\n            var ex = Assert.Throws<InvalidOperationException>(() =>\n            {\n                TestableRegionBehavior regionBehavior = new TestableRegionBehavior();\n\n                regionBehavior.Region = new MockPresentationRegion();\n\n                regionBehavior.Attach();\n                regionBehavior.Region = new MockPresentationRegion();\n            });\n\n        }\n\n        [Fact]\n        public void ShouldFailWhenAttachedWithoutRegion()\n        {\n            var ex = Assert.Throws<InvalidOperationException>(() =>\n            {\n                TestableRegionBehavior regionBehavior = new TestableRegionBehavior();\n                regionBehavior.Attach();\n            });\n\n        }\n\n        [Fact]\n        public void ShouldCallOnAttachWhenAttachMethodIsInvoked()\n        {\n            TestableRegionBehavior regionBehavior = new TestableRegionBehavior();\n\n            regionBehavior.Region = new MockPresentationRegion();\n\n            regionBehavior.Attach();\n\n            Assert.True(regionBehavior.onAttachCalled);\n        }\n\n        private class TestableRegionBehavior : RegionBehavior\n        {\n            public bool onAttachCalled;\n\n            protected override void OnAttach()\n            {\n                onAttachCalled = true;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Regions/RegionFixture.cs",
    "content": "using System;\nusing System.Collections.Specialized;\nusing System.Linq;\nusing Moq;\nusing Prism.Ioc;\nusing Prism.Avalonia.Tests.Mocks;\nusing Xunit;\nusing Prism.Navigation.Regions;\nusing Prism.Navigation;\n\nnamespace Prism.Avalonia.Tests.Regions\n{\n    public class RegionFixture\n    {\n        [Fact]\n        public void WhenRegionConstructed_SortComparisonIsDefault()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            IRegion region = new Region();\n\n            Assert.NotNull(region.SortComparison);\n            Assert.Equal(region.SortComparison, Region.DefaultSortComparison);\n        }\n\n        [Fact]\n        public void CanAddContentToRegion()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            IRegion region = new Region();\n\n            Assert.Empty(region.Views.Cast<object>());\n\n            region.Add(new object());\n\n            Assert.Single(region.Views.Cast<object>());\n        }\n\n        [Fact]\n        public void CanRemoveContentFromRegion()\n        {\n            IRegion region = new Region();\n            object view = new object();\n\n            region.Add(view);\n            region.Remove(view);\n\n            Assert.Empty(region.Views.Cast<object>());\n        }\n\n        [Fact]\n        public void RemoveInexistentViewThrows()\n        {\n            var ex = Assert.Throws<ArgumentException>(() =>\n            {\n                IRegion region = new Region();\n                object view = new object();\n\n                region.Remove(view);\n\n                Assert.Empty(region.Views.Cast<object>());\n            });\n\n        }\n\n        [Fact]\n        public void RegionExposesCollectionOfContainedViews()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            IRegion region = new Region();\n\n            object view = new object();\n\n            region.Add(view);\n\n            var views = region.Views;\n\n            Assert.NotNull(views);\n            Assert.Single(views.Cast<object>());\n            Assert.Same(view, views.Cast<object>().ElementAt(0));\n        }\n\n        [Fact]\n        public void CanAddAndRetrieveNamedViewInstance()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            IRegion region = new Region();\n            object myView = new object();\n            region.Add(myView, \"MyView\");\n            object returnedView = region.GetView(\"MyView\");\n\n            Assert.NotNull(returnedView);\n            Assert.Same(returnedView, myView);\n        }\n\n        [Fact]\n        public void AddingDuplicateNamedViewThrows()\n        {\n            var ex = Assert.Throws<InvalidOperationException>(() =>\n            {\n                IRegion region = new Region();\n\n                region.Add(new object(), \"MyView\");\n                region.Add(new object(), \"MyView\");\n            });\n\n        }\n\n        [Fact]\n        public void AddNamedViewIsAlsoListedInViewsCollection()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            IRegion region = new Region();\n            object myView = new object();\n\n            region.Add(myView, \"MyView\");\n\n            Assert.Single(region.Views.Cast<object>());\n            Assert.Same(myView, region.Views.Cast<object>().ElementAt(0));\n        }\n\n        [Fact]\n        public void GetViewReturnsNullWhenViewDoesNotExistInRegion()\n        {\n            IRegion region = new Region();\n\n            Assert.Null(region.GetView(\"InexistentView\"));\n        }\n\n        [Fact]\n        public void GetViewWithNullOrEmptyStringThrows()\n        {\n            var ex = Assert.Throws<ArgumentException>(() =>\n            {\n                IRegion region = new Region();\n\n                region.GetView(string.Empty);\n            });\n\n        }\n\n        [Fact]\n        public void AddNamedViewWithNullOrEmptyStringNameThrows()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            var ex = Assert.Throws<ArgumentException>(() =>\n            {\n                IRegion region = new Region();\n\n                region.Add(new object(), string.Empty);\n            });\n\n        }\n\n        [Fact]\n        public void GetViewReturnsNullAfterRemovingViewFromRegion()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            IRegion region = new Region();\n            object myView = new object();\n            region.Add(myView, \"MyView\");\n            region.Remove(myView);\n\n            Assert.Null(region.GetView(\"MyView\"));\n        }\n\n        [Fact]\n        public void AddViewPassesSameScopeByDefaultToView()\n        {\n            var regionManager = new MockRegionManager();\n            IRegion region = new Region();\n            region.RegionManager = regionManager;\n            var myView = new MockDependencyObject();\n\n            region.Add(myView);\n\n            Assert.Same(regionManager, myView.GetValue(RegionManager.RegionManagerProperty));\n        }\n\n        [Fact]\n        public void AddViewPassesSameScopeByDefaultToNamedView()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            var regionManager = new MockRegionManager();\n            IRegion region = new Region();\n            region.RegionManager = regionManager;\n            var myView = new MockDependencyObject();\n\n            region.Add(myView, \"MyView\");\n\n            Assert.Same(regionManager, myView.GetValue(RegionManager.RegionManagerProperty));\n        }\n\n        [Fact]\n        public void AddViewPassesDifferentScopeWhenAdding()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            var regionManager = new MockRegionManager();\n            IRegion region = new Region();\n            region.RegionManager = regionManager;\n            var myView = new MockDependencyObject();\n\n            region.Add(myView, \"MyView\", true);\n\n            Assert.NotSame(regionManager, myView.GetValue(RegionManager.RegionManagerProperty));\n        }\n\n        [Fact]\n        public void CreatingNewScopesAsksTheRegionManagerForNewInstance()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            var regionManager = new MockRegionManager();\n            IRegion region = new Region();\n            region.RegionManager = regionManager;\n            var myView = new object();\n\n            region.Add(myView, \"MyView\", true);\n\n            Assert.True(regionManager.CreateRegionManagerCalled);\n        }\n\n        [Fact]\n        public void AddViewReturnsExistingRegionManager()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            var regionManager = new MockRegionManager();\n            IRegion region = new Region();\n            region.RegionManager = regionManager;\n            var myView = new object();\n\n            var returnedRegionManager = region.Add(myView, \"MyView\", false);\n\n            Assert.Same(regionManager, returnedRegionManager);\n        }\n\n        [Fact]\n        public void AddViewReturnsNewRegionManager()\n        {\n            var regionManager = new MockRegionManager();\n            IRegion region = new Region();\n            region.RegionManager = regionManager;\n            var myView = new object();\n\n            var returnedRegionManager = region.Add(myView, \"MyView\", true);\n\n            Assert.NotSame(regionManager, returnedRegionManager);\n        }\n\n        [Fact]\n        public void AddingNonDependencyObjectToRegionDoesNotThrow()\n        {\n            IRegion region = new Region();\n            object model = new object();\n\n            region.Add(model);\n\n            Assert.Single(region.Views.Cast<object>());\n        }\n\n        [Fact]\n        public void ActivateNonAddedViewThrows()\n        {\n            var ex = Assert.Throws<ArgumentException>(() =>\n            {\n                IRegion region = new Region();\n\n                object nonAddedView = new object();\n\n                region.Activate(nonAddedView);\n            });\n\n        }\n\n        [Fact]\n        public void DeactivateNonAddedViewThrows()\n        {\n            var ex = Assert.Throws<ArgumentException>(() =>\n            {\n                IRegion region = new Region();\n\n                object nonAddedView = new object();\n\n                region.Deactivate(nonAddedView);\n            });\n\n        }\n\n        [Fact]\n        public void ActivateNullViewThrows()\n        {\n            var ex = Assert.Throws<ArgumentNullException>(() =>\n            {\n                IRegion region = new Region();\n\n                region.Activate(null);\n            });\n\n        }\n\n        [Fact]\n        public void AddViewRaisesCollectionViewEvent()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            bool viewAddedCalled = false;\n\n            IRegion region = new Region();\n            region.Views.CollectionChanged += (sender, e) =>\n            {\n                if (e.Action == NotifyCollectionChangedAction.Add)\n                    viewAddedCalled = true;\n            };\n\n            object model = new object();\n            Assert.False(viewAddedCalled);\n            region.Add(model);\n\n            Assert.True(viewAddedCalled);\n        }\n\n        [Fact]\n        public void ViewAddedEventPassesTheViewAddedInTheEventArgs()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            object viewAdded = null;\n\n            IRegion region = new Region();\n            region.Views.CollectionChanged += (sender, e) =>\n            {\n                if (e.Action == NotifyCollectionChangedAction.Add)\n                {\n                    viewAdded = e.NewItems[0];\n                }\n            };\n            object model = new object();\n            Assert.Null(viewAdded);\n            region.Add(model);\n\n            Assert.NotNull(viewAdded);\n            Assert.Same(model, viewAdded);\n        }\n\n        [Fact]\n        public void RemoveViewFiresViewRemovedEvent()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            bool viewRemoved = false;\n\n            IRegion region = new Region();\n            object model = new object();\n            region.Views.CollectionChanged += (sender, e) =>\n            {\n                if (e.Action == NotifyCollectionChangedAction.Remove)\n                    viewRemoved = true;\n            };\n\n            region.Add(model);\n            Assert.False(viewRemoved);\n\n            region.Remove(model);\n\n            Assert.True(viewRemoved);\n        }\n\n        [Fact]\n        public void ViewRemovedEventPassesTheViewRemovedInTheEventArgs()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            object removedView = null;\n\n            IRegion region = new Region();\n            region.Views.CollectionChanged += (sender, e) =>\n            {\n                if (e.Action == NotifyCollectionChangedAction.Remove)\n                    removedView = e.OldItems[0];\n            };\n            object model = new object();\n            region.Add(model);\n            Assert.Null(removedView);\n\n            region.Remove(model);\n\n            Assert.Same(model, removedView);\n        }\n\n        [Fact]\n        public void ShowViewFiresViewShowedEvent()\n        {\n            bool viewActivated = false;\n\n            IRegion region = new Region();\n            object model = new object();\n            region.ActiveViews.CollectionChanged += (o, e) =>\n            {\n                if (e.Action == NotifyCollectionChangedAction.Add && e.NewItems.Contains(model))\n                    viewActivated = true;\n            };\n            region.Add(model);\n            Assert.False(viewActivated);\n\n            region.Activate(model);\n\n            Assert.True(viewActivated);\n        }\n\n        [Fact]\n        public void AddingSameViewTwiceThrows()\n        {\n            object view = new object();\n            IRegion region = new Region();\n            region.Add(view);\n\n            try\n            {\n                region.Add(view);\n                //Assert.Fail();\n            }\n            catch (InvalidOperationException ex)\n            {\n                Assert.Equal(\"View already exists in region.\", ex.Message);\n            }\n            catch\n            {\n                //Assert.Fail();\n            }\n        }\n\n        [Fact]\n        public void RemovingViewAlsoRemovesItFromActiveViews()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            IRegion region = new Region();\n            object model = new object();\n            region.Add(model);\n            region.Activate(model);\n            Assert.True(region.ActiveViews.Contains(model));\n\n            region.Remove(model);\n\n            Assert.False(region.ActiveViews.Contains(model));\n        }\n\n        [Fact]\n        public void ShouldGetNotificationWhenContextChanges()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            IRegion region = new Region();\n            bool contextChanged = false;\n            region.PropertyChanged += (s, args) => { if (args.PropertyName == \"Context\") contextChanged = true; };\n\n            region.Context = \"MyNewContext\";\n\n            Assert.True(contextChanged);\n        }\n\n        [Fact]\n        public void ChangingNameOnceItIsSetThrows()\n        {\n            var ex = Assert.Throws<InvalidOperationException>(() =>\n            {\n                var region = new Region\n                {\n                    Name = \"MyRegion\"\n                };\n\n                region.Name = \"ChangedRegionName\";\n            });\n\n        }\n\n        private class MockRegionManager : IRegionManager\n        {\n            public bool CreateRegionManagerCalled;\n\n            public IRegionManager CreateRegionManager()\n            {\n                CreateRegionManagerCalled = true;\n                return new MockRegionManager();\n            }\n\n            public IRegionManager AddToRegion(string regionName, object view)\n            {\n                throw new NotImplementedException();\n            }\n\n            public IRegionManager RegisterViewWithRegion(string regionName, Type viewType)\n            {\n                throw new NotImplementedException();\n            }\n\n            public IRegionManager RegisterViewWithRegion(string regionName, Func<IContainerProvider, object> getContentDelegate)\n            {\n                throw new NotImplementedException();\n            }\n\n            public void RequestNavigate(string regionName, Uri source, Action<NavigationResult> navigationCallback)\n            {\n                throw new NotImplementedException();\n            }\n\n            public void RequestNavigate(string regionName, Uri source)\n            {\n                throw new NotImplementedException();\n            }\n\n            public void RequestNavigate(string regionName, string source, Action<NavigationResult> navigationCallback)\n            {\n                throw new NotImplementedException();\n            }\n\n            public void RequestNavigate(string regionName, string source)\n            {\n                throw new NotImplementedException();\n            }\n\n            public void RequestNavigate(string regionName, Uri target, Action<NavigationResult> navigationCallback, INavigationParameters navigationParameters)\n            {\n                throw new NotImplementedException();\n            }\n\n            public void RequestNavigate(string regionName, string target, Action<NavigationResult> navigationCallback, INavigationParameters navigationParameters)\n            {\n                throw new NotImplementedException();\n            }\n\n            public void RequestNavigate(string regionName, Uri target, INavigationParameters navigationParameters)\n            {\n                throw new NotImplementedException();\n            }\n\n            public void RequestNavigate(string regionName, string target, INavigationParameters navigationParameters)\n            {\n                throw new NotImplementedException();\n            }\n\n            public IRegionCollection Regions\n            {\n                get { throw new NotImplementedException(); }\n            }\n\n            public IRegion AttachNewRegion(object regionTarget, string regionName)\n            {\n                throw new NotImplementedException();\n            }\n\n            public bool Navigate(Uri source)\n            {\n                throw new NotImplementedException();\n            }\n\n            public IRegionManager AddToRegion(string regionName, string viewName)\n            {\n                throw new NotImplementedException();\n            }\n\n            public IRegionManager RegisterViewWithRegion(string regionName, string viewName)\n            {\n                throw new NotImplementedException();\n            }\n        }\n\n        [Fact]\n        public void NavigateDelegatesToIRegionNavigationService()\n        {\n            try\n            {\n                // Prepare\n                IRegion region = new Region();\n\n                object view = new object();\n                region.Add(view);\n\n                Uri uri = new Uri(view.GetType().Name, UriKind.Relative);\n                Action<NavigationResult> navigationCallback = nr => { };\n                NavigationParameters navigationParameters = new NavigationParameters();\n\n                Mock<IRegionNavigationService> mockRegionNavigationService = new Mock<IRegionNavigationService>();\n                mockRegionNavigationService.Setup(x => x.RequestNavigate(uri, navigationCallback, navigationParameters)).Verifiable();\n\n                var containerMock = new Mock<IContainerExtension>();\n                containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationService))).Returns(mockRegionNavigationService.Object);\n                ContainerLocator.ResetContainer();\n                ContainerLocator.SetContainerExtension(containerMock.Object);\n\n                // Act\n                region.RequestNavigate(uri, navigationCallback, navigationParameters);\n\n                // Verify\n                mockRegionNavigationService.VerifyAll();\n            }\n            finally\n            {\n                ContainerLocator.ResetContainer();\n            }\n        }\n\n        [Fact]\n        public void WhenViewsWithSortHintsAdded_RegionSortsViews()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            IRegion region = new Region();\n\n            object view1 = new ViewOrder1();\n            object view2 = new ViewOrder2();\n            object view3 = new ViewOrder3();\n\n            region.Add(view1);\n            region.Add(view2);\n            region.Add(view3);\n\n            Assert.Equal(3, region.Views.Count());\n            Assert.Same(view2, region.Views.ElementAt(0));\n            Assert.Same(view3, region.Views.ElementAt(1));\n            Assert.Same(view1, region.Views.ElementAt(2));\n        }\n\n        [StaFact]\n        public void WhenViewHasBeenRemovedAndRegionManagerPropertyCleared_ThenItCanBeAddedAgainToARegion()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            IRegion region = new Region { RegionManager = new MockRegionManager() };\n\n            var view = new MockFrameworkElement();\n\n            var scopedRegionManager = region.Add(view, null, true);\n\n            Assert.Equal(view, region.Views.First());\n\n            region.Remove(view);\n\n            view.ClearValue(RegionManager.RegionManagerProperty);\n\n            Assert.Empty(region.Views.Cast<object>());\n\n            var newScopedRegion = region.Add(view, null, true);\n\n            Assert.Equal(view, region.Views.First());\n\n            Assert.Same(newScopedRegion, view.GetValue(RegionManager.RegionManagerProperty));\n        }\n\n        [ViewSortHint(\"C\")]\n        private class ViewOrder1 { };\n\n        [ViewSortHint(\"A\")]\n        private class ViewOrder2 { };\n\n        [ViewSortHint(\"B\")]\n        private class ViewOrder3 { };\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Regions/RegionManagerFixture.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Collections.Specialized;\nusing System.Threading.Tasks;\nusing Moq;\nusing Prism.Avalonia.Tests.Mocks;\nusing Prism.Ioc;\nusing Prism.Navigation.Regions;\nusing Xunit;\n\nnamespace Prism.Avalonia.Tests.Regions\n{\n    public class RegionManagerFixture\n    {\n        [Fact]\n        public void CanAddRegion()\n        {\n            IRegion region1 = new MockPresentationRegion();\n            region1.Name = \"MainRegion\";\n\n            RegionManager regionManager = new RegionManager();\n            regionManager.Regions.Add(region1);\n\n            IRegion region2 = regionManager.Regions[\"MainRegion\"];\n            Assert.Same(region1, region2);\n        }\n\n        [Fact]\n        public void ShouldFailIfRegionDoesntExists()\n        {\n            var ex = Assert.Throws<KeyNotFoundException>(() =>\n            {\n                RegionManager regionManager = new RegionManager();\n                IRegion region = regionManager.Regions[\"nonExistentRegion\"];\n            });\n        }\n\n        [Fact]\n        public void CanCheckTheExistenceOfARegion()\n        {\n            RegionManager regionManager = new RegionManager();\n            bool result = regionManager.Regions.ContainsRegionWithName(\"noRegion\");\n\n            Assert.False(result);\n\n            IRegion region = new MockPresentationRegion();\n            region.Name = \"noRegion\";\n            regionManager.Regions.Add(region);\n\n            result = regionManager.Regions.ContainsRegionWithName(\"noRegion\");\n\n            Assert.True(result);\n        }\n\n        [Fact]\n        public void AddingMultipleRegionsWithSameNameThrowsArgumentException()\n        {\n            var ex = Assert.Throws<ArgumentException>(() =>\n            {\n                var regionManager = new RegionManager();\n                regionManager.Regions.Add(new MockPresentationRegion { Name = \"region name\" });\n                regionManager.Regions.Add(new MockPresentationRegion { Name = \"region name\" });\n            });\n\n        }\n\n        [Fact]\n        public void AddPassesItselfAsTheRegionManagerOfTheRegion()\n        {\n            var regionManager = new RegionManager();\n            var region = new MockPresentationRegion\n            {\n                Name = \"region\"\n            };\n\n            regionManager.Regions.Add(region);\n\n            Assert.Same(regionManager, region.RegionManager);\n        }\n\n        [Fact]\n        public void CreateRegionManagerCreatesANewInstance()\n        {\n            var regionManager = new RegionManager();\n            var createdRegionManager = regionManager.CreateRegionManager();\n            Assert.NotNull(createdRegionManager);\n            Assert.IsType<RegionManager>(createdRegionManager);\n            Assert.NotSame(regionManager, createdRegionManager);\n        }\n\n        [Fact]\n        public void CanRemoveRegion()\n        {\n            var regionManager = new RegionManager();\n            IRegion region = new MockPresentationRegion\n            {\n                Name = \"TestRegion\"\n            };\n\n            regionManager.Regions.Add(region);\n            regionManager.Regions.Remove(\"TestRegion\");\n\n            Assert.False(regionManager.Regions.ContainsRegionWithName(\"TestRegion\"));\n        }\n\n        [Fact]\n        public void ShouldRemoveRegionManagerWhenRemoving()\n        {\n            var regionManager = new RegionManager();\n            var region = new MockPresentationRegion\n            {\n                Name = \"TestRegion\"\n            };\n\n            regionManager.Regions.Add(region);\n            regionManager.Regions.Remove(\"TestRegion\");\n\n            Assert.Null(region.RegionManager);\n        }\n\n        [Fact]\n        public void UpdatingRegionsGetsCalledWhenAccessingRegionMembers()\n        {\n            var listener = new MySubscriberClass();\n\n            try\n            {\n                RegionManager.UpdatingRegions += listener.OnUpdatingRegions;\n                RegionManager regionManager = new RegionManager();\n                regionManager.Regions.ContainsRegionWithName(\"TestRegion\");\n                Assert.True(listener.OnUpdatingRegionsCalled);\n\n                listener.OnUpdatingRegionsCalled = false;\n                regionManager.Regions.Add(new MockPresentationRegion() { Name = \"TestRegion\" });\n                Assert.True(listener.OnUpdatingRegionsCalled);\n\n                listener.OnUpdatingRegionsCalled = false;\n                var region = regionManager.Regions[\"TestRegion\"];\n                Assert.True(listener.OnUpdatingRegionsCalled);\n\n                listener.OnUpdatingRegionsCalled = false;\n                regionManager.Regions.Remove(\"TestRegion\");\n                Assert.True(listener.OnUpdatingRegionsCalled);\n\n                listener.OnUpdatingRegionsCalled = false;\n                regionManager.Regions.GetEnumerator();\n                Assert.True(listener.OnUpdatingRegionsCalled);\n            }\n            finally\n            {\n                RegionManager.UpdatingRegions -= listener.OnUpdatingRegions;\n            }\n        }\n\n        [StaFact(Skip = \"Avalonia doesn't auto-create ObservableObject in RegionContext\")]\n        public void ShouldSetObservableRegionContextWhenRegionContextChanges()\n        {\n            var region = new MockPresentationRegion();\n            var view = new MockDependencyObject();\n\n            var observableObject = RegionContext.GetObservableContext(view);\n\n            bool propertyChangedCalled = false;\n            observableObject.PropertyChanged += (sender, args) => propertyChangedCalled = true;\n\n            Assert.Null(observableObject.Value);\n            RegionManager.SetRegionContext(view, \"MyContext\");\n            Assert.True(propertyChangedCalled);\n            Assert.Equal(\"MyContext\", observableObject.Value);\n        }\n\n        [Fact]\n        public async Task ShouldNotPreventSubscribersToStaticEventFromBeingGarbageCollected()\n        {\n            var subscriber = new MySubscriberClass();\n            RegionManager.UpdatingRegions += subscriber.OnUpdatingRegions;\n            RegionManager.UpdateRegions();\n            Assert.True(subscriber.OnUpdatingRegionsCalled);\n            WeakReference subscriberWeakReference = new WeakReference(subscriber);\n\n            subscriber = null;\n            await Task.Delay(50);\n            GC.Collect();\n\n            Assert.False(subscriberWeakReference.IsAlive);\n        }\n\n        [Fact]\n        public void ExceptionMessageWhenCallingUpdateRegionsShouldBeClear()\n        {\n            try\n            {\n                ExceptionExtensions.RegisterFrameworkExceptionType(typeof(FrameworkException));\n                RegionManager.UpdatingRegions += new EventHandler(RegionManager_UpdatingRegions);\n\n                try\n                {\n                    RegionManager.UpdateRegions();\n                    //Assert.Fail();\n                }\n                catch (Exception ex)\n                {\n                    Assert.Contains(\"Abcde\", ex.Message);\n                }\n            }\n            finally\n            {\n                RegionManager.UpdatingRegions -= new EventHandler(RegionManager_UpdatingRegions);\n            }\n        }\n\n        private void RegionManager_UpdatingRegions(object sender, EventArgs e)\n        {\n            try\n            {\n                throw new Exception(\"Abcde\");\n            }\n            catch (Exception ex)\n            {\n                throw new FrameworkException(ex);\n            }\n        }\n\n        internal class MySubscriberClass\n        {\n            public bool OnUpdatingRegionsCalled;\n\n            public void OnUpdatingRegions(object sender, EventArgs e)\n            {\n                OnUpdatingRegionsCalled = true;\n            }\n        }\n\n        [Fact]\n        public void WhenAddingRegions_ThenRegionsCollectionNotifiesUpdate()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            var regionManager = new RegionManager();\n\n            var region1 = new Region { Name = \"region1\" };\n            var region2 = new Region { Name = \"region2\" };\n\n            NotifyCollectionChangedEventArgs args = null;\n            regionManager.Regions.CollectionChanged += (s, e) => args = e;\n\n            regionManager.Regions.Add(region1);\n\n            Assert.Equal(NotifyCollectionChangedAction.Add, args.Action);\n            Assert.Equal(new object[] { region1 }, args.NewItems);\n            Assert.Equal(0, args.NewStartingIndex);\n            Assert.Null(args.OldItems);\n            Assert.Equal(-1, args.OldStartingIndex);\n\n            regionManager.Regions.Add(region2);\n\n            Assert.Equal(NotifyCollectionChangedAction.Add, args.Action);\n            Assert.Equal(new object[] { region2 }, args.NewItems);\n            Assert.Equal(0, args.NewStartingIndex);\n            Assert.Null(args.OldItems);\n            Assert.Equal(-1, args.OldStartingIndex);\n        }\n\n        [Fact]\n        public void WhenRemovingRegions_ThenRegionsCollectionNotifiesUpdate()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            var regionManager = new RegionManager();\n\n            var region1 = new Region { Name = \"region1\" };\n            var region2 = new Region { Name = \"region2\" };\n\n            regionManager.Regions.Add(region1);\n            regionManager.Regions.Add(region2);\n\n            NotifyCollectionChangedEventArgs args = null;\n            regionManager.Regions.CollectionChanged += (s, e) => args = e;\n\n            regionManager.Regions.Remove(\"region2\");\n\n            Assert.Equal(NotifyCollectionChangedAction.Remove, args.Action);\n            Assert.Equal(new object[] { region2 }, args.OldItems);\n            Assert.Equal(0, args.OldStartingIndex);\n            Assert.Null(args.NewItems);\n            Assert.Equal(-1, args.NewStartingIndex);\n\n            regionManager.Regions.Remove(\"region1\");\n\n            Assert.Equal(NotifyCollectionChangedAction.Remove, args.Action);\n            Assert.Equal(new object[] { region1 }, args.OldItems);\n            Assert.Equal(0, args.OldStartingIndex);\n            Assert.Null(args.NewItems);\n            Assert.Equal(-1, args.NewStartingIndex);\n        }\n\n        [Fact]\n        public void WhenRemovingNonExistingRegion_ThenRegionsCollectionDoesNotNotifyUpdate()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            var regionManager = new RegionManager();\n\n            var region1 = new Region { Name = \"region1\" };\n\n            regionManager.Regions.Add(region1);\n\n            NotifyCollectionChangedEventArgs args = null;\n            regionManager.Regions.CollectionChanged += (s, e) => args = e;\n\n            regionManager.Regions.Remove(\"region2\");\n\n            Assert.Null(args);\n        }\n\n        [Fact]\n        public void CanAddViewToRegion()\n        {\n            var regionManager = new RegionManager();\n            var view1 = new object();\n            var view2 = new object();\n\n            IRegion region = new MockRegion\n            {\n                Name = \"RegionName\"\n            };\n\n            regionManager.Regions.Add(region);\n\n            regionManager.AddToRegion(\"RegionName\", view1);\n            regionManager.AddToRegion(\"RegionName\", view2);\n\n            Assert.True(regionManager.Regions[\"RegionName\"].Views.Contains(view1));\n            Assert.True(regionManager.Regions[\"RegionName\"].Views.Contains(view2));\n        }\n\n        [Fact(DisplayName = \"Flaky test. Run by itself not as a group.\")]\n        public void CanRegisterViewType()\n        {\n            try\n            {\n                var mockRegionContentRegistry = new MockRegionContentRegistry();\n\n                string regionName = null;\n                Type viewType = null;\n\n                mockRegionContentRegistry.RegisterContentWithViewType = (name, type) =>\n                {\n                    regionName = name;\n                    viewType = type;\n                    return null;\n                };\n\n                var containerMock = new Mock<IContainerExtension>();\n                containerMock.Setup(c => c.Resolve(typeof(IRegionViewRegistry))).Returns(mockRegionContentRegistry);\n                ContainerLocator.SetContainerExtension(containerMock.Object);\n\n                var regionManager = new RegionManager();\n\n                regionManager.RegisterViewWithRegion(\"Region1\", typeof(object));\n\n                Assert.Equal(\"Region1\", regionName);\n                Assert.Equal(typeof(object), viewType);\n            }\n            finally\n            {\n                ContainerLocator.ResetContainer();\n            }\n        }\n\n        [Fact]\n        public void CanRegisterViewTypeGeneric()\n        {\n            try\n            {\n                var mockRegionContentRegistry = new MockRegionContentRegistry();\n\n                string regionName = null;\n                Type viewType = null;\n\n                mockRegionContentRegistry.RegisterContentWithViewType = (name, type) =>\n                {\n                    regionName = name;\n                    viewType = type;\n                    return null;\n                };\n\n                var containerMock = new Mock<IContainerExtension>();\n                containerMock.Setup(c => c.Resolve(typeof(IRegionViewRegistry))).Returns(mockRegionContentRegistry);\n                ContainerLocator.ResetContainer();\n                ContainerLocator.SetContainerExtension(containerMock.Object);\n\n                var regionManager = new RegionManager();\n\n                regionManager.RegisterViewWithRegion<object>(\"Region1\");\n\n                Assert.Equal(\"Region1\", regionName);\n                Assert.Equal(typeof(object), viewType);\n            }\n            finally\n            {\n                ContainerLocator.ResetContainer();\n            }\n        }\n\n        [Fact]\n        public void CanRegisterDelegate()\n        {\n            try\n            {\n                ContainerLocator.ResetContainer();\n                var mockRegionContentRegistry = new MockRegionContentRegistry();\n\n                string regionName = null;\n                Func<IContainerProvider, object> contentDelegate = null;\n                Func<IContainerProvider, object> expectedDelegate = _ => true;\n\n                mockRegionContentRegistry.RegisterContentWithDelegate = (name, usedDelegate) =>\n                {\n                    regionName = name;\n                    contentDelegate = usedDelegate;\n                    return null;\n                };\n\n                var containerMock = new Mock<IContainerExtension>();\n                containerMock.Setup(c => c.Resolve(typeof(IRegionViewRegistry))).Returns(mockRegionContentRegistry);\n                ContainerLocator.SetContainerExtension(containerMock.Object);\n\n                var regionManager = new RegionManager();\n\n                regionManager.RegisterViewWithRegion(\"Region1\", expectedDelegate);\n\n                Assert.Equal(\"Region1\", regionName);\n                Assert.Equal(expectedDelegate, contentDelegate);\n            }\n            finally\n            {\n                ContainerLocator.ResetContainer();\n            }\n        }\n\n        [Fact]\n        public void CanAddRegionToRegionManager()\n        {\n            var regionManager = new RegionManager();\n            var region = new MockRegion();\n\n            regionManager.Regions.Add(\"region\", region);\n\n            Assert.Single(regionManager.Regions);\n            Assert.Equal(\"region\", region.Name);\n        }\n\n        [Fact]\n        public void ShouldThrowIfRegionNameArgumentIsDifferentToRegionNameProperty()\n        {\n            var ex = Assert.Throws<ArgumentException>(() =>\n            {\n                var regionManager = new RegionManager();\n                var region = new MockRegion\n                {\n                    Name = \"region\"\n                };\n\n                regionManager.Regions.Add(\"another region\", region);\n            });\n        }\n    }\n\n    internal class FrameworkException : Exception\n    {\n        public FrameworkException(Exception inner)\n            : base(string.Empty, inner)\n        {\n        }\n    }\n\n    internal class MockRegionContentRegistry : IRegionViewRegistry\n    {\n        public Func<string, Type, object> RegisterContentWithViewType;\n        public Func<string, Func<IContainerProvider, object>, object> RegisterContentWithDelegate;\n        public event EventHandler<ViewRegisteredEventArgs> ContentRegistered;\n        public IEnumerable<object> GetContents(string regionName, IContainerProvider container)\n        {\n            return null;\n        }\n\n        public void RegisterViewWithRegion(string regionName, string targetName)\n        {\n            throw new NotImplementedException();\n        }\n\n        void IRegionViewRegistry.RegisterViewWithRegion(string regionName, Type viewType)\n        {\n            RegisterContentWithViewType?.Invoke(regionName, viewType);\n        }\n\n        void IRegionViewRegistry.RegisterViewWithRegion(string regionName, Func<IContainerProvider, object> getContentDelegate)\n        {\n            RegisterContentWithDelegate?.Invoke(regionName, getContentDelegate);\n\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Regions/RegionManagerRequestNavigateFixture.cs",
    "content": "using System;\nusing Moq;\nusing Prism.Navigation;\nusing Prism.Navigation.Regions;\nusing Xunit;\n\nnamespace Prism.Avalonia.Tests.Regions\n{\n    public class RegionManagerRequestNavigateFixture\n    {\n        const string region = \"Region\";\n        const string nonExistentRegion = \"NonExistentRegion\";\n        const string source = \"Source\";\n\n        private static Uri sourceUri = new Uri(source, UriKind.RelativeOrAbsolute);\n        private static NavigationParameters parameters = new NavigationParameters();\n        private static Action<NavigationResult> callback = (_) => { };\n\n        private static Mock<IRegion> mockRegion;\n        private static RegionManager regionManager;\n\n        public RegionManagerRequestNavigateFixture()\n        {\n            mockRegion = new Mock<IRegion>();\n            mockRegion.SetupGet((r) => r.Name).Returns(region);\n\n            regionManager = new RegionManager();\n            regionManager.Regions.Add(mockRegion.Object);\n        }\n\n        [Fact]\n        public void ThrowsWhenNavigationCallbackIsNull()\n        {\n            ExceptionAssert.Throws<ArgumentNullException>(() =>\n                regionManager.RequestNavigate(region, source, null, parameters)\n            );\n\n            ExceptionAssert.Throws<ArgumentNullException>(() =>\n                regionManager.RequestNavigate(region, source, navigationCallback: null)\n            );\n\n            ExceptionAssert.Throws<ArgumentNullException>(() =>\n                regionManager.RequestNavigate(region, sourceUri, null, parameters)\n            );\n\n            ExceptionAssert.Throws<ArgumentNullException>(() =>\n                regionManager.RequestNavigate(region, sourceUri, navigationCallback: null)\n            );\n        }\n\n        [Fact]\n        public void WhenNonExistentRegion_ReturnNavigationResultFalse()\n        {\n            NavigationResult result;\n\n            result = null;\n            regionManager.RequestNavigate(nonExistentRegion, source, (r) => result = r, parameters);\n            Assert.False(result.Success);\n\n            result = null;\n            regionManager.RequestNavigate(nonExistentRegion, source, (r) => result = r);\n            Assert.False(result.Success);\n\n            result = null;\n            regionManager.RequestNavigate(nonExistentRegion, sourceUri, (r) => result = r, parameters);\n            Assert.False(result.Success);\n\n            result = null;\n            regionManager.RequestNavigate(nonExistentRegion, sourceUri, (r) => result = r);\n            Assert.False(result.Success);\n        }\n\n        [Fact]\n        public void DelegatesCallToRegion_RegionSource()\n        {\n            regionManager.RequestNavigate(region, source);\n            mockRegion.Verify((r) => r.RequestNavigate(sourceUri, It.IsAny<Action<NavigationResult>>(), It.IsAny<INavigationParameters>()));\n        }\n\n        [Fact]\n        public void DelegatesCallToRegion_RegionTarget()\n        {\n            regionManager.RequestNavigate(region, sourceUri);\n            mockRegion.Verify((r) => r.RequestNavigate(sourceUri, It.IsAny<Action<NavigationResult>>(), It.IsAny<INavigationParameters>()));\n        }\n\n        [Fact]\n        public void DelegatesCallToRegion_RegionSourceParameters()\n        {\n            regionManager.RequestNavigate(region, source, parameters);\n            mockRegion.Verify((r) => r.RequestNavigate(sourceUri, It.IsAny<Action<NavigationResult>>(), parameters));\n        }\n\n        [Fact]\n        public void DelegatesCallToRegion_RegionSourceUriParameters()\n        {\n            regionManager.RequestNavigate(region, sourceUri, parameters);\n            mockRegion.Verify((r) => r.RequestNavigate(sourceUri, It.IsAny<Action<NavigationResult>>(), parameters));\n        }\n\n        [Fact]\n        public void DelegatesCallToRegion_RegionSourceCallback()\n        {\n            regionManager.RequestNavigate(region, source, callback);\n            mockRegion.Verify((r) => r.RequestNavigate(sourceUri, callback, It.IsAny<INavigationParameters>()));\n        }\n\n        [Fact]\n        public void DelegatesCallToRegion_RegionTargetCallback()\n        {\n            regionManager.RequestNavigate(region, sourceUri, callback);\n            mockRegion.Verify((r) => r.RequestNavigate(sourceUri, callback, It.IsAny<INavigationParameters>()));\n        }\n\n        [Fact]\n        public void DelegatesCallToRegion_RegionSourceCallbackParameters()\n        {\n            regionManager.RequestNavigate(region, source, callback, parameters);\n            mockRegion.Verify((r) => r.RequestNavigate(sourceUri, callback, parameters));\n        }\n\n        [Fact]\n        public void DelegatesCallToRegion_RegionSourceUriCallbackParameters()\n        {\n            regionManager.RequestNavigate(region, sourceUri, callback, parameters);\n            mockRegion.Verify((r) => r.RequestNavigate(sourceUri, callback, parameters));\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Regions/RegionNavigationJournalFixture.cs",
    "content": "using System;\nusing Moq;\nusing Prism.Navigation;\nusing Prism.Navigation.Regions;\nusing Xunit;\n\nnamespace Prism.Avalonia.Tests.Regions\n{\n    public class RegionNavigationJournalFixture\n    {\n        [Fact]\n        public void ConstructingJournalInitializesValues()\n        {\n            // Act\n            RegionNavigationJournal target = new RegionNavigationJournal();\n\n            // Verify\n            Assert.False(target.CanGoBack);\n            Assert.False(target.CanGoForward);\n            Assert.Null(target.CurrentEntry);\n            Assert.Null(target.NavigationTarget);\n        }\n\n        [Fact]\n        public void SettingNavigationServiceUpdatesValue()\n        {\n            // Prepare\n            RegionNavigationJournal target = new RegionNavigationJournal();\n\n            Mock<INavigateAsync> mockINavigate = new Mock<INavigateAsync>();\n\n            // Act\n            target.NavigationTarget = mockINavigate.Object;\n\n            // Verify\n            Assert.Same(mockINavigate.Object, target.NavigationTarget);\n        }\n\n        [Fact]\n        public void RecordingNavigationUpdatesNavigationState()\n        {\n            // Prepare\n            RegionNavigationJournal target = new RegionNavigationJournal();\n\n            Uri uri = new Uri(\"Uri\", UriKind.Relative);\n            RegionNavigationJournalEntry entry = new RegionNavigationJournalEntry() { Uri = uri };\n\n            // Act\n            target.RecordNavigation(entry, true);\n\n            // Verify\n            Assert.False(target.CanGoBack);\n            Assert.False(target.CanGoForward);\n            Assert.Same(entry, target.CurrentEntry);\n        }\n\n        [Fact]\n        public void RecordingNavigationMultipleTimesUpdatesNavigationState()\n        {\n            // Prepare\n            RegionNavigationJournal target = new RegionNavigationJournal();\n\n            Uri uri1 = new Uri(\"Uri1\", UriKind.Relative);\n            RegionNavigationJournalEntry entry1 = new RegionNavigationJournalEntry() { Uri = uri1 };\n\n            Uri uri2 = new Uri(\"Uri2\", UriKind.Relative);\n            RegionNavigationJournalEntry entry2 = new RegionNavigationJournalEntry() { Uri = uri2 };\n\n            Uri uri3 = new Uri(\"Uri3\", UriKind.Relative);\n            RegionNavigationJournalEntry entry3 = new RegionNavigationJournalEntry() { Uri = uri3 };\n\n            // Act\n            target.RecordNavigation(entry1, true);\n            target.RecordNavigation(entry2, true);\n            target.RecordNavigation(entry3, true);\n\n            // Verify\n            Assert.True(target.CanGoBack);\n            Assert.False(target.CanGoForward);\n            Assert.Same(entry3, target.CurrentEntry);\n        }\n\n        [Fact]\n        public void ClearUpdatesNavigationState()\n        {\n            // Prepare\n            RegionNavigationJournal target = new RegionNavigationJournal();\n\n            Uri uri1 = new Uri(\"Uri1\", UriKind.Relative);\n            RegionNavigationJournalEntry entry1 = new RegionNavigationJournalEntry() { Uri = uri1 };\n\n            Uri uri2 = new Uri(\"Uri2\", UriKind.Relative);\n            RegionNavigationJournalEntry entry2 = new RegionNavigationJournalEntry() { Uri = uri2 };\n\n            Uri uri3 = new Uri(\"Uri3\", UriKind.Relative);\n            RegionNavigationJournalEntry entry3 = new RegionNavigationJournalEntry() { Uri = uri3 };\n\n            target.RecordNavigation(entry1, true);\n            target.RecordNavigation(entry2, true);\n            target.RecordNavigation(entry3, true);\n\n            // Act\n            target.Clear();\n\n            // Verify\n            Assert.False(target.CanGoBack);\n            Assert.False(target.CanGoForward);\n            Assert.Null(target.CurrentEntry);\n        }\n\n        [Fact]\n        public void GoBackNavigatesBack()\n        {\n            // Prepare\n            RegionNavigationJournal target = new RegionNavigationJournal();\n\n            Mock<INavigateAsync> mockNavigationTarget = new Mock<INavigateAsync>();\n            target.NavigationTarget = mockNavigationTarget.Object;\n\n            Uri uri1 = new Uri(\"Uri1\", UriKind.Relative);\n            RegionNavigationJournalEntry entry1 = new RegionNavigationJournalEntry() { Uri = uri1 };\n\n            Uri uri2 = new Uri(\"Uri2\", UriKind.Relative);\n            RegionNavigationJournalEntry entry2 = new RegionNavigationJournalEntry() { Uri = uri2 };\n\n            Uri uri3 = new Uri(\"Uri3\", UriKind.Relative);\n            RegionNavigationJournalEntry entry3 = new RegionNavigationJournalEntry() { Uri = uri3 };\n\n            target.RecordNavigation(entry1, true);\n            target.RecordNavigation(entry2, true);\n            target.RecordNavigation(entry3, true);\n\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri1, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri2, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri3, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n\n            // Act\n            target.GoBack();\n\n            // Verify\n            Assert.True(target.CanGoBack);\n            Assert.True(target.CanGoForward);\n            Assert.Same(entry2, target.CurrentEntry);\n\n            mockNavigationTarget.Verify(x => x.RequestNavigate(uri1, It.IsAny<Action<NavigationResult>>(), null), Times.Never());\n            mockNavigationTarget.Verify(x => x.RequestNavigate(uri2, It.IsAny<Action<NavigationResult>>(), null), Times.Once());\n            mockNavigationTarget.Verify(x => x.RequestNavigate(uri3, It.IsAny<Action<NavigationResult>>(), null), Times.Never());\n        }\n\n        [Fact]\n        public void GoBackDoesNotChangeStateWhenNavigationFails()\n        {\n            // Prepare\n            RegionNavigationJournal target = new RegionNavigationJournal();\n\n            Mock<INavigateAsync> mockNavigationTarget = new Mock<INavigateAsync>();\n            target.NavigationTarget = mockNavigationTarget.Object;\n\n            Uri uri1 = new Uri(\"Uri1\", UriKind.Relative);\n            RegionNavigationJournalEntry entry1 = new RegionNavigationJournalEntry() { Uri = uri1 };\n\n            Uri uri2 = new Uri(\"Uri2\", UriKind.Relative);\n            RegionNavigationJournalEntry entry2 = new RegionNavigationJournalEntry() { Uri = uri2 };\n\n            Uri uri3 = new Uri(\"Uri3\", UriKind.Relative);\n            RegionNavigationJournalEntry entry3 = new RegionNavigationJournalEntry() { Uri = uri3 };\n\n            target.RecordNavigation(entry1, true);\n            target.RecordNavigation(entry2, true);\n            target.RecordNavigation(entry3, true);\n\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri1, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri2, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, false)));\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri3, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n\n            // Act\n            target.GoBack();\n\n            // Verify\n            Assert.True(target.CanGoBack);\n            Assert.False(target.CanGoForward);\n            Assert.Same(entry3, target.CurrentEntry);\n\n            mockNavigationTarget.Verify(x => x.RequestNavigate(uri1, It.IsAny<Action<NavigationResult>>(), null), Times.Never());\n            mockNavigationTarget.Verify(x => x.RequestNavigate(uri2, It.IsAny<Action<NavigationResult>>(), null), Times.Once());\n            mockNavigationTarget.Verify(x => x.RequestNavigate(uri3, It.IsAny<Action<NavigationResult>>(), null), Times.Never());\n        }\n\n        [Fact]\n        public void GoBackMultipleTimesNavigatesBack()\n        {\n            // Prepare\n            RegionNavigationJournal target = new RegionNavigationJournal();\n\n            Mock<INavigateAsync> mockNavigationTarget = new Mock<INavigateAsync>();\n            target.NavigationTarget = mockNavigationTarget.Object;\n\n            Uri uri1 = new Uri(\"Uri1\", UriKind.Relative);\n            RegionNavigationJournalEntry entry1 = new RegionNavigationJournalEntry() { Uri = uri1 };\n\n            Uri uri2 = new Uri(\"Uri2\", UriKind.Relative);\n            RegionNavigationJournalEntry entry2 = new RegionNavigationJournalEntry() { Uri = uri2 };\n\n            Uri uri3 = new Uri(\"Uri3\", UriKind.Relative);\n            RegionNavigationJournalEntry entry3 = new RegionNavigationJournalEntry() { Uri = uri3 };\n\n            target.RecordNavigation(entry1, true);\n            target.RecordNavigation(entry2, true);\n            target.RecordNavigation(entry3, true);\n\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri1, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri2, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri3, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n\n            // Act\n            target.GoBack();\n            target.GoBack();\n\n            // Verify\n            Assert.False(target.CanGoBack);\n            Assert.True(target.CanGoForward);\n            Assert.Same(entry1, target.CurrentEntry);\n\n            mockNavigationTarget.Verify(x => x.RequestNavigate(uri1, It.IsAny<Action<NavigationResult>>(), null), Times.Once());\n            mockNavigationTarget.Verify(x => x.RequestNavigate(uri2, It.IsAny<Action<NavigationResult>>(), null), Times.Once());\n            mockNavigationTarget.Verify(x => x.RequestNavigate(uri3, It.IsAny<Action<NavigationResult>>(), null), Times.Never());\n        }\n\n        [Fact]\n        public void GoForwardNavigatesForward()\n        {\n            // Prepare\n            RegionNavigationJournal target = new RegionNavigationJournal();\n\n            Mock<INavigateAsync> mockNavigationTarget = new Mock<INavigateAsync>();\n            target.NavigationTarget = mockNavigationTarget.Object;\n\n            Uri uri1 = new Uri(\"Uri1\", UriKind.Relative);\n            RegionNavigationJournalEntry entry1 = new RegionNavigationJournalEntry() { Uri = uri1 };\n\n            Uri uri2 = new Uri(\"Uri2\", UriKind.Relative);\n            RegionNavigationJournalEntry entry2 = new RegionNavigationJournalEntry() { Uri = uri2 };\n\n            Uri uri3 = new Uri(\"Uri3\", UriKind.Relative);\n            RegionNavigationJournalEntry entry3 = new RegionNavigationJournalEntry() { Uri = uri3 };\n\n            target.RecordNavigation(entry1, true);\n            target.RecordNavigation(entry2, true);\n            target.RecordNavigation(entry3, true);\n\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri1, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri2, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri3, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n\n            target.GoBack();\n            target.GoBack();\n\n            // Act\n            target.GoForward();\n\n            // Verify\n            Assert.True(target.CanGoBack);\n            Assert.True(target.CanGoForward);\n            Assert.Same(entry2, target.CurrentEntry);\n\n            mockNavigationTarget.Verify(x => x.RequestNavigate(uri1, It.IsAny<Action<NavigationResult>>(), null), Times.Once());\n            mockNavigationTarget.Verify(x => x.RequestNavigate(uri2, It.IsAny<Action<NavigationResult>>(), null), Times.Exactly(2));\n            mockNavigationTarget.Verify(x => x.RequestNavigate(uri3, It.IsAny<Action<NavigationResult>>(), null), Times.Never());\n        }\n\n        [Fact]\n        public void GoForwardDoesNotChangeStateWhenNavigationFails()\n        {\n            // Prepare\n            RegionNavigationJournal target = new RegionNavigationJournal();\n\n            Mock<INavigateAsync> mockNavigationTarget = new Mock<INavigateAsync>();\n            target.NavigationTarget = mockNavigationTarget.Object;\n\n            Uri uri1 = new Uri(\"Uri1\", UriKind.Relative);\n            RegionNavigationJournalEntry entry1 = new RegionNavigationJournalEntry() { Uri = uri1 };\n\n            Uri uri2 = new Uri(\"Uri2\", UriKind.Relative);\n            RegionNavigationJournalEntry entry2 = new RegionNavigationJournalEntry() { Uri = uri2 };\n\n            Uri uri3 = new Uri(\"Uri3\", UriKind.Relative);\n            RegionNavigationJournalEntry entry3 = new RegionNavigationJournalEntry() { Uri = uri3 };\n\n            target.RecordNavigation(entry1, true);\n            target.RecordNavigation(entry2, true);\n            target.RecordNavigation(entry3, true);\n\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri1, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri2, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri3, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, false)));\n\n            target.GoBack();\n\n            // Act\n            target.GoForward();\n\n            // Verify\n            Assert.True(target.CanGoBack);\n            Assert.True(target.CanGoForward);\n            Assert.Same(entry2, target.CurrentEntry);\n\n            mockNavigationTarget.Verify(x => x.RequestNavigate(uri1, It.IsAny<Action<NavigationResult>>(), null), Times.Never());\n            mockNavigationTarget.Verify(x => x.RequestNavigate(uri2, It.IsAny<Action<NavigationResult>>(), null), Times.Once());\n            mockNavigationTarget.Verify(x => x.RequestNavigate(uri3, It.IsAny<Action<NavigationResult>>(), null), Times.Once());\n        }\n\n        [Fact]\n        public void GoForwardMultipleTimesNavigatesForward()\n        {\n            // Prepare\n            RegionNavigationJournal target = new RegionNavigationJournal();\n\n            Mock<INavigateAsync> mockNavigationTarget = new Mock<INavigateAsync>();\n            target.NavigationTarget = mockNavigationTarget.Object;\n\n            Uri uri1 = new Uri(\"Uri1\", UriKind.Relative);\n            RegionNavigationJournalEntry entry1 = new RegionNavigationJournalEntry() { Uri = uri1 };\n\n            Uri uri2 = new Uri(\"Uri2\", UriKind.Relative);\n            RegionNavigationJournalEntry entry2 = new RegionNavigationJournalEntry() { Uri = uri2 };\n\n            Uri uri3 = new Uri(\"Uri3\", UriKind.Relative);\n            RegionNavigationJournalEntry entry3 = new RegionNavigationJournalEntry() { Uri = uri3 };\n\n            target.RecordNavigation(entry1, true);\n            target.RecordNavigation(entry2, true);\n            target.RecordNavigation(entry3, true);\n\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri1, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri2, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri3, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n\n            target.GoBack();\n            target.GoBack();\n\n            // Act\n            target.GoForward();\n            target.GoForward();\n\n            // Verify\n            Assert.True(target.CanGoBack);\n            Assert.False(target.CanGoForward);\n            Assert.Same(entry3, target.CurrentEntry);\n\n            mockNavigationTarget.Verify(x => x.RequestNavigate(uri1, It.IsAny<Action<NavigationResult>>(), null), Times.Once());\n            mockNavigationTarget.Verify(x => x.RequestNavigate(uri2, It.IsAny<Action<NavigationResult>>(), null), Times.Exactly(2));\n            mockNavigationTarget.Verify(x => x.RequestNavigate(uri3, It.IsAny<Action<NavigationResult>>(), null), Times.Once());\n        }\n\n        [Fact]\n        public void WhenNavigationToNewUri_ThenCanNoLongerNavigateForward()\n        {\n            // Prepare\n            RegionNavigationJournal target = new RegionNavigationJournal();\n\n            Mock<INavigateAsync> mockNavigationTarget = new Mock<INavigateAsync>();\n            target.NavigationTarget = mockNavigationTarget.Object;\n\n            Uri uri1 = new Uri(\"Uri1\", UriKind.Relative);\n            RegionNavigationJournalEntry entry1 = new RegionNavigationJournalEntry() { Uri = uri1 };\n\n            Uri uri2 = new Uri(\"Uri2\", UriKind.Relative);\n            RegionNavigationJournalEntry entry2 = new RegionNavigationJournalEntry() { Uri = uri2 };\n\n            Uri uri3 = new Uri(\"Uri3\", UriKind.Relative);\n            RegionNavigationJournalEntry entry3 = new RegionNavigationJournalEntry() { Uri = uri3 };\n\n            Uri uri4 = new Uri(\"Uri4\", UriKind.Relative);\n            RegionNavigationJournalEntry entry4 = new RegionNavigationJournalEntry() { Uri = uri4 };\n\n            target.RecordNavigation(entry1, true);\n            target.RecordNavigation(entry2, true);\n\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri1, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri2, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri3, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n\n            target.GoBack();\n\n            Assert.True(target.CanGoForward);\n\n            // Act\n            target.RecordNavigation(entry3, true);\n\n            // Verify\n            Assert.False(target.CanGoForward);\n            Assert.Equal(entry3, target.CurrentEntry);\n        }\n\n        [Fact]\n        public void WhenSavePreviousFalseDoNotRecordEntry()\n        {\n            // Prepare\n            RegionNavigationJournal target = new RegionNavigationJournal();\n\n            Mock<INavigateAsync> mockNavigationTarget = new Mock<INavigateAsync>();\n            target.NavigationTarget = mockNavigationTarget.Object;\n\n            Uri uri1 = new Uri(\"Uri1\", UriKind.Relative);\n            RegionNavigationJournalEntry entry1 = new RegionNavigationJournalEntry() { Uri = uri1 };\n\n            Uri uri2 = new Uri(\"Uri2\", UriKind.Relative);\n            RegionNavigationJournalEntry entry2 = new RegionNavigationJournalEntry() { Uri = uri2 };\n\n            Uri uri3 = new Uri(\"Uri3\", UriKind.Relative);\n            RegionNavigationJournalEntry entry3 = new RegionNavigationJournalEntry() { Uri = uri3 };\n\n            Uri uri4 = new Uri(\"Uri4\", UriKind.Relative);\n            RegionNavigationJournalEntry entry4 = new RegionNavigationJournalEntry() { Uri = uri4 };\n\n            target.RecordNavigation(entry1, true);\n            target.RecordNavigation(entry2, true);\n            target.RecordNavigation(entry3, false);\n            target.RecordNavigation(entry4, true);\n\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri1, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri2, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri3, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri4, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n\n            Assert.Equal(entry4, target.CurrentEntry);\n\n            target.GoBack();\n\n            Assert.True(target.CanGoBack);\n            Assert.True(target.CanGoForward);\n            Assert.Same(entry2, target.CurrentEntry);\n\n            mockNavigationTarget.Verify(x => x.RequestNavigate(uri1, It.IsAny<Action<NavigationResult>>(), null), Times.Never());\n            mockNavigationTarget.Verify(x => x.RequestNavigate(uri2, It.IsAny<Action<NavigationResult>>(), null), Times.Once());\n            mockNavigationTarget.Verify(x => x.RequestNavigate(uri3, It.IsAny<Action<NavigationResult>>(), null), Times.Never());\n            mockNavigationTarget.Verify(x => x.RequestNavigate(uri4, It.IsAny<Action<NavigationResult>>(), null), Times.Never());\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Regions/RegionNavigationServiceFixture.new.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Avalonia.Controls;\nusing Moq;\nusing Prism.Ioc;\nusing Prism.Navigation;\nusing Prism.Navigation.Regions;\nusing Xunit;\nnamespace Prism.Avalonia.Tests.Regions\n{\n    public class RegionNavigationServiceFixture\n    {\n        [Fact]\n        public void WhenNavigating_ViewIsActivated()\n        {\n            // Prepare\n            object view = new object();\n            Uri viewUri = new Uri(view.GetType().Name, UriKind.Relative);\n\n            IRegion region = new Region();\n            region.Add(view);\n\n            string regionName = \"RegionName\";\n            RegionManager regionManager = new RegionManager();\n            regionManager.Regions.Add(regionName, region);\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(new RegionNavigationJournalEntry());\n\n            var container = containerMock.Object;\n            RegionNavigationContentLoader contentLoader = new RegionNavigationContentLoader(container);\n            IRegionNavigationJournal journal = new Mock<IRegionNavigationJournal>().Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            // Act\n            bool isNavigationSuccessful = false;\n            target.RequestNavigate(viewUri, nr => isNavigationSuccessful = nr.Success == true);\n\n            // Verify\n            Assert.True(isNavigationSuccessful);\n            bool isViewActive = region.ActiveViews.Contains(view);\n            Assert.True(isViewActive);\n        }\n\n        [Fact]\n        public void WhenNavigatingWithQueryString_ViewIsActivated()\n        {\n            // Prepare\n            object view = new object();\n            Uri viewUri = new Uri(view.GetType().Name + \"?MyQuery=true\", UriKind.Relative);\n\n            IRegion region = new Region();\n            region.Add(view);\n\n            string regionName = \"RegionName\";\n            RegionManager regionManager = new RegionManager();\n            regionManager.Regions.Add(regionName, region);\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(new RegionNavigationJournalEntry());\n\n            IContainerExtension container = containerMock.Object;\n            RegionNavigationContentLoader contentLoader = new RegionNavigationContentLoader(container);\n            IRegionNavigationJournal journal = new Mock<IRegionNavigationJournal>().Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            // Act\n            bool isNavigationSuccessful = false;\n            target.RequestNavigate(viewUri, nr => isNavigationSuccessful = nr.Success == true);\n\n            // Verify\n            Assert.True(isNavigationSuccessful);\n            bool isViewActive = region.ActiveViews.Contains(view);\n            Assert.True(isViewActive);\n        }\n\n        [Fact]\n        public void WhenNavigatingAndViewCannotBeAcquired_ThenNavigationResultHasError()\n        {\n            // Prepare\n            object view = new object();\n            Uri viewUri = new Uri(view.GetType().Name, UriKind.Relative);\n\n            IRegion region = new Region();\n            region.Add(view);\n\n            string otherType = \"OtherType\";\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(new RegionNavigationJournalEntry());\n            IContainerExtension container = containerMock.Object;\n\n            Mock<IRegionNavigationContentLoader> targetHandlerMock = new Mock<IRegionNavigationContentLoader>();\n            targetHandlerMock.Setup(th => th.LoadContent(It.IsAny<IRegion>(), It.IsAny<NavigationContext>())).Throws<ArgumentException>();\n\n            IRegionNavigationJournal journal = new Mock<IRegionNavigationJournal>().Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, targetHandlerMock.Object, journal)\n            {\n                Region = region\n            };\n\n            // Act\n            Exception error = null;\n            target.RequestNavigate(\n                new Uri(otherType.GetType().Name, UriKind.Relative),\n                nr =>\n                {\n                    error = nr.Exception;\n                });\n\n            // Verify\n            bool isViewActive = region.ActiveViews.Contains(view);\n            Assert.False(isViewActive);\n            Assert.IsType<ArgumentException>(error);\n        }\n\n        [Fact]\n        public void WhenNavigatingWithNullUri_Throws()\n        {\n            // Prepare\n            IRegion region = new Region();\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(new RegionNavigationJournalEntry());\n\n            IContainerExtension container = containerMock.Object;\n            RegionNavigationContentLoader contentLoader = new Mock<RegionNavigationContentLoader>(container).Object;\n            IRegionNavigationJournal journal = new Mock<IRegionNavigationJournal>().Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            // Act\n            NavigationResult navigationResult = null;\n            target.RequestNavigate((Uri)null, nr => navigationResult = nr);\n\n            // Verify\n            Assert.False(navigationResult.Success);\n            Assert.NotNull(navigationResult.Exception);\n            Assert.IsType<ArgumentNullException>(navigationResult.Exception);\n        }\n\n        [Fact]\n        public void WhenNavigatingAndViewImplementsINavigationAware_ThenNavigatedIsInvokedOnNavigation()\n        {\n            // Prepare\n            var region = new Region();\n\n            var viewMock = new Mock<INavigationAware>();\n            viewMock.Setup(ina => ina.IsNavigationTarget(It.IsAny<NavigationContext>())).Returns(true);\n            var view = viewMock.Object;\n            region.Add(view);\n\n            var navigationUri = new Uri(view.GetType().Name, UriKind.Relative);\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(new RegionNavigationJournalEntry());\n\n            IContainerExtension container = containerMock.Object;\n            RegionNavigationContentLoader contentLoader = new RegionNavigationContentLoader(container);\n            IRegionNavigationJournal journal = new Mock<IRegionNavigationJournal>().Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            // Act\n            target.RequestNavigate(navigationUri, nr => { });\n\n            // Verify\n            viewMock.Verify(v => v.OnNavigatedTo(It.Is<NavigationContext>(nc => nc.Uri == navigationUri && nc.NavigationService == target)));\n        }\n\n        [StaFact]\n        public void WhenNavigatingAndDataContextImplementsINavigationAware_ThenNavigatedIsInvokesOnNavigation()\n        {\n            // Prepare\n            var region = new Region();\n\n            Mock<Control> mockControl = new Mock<Control>();\n            Mock<INavigationAware> mockINavigationAwareDataContext = new Mock<INavigationAware>();\n            mockINavigationAwareDataContext.Setup(ina => ina.IsNavigationTarget(It.IsAny<NavigationContext>())).Returns(true);\n            mockControl.Object.DataContext = mockINavigationAwareDataContext.Object;\n\n            var view = mockControl.Object;\n            region.Add(view);\n\n            var navigationUri = new Uri(view.GetType().Name, UriKind.Relative);\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(new RegionNavigationJournalEntry());\n\n            IContainerExtension container = containerMock.Object;\n            RegionNavigationContentLoader contentLoader = new RegionNavigationContentLoader(container);\n            IRegionNavigationJournal journal = new Mock<IRegionNavigationJournal>().Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            // Act\n            target.RequestNavigate(navigationUri, nr => { });\n\n            // Verify\n            mockINavigationAwareDataContext.Verify(v => v.OnNavigatedTo(It.Is<NavigationContext>(nc => nc.Uri == navigationUri)));\n        }\n\n        [StaFact(Skip = \"Type to mock (Avalonia.Controls.Control) must be an interface, a delegate, or a non-sealed, non-static class.\")]\n        public void WhenNavigatingAndBothViewAndDataContextImplementINavigationAware_ThenNavigatedIsInvokesOnNavigation()\n        {\n            // Prepare\n            var region = new Region();\n\n            Mock<Control> mockControl = new Mock<Control>();\n            Mock<INavigationAware> mockINavigationAwareView = mockControl.As<INavigationAware>();\n            mockINavigationAwareView.Setup(ina => ina.IsNavigationTarget(It.IsAny<NavigationContext>())).Returns(true);\n\n            Mock<INavigationAware> mockINavigationAwareDataContext = new Mock<INavigationAware>();\n            mockINavigationAwareDataContext.Setup(ina => ina.IsNavigationTarget(It.IsAny<NavigationContext>())).Returns(true);\n            mockControl.Object.DataContext = mockINavigationAwareDataContext.Object;\n\n            var view = mockControl.Object;\n            region.Add(view);\n\n            var navigationUri = new Uri(view.GetType().Name, UriKind.Relative);\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(new RegionNavigationJournalEntry());\n\n            IContainerExtension container = containerMock.Object;\n            RegionNavigationContentLoader contentLoader = new RegionNavigationContentLoader(container);\n            IRegionNavigationJournal journal = new Mock<IRegionNavigationJournal>().Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            // Act\n            target.RequestNavigate(navigationUri, nr => { });\n\n            // Verify\n            mockINavigationAwareView.Verify(v => v.OnNavigatedTo(It.Is<NavigationContext>(nc => nc.Uri == navigationUri)));\n            mockINavigationAwareDataContext.Verify(v => v.OnNavigatedTo(It.Is<NavigationContext>(nc => nc.Uri == navigationUri)));\n        }\n\n        [Fact]\n        public void WhenNavigating_NavigationIsRecordedInJournal()\n        {\n            // Prepare\n            object view = new object();\n            Uri viewUri = new Uri(view.GetType().Name, UriKind.Relative);\n\n            IRegion region = new Region();\n            region.Add(view);\n\n            string regionName = \"RegionName\";\n            RegionManager regionManager = new RegionManager();\n            regionManager.Regions.Add(regionName, region);\n\n            IRegionNavigationJournalEntry journalEntry = new RegionNavigationJournalEntry();\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(journalEntry);\n\n            IContainerExtension container = containerMock.Object;\n            ContainerLocator.SetContainerExtension(container);\n            RegionNavigationContentLoader contentLoader = new RegionNavigationContentLoader(container);\n\n            var journalMock = new Mock<IRegionNavigationJournal>();\n            journalMock.Setup(x => x.RecordNavigation(journalEntry, true)).Verifiable();\n\n            IRegionNavigationJournal journal = journalMock.Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            // Act\n            target.RequestNavigate(viewUri, nr => { });\n\n            // Verify\n            Assert.NotNull(journalEntry);\n            Assert.Equal(viewUri, journalEntry.Uri);\n            journalMock.VerifyAll();\n        }\n\n        [Fact]\n        public void WhenNavigatingAndCurrentlyActiveViewImplementsINavigateWithVeto_ThenNavigationRequestQueriesForVeto()\n        {\n            // Prepare\n            var region = new Region();\n\n            var viewMock = new Mock<IConfirmNavigationRequest>();\n            viewMock\n                .Setup(ina => ina.ConfirmNavigationRequest(It.IsAny<NavigationContext>(), It.IsAny<Action<bool>>()))\n                .Verifiable();\n\n            var view = viewMock.Object;\n            region.Add(view);\n            region.Activate(view);\n\n            var navigationUri = new Uri(view.GetType().Name, UriKind.Relative);\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(new RegionNavigationJournalEntry());\n\n            IContainerExtension container = containerMock.Object;\n            RegionNavigationContentLoader contentLoader = new Mock<RegionNavigationContentLoader>(container).Object;\n            IRegionNavigationJournal journal = new Mock<IRegionNavigationJournal>().Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            // Act\n            target.RequestNavigate(navigationUri, nr => { });\n\n            // Verify\n            viewMock.VerifyAll();\n        }\n\n        [Fact]\n        public void WhenNavigating_ThenNavigationRequestQueriesForVetoOnAllActiveViewsIfAllSucceed()\n        {\n            // Prepare\n            var region = new Region();\n\n            var view1Mock = new Mock<IConfirmNavigationRequest>();\n            view1Mock\n                .Setup(ina => ina.ConfirmNavigationRequest(It.IsAny<NavigationContext>(), It.IsAny<Action<bool>>()))\n                .Callback<NavigationContext, Action<bool>>((nc, c) => c(true))\n                .Verifiable();\n\n            var view1 = view1Mock.Object;\n            region.Add(view1);\n            region.Activate(view1);\n\n            var view2Mock = new Mock<IConfirmNavigationRequest>();\n\n            var view2 = view2Mock.Object;\n            region.Add(view2);\n\n            var view3Mock = new Mock<INavigationAware>();\n\n            var view3 = view3Mock.Object;\n            region.Add(view3);\n            region.Activate(view3);\n\n            var view4Mock = new Mock<IConfirmNavigationRequest>();\n            view4Mock\n                .Setup(ina => ina.ConfirmNavigationRequest(It.IsAny<NavigationContext>(), It.IsAny<Action<bool>>()))\n                .Callback<NavigationContext, Action<bool>>((nc, c) => c(true))\n                .Verifiable();\n\n            var view4 = view4Mock.Object;\n            region.Add(view4);\n            region.Activate(view4);\n\n            var navigationUri = new Uri(view1.GetType().Name, UriKind.Relative);\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(new RegionNavigationJournalEntry());\n\n            IContainerExtension container = containerMock.Object;\n            RegionNavigationContentLoader contentLoader = new Mock<RegionNavigationContentLoader>(container).Object;\n            IRegionNavigationJournal journal = new Mock<IRegionNavigationJournal>().Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            // Act\n            target.RequestNavigate(navigationUri, nr => { });\n\n            // Verify\n            view1Mock.VerifyAll();\n            view2Mock.Verify(ina => ina.ConfirmNavigationRequest(It.IsAny<NavigationContext>(), It.IsAny<Action<bool>>()), Times.Never());\n            view3Mock.VerifyAll();\n            view4Mock.VerifyAll();\n        }\n\n        [Fact]\n        public void WhenRequestNavigateAwayAcceptsThroughCallback_ThenNavigationProceeds()\n        {\n            // Prepare\n            var region = new Region();\n\n            var view1Mock = new Mock<IConfirmNavigationRequest>();\n            view1Mock\n                .Setup(ina => ina.ConfirmNavigationRequest(It.IsAny<NavigationContext>(), It.IsAny<Action<bool>>()))\n                .Callback<NavigationContext, Action<bool>>((nc, c) => c(true))\n                .Verifiable();\n\n            var view1 = view1Mock.Object;\n\n            var view2 = new object();\n\n            region.Add(view1);\n            region.Add(view2);\n\n            region.Activate(view1);\n\n            var navigationUri = new Uri(view2.GetType().Name, UriKind.Relative);\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(new RegionNavigationJournalEntry());\n\n            IContainerExtension container = containerMock.Object;\n            RegionNavigationContentLoader contentLoader = new RegionNavigationContentLoader(container);\n            IRegionNavigationJournal journal = new Mock<IRegionNavigationJournal>().Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            // Act\n            var navigationSucceeded = false;\n            target.RequestNavigate(navigationUri, nr => { navigationSucceeded = nr.Success == true; });\n\n            // Verify\n            view1Mock.VerifyAll();\n            Assert.True(navigationSucceeded);\n            Assert.Equal(new object[] { view1, view2 }, region.ActiveViews.ToArray());\n        }\n\n        [Fact]\n        public void WhenRequestNavigateAwayRejectsThroughCallback_ThenNavigationDoesNotProceed()\n        {\n            // Prepare\n            var region = new Region();\n\n            var view1Mock = new Mock<IConfirmNavigationRequest>();\n            view1Mock\n                .Setup(ina => ina.ConfirmNavigationRequest(It.IsAny<NavigationContext>(), It.IsAny<Action<bool>>()))\n                .Callback<NavigationContext, Action<bool>>((nc, c) => c(false))\n                .Verifiable();\n\n            var view1 = view1Mock.Object;\n\n            var view2 = new object();\n\n            region.Add(view1);\n            region.Add(view2);\n\n            region.Activate(view1);\n\n            var navigationUri = new Uri(view2.GetType().Name, UriKind.Relative);\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(new RegionNavigationJournalEntry());\n\n            IContainerExtension container = containerMock.Object;\n            RegionNavigationContentLoader contentLoader = new Mock<RegionNavigationContentLoader>(container).Object;\n            IRegionNavigationJournal journal = new Mock<IRegionNavigationJournal>().Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            // Act\n            var navigationFailed = false;\n            target.RequestNavigate(navigationUri, nr => { navigationFailed = nr.Success == false; });\n\n            // Verify\n            view1Mock.VerifyAll();\n            Assert.True(navigationFailed);\n            Assert.Equal(new object[] { view1 }, region.ActiveViews.ToArray());\n        }\n\n        [StaFact]\n        public void WhenNavigatingAndDataContextOnCurrentlyActiveViewImplementsINavigateWithVeto_ThenNavigationRequestQueriesForVeto()\n        {\n            // Prepare\n            var region = new Region();\n\n            var viewModelMock = new Mock<IConfirmNavigationRequest>();\n            viewModelMock\n                .Setup(ina => ina.ConfirmNavigationRequest(It.IsAny<NavigationContext>(), It.IsAny<Action<bool>>()))\n                .Verifiable();\n\n            var viewMock = new Mock<Control>();\n\n            var view = viewMock.Object;\n            view.DataContext = viewModelMock.Object;\n\n            region.Add(view);\n            region.Activate(view);\n\n            var navigationUri = new Uri(view.GetType().Name, UriKind.Relative);\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(new RegionNavigationJournalEntry());\n\n            IContainerExtension container = containerMock.Object;\n            RegionNavigationContentLoader contentLoader = new Mock<RegionNavigationContentLoader>(container).Object;\n            IRegionNavigationJournal journal = new Mock<IRegionNavigationJournal>().Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            // Act\n            target.RequestNavigate(navigationUri, nr => { });\n\n            // Verify\n            viewModelMock.VerifyAll();\n        }\n\n        [StaFact]\n        public void WhenRequestNavigateAwayOnDataContextAcceptsThroughCallback_ThenNavigationProceeds()\n        {\n            // Prepare\n            var region = new Region();\n\n            var view1DataContextMock = new Mock<IConfirmNavigationRequest>();\n            view1DataContextMock\n                .Setup(ina => ina.ConfirmNavigationRequest(It.IsAny<NavigationContext>(), It.IsAny<Action<bool>>()))\n                .Callback<NavigationContext, Action<bool>>((nc, c) => c(true))\n                .Verifiable();\n\n            var view1Mock = new Mock<Control>();\n            var view1 = view1Mock.Object;\n            view1.DataContext = view1DataContextMock.Object;\n\n            var view2 = new object();\n\n            region.Add(view1);\n            region.Add(view2);\n\n            region.Activate(view1);\n\n            var navigationUri = new Uri(view2.GetType().Name, UriKind.Relative);\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(new RegionNavigationJournalEntry());\n\n            IContainerExtension container = containerMock.Object;\n            RegionNavigationContentLoader contentLoader = new RegionNavigationContentLoader(container);\n            IRegionNavigationJournal journal = new Mock<IRegionNavigationJournal>().Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            // Act\n            var navigationSucceeded = false;\n            target.RequestNavigate(navigationUri, nr => { navigationSucceeded = nr.Success == true; });\n\n            // Verify\n            view1DataContextMock.VerifyAll();\n            Assert.True(navigationSucceeded);\n            Assert.Equal(new object[] { view1, view2 }, region.ActiveViews.ToArray());\n        }\n\n        [StaFact]\n        public void WhenRequestNavigateAwayOnDataContextRejectsThroughCallback_ThenNavigationDoesNotProceed()\n        {\n            // Prepare\n            var region = new Region();\n\n            var view1DataContextMock = new Mock<IConfirmNavigationRequest>();\n            view1DataContextMock\n                .Setup(ina => ina.ConfirmNavigationRequest(It.IsAny<NavigationContext>(), It.IsAny<Action<bool>>()))\n                .Callback<NavigationContext, Action<bool>>((nc, c) => c(false))\n                .Verifiable();\n\n            var view1Mock = new Mock<Control>();\n            var view1 = view1Mock.Object;\n            view1.DataContext = view1DataContextMock.Object;\n\n            var view2 = new object();\n\n            region.Add(view1);\n            region.Add(view2);\n\n            region.Activate(view1);\n\n            var navigationUri = new Uri(view2.GetType().Name, UriKind.Relative);\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(new RegionNavigationJournalEntry());\n\n            IContainerExtension container = containerMock.Object;\n            RegionNavigationContentLoader contentLoader = new Mock<RegionNavigationContentLoader>(container).Object;\n            IRegionNavigationJournal journal = new Mock<IRegionNavigationJournal>().Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            // Act\n            var navigationFailed = false;\n            target.RequestNavigate(navigationUri, nr => { navigationFailed = nr.Success == false; });\n\n            // Verify\n            view1DataContextMock.VerifyAll();\n            Assert.True(navigationFailed);\n            Assert.Equal(new object[] { view1 }, region.ActiveViews.ToArray());\n        }\n\n        [Fact]\n        public void WhenViewAcceptsNavigationOutAfterNewIncomingRequestIsReceived_ThenOriginalRequestIsIgnored()\n        {\n            var region = new Region();\n\n            var viewMock = new Mock<IConfirmNavigationRequest>();\n            var view = viewMock.Object;\n\n            var confirmationRequests = new List<Action<bool>>();\n\n            viewMock\n                .Setup(icnr => icnr.ConfirmNavigationRequest(It.IsAny<NavigationContext>(), It.IsAny<Action<bool>>()))\n                .Callback<NavigationContext, Action<bool>>((nc, c) => { confirmationRequests.Add(c); });\n\n            region.Add(view);\n            region.Activate(view);\n\n            var navigationUri = new Uri(\"\", UriKind.Relative);\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock\n                .Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry)))\n                .Returns(new RegionNavigationJournalEntry());\n\n            var contentLoaderMock = new Mock<IRegionNavigationContentLoader>();\n            contentLoaderMock\n                .Setup(cl => cl.LoadContent(region, It.IsAny<NavigationContext>()))\n                .Returns(view);\n\n            var container = containerMock.Object;\n            var contentLoader = contentLoaderMock.Object;\n            var journal = new Mock<IRegionNavigationJournal>().Object;\n\n            var target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            bool firstNavigation = false;\n            bool secondNavigation = false;\n            target.RequestNavigate(navigationUri, nr => firstNavigation = nr.Success);\n            target.RequestNavigate(navigationUri, nr => secondNavigation = nr.Success);\n\n            Assert.Equal(2, confirmationRequests.Count);\n\n            confirmationRequests[0](true);\n            confirmationRequests[1](true);\n\n            Assert.False(firstNavigation);\n            Assert.True(secondNavigation);\n        }\n\n        [StaFact]\n        public void WhenViewModelAcceptsNavigationOutAfterNewIncomingRequestIsReceived_ThenOriginalRequestIsIgnored()\n        {\n            var region = new Region();\n\n            var viewModelMock = new Mock<IConfirmNavigationRequest>();\n\n            var viewMock = new Mock<Control>();\n            var view = viewMock.Object;\n            view.DataContext = viewModelMock.Object;\n\n            var confirmationRequests = new List<Action<bool>>();\n\n            viewModelMock\n                .Setup(icnr => icnr.ConfirmNavigationRequest(It.IsAny<NavigationContext>(), It.IsAny<Action<bool>>()))\n                .Callback<NavigationContext, Action<bool>>((nc, c) => { confirmationRequests.Add(c); });\n\n            region.Add(view);\n            region.Activate(view);\n\n            var navigationUri = new Uri(\"\", UriKind.Relative);\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock\n                .Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry)))\n                .Returns(new RegionNavigationJournalEntry());\n\n            var contentLoaderMock = new Mock<IRegionNavigationContentLoader>();\n            contentLoaderMock\n                .Setup(cl => cl.LoadContent(region, It.IsAny<NavigationContext>()))\n                .Returns(view);\n\n            var container = containerMock.Object;\n            var contentLoader = contentLoaderMock.Object;\n            var journal = new Mock<IRegionNavigationJournal>().Object;\n\n            var target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            bool firstNavigation = false;\n            bool secondNavigation = false;\n            target.RequestNavigate(navigationUri, nr => firstNavigation = nr.Success);\n            target.RequestNavigate(navigationUri, nr => secondNavigation = nr.Success);\n\n            Assert.Equal(2, confirmationRequests.Count);\n\n            confirmationRequests[0](true);\n            confirmationRequests[1](true);\n\n            Assert.False(firstNavigation);\n            Assert.True(secondNavigation);\n        }\n\n        [Fact]\n        public void BeforeNavigating_NavigatingEventIsRaised()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            // Prepare\n            object view = new object();\n            Uri viewUri = new Uri(view.GetType().Name, UriKind.Relative);\n\n            IRegion region = new Region();\n            region.Add(view);\n\n            string regionName = \"RegionName\";\n            RegionManager regionManager = new RegionManager();\n            regionManager.Regions.Add(regionName, region);\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(new RegionNavigationJournalEntry());\n\n            IContainerExtension container = containerMock.Object;\n            RegionNavigationContentLoader contentLoader = new RegionNavigationContentLoader(container);\n            IRegionNavigationJournal journal = new Mock<IRegionNavigationJournal>().Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            bool isNavigatingRaised = false;\n            target.Navigating += delegate (object sender, RegionNavigationEventArgs e)\n            {\n                if (sender == target)\n                {\n                    isNavigatingRaised = true;\n                }\n            };\n\n            // Act\n            bool isNavigationSuccessful = false;\n            target.RequestNavigate(viewUri, nr => isNavigationSuccessful = nr.Success == true);\n\n            // Verify\n            Assert.True(isNavigationSuccessful);\n            Assert.True(isNavigatingRaised);\n        }\n\n        [Fact]\n        public void WhenNavigationSucceeds_NavigatedIsRaised()\n        {\n            // Prepare\n            object view = new object();\n            Uri viewUri = new Uri(view.GetType().Name, UriKind.Relative);\n\n            IRegion region = new Region();\n            region.Add(view);\n\n            string regionName = \"RegionName\";\n            RegionManager regionManager = new RegionManager();\n            regionManager.Regions.Add(regionName, region);\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(new RegionNavigationJournalEntry());\n\n            IContainerExtension container = containerMock.Object;\n            RegionNavigationContentLoader contentLoader = new RegionNavigationContentLoader(container);\n            IRegionNavigationJournal journal = new Mock<IRegionNavigationJournal>().Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            bool isNavigatedRaised = false;\n            target.Navigated += delegate (object sender, RegionNavigationEventArgs e)\n            {\n                if (sender == target)\n                {\n                    isNavigatedRaised = true;\n                }\n            };\n\n            // Act\n            bool isNavigationSuccessful = false;\n            target.RequestNavigate(viewUri, nr => isNavigationSuccessful = nr.Success == true);\n\n            // Verify\n            Assert.True(isNavigationSuccessful);\n            Assert.True(isNavigatedRaised);\n        }\n\n        [Fact]\n        public void WhenTargetViewCreationThrowsWithAsyncConfirmation_ThenExceptionIsProvidedToNavigationCallback()\n        {\n            var containerMock = new Mock<IContainerExtension>();\n\n            var targetException = new Exception();\n            var targetHandlerMock = new Mock<IRegionNavigationContentLoader>();\n            targetHandlerMock\n                .Setup(th => th.LoadContent(It.IsAny<IRegion>(), It.IsAny<NavigationContext>()))\n                .Throws(targetException);\n\n            var journalMock = new Mock<IRegionNavigationJournal>();\n\n            Action<bool> navigationCallback = null;\n            var viewMock = new Mock<IConfirmNavigationRequest>();\n            viewMock\n                .Setup(v => v.ConfirmNavigationRequest(It.IsAny<NavigationContext>(), It.IsAny<Action<bool>>()))\n                .Callback<NavigationContext, Action<bool>>((nc, c) => { navigationCallback = c; });\n\n            var region = new Region();\n            region.Add(viewMock.Object);\n            region.Activate(viewMock.Object);\n\n            var target = new RegionNavigationService(containerMock.Object, targetHandlerMock.Object, journalMock.Object)\n            {\n                Region = region\n            };\n\n            NavigationResult result = null;\n            target.RequestNavigate(new Uri(\"\", UriKind.Relative), nr => result = nr);\n            navigationCallback(true);\n\n            Assert.NotNull(result);\n            Assert.Same(targetException, result.Exception);\n        }\n\n        [Fact]\n        public void WhenNavigatingFromViewThatIsNavigationAware_ThenNotifiesActiveViewNavigatingFrom()\n        {\n            // Arrange\n            var region = new Region();\n            var viewMock = new Mock<INavigationAware>();\n            var view = viewMock.Object;\n            region.Add(view);\n\n            var view2 = new object();\n            region.Add(view2);\n\n            region.Activate(view);\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(new RegionNavigationJournalEntry());\n\n            var navigationUri = new Uri(view2.GetType().Name, UriKind.Relative);\n            IContainerExtension container = containerMock.Object;\n            RegionNavigationContentLoader contentLoader = new Mock<RegionNavigationContentLoader>(container).Object;\n            IRegionNavigationJournal journal = new Mock<IRegionNavigationJournal>().Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            // Act\n            target.RequestNavigate(navigationUri, nr => { });\n\n            // Verify\n            viewMock.Verify(v => v.OnNavigatedFrom(It.Is<NavigationContext>(ctx => ctx.Uri == navigationUri && ctx.Parameters.Count() == 0)));\n        }\n\n        [Fact]\n        public void WhenNavigationFromViewThatIsNavigationAware_OnlyNotifiesOnNavigateFromForActiveViews()\n        {\n            // Arrange\n\n            bool navigationFromInvoked = false;\n\n            var region = new Region();\n\n            var viewMock = new Mock<INavigationAware>();\n            viewMock\n                .Setup(x => x.OnNavigatedFrom(It.IsAny<NavigationContext>())).Callback(() => navigationFromInvoked = true);\n            var view = viewMock.Object;\n            region.Add(view);\n\n            var targetViewMock = new Mock<INavigationAware>();\n            region.Add(targetViewMock.Object);\n\n            var activeViewMock = new Mock<INavigationAware>();\n            region.Add(activeViewMock.Object);\n\n            region.Activate(activeViewMock.Object);\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(new RegionNavigationJournalEntry());\n\n            var navigationUri = new Uri(targetViewMock.Object.GetType().Name, UriKind.Relative);\n            IContainerExtension container = containerMock.Object;\n            RegionNavigationContentLoader contentLoader = new Mock<RegionNavigationContentLoader>(container).Object;\n            IRegionNavigationJournal journal = new Mock<IRegionNavigationJournal>().Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            // Act\n            target.RequestNavigate(navigationUri, nr => { });\n\n            // Verify\n            Assert.False(navigationFromInvoked);\n        }\n\n        [StaFact]\n        public void WhenNavigatingFromActiveViewWithNavigatinAwareDataConext_NotifiesContextOfNavigatingFrom()\n        {\n            // Arrange\n            var region = new Region();\n\n            var mockDataContext = new Mock<INavigationAware>();\n\n            var view1Mock = new Mock<Control>();\n            var view1 = view1Mock.Object;\n            view1.DataContext = mockDataContext.Object;\n\n            region.Add(view1);\n\n            var view2 = new object();\n            region.Add(view2);\n\n            region.Activate(view1);\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(new RegionNavigationJournalEntry());\n\n            var navigationUri = new Uri(view2.GetType().Name, UriKind.Relative);\n            IContainerExtension container = containerMock.Object;\n            RegionNavigationContentLoader contentLoader = new Mock<RegionNavigationContentLoader>(container).Object;\n            IRegionNavigationJournal journal = new Mock<IRegionNavigationJournal>().Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            // Act\n            target.RequestNavigate(navigationUri, nr => { });\n\n            // Verify\n            mockDataContext.Verify(v => v.OnNavigatedFrom(It.Is<NavigationContext>(ctx => ctx.Uri == navigationUri && ctx.Parameters.Count() == 0)));\n        }\n\n        [Fact]\n        public void WhenNavigatingWithNullCallback_ThenThrows()\n        {\n            var region = new Region();\n\n            var navigationUri = new Uri(\"/\", UriKind.Relative);\n            IContainerExtension container = new Mock<IContainerExtension>().Object;\n            RegionNavigationContentLoader contentLoader = new Mock<RegionNavigationContentLoader>(container).Object;\n            IRegionNavigationJournal journal = new Mock<IRegionNavigationJournal>().Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            ExceptionAssert.Throws<ArgumentNullException>(\n                () =>\n                {\n                    target.RequestNavigate(navigationUri, null);\n                });\n        }\n\n        [Fact]\n        public void WhenNavigatingWithNoRegionSet_ThenMarshallExceptionToCallback()\n        {\n            var navigationUri = new Uri(\"/\", UriKind.Relative);\n            IContainerExtension container = new Mock<IContainerExtension>().Object;\n            RegionNavigationContentLoader contentLoader = new Mock<RegionNavigationContentLoader>(container).Object;\n            IRegionNavigationJournal journal = new Mock<IRegionNavigationJournal>().Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, contentLoader, journal);\n\n            Exception error = null;\n            target.RequestNavigate(navigationUri, nr => error = nr.Exception);\n\n            Assert.NotNull(error);\n            Assert.IsType<InvalidOperationException>(error);\n        }\n\n        [Fact]\n        public void WhenNavigatingWithNullUri_ThenMarshallExceptionToCallback()\n        {\n            IContainerExtension container = new Mock<IContainerExtension>().Object;\n            RegionNavigationContentLoader contentLoader = new Mock<RegionNavigationContentLoader>(container).Object;\n            IRegionNavigationJournal journal = new Mock<IRegionNavigationJournal>().Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = new Region()\n            };\n\n            Exception error = null;\n            target.RequestNavigate(null, nr => error = nr.Exception);\n\n            Assert.NotNull(error);\n            Assert.IsType<ArgumentNullException>(error);\n        }\n\n        [Fact]\n        public void WhenNavigationFailsBecauseTheContentViewCannotBeRetrieved_ThenNavigationFailedIsRaised()\n        {\n            // Prepare\n            var region = new Region { Name = \"RegionName\" };\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(new RegionNavigationJournalEntry());\n\n            var contentLoaderMock = new Mock<IRegionNavigationContentLoader>();\n            contentLoaderMock\n                .Setup(cl => cl.LoadContent(region, It.IsAny<NavigationContext>()))\n                .Throws<InvalidOperationException>();\n\n            var container = containerMock.Object;\n            var contentLoader = contentLoaderMock.Object;\n            var journal = new Mock<IRegionNavigationJournal>().Object;\n\n            var target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            RegionNavigationFailedEventArgs eventArgs = null;\n            target.NavigationFailed += delegate (object sender, RegionNavigationFailedEventArgs e)\n            {\n                if (sender == target)\n                {\n                    eventArgs = e;\n                }\n            };\n\n            // Act\n            bool? isNavigationSuccessful = null;\n            target.RequestNavigate(new Uri(\"invalid\", UriKind.Relative), nr => isNavigationSuccessful = nr.Success);\n\n            // Verify\n            Assert.False(isNavigationSuccessful.Value);\n            Assert.NotNull(eventArgs);\n            Assert.NotNull(eventArgs.Error);\n        }\n\n        [Fact]\n        public void WhenNavigationFailsBecauseActiveViewRejectsIt_ThenNavigationFailedIsRaised()\n        {\n            // Prepare\n            var region = new Region { Name = \"RegionName\" };\n\n            var view1Mock = new Mock<IConfirmNavigationRequest>();\n            view1Mock\n                .Setup(ina => ina.ConfirmNavigationRequest(It.IsAny<NavigationContext>(), It.IsAny<Action<bool>>()))\n                .Callback<NavigationContext, Action<bool>>((nc, c) => c(false))\n                .Verifiable();\n\n            var view1 = view1Mock.Object;\n\n            var view2 = new object();\n\n            region.Add(view1);\n            region.Add(view2);\n\n            region.Activate(view1);\n\n            var navigationUri = new Uri(view2.GetType().Name, UriKind.Relative);\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(new RegionNavigationJournalEntry());\n\n            var contentLoaderMock = new Mock<IRegionNavigationContentLoader>();\n            contentLoaderMock\n                .Setup(cl => cl.LoadContent(region, It.IsAny<NavigationContext>()))\n                .Returns(view2);\n\n            var container = containerMock.Object;\n            var contentLoader = contentLoaderMock.Object;\n            var journal = new Mock<IRegionNavigationJournal>().Object;\n\n            var target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            RegionNavigationFailedEventArgs eventArgs = null;\n            target.NavigationFailed += delegate (object sender, RegionNavigationFailedEventArgs e)\n            {\n                if (sender == target)\n                {\n                    eventArgs = e;\n                }\n            };\n\n            // Act\n            bool? isNavigationSuccessful = null;\n            target.RequestNavigate(navigationUri, nr => isNavigationSuccessful = nr.Success);\n\n            // Verify\n            view1Mock.VerifyAll();\n            Assert.False(isNavigationSuccessful.Value);\n            Assert.NotNull(eventArgs);\n            Assert.Null(eventArgs.Error);\n        }\n\n        [StaFact]\n        public void WhenNavigationFailsBecauseDataContextForActiveViewRejectsIt_ThenNavigationFailedIsRaised()\n        {\n            // Prepare\n            var region = new Region { Name = \"RegionName\" };\n\n            var viewModel1Mock = new Mock<IConfirmNavigationRequest>();\n            viewModel1Mock\n                .Setup(ina => ina.ConfirmNavigationRequest(It.IsAny<NavigationContext>(), It.IsAny<Action<bool>>()))\n                .Callback<NavigationContext, Action<bool>>((nc, c) => c(false))\n                .Verifiable();\n\n            var view1Mock = new Mock<Control>();\n            var view1 = view1Mock.Object;\n            view1.DataContext = viewModel1Mock.Object;\n\n            var view2 = new object();\n\n            region.Add(view1);\n            region.Add(view2);\n\n            region.Activate(view1);\n\n            var navigationUri = new Uri(view2.GetType().Name, UriKind.Relative);\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(new RegionNavigationJournalEntry());\n\n            var contentLoaderMock = new Mock<IRegionNavigationContentLoader>();\n            contentLoaderMock\n                .Setup(cl => cl.LoadContent(region, It.IsAny<NavigationContext>()))\n                .Returns(view2);\n\n            var container = containerMock.Object;\n            var contentLoader = contentLoaderMock.Object;\n            var journal = new Mock<IRegionNavigationJournal>().Object;\n\n            var target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            RegionNavigationFailedEventArgs eventArgs = null;\n            target.NavigationFailed += delegate (object sender, RegionNavigationFailedEventArgs e)\n            {\n                if (sender == target)\n                {\n                    eventArgs = e;\n                }\n            };\n\n            // Act\n            bool? isNavigationSuccessful = null;\n            target.RequestNavigate(navigationUri, nr => isNavigationSuccessful = nr.Success);\n\n            // Verify\n            viewModel1Mock.VerifyAll();\n            Assert.False(isNavigationSuccessful.Value);\n            Assert.NotNull(eventArgs);\n            Assert.Null(eventArgs.Error);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Regions/RegionViewRegistryFixture.cs",
    "content": "using System;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing Avalonia.Controls;\nusing Moq;\nusing Prism.Avalonia.Tests.Mvvm;\nusing Prism.Ioc;\nusing Prism.Navigation.Regions;\nusing Xunit;\n\nnamespace Prism.Avalonia.Tests.Regions;\n\npublic class RegionViewRegistryFixture\n{\n    [Fact]\n    public void CanRegisterContentAndRetrieveIt()\n    {\n        var containerMock = new Mock<IContainerExtension>();\n        ContainerLocator.SetContainerExtension(containerMock.Object);\n        containerMock.Setup(c => c.Resolve(typeof(MockContentObject))).Returns(new MockContentObject());\n        var registry = new RegionViewRegistry(containerMock.Object);\n\n        registry.RegisterViewWithRegion(\"MyRegion\", typeof(MockContentObject));\n        var result = registry.GetContents(\"MyRegion\");\n\n        Assert.NotNull(result);\n        Assert.Single(result);\n        Assert.IsType<MockContentObject>(result.ElementAt(0));\n    }\n\n    [Fact]\n    public void ShouldRaiseEventWhenAddingContent()\n    {\n        var listener = new MySubscriberClass();\n        var containerMock = new Mock<IContainerExtension>();\n        containerMock.Setup(c => c.Resolve(typeof(MockContentObject))).Returns(new MockContentObject());\n        var registry = new RegionViewRegistry(containerMock.Object);\n\n        registry.ContentRegistered += listener.OnContentRegistered;\n\n        registry.RegisterViewWithRegion(\"MyRegion\", typeof(MockContentObject));\n\n        Assert.NotNull(listener.onViewRegisteredArguments);\n        Assert.NotNull(listener.onViewRegisteredArguments.GetView);\n\n        var result = listener.onViewRegisteredArguments.GetView(containerMock.Object);\n        Assert.NotNull(result);\n        Assert.IsType<MockContentObject>(result);\n    }\n\n    [Fact]\n    public void CanRegisterContentAsDelegateAndRetrieveIt()\n    {\n        ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n        var registry = new RegionViewRegistry(null);\n        var content = new MockContentObject();\n\n        registry.RegisterViewWithRegion(\"MyRegion\", () => content);\n        var result = registry.GetContents(\"MyRegion\");\n\n        Assert.NotNull(result);\n        Assert.Single(result);\n        Assert.Same(content, result.ElementAt(0));\n    }\n\n    [Fact]\n    public async Task ShouldNotPreventSubscribersFromBeingGarbageCollected()\n    {\n        var registry = new RegionViewRegistry(null);\n        var subscriber = new MySubscriberClass();\n        registry.ContentRegistered += subscriber.OnContentRegistered;\n\n        WeakReference subscriberWeakReference = new WeakReference(subscriber);\n\n        subscriber = null;\n        await Task.Delay(50);\n        GC.Collect();\n\n        Assert.False(subscriberWeakReference.IsAlive);\n    }\n\n    [Fact]\n    public void OnRegisterErrorShouldGiveClearException()\n    {\n        var registry = new RegionViewRegistry(null);\n        registry.ContentRegistered += new EventHandler<ViewRegisteredEventArgs>(FailWithInvalidOperationException);\n\n        try\n        {\n            registry.RegisterViewWithRegion(\"R1\", typeof(object));\n            //Assert.Fail();\n        }\n        catch (ViewRegistrationException ex)\n        {\n            Assert.Contains(\"Dont do this\", ex.Message);\n            Assert.Contains(\"R1\", ex.Message);\n            Assert.Equal(\"Dont do this\", ex.InnerException.Message);\n        }\n        catch (Exception)\n        {\n            //Assert.Fail(\"Wrong exception type\");\n        }\n    }\n\n    [Fact]\n    public void OnRegisterErrorShouldSkipFrameworkExceptions()\n    {\n        ExceptionExtensions.RegisterFrameworkExceptionType(typeof(FrameworkException));\n        var registry = new RegionViewRegistry(null);\n        registry.ContentRegistered += new EventHandler<ViewRegisteredEventArgs>(FailWithFrameworkException);\n        var ex = Record.Exception(() => registry.RegisterViewWithRegion(\"R1\", typeof(object)));\n        Assert.NotNull(ex);\n        Assert.IsType<ViewRegistrationException>(ex);\n        Assert.Contains(\"Dont do this\", ex.Message);\n        Assert.Contains(\"R1\", ex.Message);\n    }\n\n    [StaFact(Skip = \"Runs alone but not in a group\")]\n    public void RegisterViewWithRegion_ShouldHaveViewModel_ByDefault()\n    {\n        ViewModelLocatorFixture.ResetViewModelLocationProvider();\n\n        var containerMock = new Mock<IContainerExtension>();\n        ContainerLocator.SetContainerExtension(containerMock.Object);\n        containerMock.Setup(c => c.Resolve(typeof(Mocks.Views.Mock))).Returns(new Mocks.Views.Mock());\n        containerMock.Setup(c => c.Resolve(typeof(Mocks.ViewModels.MockViewModel))).Returns(new Mocks.ViewModels.MockViewModel());\n        var registry = new RegionViewRegistry(containerMock.Object);\n\n        registry.RegisterViewWithRegion(\"MyRegion\", typeof(Mocks.Views.Mock));\n\n        var result = registry.GetContents(\"MyRegion\");\n        Assert.NotNull(result);\n        Assert.Single(result);\n\n        var view = result.ElementAt(0) as Control;\n        Assert.IsType<Mocks.Views.Mock>(view);\n        Assert.NotNull(view.DataContext);\n        Assert.IsType<Mocks.ViewModels.MockViewModel>(view.DataContext);\n    }\n\n    [StaFact(DisplayName = \"Flaky test, runs alone but not in a group\")]\n    public void RegisterViewWithRegion_ShouldNotHaveViewModel_OnOptOut()\n    {\n        ViewModelLocatorFixture.ResetViewModelLocationProvider();\n\n        var containerMock = new Mock<IContainerExtension>();\n        ContainerLocator.SetContainerExtension(containerMock.Object);\n        containerMock.Setup(c => c.Resolve(typeof(Mocks.Views.MockOptOut))).Returns(new Mocks.Views.MockOptOut());\n        containerMock.Setup(c => c.Resolve(typeof(Mocks.ViewModels.MockOptOutViewModel))).Returns(new Mocks.ViewModels.MockOptOutViewModel());\n        var registry = new RegionViewRegistry(containerMock.Object);\n\n        registry.RegisterViewWithRegion(\"MyRegion\", typeof(Mocks.Views.MockOptOut));\n\n        var result = registry.GetContents(\"MyRegion\");\n        Assert.NotNull(result);\n        Assert.Single(result);\n\n        var view = result.ElementAt(0) as Control;\n        Assert.IsType<Mocks.Views.MockOptOut>(view);\n        Assert.NotNull(view.DataContext);\n    }\n\n    private void FailWithFrameworkException(object sender, ViewRegisteredEventArgs e)\n    {\n        try\n        {\n            FailWithInvalidOperationException(sender, e);\n        }\n        catch (Exception ex)\n        {\n            throw new FrameworkException(ex);\n        }\n    }\n\n    private void FailWithInvalidOperationException(object sender, ViewRegisteredEventArgs e)\n    {\n        throw new InvalidOperationException(\"Dont do this\");\n    }\n\n    private class MockContentObject\n    {\n    }\n\n    private class MySubscriberClass\n    {\n        public ViewRegisteredEventArgs onViewRegisteredArguments;\n        public void OnContentRegistered(object sender, ViewRegisteredEventArgs e)\n        {\n            onViewRegisteredArguments = e;\n        }\n    }\n\n    private class FrameworkException : Exception\n    {\n        public FrameworkException(Exception innerException)\n            : base(\"\", innerException)\n        {\n\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Regions/SelectorRegionAdapterFixture.cs",
    "content": "﻿// TODO: 2022-07-13\n// Feature, SelectorRegionAdapter, is currently disabled.\n/*\nusing System;\nusing Avalonia.Controls;\nusing Moq;\nusing Prism.Navigation.Regions;\nusing Prism.Navigation.Regions.Behaviors;\nusing Xunit;\n\nnamespace Prism.Avalonia.Tests.Regions\n{\n    public class SelectorRegionAdapterFixture\n    {\n        [StaFact]\n        public void AdapterAddsSelectorItemsSourceSyncBehavior()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            var control = new ListBox();\n            IRegionAdapter adapter = new TestableSelectorRegionAdapter();\n\n            IRegion region = adapter.Initialize(control, \"Region1\");\n            Assert.NotNull(region);\n\n            Assert.IsType<SelectorItemsSourceSyncBehavior>(region.Behaviors[\"SelectorItemsSourceSyncBehavior\"]);\n        }\n\n        [StaFact]\n        public async Task AdapterDoesNotPreventRegionFromBeingGarbageCollected()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            var selector = new ListBox();\n            object model = new object();\n            IRegionAdapter adapter = new SelectorRegionAdapter(null);\n\n            var region = adapter.Initialize(selector, \"Region1\");\n            region.Add(model);\n\n            var regionWeakReference = new WeakReference(region);\n            var controlWeakReference = new WeakReference(selector);\n            Assert.True(regionWeakReference.IsAlive);\n            Assert.True(controlWeakReference.IsAlive);\n\n            region = null;\n            selector = null;\n            await Task.Delay(50);\n            GC.Collect();\n            GC.Collect();\n\n            Assert.False(regionWeakReference.IsAlive);\n            Assert.False(controlWeakReference.IsAlive);\n        }\n\n        [StaFact]\n        public void ActivatingTheViewShouldUpdateTheSelectedItem()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            var selector = new ListBox();\n            var view1 = new object();\n            var view2 = new object();\n\n            IRegionAdapter adapter = new SelectorRegionAdapter(null);\n\n            var region = adapter.Initialize(selector, \"Region1\");\n            region.Add(view1);\n            region.Add(view2);\n\n            Assert.NotEqual(view1, selector.SelectedItem);\n\n            region.Activate(view1);\n\n            Assert.Equal(view1, selector.SelectedItem);\n\n            region.Activate(view2);\n\n            Assert.Equal(view2, selector.SelectedItem);\n        }\n\n        [StaFact]\n        public void DeactivatingTheSelectedViewShouldUpdateTheSelectedItem()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            var selector = new ListBox();\n            var view1 = new object();\n            IRegionAdapter adapter = new SelectorRegionAdapter(null);\n            var region = adapter.Initialize(selector, \"Region1\");\n            region.Add(view1);\n\n            region.Activate(view1);\n\n            Assert.Equal(view1, selector.SelectedItem);\n\n            region.Deactivate(view1);\n\n            Assert.NotEqual(view1, selector.SelectedItem);\n        }\n\n        private class TestableSelectorRegionAdapter : SelectorRegionAdapter\n        {\n            public TestableSelectorRegionAdapter()\n                : base(null)\n            {\n            }\n\n\n            protected override IRegion CreateRegion()\n            {\n                return new Region();\n            }\n        }\n    }\n}\n*/\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Regions/SingleActiveRegionFixture.cs",
    "content": "using Moq;\nusing Prism.Ioc;\nusing Prism.Navigation.Regions;\nusing Xunit;\n\nnamespace Prism.Avalonia.Tests.Regions\n{\n    public class SingleActiveRegionFixture\n    {\n        [Fact]\n        public void ActivatingNewViewDeactivatesCurrent()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            IRegion region = new SingleActiveRegion();\n            var view = new object();\n            region.Add(view);\n            region.Activate(view);\n\n            Assert.True(region.ActiveViews.Contains(view));\n\n            var view2 = new object();\n            region.Add(view2);\n            region.Activate(view2);\n\n            Assert.False(region.ActiveViews.Contains(view));\n            Assert.True(region.ActiveViews.Contains(view2));\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Avalonia.Tests/Regions/ViewsCollectionFixture.cs",
    "content": "// NOTE:\n//  Avalonia.Data.CollectionViewSource control does not exist in Avalonia.\n//  This feature was apart of a legacy build:\n//  https://github.com/grokys/Avalonia/blob/master/Avalonia/Data/CollectionViewSource.cs\n//  Avalonia PR #14729 in draft as of 2024-04-11\n//  https://github.com/AvaloniaUI/Avalonia/pull/14729\nusing System.Collections;\nusing System.Collections.ObjectModel;\nusing System.Collections.Specialized;\nusing System.Linq;\nusing Prism.Avalonia.Tests.Mocks;\nusing Prism.Navigation.Regions;\nusing Xunit;\n\nnamespace Prism.Avalonia.Tests.Regions\n{\n    public class ViewsCollectionFixture\n    {\n        [Fact]\n        public void CanWrapCollectionCollection()\n        {\n            var originalCollection = new ObservableCollection<ItemMetadata>();\n            IViewsCollection viewsCollection = new ViewsCollection(originalCollection, x => true);\n\n            Assert.Empty(viewsCollection);\n\n            var item = new object();\n            originalCollection.Add(new ItemMetadata(item));\n            Assert.Single(viewsCollection);\n            Assert.Same(item, viewsCollection.First());\n        }\n\n        [Fact]\n        public void CanFilterCollection()\n        {\n            var originalCollection = new ObservableCollection<ItemMetadata>();\n            IViewsCollection viewsCollection = new ViewsCollection(originalCollection, x => x.Name == \"Possible\");\n\n            originalCollection.Add(new ItemMetadata(new object()));\n\n            Assert.Empty(viewsCollection);\n\n            var item = new object();\n            originalCollection.Add(new ItemMetadata(item) { Name = \"Possible\" });\n            Assert.Single(viewsCollection);\n\n            Assert.Same(item, viewsCollection.First());\n        }\n\n        [Fact]\n        public void RaisesCollectionChangedWhenFilteredCollectionChanges()\n        {\n            var originalCollection = new ObservableCollection<ItemMetadata>();\n            IViewsCollection viewsCollection = new ViewsCollection(originalCollection, x => x.IsActive);\n            bool collectionChanged = false;\n            viewsCollection.CollectionChanged += (s, e) => collectionChanged = true;\n\n            originalCollection.Add(new ItemMetadata(new object()) { IsActive = true });\n\n            Assert.True(collectionChanged);\n        }\n\n        [Fact]\n        public void RaisesCollectionChangedWithAddAndRemoveWhenFilteredCollectionChanges()\n        {\n            var originalCollection = new ObservableCollection<ItemMetadata>();\n            IViewsCollection viewsCollection = new ViewsCollection(originalCollection, x => x.IsActive);\n            bool addedToCollection = false;\n            bool removedFromCollection = false;\n            viewsCollection.CollectionChanged += (s, e) =>\n            {\n                if (e.Action == NotifyCollectionChangedAction.Add)\n                {\n                    addedToCollection = true;\n                }\n                else if (e.Action == NotifyCollectionChangedAction.Remove)\n                {\n                    removedFromCollection = true;\n                }\n            };\n            var filteredInObject = new ItemMetadata(new object()) { IsActive = true };\n\n            originalCollection.Add(filteredInObject);\n\n            Assert.True(addedToCollection);\n            Assert.False(removedFromCollection);\n\n            originalCollection.Remove(filteredInObject);\n\n            Assert.True(removedFromCollection);\n        }\n\n        [Fact]\n        public void DoesNotRaiseCollectionChangedWhenAddingOrRemovingFilteredOutObject()\n        {\n            var originalCollection = new ObservableCollection<ItemMetadata>();\n            IViewsCollection viewsCollection = new ViewsCollection(originalCollection, x => x.IsActive);\n            bool collectionChanged = false;\n            viewsCollection.CollectionChanged += (s, e) => collectionChanged = true;\n            var filteredOutObject = new ItemMetadata(new object()) { IsActive = false };\n\n            originalCollection.Add(filteredOutObject);\n            originalCollection.Remove(filteredOutObject);\n\n            Assert.False(collectionChanged);\n        }\n\n        [Fact]\n        public void CollectionChangedPassesWrappedItemInArgumentsWhenAdding()\n        {\n            var originalCollection = new ObservableCollection<ItemMetadata>();\n            var filteredInObject = new ItemMetadata(new object());\n            originalCollection.Add(filteredInObject);\n\n            IViewsCollection viewsCollection = new ViewsCollection(originalCollection, x => true);\n            IList oldItemsPassed = null;\n            viewsCollection.CollectionChanged += (s, e) => { oldItemsPassed = e.OldItems; };\n            originalCollection.Remove(filteredInObject);\n\n            Assert.NotNull(oldItemsPassed);\n            Assert.Single(oldItemsPassed);\n            Assert.Same(filteredInObject.Item, oldItemsPassed[0]);\n        }\n\n        [Fact]\n        public void CollectionChangedPassesWrappedItemInArgumentsWhenRemoving()\n        {\n            var originalCollection = new ObservableCollection<ItemMetadata>();\n            IViewsCollection viewsCollection = new ViewsCollection(originalCollection, x => true);\n            IList newItemsPassed = null;\n            viewsCollection.CollectionChanged += (s, e) => { newItemsPassed = e.NewItems; };\n            var filteredInObject = new ItemMetadata(new object());\n\n            originalCollection.Add(filteredInObject);\n\n            Assert.NotNull(newItemsPassed);\n            Assert.Single(newItemsPassed);\n            Assert.Same(filteredInObject.Item, newItemsPassed[0]);\n        }\n\n        [Fact]\n        public void EnumeratesWrappedItems()\n        {\n            var originalCollection = new ObservableCollection<ItemMetadata>()\n                                         {\n                                             new ItemMetadata(new object()),\n                                             new ItemMetadata(new object())\n                                         };\n            IViewsCollection viewsCollection = new ViewsCollection(originalCollection, x => true);\n            Assert.Equal(2, viewsCollection.Count());\n\n            Assert.Same(originalCollection[0].Item, viewsCollection.ElementAt(0));\n            Assert.Same(originalCollection[1].Item, viewsCollection.ElementAt(1));\n        }\n\n        [Fact]\n        public void ChangingMetadataOnItemAddsOrRemovesItFromTheFilteredCollection()\n        {\n            var originalCollection = new ObservableCollection<ItemMetadata>();\n            IViewsCollection viewsCollection = new ViewsCollection(originalCollection, x => x.IsActive);\n            bool addedToCollection = false;\n            bool removedFromCollection = false;\n            viewsCollection.CollectionChanged += (s, e) =>\n            {\n                if (e.Action == NotifyCollectionChangedAction.Add)\n                {\n                    addedToCollection = true;\n                }\n                else if (e.Action == NotifyCollectionChangedAction.Remove)\n                {\n                    removedFromCollection = true;\n                }\n            };\n\n            originalCollection.Add(new ItemMetadata(new object()) { IsActive = true });\n            Assert.True(addedToCollection);\n            Assert.False(removedFromCollection);\n            addedToCollection = false;\n\n            originalCollection[0].IsActive = false;\n\n            Assert.Empty(viewsCollection);\n            Assert.True(removedFromCollection);\n            Assert.False(addedToCollection);\n            Assert.Empty(viewsCollection);\n            addedToCollection = false;\n            removedFromCollection = false;\n\n            originalCollection[0].IsActive = true;\n\n            Assert.Single(viewsCollection);\n            Assert.True(addedToCollection);\n            Assert.False(removedFromCollection);\n        }\n\n        [Fact]\n        public void AddingToOriginalCollectionFiresAddCollectionChangeEvent()\n        {\n            var originalCollection = new ObservableCollection<ItemMetadata>();\n            IViewsCollection viewsCollection = new ViewsCollection(originalCollection, (i) => true);\n\n            var eventTracker = new CollectionChangedTracker(viewsCollection);\n\n            originalCollection.Add(new ItemMetadata(new object()));\n\n            Assert.Contains(NotifyCollectionChangedAction.Add, eventTracker.ActionsFired);\n        }\n\n        [Fact]\n        public void AddingToOriginalCollectionFiresResetNotificationIfSortComparisonSet()\n        {\n            // Reset is fired to support the need to resort after updating the collection\n            var originalCollection = new ObservableCollection<ItemMetadata>();\n            var viewsCollection = new ViewsCollection(originalCollection, (i) => true);\n            viewsCollection.SortComparison = (a, b) => { return 0; };\n\n            var eventTracker = new CollectionChangedTracker(viewsCollection);\n\n            originalCollection.Add(new ItemMetadata(new object()));\n\n            Assert.Contains(NotifyCollectionChangedAction.Add, eventTracker.ActionsFired);\n            Assert.Equal(\n                1,\n                eventTracker.ActionsFired.Count(a => a == NotifyCollectionChangedAction.Reset));\n        }\n\n        [Fact]\n        public void OnAddNotifyCollectionChangedThenIndexProvided()\n        {\n            var originalCollection = new ObservableCollection<ItemMetadata>();\n            IViewsCollection viewsCollection = new ViewsCollection(originalCollection, (i) => true);\n\n            var eventTracker = new CollectionChangedTracker(viewsCollection);\n\n            originalCollection.Add(new ItemMetadata(\"a\"));\n\n            var addEvent = eventTracker.NotifyEvents.Single(e => e.Action == NotifyCollectionChangedAction.Add);\n            Assert.Equal(0, addEvent.NewStartingIndex);\n        }\n\n        [Fact]\n        public void OnRemoveNotifyCollectionChangedThenIndexProvided()\n        {\n            var originalCollection = new ObservableCollection<ItemMetadata>();\n            originalCollection.Add(new ItemMetadata(\"a\"));\n            originalCollection.Add(new ItemMetadata(\"b\"));\n            originalCollection.Add(new ItemMetadata(\"c\"));\n            IViewsCollection viewsCollection = new ViewsCollection(originalCollection, (i) => true);\n\n            var eventTracker = new CollectionChangedTracker(viewsCollection);\n            originalCollection.RemoveAt(1);\n\n            var removeEvent = eventTracker.NotifyEvents.Single(e => e.Action == NotifyCollectionChangedAction.Remove);\n            Assert.NotNull(removeEvent);\n            Assert.Equal(1, removeEvent.OldStartingIndex);\n        }\n\n        [Fact]\n        public void OnRemoveOfFilterMatchingItemThenViewCollectionRelativeIndexProvided()\n        {\n            var originalCollection = new ObservableCollection<ItemMetadata>();\n            originalCollection.Add(new ItemMetadata(\"a\"));\n            originalCollection.Add(new ItemMetadata(\"b\"));\n            originalCollection.Add(new ItemMetadata(\"c\"));\n            IViewsCollection viewsCollection = new ViewsCollection(originalCollection, (i) => !\"b\".Equals(i.Item));\n\n            var eventTracker = new CollectionChangedTracker(viewsCollection);\n            originalCollection.RemoveAt(2);\n\n            var removeEvent = eventTracker.NotifyEvents.Single(e => e.Action == NotifyCollectionChangedAction.Remove);\n            Assert.NotNull(removeEvent);\n            Assert.Equal(1, removeEvent.OldStartingIndex);\n        }\n\n        //// NOTE:  Avalonia.Data.CollectionViewSource control does not exist in Avalonia.\n        ////[Fact]\n        ////public void RemovingFromFilteredCollectionDoesNotThrow()\n        ////{\n        ////    var originalCollection = new ObservableCollection<ItemMetadata>();\n        ////    originalCollection.Add(new ItemMetadata(\"a\"));\n        ////    originalCollection.Add(new ItemMetadata(\"b\"));\n        ////    originalCollection.Add(new ItemMetadata(\"c\"));\n        ////    IViewsCollection viewsCollection = new ViewsCollection(originalCollection, (i) => true);\n        ////\n        ////    CollectionViewSource cvs = new CollectionViewSource { Source = viewsCollection };\n        ////\n        ////    var view = cvs.View;\n        ////    //try\n        ////    //{\n        ////    originalCollection.RemoveAt(1);\n        ////    //}\n        ////    //catch (Exception ex)\n        ////    //{\n        ////    //Assert.Fail(ex.Message);\n        ////    //}\n        ////}\n\n        [Fact]\n        public void ViewsCollectionSortedAfterAddingItemToOriginalCollection()\n        {\n            var originalCollection = new ObservableCollection<ItemMetadata>();\n            ViewsCollection viewsCollection = new ViewsCollection(originalCollection, (i) => true);\n            viewsCollection.SortComparison = Region.DefaultSortComparison;\n\n            var view1 = new MockSortableView1();\n            var view2 = new MockSortableView2();\n            var view3 = new MockSortableView3();\n\n            originalCollection.Add(new ItemMetadata(view2));\n            originalCollection.Add(new ItemMetadata(view3));\n            originalCollection.Add(new ItemMetadata(view1));\n\n            Assert.Same(view1, viewsCollection.ElementAt(0));\n            Assert.Same(view2, viewsCollection.ElementAt(1));\n            Assert.Same(view3, viewsCollection.ElementAt(2));\n        }\n\n        [Fact]\n        public void ChangingSortComparisonCausesResortingOfCollection()\n        {\n            var originalCollection = new ObservableCollection<ItemMetadata>();\n            ViewsCollection viewsCollection = new ViewsCollection(originalCollection, (i) => true);\n\n            var view1 = new MockSortableView1();\n            var view2 = new MockSortableView2();\n            var view3 = new MockSortableView3();\n\n            originalCollection.Add(new ItemMetadata(view2));\n            originalCollection.Add(new ItemMetadata(view3));\n            originalCollection.Add(new ItemMetadata(view1));\n\n            // ensure items are in original order\n            Assert.Same(view2, viewsCollection.ElementAt(0));\n            Assert.Same(view3, viewsCollection.ElementAt(1));\n            Assert.Same(view1, viewsCollection.ElementAt(2));\n\n            // change sort comparison\n            viewsCollection.SortComparison = Region.DefaultSortComparison;\n\n            // ensure items are properly sorted\n            Assert.Same(view1, viewsCollection.ElementAt(0));\n            Assert.Same(view2, viewsCollection.ElementAt(1));\n            Assert.Same(view3, viewsCollection.ElementAt(2));\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Container.Avalonia.Shared/Fixtures/Application/PrismApplicationFixture.cs",
    "content": "﻿namespace Prism.Container.Avalonia.Tests.Fixtures.Application\n{\n    public class PrismApplicationFixture\n    {\n        // TODO: Write tests for PrismApplication\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Container.Avalonia.Shared/Fixtures/Bootstrapper/BootstrapperFixture.cs",
    "content": "﻿using System;\nusing Prism.Container.Avalonia.Mocks;\nusing Prism.Ioc;\nusing Prism.Modularity;\nusing Prism.Navigation.Regions;\nusing Xunit;\nusing static Prism.Container.Avalonia.Tests.ContainerHelper;\n\nnamespace Prism.Container.Avalonia.Tests.Bootstrapper\n{\n    [Collection(nameof(ContainerExtension))]\n    public class BootstrapperFixture\n    {\n        [StaFact]\n        public void ContainerDefaultsToNull()\n        {\n            var bootstrapper = new MockBootstrapper();\n            var container = bootstrapper.ContainerExtension;\n\n            Assert.Null(container);\n        }\n\n        [StaFact]\n        public void CanCreateConcreteBootstrapper()\n        {\n            new MockBootstrapper();\n        }\n\n        [StaFact]\n        public void CreateContainerShouldInitializeContainer()\n        {\n            var bootstrapper = new MockBootstrapper();\n\n            var container = bootstrapper.CallCreateContainer();\n\n            Assert.NotNull(container);\n            Assert.IsAssignableFrom(BaseContainerInterfaceType, container);\n        }\n\n        [StaFact]\n        public void ConfigureContainerAddsModuleCatalogToContainer()\n        {\n            var bootstrapper = new MockBootstrapper();\n            bootstrapper.Run();\n\n            var returnedCatalog = bootstrapper.ContainerExtension.Resolve<IModuleCatalog>();\n            Assert.NotNull(returnedCatalog);\n            Assert.IsType<ModuleCatalog>(returnedCatalog);\n        }\n\n        [StaFact]\n        public void ConfigureContainerAddsRegionNavigationJournalEntryToContainer()\n        {\n            var bootstrapper = new MockBootstrapper();\n            bootstrapper.Run();\n\n            var actual1 = bootstrapper.ContainerExtension.Resolve<IRegionNavigationJournalEntry>();\n            var actual2 = bootstrapper.ContainerExtension.Resolve<IRegionNavigationJournalEntry>();\n\n            Assert.NotNull(actual1);\n            Assert.NotNull(actual2);\n            Assert.NotSame(actual1, actual2);\n        }\n\n        [StaFact]\n        public void ConfigureContainerAddsRegionNavigationJournalToContainer()\n        {\n            var bootstrapper = new MockBootstrapper();\n            bootstrapper.Run();\n\n            var actual1 = bootstrapper.ContainerExtension.Resolve<IRegionNavigationJournal>();\n            var actual2 = bootstrapper.ContainerExtension.Resolve<IRegionNavigationJournal>();\n\n            Assert.NotNull(actual1);\n            Assert.NotNull(actual2);\n            Assert.NotSame(actual1, actual2);\n        }\n\n        [StaFact]\n        public void ConfigureContainerAddsRegionNavigationServiceToContainer()\n        {\n            var bootstrapper = new MockBootstrapper();\n            bootstrapper.Run();\n\n            var actual1 = bootstrapper.ContainerExtension.Resolve<IRegionNavigationService>();\n            var actual2 = bootstrapper.ContainerExtension.Resolve<IRegionNavigationService>();\n\n            Assert.NotNull(actual1);\n            Assert.NotNull(actual2);\n            Assert.NotSame(actual1, actual2);\n        }\n\n        [StaFact]\n        public void ConfigureContainerAddsNavigationTargetHandlerToContainer()\n        {\n            var bootstrapper = new MockBootstrapper();\n            bootstrapper.Run();\n\n            var actual1 = bootstrapper.ContainerExtension.Resolve<IRegionNavigationContentLoader>();\n            var actual2 = bootstrapper.ContainerExtension.Resolve<IRegionNavigationContentLoader>();\n\n            Assert.NotNull(actual1);\n            Assert.NotNull(actual2);\n            Assert.Same(actual1, actual2);\n        }\n\n        [StaFact]\n        public void RegisterFrameworkExceptionTypesShouldRegisterResolutionFailedException()\n        {\n            var bootstrapper = new MockBootstrapper();\n\n            bootstrapper.CallRegisterFrameworkExceptionTypes();\n\n            Assert.True(ExceptionExtensions.IsFrameworkExceptionRegistered(RegisteredFrameworkException));\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Container.Avalonia.Shared/Fixtures/Bootstrapper/BootstrapperNullModuleCatalogFixture.cs",
    "content": "﻿using System;\nusing Prism.Container.Avalonia.Mocks;\nusing Prism.IocContainer.Avalonia.Tests.Support;\nusing Xunit;\n\nnamespace Prism.Container.Avalonia.Tests.Bootstrapper\n{\n    public class BootstrapperNullModuleCatalogFixture : BootstrapperFixtureBase\n    {\n        [Fact]\n        public void NullModuleCatalogThrowsOnDefaultModuleInitialization()\n        {\n            var bootstrapper = new NullModuleCatalogBootstrapper();\n\n            AssertExceptionThrownOnRun(bootstrapper, typeof(InvalidOperationException), \"IModuleCatalog\");\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Container.Avalonia.Shared/Fixtures/Bootstrapper/BootstrapperRunMethodFixture.cs",
    "content": "﻿using Moq;\nusing Prism.Container.Avalonia.Mocks;\nusing Prism.Events;\nusing Prism.Ioc;\nusing Prism.Modularity;\nusing Prism.Navigation.Regions;\nusing Xunit;\n\nnamespace Prism.Container.Avalonia.Tests.Bootstrapper\n{\n    [Collection(nameof(ContainerExtension))]\n    public partial class BootstrapperRunMethodFixture\n    {\n        [StaFact]\n        public void CanRunBootstrapper()\n        {\n            var bootstrapper = new MockBootstrapper();\n            bootstrapper.Run();\n        }\n\n        [StaFact]\n        public void RunShouldNotFailIfReturnedNullShell()\n        {\n            var bootstrapper = new MockBootstrapper { ShellObject = null };\n            bootstrapper.Run();\n        }\n\n        [StaFact]\n        public void RunSetsCurrentContainer()\n        {\n            var bootstrapper = new MockBootstrapper();\n            bootstrapper.Run();\n\n            Assert.NotNull(ContainerLocator.Container);\n            Assert.IsType(ContainerHelper.ContainerExtensionType, ContainerLocator.Container);\n        }\n\n        [StaFact]\n        public void RunShouldInitializeContainer()\n        {\n            var bootstrapper = new MockBootstrapper();\n            var container = bootstrapper.BaseContainer;\n\n            Assert.Null(container);\n\n            bootstrapper.Run();\n\n            container = bootstrapper.BaseContainer;\n\n            Assert.NotNull(container);\n            Assert.IsType(ContainerHelper.BaseContainerType, container);\n        }\n\n        [StaFact]\n        public void RunShouldCallInitializeModules()\n        {\n            var bootstrapper = new MockBootstrapper();\n            bootstrapper.Run();\n\n            Assert.True(bootstrapper.InitializeModulesCalled);\n        }\n\n        [StaFact]\n        public void RunShouldCallConfigureDefaultRegionBehaviors()\n        {\n            var bootstrapper = new MockBootstrapper();\n\n            bootstrapper.Run();\n\n            Assert.True(bootstrapper.ConfigureDefaultRegionBehaviorsCalled);\n        }\n\n        [StaFact]\n        public void RunShouldCallConfigureRegionAdapterMappings()\n        {\n            var bootstrapper = new MockBootstrapper();\n\n            bootstrapper.Run();\n\n            Assert.True(bootstrapper.ConfigureRegionAdapterMappingsCalled);\n        }\n\n        [StaFact]\n        public void RunShouldAssignRegionManagerToReturnedShell()\n        {\n            var bootstrapper = new MockBootstrapper();\n\n            bootstrapper.Run();\n\n            Assert.NotNull(RegionManager.GetRegionManager(bootstrapper.BaseShell));\n        }\n\n        [StaFact]\n        public void RunShouldCallCreateModuleCatalog()\n        {\n            var bootstrapper = new MockBootstrapper();\n\n            bootstrapper.Run();\n\n            Assert.True(bootstrapper.CreateModuleCatalogCalled);\n        }\n\n        [StaFact]\n        public void RunShouldCallConfigureModuleCatalog()\n        {\n            var bootstrapper = new MockBootstrapper();\n\n            bootstrapper.Run();\n\n            Assert.True(bootstrapper.ConfigureModuleCatalogCalled);\n        }\n\n        [StaFact]\n        public void RunShouldCallCreateContainer()\n        {\n            var bootstrapper = new MockBootstrapper();\n\n            bootstrapper.Run();\n\n            Assert.True(bootstrapper.CreateContainerCalled);\n        }\n\n        [StaFact]\n        public void RunShouldCallCreateShell()\n        {\n            var bootstrapper = new MockBootstrapper();\n\n            bootstrapper.Run();\n\n            Assert.True(bootstrapper.CreateShellCalled);\n        }\n\n        [StaFact]\n        public void RunShouldCallRegisterRequiredTypes()\n        {\n            var bootstrapper = new MockBootstrapper();\n\n            bootstrapper.Run();\n\n            Assert.True(bootstrapper.RegisterRequiredTypesCalled);\n        }\n\n        [StaFact]\n        public void RunShouldCallRegisterTypes()\n        {\n            var bootstrapper = new MockBootstrapper();\n\n            bootstrapper.Run();\n\n            Assert.True(bootstrapper.RegisterTypesCalled);\n        }\n\n        [StaFact]\n        public void SetsContainerLocatorCurrentContainer()\n        {\n            ContainerLocator.ResetContainer();\n            Assert.False(ContainerLocator.IsInitialized);\n            var bootstrapper = new MockBootstrapper();\n\n            bootstrapper.Run();\n\n            Assert.NotNull(ContainerLocator.Container);\n            Assert.Same(bootstrapper.Container, ContainerLocator.Container);\n        }\n\n        [StaFact]\n        public void RunShouldCallConfigureViewModelLocator()\n        {\n            var bootstrapper = new MockBootstrapper();\n\n            bootstrapper.Run();\n\n            Assert.True(bootstrapper.ConfigureViewModelLocatorCalled);\n        }\n\n        [StaFact]\n        public void ModuleManagerRunCalled()\n        {\n            // Have to use a non-mocked container because of IsRegistered<> extension method, Registrations property,and ContainerRegistration\n            var mockedModuleInitializer = new Mock<IModuleInitializer>();\n            var mockedModuleManager = new Mock<IModuleManager>();\n            var regionAdapterMappings = new RegionAdapterMappings();\n            var container = ContainerHelper.CreateContainerExtension();\n            var regionBehaviorFactory = new RegionBehaviorFactory(container);\n\n            container.RegisterInstance<IContainerExtension>(container);\n            container.RegisterInstance<IModuleCatalog>(new ModuleCatalog());\n            container.RegisterInstance<IModuleInitializer>(mockedModuleInitializer.Object);\n            container.RegisterInstance<IModuleManager>(mockedModuleManager.Object);\n            container.RegisterInstance<RegionAdapterMappings>(regionAdapterMappings);\n\n            container.RegisterSingleton(typeof(RegionAdapterMappings), typeof(RegionAdapterMappings));\n            container.RegisterSingleton(typeof(IRegionManager), typeof(RegionManager));\n            container.RegisterSingleton(typeof(IEventAggregator), typeof(EventAggregator));\n            container.RegisterSingleton(typeof(IRegionViewRegistry), typeof(RegionViewRegistry));\n            container.RegisterSingleton(typeof(IRegionBehaviorFactory), typeof(RegionBehaviorFactory));\n            container.RegisterSingleton(typeof(IRegionNavigationJournalEntry), typeof(RegionNavigationJournalEntry));\n            container.RegisterSingleton(typeof(IRegionNavigationJournal), typeof(RegionNavigationJournal));\n            container.RegisterSingleton(typeof(IRegionNavigationService), typeof(RegionNavigationService));\n            container.RegisterSingleton(typeof(IRegionNavigationContentLoader), typeof(RegionNavigationContentLoader));\n\n            // TODO: container.RegisterInstance<SelectorRegionAdapter>(new SelectorRegionAdapter(regionBehaviorFactory));\n            container.RegisterInstance<ItemsControlRegionAdapter>(new ItemsControlRegionAdapter(regionBehaviorFactory));\n            container.RegisterInstance<ContentControlRegionAdapter>(new ContentControlRegionAdapter(regionBehaviorFactory));\n\n            var bootstrapper = new MockedContainerBootstrapper(container.GetBaseContainer());\n            bootstrapper.Run(false);\n\n            mockedModuleManager.Verify(mm => mm.Run(), Times.Once());\n        }\n\n        [StaFact]\n        public void RunShouldCallTheMethodsInOrder()\n        {\n            var bootstrapper = new MockBootstrapper();\n            bootstrapper.Run();\n\n            var index = 0;\n            Assert.Equal(\"ConfigureViewModelLocator\", bootstrapper.MethodCalls[index++]);\n            Assert.Equal(\"CreateContainerExtension\", bootstrapper.MethodCalls[index++]);\n            Assert.Equal(\"CreateModuleCatalog\", bootstrapper.MethodCalls[index++]);\n            Assert.Equal(\"RegisterRequiredTypes\", bootstrapper.MethodCalls[index++]);\n            Assert.Equal(\"RegisterTypes\", bootstrapper.MethodCalls[index++]);\n            Assert.Equal(\"ConfigureModuleCatalog\", bootstrapper.MethodCalls[index++]);\n            Assert.Equal(\"ConfigureRegionAdapterMappings\", bootstrapper.MethodCalls[index++]);\n            Assert.Equal(\"ConfigureDefaultRegionBehaviors\", bootstrapper.MethodCalls[index++]);\n            Assert.Equal(\"RegisterFrameworkExceptionTypes\", bootstrapper.MethodCalls[index++]);\n            Assert.Equal(\"CreateShell\", bootstrapper.MethodCalls[index++]);\n            Assert.Equal(\"InitializeShell\", bootstrapper.MethodCalls[index++]);\n            Assert.Equal(\"InitializeModules\", bootstrapper.MethodCalls[index++]);\n            Assert.Equal(\"OnInitialized\", bootstrapper.MethodCalls[index++]);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Container.Avalonia.Shared/Fixtures/ContainerExtensionCollection.cs",
    "content": "﻿using Xunit;\n\nnamespace Prism.Container.Avalonia.Tests\n{\n    public class ContainerExtension { }\n\n    [CollectionDefinition(nameof(ContainerExtension), DisableParallelization = true)]\n    public class ContainerExtensionCollection : ICollectionFixture<ContainerExtension>\n    {\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Container.Avalonia.Shared/Fixtures/Ioc/ContainerExtensionFixture.cs",
    "content": "﻿using System.Collections.Generic;\nusing Prism.Ioc;\nusing Prism.IocContainer.Avalonia.Tests.Support.Mocks;\nusing Xunit;\nusing static Prism.Container.Avalonia.Tests.ContainerHelper;\n\nnamespace Prism.Container.Avalonia.Tests.Ioc\n{\n    public class ContainerExtensionFixture\n    {\n        [Fact]\n        public void ExtensionReturnsTrueIfThereIsAPolicyForType()\n        {\n            var container = CreateContainerExtension();\n\n            container.Register<object, string>();\n            Assert.True(container.IsRegistered(typeof(object)));\n            Assert.False(container.IsRegistered(typeof(int)));\n\n            container.Register<IList<int>, List<int>>();\n\n            Assert.True(container.IsRegistered(typeof(IList<int>)));\n            Assert.False(container.IsRegistered(typeof(IList<string>)));\n\n            container.Register(typeof(IDictionary<,>), typeof(Dictionary<,>));\n            Assert.True(container.IsRegistered(typeof(IDictionary<,>)));\n        }\n\n        [Fact]\n        public void TryResolveShouldResolveTheElementIfElementExist()\n        {\n            var container = CreateContainerExtension();\n            container.Register<IService, MockService>();\n\n            object dependantA = null;\n            var ex = Record.Exception(() => dependantA = container.Resolve<IService>());\n            Assert.Null(ex);\n            Assert.NotNull(dependantA);\n        }\n\n        [Fact]\n        public void TryResolveShouldReturnNullIfElementNotExist()\n        {\n            var container = CreateContainerExtension();\n\n            object dependantA = null;\n            var ex = Record.Exception(() => dependantA = container.Resolve<IDependantA>());\n            Assert.NotNull(ex);\n            Assert.Null(dependantA);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Container.Avalonia.Shared/Fixtures/Ioc/ContainerProviderExtensionFixture.cs",
    "content": "﻿/*\n * TODO: Fix me for Avalonia\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Reflection;\nusing System.Threading;\nusing Avalonia.Controls;\nusing Avalonia.Markup.Xaml;\nusing Prism.Ioc;\nusing Prism.IocContainer.Avalonia.Tests.Support.Mocks;\nusing Xunit;\n\nnamespace Prism.Container.Avalonia.Tests.Ioc\n{\n    public class ContainerProviderExtensionFixture : IDisposable\n    {\n        private static readonly MockService _unnamedService = new MockService();\n        private static readonly IReadOnlyDictionary<string, MockService> _namedServiceDictionary = new Dictionary<string, MockService>\n        {\n            [\"A\"] = new MockService(),\n            [\"B\"] = new MockService(),\n        };\n\n        private static readonly IContainerExtension _containerExtension\n             = ContainerHelper.CreateContainerExtension();\n\n        static ContainerProviderExtensionFixture()\n        {\n            // Preload assembly to resolve 'xmlns:prism' on xaml.\n            Assembly.Load(\"Prism.Avalonia\");\n\n            _containerExtension.RegisterInstance<IService>(_unnamedService);\n            foreach (var kvp in _namedServiceDictionary)\n            {\n                _containerExtension.RegisterInstance<IService>(kvp.Value, kvp.Key);\n            }\n        }\n\n        public ContainerProviderExtensionFixture()\n        {\n            ContainerLocator.ResetContainer();\n            ContainerLocator.SetContainerExtension(_containerExtension);\n        }\n\n        public void Dispose()\n        {\n            ContainerLocator.ResetContainer();\n        }\n\n        [Fact]\n        public void CanResolveUnnamedServiceUsingConstructor()\n        {\n            var containerProvider = new ContainerProviderExtension(typeof(IService));\n            var service = containerProvider.ProvideValue(null);\n\n            Assert.Same(_unnamedService, service);\n        }\n\n        [Fact]\n        public void CanResolveUnnamedServiceUsingProperty()\n        {\n            var containerProvider = new ContainerProviderExtension\n            {\n                Type = typeof(IService)\n            };\n            var service = containerProvider.ProvideValue(null);\n\n            Assert.Same(_unnamedService, service);\n        }\n\n        [Theory]\n        [InlineData(\"A\")]\n        [InlineData(\"B\")]\n        public void CanResolvedNamedServiceUsingConstructor(string name)\n        {\n            var expectedService = _namedServiceDictionary[name];\n\n            var containerProvider = new ContainerProviderExtension(typeof(IService))\n            {\n                Name = name,\n            };\n            var service = containerProvider.ProvideValue(null);\n\n            Assert.Same(expectedService, service);\n        }\n\n        [Theory]\n        [InlineData(\"A\")]\n        [InlineData(\"B\")]\n        public void CanResolvedNamedServiceUsingProperty(string name)\n        {\n            var expectedService = _namedServiceDictionary[name];\n\n            var containerProvider = new ContainerProviderExtension()\n            {\n                Type = typeof(IService),\n                Name = name,\n            };\n            var service = containerProvider.ProvideValue(null);\n\n            Assert.Same(expectedService, service);\n        }\n\n        private const string _xamlWithMarkupExtension =\n@\"<Window \n  xmlns=\"\"https://github.com/avaloniaui\"\"\n  xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'\n  xmlns:prism='http://prismlibrary.com/'\n  xmlns:mocks='clr-namespace:Prism.IocContainer.Avalonia.Tests.Support.Mocks;assembly=Prism.IocContainer.Avalonia.Tests.Support'\n  DataContext='{prism:ContainerProvider mocks:IService}' />\";\n\n        private const string _xamlWithXmlElement =\n@\"<Window\n  xmlns=\"\"https://github.com/avaloniaui\"\"\n  xmlns:x=\"\"http://schemas.microsoft.com/winfx/2006/xaml\"\"\n  xmlns:prism='http://prismlibrary.com/'\n  xmlns:mocks='clr-namespace:Prism.IocContainer.Avalonia.Tests.Support.Mocks;assembly=Prism.IocContainer.Avalonia.Tests.Support'>\n  <Window.DataContext>\n    <prism:ContainerProvider Type='mocks:IService' />\n  </Window.DataContext>\n</Window>\";\n\n        [Theory]\n        [InlineData(_xamlWithMarkupExtension)]\n        [InlineData(_xamlWithXmlElement)]\n        public void CanResolveServiceFromXaml(string xaml)\n        {\n            // Don't use StaTheoryAttribute. \n            // If use StaTheoryAttribute, ContainerLocator.Current will be changed by other test method\n            // and Window.DataContext will be null.\n\n            object dataContext = null;\n            try\n            {\n                var thread = new Thread(() =>\n                {\n                    ////using (var reader = new StringReader(xaml))\n                    ////{\n                    ////    var window = XamlServices.Load(reader) as Window;\n                    ////    dataContext = window.DataContext;\n                    ////}\n\n                    var window = AvaloniaRuntimeXamlLoader.Load(xaml) as Window;\n                    dataContext = window.DataContext;\n                });\n\n                thread.SetApartmentState(ApartmentState.STA);\n                thread.Start();\n                thread.Join();\n            }\n            catch (Exception ex)\n            {\n                Console.WriteLine(\"Issue resolving AXAML: \" + ex);\n                Debug.WriteLine(\"Issue resolving AXAML: \" + ex);\n            }\n\n            Assert.Same(_unnamedService, dataContext);\n        }\n    }\n}\n*/\n"
  },
  {
    "path": "tests/Avalonia/Prism.Container.Avalonia.Shared/Fixtures/Mvvm/ViewModelLocatorFixture.cs",
    "content": "﻿using Prism.Container.Avalonia.Mocks;\nusing Prism.Ioc;\nusing Prism.IocContainer.Avalonia.Tests.Support.Mocks;\nusing Prism.IocContainer.Avalonia.Tests.Support.Mocks.ViewModels;\nusing Prism.IocContainer.Avalonia.Tests.Support.Mocks.Views;\nusing Prism.Mvvm;\nusing Xunit;\n\nnamespace Prism.Container.Avalonia.Tests.Mvvm\n{\n    [Collection(nameof(ContainerExtension))]\n    public class ViewModelLocatorFixture\n    {\n        [StaFact]\n        public void ShouldLocateViewModelAndResolveWithContainer()\n        {\n            var bootstrapper = new MockBootstrapper();\n            bootstrapper.Run();\n\n            bootstrapper.ContainerRegistry.Register<IService, MockService>();\n\n            var view = new MockView();\n            Assert.Null(view.DataContext);\n\n            ViewModelLocator.SetAutoWireViewModel(view, true);\n            Assert.NotNull(view.DataContext);\n            Assert.IsType<MockViewModel>(view.DataContext);\n\n            Assert.NotNull(((MockViewModel)view.DataContext).MockService);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Container.Avalonia.Shared/Fixtures/Regions/RegionNavigationContentLoaderFixture.cs",
    "content": "﻿using System.Linq;\nusing Prism.Ioc;\nusing Prism.IocContainer.Avalonia.Tests.Support.Mocks.Views;\nusing Prism.Navigation.Regions;\nusing Xunit;\nusing static Prism.Container.Avalonia.Tests.ContainerHelper;\n\nnamespace Prism.Container.Avalonia.Tests.Regions\n{\n    [Collection(nameof(ContainerExtension))]\n    public class RegionNavigationContentLoaderFixture\n    {\n        readonly IContainerExtension _container;\n\n        public RegionNavigationContentLoaderFixture()\n        {\n            _container = CreateContainerExtension();\n            _container.RegisterInstance<IContainerExtension>(_container);\n            _container.Register<IRegionNavigationService, RegionNavigationService>();\n            _container.Register(typeof(IRegionNavigationContentLoader), typeof(RegionNavigationContentLoader));\n            _container.Register<IRegionNavigationJournal, RegionNavigationJournal>();\n            ContainerLocator.ResetContainer();\n            ContainerLocator.SetContainerExtension(_container);\n        }\n\n        [StaFact]\n        public void ShouldFindCandidateViewInRegion()\n        {\n            _container.RegisterForNavigation<MockView>();\n            //_container.RegisterType<object, MockView>(\"MockView\");\n\n            // We cannot access the UnityRegionNavigationContentLoader directly so we need to call its\n            // GetCandidatesFromRegion method through a navigation request.\n            IRegion testRegion = new Region();\n\n            MockView view = new MockView();\n            testRegion.Add(view);\n            testRegion.Deactivate(view);\n\n            Assert.True(((IContainerRegistry)_container).IsRegistered<object>(\"MockView\"));\n\n            testRegion.RequestNavigate(\"MockView\");\n\n            Assert.Contains(view, testRegion.Views);\n            Assert.Single(testRegion.Views);\n            Assert.Single(testRegion.ActiveViews);\n            Assert.Contains(view, testRegion.ActiveViews);\n        }\n\n        [StaFact]\n        public void ShouldFindCandidateViewWithFriendlyNameInRegion()\n        {\n            _container.RegisterForNavigation<MockView>(\"SomeView\");\n\n            // We cannot access the Container specific RegionNavigationContentLoader directly so we need to call its\n            // GetCandidatesFromRegion method through a navigation request.\n            IRegion testRegion = new Region();\n\n            var view = _container.Resolve<object>(\"SomeView\") as MockView;\n            testRegion.Add(view);\n            testRegion.Deactivate(view);\n\n            Assert.Empty(testRegion.ActiveViews);\n            testRegion.RequestNavigate(\"SomeView\");\n\n            Assert.Contains(view, testRegion.Views);\n            Assert.Single(testRegion.Views);\n            Assert.Single(testRegion.ActiveViews);\n            Assert.Contains(view, testRegion.ActiveViews);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Container.Avalonia.Shared/Mocks/NullModuleCatalogBootstrapper.cs",
    "content": "﻿using Avalonia;\nusing Prism.Ioc;\nusing Prism.Modularity;\n\nnamespace Prism.Container.Avalonia.Mocks\n{\n    internal partial class NullModuleCatalogBootstrapper\n    {\n        protected override IModuleCatalog CreateModuleCatalog()\n        {\n            return null;\n        }\n\n        protected override AvaloniaObject CreateShell()\n        {\n            return null;\n        }\n\n        protected override void RegisterTypes(IContainerRegistry containerRegistry)\n        {\n\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.Container.Avalonia.Shared/Prism.Container.Avalonia.Shared.projitems",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <PropertyGroup>\n    <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>\n    <HasSharedItems>true</HasSharedItems>\n    <SharedGUID>bd42a7d6-a84d-4d27-9c28-7f6a2ec477f1</SharedGUID>\n  </PropertyGroup>\n  <PropertyGroup Label=\"Configuration\">\n    <Import_RootNamespace>Prism.Container.Wpf.Tests</Import_RootNamespace>\n  </PropertyGroup>\n  <ItemGroup>\n    <Compile Include=\"$(MSBuildThisFileDirectory)Fixtures\\Application\\PrismApplicationFixture.cs\" />\n    <Compile Include=\"$(MSBuildThisFileDirectory)Fixtures\\ContainerExtensionCollection.cs\" />\n    <Compile Include=\"$(MSBuildThisFileDirectory)Fixtures\\Bootstrapper\\BootstrapperFixture.cs\" />\n    <Compile Include=\"$(MSBuildThisFileDirectory)Fixtures\\Bootstrapper\\BootstrapperNullModuleCatalogFixture.cs\" />\n    <Compile Include=\"$(MSBuildThisFileDirectory)Fixtures\\Bootstrapper\\BootstrapperRunMethodFixture.cs\" />\n    <Compile Include=\"$(MSBuildThisFileDirectory)Fixtures\\Ioc\\ContainerExtensionFixture.cs\" />\n    <Compile Include=\"$(MSBuildThisFileDirectory)Fixtures\\Ioc\\ContainerProviderExtensionFixture.cs\" />\n    <Compile Include=\"$(MSBuildThisFileDirectory)Mocks\\NullModuleCatalogBootstrapper.cs\" />\n    <Compile Include=\"$(MSBuildThisFileDirectory)Fixtures\\Mvvm\\ViewModelLocatorFixture.cs\" />\n    <Compile Include=\"$(MSBuildThisFileDirectory)Fixtures\\Regions\\RegionNavigationContentLoaderFixture.cs\" />\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "tests/Avalonia/Prism.Container.Avalonia.Shared/Prism.Container.Avalonia.Shared.shproj",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"15.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <PropertyGroup Label=\"Globals\">\n    <ProjectGuid>{6FDA7D49-DF44-4E8F-A182-0EB73DD3C452}</ProjectGuid>\n    <MinimumVisualStudioVersion>17.0</MinimumVisualStudioVersion>\n  </PropertyGroup>\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <Import Project=\"$(MSBuildExtensionsPath32)\\Microsoft\\VisualStudio\\v$(VisualStudioVersion)\\CodeSharing\\Microsoft.CodeSharing.Common.Default.props\" />\n  <Import Project=\"$(MSBuildExtensionsPath32)\\Microsoft\\VisualStudio\\v$(VisualStudioVersion)\\CodeSharing\\Microsoft.CodeSharing.Common.props\" />\n  <PropertyGroup />\n  <Import Project=\"Prism.Container.Avalonia.Shared.projitems\" Label=\"Shared\" />\n  <Import Project=\"$(MSBuildExtensionsPath32)\\Microsoft\\VisualStudio\\v$(VisualStudioVersion)\\CodeSharing\\Microsoft.CodeSharing.CSharp.targets\" />\n</Project>"
  },
  {
    "path": "tests/Avalonia/Prism.DryIoc.Avalonia.Tests/ContainerHelper.cs",
    "content": "﻿using System;\nusing DryIoc;\nusing Prism.Container.DryIoc;\nusing Prism.Ioc;\n\nnamespace Prism.Container.Avalonia.Tests\n{\n    public static class ContainerHelper\n    {\n        private static Rules CreateContainerRules() => Rules.Default.WithAutoConcreteTypeResolution()\n                                                                    .With(Made.Of(FactoryMethod.ConstructorWithResolvableArguments))\n                                                                    .WithDefaultIfAlreadyRegistered(IfAlreadyRegistered.Replace);\n\n        public static IContainer CreateContainer() =>\n            new global::DryIoc.Container(CreateContainerRules());\n\n        public static IContainerExtension CreateContainerExtension() =>\n        new DryIocContainerExtension(CreateContainer());\n\n        public static IContainer GetBaseContainer(this IContainerExtension container) =>\n            ((IContainerProvider)container).GetContainer();\n\n        public static IContainer GetBaseContainer(this IContainerProvider container) =>\n            container.GetContainer();\n\n        public static Type ContainerExtensionType => typeof(DryIocContainerExtension);\n\n        public static Type BaseContainerType => typeof(global::DryIoc.Container);\n\n        public static Type BaseContainerInterfaceType = typeof(IContainer);\n\n        public static Type RegisteredFrameworkException = typeof(ContainerException);\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.DryIoc.Avalonia.Tests/Fixtures/BootstrapperRunMethodFixture.cs",
    "content": "﻿using System;\nusing DryIoc;\nusing Moq;\nusing Prism.Container.DryIoc;\nusing Prism.Container.Avalonia.Mocks;\nusing Prism.DryIoc;\nusing Prism.Events;\nusing Prism.Ioc;\nusing Prism.Modularity;\nusing Prism.Navigation.Regions;\nusing Xunit;\n\nnamespace Prism.Container.Avalonia.Tests.Bootstrapper\n{\n    public partial class BootstrapperRunMethodFixture\n    {\n        [StaFact]\n        public void RunAddsCompositionContainerToContainer()\n        {\n            var bootstrapper = new MockBootstrapper();\n\n            var createdContainer = bootstrapper.CallCreateContainer();\n            var returnedContainer = createdContainer.Resolve<IContainer>();\n            Assert.NotNull(returnedContainer);\n            Assert.Equal(typeof(global::DryIoc.Container), returnedContainer.GetType());\n        }\n\n        [StaFact]\n        public void RunRegistersInstanceOfIModuleCatalog()\n        {\n            var mockedContainer = new Mock<IContainer>();\n            SetupMockedContainerForVerificationTests(mockedContainer);\n\n            var bootstrapper = new MockedContainerBootstrapper(mockedContainer.Object);\n\n            bootstrapper.Run();\n\n            mockedContainer.Verify(c => c.Register(It.IsAny<Factory>(), typeof(IModuleCatalog), It.IsAny<object>(), It.IsAny<IfAlreadyRegistered?>(), It.IsAny<bool>()));\n        }\n\n        [StaFact]\n        public void RunRegistersTypeForIModuleInitializer()\n        {\n            var mockedContainer = new Mock<IContainer>();\n            SetupMockedContainerForVerificationTests(mockedContainer);\n\n            var bootstrapper = new MockedContainerBootstrapper(mockedContainer.Object);\n\n            bootstrapper.Run();\n\n            mockedContainer.Verify(c => c.Register(It.IsAny<Factory>(), typeof(IModuleInitializer), null, It.IsAny<IfAlreadyRegistered?>(), It.IsAny<bool>()), Times.Once());\n        }\n\n        [StaFact]\n        public void RunRegistersTypeForIRegionManager()\n        {\n            var mockedContainer = new Mock<IContainer>();\n            SetupMockedContainerForVerificationTests(mockedContainer);\n\n            var bootstrapper = new MockedContainerBootstrapper(mockedContainer.Object);\n\n            bootstrapper.Run();\n\n            mockedContainer.Verify(c => c.Register(It.IsAny<Factory>(), typeof(IRegionManager), null, It.IsAny<IfAlreadyRegistered?>(), It.IsAny<bool>()), Times.Once());\n        }\n\n        [StaFact]\n        public void RunRegistersTypeForRegionAdapterMappings()\n        {\n            var mockedContainer = new Mock<IContainer>();\n            SetupMockedContainerForVerificationTests(mockedContainer);\n\n            var bootstrapper = new MockedContainerBootstrapper(mockedContainer.Object);\n\n            bootstrapper.Run();\n\n            mockedContainer.Verify(c => c.Register(It.IsAny<Factory>(), typeof(RegionAdapterMappings), null, It.IsAny<IfAlreadyRegistered?>(), It.IsAny<bool>()), Times.Once());\n        }\n\n        [StaFact]\n        public void RunRegistersTypeForIRegionViewRegistry()\n        {\n            var mockedContainer = new Mock<IContainer>();\n            SetupMockedContainerForVerificationTests(mockedContainer);\n\n            var bootstrapper = new MockedContainerBootstrapper(mockedContainer.Object);\n\n            bootstrapper.Run();\n\n            mockedContainer.Verify(c => c.Register(It.IsAny<Factory>(), typeof(IRegionViewRegistry), null, It.IsAny<IfAlreadyRegistered?>(), It.IsAny<bool>()), Times.Once());\n        }\n\n        [StaFact]\n        public void RunRegistersTypeForIRegionBehaviorFactory()\n        {\n            var mockedContainer = new Mock<IContainer>();\n            SetupMockedContainerForVerificationTests(mockedContainer);\n\n            var bootstrapper = new MockedContainerBootstrapper(mockedContainer.Object);\n\n            bootstrapper.Run();\n\n            mockedContainer.Verify(c => c.Register(It.IsAny<Factory>(), typeof(IRegionBehaviorFactory), null, It.IsAny<IfAlreadyRegistered?>(), It.IsAny<bool>()), Times.Once());\n        }\n\n        [StaFact]\n        public void RunRegistersTypeForIEventAggregator()\n        {\n            var mockedContainer = new Mock<IContainer>();\n            SetupMockedContainerForVerificationTests(mockedContainer);\n\n            var bootstrapper = new MockedContainerBootstrapper(mockedContainer.Object);\n\n            bootstrapper.Run();\n\n            mockedContainer.Verify(c => c.Register(It.IsAny<Factory>(), typeof(IEventAggregator), null, It.IsAny<IfAlreadyRegistered?>(), It.IsAny<bool>()), Times.Once());\n        }\n\n        [StaFact]\n        public void RunFalseShouldNotRegisterDefaultServicesAndTypes()\n        {\n            var mockedContainer = new Mock<IContainer>();\n            SetupMockedContainerForVerificationTests(mockedContainer);\n\n            var bootstrapper = new MockedContainerBootstrapper(mockedContainer.Object);\n            bootstrapper.Run(false);\n\n            mockedContainer.Verify(c => c.Register(It.IsAny<Factory>(), typeof(IEventAggregator), null, It.IsAny<IfAlreadyRegistered?>(), It.IsAny<bool>()), Times.Never());\n            mockedContainer.Verify(c => c.Register(It.IsAny<Factory>(), typeof(IRegionManager), null, It.IsAny<IfAlreadyRegistered?>(), It.IsAny<bool>()), Times.Never());\n            mockedContainer.Verify(c => c.Register(It.IsAny<Factory>(), typeof(RegionAdapterMappings), null, It.IsAny<IfAlreadyRegistered?>(), It.IsAny<bool>()), Times.Never());\n            mockedContainer.Verify(c => c.Register(It.IsAny<Factory>(), typeof(IModuleInitializer), null, It.IsAny<IfAlreadyRegistered?>(), It.IsAny<bool>()), Times.Never());\n        }\n\n        private static void SetupMockedContainerForVerificationTests(Mock<IContainer> mockedContainer)\n        {\n            var mockedModuleInitializer = new Mock<IModuleInitializer>();\n            var mockedModuleManager = new Mock<IModuleManager>();\n            var regionAdapterMappings = new RegionAdapterMappings();\n\n            var containerExtension = new DryIocContainerExtension(mockedContainer.Object);\n            var regionBehaviorFactory = new RegionBehaviorFactory(containerExtension);\n\n            mockedContainer.Setup(c => c.Register(It.IsAny<Factory>(), It.IsAny<Type>(), It.IsAny<string>(), It.IsAny<IfAlreadyRegistered?>(), It.IsAny<bool>()));\n\n            // NOTE: The actual method called by Prism's DryIocContainerExtension is off over the IResolver not IContainer\n            mockedContainer.As<IResolver>().Setup(r => r.Resolve(typeof(IModuleCatalog), It.IsAny<object>(), IfUnresolved.Throw, It.IsAny<Type>(), It.IsAny<Request>(), It.IsAny<object[]>())).Returns(\n                new ModuleCatalog());\n\n            mockedContainer.As<IResolver>().Setup(c => c.Resolve(typeof(IModuleInitializer), It.IsAny<object>(), IfUnresolved.Throw, It.IsAny<Type>(), It.IsAny<Request>(), It.IsAny<object[]>())).Returns(\n                mockedModuleInitializer.Object);\n\n            mockedContainer.As<IResolver>().Setup(c => c.Resolve(typeof(IModuleManager), It.IsAny<object>(), IfUnresolved.Throw, It.IsAny<Type>(), It.IsAny<Request>(), It.IsAny<object[]>())).Returns(\n                mockedModuleManager.Object);\n\n            mockedContainer.As<IResolver>().Setup(c => c.Resolve(typeof(RegionAdapterMappings), It.IsAny<object>(), IfUnresolved.Throw, It.IsAny<Type>(), It.IsAny<Request>(), It.IsAny<object[]>())).Returns(\n                regionAdapterMappings);\n\n            // TODO: Implement SelectorRegion\n            /////mockedContainer.As<IResolver>().Setup(c => c.Resolve(typeof(SelectorRegionAdapter), It.IsAny<object>(), IfUnresolved.Throw, It.IsAny<Type>(), It.IsAny<Request>(), It.IsAny<object[]>())).Returns(\n            /////    new SelectorRegionAdapter(regionBehaviorFactory));\n\n            mockedContainer.As<IResolver>().Setup(c => c.Resolve(typeof(ItemsControlRegionAdapter), It.IsAny<object>(), IfUnresolved.Throw, It.IsAny<Type>(), It.IsAny<Request>(), It.IsAny<object[]>())).Returns(\n                new ItemsControlRegionAdapter(regionBehaviorFactory));\n\n            mockedContainer.As<IResolver>().Setup(c => c.Resolve(typeof(ContentControlRegionAdapter), It.IsAny<object>(), IfUnresolved.Throw, It.IsAny<Type>(), It.IsAny<Request>(), It.IsAny<object[]>())).Returns(\n                new ContentControlRegionAdapter(regionBehaviorFactory));\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.DryIoc.Avalonia.Tests/Mocks/MockBootstrapper.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Reflection;\nusing Avalonia;\nusing Avalonia.Controls;\nusing DryIoc;\nusing Prism.Container.DryIoc;\nusing Prism.DryIoc;\nusing Prism.Ioc;\nusing Prism.Modularity;\nusing Prism.Navigation.Regions;\n\nnamespace Prism.Container.Avalonia.Mocks\n{\n    internal class MockBootstrapper : PrismBootstrapper\n    {\n        public List<string> MethodCalls = new List<string>();\n        public bool InitializeModulesCalled;\n        public bool ConfigureRegionAdapterMappingsCalled;\n        public RegionAdapterMappings DefaultRegionAdapterMappings;\n        public bool CreateModuleCatalogCalled;\n        public bool RegisterRequiredTypesCalled;\n        public bool RegisterTypesCalled;\n        public bool CreateShellCalled;\n        public bool CreateContainerCalled;\n        public bool ConfigureModuleCatalogCalled;\n        public bool InitializeShellCalled;\n        public bool OnInitializeCalled;\n        public bool ConfigureViewModelLocatorCalled;\n        public bool ConfigureDefaultRegionBehaviorsCalled;\n        public UserControl ShellObject = new UserControl();\n\n        public AvaloniaObject BaseShell => base.Shell;\n\n        public IContainer BaseContainer\n        {\n            get => base.Container?.GetContainer();\n        }\n\n        public IContainerExtension ContainerExtension => (IContainerExtension)base.Container;\n\n        public IContainerRegistry ContainerRegistry => (IContainerRegistry)base.Container;\n\n        public IContainer CallCreateContainer()\n        {\n            var containerExt = this.CreateContainerExtension();\n            return ((IContainerExtension<IContainer>)containerExt).Instance;\n        }\n\n        protected override AvaloniaObject CreateShell()\n        {\n            this.MethodCalls.Add(MethodBase.GetCurrentMethod().Name);\n            this.CreateShellCalled = true;\n            return ShellObject;\n        }\n\n        protected override void RegisterRequiredTypes(IContainerRegistry containerRegistry)\n        {\n            this.MethodCalls.Add(MethodBase.GetCurrentMethod().Name);\n            this.RegisterRequiredTypesCalled = true;\n            base.RegisterRequiredTypes(containerRegistry);\n        }\n\n        protected override void RegisterTypes(IContainerRegistry containerRegistry)\n        {\n            this.MethodCalls.Add(MethodBase.GetCurrentMethod().Name);\n            this.RegisterTypesCalled = true;\n        }\n\n        protected override void Initialize()\n        {\n            ContainerLocator.ResetContainer();\n            base.Initialize();\n        }\n\n        protected override IContainerExtension CreateContainerExtension()\n        {\n            this.MethodCalls.Add(MethodBase.GetCurrentMethod().Name);\n            this.CreateContainerCalled = true;\n            return base.CreateContainerExtension();\n        }\n\n        protected override void ConfigureViewModelLocator()\n        {\n            this.MethodCalls.Add(MethodBase.GetCurrentMethod().Name);\n            this.ConfigureViewModelLocatorCalled = true;\n            base.ConfigureViewModelLocator();\n        }\n\n        protected override IModuleCatalog CreateModuleCatalog()\n        {\n            this.MethodCalls.Add(MethodBase.GetCurrentMethod().Name);\n            this.CreateModuleCatalogCalled = true;\n            return base.CreateModuleCatalog();\n        }\n\n        protected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog)\n        {\n            this.MethodCalls.Add(MethodBase.GetCurrentMethod().Name);\n            this.ConfigureModuleCatalogCalled = true;\n            base.ConfigureModuleCatalog(moduleCatalog);\n        }\n\n        protected override void InitializeShell(AvaloniaObject shell)\n        {\n            this.MethodCalls.Add(MethodBase.GetCurrentMethod().Name);\n            this.InitializeShellCalled = true;\n            base.InitializeShell(shell);\n        }\n\n        protected override void OnInitialized()\n        {\n            this.MethodCalls.Add(MethodBase.GetCurrentMethod().Name);\n            this.OnInitializeCalled = true;\n            base.OnInitialized();\n        }\n\n        protected override void InitializeModules()\n        {\n            this.MethodCalls.Add(MethodBase.GetCurrentMethod().Name);\n            this.InitializeModulesCalled = true;\n            base.InitializeModules();\n        }\n\n        protected override void ConfigureDefaultRegionBehaviors(IRegionBehaviorFactory regionBehaviors)\n        {\n            this.MethodCalls.Add(MethodBase.GetCurrentMethod().Name);\n            this.ConfigureDefaultRegionBehaviorsCalled = true;\n            base.ConfigureDefaultRegionBehaviors(regionBehaviors);\n        }\n\n        protected override void ConfigureRegionAdapterMappings(RegionAdapterMappings regionAdapterMappings)\n        {\n            this.MethodCalls.Add(MethodBase.GetCurrentMethod().Name);\n            ConfigureRegionAdapterMappingsCalled = true;\n\n            base.ConfigureRegionAdapterMappings(regionAdapterMappings);\n\n            DefaultRegionAdapterMappings = regionAdapterMappings;\n        }\n\n        protected override void RegisterFrameworkExceptionTypes()\n        {\n            this.MethodCalls.Add(MethodBase.GetCurrentMethod().Name);\n            base.RegisterFrameworkExceptionTypes();\n        }\n\n        public void CallRegisterFrameworkExceptionTypes()\n        {\n            base.RegisterFrameworkExceptionTypes();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.DryIoc.Avalonia.Tests/Mocks/MockedContainerBootstrapper.cs",
    "content": "﻿using Avalonia;\nusing Avalonia.Controls;\nusing DryIoc;\nusing Prism.Container.DryIoc;\nusing Prism.DryIoc;\nusing Prism.Ioc;\n\nnamespace Prism.Container.Avalonia.Mocks\n{\n    internal class MockedContainerBootstrapper : PrismBootstrapper\n    {\n        private readonly IContainer _container;\n\n        public MockedContainerBootstrapper(IContainer container)\n        {\n            ContainerLocator.ResetContainer();\n            this._container = container;\n        }\n\n        bool _useDefaultConfiguration = true;\n\n        public void Run(bool useDefaultConfiguration)\n        {\n            _useDefaultConfiguration = useDefaultConfiguration;\n\n            base.Run();\n        }\n\n        protected override IContainerExtension CreateContainerExtension()\n        {\n            return new DryIocContainerExtension(_container);\n        }\n\n        protected override AvaloniaObject CreateShell()\n        {\n            return new UserControl();\n        }\n\n        protected override void InitializeShell(AvaloniaObject shell)\n        {\n\n        }\n\n        protected override void RegisterTypes(IContainerRegistry containerRegistry)\n        {\n\n        }\n\n        protected override void RegisterRequiredTypes(IContainerRegistry containerRegistry)\n        {\n            if (_useDefaultConfiguration)\n                base.RegisterRequiredTypes(containerRegistry);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.DryIoc.Avalonia.Tests/Mocks/NullLoggerBootstrapper.cs",
    "content": "﻿using System.Windows;\nusing Avalonia;\nusing Prism.DryIoc;\nusing Prism.Ioc;\n\nnamespace Prism.Container.Avalonia.Mocks\n{\n    internal partial class NullLoggerBootstrapper : PrismBootstrapper\n    {\n        protected override void RegisterTypes(IContainerRegistry containerRegistry)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        protected override AvaloniaObject CreateShell()\n        {\n            throw new System.NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.DryIoc.Avalonia.Tests/Mocks/NullModuleCatalogBootstrapper.cs",
    "content": "﻿using Prism.DryIoc;\n\nnamespace Prism.Container.Avalonia.Mocks\n{\n    internal partial class NullModuleCatalogBootstrapper : PrismBootstrapper\n    {\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.DryIoc.Avalonia.Tests/Prism.DryIoc.Avalonia.Tests.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFramework>net10.0</TargetFramework>\n\n    <IsPackable>false</IsPackable>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <!--<PackageReference Include=\"GitHubActionsTestLogger\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n    </PackageReference>-->\n    <PackageReference Include=\"Avalonia.Markup.Xaml.Loader\" />\n    <PackageReference Include=\"GitHubActionsTestLogger\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"Microsoft.NET.Test.Sdk\" />\n    <PackageReference Include=\"Moq\" />\n    <PackageReference Include=\"xunit\" />\n    <PackageReference Include=\"xunit.runner.visualstudio\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"coverlet.collector\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"Xunit.StaFact\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\..\\src\\Avalonia\\Prism.DryIoc.Avalonia\\Prism.DryIoc.Avalonia.csproj\" />\n    <ProjectReference Include=\"..\\Prism.IocContainer.Avalonia.Tests.Support\\Prism.IocContainer.Avalonia.Tests.Support.csproj\" />\n  </ItemGroup>\n\n  <Import Project=\"..\\Prism.Container.Avalonia.Shared\\Prism.Container.Avalonia.Shared.projitems\" Label=\"Shared\" />\n\n</Project>\n"
  },
  {
    "path": "tests/Avalonia/Prism.IocContainer.Avalonia.Tests.Support/BootstrapperFixtureBase.cs",
    "content": "﻿using System;\nusing Xunit;\n\nnamespace Prism.IocContainer.Avalonia.Tests.Support\n{\n    public class BootstrapperFixtureBase\n    {\n        protected static void AssertExceptionThrownOnRun(PrismBootstrapperBase bootstrapper, Type expectedExceptionType, string expectedExceptionMessageSubstring)\n        {\n            bool exceptionThrown = false;\n            try\n            {\n                bootstrapper.Run();\n            }\n            catch (Exception ex)\n            {\n                Assert.Equal(expectedExceptionType, ex.GetType());\n                Assert.Contains(expectedExceptionMessageSubstring, ex.Message);\n                exceptionThrown = true;\n            }\n\n            if (!exceptionThrown)\n            {\n                //Assert.Fail(\"Exception not thrown.\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.IocContainer.Avalonia.Tests.Support/Mocks/DependantA.cs",
    "content": "﻿\n\n\nnamespace Prism.IocContainer.Avalonia.Tests.Support.Mocks\n{\n    public class DependantA : IDependantA\n    {\n        public DependantA(IDependantB dependantB)\n        {\n            MyDependantB = dependantB;\n        }\n\n        public IDependantB MyDependantB { get; set; }\n    }\n\n    public interface IDependantA\n    {\n        IDependantB MyDependantB { get; }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.IocContainer.Avalonia.Tests.Support/Mocks/DependantB.cs",
    "content": "﻿\n\n\nnamespace Prism.IocContainer.Avalonia.Tests.Support.Mocks\n{\n    public class DependantB : IDependantB\n    {\n        public DependantB(IService service)\n        {\n            MyService = service;\n        }\n\n        public IService MyService { get; set; }\n    }\n\n    public interface IDependantB\n    {\n        IService MyService { get; }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.IocContainer.Avalonia.Tests.Support/Mocks/MockModuleLoader.cs",
    "content": "﻿using Prism.Modularity;\n\nnamespace Prism.IocContainer.Avalonia.Tests.Support.Mocks\n{\n    public class MockModuleInitializer : IModuleInitializer\n    {\n        public bool LoadCalled;\n\n        public void Initialize(IModuleInfo moduleInfo)\n        {\n            LoadCalled = true;\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.IocContainer.Avalonia.Tests.Support/Mocks/MockRegionManager.cs",
    "content": "﻿using System;\nusing Prism.Ioc;\nusing Prism.Navigation;\nusing Prism.Navigation.Regions;\n\nnamespace Prism.IocContainer.Avalonia.Tests.Support.Mocks\n{\n    public class MockRegionManager : IRegionManager\n    {\n        #region IRegionManager Members\n\n        public IRegionCollection Regions\n        {\n            get { throw new NotImplementedException(); }\n        }\n\n        public IRegionManager CreateRegionManager()\n        {\n            throw new NotImplementedException();\n        }\n\n        public IRegionManager AddToRegion(string regionName, object view)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IRegionManager RegisterViewWithRegion(string regionName, Type viewType)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IRegionManager RegisterViewWithRegion(string regionName, Func<object> getContentDelegate)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RequestNavigate(string regionName, Uri source, Action<NavigationResult> navigationCallback)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RequestNavigate(string regionName, Uri source)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RequestNavigate(string regionName, string source, Action<NavigationResult> navigationCallback)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RequestNavigate(string regionName, string source)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RequestNavigate(string regionName, Uri target, Action<NavigationResult> navigationCallback, INavigationParameters navigationParameters)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RequestNavigate(string regionName, string target, Action<NavigationResult> navigationCallback, INavigationParameters navigationParameters)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RequestNavigate(string regionName, Uri target, INavigationParameters navigationParameters)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RequestNavigate(string regionName, string target, INavigationParameters navigationParameters)\n        {\n            throw new NotImplementedException();\n        }\n\n        #endregion\n\n        public bool Navigate(Uri source)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IRegionManager AddToRegion(string regionName, string viewName)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IRegionManager RegisterViewWithRegion(string regionName, string viewName)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IRegionManager RegisterViewWithRegion(string regionName, Func<IContainerProvider, object> getContentDelegate)\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.IocContainer.Avalonia.Tests.Support/Mocks/MockService.cs",
    "content": "﻿namespace Prism.IocContainer.Avalonia.Tests.Support.Mocks\n{\n    public class MockService : IService\n    {\n    }\n\n    public interface IService { }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.IocContainer.Avalonia.Tests.Support/Mocks/ViewModels/MockViewModel.cs",
    "content": "﻿using Prism.Mvvm;\n\nnamespace Prism.IocContainer.Avalonia.Tests.Support.Mocks.ViewModels\n{\n    public class MockViewModel : BindableBase\n    {\n        private IService _mockService;\n        public IService MockService\n        {\n            get { return _mockService; }\n            set { SetProperty(ref _mockService, value); }\n        }\n\n        public MockViewModel(IService mockService)\n        {\n            _mockService = mockService;\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.IocContainer.Avalonia.Tests.Support/Mocks/Views/MockView.cs",
    "content": "﻿using Avalonia.Controls;\n\nnamespace Prism.IocContainer.Avalonia.Tests.Support.Mocks.Views\n{\n    public class MockView : Control\n    {\n    }\n}\n"
  },
  {
    "path": "tests/Avalonia/Prism.IocContainer.Avalonia.Tests.Support/Prism.IocContainer.Avalonia.Tests.Support.csproj",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFramework>net10.0</TargetFramework>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Avalonia\" />\n    <PackageReference Include=\"coverlet.collector\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"GitHubActionsTestLogger\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"Microsoft.NET.Test.Sdk\" />\n    <!--<PackageReference Include=\"GitHubActionsTestLogger\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n    </PackageReference>-->\n    <PackageReference Include=\"xunit\" />\n    <PackageReference Include=\"xunit.runner.visualstudio\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>\n    </PackageReference>\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\..\\src\\Avalonia\\Prism.Avalonia\\Prism.Avalonia.csproj\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "tests/Directory.Build.targets",
    "content": "<Project>\n  <PropertyGroup>\n    <NoWarn>$(NoWarn);CS0067</NoWarn>\n    <IsPackable>false</IsPackable>\n  </PropertyGroup>\n</Project>\n"
  },
  {
    "path": "tests/Maui/Directory.Build.props",
    "content": "<Project>\n  <Import Project=\"../../Directory.Build.props\" />\n\n  <PropertyGroup>\n    <ImplicitUsings>enable</ImplicitUsings>\n    <IsPackable>false</IsPackable>\n    <UseMaui>True</UseMaui>\n  </PropertyGroup>\n</Project>\n"
  },
  {
    "path": "tests/Maui/Directory.Build.targets",
    "content": "<Project>\n  <Import Project=\"../../src/Prism.Core/build/Package.targets\" />\n  <Import Project=\"../../src/Maui/Prism.Maui/build/Package.targets\" />\n\n  <ItemGroup>\n    <Using Include=\"Xunit\" />\n    <Using Include=\"Xunit.Abstractions\" />\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Fixtures/Behaviors/NavigationBehaviors.cs",
    "content": "using Microsoft.Maui.Controls;\nusing Prism.Controls;\nusing Prism.DryIoc.Maui.Tests.Mocks.ViewModels;\nusing Prism.DryIoc.Maui.Tests.Mocks.Views;\nusing Prism.Navigation.Builder;\n\nnamespace Prism.DryIoc.Maui.Tests.Fixtures.Behaviors;\n\npublic class NavigationBehaviors : TestBase\n{\n    public NavigationBehaviors(ITestOutputHelper testOutputHelper)\n        : base(testOutputHelper)\n    {\n    }\n\n    [Fact]\n    public void RootPageIsNotActive()\n    {\n        var rootPage = StartAndGetRootPage(\"NavigationPage/MockViewA/MockViewB\");\n\n        Assert.IsType<PrismNavigationPage>(rootPage);\n        var navPage = (NavigationPage)rootPage;\n\n        var viewA = navPage.Navigation.NavigationStack[0];\n        var viewB = navPage.Navigation.NavigationStack[1];\n\n        Assert.IsType<MockViewA>(viewA);\n        Assert.IsType<MockViewB>(viewB);\n\n        AssertIsActive(viewA, false);\n        AssertIsActive(viewB, true);\n    }\n\n    [Fact]\n    public void TabPageSetsFirstTabIsActive()\n    {\n        var rootPage = StartAndGetRootPage(b => b.AddTabbedSegment(t => t.CreateTab(\"MockViewA\").CreateTab(\"MockViewB\")));\n\n        Assert.IsType<TabbedPage>(rootPage);\n\n        var tabbed = (TabbedPage)rootPage;\n        AssertIsActive(tabbed.Children[0], true);\n        AssertIsActive(tabbed.Children[1], false);\n    }\n\n    [Fact]\n    public void TabPageSetsSecondTabIsActive()\n    {\n        var rootPage = StartAndGetRootPage(b => b.AddTabbedSegment(t => t.CreateTab(\"MockViewA\").CreateTab(\"MockViewB\").SelectedTab(\"MockViewB\")));\n\n        Assert.IsType<TabbedPage>(rootPage);\n\n        var tabbed = (TabbedPage)rootPage;\n        AssertIsActive(tabbed.Children[0], false);\n        AssertIsActive(tabbed.Children[1], true);\n    }\n\n    [Fact]\n    public void TabPageSetsFirstTabIsActiveWithNavigationPage()\n    {\n        var rootPage = StartAndGetRootPage(b => b.AddTabbedSegment(t => t.CreateTab(tb => tb.AddNavigationPage().AddSegment(\"MockViewA\")).CreateTab(tb => tb.AddNavigationPage().AddSegment(\"MockViewB\"))));\n\n        Assert.IsType<TabbedPage>(rootPage);\n\n        var tabbed = (TabbedPage)rootPage;\n\n        AssertIsActive(GetTabChild(tabbed, 0), true);\n        AssertIsActive(GetTabChild(tabbed, 1), false);\n    }\n\n    [Fact]\n    public void TabPageSetsSecondTabIsActiveWithNavigationPage()\n    {\n        var rootPage = StartAndGetRootPage(b =>\n            b.AddTabbedSegment(t =>\n                t.CreateTab(tb => tb.AddNavigationPage().AddSegment(\"MockViewA\"))\n                 .CreateTab(tb => tb.AddNavigationPage().AddSegment(\"MockViewB\"))\n                 .SelectedTab(\"NavigationPage|MockViewB\")));\n\n        Assert.IsType<TabbedPage>(rootPage);\n\n        var tabbed = (TabbedPage)rootPage;\n        AssertIsActive(GetTabChild(tabbed, 0), false);\n        AssertIsActive(GetTabChild(tabbed, 1), true);\n    }\n\n    private void AssertIsActive(Page page, bool expected)\n    {\n        var viewModel = (MockViewModelBase)page.BindingContext;\n        Assert.Equal(expected, viewModel.IsActive);\n    }\n\n    private Page GetTabChild(TabbedPage tabbed, int index)\n    {\n        var child = tabbed.Children[index];\n        Assert.IsType<PrismNavigationPage>(child);\n        var navPage = (NavigationPage)child;\n        return navPage.CurrentPage;\n    }\n\n    private Page StartAndGetRootPage(Action<INavigationBuilder> initialNav)\n    {\n        var mauiApp = CreateBuilder(prism => prism.CreateWindow((_, nav) =>\n        {\n            var navBuilder = nav.CreateBuilder();\n            initialNav(navBuilder);\n            return navBuilder.NavigateAsync();\n        }))\n            .Build();\n        var window = GetWindow(mauiApp);\n\n        var rootPage = window.Page;\n\n        Assert.NotNull(rootPage);\n        return rootPage;\n    }\n\n    private Page StartAndGetRootPage(string uri)\n    {\n        var mauiApp = CreateBuilder(prism => prism.CreateWindow(uri))\n            .Build();\n        var window = GetWindow(mauiApp);\n\n        var rootPage = window.Page;\n\n        Assert.NotNull(rootPage);\n        return rootPage;\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Fixtures/IoC/ContainerProviderTests.cs",
    "content": "using Prism.DryIoc.Maui.Tests.Mocks;\nusing Prism.DryIoc.Maui.Tests.Mocks.Events;\nusing Prism.DryIoc.Maui.Tests.Mocks.ViewModels;\nusing Prism.DryIoc.Maui.Tests.Mocks.Views;\nusing Prism.Events;\nusing Prism.IoC;\n\nnamespace Prism.DryIoc.Maui.Tests.Fixtures.IoC;\n\npublic class ContainerProviderTests(ITestOutputHelper testOutputHelper) : TestBase(testOutputHelper)\n{\n    [Fact]\n    public void CanResolveUnamedType()\n    {\n        var builder = CreateBuilder(prism => { });\n        var app = builder.Build();\n        var containerProvider = new ContainerProvider<ConcreteTypeMock>();\n\n        ConcreteTypeMock type = (ConcreteTypeMock)containerProvider;\n\n        Assert.NotNull(type);\n        Assert.IsType<ConcreteTypeMock>(type);\n    }\n\n    [Fact]\n    public void CanResolvedNamedType()\n    {\n        var builder = CreateBuilder(prism => { });\n        var app = builder.Build();\n        var containerProvider = new ContainerProvider<ConcreteTypeMock>\n        {\n            Name = ConcreteTypeMock.Key\n        };\n\n        ConcreteTypeMock vm = (ConcreteTypeMock)containerProvider;\n\n        Assert.NotNull(vm);\n        Assert.IsType<ConcreteTypeMock>(vm);\n    }\n\n    [Fact]\n    public async Task ProvidesValueFromResourceDictionary()\n    {\n        var builder = CreateBuilder(prism =>\n        {\n            prism.RegisterTypes(containerRegistry =>\n            {\n                containerRegistry.RegisterForNavigation<MockXamlView, MockXamlViewViewModel>();\n            })\n            .CreateWindow(n =>\n                n.CreateBuilder()\n                .AddSegment<MockViewAViewModel>()\n                .NavigateAsync());\n        });\n        var app = builder.Build();\n\n        var ea = app.Services.GetService<IEventAggregator>();\n        var events = new List<string>();\n        ea.GetEvent<TestActionEvent>().Subscribe((m) => events.Add(m));\n\n        var navigation = app.Services.GetService<INavigationService>();\n        await navigation.CreateBuilder()\n            .AddSegment<MockXamlViewViewModel>()\n            .NavigateAsync();\n\n        Assert.Contains(events, e => e == \"Convert\");\n        var window = GetWindow(app);\n        Assert.NotNull(window.Page);\n\n        var xamlView = window.Page as MockXamlView;\n        var viewModel = xamlView.BindingContext as MockXamlViewViewModel;\n\n        xamlView.TestEntry.Text = \"Foo Bar\";\n        Assert.Contains(events, e => e == \"ConvertBack\");\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Fixtures/Modularity/ModuleCatalogTests.cs",
    "content": "namespace Prism.DryIoc.Maui.Tests.Fixtures.Modularity;\n\npublic class ModuleCatalogTests(ITestOutputHelper testOutputHelper) : TestBase(testOutputHelper)\n{\n    public readonly IModuleInfo ModuleA = new ModuleInfo(typeof(MockModuleA));\n    public readonly IModuleInfo ModuleB = new ModuleInfo(typeof(MockModuleB));\n\n    [Fact]\n    public void UsesCustomModuleCatalog()\n    {\n        var builder = CreateBuilder(prism =>\n        {\n            prism.RegisterTypes(c => c.RegisterSingleton<IModuleCatalog, CustomMoudleCatalog>())\n                 .ConfigureModuleCatalog(catalog => { });\n        });\n        var app = builder.Build();\n\n        var moduleCatalog = app.Services.GetService<IModuleCatalog>();\n        Assert.NotNull(moduleCatalog);\n        Assert.IsType<CustomMoudleCatalog>(moduleCatalog);\n    }\n\n    [Fact]\n    public void InjectsModulesFromDI()\n    {\n        var builder = CreateBuilder(prism =>\n        {\n            prism.RegisterTypes(c => c.RegisterInstance<IModuleInfo>(ModuleA))\n                 .ConfigureModuleCatalog(c => { });\n        });\n        var app = builder.Build();\n\n        var moduleCatalog = app.Services.GetService<IModuleCatalog>();\n        Assert.Single(moduleCatalog.Modules);\n        Assert.Equal(ModuleA.ModuleType, moduleCatalog.Modules.Single().ModuleType);\n    }\n\n    [Fact]\n    public void InjectsModulesFromConfigureDelegate()\n    {\n        var builder = CreateBuilder(prism =>\n            prism.ConfigureModuleCatalog(c => c.AddModule<MockModuleA>()));\n        var app = builder.Build();\n\n        var moduleCatalog = app.Services.GetService<IModuleCatalog>();\n        Assert.Single(moduleCatalog.Modules);\n        Assert.Equal(ModuleA.ModuleType, moduleCatalog.Modules.Single().ModuleType);\n    }\n\n    [Fact]\n    public void CombinesModulesFromConfigureMethodAndDI()\n    {\n        var builder = CreateBuilder(prism =>\n        {\n            prism.RegisterTypes(c => c.RegisterInstance<IModuleInfo>(ModuleA))\n                 .ConfigureModuleCatalog(c => c.AddModule<MockModuleB>());\n        });\n        var app = builder.Build();\n\n        var moduleCatalog = app.Services.GetService<IModuleCatalog>();\n        Assert.Equal(2, moduleCatalog.Modules.Count());\n        Assert.Contains(ModuleA.ModuleType, moduleCatalog.Modules.Select(m => m.ModuleType));\n        Assert.Contains(ModuleB.ModuleType, moduleCatalog.Modules.Select(m => m.ModuleType));\n    }\n\n    public class CustomMoudleCatalog : ModuleCatalogBase { }\n\n    public class MockModuleA : IModule\n    {\n        public void OnInitialized(IContainerProvider containerProvider)\n        {\n        }\n\n        public void RegisterTypes(IContainerRegistry containerRegistry)\n        {\n        }\n    }\n\n    public class MockModuleB : IModule\n    {\n        public void OnInitialized(IContainerProvider containerProvider)\n        {\n        }\n\n        public void RegisterTypes(IContainerRegistry containerRegistry)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Fixtures/Navigation/DynamicTabbedPageNavigationFixture.cs",
    "content": "﻿using Prism.Controls;\nusing Prism.DryIoc.Maui.Tests.Mocks.Views;\n\nnamespace Prism.DryIoc.Maui.Tests.Fixtures.Navigation;\n\npublic class DynamicTabbedPageNavigationFixture : TestBase\n{\n    public DynamicTabbedPageNavigationFixture(ITestOutputHelper testOutputHelper)\n        : base(testOutputHelper)\n    {\n    }\n\n    [Fact]\n    public void CreatesTabs_WithSingleContentPage()\n    {\n        var mauiApp = CreateBuilder(prism => prism.CreateWindow(navigation =>\n        navigation.CreateBuilder()\n            .AddTabbedSegment(t =>\n                t.CreateTab(\"MockViewA\")\n                    .CreateTab(\"MockViewB\"))\n            .NavigateAsync())).Build();\n        var window = GetWindow(mauiApp);\n        Assert.IsType<TabbedPage>(window.Page);\n        var tabbedPage = window.Page as TabbedPage;\n\n        Assert.Equal(2, tabbedPage.Children.Count);\n        Assert.IsType<MockViewA>(tabbedPage.Children[0]);\n        Assert.IsType<MockViewB>(tabbedPage.Children[1]);\n\n        Assert.Same(tabbedPage.Children[0], tabbedPage.CurrentPage);\n    }\n    \n    [Fact]\n    public void CreatesTab_WithTitleAndSingleContentPage()\n    {\n        var mauiApp = CreateBuilder(prism => prism.CreateWindow(navigation =>\n            navigation.CreateBuilder()\n                .AddTabbedSegment(t =>\n                {\n                    t.Title(\"MyTitle\");\n                    t.CreateTab(\"MockViewA\");\n                })\n                .NavigateAsync())).Build();\n        \n        var window = GetWindow(mauiApp);\n        Assert.IsType<TabbedPage>(window.Page);\n        var tabbedPage = (TabbedPage)window.Page;\n        Assert.Single(tabbedPage.Children);\n        Assert.IsType<MockViewA>(tabbedPage.Children[0]);\n        Assert.Equal(\"MyTitle\", window.Page.Title);\n    }\n\n    [Fact]\n    public void CreatesTabs_WithNavigationPageAndContentPage()\n    {\n        var mauiApp = CreateBuilder(prism => prism.CreateWindow(navigation =>\n            navigation.CreateBuilder()\n                .AddTabbedSegment(t =>\n                    t.CreateTab(ct => ct.AddNavigationPage().AddSegment(\"MockViewA\"))\n                     .CreateTab(ct => ct.AddNavigationPage().AddSegment(\"MockViewB\")))\n                .NavigateAsync())).Build();\n        var window = GetWindow(mauiApp);\n        Assert.IsType<TabbedPage>(window.Page);\n        var tabbedPage = window.Page as TabbedPage;\n\n        Assert.Equal(2, tabbedPage.Children.Count);\n        Assert.IsType<PrismNavigationPage>(tabbedPage.Children[0]);\n        var tab0 = tabbedPage.Children[0] as NavigationPage;\n        Assert.IsType<MockViewA>(tab0.CurrentPage);\n        Assert.IsType<PrismNavigationPage>(tabbedPage.Children[1]);\n        var tab1 = tabbedPage.Children[1] as NavigationPage;\n        Assert.IsType<MockViewB>(tab1.CurrentPage);\n\n        Assert.Same(tabbedPage.Children[0], tabbedPage.CurrentPage);\n    }\n    \n    [Fact]\n    public void CreatesTabs_WithNavigationPageAndContentPageTitlesSet()\n    {\n        var mauiApp = CreateBuilder(prism => prism.CreateWindow(navigation =>\n            navigation.CreateBuilder()\n                .AddTabbedSegment(t =>\n                {\n                    t.Title(\"MyTitle\");\n                    t.CreateTab(ct => ct.AddNavigationPage().AddSegment(\"MockViewA\"))\n                        .CreateTab(ct => ct.AddNavigationPage().AddSegment(\"MockViewB\"));\n                })\n                .NavigateAsync())).Build();\n        var window = GetWindow(mauiApp);\n        Assert.IsType<TabbedPage>(window.Page);\n        var tabbedPage = (TabbedPage)window.Page;\n\n        Assert.Equal(2, tabbedPage.Children.Count);\n        Assert.IsType<PrismNavigationPage>(tabbedPage.Children[0]);\n        var tab0 = (NavigationPage)tabbedPage.Children[0];\n        Assert.IsType<MockViewA>(tab0.CurrentPage);\n        Assert.IsType<PrismNavigationPage>(tabbedPage.Children[1]);\n        var tab1 = (NavigationPage)tabbedPage.Children[1];\n        Assert.IsType<MockViewB>(tab1.CurrentPage);\n\n        Assert.Same(tabbedPage.Children[0], tabbedPage.CurrentPage);\n        Assert.Equal(\"MyTitle\", tabbedPage.Title);\n        Assert.Equal(MockViewA.ExpectedTitle, tab0.Title);\n        Assert.Equal(MockViewB.ExpectedTitle, tab1.Title);\n    }\n\n    [Fact]\n    public async Task NavigatesModally_FromChild_OfNavigationPageTab()\n    {\n        var mauiApp = CreateBuilder(prism => prism.CreateWindow(navigation =>\n            navigation.CreateBuilder()\n                .AddTabbedSegment(t =>\n                    t.CreateTab(ct => ct.AddNavigationPage().AddSegment(\"MockViewA\"))\n                     .CreateTab(ct => ct.AddNavigationPage().AddSegment(\"MockViewB\")))\n                .NavigateAsync())).Build();\n        var window = GetWindow(mauiApp);\n        Assert.IsType<TabbedPage>(window.Page);\n        var tabbedPage = window.Page as TabbedPage;\n\n        Assert.IsType<PrismNavigationPage>(tabbedPage.CurrentPage);\n        var navPage = (PrismNavigationPage)tabbedPage.CurrentPage;\n        Assert.Empty(navPage.Navigation.ModalStack);\n\n        var navService = Prism.Navigation.Xaml.Navigation.GetNavigationService(navPage.CurrentPage);\n        var result = await navService.CreateBuilder()\n            .AddSegment(\"MockViewC\", useModalNavigation: true)\n            .NavigateAsync();\n\n        Assert.True(result.Success);\n\n        Assert.Single(navPage.Navigation.ModalStack);\n\n        var modalNavService = Prism.Navigation.Xaml.Navigation.GetNavigationService(navPage.Navigation.ModalStack[0]);\n\n        result = await modalNavService.NavigateAsync(\"MockViewD\");\n        Assert.True(result.Success);\n\n        Assert.Equal(2, navPage.Navigation.ModalStack.Count);\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Fixtures/Navigation/NavigationSelectTabTests.cs",
    "content": "using Prism.Controls;\nusing Prism.DryIoc.Maui.Tests.Mocks.ViewModels;\nusing Prism.DryIoc.Maui.Tests.Mocks.Views;\n\nnamespace Prism.DryIoc.Maui.Tests.Fixtures.Navigation;\n\npublic class NavigationSelectTabTests : TestBase\n{\n    public NavigationSelectTabTests(ITestOutputHelper testOutputHelper) \n        : base(testOutputHelper)\n    {\n    }\n\n    [Fact]\n    public async Task SelectsTab_NavigatesWithinTab_NavigationPage()\n    {\n        var mauiApp = CreateBuilder(prism => prism\n            .RegisterTypes(c => c.RegisterForNavigation<ForcedView>())\n            .CreateWindow(\"TabbedPage?createTab=MockViewA&createTab=NavigationPage%2FMockViewB\"))\n            .Build();\n        var window = GetWindow(mauiApp);\n\n        Assert.IsType<MockViewA>(window.CurrentPage);\n        var navigationService = Prism.Navigation.Xaml.Navigation.GetNavigationService(window.CurrentPage);\n        var result = await navigationService.SelectTabAsync(\"NavigationPage|MockViewB\", \"MockViewC/MockViewD\");\n\n        Assert.True(result.Success);\n        Assert.Null(result.Exception);\n\n        Assert.IsType<TabbedPage>(window.Page);\n        var tabbedPage = window.Page as TabbedPage;\n        Assert.IsType<PrismNavigationPage>(tabbedPage.CurrentPage);\n        var navPage = tabbedPage.CurrentPage as PrismNavigationPage;\n        Assert.IsType<MockViewB>(navPage.RootPage);\n        Assert.IsType<MockViewD>(navPage.CurrentPage);\n        Assert.Equal(3, navPage.Navigation.NavigationStack.Count);\n    }\n\n    [Fact]\n    public async Task TabbedPage_SelectTabSets_CurrentTab()\n    {\n        var mauiApp = CreateBuilder(prism => prism.CreateWindow(\"TabbedPage?createTab=MockViewA&createTab=MockViewB&selectedTab=MockViewB\"))\n            .Build();\n        var window = GetWindow(mauiApp);\n\n        Assert.IsAssignableFrom<TabbedPage>(window.Page);\n        var tabbedPage = (TabbedPage)window.Page;\n        Assert.NotNull(tabbedPage);\n        Assert.IsType<MockViewB>(tabbedPage.CurrentPage);\n    }\n\n    [Fact]\n    public async Task TabbedPage_SelectTab_SetsCurrentTab_WithNavigationPageTab()\n    {\n        var mauiApp = CreateBuilder(prism => prism.CreateWindow(\"TabbedPage?createTab=NavigationPage%2FMockViewA&createTab=NavigationPage%2FMockViewB&selectedTab=NavigationPage|MockViewB\"))\n            .Build();\n        var window = GetWindow(mauiApp);\n\n        Assert.IsAssignableFrom<TabbedPage>(window.Page);\n        var tabbedPage = (TabbedPage)window.Page;\n        Assert.NotNull(tabbedPage);\n        var navPage = tabbedPage.CurrentPage as NavigationPage;\n        Assert.NotNull(navPage);\n        Assert.IsType<MockViewB>(navPage.CurrentPage);\n    }\n\n    [Fact]\n    public async Task TabbedPage_SelectsNewTab()\n    {\n        var mauiApp = CreateBuilder(prism => prism\n            .CreateWindow(nav => nav.CreateBuilder()\n                .AddTabbedSegment(s => s.CreateTab(\"MockViewA\")\n                                                       .CreateTab(\"MockViewB\")\n                                                       .CreateTab(\"MockViewC\"))\n                .NavigateAsync()))\n            .Build();\n        var window = GetWindow(mauiApp);\n        Assert.IsAssignableFrom<TabbedPage>(window.Page);\n        var tabbed = window.Page as TabbedPage;\n\n        Assert.NotNull(tabbed);\n\n        Assert.IsType<MockViewA>(tabbed.CurrentPage);\n        var mockViewA = tabbed.CurrentPage;\n        var mockViewANav = Prism.Navigation.Xaml.Navigation.GetNavigationService(mockViewA);\n\n        await mockViewANav.SelectTabAsync(\"MockViewB\");\n\n        Assert.IsNotType<MockViewA>(tabbed.CurrentPage);\n        Assert.IsType<MockViewB>(tabbed.CurrentPage);\n    }\n\n    [Fact]\n    public async Task TabbedPage_SelectsNewTab_WithNavigationParameters()\n    {\n        var mauiApp = CreateBuilder(prism => prism\n            .CreateWindow(nav => nav.CreateBuilder()\n                .AddTabbedSegment(s => s.CreateTab(\"MockViewA\")\n                                                       .CreateTab(\"MockViewB\")\n                                                       .CreateTab(\"MockViewC\"))\n                .NavigateAsync()))\n            .Build();\n        var window = GetWindow(mauiApp);\n        Assert.IsAssignableFrom<TabbedPage>(window.Page);\n        var tabbed = window.Page as TabbedPage;\n\n        Assert.NotNull(tabbed);\n\n        Assert.IsType<MockViewA>(tabbed.CurrentPage);\n        var mockViewA = tabbed.CurrentPage;\n        var mockViewANav = Prism.Navigation.Xaml.Navigation.GetNavigationService(mockViewA);\n\n        var expectedMessage = nameof(TabbedPage_SelectsNewTab_WithNavigationParameters);\n        await mockViewANav.SelectTabAsync(\"MockViewB\", new NavigationParameters { { \"Message\", expectedMessage } });\n\n        Assert.IsNotType<MockViewA>(tabbed.CurrentPage);\n        Assert.IsType<MockViewB>(tabbed.CurrentPage);\n\n        var viewModel = tabbed.CurrentPage.BindingContext as MockViewBViewModel;\n        Assert.Equal(expectedMessage, viewModel?.Message);\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Fixtures/Navigation/NavigationTests.cs",
    "content": "using Prism.Behaviors;\nusing Prism.Common;\nusing Prism.Controls;\nusing Prism.DryIoc.Maui.Tests.Mocks.Navigation;\nusing Prism.DryIoc.Maui.Tests.Mocks.ViewModels;\nusing Prism.DryIoc.Maui.Tests.Mocks.Views;\nusing Prism.Navigation.Xaml;\nusing Prism.Navigation;\nusing Prism.Xaml;\nusing TabbedPage = Microsoft.Maui.Controls.TabbedPage;\nusing Microsoft.Maui.LifecycleEvents;\n\nnamespace Prism.DryIoc.Maui.Tests.Fixtures.Navigation;\n\npublic class NavigationTests : TestBase\n{\n    public NavigationTests(ITestOutputHelper testOutputHelper)\n        : base(testOutputHelper)\n    {\n    }\n\n    [Theory]\n    [InlineData(\"NavigationPage/MockViewA/MockViewB/MockViewC\")]\n    [InlineData(\"MockHome/NavigationPage/MockViewA\")]\n    [InlineData(\"MockExplicitTabbedPage\")]\n    [InlineData(\"TabbedPage?createTab=NavigationPage%2FMockViewA%2FMockViewB%3Fid%3D5%2FMockViewC&createTab=MockViewD\")]\n    [InlineData(\"NavigationPage/MockViewB/TabbedPage?createTab=MockViewA/MockViewC\")]\n    public void PagesInjectScopedInstanceOfIPageAccessor(string uri)\n    {\n        var mauiApp = CreateBuilder(prism => prism.CreateWindow(uri))\n            .Build();\n        var window = GetWindow(mauiApp);\n\n        var rootPage = window.Page;\n\n        if (rootPage is FlyoutPage flyoutPage)\n        {\n            TestPage(flyoutPage);\n            rootPage = flyoutPage.Detail;\n        }\n\n        TestPage(rootPage!);\n\n        foreach (var page in rootPage!.Navigation.NavigationStack)\n        {\n            TestPage(page);\n        }\n    }\n\n    [Fact]\n    public async Task ViewModelLocator_Forced_SetsContainer_ResolvedViewModel()\n    {\n        var mauiApp = CreateBuilder(prism => prism\n            .RegisterTypes(c => c.RegisterForNavigation<ForcedView>())\n            .CreateWindow(\"ForcedView\"))\n            .Build();\n        var window = GetWindow(mauiApp);\n\n        Assert.IsType<ForcedView>(window.Page);\n        Assert.IsType<ForcedViewModel>(window.Page.BindingContext);\n\n        var viewModel = (ForcedViewModel)window.Page.BindingContext;\n        Assert.NotNull(viewModel.Page);\n        Assert.IsType<ForcedView>(viewModel.Page);\n    }\n\n    [Fact]\n    public async Task AddsPageFromRelativeURI()\n    {\n        var mauiApp = CreateBuilder(prism => prism.CreateWindow(\"NavigationPage/MockViewA\"))\n            .Build();\n        var window = GetWindow(mauiApp);\n\n        var rootPage = window.Page as NavigationPage;\n        Assert.NotNull(rootPage);\n        TestPage(rootPage);\n        var currentPage = rootPage.CurrentPage;\n        Assert.IsType<MockViewA>(currentPage);\n        TestPage(currentPage);\n        var container = currentPage.GetContainerProvider();\n        var navService = container.Resolve<INavigationService>();\n        Assert.Single(rootPage.Navigation.NavigationStack);\n        await navService.NavigateAsync(\"MockViewB\");\n        Assert.IsType<MockViewB>(rootPage.CurrentPage);\n        TestPage(rootPage.CurrentPage);\n        Assert.Equal(2, rootPage.Navigation.NavigationStack.Count);\n\n        var pushes = navService.GetPushes();\n        Assert.Single(pushes);\n        Assert.Equal(currentPage, pushes[0].CurrentPage);\n        Assert.Equal(rootPage.CurrentPage, pushes[0].Page);\n        Assert.Null(pushes[0].Animated);\n    }\n\n    [Fact]\n    public async Task RelativeNavigation_RemovesPage_AndNavigates()\n    {\n        var mauiApp = CreateBuilder(prism => prism.CreateWindow(\"NavigationPage/MockViewA/MockViewB\"))\n            .Build();\n        var window = GetWindow(mauiApp);\n\n        var rootPage = window.Page as NavigationPage;\n        Assert.NotNull(rootPage);\n        TestPage(rootPage);\n        var currentPage = rootPage.CurrentPage;\n        Assert.IsType<MockViewB>(currentPage);\n        TestPage(currentPage);\n        var container = currentPage.GetContainerProvider();\n        var navService = container.Resolve<INavigationService>();\n        Assert.Equal(2, rootPage.Navigation.NavigationStack.Count);\n        await navService.NavigateAsync(\"../MockViewC\");\n        Assert.IsType<MockViewC>(rootPage.CurrentPage);\n        TestPage(rootPage.CurrentPage);\n        Assert.Equal(2, rootPage.Navigation.NavigationStack.Count);\n    }\n\n    [Fact(Timeout = 5000)]\n    public async Task Issue3047_RelativeNavigation_RemovesPage_AndGoBack()\n    {\n        var mauiApp = CreateBuilder(prism => prism.CreateWindow(\"NavigationPage/MockViewA/MockViewB\"))\n            .Build();\n        var window = GetWindow(mauiApp);\n\n        var rootPage = window.Page as NavigationPage;\n        Assert.NotNull(rootPage);\n        TestPage(rootPage);\n        var currentPage = rootPage.CurrentPage;\n        Assert.IsType<MockViewB>(currentPage);\n        TestPage(currentPage);\n        var container = currentPage.GetContainerProvider();\n        var navService = container.Resolve<INavigationService>();\n        Assert.Equal(2, rootPage.Navigation.NavigationStack.Count);\n        await navService.NavigateAsync(\"../\");\n        Assert.IsType<MockViewA>(rootPage.CurrentPage);\n        TestPage(rootPage.CurrentPage);\n        Assert.Single(rootPage.Navigation.NavigationStack);\n    }\n\n    [Fact]\n    public async Task AbsoluteNavigation_ResetsWindowPage()\n    {\n        var mauiApp = CreateBuilder(prism => prism.CreateWindow(\"MockViewA\"))\n            .Build();\n        var window = GetWindow(mauiApp);\n\n        var rootPage = window.Page as MockViewA;\n        Assert.NotNull(rootPage);\n        var container = rootPage.GetContainerProvider();\n        var navService = container.Resolve<INavigationService>();\n        var result = await navService.NavigateAsync(\"/MockViewB\");\n        Assert.True(result.Success);\n        Assert.NotEqual(rootPage, window.Page);\n    }\n\n    [Fact]\n    public async Task AddsModalPageFromRelativeURI()\n    {\n        var mauiApp = CreateBuilder(prism => prism.CreateWindow(\"MockViewA\"))\n            .Build();\n        var window = GetWindow(mauiApp);\n\n        var rootPage = window.Page as MockViewA;\n        Assert.NotNull(rootPage);\n        Assert.IsType<MockViewA>(rootPage);\n        var container = rootPage.GetContainerProvider();\n        var navService = container.Resolve<INavigationService>();\n        Assert.Empty(rootPage.Navigation.ModalStack);\n        var result = await navService.NavigateAsync(\"MockViewB\");\n        Assert.True(result.Success);\n        Assert.Single(rootPage.Navigation.ModalStack);\n        Assert.IsType<MockViewB>(rootPage.Navigation.ModalStack.Last());\n    }\n\n    [Fact]\n    public async Task FlyoutRelativeNavigation_RemovesPage_AndNavigatesNotModally()\n    {\n        var mauiApp = CreateBuilder(prism => prism.CreateWindow(\"MockHome/NavigationPage/MockViewA\"))\n            .Build();\n        var window = GetWindow(mauiApp);\n\n        var rootPage = window.Page as MockHome;\n        Assert.NotNull(rootPage);\n        TestPage(rootPage);\n        Assert.NotNull(rootPage.Detail);\n        var detailPage = rootPage.Detail as NavigationPage;\n        Assert.NotNull(detailPage);\n        TestPage(detailPage);\n        var currentPage = detailPage.CurrentPage;\n        Assert.IsType<MockViewA>(currentPage);\n        TestPage(currentPage);\n        var navService = Prism.Navigation.Xaml.Navigation.GetNavigationService(rootPage);\n        Assert.Empty(rootPage.Navigation.ModalStack);\n        var result = await navService.NavigateAsync(\"./NavigationPage/MockViewB\");\n        Assert.True(result.Success);\n        Assert.Empty(rootPage.Navigation.ModalStack);\n        Assert.NotNull(rootPage.Detail);\n        detailPage = rootPage.Detail as NavigationPage;\n        Assert.NotNull(detailPage);\n        TestPage(detailPage);\n        currentPage = detailPage.CurrentPage;\n        Assert.IsType<MockViewB>(currentPage);\n        TestPage(currentPage);\n    }\n\n    [Fact]\n    public void MAUI_Issue_8157_InitialNavigation_PushesModals()\n    {\n        Exception startupEx = null;\n        var mauiApp = CreateBuilder(prism => prism.CreateWindow(\"MockViewA/MockViewB\", ex =>\n        {\n            startupEx = ex;\n        }))\n            .Build();\n        Assert.Null(startupEx);\n        var window = GetWindow(mauiApp);\n\n        Assert.IsType<MockViewA>(window.Page);\n        TestPage(window.Page);\n        var currentPage = window.CurrentPage;\n        Assert.IsType<MockViewB>(currentPage);\n        TestPage(currentPage);\n    }\n\n    [Fact(Skip = \"No longer blocked by dotnet/maui/issues/8157. Not yet implemented.\")]\n    public async Task RelativeNavigation_RemovesPage_AndNavigatesModally()\n    {\n        Exception startupEx = null;\n        var mauiApp = CreateBuilder(prism => prism.CreateWindow(\"MockViewA/MockViewB\", ex =>\n        {\n            startupEx = ex;\n        }))\n            .Build();\n        Assert.Null(startupEx);\n        var window = GetWindow(mauiApp);\n\n        Assert.IsType<MockViewA>(window.Page);\n        TestPage(window.Page);\n        var currentPage = window.CurrentPage;\n        Assert.IsType<MockViewB>(currentPage);\n        TestPage(currentPage);\n        var navService = Prism.Navigation.Xaml.Navigation.GetNavigationService(currentPage);\n        Assert.Single(window.Page.Navigation.ModalStack);\n        var result = await navService.NavigateAsync(\"../MockViewC\");\n        Assert.True(result.Success);\n        Assert.Null(result.Exception);\n        Assert.IsType<MockViewC>(window.CurrentPage);\n        Assert.Single(window.Page.Navigation.ModalStack);\n    }\n\n    [Fact]\n    public async Task GoBack_Name_PopsToSpecifiedView()\n    {\n        var mauiApp = CreateBuilder(prism => prism.CreateWindow(\"NavigationPage/MockViewA/MockViewB/MockViewC/MockViewD/MockViewE\"))\n            .Build();\n        var window = GetWindow(mauiApp);\n\n        Assert.IsAssignableFrom<NavigationPage>(window.Page);\n        var navigationPage = (NavigationPage)window.Page;\n\n        Assert.IsType<MockViewA>(navigationPage.RootPage);\n        Assert.IsType<MockViewE>(navigationPage.CurrentPage);\n\n        var result = await navigationPage.CurrentPage.GetContainerProvider()\n            .Resolve<INavigationService>()\n            .GoBackToAsync(\"MockViewC\");\n\n        Assert.True(result.Success);\n\n        Assert.IsType<MockViewC>(navigationPage.CurrentPage);\n    }\n\n    [Fact]\n    public async Task GoBack_ViewModel_PopsToSpecifiedView()\n    {\n        var mauiApp = CreateBuilder(prism => prism.CreateWindow(\"NavigationPage/MockViewA/MockViewB/MockViewC/MockViewD/MockViewE\"))\n            .Build();\n        var window = GetWindow(mauiApp);\n\n        Assert.IsAssignableFrom<NavigationPage>(window.Page);\n        var navigationPage = (NavigationPage)window.Page;\n\n        Assert.IsType<MockViewA>(navigationPage.RootPage);\n        Assert.IsType<MockViewE>(navigationPage.CurrentPage);\n\n        var result = await navigationPage.CurrentPage.GetContainerProvider()\n            .Resolve<INavigationService>()\n            .CreateBuilder()\n            .GoBackToAsync<MockViewCViewModel>();\n\n        Assert.True(result.Success);\n\n        Assert.IsType<MockViewC>(navigationPage.CurrentPage);\n    }\n\n    [Fact]\n    public async Task GoBack_Issue2232()\n    {\n        var mauiApp = CreateBuilder(prism => prism.CreateWindow(\"NavigationPage/MockViewA\"))\n            .Build();\n        var window = GetWindow(mauiApp);\n\n        Assert.IsAssignableFrom<NavigationPage>(window.Page);\n        var navigationPage = (NavigationPage)window.Page;\n\n        await MvvmHelpers.InvokeViewAndViewModelActionAsync<MockViewModelBase>(navigationPage.CurrentPage, x => x.NavigateTo(\"MockViewB\"));\n        Assert.IsType<MockViewB>(navigationPage.CurrentPage);\n        await MvvmHelpers.InvokeViewAndViewModelActionAsync<MockViewModelBase>(navigationPage.CurrentPage, x => x.NavigateTo(\"MockViewC\"));\n        Assert.IsType<MockViewC>(navigationPage.CurrentPage);\n        await MvvmHelpers.InvokeViewAndViewModelActionAsync<MockViewModelBase>(navigationPage.CurrentPage, x => x.NavigateTo(\"MockViewD/MockViewE\"));\n        Assert.IsType<MockViewE>(navigationPage.CurrentPage);\n\n        await MvvmHelpers.InvokeViewAndViewModelActionAsync<MockViewModelBase>(navigationPage.CurrentPage, x => x.GoBack());\n        Assert.IsType<MockViewD>(navigationPage.CurrentPage);\n        await MvvmHelpers.InvokeViewAndViewModelActionAsync<MockViewModelBase>(navigationPage.CurrentPage, x => x.GoBack());\n        Assert.IsType<MockViewC>(navigationPage.CurrentPage);\n        await MvvmHelpers.InvokeViewAndViewModelActionAsync<MockViewModelBase>(navigationPage.CurrentPage, x => x.GoBack());\n        Assert.IsType<MockViewB>(navigationPage.CurrentPage);\n        await MvvmHelpers.InvokeViewAndViewModelActionAsync<MockViewModelBase>(navigationPage.CurrentPage, x => x.GoBack());\n        Assert.IsType<MockViewA>(navigationPage.CurrentPage);\n    }\n\n    [Fact]\n    public async Task GoBack_Name_PopsToSpecifiedViewWithoutPoppingEachPage()\n    {\n        var mauiApp = CreateBuilder(prism => prism.CreateWindow(\"NavigationPage/MockViewA/MockViewB/MockViewC/MockViewD/MockViewE\"))\n            .Build();\n        var window = GetWindow(mauiApp);\n\n        Assert.IsAssignableFrom<NavigationPage>(window.Page);\n        var navigationPage = (NavigationPage)window.Page;\n        var withoutPoppingPage = (MockViewD)navigationPage.Navigation.NavigationStack.First(p => ViewModelLocator.GetNavigationName(p) == nameof(MockViewD));\n        var withoutPoppingPageVm = (MockViewModelBase)withoutPoppingPage.BindingContext;\n\n        Assert.IsType<MockViewA>(navigationPage.RootPage);\n        Assert.IsType<MockViewE>(navigationPage.CurrentPage);\n\n        var result = await navigationPage.CurrentPage.GetContainerProvider()\n            .Resolve<INavigationService>()\n            .GoBackToAsync(\"MockViewC\");\n\n        Assert.True(result.Success);\n\n        Assert.IsType<MockViewC>(navigationPage.CurrentPage);\n\n        // In the GoBackAsync method, the OnNavigatedTo method is not called for pages that are not popped.\n        Assert.True(withoutPoppingPageVm.Actions.Last() == nameof(MockViewModelBase.OnNavigatedFrom));\n    }\n\n    [Fact]\n    public async Task GoBack_Name_PopsToSpecifiedViewWithoutPoppingEachPageOfLimitation()\n    {\n        var mauiApp = CreateBuilder(prism => prism.CreateWindow(\"NavigationPage/MockViewA/MockViewA/MockViewB/MockViewC/MockViewD/MockViewE\"))\n            .Build();\n        var window = GetWindow(mauiApp);\n\n        Assert.IsAssignableFrom<NavigationPage>(window.Page);\n        var navigationPage = (NavigationPage)window.Page;\n\n        Assert.IsType<MockViewA>(navigationPage.RootPage);\n        Assert.IsType<MockViewE>(navigationPage.CurrentPage);\n\n        var result = await navigationPage.CurrentPage.GetContainerProvider()\n            .Resolve<INavigationService>()\n            .GoBackToAsync(\"MockViewA\");\n\n        Assert.True(result.Success);\n\n        Assert.IsType<MockViewA>(navigationPage.CurrentPage);\n\n        // If there are two instances of MockViewA, it will return to the instance closest to the current page.\n        // Therefore, the current modal stack will be in the state of NavigationPage/MockViewA/MockViewA.\n        Assert.Equal(2, navigationPage.Navigation.NavigationStack.Count);\n    }\n\n    [Fact]\n    public async Task NavigationPage_DoesNotHave_MauiPage_AsRootPage()\n    {\n        var mauiApp = CreateBuilder(prism => prism\n            .CreateWindow(\"NavigationPage/MockViewA\"))\n            .Build();\n        var window = GetWindow(mauiApp);\n\n        Assert.IsAssignableFrom<NavigationPage>(window.Page);\n        var navPage = window.Page as NavigationPage;\n\n        Assert.NotNull(navPage);\n        Assert.IsNotType<Page>(navPage.RootPage);\n        Assert.IsType<MockViewA>(navPage.RootPage);\n\n        Assert.Same(navPage.RootPage, navPage.CurrentPage);\n    }\n\n    [Fact]\n    public async Task NavigationPage_UsesRootPageTitle_WithTabbedParent()\n    {\n        var mauiApp = CreateBuilder(prism => prism\n            .CreateWindow(n => n.CreateBuilder()\n                .AddTabbedSegment(s => s\n                    .CreateTab(t => t.AddNavigationPage()\n                                                .AddSegment(\"MockViewA\")))\n                .NavigateAsync()))\n            .Build();\n        var window = GetWindow(mauiApp);\n        Assert.IsAssignableFrom<TabbedPage>(window.Page);\n        var tabbed = window.Page as TabbedPage;\n\n        Assert.NotNull(tabbed);\n\n        Assert.Single(tabbed.Children);\n        var child = tabbed.Children[0];\n        Assert.IsAssignableFrom<NavigationPage>(child);\n        var navPage = child as NavigationPage;\n\n        Assert.Equal(navPage.Title, navPage.RootPage.Title);\n        Assert.Equal(MockViewA.ExpectedTitle, navPage.Title);\n    }\n    \n    [Fact]\n    public async Task NavigationPage_UsesTabbedPageTitle()\n    {\n        var mauiApp = CreateBuilder(prism => prism\n                .CreateWindow(n => n.CreateBuilder()\n                    .AddNavigationPage()\n                    .AddTabbedSegment(s => s\n                        .CreateTab(\"MockViewA\"))\n                    .NavigateAsync()))\n            .Build();\n        \n        var window = GetWindow(mauiApp);\n        Assert.IsAssignableFrom<NavigationPage>(window.Page);\n        var navPage = window.Page as NavigationPage;\n        Assert.IsAssignableFrom<TabbedPage>(navPage.RootPage);\n        var tabbed = navPage.RootPage as TabbedPage;\n\n        Assert.NotNull(tabbed);\n        Assert.Single(tabbed.Children);\n        Assert.Equal(navPage.Title, tabbed.Title);\n    }\n    \n    [Fact]\n    public async Task NavigationPage_OverrideTabbedPageTitle()\n    {\n        var mauiApp = CreateBuilder(prism => prism\n                .CreateWindow(n => n.CreateBuilder()\n                    .AddNavigationPage()\n                    .AddTabbedSegment(s =>\n                        {\n                            s.CreateTab(\"MockViewA\");\n                            s.Title(\"MyTitle\");\n                        })\n                    .NavigateAsync()))\n            .Build();\n        \n        var window = GetWindow(mauiApp);\n        Assert.IsAssignableFrom<NavigationPage>(window.Page);\n        var navPage = window.Page as NavigationPage;\n        Assert.IsAssignableFrom<TabbedPage>(navPage.RootPage);\n        var tabbed = navPage.RootPage as TabbedPage;\n\n        Assert.NotNull(tabbed);\n        Assert.Single(tabbed.Children);\n        Assert.Equal(\"MyTitle\", tabbed.Title);\n    }\n\n    [Fact]\n    public async Task Navigation_HasDefault_AnimatedIsNull()\n    {\n        var mauiApp = CreateBuilder(prism => prism\n            .CreateWindow(n => n.CreateBuilder()\n                .AddNavigationPage()\n                .AddSegment(\"MockViewA\")))\n            .Build();\n        var window = GetWindow(mauiApp);\n        var navigationPage = (NavigationPage)window.Page;\n        var rootPage = navigationPage.RootPage;\n\n        var navigationService = Prism.Navigation.Xaml.Navigation.GetNavigationService(rootPage);\n        var pushes = navigationService.GetPushes();\n\n        Assert.Empty(pushes);\n\n        var result = await navigationService.NavigateAsync(\"MockViewB\");\n\n        Assert.True(result.Success);\n        Assert.Single(pushes);\n        var push = pushes[0];\n\n        Assert.IsType<MockViewA>(push.CurrentPage);\n        Assert.IsType<MockViewB>(push.Page);\n\n        Assert.Equal(navigationPage.RootPage, push.CurrentPage);\n        Assert.Equal(navigationPage.CurrentPage, push.Page);\n\n        Assert.Null(push.Animated);\n    }\n\n    [Fact]\n    public async Task Navigation_Animation_IsTrue()\n    {\n        var mauiApp = CreateBuilder(prism => prism\n            .CreateWindow(n => n.CreateBuilder()\n                .AddNavigationPage()\n                .AddSegment(\"MockViewA\")))\n            .Build();\n        var window = GetWindow(mauiApp);\n        var navigationPage = (NavigationPage)window.Page;\n        var rootPage = navigationPage.RootPage;\n\n        var navigationService = Prism.Navigation.Xaml.Navigation.GetNavigationService(rootPage);\n        var pushes = navigationService.GetPushes();\n\n        Assert.Empty(pushes);\n\n        var result = await navigationService.NavigateAsync($\"MockViewB?{KnownNavigationParameters.Animated}=true\");\n\n        Assert.True(result.Success);\n        Assert.Single(pushes);\n        var push = pushes[0];\n\n        Assert.IsType<MockViewA>(push.CurrentPage);\n        Assert.IsType<MockViewB>(push.Page);\n\n        Assert.Equal(navigationPage.RootPage, push.CurrentPage);\n        Assert.Equal(navigationPage.CurrentPage, push.Page);\n\n        Assert.True(push.Animated);\n    }\n\n    [Fact]\n    public async Task Navigation_Animation_IsFalse()\n    {\n        var mauiApp = CreateBuilder(prism => prism\n            .CreateWindow(n => n.CreateBuilder()\n                .AddNavigationPage()\n                .AddSegment(\"MockViewA\")))\n            .Build();\n        var window = GetWindow(mauiApp);\n        var navigationPage = (NavigationPage)window.Page;\n        var rootPage = navigationPage.RootPage;\n\n        var navigationService = Prism.Navigation.Xaml.Navigation.GetNavigationService(rootPage);\n        var pushes = navigationService.GetPushes();\n\n        Assert.Empty(pushes);\n\n        var result = await navigationService.NavigateAsync($\"MockViewB?{KnownNavigationParameters.Animated}=false\");\n\n        Assert.True(result.Success);\n        Assert.Single(pushes);\n        var push = pushes[0];\n\n        Assert.IsType<MockViewA>(push.CurrentPage);\n        Assert.IsType<MockViewB>(push.Page);\n\n        Assert.Equal(navigationPage.RootPage, push.CurrentPage);\n        Assert.Equal(navigationPage.CurrentPage, push.Page);\n\n        Assert.False(push.Animated);\n    }\n\n    [Theory]\n    [InlineData(\"MockViewA\", \"MockViewB\", null)]\n    [InlineData(\"NavigationPage/MockViewA\", \"MockViewB?useModalNavigation=true\", true)]\n    public async Task PushesModally(string startUri, string requestUri, bool? expectedUseModal)\n    {\n        var mauiApp = CreateBuilder(prism => prism\n            .CreateWindow(n => n.NavigateAsync(startUri)))\n            .Build();\n        var window = GetWindow(mauiApp);\n        var page = window.Page;\n        if (page is NavigationPage navPage)\n            page = navPage.RootPage;\n\n        var navService = Prism.Navigation.Xaml.Navigation.GetNavigationService(page);\n\n        var result = await navService.NavigateAsync(requestUri);\n        Assert.True(result.Success);\n\n        var pushes = navService.GetPushes();\n        Assert.Single(pushes);\n        var push = pushes[0];\n\n        var parameters = UriParsingHelper.GetSegmentParameters(requestUri);\n        bool? useModalNavigation = null;\n        if (parameters.TryGetValue<bool>(KnownNavigationParameters.UseModalNavigation, out var parameterModal))\n            useModalNavigation = parameterModal;\n\n        Assert.Equal(expectedUseModal, push.UseModalNavigation);\n        Assert.True(PageNavigationService.UseModalNavigation(push.CurrentPage, useModalNavigation));\n    }\n\n    [Fact]\n    public async Task PushesModally_From_NavigationParameters()\n    {\n        var mauiApp = CreateBuilder(prism => prism\n            .CreateWindow(n => n.NavigateAsync(\"NavigationPage/MockViewA\")))\n            .Build();\n        var window = GetWindow(mauiApp);\n        var page = window.Page;\n        if (page is NavigationPage navPage)\n            page = navPage.RootPage;\n\n        var navService = Prism.Navigation.Xaml.Navigation.GetNavigationService(page);\n\n        var result = await navService.NavigateAsync(\"MockViewB\", new NavigationParameters { { KnownNavigationParameters.UseModalNavigation, true } });\n        Assert.True(result.Success);\n\n        var pushes = navService.GetPushes();\n        Assert.Single(pushes);\n        var push = pushes[0];\n\n        Assert.True(push.UseModalNavigation);\n    }\n\n    [Fact]\n    public async Task DeepLinked_ModalNavigationPage_GoesBackToPreviousPage()\n    {\n        var mauiApp = CreateBuilder(prism => prism\n            .CreateWindow(n => n.CreateBuilder()\n                .AddSegment(\"MockViewA\")\n                .AddNavigationPage()\n                .AddSegment(\"MockViewB\")\n                .AddSegment(\"MockViewC\")\n                .AddSegment(\"MockViewD\")\n                .NavigateAsync()))\n            .Build();\n\n        var window = GetWindow(mauiApp);\n        var page = window.CurrentPage;\n\n        Assert.IsType<MockViewA>(window.Page);\n        Assert.IsType<MockViewD>(page);\n        var navigationService = Prism.Navigation.Xaml.Navigation.GetNavigationService(page);\n        var result = await navigationService.GoBackAsync();\n\n        Assert.True(result.Success);\n        Assert.IsType<MockViewC>(window.CurrentPage);\n    }\n\n    [Fact]\n    public async Task DeepLinked_ModalNavigationPage_GoesBackToRoot()\n    {\n        var mauiApp = CreateBuilder(prism => prism\n            .CreateWindow(n => n.CreateBuilder()\n                .AddSegment(\"MockViewA\")\n                .AddNavigationPage()\n                .AddSegment(\"MockViewB\")\n                .AddSegment(\"MockViewC\")\n                .AddSegment(\"MockViewD\")\n                .NavigateAsync()))\n            .Build();\n\n        var window = GetWindow(mauiApp);\n        var page = window.CurrentPage;\n\n        Assert.IsType<MockViewA>(window.Page);\n        Assert.IsType<MockViewD>(page);\n        var navigationService = Prism.Navigation.Xaml.Navigation.GetNavigationService(page);\n        var result = await navigationService.GoBackToRootAsync();\n\n        Assert.True(result.Success);\n        Assert.IsType<MockViewB>(window.CurrentPage);\n    }\n\n    [Fact]\n    public async Task DeepLinked_ModalNavigationPage_GoesBackToPreviousPage_AsTabbedChild()\n    {\n        var mauiApp = CreateBuilder(prism => prism\n            .CreateWindow(n => n.CreateBuilder()\n                .AddSegment(\"MockViewA\")\n                .AddTabbedSegment(s => s.CreateTab(t =>\n                    t.AddNavigationPage().AddSegment(\"MockViewB\").AddSegment(\"MockViewC\"))\n                    .CreateTab(\"MockViewD\"))\n                .NavigateAsync()))\n            .Build();\n\n        var window = GetWindow(mauiApp);\n        var page = window.CurrentPage;\n\n        Assert.IsType<MockViewA>(window.Page);\n        Assert.IsType<MockViewC>(page);\n        var navigationService = Prism.Navigation.Xaml.Navigation.GetNavigationService(page);\n        var result = await navigationService.GoBackAsync();\n\n        Assert.True(result.Success);\n        Assert.IsType<MockViewB>(window.CurrentPage);\n    }\n\n    [Theory]\n    [InlineData(\"NavigationPage|MockViewB\", typeof(MockViewB))]\n    [InlineData(\"MockViewC\", typeof(MockViewC))]\n    public void Navigate_And_SelectTab(string selectTab, Type viewType)\n    {\n        var mauiApp = CreateBuilder(prism => prism\n            .CreateWindow(n => n.NavigateAsync($\"MockExplicitTabbedPage?{KnownNavigationParameters.SelectedTab}={selectTab}\")))\n            .Build();\n        var window = GetWindow(mauiApp);\n        var page = window.Page;\n\n        Assert.IsType<MockExplicitTabbedPage>(page);\n        var tabbed = page as MockExplicitTabbedPage;\n\n        var child = tabbed.CurrentPage;\n        if (child is NavigationPage navPage)\n        {\n            child = navPage.RootPage;\n        }\n\n        Assert.IsType(viewType, child);\n    }\n\n    [Fact]\n    public async Task Issue3123_GoBack_SendsAppToBackground()\n    {\n        var errorInvoked = false;\n        var mauiApp = CreateBuilder(prism => prism\n        .AddGlobalNavigationObserver(context => context.Subscribe(x =>\n        {\n            //this error message is used in this unit test to know that the SendAppToBackground method was called\n            //for Android we send the app to the background and do not throw the exception, otherwise we throw and quit the app\n            if (!x.Result.Success && x.Result?.Exception?.Message == NavigationException.CannotPopApplicationMainPage)\n                errorInvoked = true;\n        }))\n        .CreateWindow(nav => nav.CreateBuilder()\n            .AddTabbedSegment(page =>\n                    page.CreateTab(t =>\n                        t.AddNavigationPage()\n                            .AddSegment(\"MockViewA\")\n                            .AddSegment(\"MockViewB\")))\n            .NavigateAsync()))\n        .Build();\n        var window = GetWindow(mauiApp);\n\n        var tabbedPage = window.Page as TabbedPage;\n        Assert.NotNull(tabbedPage);\n\n        var currentPage = tabbedPage.CurrentPage;\n        Assert.IsType<PrismNavigationPage>(currentPage);\n        Assert.Equal(2, currentPage.Navigation.NavigationStack.Count);\n\n        var navPage = (PrismNavigationPage)currentPage;\n        Assert.IsType<MockViewB>(navPage.CurrentPage);\n\n        var container = navPage.CurrentPage.GetContainerProvider();\n        var navService = container.Resolve<INavigationService>();\n        await navService.GoBackAsync();\n\n        Assert.False(errorInvoked);\n        Assert.IsType<MockViewA>(navPage.CurrentPage);\n        Assert.Single(currentPage.Navigation.NavigationStack);\n\n        container = navPage.CurrentPage.GetContainerProvider();\n        navService = container.Resolve<INavigationService>();\n        await navService.GoBackAsync();\n\n        Assert.True(errorInvoked);\n    }\n\n    private static void TestPage(Page page, bool ignoreNavigationPage = false)\n    {\n        Assert.NotNull(page.BindingContext);\n        var container = Prism.Navigation.Xaml.Navigation.GetContainerProvider(page);\n        Assert.IsAssignableFrom<IScopedProvider>(container);\n\n        TestPageBehaviors(page);\n\n        var accessor = container.Resolve<IPageAccessor>();\n        Assert.NotNull(accessor.Page);\n        Assert.Same(page, accessor.Page);\n\n        if (page.Parent is not null)\n        {\n            Assert.False(page.BindingContext == page);\n            Assert.False(page.BindingContext == page.Parent);\n            Assert.False(page.BindingContext == page.Parent.BindingContext);\n        }\n\n        if (page is NavigationPage)\n        {\n            if (!ignoreNavigationPage)\n            {\n                Assert.IsType<PrismNavigationPage>(page);\n            }\n\n            return;\n        }\n\n        if (page is TabbedPage tabbedPage)\n        {\n            foreach (var child in tabbedPage.Children)\n            {\n                TestPage(child, tabbedPage is MockExplicitTabbedPage);\n\n                if (child is NavigationPage childNavigationPage)\n                {\n                    var root = childNavigationPage.RootPage;\n                    Assert.Equal(DynamicTab.GetTitle(root), childNavigationPage.Title);\n                    Assert.Equal(DynamicTab.GetIconImageSource(root), child.IconImageSource);\n\n                    switch (root)\n                    {\n                        case MockViewA viewA:\n                            Assert.Equal(MockViewA.ExpectedTitle, DynamicTab.GetTitle(viewA));\n                            break;\n                        case MockViewB viewB:\n                            Assert.Equal(MockViewB.ExpectedTitle, DynamicTab.GetTitle(viewB));\n                            break;\n                        case MockViewC viewC:\n                            Assert.NotEqual(MockViewC.ExpectedTitle, DynamicTab.GetTitle(viewC));\n                            Assert.Equal(MockViewC.ExpectedDynamicTitle, DynamicTab.GetTitle(viewC));\n                            break;\n                    }\n                }\n            }\n            return;\n        }\n\n        var viewModel = page.BindingContext as MockViewModelBase;\n        Assert.NotNull(viewModel);\n        Assert.Same(page, viewModel!.Page);\n    }\n\n    private static void TestPageBehaviors(Page page)\n    {\n        var expectedBehaviors = page switch\n        {\n            TabbedPage => 4,\n            NavigationPage => 6,\n            _ => 3\n        };\n\n        Assert.Equal(expectedBehaviors, page.Behaviors.Count);\n\n        switch (page)\n        {\n            case TabbedPage:\n                TestTabbedPageBehaviors(page);\n                break;\n            case NavigationPage:\n                TestNavigationPageBehaviors(page);\n                break;\n        }\n\n        Assert.NotNull(page.Behaviors.OfType<PageScopeBehavior>().SingleOrDefault());\n        Assert.NotNull(page.Behaviors.OfType<RegionCleanupBehavior>().SingleOrDefault());\n        Assert.NotNull(page.Behaviors.OfType<PageLifeCycleAwareBehavior>().SingleOrDefault());\n    }\n\n    private static void TestTabbedPageBehaviors(Page page)\n    {\n        Assert.NotNull(page.Behaviors.OfType<TabbedPageActiveAwareBehavior>().SingleOrDefault());\n    }\n\n    private static void TestNavigationPageBehaviors(Page page)\n    {\n        Assert.NotNull(page.Behaviors.OfType<NavigationPageActiveAwareBehavior>().SingleOrDefault());\n        Assert.NotNull(page.Behaviors.OfType<NavigationPageSystemGoBackBehavior>().SingleOrDefault());\n        Assert.NotNull(page.Behaviors.OfType<NavigationPageTabbedParentBehavior>().SingleOrDefault());\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Fixtures/Navigation/PrismWindowTests.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Prism.Controls;\nusing Prism.DryIoc.Maui.Tests.Mocks.Views;\n\nnamespace Prism.DryIoc.Maui.Tests.Fixtures.Navigation;\n\npublic class PrismWindowTests : TestBase\n{\n    public PrismWindowTests(ITestOutputHelper testOutputHelper) \n        : base(testOutputHelper)\n    {\n    }\n\n    [Fact]\n    public void CurrentPageEqualsRootPage()\n    {\n        var mauiApp = CreateBuilder(prism => prism.CreateWindow(\"MockViewA\"))\n            .Build();\n        var window = GetWindow(mauiApp);\n\n        Assert.IsType<MockViewA>(window.CurrentPage);\n        Assert.IsType<MockViewA>(window.Page);\n        Assert.True(window.IsRootPage);\n    }\n\n    [Fact]\n    public void CurrentPage_FromNavigationPage_EqualsRootPage()\n    {\n        var mauiApp = CreateBuilder(prism => prism.CreateWindow(\"NavigationPage/MockViewA\"))\n            .Build();\n        var window = GetWindow(mauiApp);\n\n        Assert.IsType<MockViewA>(window.CurrentPage);\n        Assert.IsType<PrismNavigationPage>(window.Page);\n        Assert.True(window.IsRootPage);\n    }\n\n    [Fact]\n    public void CurrentPage_FromNavigationPage_IsNotRootPage()\n    {\n        var mauiApp = CreateBuilder(prism => prism.CreateWindow(\"NavigationPage/MockViewA/MockViewB\"))\n            .Build();\n        var window = GetWindow(mauiApp);\n\n        Assert.IsType<MockViewB>(window.CurrentPage);\n        Assert.IsType<PrismNavigationPage>(window.Page);\n        Assert.False(window.IsRootPage);\n    }\n\n    [Fact]\n    public void CurrentPage_IsRoot_FromTabbedPage_WithNavigationPageTab()\n    {\n        var mauiApp = CreateBuilder(prism => prism.CreateWindow(n =>\n            n.CreateBuilder()\n             .AddTabbedSegment(b => b.CreateTab(t => t.AddNavigationPage().AddSegment(\"MockViewA\"))\n                .CreateTab(\"MockViewB\")).NavigateAsync()))\n             .Build();\n        var window = GetWindow(mauiApp);\n\n        Assert.IsType<MockViewA>(window.CurrentPage);\n        Assert.IsType<TabbedPage>(window.Page);\n        Assert.True(window.IsRootPage);\n    }\n\n    [Fact]\n    public void CurrentPage_IsNotRoot_FromTabbedPage_WithDeepLinkedNavigationPageTab()\n    {\n        var mauiApp = CreateBuilder(prism => prism.CreateWindow(n =>\n            n.CreateBuilder()\n             .AddTabbedSegment(b => b.CreateTab(t => \n                    t.AddNavigationPage()\n                     .AddSegment(\"MockViewA\")\n                     .AddSegment(\"MockViewC\"))\n                .CreateTab(\"MockViewB\")).NavigateAsync()))\n             .Build();\n        var window = GetWindow(mauiApp);\n\n        Assert.IsType<MockViewC>(window.CurrentPage);\n        Assert.IsType<TabbedPage>(window.Page);\n        Assert.False(window.IsRootPage);\n    }\n\n    [Fact]\n    public void CurrentPage_IsRoot_WithFlyoutPage()\n    {\n        var mauiApp = CreateBuilder(prism => prism.CreateWindow(n =>\n            n.CreateBuilder()\n             .AddSegment(\"MockHome\")\n             .AddNavigationPage()\n             .AddSegment(\"MockViewA\")\n             .NavigateAsync()))\n            .Build();\n\n        var window = GetWindow(mauiApp);\n\n        Assert.IsType<MockViewA>(window.CurrentPage);\n        Assert.IsType<MockHome>(window.Page);\n        Assert.True(window.IsRootPage);\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Fixtures/Navigation/WindowManagerTests.cs",
    "content": "﻿\nusing Prism.Navigation.Xaml;\n\nnamespace Prism.DryIoc.Maui.Tests.Fixtures.Navigation;\n\npublic class WindowManagerTests : TestBase\n{\n    public WindowManagerTests(ITestOutputHelper testOutputHelper)\n        : base(testOutputHelper)\n    {\n    }\n\n    [Theory]\n    [InlineData(\"NavigationPage/MockViewA/MockViewB/MockViewC\")]\n    [InlineData(\"MockHome/NavigationPage/MockViewA\")]\n    public void WindowManagerGetsNavigationServiceFromCurrentPage(string uri)\n    {\n        var mauiApp = CreateBuilder(prism => prism.CreateWindow(uri))\n            .Build();\n        var window = GetWindow(mauiApp);\n\n        var rootPage = window.Page;\n        var currentPage = rootPage;\n        if (rootPage is NavigationPage navigationPage)\n        {\n            currentPage = navigationPage.CurrentPage;\n        }\n        if (rootPage is FlyoutPage flyoutPage && flyoutPage.Detail is NavigationPage detailPage)\n        {\n            currentPage = detailPage.CurrentPage;\n        }\n\n        var currentNavigationService = Prism.Navigation.Xaml.Navigation.GetNavigationService(currentPage);\n        var windowManager = rootPage.GetContainerProvider().Resolve<IWindowManager>();\n        Assert.Same(currentNavigationService, windowManager.GetCurrentNavigationService());\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Fixtures/Regions/RegionBehaviorFixture.cs",
    "content": "using Prism.DryIoc.Maui.Tests.Mocks.Regions.Behaviors;\nusing Prism.Navigation.Regions.Behaviors;\n\nnamespace Prism.DryIoc.Maui.Tests.Fixtures.Regions;\npublic class RegionBehaviorFixture : TestBase\n{\n    public RegionBehaviorFixture(ITestOutputHelper testOutputHelper)\n        : base(testOutputHelper)\n    {\n    }\n\n    [Fact]\n    public void ExistingBehavior_IsReplaced_WithCustomBehavior()\n    {\n        var mauiApp = CreateBuilder(prism => prism\n            .ConfigureRegionBehaviors(behaviors =>\n            {\n                behaviors.AddOrReplace<RegionBehaviorBMock>(RegionBehaviorAMock.BehaviorKey);\n            }))\n            .Build();\n\n        var regionBehaviorFactory = mauiApp.Services.GetRequiredService<IRegionBehaviorFactory>();\n\n        Assert.NotEmpty(regionBehaviorFactory);\n        Assert.Contains(regionBehaviorFactory, x => x == RegionBehaviorAMock.BehaviorKey);\n        Assert.DoesNotContain(regionBehaviorFactory, x => x == RegionBehaviorBMock.BehaviorKey);\n        Assert.IsType<RegionBehaviorBMock>(regionBehaviorFactory.CreateFromKey(RegionBehaviorAMock.BehaviorKey));\n    }\n\n    [Fact]\n    public void MissingBehavior_IsAdded()\n    {\n        var mauiApp = CreateBuilder(prism => prism\n            .ConfigureRegionBehaviors(behaviors =>\n            {\n                behaviors.AddOrReplace<RegionBehaviorAMock>(RegionBehaviorAMock.BehaviorKey);\n            }))\n            .Build();\n\n        var regionBehaviorFactory = mauiApp.Services.GetRequiredService<IRegionBehaviorFactory>();\n\n        Assert.NotEmpty(regionBehaviorFactory);\n        Assert.Contains(regionBehaviorFactory, x => x == RegionBehaviorAMock.BehaviorKey);\n        Assert.IsType<RegionBehaviorAMock>(regionBehaviorFactory.CreateFromKey(RegionBehaviorAMock.BehaviorKey));\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Fixtures/Regions/RegionFixture.cs",
    "content": "﻿using Prism.DryIoc.Maui.Tests.Mocks.ViewModels;\nusing Prism.DryIoc.Maui.Tests.Mocks.Views;\nusing Prism.Navigation.Xaml;\n\nnamespace Prism.DryIoc.Maui.Tests.Fixtures.Regions;\n\npublic class RegionFixture : TestBase\n{\n    public RegionFixture(ITestOutputHelper testOutputHelper)\n        : base(testOutputHelper)\n    {\n    }\n\n    [Fact]\n    public void ContentRegion_CreatedBy_RequestNavigate()\n    {\n        var mauiApp = CreateBuilder(prism => prism.RegisterTypes(container =>\n        {\n            container.RegisterForNavigation<MockContentRegionPage, MockContentRegionPageViewModel>();\n            container.RegisterForRegionNavigation<MockRegionViewA, MockRegionViewAViewModel>();\n        }).CreateWindow(nav => nav.NavigateAsync(\"MockContentRegionPage\"))).Build();\n        var window = GetWindow(mauiApp);\n\n        Assert.IsType<MockContentRegionPage>(window.Page);\n        var page = window.Page as MockContentRegionPage;\n        Assert.NotNull(page.ContentRegion.Content);\n        Assert.IsType<MockRegionViewA>(page.ContentRegion.Content);\n        Assert.IsType<MockRegionViewAViewModel>(page.ContentRegion.Content.BindingContext);\n    }\n\n    [Fact]\n    public void FrameRegion_CreatedBy_RegisterViewWithRegion()\n    {\n        var mauiApp = CreateBuilder(prism =>\n                prism.RegisterTypes(container =>\n                {\n                    container.RegisterForNavigation<MockContentRegionPage, MockContentRegionPageViewModel>();\n                    container.RegisterForRegionNavigation<MockRegionViewA, MockRegionViewAViewModel>();\n                })\n                .OnInitialized(container =>\n                {\n                    var regionManager = container.Resolve<IRegionManager>();\n                    regionManager.RegisterViewWithRegion(\"FrameRegion\", \"MockRegionViewA\");\n                })\n                .CreateWindow(\"MockContentRegionPage\"))\n            .Build();\n        var window = GetWindow(mauiApp);\n\n        Assert.IsType<MockContentRegionPage>(window.Page);\n        var page = window.Page as MockContentRegionPage;\n        Assert.NotNull(page.FrameRegion.Content);\n        Assert.IsType<MockRegionViewA>(page.FrameRegion.Content);\n        Assert.IsType<MockRegionViewAViewModel>(page.FrameRegion.Content.BindingContext);\n    }\n\n    [Fact]\n    public void Issue3159_LayoutRegion_CreatedBy_RegisterViewWithRegion()\n    {\n        var mauiApp = CreateBuilder(prism =>\n                prism.RegisterTypes(container =>\n                {\n                    container.RegisterForNavigation<MockContentRegionPage, MockContentRegionPageViewModel>();\n                    container.RegisterForRegionNavigation<MockRegionViewA, MockRegionViewAViewModel>();\n                })\n                .OnInitialized(container =>\n                {\n                    var regionManager = container.Resolve<IRegionManager>();\n                    regionManager.RegisterViewWithRegion(\"LayoutRegion\", \"MockRegionViewA\");\n                })\n                .CreateWindow(\"MockContentRegionPage\"))\n            .Build();\n        var window = GetWindow(mauiApp);\n\n        Assert.IsType<MockContentRegionPage>(window.Page);\n        var page = window.Page as MockContentRegionPage;\n\n        Assert.NotNull(page.LayoutRegion.Children);\n        Assert.NotEmpty(page.LayoutRegion.Children);\n        Assert.IsType<ContentView>(page.LayoutRegion.Children.First());\n        Assert.IsType<MockRegionViewAViewModel>(((ContentView)page.LayoutRegion.First()).Content.BindingContext);\n    }\n\n    [Fact]\n    public void RegionsShareContainer_WithPage()\n    {\n        var mauiApp = CreateBuilder(prism =>\n                prism.RegisterTypes(container =>\n                {\n                    container.RegisterForNavigation<MockContentRegionPage, MockContentRegionPageViewModel>();\n                    container.RegisterForRegionNavigation<MockRegionViewA, MockRegionViewAViewModel>();\n                })\n                .OnInitialized(container =>\n                {\n                    var regionManager = container.Resolve<IRegionManager>();\n                    regionManager.RegisterViewWithRegion(\"FrameRegion\", \"MockRegionViewA\");\n                })\n                .CreateWindow(\"MockContentRegionPage\"))\n            .Build();\n        var window = GetWindow(mauiApp);\n\n        Assert.IsType<MockContentRegionPage>(window.Page);\n        var page = window.Page as MockContentRegionPage;\n\n        var regionManager = mauiApp.Services.GetRequiredService<IRegionManager>();\n        var regions = regionManager.Regions.Cast<ITargetAwareRegion>();\n        Assert.Equal(3, regions.Count());\n        foreach (var region in regions)\n        {\n            Assert.Same(page.GetContainerProvider(), region.Container);\n        }\n    }\n\n    [Fact]\n    public void RegionViewModel_HasPageAccessor_WithCorrectPage()\n    {\n        // This validates that the NavigationService is using the correct Page to navigate from\n        var mauiApp = CreateBuilder(prism =>\n                prism.RegisterTypes(container =>\n                {\n                    container.RegisterForNavigation<MockContentRegionPage, MockContentRegionPageViewModel>();\n                    container.RegisterForRegionNavigation<MockRegionViewA, MockRegionViewAViewModel>();\n                })\n                .CreateWindow(\"MockContentRegionPage\"))\n            .Build();\n        var window = GetWindow(mauiApp);\n\n        var regionManager = mauiApp.Services.GetRequiredService<IRegionManager>();\n        var region = regionManager.Regions.First(x => x.Name == \"ContentRegion\");\n        var activeView = region.ActiveViews.First();\n        Assert.IsType<MockRegionViewA>(activeView);\n        var activeViewAsMockRegionViewA = activeView as MockRegionViewA;\n        var viewModel = activeViewAsMockRegionViewA.BindingContext as MockRegionViewAViewModel;\n        Assert.NotNull(viewModel);\n\n        Assert.NotNull(viewModel.Page);\n        Assert.IsType<MockContentRegionPage>(viewModel.Page);\n    }\n\n    [Fact]\n    public void RegionManager_HasRegionsAmount()\n    {\n        var mauiApp = CreateBuilder(prism =>\n                prism.RegisterTypes(container =>\n                {\n                    container.RegisterForNavigation<MockContentRegionPage, MockContentRegionPageViewModel>();\n                })\n                .CreateWindow(\"MockContentRegionPage\"))\n            .Build();\n        var window = GetWindow(mauiApp);\n\n        var regionManager = mauiApp.Services.GetRequiredService<IRegionManager>();\n        Assert.Equal(3, regionManager.Regions.Count());\n    }\n\n    [Fact]\n    public void PageHas_2_ChildViews()\n    {\n        var mauiApp = CreateBuilder(prism =>\n                prism.RegisterTypes(container =>\n                {\n                    container.RegisterForNavigation<MockContentRegionPage, MockContentRegionPageViewModel>();\n                    container.RegisterForRegionNavigation<MockRegionViewA, MockRegionViewAViewModel>();\n                })\n                .OnInitialized(container =>\n                {\n                    var regionManager = container.Resolve<IRegionManager>();\n                    regionManager.RegisterViewWithRegion(\"FrameRegion\", \"MockRegionViewA\");\n                })\n                .CreateWindow(\"MockContentRegionPage\"))\n            .Build();\n        var window = GetWindow(mauiApp);\n\n        Assert.IsType<MockContentRegionPage>(window.Page);\n        var page = window.Page as MockContentRegionPage;\n\n        var children = page.GetChildRegions();\n        Assert.NotNull(children);\n\n        Assert.Equal(2, children.Count());\n    }\n\n    [Fact]\n    public void RegionWithDefaultView_IsAutoPopulated()\n    {\n        var mauiApp = CreateBuilder(prism =>\n                prism.RegisterTypes(container =>\n                {\n                    container.RegisterForNavigation<MockPageWithRegionAndDefaultView>(\"MainPage\");\n                    container.RegisterForRegionNavigation<MockRegionViewA, MockRegionViewAViewModel>();\n                })\n                .CreateWindow(\"MainPage\", ex => Assert.Null(ex)))\n            .Build();\n        var window = GetWindow(mauiApp);\n\n        Assert.IsType<MockPageWithRegionAndDefaultView>(window.Page);\n        var page = window.Page as MockPageWithRegionAndDefaultView;\n\n        var region = page.Content as ContentView;\n\n        Assert.NotNull(region.Content);\n        Assert.IsType<MockRegionViewA>(region.Content);\n    }\n\n    [Fact]\n    public async Task Region_IsDestroyed_OnNavigatedAway()\n    {\n        var mauiApp = CreateBuilder(prism => prism\n                .RegisterTypes(container =>\n                {\n                    container.RegisterForNavigation<MockPageWithRegionAndDefaultView>(\"MainPage\");\n                    container.RegisterForRegionNavigation<MockRegionViewA, MockRegionViewAViewModel>();\n                })\n                .CreateWindow(\"MainPage\"))\n            .Build();\n\n        var window = GetWindow(mauiApp);\n\n        var navigationService = Prism.Navigation.Xaml.Navigation.GetNavigationService(window.Page);\n        var regionManager = mauiApp.Services.GetRequiredService<IRegionManager>();\n\n        Assert.Single(regionManager.Regions);\n        await navigationService.NavigateAsync(\"/MockViewA\");\n        Assert.Empty(regionManager.Regions);\n    }\n\n    [Fact]\n    public async Task Region_IsDestroyed_OnNavigationGoBack()\n    {\n        var mauiApp = CreateBuilder(prism => prism\n                .RegisterTypes(container =>\n                {\n                    container.RegisterForNavigation<MockPageWithRegionAndDefaultView>(\"RegionPage\");\n                    container.RegisterForRegionNavigation<MockRegionViewA, MockRegionViewAViewModel>();\n                })\n                .CreateWindow(\"NavigationPage/MockViewA\"))\n            .Build();\n\n        var window = GetWindow(mauiApp);\n        var navPage = window.Page as NavigationPage;\n\n        var navigationService = Prism.Navigation.Xaml.Navigation.GetNavigationService(navPage.RootPage);\n        var regionManager = mauiApp.Services.GetRequiredService<IRegionManager>();\n\n        Assert.Empty(regionManager.Regions);\n        await navigationService.NavigateAsync(\"RegionPage\");\n        Assert.Single(regionManager.Regions);\n\n        await Prism.Navigation.Xaml.Navigation.GetNavigationService(navPage.CurrentPage).GoBackAsync();\n        Assert.Empty(regionManager.Regions);\n\n        var result = await navigationService.NavigateAsync(\"RegionPage\");\n        Assert.True(result.Success);\n    }\n\n    [Fact]\n    public void Issue3328_WhenNavigatingToUnregisteredView_ShouldFailWithKeyNotFoundException()\n    {\n        // Arrange\n        var mauiApp = CreateBuilder(prism => prism.RegisterTypes(container =>\n        {\n            container.RegisterForNavigation<MockContentRegionPage, MockContentRegionPageViewModel>();\n            container.RegisterForRegionNavigation<MockRegionViewA, MockRegionViewAViewModel>();\n        }).CreateWindow(nav => nav.NavigateAsync(\"MockContentRegionPage\"))).Build();\n        var window = GetWindow(mauiApp);\n\n        Assert.IsType<MockContentRegionPage>(window.Page);\n        var page = window.Page as MockContentRegionPage;\n        Assert.NotNull(page.ContentRegion.Content);\n        Assert.IsType<MockRegionViewA>(page.ContentRegion.Content);\n        Assert.IsType<MockRegionViewAViewModel>(page.ContentRegion.Content.BindingContext);\n        \n        // Act\n        var regionManager = mauiApp.Services.GetRequiredService<IRegionManager>();\n        INavigationResult result = null;\n        \n        regionManager.RequestNavigate(\"ContentRegion\", \"UnregisteredRegion\", navResult =>\n        {\n            result = navResult;\n        });\n        \n        // Assert\n        Assert.False(result.Success);\n        var ex = Assert.IsType<KeyNotFoundException>(result.Exception);\n        Assert.Equal(\"No view with the name 'UnregisteredRegion' has been registered\", ex.Message);\n        \n        Assert.IsType<MockRegionViewA>(page.ContentRegion.Content);\n        Assert.IsType<MockRegionViewAViewModel>(page.ContentRegion.Content.BindingContext);\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Fixtures/TestBase.cs",
    "content": "using Microsoft.Extensions.Logging;\nusing Prism.DryIoc.Maui.Tests.Mocks;\nusing Prism.DryIoc.Maui.Tests.Mocks.Logging;\nusing Prism.DryIoc.Maui.Tests.Mocks.Navigation;\nusing Prism.DryIoc.Maui.Tests.Mocks.ViewModels;\nusing Prism.DryIoc.Maui.Tests.Mocks.Views;\nusing Prism.Events;\n\nnamespace Prism.DryIoc.Maui.Tests.Fixtures;\n\npublic abstract class TestBase\n{\n    protected readonly ITestOutputHelper _testOutputHelper;\n\n    protected TestBase(ITestOutputHelper testOutputHelper)\n    {\n        _testOutputHelper = testOutputHelper;\n\n        DispatcherProvider.SetCurrent(TestDispatcher.Provider);\n    }\n\n    protected MauiAppBuilder CreateBuilder(Action<PrismAppBuilder> configurePrism)\n    {\n        return MauiApp.CreateBuilder()\n            .UseMauiApp<Application>()\n            .UsePrism(prism =>\n            {\n                prism.RegisterTypes(container =>\n                {\n                    container.RegisterScoped<INavigationService, TestPageNavigationService>();\n                    container.RegisterForNavigation<MockHome, MockHomeViewModel>()\n                        .RegisterForNavigation<MockExplicitTabbedPage>()\n                        .RegisterForNavigation<MockViewA, MockViewAViewModel>()\n                        .RegisterForNavigation<MockViewB, MockViewBViewModel>()\n                        .RegisterForNavigation<MockViewC, MockViewCViewModel>()\n                        .RegisterForNavigation<MockViewD, MockViewDViewModel>()\n                        .RegisterForNavigation<MockViewE, MockViewEViewModel>();\n                })\n                .ConfigureLogging(builder =>\n                    builder.AddProvider(new XUnitLoggerProvider(_testOutputHelper)))\n                .OnInitialized(container =>\n                {\n                    var ea = container.Resolve<IEventAggregator>();\n                    ea.GetEvent<NavigationRequestEvent>().Subscribe(context =>\n                    {\n                        if (System.Diagnostics.Debugger.IsAttached)\n                            System.Diagnostics.Debugger.Break();\n\n                        var logger = container.Resolve<ILoggerFactory>()\n                            .CreateLogger(GetType().Name);\n                        var message = context.Type == NavigationRequestType.Navigate ? $\"{context.Type}: {context.Uri}\" : $\"{context.Type}\";\n\n                        message += context.Cancelled ? \" - Cancelled\" : context.Result.Exception is null ? \" - Success\" : \" - Error\";\n                        logger.LogInformation(message);\n                        if (!context.Cancelled && context.Result.Exception is not null)\n                        {\n                            var ex = context.Result.Exception;\n                            while(ex is not null)\n                            {\n                                logger.LogError(ex, \"Navigation Error\");\n                                ex = ex.InnerException;\n                            }\n                        }\n                    });\n                });\n                configurePrism(prism);\n            });\n    }\n\n    protected static PrismWindow GetWindow(MauiApp mauiApp)\n    {\n        var app = mauiApp.Services.GetService<IApplication>();\n        Assert.NotNull(app);\n        Assert.IsType<Application>(app);\n\n        var state = new ActivationState(new MauiContext(mauiApp.Services));\n        var window = app.CreateWindow(state);\n        Assert.IsType<PrismWindow>(window);\n        var prismWindow = window as PrismWindow;\n        Assert.NotNull(prismWindow?.Page);\n        return prismWindow;\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Mocks/ConcreteTypeMock.cs",
    "content": "namespace Prism.DryIoc.Maui.Tests.Mocks;\n\ninternal class ConcreteTypeMock\n{\n    public const string Key = \"ConcreteTypeMock\";\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Mocks/Converters/MockValueConverter.cs",
    "content": "using System.Globalization;\nusing Prism.DryIoc.Maui.Tests.Mocks.Events;\nusing Prism.Events;\n\nnamespace Prism.DryIoc.Maui.Tests.Mocks.Converters;\n\ninternal class MockValueConverter : IValueConverter\n{\n    private IEventAggregator _eventAggreator { get; }\n\n    public MockValueConverter(IEventAggregator eventAggreator)\n    {\n        _eventAggreator = eventAggreator;\n    }\n\n    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)\n    {\n        _eventAggreator.GetEvent<TestActionEvent>().Publish(\"Convert\");\n        return value;\n    }\n\n    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)\n    {\n        _eventAggreator.GetEvent<TestActionEvent>().Publish(\"ConvertBack\");\n        return value;\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Mocks/Events/TestActionEvent.cs",
    "content": "using Prism.Events;\n\nnamespace Prism.DryIoc.Maui.Tests.Mocks.Events;\n\ninternal class TestActionEvent : PubSubEvent<string>\n{\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Mocks/Logging/XUnitLogger.cs",
    "content": "﻿using System.Text;\nusing Microsoft.Extensions.Logging;\n\nnamespace Prism.DryIoc.Maui.Tests.Mocks.Logging;\n\ninternal class XUnitLogger : ILogger\n{\n    private readonly ITestOutputHelper _testOutputHelper;\n    private readonly string _categoryName;\n    private readonly LoggerExternalScopeProvider _scopeProvider;\n\n    public static ILogger CreateLogger(ITestOutputHelper testOutputHelper) => new XUnitLogger(testOutputHelper, new LoggerExternalScopeProvider(), \"\");\n    public static ILogger<T> CreateLogger<T>(ITestOutputHelper testOutputHelper) => new XUnitLogger<T>(testOutputHelper, new LoggerExternalScopeProvider());\n\n    public XUnitLogger(ITestOutputHelper testOutputHelper, LoggerExternalScopeProvider scopeProvider, string categoryName)\n    {\n        _testOutputHelper = testOutputHelper;\n        _scopeProvider = scopeProvider;\n        _categoryName = categoryName;\n    }\n\n    public bool IsEnabled(LogLevel logLevel) => logLevel != LogLevel.None;\n\n    public IDisposable BeginScope<TState>(TState state) => _scopeProvider.Push(state);\n\n    public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)\n    {\n        var sb = new StringBuilder();\n        sb.Append(logLevel)\n          .Append(\" [\").Append(_categoryName).Append(\"] \")\n          .Append(formatter(state, exception));\n\n        if (exception != null)\n        {\n            sb.Append('\\n').Append(exception);\n        }\n\n        // Append scopes\n        _scopeProvider.ForEachScope((scope, state) =>\n        {\n            state.Append(\"\\n => \");\n            state.Append(scope);\n        }, sb);\n\n        _testOutputHelper.WriteLine(sb.ToString());\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Mocks/Logging/XUnitLoggerProvider.cs",
    "content": "﻿using Microsoft.Extensions.Logging;\n\nnamespace Prism.DryIoc.Maui.Tests.Mocks.Logging;\n\ninternal sealed class XUnitLoggerProvider : ILoggerProvider\n{\n    private readonly ITestOutputHelper _testOutputHelper;\n    private readonly LoggerExternalScopeProvider _scopeProvider = new ();\n\n    public XUnitLoggerProvider(ITestOutputHelper testOutputHelper)\n    {\n        _testOutputHelper = testOutputHelper;\n    }\n\n    public ILogger CreateLogger(string categoryName)\n    {\n        return new XUnitLogger(_testOutputHelper, _scopeProvider, categoryName);\n    }\n\n    public void Dispose()\n    {\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Mocks/Logging/XUnitLogger{T}.cs",
    "content": "﻿using Microsoft.Extensions.Logging;\n\nnamespace Prism.DryIoc.Maui.Tests.Mocks.Logging;\n\ninternal sealed class XUnitLogger<T> : XUnitLogger, ILogger<T>\n{\n    public XUnitLogger(ITestOutputHelper testOutputHelper, LoggerExternalScopeProvider scopeProvider)\n        : base(testOutputHelper, scopeProvider, typeof(T).FullName)\n    {\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Mocks/Navigation/NavigationPop.cs",
    "content": "﻿namespace Prism.DryIoc.Maui.Tests.Mocks.Navigation;\n\npublic record NavigationPop(Page Page, bool UseModalNavigation, bool Animated);\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Mocks/Navigation/NavigationPush.cs",
    "content": "﻿namespace Prism.DryIoc.Maui.Tests.Mocks.Navigation;\n\npublic record NavigationPush(Page CurrentPage, Page Page, bool? UseModalNavigation, bool? Animated, bool InsertBeforeLast, int NavigationOffset);\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Mocks/Navigation/NavigationTestRecorder.cs",
    "content": "﻿namespace Prism.DryIoc.Maui.Tests.Mocks.Navigation;\n\ninternal class NavigationTestRecorder\n{\n    private readonly List<NavigationPop> _pops = [];\n    private readonly List<NavigationPush> _pushes = [];\n\n    public IReadOnlyList<NavigationPop> Pops => _pops;\n    public IReadOnlyList<NavigationPush> Pushes => _pushes;\n\n    public void Push(NavigationPush push) =>\n        _pushes.Add(push);\n\n    public void Pop(NavigationPop pop) =>\n        _pops.Add(pop);\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Mocks/Navigation/NavigationTestRecorderExtensions.cs",
    "content": "﻿namespace Prism.DryIoc.Maui.Tests.Mocks.Navigation;\n\npublic static class NavigationTestRecorderExtensions\n{\n    public static IReadOnlyList<NavigationPop> GetPops(this INavigationService navigationService)\n    {\n        if (navigationService is not TestPageNavigationService testNav)\n            throw new InvalidCastException();\n\n        return testNav.Recorder.Pops;\n    }\n\n    public static IReadOnlyList<NavigationPush> GetPushes(this INavigationService navigationService)\n    {\n        if (navigationService is not TestPageNavigationService testNav)\n            throw new InvalidCastException();\n\n        return testNav.Recorder.Pushes;\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Mocks/Navigation/TestPageNavigationService.cs",
    "content": "﻿using Prism.Common;\nusing Prism.Events;\n\nnamespace Prism.DryIoc.Maui.Tests.Mocks.Navigation;\n\ninternal sealed class TestPageNavigationService : PageNavigationService\n{\n    public TestPageNavigationService(\n        IContainerProvider container,\n        IWindowManager windowManager,\n        IEventAggregator eventAggregator,\n        IPageAccessor pageAccessor,\n        NavigationTestRecorder recorder)\n        : base(container, windowManager, eventAggregator, pageAccessor)\n    {\n        Recorder = recorder;\n    }\n\n    public NavigationTestRecorder Recorder { get; }\n\n    protected override async Task<Page> DoPop(INavigation navigation, bool useModalNavigation, bool animated)\n    {\n        var page = await base.DoPop(navigation, useModalNavigation, animated);\n        Recorder.Pop(new NavigationPop(page, useModalNavigation, animated));\n        return page;\n    }\n\n    protected override Task DoPush(Page currentPage, Page page, bool? useModalNavigation, bool? animated, bool insertBeforeLast = false, int navigationOffset = 0)\n    {\n        Recorder.Push(new NavigationPush(currentPage, page, useModalNavigation, animated, insertBeforeLast, navigationOffset));\n        return base.DoPush(currentPage, page, useModalNavigation, animated, insertBeforeLast, navigationOffset);\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Mocks/Regions/Behaviors/RegionBehaviorAMock.cs",
    "content": "namespace Prism.DryIoc.Maui.Tests.Mocks.Regions.Behaviors;\ninternal class RegionBehaviorAMock : RegionBehavior\n{\n    public const string BehaviorKey = \"RegionBehaviorAMock\";\n    public RegionBehaviorAMock()\n    {\n\n    }\n    protected override void OnAttach()\n    {\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Mocks/Regions/Behaviors/RegionBehaviorBMock.cs",
    "content": "namespace Prism.DryIoc.Maui.Tests.Mocks.Regions.Behaviors;\ninternal class RegionBehaviorBMock : RegionBehavior\n{\n    public const string BehaviorKey = \"RegionBehaviorBMock\";\n    public RegionBehaviorBMock()\n    {\n\n    }\n    protected override void OnAttach()\n    {\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Mocks/TestDispatcher.cs",
    "content": "﻿using Microsoft.Maui.Dispatching;\n\nnamespace Prism.DryIoc.Maui.Tests.Mocks;\n\ninternal class TestDispatcher\n{\n    public static readonly IDispatcherProvider Provider = new DispatcherProviderMock();\n\n    public static IDispatcher Current => new DispatcherMock();\n\n    private class DispatcherProviderMock : IDispatcherProvider\n    {\n        public IDispatcher GetForCurrentThread() => new DispatcherMock();\n    }\n\n    private class DispatcherMock : IDispatcher\n    {\n        public bool IsDispatchRequired { get; }\n\n        public IDispatcherTimer CreateTimer() => new DispatchTimerMock();\n\n        public bool Dispatch(Action action) => true;\n\n        public bool DispatchDelayed(TimeSpan delay, Action action)\n        {\n            return delay > TimeSpan.Zero;\n        }\n    }\n\n    private class DispatchTimerMock : IDispatcherTimer\n    {\n        public TimeSpan Interval { get; set; }\n        public bool IsRepeating { get; set; }\n        public bool IsRunning { get; private set; }\n\n#pragma warning disable CS0067\n        public event EventHandler Tick;\n#pragma warning restore CS0067\n\n        public void Start()\n        {\n            IsRunning = true;\n        }\n\n        public void Stop()\n        {\n            IsRunning = false;\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Mocks/ViewModels/ForcedViewModel.cs",
    "content": "﻿using Prism.Common;\n\nnamespace Prism.DryIoc.Maui.Tests.Mocks.ViewModels;\n\ninternal class ForcedViewModel\n{\n    public ForcedViewModel(IPageAccessor accessor)\n    {\n        _accessor = accessor;\n    }\n\n    private readonly IPageAccessor _accessor;\n\n    public Page Page => _accessor.Page;\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Mocks/ViewModels/MockContentRegionPageViewModel.cs",
    "content": "﻿namespace Prism.DryIoc.Maui.Tests.Mocks.ViewModels;\n\ninternal class MockContentRegionPageViewModel : IInitialize\n{\n    private IRegionManager _regionManager { get; }\n\n    public MockContentRegionPageViewModel(IRegionManager regionManager)\n    {\n        _regionManager = regionManager;\n    }\n\n    public void Initialize(INavigationParameters parameters)\n    {\n        _regionManager.RequestNavigate(\"ContentRegion\", \"MockRegionViewA\", parameters);\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Mocks/ViewModels/MockHomeViewModel.cs",
    "content": "﻿using Prism.Common;\n\nnamespace Prism.DryIoc.Maui.Tests.Mocks.ViewModels;\n\npublic class MockHomeViewModel : MockViewModelBase\n{\n    public MockHomeViewModel(IPageAccessor pageAccessor, INavigationService navigationService) : base(pageAccessor, navigationService)\n    {\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Mocks/ViewModels/MockRegionViewAViewModel.cs",
    "content": "﻿using Prism.Common;\n\nnamespace Prism.DryIoc.Maui.Tests.Mocks.ViewModels;\n\npublic class MockRegionViewAViewModel : BindableBase, IRegionAware, IInitialize\n{\n    private IPageAccessor _accessor;\n\n    public MockRegionViewAViewModel(IPageAccessor accessor)\n    {\n        _accessor = accessor;\n    }\n\n    public bool Initialized { get; private set; }\n\n    public Page Page => _accessor.Page;\n\n    private string _message;\n    public string Message\n    {\n        get => _message;\n        set => SetProperty(ref _message, value);\n    }\n\n    public void Initialize(INavigationParameters parameters)\n    {\n        Initialized = true;\n        if (parameters.TryGetValue<string>(nameof(Message), out var message))\n            Message = message;\n    }\n\n    public bool IsNavigationTarget(NavigationContext navigationContext)\n    {\n        return navigationContext.NavigatedName() == \"MockRegionViewA\";\n    }\n\n    public void OnNavigatedFrom(NavigationContext navigationContext)\n    {\n\n    }\n\n    public void OnNavigatedTo(NavigationContext navigationContext)\n    {\n\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Mocks/ViewModels/MockRegionViewBViewModel.cs",
    "content": "﻿using Prism.Common;\n\nnamespace Prism.DryIoc.Maui.Tests.Mocks.ViewModels;\n\npublic class MockRegionViewBViewModel\n{\n    private IPageAccessor _accessor;\n\n    public MockRegionViewBViewModel(IPageAccessor accessor)\n    {\n        _accessor = accessor;\n    }\n\n    public Page Page => _accessor.Page;\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Mocks/ViewModels/MockViewAViewModel.cs",
    "content": "﻿using Prism.Common;\n\nnamespace Prism.DryIoc.Maui.Tests.Mocks.ViewModels;\n\npublic class MockViewAViewModel : MockViewModelBase\n{\n    public MockViewAViewModel(IPageAccessor pageAccessor, INavigationService navigationService) : base(pageAccessor, navigationService)\n    {\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Mocks/ViewModels/MockViewBViewModel.cs",
    "content": "﻿using Prism.Common;\n\nnamespace Prism.DryIoc.Maui.Tests.Mocks.ViewModels;\n\npublic class MockViewBViewModel : MockViewModelBase\n{\n    public MockViewBViewModel(IPageAccessor pageAccessor, INavigationService navigationService) : base(pageAccessor, navigationService)\n    {\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Mocks/ViewModels/MockViewCViewModel.cs",
    "content": "﻿using Prism.Common;\n\nnamespace Prism.DryIoc.Maui.Tests.Mocks.ViewModels;\n\npublic class MockViewCViewModel : MockViewModelBase\n{\n    public MockViewCViewModel(IPageAccessor pageAccessor, INavigationService navigationService) : base(pageAccessor, navigationService)\n    {\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Mocks/ViewModels/MockViewDViewModel.cs",
    "content": "﻿using Prism.Common;\n\nnamespace Prism.DryIoc.Maui.Tests.Mocks.ViewModels;\n\npublic class MockViewDViewModel : MockViewModelBase\n{\n    public MockViewDViewModel(IPageAccessor pageAccessor, INavigationService navigationService) : base(pageAccessor, navigationService)\n    {\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Mocks/ViewModels/MockViewEViewModel.cs",
    "content": "﻿using Prism.Common;\n\nnamespace Prism.DryIoc.Maui.Tests.Mocks.ViewModels;\n\npublic class MockViewEViewModel : MockViewModelBase\n{\n    public MockViewEViewModel(IPageAccessor pageAccessor, INavigationService navigationService) : base(pageAccessor, navigationService)\n    {\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Mocks/ViewModels/MockViewModelBase.cs",
    "content": "using Prism.Common;\n\nnamespace Prism.DryIoc.Maui.Tests.Mocks.ViewModels;\n\n#pragma warning disable CS0067 // The event is never used because this is a Mock\npublic abstract class MockViewModelBase : IActiveAware, INavigationAware, IConfirmNavigation\n{\n    private readonly IPageAccessor _pageAccessor;\n\n    public event EventHandler IsActiveChanged;\n\n    protected MockViewModelBase(IPageAccessor pageAccessor, INavigationService navigationService)\n    {\n        _pageAccessor = pageAccessor;\n        NavigationService = navigationService;\n    }\n\n    public string Message { get; private set; }\n\n    private List<string> _actions = [];\n    public IEnumerable<string> Actions => _actions;\n\n    public INavigationService NavigationService { get; }\n\n    public Task<INavigationResult> GoBack() => NavigationService.GoBackAsync();\n\n    public Task<INavigationResult> NavigateTo(string uri) => NavigationService.NavigateAsync(uri);\n\n    public Page Page => _pageAccessor.Page;\n\n    public bool StopNavigation { get; set; }\n\n    public bool IsActive { get; set; }\n\n    public bool CanNavigate(INavigationParameters parameters)\n    {\n        _actions.Add(nameof(CanNavigate));\n        return !StopNavigation;\n    }\n\n    public void OnNavigatedFrom(INavigationParameters parameters)\n    {\n        _actions.Add(nameof(OnNavigatedFrom));\n    }\n\n    public void OnNavigatedTo(INavigationParameters parameters)\n    {\n        _actions.Add(nameof(OnNavigatedTo));\n        if (parameters.TryGetValue<string>(\"Message\", out var message))\n            Message = message;\n    }\n}\n#pragma warning restore CS0067 // The event is never used because this is a Mock\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Mocks/ViewModels/MockXamlViewViewModel.cs",
    "content": "namespace Prism.DryIoc.Maui.Tests.Mocks.ViewModels;\n\ninternal class MockXamlViewViewModel : BindableBase\n{\n    private string _test = \"Initial Value\";\n    public string Test\n    {\n        get => _test;\n        set => SetProperty(ref _test, value);\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Mocks/Views/ForcedView.cs",
    "content": "﻿namespace Prism.DryIoc.Maui.Tests.Mocks.Views;\n\ninternal class ForcedView : ContentPage\n{\n    public ForcedView()\n    {\n        ViewModelLocator.SetAutowireViewModel(this, ViewModelLocatorBehavior.Forced);\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Mocks/Views/IMessageLabel.cs",
    "content": "﻿namespace Prism.DryIoc.Maui.Tests.Mocks.Views;\n\npublic interface IMessageLabel\n{\n    Label Message { get; }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Mocks/Views/MockContentRegionPage.cs",
    "content": "namespace Prism.DryIoc.Maui.Tests.Mocks.Views;\n\npublic class MockContentRegionPage : ContentPage\n{\n    public MockContentRegionPage()\n    {\n        ContentRegion = new ContentView();\n        ContentRegion.SetValue(Prism.Navigation.Regions.Xaml.RegionManager.RegionNameProperty, nameof(ContentRegion));\n\n        FrameRegion = new Frame();\n        FrameRegion.SetValue(Prism.Navigation.Regions.Xaml.RegionManager.RegionNameProperty, nameof(FrameRegion));\n\n        LayoutRegion = new StackLayout();\n        LayoutRegion.SetValue(Prism.Navigation.Regions.Xaml.RegionManager.RegionNameProperty, nameof(LayoutRegion));\n\n        Content = new StackLayout\n        {\n            ContentRegion,\n            FrameRegion,\n            LayoutRegion\n        };\n    }\n\n    public ContentView ContentRegion { get; }\n\n    public Frame FrameRegion { get; }\n\n    public Layout LayoutRegion { get; }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Mocks/Views/MockExplicitTabbedPage.cs",
    "content": "namespace Prism.DryIoc.Maui.Tests.Mocks.Views;\n\ninternal class MockExplicitTabbedPage : TabbedPage\n{\n    public MockExplicitTabbedPage()\n    {\n        Children.Add(new NavigationPage(new MockViewA()));\n        Children.Add(new NavigationPage(new MockViewB()));\n        Children.Add(new MockViewC());\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Mocks/Views/MockHome.cs",
    "content": "﻿namespace Prism.DryIoc.Maui.Tests.Mocks.Views;\n\npublic class MockHome : FlyoutPage\n{\n    public MockHome()\n    {\n        Flyout = new ContentPage { Title = \"Menu\" };\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Mocks/Views/MockPageWithRegionAndDefaultView.cs",
    "content": "﻿namespace Prism.DryIoc.Maui.Tests.Mocks.Views;\n\npublic class MockPageWithRegionAndDefaultView : ContentPage\n{\n    public MockPageWithRegionAndDefaultView()\n    {\n        var view = new ContentView();\n        view.SetValue(Prism.Navigation.Regions.Xaml.RegionManager.RegionNameProperty, \"Demo\");\n        view.SetValue(Prism.Navigation.Regions.Xaml.RegionManager.DefaultViewProperty, \"MockRegionViewA\");\n        Content = view;\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Mocks/Views/MockRegionViewA.cs",
    "content": "﻿namespace Prism.DryIoc.Maui.Tests.Mocks.Views;\n\npublic class MockRegionViewA : StackLayout, IMessageLabel\n{\n    public MockRegionViewA()\n    {\n        Message = new Label();\n        Message.SetBinding(Label.TextProperty, new Binding(\"Message\"));\n        Add(Message);\n    }\n\n    public Label Message { get; }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Mocks/Views/MockRegionViewB.cs",
    "content": "﻿namespace Prism.DryIoc.Maui.Tests.Mocks.Views;\n\npublic class MockRegionViewB : StackLayout, IMessageLabel\n{\n    public MockRegionViewB()\n    {\n        Message = new Label();\n        Message.SetBinding(Label.TextProperty, new Binding(\"Message\"));\n        Add(Message);\n    }\n\n    public Label Message { get; }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Mocks/Views/MockViewA.cs",
    "content": "﻿namespace Prism.DryIoc.Maui.Tests.Mocks.Views;\n\npublic class MockViewA : ContentPage\n{\n    public const string ExpectedTitle = \"Mock View A\";\n    public static readonly ImageSource ExpectedIconImageSource = \"home.png\";\n    public MockViewA()\n    {\n        Title = ExpectedTitle;\n        IconImageSource = ExpectedIconImageSource;\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Mocks/Views/MockViewB.cs",
    "content": "using Prism.Xaml;\n\nnamespace Prism.DryIoc.Maui.Tests.Mocks.Views;\n\npublic class MockViewB : ContentPage\n{\n    public const string ExpectedTitle = \"Mock View B\";\n    public MockViewB()\n    {\n        DynamicTab.SetTitle(this, ExpectedTitle);\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Mocks/Views/MockViewC.cs",
    "content": "using Prism.Xaml;\n\nnamespace Prism.DryIoc.Maui.Tests.Mocks.Views;\n\npublic class MockViewC : ContentPage\n{\n    public const string ExpectedTitle = \"Mock View C\";\n    public const string ExpectedDynamicTitle = \"Dynamic View C\";\n    public MockViewC()\n    {\n        Title = ExpectedTitle;\n        DynamicTab.SetTitle(this, ExpectedDynamicTitle);\n        DynamicTab.SetIconImageSource(this, \"home.png\");\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Mocks/Views/MockViewD.cs",
    "content": "﻿namespace Prism.DryIoc.Maui.Tests.Mocks.Views;\n\npublic class MockViewD : ContentPage { }\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Mocks/Views/MockViewE.cs",
    "content": "﻿namespace Prism.DryIoc.Maui.Tests.Mocks.Views;\n\npublic class MockViewE : ContentPage { }"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Mocks/Views/MockXamlView.xaml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<ContentPage\n    xmlns=\"http://schemas.microsoft.com/dotnet/2021/maui\"\n    xmlns:x=\"http://schemas.microsoft.com/winfx/2009/xaml\"\n    xmlns:prism=\"clr-namespace:Prism.IoC;assembly=Prism.Maui\"\n    xmlns:converters=\"clr-namespace:Prism.DryIoc.Maui.Tests.Mocks.Converters\"\n    x:Class=\"Prism.DryIoc.Maui.Tests.Mocks.Views.MockXamlView\"\n    Title=\"MockXamlView\">\n  \n    <ContentPage.Resources>\n        <ResourceDictionary>\n        <prism:ContainerProvider\n            x:TypeArguments=\"converters:MockValueConverter\"\n            x:Key=\"mockValueConverter\" />\n        </ResourceDictionary>\n    </ContentPage.Resources>\n  \n    <StackLayout>\n        <Entry x:Name=\"testEntry\"\n            Text=\"{Binding Test,Converter={StaticResource mockValueConverter}}\" />\n    </StackLayout>\n  \n</ContentPage>\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Mocks/Views/MockXamlView.xaml.cs",
    "content": "namespace Prism.DryIoc.Maui.Tests.Mocks.Views;\n\n[XamlCompilation(XamlCompilationOptions.Compile)]\npublic partial class MockXamlView : ContentPage\n{\n\tpublic MockXamlView()\n\t{\n\t\tInitializeComponent();\n\t}\n\n    public Entry TestEntry => testEntry;\n}\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Prism.DryIoc.Maui.Tests.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFramework>net10.0</TargetFramework>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <Compile Include=\"..\\Prism.Maui.Tests\\Mocks\\MockResourcesProvider.cs\" LinkBase=\"Mocks\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Microsoft.Maui.Controls\" VersionOverride=\"10.0.10\" />\n    <PackageReference Include=\"GitHubActionsTestLogger\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"Microsoft.NET.Test.Sdk\" />\n    <PackageReference Include=\"xunit\" />\n    <PackageReference Include=\"xunit.runner.visualstudio\">\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n      <PrivateAssets>all</PrivateAssets>\n    </PackageReference>\n    <PackageReference Include=\"coverlet.collector\">\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n      <PrivateAssets>all</PrivateAssets>\n    </PackageReference>\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\..\\src\\Maui\\Prism.DryIoc.Maui\\Prism.DryIoc.Maui.csproj\" />\n    <ProjectReference Include=\"..\\..\\..\\src\\Maui\\Prism.Maui.Rx\\Prism.Maui.Rx.csproj\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "tests/Maui/Prism.DryIoc.Maui.Tests/Properties/AssemblyInfo.cs",
    "content": "﻿[assembly: CollectionBehavior(DisableTestParallelization = true)]\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Fixtures/Behaviors/EventToCommandBehaviorFixture.cs",
    "content": "﻿using System;\nusing System.Globalization;\nusing Microsoft.Maui.Controls;\nusing Microsoft.Maui.Controls.Hosting;\nusing Microsoft.Maui.Dispatching;\nusing Microsoft.Maui.Hosting;\nusing Prism.Behaviors;\nusing Prism.Maui.Tests.Mocks;\nusing Prism.Maui.Tests.Mocks.Behaviors;\n\nnamespace Prism.Maui.Tests.Fixtures.Behaviors;\n\npublic class EventToCommandBehaviorFixture\n{\n    private class ItemTappedEventArgsConverter : IValueConverter\n    {\n        private readonly bool _returnParameter;\n\n        public bool HasConverted { get; private set; }\n\n        public ItemTappedEventArgsConverter(bool returnParameter)\n        {\n            _returnParameter = returnParameter;\n        }\n\n        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)\n        {\n            HasConverted = true;\n            return _returnParameter ? parameter : (value as ItemTappedEventArgs)?.Item;\n        }\n\n        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)\n        {\n            throw new NotImplementedException();\n        }\n    }\n\n    public EventToCommandBehaviorFixture()\n    {\n        DispatcherProvider.SetCurrent(TestDispatcher.Provider);\n        _ = MauiApp.CreateBuilder()\n            .UseMauiApp<Application>()\n            .Build();\n    }\n\n    [Fact]\n    public void Command_OrderOfExecution()\n    {\n        const string commandParameter = \"ItemProperty\";\n        var executedCommand = false;\n        var converter = new ItemTappedEventArgsConverter(false);\n        var behavior = new EventToCommandBehaviorMock\n        {\n            EventName = \"ItemTapped\",\n            EventArgsConverter = converter,\n            CommandParameter = commandParameter,\n            Command = new DelegateCommand<string>(o =>\n            {\n                executedCommand = true;\n                Assert.NotNull(o);\n                Assert.Equal(commandParameter, o);\n                Assert.False(converter.HasConverted);\n            })\n        };\n        var listView = new ListView();\n        listView.Behaviors.Add(behavior);\n        behavior.RaiseEvent(listView, new ItemTappedEventArgs(listView, commandParameter, 0));\n        Assert.True(executedCommand);\n    }\n\n    [Fact]\n    public void Command_Converter()\n    {\n        const string item = \"ItemProperty\";\n        var executedCommand = false;\n        var behavior = new EventToCommandBehaviorMock\n        {\n            EventName = \"ItemTapped\",\n            EventArgsConverter = new ItemTappedEventArgsConverter(false),\n            Command = new DelegateCommand<string>(o =>\n            {\n                executedCommand = true;\n                Assert.NotNull(o);\n                Assert.Equal(item, o);\n            })\n        };\n        var listView = new ListView();\n        listView.Behaviors.Add(behavior);\n        behavior.RaiseEvent(listView, new ItemTappedEventArgs(listView, item, 0));\n        Assert.True(executedCommand);\n    }\n\n    [Fact]\n    public void Command_ConverterWithConverterParameter()\n    {\n        const string item = \"ItemProperty\";\n        var executedCommand = false;\n        var behavior = new EventToCommandBehaviorMock\n        {\n            EventName = \"ItemTapped\",\n            EventArgsConverter = new ItemTappedEventArgsConverter(true),\n            EventArgsConverterParameter = item,\n            Command = new DelegateCommand<string>(o =>\n            {\n                executedCommand = true;\n                Assert.NotNull(o);\n                Assert.Equal(item, o);\n            })\n        };\n        var listView = new ListView();\n        listView.Behaviors.Add(behavior);\n        behavior.RaiseEvent(listView, new ItemTappedEventArgs(listView, null, 0));\n        Assert.True(executedCommand);\n    }\n\n    [Fact]\n    public void Command_ExecuteWithParameter()\n    {\n        const string item = \"ItemProperty\";\n        var executedCommand = false;\n        var behavior = new EventToCommandBehaviorMock\n        {\n            EventName = \"ItemTapped\",\n            CommandParameter = item,\n            Command = new DelegateCommand<string>(o =>\n            {\n                executedCommand = true;\n                Assert.NotNull(o);\n                Assert.Equal(item, o);\n            })\n        };\n        var listView = new ListView();\n        listView.Behaviors.Add(behavior);\n        behavior.RaiseEvent(listView, new ItemTappedEventArgs(listView, null, 0));\n        Assert.True(executedCommand);\n    }\n\n    [Fact]\n    public void Command_EventArgsParameterPath()\n    {\n        const string item = \"ItemProperty\";\n        var executedCommand = false;\n        var behavior = new EventToCommandBehaviorMock\n        {\n            EventName = \"ItemTapped\",\n            EventArgsParameterPath = \"Item\",\n            Command = new DelegateCommand<string>(o =>\n            {\n                executedCommand = true;\n                Assert.NotNull(o);\n                Assert.Equal(item, o);\n            })\n        };\n        var listView = new ListView();\n        listView.Behaviors.Add(behavior);\n        behavior.RaiseEvent(listView, new ItemTappedEventArgs(listView, item, 0));\n        Assert.True(executedCommand);\n    }\n\n    //[Fact]\n    //public void Command_EventArgsParameterPath_Nested()\n    //{\n    //    dynamic item = new\n    //    {\n    //        AProperty = \"Value\"\n    //    };\n    //    var executedCommand = false;\n    //    var behavior = new EventToCommandBehaviorMock\n    //    {\n    //        EventName = \"ItemTapped\",\n    //        EventArgsParameterPath = \"Item.AProperty\",\n    //        Command = new DelegateCommand<object>(o =>\n    //        {\n    //            executedCommand = true;\n    //            Assert.NotNull(o);\n    //            Assert.Equal(\"Value\", o);\n    //        })\n    //    };\n    //    var listView = new ListView();\n    //    listView.Behaviors.Add(behavior);\n    //    behavior.RaiseEvent(listView, new ItemTappedEventArgs(listView, item));\n    //    Assert.True(executedCommand);\n    //}\n\n\n    [Fact]\n    public void Command_EventArgsParameterPath_Nested_When_ChildIsNull()\n    {\n        var executedCommand = false;\n        var behavior = new EventToCommandBehaviorMock\n        {\n            EventName = \"ItemTapped\",\n            EventArgsParameterPath = \"Item.AProperty\",\n            Command = new DelegateCommand<object>(o =>\n            {\n                executedCommand = true;\n                Assert.Null(o);\n            })\n        };\n        var listView = new ListView();\n        listView.Behaviors.Add(behavior);\n        behavior.RaiseEvent(listView, new ItemTappedEventArgs(listView, null, 0));\n        Assert.True(executedCommand);\n    }\n\n    [Fact]\n    public void Command_CanExecute()\n    {\n        var behavior = new EventToCommandBehaviorMock\n        {\n            EventName = \"ItemTapped\",\n            Command = new DelegateCommand(() => Assert.True(false), () => false)\n        };\n        var listView = new ListView();\n        listView.Behaviors.Add(behavior);\n        behavior.RaiseEvent(listView, null);\n    }\n\n    [Fact]\n    public void Command_CanExecuteWithParameterShouldExecute()\n    {\n        var shouldExeute = bool.TrueString;\n        var executedCommand = false;\n        var behavior = new EventToCommandBehaviorMock\n        {\n            EventName = \"ItemTapped\",\n            CommandParameter = shouldExeute,\n            Command = new DelegateCommand<string>(o =>\n            {\n                executedCommand = true;\n                Assert.True(true);\n            }, o => o.Equals(bool.TrueString))\n        };\n        var listView = new ListView();\n        listView.Behaviors.Add(behavior);\n        behavior.RaiseEvent(listView, null);\n        Assert.True(executedCommand);\n    }\n\n    [Fact]\n    public void Command_CanExecuteWithParameterShouldNotExeute()\n    {\n        var shouldExeute = bool.FalseString;\n        var behavior = new EventToCommandBehaviorMock\n        {\n            EventName = \"ItemTapped\",\n            CommandParameter = shouldExeute,\n            Command = new DelegateCommand<string>(o => Assert.True(false), o => o.Equals(bool.TrueString))\n        };\n        var listView = new ListView();\n        listView.Behaviors.Add(behavior);\n        behavior.RaiseEvent(listView, null);\n    }\n\n    [Fact]\n    public void Command_Execute()\n    {\n        var executedCommand = false;\n        var behavior = new EventToCommandBehaviorMock\n        {\n            EventName = \"ItemTapped\",\n            Command = new DelegateCommand(() =>\n            {\n                executedCommand = true;\n                Assert.True(true);\n            })\n        };\n        var listView = new ListView();\n        listView.Behaviors.Add(behavior);\n        behavior.RaiseEvent(listView, null);\n        Assert.True(executedCommand);\n    }\n\n    [Fact]\n    public void EventName_InvalidEventShouldThrow()\n    {\n        var behavior = new EventToCommandBehavior\n        {\n            EventName = \"OnItemTapped\"\n        };\n        var listView = new ListView();\n        Assert.Throws<ArgumentException>(() => listView.Behaviors.Add(behavior));\n    }\n\n    [Fact]\n    public void EventName_Valid()\n    {\n        var behavior = new EventToCommandBehavior\n        {\n            EventName = \"ItemTapped\"\n        };\n        var listView = new ListView();\n        listView.Behaviors.Add(behavior);\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Fixtures/Common/MvvmHelperFixture.cs",
    "content": "using Moq;\nusing Prism.Common;\n\nnamespace Prism.Maui.Tests.Fixtures.Common;\n\npublic class MvvmHelperFixture\n{\n    public MvvmHelperFixture()\n    {\n        var provider = new Mock<IDispatcherProvider>();\n        provider.Setup(x => x.GetForCurrentThread()).Returns(Mock.Of<IDispatcher>());\n\n        DispatcherProvider.SetCurrent(provider.Object);\n    }\n\n    /// <summary>\n    /// This test was introduced to verify GH3143\n    /// </summary>\n    /// <a href=\"https://github.com/PrismLibrary/Prism/issues/3143\">Git Hub Issue 3143</a>\n    [Fact]\n    public async Task GetCurrentPageFromFlyoutPageWithModalReturnsDetailPage()\n    {\n        // Given\n        var flyout = new FlyoutPage\n            { Flyout = new ContentPage { Title = \"Title\" }, Detail = new NavigationPage(), };\n        var window = new PrismWindow { Page = flyout };\n        await window.Navigation.PushModalAsync(new DialogContainerPage());\n\n        // When\n        var result = MvvmHelpers.GetCurrentPage(window.Page);\n\n        // Then\n        Assert.Equal(flyout.Detail, result);\n    }\n\n    /// <summary>\n    /// This test was introduced to verify GH3143\n    /// </summary>\n    /// <a href=\"https://github.com/PrismLibrary/Prism/issues/3143\">Git Hub Issue 3143</a>\n    [Fact]\n    public async Task GetCurrentPageFromComplexFlyoutPageWithModalReturnsCorrectPage()\n    {\n        // Given\n        var expected = new ContentPage { Title = \"D\" };\n        var navigationPage = new NavigationPage();\n        await navigationPage.PushAsync(new ContentPage { Title = \"A\" });\n        await navigationPage.PushAsync(new ContentPage { Title = \"B\" });\n        await navigationPage.PushAsync(new ContentPage { Title = \"C\" });\n        await navigationPage.PushAsync(expected);\n\n        var window = new Window\n        {\n            Page = new FlyoutPage\n                { Flyout = new ContentPage { Title = \"Title\" }, Detail = navigationPage, }\n        };\n\n        await window.Navigation.PushModalAsync(new DialogContainerPage());\n\n        // When\n        var result = MvvmHelpers.GetCurrentPage(window.Page);\n\n        // Then\n        Assert.Equal(expected, result);\n    }\n\n    /// <summary>\n    /// This test was introduced to verify GH3143\n    /// </summary>\n    /// <a href=\"https://github.com/PrismLibrary/Prism/issues/3143\">Git Hub Issue 3143</a>\n    [Fact]\n    public async Task GetCurrentPageFromNavigationPageWithModalReturnsContentPage()\n    {\n        // Given\n        var expected = new ContentPage();\n        var window = new Window { Page = new NavigationPage(expected) };\n        await window.Navigation.PushModalAsync(new DialogContainerPage());\n\n        // When\n        var result = MvvmHelpers.GetCurrentPage(window.Page);\n\n        // Then\n        Assert.Equal(expected, result);\n    }\n\n    /// <summary>\n    /// This test was introduced to verify GH3143\n    /// </summary>\n    /// <a href=\"https://github.com/PrismLibrary/Prism/issues/3143\">Git Hub Issue 3143</a>\n    [Fact]\n    public async Task GetCurrentPageFromContentPageWithModalReturnsContentPage()\n    {\n        // Given\n        var expected = new ContentPage { Title = \"Title\" };\n        var window = new Window { Page = expected };\n        await window.Navigation.PushModalAsync(new DialogContainerPage());\n\n        // When\n        var result = MvvmHelpers.GetCurrentPage(window.Page);\n\n        // Then\n        Assert.Equal(expected, result);\n    }\n\n    /// <summary>\n    /// This test was introduced to verify GH3143\n    /// </summary>\n    /// <a href=\"https://github.com/PrismLibrary/Prism/issues/3143\">Git Hub Issue 3143</a>\n    [Fact]\n    public async Task GetCurrentPageFromTabbedPageWithModalReturnsContentPage()\n    {\n        // Given\n        var expected = new ContentPage();\n        var tabbedPage = new TabbedPage { Title = \"Tab\", Children = { expected } };\n        var window = new Window { Page = tabbedPage };\n        await window.Navigation.PushModalAsync(new DialogContainerPage());\n\n        // When\n        var result = MvvmHelpers.GetCurrentPage(window.Page);\n\n        // Then\n        Assert.Equal(expected, result);\n    }\n\n    /// <summary>\n    /// This test was introduced to verify GH3143\n    /// </summary>\n    /// <a href=\"https://github.com/PrismLibrary/Prism/issues/3143\">Git Hub Issue 3143</a>\n    [Fact]\n    public async Task GetCurrentPageFromTabbedNavigationPageWithModalReturnsContentPage()\n    {\n        // Given\n        var expected = new ContentPage();\n        var navigationPage = new NavigationPage(expected);\n        var tabbedPage = new TabbedPage { Title = \"Tab\", Children = { navigationPage } };\n        var window = new Window { Page = tabbedPage };\n        await window.Navigation.PushModalAsync(new DialogContainerPage());\n\n        // When\n        var result = MvvmHelpers.GetCurrentPage(window.Page);\n\n        // Then\n        Assert.Equal(expected, result);\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Fixtures/Common/UriParsingHelperFixture.cs",
    "content": "﻿using Prism.Common;\n\nnamespace Prism.Maui.Tests.Fixtures.Common;\n#nullable enable\npublic class UriParsingHelperFixture\n{\n    const string _relativeUri = \"MainPage?id=3&name=dan\";\n    const string _absoluteUriWithOutProtocol = \"/MainPage?id=3&name=dan\";\n    const string _absoluteUri = \"htp://www.dansiegel.net/MainPage?id=3&name=dan\";\n    const string _deepLinkAbsoluteUri = \"android-app://HellowWorld/MainPage?id=1/ViewA?id=2/ViewB?id=3/ViewC?id=4\";\n    const string _deepLinkRelativeUri = \"MainPage?id=1/ViewA?id=2/ViewB?id=3/ViewC?id=4\";\n\n    [Fact]\n    public void ParametersParsedFromNullSegment()\n    {\n        var parameters = UriParsingHelper.GetSegmentParameters(null!);\n        Assert.NotNull(parameters);\n    }\n\n    [Fact]\n    public void ParametersParsedFromEmptySegment()\n    {\n        var parameters = UriParsingHelper.GetSegmentParameters(string.Empty);\n        Assert.NotNull(parameters);\n    }\n\n    [Fact]\n    public void ParametersParsedFromRelativeUri()\n    {\n        var parameters = UriParsingHelper.GetSegmentParameters(_relativeUri);\n\n        Assert.NotEmpty(parameters);\n\n        Assert.Contains(\"id\", parameters.Keys);\n        Assert.Contains(\"name\", parameters.Keys);\n\n        Assert.Equal(\"3\", parameters[\"id\"]);\n        Assert.Equal(\"dan\", parameters[\"name\"]);\n    }\n\n    [Fact]\n    public void ParametersParsedFromAbsoluteUri()\n    {\n        var parameters = UriParsingHelper.GetSegmentParameters(_absoluteUri);\n\n        Assert.NotEmpty(parameters);\n\n        Assert.Contains(\"id\", parameters.Keys);\n        Assert.Contains(\"name\", parameters.Keys);\n\n        Assert.Equal(\"3\", parameters[\"id\"]);\n        Assert.Equal(\"dan\", parameters[\"name\"]);\n    }\n\n    [Fact]\n    public void ParametersParsedFromNavigationParametersInRelativeUri()\n    {\n        var navParameters = new NavigationParameters\n            {\n                { \"id\", 3 },\n                { \"name\", \"dan\" }\n            };\n\n        var parameters = UriParsingHelper.GetSegmentParameters(\"MainPage\" + navParameters);\n\n        Assert.NotEmpty(parameters);\n\n        Assert.Contains(\"id\", parameters.Keys);\n        Assert.Contains(\"name\", parameters.Keys);\n\n        Assert.Equal(\"3\", parameters[\"id\"]);\n        Assert.Equal(\"dan\", parameters[\"name\"]);\n    }\n\n    [Fact]\n    public void ParametersParsedFromNavigationParametersInAbsoluteUri()\n    {\n        var navParameters = new NavigationParameters\n            {\n                { \"id\", 3 },\n                { \"name\", \"dan\" }\n            };\n\n        var parameters = UriParsingHelper.GetSegmentParameters(\"http://www.dansiegel.net/MainPage\" + navParameters);\n\n        Assert.NotEmpty(parameters);\n\n        Assert.Contains(\"id\", parameters.Keys);\n        Assert.Contains(\"name\", parameters.Keys);\n\n        Assert.Equal(\"3\", parameters[\"id\"]);\n        Assert.Equal(\"dan\", parameters[\"name\"]);\n    }\n\n    [Fact]\n    public void TargetNameParsedFromEmptySegment()\n    {\n        var target = UriParsingHelper.GetSegmentName(string.Empty);\n        Assert.Equal(string.Empty, target);\n    }\n\n    [Fact]\n    public void TargetNameParsedFromSingleSegment()\n    {\n        var target = UriParsingHelper.GetSegmentName(_relativeUri);\n        Assert.Equal(\"MainPage\", target);\n    }\n\n    [Fact]\n    public void SegmentsParsedFromDeepLinkUri()\n    {\n        var target = UriParsingHelper.GetUriSegments(new Uri(_deepLinkAbsoluteUri));\n        Assert.Equal(4, target.Count);\n    }\n\n    [Fact]\n    public void ParametersParsedFromDeepLinkAbsoluteUri()\n    {\n        var target = UriParsingHelper.GetUriSegments(new Uri(_deepLinkAbsoluteUri));\n        Assert.Equal(4, target.Count);\n\n        var p1 = UriParsingHelper.GetSegmentParameters(target.Dequeue());\n        Assert.Equal(\"1\", p1[\"id\"]);\n\n        var p2 = UriParsingHelper.GetSegmentParameters(target.Dequeue());\n        Assert.Equal(\"2\", p2[\"id\"]);\n\n        var p3 = UriParsingHelper.GetSegmentParameters(target.Dequeue());\n        Assert.Equal(\"3\", p3[\"id\"]);\n\n        var p4 = UriParsingHelper.GetSegmentParameters(target.Dequeue());\n        Assert.Equal(\"4\", p4[\"id\"]);\n    }\n\n    [Fact]\n    public void ParametersParsedFromDeepLinkRelativeUri()\n    {\n        var target = UriParsingHelper.GetUriSegments(new Uri(_deepLinkRelativeUri, UriKind.Relative));\n        Assert.Equal(4, target.Count);\n\n        var p1 = UriParsingHelper.GetSegmentParameters(target.Dequeue());\n        Assert.Equal(\"1\", p1[\"id\"]);\n\n        var p2 = UriParsingHelper.GetSegmentParameters(target.Dequeue());\n        Assert.Equal(\"2\", p2[\"id\"]);\n\n        var p3 = UriParsingHelper.GetSegmentParameters(target.Dequeue());\n        Assert.Equal(\"3\", p3[\"id\"]);\n\n        var p4 = UriParsingHelper.GetSegmentParameters(target.Dequeue());\n        Assert.Equal(\"4\", p4[\"id\"]);\n    }\n\n    [Fact]\n    public void ParametersParsedFromUriWithEmptyPathSegments()\n    {\n        var uri = new Uri(\"app://forms/MainPage//DetailPage\");\n        var target = UriParsingHelper.GetUriSegments(uri);\n        Assert.Equal(2, target.Count);\n    }\n\n    [Fact]\n    public void EnsureAbsoluteUriForRelativeUri()\n    {\n        var uri = UriParsingHelper.EnsureAbsolute(new Uri(_relativeUri, UriKind.Relative));\n        Assert.True(uri.IsAbsoluteUri);\n    }\n\n    [Fact]\n    public void EnsureAbsoluteUriForRelativeUriThatStartsWithSlash()\n    {\n        var uri = UriParsingHelper.EnsureAbsolute(new Uri(\"/\" + _relativeUri, UriKind.Relative));\n        Assert.True(uri.IsAbsoluteUri);\n    }\n\n    [Fact]\n    public void EnsureAbsoluteUriForAbsoluteUri()\n    {\n        var uri = UriParsingHelper.EnsureAbsolute(new Uri(_absoluteUri, UriKind.Absolute));\n        Assert.True(uri.IsAbsoluteUri);\n    }\n\n    [Fact]\n    public void ParseForNull()\n    {\n        var actual = Assert.Throws<ArgumentNullException>(() => UriParsingHelper.Parse(null!));\n        Assert.NotNull(actual);\n        Assert.Equal(\"uri\", actual.ParamName);\n    }\n\n    [Fact]\n    public void ParseForRelativeUri()\n    {\n        var uri = UriParsingHelper.Parse(_relativeUri);\n        Assert.NotNull(uri);\n        Assert.Equal(_relativeUri, uri.OriginalString);\n        Assert.False(uri.IsAbsoluteUri);\n    }\n\n    [Fact]\n    public void ParseForAbsoluteUri()\n    {\n        var uri = UriParsingHelper.Parse(_absoluteUri);\n        Assert.NotNull(uri);\n        Assert.Equal(_absoluteUri, uri.OriginalString);\n        Assert.True(uri.IsAbsoluteUri);\n    }\n\n    [Fact]\n    public void ParseForAbsoluteUriWithOutProtocol()\n    {\n        var uri = UriParsingHelper.Parse(_absoluteUriWithOutProtocol);\n        Assert.NotNull(uri);\n        Assert.Equal(\"http://localhost\" + _absoluteUriWithOutProtocol, uri.OriginalString);\n        Assert.True(uri.IsAbsoluteUri);\n    }\n\n    [Fact]\n    public void ParseForDeepLinkAbsoluteUri()\n    {\n        var uri = UriParsingHelper.Parse(_deepLinkAbsoluteUri);\n        Assert.NotNull(uri);\n        Assert.Equal(_deepLinkAbsoluteUri, uri.OriginalString);\n        Assert.True(uri.IsAbsoluteUri);\n    }\n\n    [Fact]\n    public void ParseForDeepLinkRelativeUri()\n    {\n        var uri = UriParsingHelper.Parse(_deepLinkRelativeUri);\n        Assert.NotNull(uri);\n        Assert.Equal(_deepLinkRelativeUri, uri.OriginalString);\n        Assert.False(uri.IsAbsoluteUri);\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Fixtures/Navigation/NavigationBuilderFixture.cs",
    "content": "﻿using System.Linq;\nusing System.Web;\nusing Microsoft.Maui.Controls;\nusing Moq;\nusing Prism.Common;\nusing Prism.Maui.Tests.Mocks.Ioc;\nusing Prism.Maui.Tests.Navigation.Mocks.Views;\n\nnamespace Prism.Maui.Tests.Fixtures.Navigation;\n\npublic class NavigationBuilderFixture\n{\n    [Fact]\n    public void GeneratesRelativeUriWithSingleSegment()\n    {\n        var uri = Mock.Of<INavigationService>()\n            .CreateBuilder()\n            .AddSegment(\"ViewA\")\n            .Uri;\n\n        Assert.Equal(\"ViewA\", uri.ToString());\n    }\n\n    [Fact]\n    public void GeneratesRelativeUriWithMultipleSegments()\n    {\n        var uri = Mock.Of<INavigationService>()\n            .CreateBuilder()\n            .AddSegment(\"ViewA\")\n            .AddSegment(\"ViewB\")\n            .AddSegment(\"ViewC\")\n            .Uri;\n\n        Assert.Equal(\"ViewA/ViewB/ViewC\", uri.ToString());\n    }\n\n    [Fact]\n    public void GeneratesAbsoluteUriWithSingleSegment()\n    {\n        var uri = Mock.Of<INavigationService>()\n            .CreateBuilder()\n            .AddSegment(\"ViewA\")\n            .UseAbsoluteNavigation()\n            .Uri;\n\n        Assert.Equal(\"http://localhost/ViewA\", uri.ToString());\n    }\n\n    [Fact]\n    public void GeneratesAbsoluteUriWithMultipleSegments()\n    {\n        var uri = Mock.Of<INavigationService>()\n            .CreateBuilder()\n            .AddSegment(\"ViewA\")\n            .AddSegment(\"ViewB\")\n            .AddSegment(\"ViewC\")\n            .UseAbsoluteNavigation()\n            .Uri;\n\n        Assert.Equal(\"http://localhost/ViewA/ViewB/ViewC\", uri.ToString());\n    }\n\n    [Fact]\n    public void GeneratesTabbedPageUriWithCreatedTabs()\n    {\n        var container = new TestContainer();\n        container.RegisterForNavigation<TabbedPage>();\n\n        var navigationService = new Mock<INavigationService>();\n        navigationService\n            .As<IRegistryAware>()\n            .Setup(x => x.Registry)\n            .Returns(container.Resolve<NavigationRegistry>());\n        var uri = navigationService.Object\n            .CreateBuilder()\n            .AddTabbedSegment(b =>\n            {\n                b.CreateTab(\"ViewA\")\n                 .CreateTab(\"ViewB\")\n                 .CreateTab(\"ViewC\");\n            })\n            .Uri;\n\n        Assert.Equal(\"TabbedPage?createTab=ViewA&createTab=ViewB&createTab=ViewC\", uri.ToString());\n    }\n    \n    [Fact]\n    public void GeneratesTabbedPageUriWithTitle()\n    {\n        var container = new TestContainer();\n        container.RegisterForNavigation<TabbedPage>();\n\n        var navigationService = new Mock<INavigationService>();\n        navigationService\n            .As<IRegistryAware>()\n            .Setup(x => x.Registry)\n            .Returns(container.Resolve<NavigationRegistry>());\n        var uri = navigationService.Object\n            .CreateBuilder()\n            .AddTabbedSegment(b =>\n            {\n                b.Title(\"MyTitle\");\n            })\n            .Uri;\n\n        Assert.Equal(\"TabbedPage?title=MyTitle\", uri.ToString());\n    }\n    \n    [Fact]\n    public void GeneratesTabbedPageUriWithCreatedTabsWithTitle()\n    {\n        var container = new TestContainer();\n        container.RegisterForNavigation<TabbedPage>();\n\n        var navigationService = new Mock<INavigationService>();\n        navigationService\n            .As<IRegistryAware>()\n            .Setup(x => x.Registry)\n            .Returns(container.Resolve<NavigationRegistry>());\n        var uri = navigationService.Object\n            .CreateBuilder()\n            .AddTabbedSegment(b =>\n            {\n                b.CreateTab(\"ViewA\")\n                    .CreateTab(\"ViewB\")\n                    .CreateTab(\"ViewC\");\n                b.Title(\"MyTitle\");\n            })\n            .Uri;\n\n        Assert.Equal(\"TabbedPage?createTab=ViewA&createTab=ViewB&createTab=ViewC&title=MyTitle\", uri.ToString());\n    }\n\n    [Fact]\n    public void GeneratesTabbedPageUriWithCreatedTabsWithParameters()\n    {\n        var container = new TestContainer();\n        container.RegisterForNavigation<TabbedPage>();\n\n        var navigationService = new Mock<INavigationService>();\n        navigationService\n            .As<IRegistryAware>()\n            .Setup(x => x.Registry)\n            .Returns(container.Resolve<NavigationRegistry>());\n        var uri = navigationService.Object\n            .CreateBuilder()\n            .AddTabbedSegment(b =>\n            {\n                b.CreateTab(\"ViewA\", t => t.AddParameter(\"id\", 5))\n                 .CreateTab(\"ViewB\", t => t.AddParameter(\"foo\", \"bar\"))\n                 .CreateTab(\"ViewC\");\n            })\n            .Uri;\n\n        Assert.Equal(\"TabbedPage?createTab=ViewA%3Fid%3D5&createTab=ViewB%3Ffoo%3Dbar&createTab=ViewC\", uri.ToString());\n\n        var parameters = UriParsingHelper.GetSegmentParameters(uri.ToString());\n        Assert.Equal(3, parameters.Count);\n        Assert.True(parameters.All(x => x.Key == KnownNavigationParameters.CreateTab));\n\n        Assert.Contains(parameters, x => HttpUtility.UrlDecode(x.Value.ToString()) == \"ViewA?id=5\");\n        Assert.Contains(parameters, x => HttpUtility.UrlDecode(x.Value.ToString()) == \"ViewB?foo=bar\");\n    }\n    \n    [Fact]\n    public void GeneratesTabbedPageUriWithCreatedTabsWithParametersWithTitle()\n    {\n        var container = new TestContainer();\n        container.RegisterForNavigation<TabbedPage>();\n\n        var navigationService = new Mock<INavigationService>();\n        navigationService\n            .As<IRegistryAware>()\n            .Setup(x => x.Registry)\n            .Returns(container.Resolve<NavigationRegistry>());\n        var uri = navigationService.Object\n            .CreateBuilder()\n            .AddTabbedSegment(b =>\n            {\n                b.CreateTab(\"ViewA\", t => t.AddParameter(\"id\", 5))\n                    .CreateTab(\"ViewB\", t => t.AddParameter(\"foo\", \"bar\"))\n                    .CreateTab(\"ViewC\");\n                b.Title(\"MyTitle\");\n            })\n            .Uri;\n\n        Assert.Equal(\"TabbedPage?createTab=ViewA%3Fid%3D5&createTab=ViewB%3Ffoo%3Dbar&createTab=ViewC&title=MyTitle\", uri.ToString());\n\n        var parameters = UriParsingHelper.GetSegmentParameters(uri.ToString());\n        Assert.Equal(4, parameters.Count);\n        Assert.True(parameters.ContainsKey(KnownNavigationParameters.CreateTab));\n        Assert.True(parameters.ContainsKey(KnownNavigationParameters.Title));\n\n        Assert.Contains(parameters, x => HttpUtility.UrlDecode(x.Value.ToString()) == \"ViewA?id=5\");\n        Assert.Contains(parameters, x => HttpUtility.UrlDecode(x.Value.ToString()) == \"ViewB?foo=bar\");\n    }\n\n    [Fact]\n    public void GeneratesCustomTabbedPageUriWithCreatedTabs()\n    {\n        var container = new TestContainer();\n        container.RegisterForNavigation<TabbedPage>();\n        container.RegisterForNavigation<TabbedPageEmptyMock>();\n\n        var navigationService = new Mock<INavigationService>();\n        navigationService\n            .As<IRegistryAware>()\n            .Setup(x => x.Registry)\n            .Returns(container.Resolve<NavigationRegistry>());\n        var uri = navigationService.Object\n            .CreateBuilder()\n            .AddTabbedSegment(\"TabbedPageEmptyMock\", b =>\n            {\n                b.CreateTab(\"ViewA\")\n                 .CreateTab(\"ViewB\")\n                 .CreateTab(\"ViewC\");\n            })\n            .Uri;\n\n        Assert.Equal(\"TabbedPageEmptyMock?createTab=ViewA&createTab=ViewB&createTab=ViewC\", uri.ToString());\n    }\n    \n    [Fact]\n    public void GeneratesCustomTabbedPageUriWithTitle()\n    {\n        var container = new TestContainer();\n        container.RegisterForNavigation<TabbedPage>();\n        container.RegisterForNavigation<TabbedPageEmptyMock>();\n\n        var navigationService = new Mock<INavigationService>();\n        navigationService\n            .As<IRegistryAware>()\n            .Setup(x => x.Registry)\n            .Returns(container.Resolve<NavigationRegistry>());\n        var uri = navigationService.Object\n            .CreateBuilder()\n            .AddTabbedSegment(\"TabbedPageEmptyMock\", b =>\n            {\n                b.Title(\"MyTitle\");\n            })\n            .Uri;\n\n        Assert.Equal(\"TabbedPageEmptyMock?title=MyTitle\", uri.ToString());\n    }\n\n    [Fact]\n    public void GeneratesCustomTabbedPageUriWithCreatedTabsWithParameters()\n    {\n        var container = new TestContainer();\n        container.RegisterForNavigation<TabbedPage>();\n        container.RegisterForNavigation<TabbedPageEmptyMock>();\n\n        var navigationService = new Mock<INavigationService>();\n        navigationService\n            .As<IRegistryAware>()\n            .Setup(x => x.Registry)\n            .Returns(container.Resolve<NavigationRegistry>());\n        var uri = navigationService.Object\n            .CreateBuilder()\n            .AddTabbedSegment(\"TabbedPageEmptyMock\", b =>\n            {\n                b.CreateTab(\"ViewA\", t => t.AddParameter(\"id\", 5))\n                 .CreateTab(\"ViewB\", t => t.AddParameter(\"foo\", \"bar\"))\n                 .CreateTab(\"ViewC\");\n            })\n            .Uri;\n\n        Assert.Equal(\"TabbedPageEmptyMock?createTab=ViewA%3Fid%3D5&createTab=ViewB%3Ffoo%3Dbar&createTab=ViewC\", uri.ToString());\n\n        var parameters = UriParsingHelper.GetSegmentParameters(uri.ToString());\n        Assert.Equal(3, parameters.Count);\n        Assert.True(parameters.All(x => x.Key == KnownNavigationParameters.CreateTab));\n\n        Assert.Contains(parameters, x => HttpUtility.UrlDecode(x.Value.ToString()) == \"ViewA?id=5\");\n        Assert.Contains(parameters, x => HttpUtility.UrlDecode(x.Value.ToString()) == \"ViewB?foo=bar\");\n    }\n    \n    [Fact]\n    public void GeneratesCustomTabbedPageUriWithCreatedTabsWithTitleWithParameters()\n    {\n        var container = new TestContainer();\n        container.RegisterForNavigation<TabbedPage>();\n        container.RegisterForNavigation<TabbedPageEmptyMock>();\n\n        var navigationService = new Mock<INavigationService>();\n        navigationService\n            .As<IRegistryAware>()\n            .Setup(x => x.Registry)\n            .Returns(container.Resolve<NavigationRegistry>());\n        var uri = navigationService.Object\n            .CreateBuilder()\n            .AddTabbedSegment(\"TabbedPageEmptyMock\", b =>\n            {\n                b.CreateTab(\"ViewA\", t => t.AddParameter(\"id\", 5))\n                    .CreateTab(\"ViewB\", t => t.AddParameter(\"foo\", \"bar\"))\n                    .CreateTab(\"ViewC\");\n                b.Title(\"MyTitle\");\n            })\n            .Uri;\n\n        Assert.Equal(\"TabbedPageEmptyMock?createTab=ViewA%3Fid%3D5&createTab=ViewB%3Ffoo%3Dbar&createTab=ViewC&title=MyTitle\", uri.ToString());\n\n        var parameters = UriParsingHelper.GetSegmentParameters(uri.ToString());\n        Assert.Equal(4, parameters.Count);\n        Assert.True(parameters.ContainsKey(KnownNavigationParameters.CreateTab));\n        Assert.True(parameters.ContainsKey(KnownNavigationParameters.Title));\n\n        Assert.Contains(parameters, x => HttpUtility.UrlDecode(x.Value.ToString()) == \"ViewA?id=5\");\n        Assert.Contains(parameters, x => HttpUtility.UrlDecode(x.Value.ToString()) == \"ViewB?foo=bar\");\n    }\n\n    [Fact]\n    public void GeneratesDeepLinkTabCreation()\n    {\n        var container = new TestContainer();\n        container.RegisterForNavigation<TabbedPage>();\n        container.RegisterForNavigation<NavigationPage>();\n\n        var navigationService = new Mock<INavigationService>();\n        navigationService\n            .As<IRegistryAware>()\n            .Setup(x => x.Registry)\n            .Returns(container.Resolve<NavigationRegistry>());\n        var uri = navigationService.Object\n            .CreateBuilder()\n            .AddTabbedSegment(b =>\n                b.CreateTab(t => t.AddNavigationPage()\n                    .AddSegment(\"ViewA\")\n                    .AddSegment(\"ViewB\", s => s.AddParameter(\"id\", 5))\n                    .AddSegment(\"ViewC\"))\n                 .CreateTab(\"ViewD\"))\n            .Uri;\n\n        Assert.Equal(\"TabbedPage?createTab=NavigationPage%2FViewA%2FViewB%3Fid%3D5%2FViewC&createTab=ViewD\", uri.ToString());\n\n        var parameters = UriParsingHelper.GetSegmentParameters(uri.ToString());\n        Assert.Equal(2, parameters.Count);\n        Assert.Contains(parameters, x => HttpUtility.UrlDecode(x.Value.ToString()) == \"NavigationPage/ViewA/ViewB?id=5/ViewC\");\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Fixtures/Navigation/ViewRegistryFixture.cs",
    "content": "﻿using System;\nusing System.Linq;\nusing Microsoft.Maui.Controls;\nusing Prism.Behaviors;\nusing Prism.Common;\nusing Prism.Controls;\nusing Prism.Maui.Tests.Mocks.Ioc;\nusing Prism.Maui.Tests.Mocks.ViewModels;\nusing Prism.Maui.Tests.Mocks.Views;\nusing Prism.Navigation.Xaml;\nusing TabbedPage = Microsoft.Maui.Controls.TabbedPage;\n\nnamespace Prism.Maui.Tests.Fixtures.Navigation;\n\npublic class ViewRegistryFixture\n{\n    [Fact]\n    public void ViewIsRegisteredWithRegistry()\n    {\n        var container = new TestContainer();\n        container.RegisterForNavigation<ContentPageMock>(\"ContentPage\");\n\n        var registry = container.Resolve<NavigationRegistry>();\n        Assert.True(registry.IsRegistered(\"ContentPage\"));\n    }\n\n    [Fact]\n    public void ViewIsNotRegisteredWithRegistry()\n    {\n        var container = new TestContainer();\n\n        var registry = container.Resolve<NavigationRegistry>();\n        Assert.False(registry.IsRegistered(\"FooBar\"));\n    }\n\n    [Fact]\n    public void RegistryHas4Registrations()\n    {\n        var container = new TestContainer();\n        container.RegisterForNavigation<PageMock>();\n        container.RegisterForNavigation<ContentPageMock>(\"ContentPage\");\n        container.RegisterForNavigation<ContentPageMock1>(\"ContentPage1\");\n        container.RegisterForNavigation<SecondContentPageMock>(\"SecondContentPageMock\");\n\n        var registry = container.Resolve<NavigationRegistry>();\n        Assert.Equal(4, registry.Registrations.Count());\n    }\n\n    [Fact]\n    public void CreateView_ViewModelProperty_IsSet()\n    {\n        var container = new TestContainer();\n        container.RegisterInstance(new PageAccessor());\n        container.RegisterForNavigation<ContentPageMock, ContentPageMockViewModel>();\n\n        var registry = container.Resolve<NavigationRegistry>();\n        var page = registry.CreateView(container, \"ContentPageMock\") as Page;\n\n        Assert.NotNull(page);\n        var viewModelType = page.GetValue(ViewModelLocator.ViewModelProperty) as Type;\n        Assert.NotNull(viewModelType);\n        Assert.Equal(typeof(ContentPageMockViewModel), viewModelType);\n    }\n\n    [Fact]\n    public void CreateView_ContainerProperty_IsSet()\n    {\n        var container = new TestContainer();\n        container.RegisterInstance(new PageAccessor());\n        container.RegisterForNavigation<PageMock, PageMockViewModel>();\n\n        var registry = container.Resolve<NavigationRegistry>();\n        var page = registry.CreateView(container, \"PageMock\") as Page;\n\n        Assert.NotNull(page);\n        var attachedContainer = page.GetContainerProvider();\n        Assert.NotNull(attachedContainer);\n    }\n\n    [Fact]\n    public void CreateView_BindingContext_IsSet()\n    {\n        var container = new TestContainer();\n        container.RegisterInstance(new PageAccessor());\n        container.RegisterForNavigation<PageMock, PageMockViewModel>();\n\n        var registry = container.Resolve<NavigationRegistry>();\n        var page = registry.CreateView(container, \"PageMock\") as Page;\n\n        Assert.NotNull(page);\n        Assert.NotNull(page.BindingContext);\n        Assert.IsType<PageMockViewModel>(page.BindingContext);\n    }\n\n    [Fact]\n    public void CreateView_AppliesPageBehaviors()\n    {\n        var container = new TestContainer();\n        container.RegisterInstance(new PageAccessor());\n        container.RegisterForNavigation<PageMock, PageMockViewModel>();\n        container.RegisterPageBehavior<PageLifeCycleAwareBehavior>();\n\n        var registry = container.Resolve<NavigationRegistry>();\n        var page = registry.CreateView(container, \"PageMock\") as Page;\n\n        Assert.NotNull(page);\n        Assert.Single(page.Behaviors);\n        Assert.IsType<PageLifeCycleAwareBehavior>(page.Behaviors.First());\n    }\n\n    [Fact]\n    public void CreateView_WithViewModelLocator_Disabled()\n    {\n        var container = new TestContainer();\n        container.RegisterInstance(new PageAccessor());\n        container.RegisterForNavigation<VMLDisabledPageMock>();\n\n        var registry = container.Resolve<NavigationRegistry>();\n        VMLDisabledPageMock page = null;\n\n        var ex = Record.Exception(() => page = registry.CreateView(container, \"VMLDisabledPageMock\") as VMLDisabledPageMock);\n\n        Assert.Null(ex);\n        Assert.NotNull(page);\n        Assert.IsNotType<VMLDisabledPageMockViewModel>(page.BindingContext);\n    }\n\n    [Fact]\n    public void TabbedPageRegistrationIsReturnedForViewOfType()\n    {\n        var container = new TestContainer();\n        container.RegisterForNavigation<TabbedPage>();\n\n        var registry = container.Resolve<NavigationRegistry>();\n        var registrations = registry.ViewsOfType(typeof(TabbedPage));\n\n        Assert.Single(registrations);\n        Assert.Equal(typeof(TabbedPage), registrations.First().View);\n    }\n\n    [Fact]\n    public void NavigationPageRegistrationIsReturnedForViewOfType()\n    {\n        var container = new TestContainer();\n        container.RegisterForNavigation<NavigationPage>();\n\n        var registry = container.Resolve<NavigationRegistry>();\n        var registrations = registry.ViewsOfType(typeof(NavigationPage));\n\n        Assert.Single(registrations);\n        Assert.Equal(typeof(NavigationPage), registrations.First().View);\n    }\n\n    [Fact]\n    public void PrismNavigationPageRegistrationIsReturnedForViewOfType()\n    {\n        var container = new TestContainer();\n        container.RegisterForNavigation<PrismNavigationPage>();\n\n        var registry = container.Resolve<NavigationRegistry>();\n        var registrations = registry.ViewsOfType(typeof(NavigationPage));\n\n        Assert.Single(registrations);\n        Assert.Equal(typeof(PrismNavigationPage), registrations.First().View);\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Fixtures/Navigation/Xaml/GoBackExtensionFixture.cs",
    "content": "using Microsoft.Extensions.Logging;\nusing Microsoft.Maui.Controls;\nusing Moq;\nusing Prism.Common;\nusing Prism.Maui.Tests.Mocks.Ioc;\nusing Prism.Maui.Tests.Mocks.ViewModels;\nusing Prism.Maui.Tests.Mocks.Views;\nusing Prism.Navigation.Xaml;\nusing System;\n\nnamespace Prism.Maui.Tests.Fixtures.Navigation.Xaml;\n\npublic class GoBackExtensionFixture\n{\n    [Fact]\n    public void Execute_GoBackTypeDefault_GoesBackAPage()\n    {\n        var mockNavigation = Mock.Of<INavigationService>();\n        var container = new TestContainer();\n        container.RegisterInstance(mockNavigation);\n        container.RegisterInstance(new PageAccessor());\n        container.RegisterForNavigation<PageMock, PageMockViewModel>();\n        var mockLoggingProvider = new Mock<ILoggerFactory>();\n        mockLoggingProvider.Setup(x => x.CreateLogger(It.IsAny<string>()))\n            .Returns(Mock.Of<ILogger>());\n        container.RegisterInstance(mockLoggingProvider.Object);\n\n        var registry = container.Resolve<NavigationRegistry>();\n        var page = registry.CreateView(container, \"PageMock\") as Page;\n        var extension = new GoBackExtension();\n        extension.Page = page;\n\n        extension.Execute(default);\n\n        Mock.Get(mockNavigation)\n            .Verify(x => x.GoBackAsync(It.IsAny<INavigationParameters>()), Times.Once);\n    }\n\n    [Theory]\n    [InlineData(true, true)]\n    [InlineData(false, true)]\n    [InlineData(true, false)]\n    [InlineData(false, false)]\n    public void Execute_GoBackTypeDefault_NavigationParameters_HasKnownNavigationParameters(bool animated, bool? useModalNavigation)\n    {\n        var mockNavigation = Mock.Of<INavigationService>();\n        var container = new TestContainer();\n        container.RegisterInstance(mockNavigation);\n        container.RegisterInstance(new PageAccessor());\n        container.RegisterForNavigation<PageMock, PageMockViewModel>();\n        var mockLoggingProvider = new Mock<ILoggerFactory>();\n        mockLoggingProvider.Setup(x => x.CreateLogger(It.IsAny<string>()))\n            .Returns(Mock.Of<ILogger>());\n        container.RegisterInstance(mockLoggingProvider.Object);\n\n        INavigationParameters parameters = default;\n        Mock.Get(mockNavigation)\n            .Setup(x => x.GoBackAsync(It.IsAny<INavigationParameters>()))\n            .Callback<INavigationParameters>(navParameters =>\n            {\n                parameters = navParameters;\n            })\n            .ReturnsAsync(new NavigationResult(new Exception()));\n\n        var registry = container.Resolve<NavigationRegistry>();\n        var page = registry.CreateView(container, \"PageMock\") as Page;\n        var extension = new GoBackExtension();\n        extension.Page = page;\n        extension.Animated = animated;\n        extension.UseModalNavigation = useModalNavigation;\n\n        extension.Execute(default);\n\n        Assert.True(parameters.ContainsKey(KnownNavigationParameters.Animated));\n        Assert.Equal(animated, parameters.GetValue<bool>(KnownNavigationParameters.Animated));\n\n        Assert.True(parameters.ContainsKey(KnownNavigationParameters.UseModalNavigation));\n        Assert.Equal(useModalNavigation, parameters.GetValue<bool?>(KnownNavigationParameters.UseModalNavigation));\n    }\n\n    [Fact]\n    public void Execute_GoBackTypeToRoot_GoesBackToRoot()\n    {\n        var mockNavigation = Mock.Of<INavigationService>();\n        var container = new TestContainer();\n        container.RegisterInstance(mockNavigation);\n        container.RegisterInstance(new PageAccessor());\n        container.RegisterForNavigation<PageMock, PageMockViewModel>();\n        var mockLoggingProvider = new Mock<ILoggerFactory>();\n        mockLoggingProvider.Setup(x => x.CreateLogger(It.IsAny<string>()))\n            .Returns(Mock.Of<ILogger>());\n        container.RegisterInstance(mockLoggingProvider.Object);\n\n        var registry = container.Resolve<NavigationRegistry>();\n        var page = registry.CreateView(container, \"PageMock\") as Page;\n        var extension = new GoBackExtension();\n        extension.Page = page;\n        extension.GoBackType = GoBackType.ToRoot;\n\n        extension.Execute(default);\n\n        Mock.Get(mockNavigation)\n            .Verify(x => x.GoBackToRootAsync(It.IsAny<INavigationParameters>()), Times.Once);\n    }\n\n    [Fact]\n    public void Execute_GoBackTypeToRoot_NavigationParameters_DoNotHaveKnownNavigationParameters()\n    {\n        var mockNavigation = Mock.Of<INavigationService>();\n        var container = new TestContainer();\n        container.RegisterInstance(mockNavigation);\n        container.RegisterInstance(new PageAccessor());\n        container.RegisterForNavigation<PageMock, PageMockViewModel>();\n        var mockLoggingProvider = new Mock<ILoggerFactory>();\n        mockLoggingProvider.Setup(x => x.CreateLogger(It.IsAny<string>()))\n            .Returns(Mock.Of<ILogger>());\n        container.RegisterInstance(mockLoggingProvider.Object);\n\n        INavigationParameters parameters = default;\n        Mock.Get(mockNavigation)\n            .Setup(x => x.GoBackToRootAsync(It.IsAny<INavigationParameters>()))\n            .Callback<INavigationParameters>(navParameters =>\n            {\n                parameters = navParameters;\n            })\n            .ReturnsAsync(new NavigationResult(new Exception()));\n\n        var registry = container.Resolve<NavigationRegistry>();\n        var page = registry.CreateView(container, \"PageMock\") as Page;\n        var extension = new GoBackExtension();\n        extension.Page = page;\n        extension.GoBackType = GoBackType.ToRoot;\n\n        extension.Execute(default);\n\n        Assert.False(parameters.ContainsKey(KnownNavigationParameters.Animated));\n        Assert.False(parameters.ContainsKey(KnownNavigationParameters.UseModalNavigation));\n    }\n\n    [Fact]\n    public void Execute_GoBackTypeDefault_CommandParameter_IncludedInNavigationParameters()\n    {\n        var mockNavigation = Mock.Of<INavigationService>();\n        var container = new TestContainer();\n        container.RegisterInstance(mockNavigation);\n        container.RegisterInstance(new PageAccessor());\n        container.RegisterForNavigation<PageMock, PageMockViewModel>();\n        var mockLoggingProvider = new Mock<ILoggerFactory>();\n        mockLoggingProvider.Setup(x => x.CreateLogger(It.IsAny<string>()))\n            .Returns(Mock.Of<ILogger>());\n        container.RegisterInstance(mockLoggingProvider.Object);\n\n        INavigationParameters parameters = default;\n        Mock.Get(mockNavigation)\n            .Setup(x => x.GoBackAsync(It.IsAny<INavigationParameters>()))\n            .Callback<INavigationParameters>(navParameters =>\n            {\n                parameters = navParameters;\n            })\n            .ReturnsAsync(new NavigationResult(new Exception()));\n\n        var registry = container.Resolve<NavigationRegistry>();\n        var page = registry.CreateView(container, \"PageMock\") as Page;\n        var extension = new GoBackExtension();\n        extension.Page = page;\n\n        extension.Execute(\"command parameter\");\n\n        Assert.True(parameters.ContainsKey(KnownNavigationParameters.XamlParam));\n        Assert.Equal(\"command parameter\", parameters.GetValue<string>(KnownNavigationParameters.XamlParam));\n    }\n\n    [Fact]\n    public void Execute_GoBackTypeToRoot_CommandParameter_IncludedInNavigationParameters()\n    {\n        var mockNavigation = Mock.Of<INavigationService>();\n        var container = new TestContainer();\n        container.RegisterInstance(mockNavigation);\n        container.RegisterInstance(new PageAccessor());\n        container.RegisterForNavigation<PageMock, PageMockViewModel>();\n        var mockLoggingProvider = new Mock<ILoggerFactory>();\n        mockLoggingProvider.Setup(x => x.CreateLogger(It.IsAny<string>()))\n            .Returns(Mock.Of<ILogger>());\n        container.RegisterInstance(mockLoggingProvider.Object);\n\n        INavigationParameters parameters = default;\n        Mock.Get(mockNavigation)\n            .Setup(x => x.GoBackToRootAsync(It.IsAny<INavigationParameters>()))\n            .Callback<INavigationParameters>(navParameters =>\n            {\n                parameters = navParameters;\n            })\n            .ReturnsAsync(new NavigationResult(new Exception()));\n\n        var registry = container.Resolve<NavigationRegistry>();\n        var page = registry.CreateView(container, \"PageMock\") as Page;\n        var extension = new GoBackExtension();\n        extension.Page = page;\n        extension.GoBackType = GoBackType.ToRoot;\n\n        extension.Execute(\"command parameter\");\n\n        Assert.True(parameters.ContainsKey(KnownNavigationParameters.XamlParam));\n        Assert.Equal(\"command parameter\", parameters.GetValue<string>(KnownNavigationParameters.XamlParam));\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Fixtures/Navigation/Xaml/NavigateToExtensionFixture.cs",
    "content": "using Microsoft.Extensions.Logging;\nusing Microsoft.Maui.Controls;\nusing Moq;\nusing Prism.Common;\nusing Prism.Maui.Tests.Mocks.Ioc;\nusing Prism.Maui.Tests.Mocks.ViewModels;\nusing Prism.Maui.Tests.Mocks.Views;\nusing Prism.Navigation.Xaml;\nusing System;\n\nnamespace Prism.Maui.Tests.Fixtures.Navigation.Xaml;\n\npublic class NavigateToExtensionFixture\n{\n    [Fact]\n    public void Execute_NameIsNull_DoesNotNavigateToPage()\n    {\n        var mockNavigation = Mock.Of<INavigationService>();\n        var logFactory = new Mock<ILoggerFactory>();\n        logFactory.Setup(x => x.CreateLogger(It.IsAny<string>()))\n            .Returns(Mock.Of<ILogger>());\n        var container = new TestContainer();\n        container.RegisterInstance(mockNavigation);\n        container.RegisterInstance(new PageAccessor());\n        container.RegisterForNavigation<PageMock, PageMockViewModel>();\n        container.RegisterInstance<ILoggerFactory>(logFactory.Object);\n\n        var registry = container.Resolve<NavigationRegistry>();\n        var page = registry.CreateView(container, \"PageMock\") as Page;\n        var extension = new NavigateToExtension();\n        extension.Page = page;\n\n        var ex = Record.Exception(() => extension.Execute(default));\n\n        Mock.Get(mockNavigation)\n            .Verify(x => x.NavigateAsync(It.IsAny<Uri>(), It.IsAny<INavigationParameters>()), Times.Never);\n    }\n\n    [Fact]\n    public void Execute_NameIsSet_NavigatesToPage()\n    {\n        var mockNavigation = Mock.Of<INavigationService>();\n        var container = new TestContainer();\n        container.RegisterInstance(mockNavigation);\n        container.RegisterInstance(new PageAccessor());\n        container.RegisterForNavigation<PageMock, PageMockViewModel>();\n\n        Mock.Get(mockNavigation)\n            .Setup(x => x.NavigateAsync(It.IsAny<Uri>(), It.IsAny<INavigationParameters>()))\n            .ReturnsAsync(new NavigationResult());\n\n        var registry = container.Resolve<NavigationRegistry>();\n        var page = registry.CreateView(container, \"PageMock\") as Page;\n        var extension = new NavigateToExtension();\n        extension.Page = page;\n        extension.Name = \"ViewA\";\n\n        extension.Execute(default);\n\n        Mock.Get(mockNavigation)\n            .Verify(x => x.NavigateAsync(It.Is<Uri>(uri => uri.OriginalString == \"ViewA\"), It.IsAny<INavigationParameters>()), Times.Once);\n    }\n\n    [Theory]\n    [InlineData(true, true)]\n    [InlineData(false, true)]\n    [InlineData(true, false)]\n    [InlineData(false, false)]\n    public void Execute_NavigationParameters_HasKnownNavigationParameters(bool animated, bool? useModalNavigation)\n    {\n        var mockNavigation = Mock.Of<INavigationService>();\n        var logFactory = new Mock<ILoggerFactory>();\n        logFactory.Setup(x => x.CreateLogger(It.IsAny<string>()))\n            .Returns(Mock.Of<ILogger>());\n\n        var container = new TestContainer();\n        container.RegisterInstance(mockNavigation);\n        container.RegisterInstance(new PageAccessor());\n        container.RegisterForNavigation<PageMock, PageMockViewModel>();\n        container.RegisterInstance(logFactory.Object);\n\n        INavigationParameters parameters = default;\n        Mock.Get(mockNavigation)\n            .Setup(x => x.NavigateAsync(It.IsAny<Uri>(), It.IsAny<INavigationParameters>()))\n            .Callback<Uri, INavigationParameters>((uri, navParameters) =>\n            {\n                parameters = navParameters;\n            })\n            .ReturnsAsync(new NavigationResult(new Exception()));\n\n        var registry = container.Resolve<NavigationRegistry>();\n        var page = registry.CreateView(container, \"PageMock\") as Page;\n        var extension = new NavigateToExtension();\n        extension.Page = page;\n        extension.Name = \"ViewA\";\n        extension.Animated = animated;\n        extension.UseModalNavigation = useModalNavigation;\n\n        extension.Execute(default);\n\n        Assert.True(parameters.ContainsKey(KnownNavigationParameters.Animated));\n        Assert.Equal(animated, parameters.GetValue<bool>(KnownNavigationParameters.Animated));\n\n        Assert.True(parameters.ContainsKey(KnownNavigationParameters.UseModalNavigation));\n        Assert.Equal(useModalNavigation, parameters.GetValue<bool?>(KnownNavigationParameters.UseModalNavigation));\n    }\n\n    [Fact]\n    public void Execute_CommandParameter_IncludedInNavigationParameters()\n    {\n        var mockNavigation = Mock.Of<INavigationService>();\n        var container = new TestContainer();\n        container.RegisterInstance(mockNavigation);\n        container.RegisterInstance(new PageAccessor());\n        container.RegisterForNavigation<PageMock, PageMockViewModel>();\n\n        INavigationParameters parameters = default;\n        Mock.Get(mockNavigation)\n            .Setup(x => x.NavigateAsync(It.IsAny<Uri>(), It.IsAny<INavigationParameters>()))\n            .Callback<Uri, INavigationParameters>((uri, navParameters) =>\n            {\n                parameters = navParameters;\n            })\n            .ReturnsAsync(new NavigationResult());\n\n        var registry = container.Resolve<NavigationRegistry>();\n        var page = registry.CreateView(container, \"PageMock\") as Page;\n        var extension = new NavigateToExtension();\n        extension.Page = page;\n        extension.Name = \"ViewA\";\n\n        extension.Execute(\"command parameter\");\n\n        Assert.True(parameters.ContainsKey(KnownNavigationParameters.XamlParam));\n        Assert.Equal(\"command parameter\", parameters.GetValue<string>(KnownNavigationParameters.XamlParam));\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Fixtures/PageNavigationServiceFixture.cs",
    "content": "﻿using System;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing Moq;\nusing Prism.Common;\nusing Prism.Maui.Tests.Mocks;\nusing Prism.Maui.Tests.Mocks.ViewModels;\nusing Prism.Maui.Tests.Mocks.Views;\nusing Prism.Maui.Tests.Navigation.Mocks.Views;\nusing Prism.Ioc;\nusing Prism.Navigation;\nusing Xunit;\nusing Microsoft.Maui.Controls;\nusing Microsoft.Maui;\n\nnamespace Prism.Maui.Tests.Navigation\n{\n    public class PageNavigationServiceFixture : IDisposable\n    {\n        PageNavigationContainerMock _container;\n        ApplicationMock _app;\n\n        public PageNavigationServiceFixture()\n        {\n            //Mocks.MockForms.Init();\n            //Microsoft.Maui.Controls.Compatibility.Forms.Init(activationState);\n\n            ContainerLocator.ResetContainer();\n            NavigationRegistry.ClearRegistrationCache();\n            _container = new PageNavigationContainerMock();\n            ContainerLocator.SetContainerExtension(() => _container);\n\n            _container.RegisterForNavigation<PageMock>();\n\n            _container.RegisterForNavigation<ContentPageMock>(\"ContentPage\");\n            _container.RegisterForNavigation<ContentPageMock1>(\"ContentPage1\");\n\n            _container.RegisterForNavigation<ContentPageMock>(typeof(ContentPageMockViewModel).FullName);\n            _container.RegisterForNavigation<ContentPageMock1>(typeof(ContentPageMock1ViewModel).FullName);\n\n            _container.RegisterForNavigation<SecondContentPageMock>(\"SecondContentPageMock\");\n\n            _container.RegisterForNavigation<NavigationPageMock>(\"NavigationPage\");\n            _container.RegisterForNavigation<NavigationPageEmptyMock>(\"NavigationPage-Empty\");\n            _container.RegisterForNavigation<NavigationPageEmptyMock_Reused>(\"NavigationPage-Empty-Reused\");\n            _container.RegisterForNavigation<NavigationPageWithStackMock>(\"NavigationPageWithStack\");\n            _container.RegisterForNavigation<NavigationPageWithStackNoMatchMock>(\"NavigationPageWithStackNoMatch\");\n\n            _container.RegisterForNavigation<FlyoutPageMock>(\"FlyoutPage\");\n            _container.RegisterForNavigation<FlyoutPageEmptyMock>(\"FlyoutPage-Empty\");\n\n\n            _container.RegisterForNavigation<TabbedPageMock>(\"TabbedPage\");\n            _container.RegisterForNavigation<TabbedPageEmptyMock>(\"TabbedPage-Empty\");\n            _container.RegisterForNavigation<Tab1Mock>(\"Tab1\");\n            _container.RegisterForNavigation<Tab2Mock>(\"Tab2\");\n            _container.RegisterForNavigation<Tab3Mock>(\"Tab3\");\n\n            _app = new ApplicationMock();\n        }\n\n        [Fact]\n        public void IPageAware_NullByDefault()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var page = ((IPageAware)navigationService).Page;\n            Assert.Null(page);\n        }\n\n        [Fact]\n        public void Navigate_ToUnregisteredPage_ByName()\n        {\n            Assert.ThrowsAsync<NullReferenceException>(async () =>\n            {\n                var navigationService = new PageNavigationServiceMock(_container, _app);\n                var rootPage = new ContentPage();\n                ((IPageAware)navigationService).Page = rootPage;\n\n                await navigationService.NavigateAsync(\"UnregisteredPage\");\n\n                Assert.True(rootPage.Navigation.ModalStack.Count == 0);\n            });\n        }\n\n        [Fact]\n        public async void Navigate_ToContentPage_ByName()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync(\"ContentPage\");\n\n            Assert.Single(rootPage.Navigation.ModalStack);\n            Assert.IsType<ContentPageMock>(rootPage.Navigation.ModalStack[0]);\n        }\n\n        [Fact]\n        public async void Navigate_ToContentPage_ByRelativeUri()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync(new Uri(\"ContentPage\", UriKind.Relative));\n\n            Assert.Single(rootPage.Navigation.ModalStack);\n            Assert.IsType<ContentPageMock>(rootPage.Navigation.ModalStack[0]);\n        }\n\n        [Fact]\n        public async void Navigate_ToContentPage_ByAbsoluteName()\n        {\n            // Set up top page.\n            var recorder = new PageNavigationEventRecorder();\n            var rootPage = new ContentPageMock(recorder);\n            var rootPageViewModel = (ViewModelBase)rootPage.BindingContext;\n            var applicationProvider = new ApplicationMock(rootPage);\n            var navigationService = new PageNavigationServiceMock(_container, applicationProvider, recorder);\n\n            await navigationService.NavigateAsync(\"/ContentPage\");\n\n            var navigatedPage = applicationProvider.MainPage as Page;\n            Assert.IsType<ContentPageMock>(navigatedPage);\n            Assert.NotEqual(rootPage, _app.MainPage);\n\n            var record = recorder.TakeFirst();\n            Assert.Equal(navigatedPage, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnInitialized, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(navigatedPage.BindingContext, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnInitialized, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(navigatedPage, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnInitializedAsync, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(navigatedPage.BindingContext, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnInitializedAsync, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(rootPage, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnNavigatedFrom, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(rootPageViewModel, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnNavigatedFrom, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(navigatedPage, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnNavigatedTo, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(navigatedPage.BindingContext, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnNavigatedTo, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(rootPage, record.Sender);\n            Assert.Equal(PageNavigationEvent.Destroy, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(rootPageViewModel, record.Sender);\n            Assert.Equal(PageNavigationEvent.Destroy, record.Event);\n\n            Assert.True(recorder.IsEmpty);\n        }\n\n        [Fact]\n        public async void Navigate_ToContentPage_ByAbsoluteUri()\n        {\n            // Set up top page.\n            var recorder = new PageNavigationEventRecorder(); ;\n            var rootPage = new ContentPageMock(recorder);\n            var rootPageViewModel = (ViewModelBase)rootPage.BindingContext;\n            var applicationProvider = new ApplicationMock(rootPage);\n            var navigationService = new PageNavigationServiceMock(_container, applicationProvider, recorder);\n\n            await navigationService.NavigateAsync(new Uri(\"http://localhost/ContentPage\", UriKind.Absolute));\n\n            var navigatedPage = applicationProvider.MainPage as Page;\n            Assert.IsType<ContentPageMock>(navigatedPage);\n            Assert.NotEqual(rootPage, _app.MainPage);\n\n            var record = recorder.TakeFirst();\n            Assert.Equal(navigatedPage, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnInitialized, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(navigatedPage.BindingContext, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnInitialized, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(navigatedPage, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnInitializedAsync, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(navigatedPage.BindingContext, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnInitializedAsync, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(rootPage, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnNavigatedFrom, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(rootPageViewModel, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnNavigatedFrom, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(navigatedPage, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnNavigatedTo, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(navigatedPage.BindingContext, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnNavigatedTo, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(rootPage, record.Sender);\n            Assert.Equal(PageNavigationEvent.Destroy, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(rootPageViewModel, record.Sender);\n            Assert.Equal(PageNavigationEvent.Destroy, record.Event);\n\n            Assert.True(recorder.IsEmpty);\n        }\n\n\n\n        [Fact]\n        public async void Navigate_ToContentPage_ByName_WithNavigationParameters()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            var navParameters = new NavigationParameters\n            {\n                { \"id\", 3 }\n            };\n\n            await navigationService.NavigateAsync(\"ContentPage\", navParameters);\n\n            Assert.Single(rootPage.Navigation.ModalStack);\n            Assert.IsType<ContentPageMock>(rootPage.Navigation.ModalStack[0]);\n\n            var viewModel = rootPage.Navigation.ModalStack[0].BindingContext as ContentPageMockViewModel;\n            Assert.NotNull(viewModel);\n\n            Assert.NotNull(viewModel.NavigatedToParameters);\n            Assert.True(viewModel.NavigatedToParameters.Count > 0);\n            Assert.Equal(3, viewModel.NavigatedToParameters[\"id\"]);\n        }\n\n        [Fact]\n        public async void Navigate_ToContentPage_ThenGoBack()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync(\"ContentPage\");\n\n            Assert.Single(rootPage.Navigation.ModalStack);\n            Assert.IsType<ContentPageMock>(rootPage.Navigation.ModalStack[0]);\n\n            var result = await navigationService.GoBackAsync();\n\n            Assert.True(result.Success);\n            Assert.True(rootPage.Navigation.ModalStack.Count == 0);\n        }\n\n        [Fact]\n        public async void NavigateAsync_ToContentPage_ThenGoBack()\n        {\n            var pageMock = new ContentPageMock();\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            ((IPageAware)navigationService).Page = pageMock;\n\n            var rootPage = new NavigationPage(pageMock);\n\n            Assert.IsType<ContentPageMock>(rootPage.CurrentPage);\n\n            await navigationService.NavigateAsync(\"TabbedPage\");\n\n            Assert.True(rootPage.Navigation.NavigationStack.Count == 2);\n            Assert.IsType<TabbedPageMock>(rootPage.CurrentPage);\n            var tabbedPageMock = rootPage.CurrentPage as TabbedPageMock;\n            Assert.NotNull(tabbedPageMock);\n            var viewModel = (ViewModelBase)tabbedPageMock.BindingContext;\n\n            var result = await navigationService.GoBackAsync();\n\n            Assert.True(result.Success);\n            Assert.Single(rootPage.Navigation.NavigationStack);\n            Assert.IsType<ContentPageMock>(rootPage.CurrentPage);\n            Assert.True(tabbedPageMock.DestroyCalled);\n            Assert.Null(tabbedPageMock.BindingContext);\n            Assert.True(viewModel.DestroyCalled);\n        }\n\n        [Fact]\n        public async void Navigate_ToContentPage_ViewModelHasINavigationAware()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync(\"ContentPage\");\n\n            Assert.Single(rootPage.Navigation.ModalStack);\n            Assert.IsType<ContentPageMock>(rootPage.Navigation.ModalStack[0]);\n\n            var viewModel = rootPage.Navigation.ModalStack[0].BindingContext as ContentPageMockViewModel;\n            Assert.NotNull(viewModel);\n            Assert.True(viewModel.OnNavigatedToCalled);\n\n            var nextPageNavService = new PageNavigationServiceMock(_container, _app);\n            ((IPageAware)nextPageNavService).Page = rootPage.Navigation.ModalStack[0];\n            await nextPageNavService.NavigateAsync(\"NavigationPage\");\n\n            Assert.True(viewModel.OnNavigatedFromCalled);\n        }\n\n        [Fact]\n        public async void Navigate_ToContentPage_PageHasINavigationAware()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync(\"ContentPage\");\n\n            Assert.Single(rootPage.Navigation.ModalStack);\n\n            var contentPage = rootPage.Navigation.ModalStack[0] as ContentPageMock;\n            Assert.NotNull(contentPage);\n            Assert.True(contentPage.OnNavigatedToCalled);\n\n            var nextPageNavService = new PageNavigationServiceMock(_container, _app);\n            ((IPageAware)nextPageNavService).Page = contentPage;\n\n            await nextPageNavService.NavigateAsync(\"NavigationPage\");\n\n            Assert.True(contentPage.OnNavigatedFromCalled);\n            Assert.Single(contentPage.Navigation.ModalStack);\n        }\n\n        [Fact]\n        public async void Navigate_ToContentPage_PageHasIConfirmNavigation_True()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPageMock();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            Assert.False(rootPage.OnConfirmNavigationCalled);\n\n            await navigationService.NavigateAsync(\"ContentPage\");\n\n            Assert.True(rootPage.OnConfirmNavigationCalled);\n            Assert.Single(rootPage.Navigation.ModalStack);\n        }\n\n        [Fact]\n        public async void Navigate_ToContentPage_PageHasIConfirmNavigation_False()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPageMock();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            Assert.False(rootPage.OnConfirmNavigationCalled);\n\n            var navParams = new NavigationParameters\n            {\n                { \"canNavigate\", false }\n            };\n\n            await navigationService.NavigateAsync(\"ContentPage\", navParams);\n\n            Assert.True(rootPage.OnConfirmNavigationCalled);\n            Assert.True(rootPage.Navigation.ModalStack.Count == 0);\n        }\n\n        [Fact]\n        public async void Navigate_ToContentPage_ViewModelHasIConfirmNavigation_True()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage() { BindingContext = new ContentPageMockViewModel() };\n            ((IPageAware)navigationService).Page = rootPage;\n\n            var viewModel = rootPage.BindingContext as ContentPageMockViewModel;\n            Assert.False(viewModel.OnConfirmNavigationCalled);\n\n            await navigationService.NavigateAsync(\"ContentPage\");\n            Assert.Single(rootPage.Navigation.ModalStack);\n\n            Assert.NotNull(viewModel);\n            Assert.True(viewModel.OnConfirmNavigationCalled);\n        }\n\n        [Fact]\n        public async void Navigate_ToContentPage_ViewModelHasIConfirmNavigation_False()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage() { BindingContext = new ContentPageMockViewModel() };\n            ((IPageAware)navigationService).Page = rootPage;\n\n            var viewModel = rootPage.BindingContext as ContentPageMockViewModel;\n            Assert.False(viewModel.OnConfirmNavigationCalled);\n\n            var navParams = new NavigationParameters\n            {\n                { \"canNavigate\", false }\n            };\n\n            await navigationService.NavigateAsync(\"ContentPage\", navParams);\n\n            Assert.True(viewModel.OnConfirmNavigationCalled);\n            Assert.True(rootPage.Navigation.ModalStack.Count == 0);\n        }\n\n        [Fact]\n        public async void GoBack_ViewModelWithIConfirmNavigationFalse_ResultException()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage() { BindingContext = new ContentPageMockViewModel() };\n            ((IPageAware)navigationService).Page = rootPage;\n\n            var viewModel = rootPage.BindingContext as ContentPageMockViewModel;\n\n            var navParams = new NavigationParameters\n            {\n                { \"canNavigate\", false }\n            };\n\n            var navigationResult = await navigationService.GoBackAsync(navParams);\n\n            Assert.True(viewModel.OnConfirmNavigationCalled);\n            Assert.NotNull(navigationResult.Exception);\n            Assert.IsType<NavigationException>(navigationResult.Exception);\n            Assert.False(navigationResult.Success);\n            Assert.Equal(NavigationException.IConfirmNavigationReturnedFalse, navigationResult.Exception.Message);\n        }\n\n        [Fact]\n        public async void GoBackToRoot_ViewModelWithIConfirmNavigationFalse_ResultException()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage() { BindingContext = new ContentPageMockViewModel() };\n            ((IPageAware)navigationService).Page = rootPage;\n\n            var viewModel = rootPage.BindingContext as ContentPageMockViewModel;\n\n            var navParams = new NavigationParameters\n            {\n                { \"canNavigate\", false }\n            };\n\n            var navigationResult = await navigationService.GoBackToRootAsync(navParams);\n\n            Assert.True(viewModel.OnConfirmNavigationCalled);\n            Assert.NotNull(navigationResult.Exception);\n            Assert.IsType<NavigationException>(navigationResult.Exception);\n            Assert.False(navigationResult.Success);\n            Assert.Equal(NavigationException.IConfirmNavigationReturnedFalse, navigationResult.Exception.Message);\n        }\n\n        [Fact]\n        public async void NavigateAsync_ViewModelWithIConfirmNavigationFalse_ResultException()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage() { BindingContext = new ContentPageMockViewModel() };\n            ((IPageAware)navigationService).Page = rootPage;\n\n            var viewModel = rootPage.BindingContext as ContentPageMockViewModel;\n\n            var navParams = new NavigationParameters\n            {\n                { \"canNavigate\", false }\n            };\n\n            var navigationResult = await navigationService.NavigateAsync(\"ContentPage\", navParams);\n\n            Assert.True(viewModel.OnConfirmNavigationCalled);\n            Assert.NotNull(navigationResult.Exception);\n            Assert.IsType<NavigationException>(navigationResult.Exception);\n            Assert.False(navigationResult.Success);\n            Assert.Equal(NavigationException.IConfirmNavigationReturnedFalse, navigationResult.Exception.Message);\n        }\n\n        [Fact]\n        public async void Navigate_ToNavigatonPage_ViewModelHasINavigationAware()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync(\"NavigationPage\");\n\n            Assert.Single(rootPage.Navigation.ModalStack);\n            Assert.IsType<NavigationPageMock>(rootPage.Navigation.ModalStack[0]);\n\n            var viewModel = rootPage.Navigation.ModalStack[0].BindingContext as NavigationPageMockViewModel;\n            Assert.NotNull(viewModel);\n            Assert.True(viewModel.OnNavigatedToCalled);\n        }\n\n        [Fact]\n        public async void Navigate_ToFlyoutPage_ViewModelHasINavigationAware()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync(\"FlyoutPage\");\n\n            Assert.Single(rootPage.Navigation.ModalStack);\n\n            var mdPage = rootPage.Navigation.ModalStack[0] as FlyoutPage;\n            Assert.NotNull(mdPage);\n\n            var viewModel = mdPage.BindingContext as FlyoutPageMockViewModel;\n            Assert.NotNull(viewModel);\n            Assert.True(viewModel.OnNavigatedToCalled);\n        }\n\n        [Fact]\n        public async void Navigate_ToTabbedPage_ByName_ViewModelHasINavigationAware()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync(\"TabbedPage\");\n\n            Assert.Single(rootPage.Navigation.ModalStack);\n\n            var mdPage = rootPage.Navigation.ModalStack[0] as TabbedPageMock;\n            Assert.NotNull(mdPage);\n\n            var viewModel = mdPage.BindingContext as TabbedPageMockViewModel;\n            Assert.NotNull(viewModel);\n            Assert.True(viewModel.OnNavigatedToCalled);\n        }\n\n        [Fact]\n        public async void Navigate_FromNavigationPage_ToContentPage_ByName()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new NavigationPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync(\"ContentPage\");\n\n            Assert.Single(rootPage.Navigation.NavigationStack);\n            Assert.IsType<ContentPageMock>(rootPage.Navigation.NavigationStack[0]);\n        }\n\n        //TODO: rename tests to follow a new test naming convention \n        [Fact]\n        public async Task Navigate_FromNavigationPage_WithoutChildPage_ToContentPage()\n        {\n            var recorder = new PageNavigationEventRecorder();\n            var navigationService = new PageNavigationServiceMock(_container, _app, recorder);\n            var navigationPage = new NavigationPageEmptyMock(recorder);\n\n            ((IPageAware)navigationService).Page = navigationPage;\n            await navigationService.NavigateAsync(\"ContentPage\");\n\n            Assert.Equal(0, navigationPage.Navigation.ModalStack.Count);\n            Assert.Equal(1, navigationPage.Navigation.NavigationStack.Count);\n            var contentPage = navigationPage.Navigation.NavigationStack.Last();\n            Assert.IsType<ContentPageMock>(contentPage);\n\n            var record = recorder.TakeFirst();\n            Assert.Equal(contentPage, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnInitialized, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(contentPage.BindingContext, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnInitialized, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(contentPage, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnInitializedAsync, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(contentPage.BindingContext, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnInitializedAsync, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(navigationPage, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnNavigatedFrom, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(navigationPage.BindingContext, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnNavigatedFrom, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(contentPage, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnNavigatedTo, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(contentPage.BindingContext, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnNavigatedTo, record.Event);\n\n            Assert.True(recorder.IsEmpty);\n        }\n\n        [Fact]\n        public async Task NavigateAsync_From_ChildPageOfNavigationPage()\n        {\n            var recorder = new PageNavigationEventRecorder(); ;\n            var navigationService = new PageNavigationServiceMock(_container, _app, recorder);\n            var contentPageMock = new ContentPageMock(recorder);\n            var navigationPage = new NavigationPageMock(recorder, contentPageMock);\n\n            // Navigate to Page2\n            ((IPageAware)navigationService).Page = contentPageMock;\n            await navigationService.NavigateAsync(\"SecondContentPageMock\");\n\n            Assert.Equal(0, navigationPage.Navigation.ModalStack.Count);\n            Assert.Equal(2, navigationPage.Navigation.NavigationStack.Count);\n\n            var pageMock = navigationPage.Navigation.NavigationStack.Last();\n\n            Assert.IsType<SecondContentPageMock>(pageMock);\n\n            var record = recorder.TakeFirst();\n            Assert.Equal(pageMock, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnInitialized, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(pageMock.BindingContext, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnInitialized, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(pageMock, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnInitializedAsync, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(pageMock.BindingContext, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnInitializedAsync, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(contentPageMock, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnNavigatedFrom, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(contentPageMock.BindingContext, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnNavigatedFrom, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(pageMock, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnNavigatedTo, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(pageMock.BindingContext, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnNavigatedTo, record.Event);\n\n            Assert.True(recorder.IsEmpty);\n        }\n\n        //TODO: reimplement test to check order of events when navigating in a navigationpage. because of reverse navigation, this no longer is valid.\n        [Fact]\n        public async Task NavigateAsync_From_NavigationPage_With_ChildPage_And_DoesNotReplaseRootPage()\n        {\n            var recorder = new PageNavigationEventRecorder(); ;\n            var navigationService = new PageNavigationServiceMock(_container, _app, recorder);\n            var contentPageMock = new ContentPageMock(recorder);\n            var contentPageMockViewModel = contentPageMock.BindingContext;\n            var navigationPage = new NavigationPageMock(recorder, contentPageMock);\n\n            // Navigate to Page2\n            ((IPageAware)navigationService).Page = contentPageMock;\n            await navigationService.NavigateAsync(\"SecondContentPageMock\");\n\n            var secondContentPage = navigationPage.Navigation.NavigationStack.Last();\n            var secondContentPageViewModel = secondContentPage.BindingContext;\n\n            recorder.Clear();\n            // PopToRootAsync\n            ((IPageAware)navigationService).Page = navigationPage;\n            await navigationService.NavigateAsync(\"ContentPage\");\n\n            Assert.Equal(0, navigationPage.Navigation.ModalStack.Count);\n            Assert.Equal(1, navigationPage.Navigation.NavigationStack.Count);\n\n            var rootPage = navigationPage.Navigation.NavigationStack.Last();\n            Assert.Equal(contentPageMock, rootPage);\n\n            var record = recorder.TakeFirst();\n            Assert.Equal(contentPageMock, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnInitialized, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(contentPageMockViewModel, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnInitialized, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(contentPageMock, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnInitializedAsync, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(contentPageMockViewModel, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnInitializedAsync, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(contentPageMock, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnNavigatedFrom, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(contentPageMockViewModel, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnNavigatedFrom, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(contentPageMock, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnNavigatedTo, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(contentPageMock.BindingContext, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnNavigatedTo, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(secondContentPage, record.Sender);\n            Assert.Equal(PageNavigationEvent.Destroy, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(secondContentPageViewModel, record.Sender);\n            Assert.Equal(PageNavigationEvent.Destroy, record.Event);\n\n            Assert.True(recorder.IsEmpty);\n        }\n\n        //TODO: reimplement test to check order of events when navigating in a navigationpage. because of reverse navigation, this no longer is valid.\n        //[Fact]\n        //public async Task NavigateAsync_From_NavigationPage_With_ChildPage_And_ReplaseRootPage()\n        //{\n        //    var recorder = new PageNavigationEventRecorder(); ;\n        //    var navigationService = new PageNavigationServiceMock(_container, _applicationProvider, recorder);\n        //    var secondContentPageMock = new SecondContentPageMock(recorder);\n        //    var secondContentPageMockViewModel = secondContentPageMock.BindingContext;\n        //    var navigationPage = new NavigationPageMock(recorder, secondContentPageMock);\n\n        //    // Navigate to Page2\n        //    ((IPageAware)navigationService).Page = secondContentPageMock;\n        //    await navigationService.NavigateAsync(\"FlyoutPage\");\n\n        //    var FlyoutPage = navigationPage.Navigation.NavigationStack.Last();\n        //    var FlyoutPageViewModel = FlyoutPage.BindingContext;\n\n        //    recorder.Clear();\n        //    // PopToRootAsync\n        //    ((IPageAware)navigationService).Page = navigationPage;\n        //    await navigationService.NavigateAsync(\"ContentPage\");\n\n        //    Assert.Equal(0, navigationPage.Navigation.ModalStack.Count);\n        //    Assert.Equal(1, navigationPage.Navigation.NavigationStack.Count);\n\n        //    var contentPage = navigationPage.Navigation.NavigationStack.Last();\n        //    Assert.NotEqual(secondContentPageMock, contentPage);\n\n        //    var record = recorder.TakeFirst();\n        //    Assert.Equal(contentPage, record.Sender);\n        //    Assert.Equal(PageNavigationEvent.OnNavigatingTo, record.Event);\n\n        //    record = recorder.TakeFirst();\n        //    Assert.Equal(contentPage.BindingContext, record.Sender);\n        //    Assert.Equal(PageNavigationEvent.OnNavigatingTo, record.Event);\n\n        //    record = recorder.TakeFirst();\n        //    Assert.Equal(secondContentPageMock, record.Sender);\n        //    Assert.Equal(PageNavigationEvent.OnNavigatedFrom, record.Event);\n\n        //    record = recorder.TakeFirst();\n        //    Assert.Equal(secondContentPageMockViewModel, record.Sender);\n        //    Assert.Equal(PageNavigationEvent.OnNavigatedFrom, record.Event);\n\n        //    record = recorder.TakeFirst();\n        //    Assert.Equal(contentPage, record.Sender);\n        //    Assert.Equal(PageNavigationEvent.OnNavigatedTo, record.Event);\n\n        //    record = recorder.TakeFirst();\n        //    Assert.Equal(contentPage.BindingContext, record.Sender);\n        //    Assert.Equal(PageNavigationEvent.OnNavigatedTo, record.Event);\n\n        //    record = recorder.TakeFirst();\n        //    Assert.Equal(FlyoutPage, record.Sender);\n        //    Assert.Equal(PageNavigationEvent.Destroy, record.Event);\n\n        //    record = recorder.TakeFirst();\n        //    Assert.Equal(FlyoutPageViewModel, record.Sender);\n        //    Assert.Equal(PageNavigationEvent.Destroy, record.Event);\n\n        //    record = recorder.TakeFirst();\n        //    Assert.Equal(secondContentPageMock, record.Sender);\n        //    Assert.Equal(PageNavigationEvent.Destroy, record.Event);\n\n        //    record = recorder.TakeFirst();\n        //    Assert.Equal(secondContentPageMockViewModel, record.Sender);\n        //    Assert.Equal(PageNavigationEvent.Destroy, record.Event);\n\n        //    Assert.True(recorder.IsEmpty);\n        //}\n\n        //TODO: reimplement test to check order of events when navigating in a navigationpage. because of reverse navigation, this no longer is valid.\n        //[Fact]\n        //public async Task NavigateAsync_From_NavigationPage_When_NotClearNavigationStack()\n        //{\n        //    var recorder = new PageNavigationEventRecorder(); ;\n        //    var navigationService = new PageNavigationServiceMock(_container, _applicationProvider, recorder);\n        //    var contentPageMock = new ContentPageMock(recorder);\n        //    var navigationPage = new NavigationPageMock(recorder, contentPageMock);\n        //    navigationPage.ClearNavigationStackOnNavigation = false;\n\n        //    // Navigate to Page2\n        //    ((IPageAware)navigationService).Page = contentPageMock;\n        //    await navigationService.NavigateAsync(\"SecondContentPageMock\");\n\n        //    var secondContentPage = navigationPage.Navigation.NavigationStack.Last();\n        //    var secondContentPageViewModel = secondContentPage.BindingContext;\n\n        //    recorder.Clear();\n        //    ((IPageAware)navigationService).Page = navigationPage;\n        //    await navigationService.NavigateAsync(\"ContentPage\");\n\n        //    Assert.Equal(0, navigationPage.Navigation.ModalStack.Count);\n        //    Assert.Equal(3, navigationPage.Navigation.NavigationStack.Count);\n\n        //    var currentPage = navigationPage.Navigation.NavigationStack.Last();\n        //    Assert.NotEqual(contentPageMock, currentPage);\n\n        //    var record = recorder.TakeFirst();\n        //    Assert.Equal(currentPage, record.Sender);\n        //    Assert.Equal(PageNavigationEvent.OnNavigatingTo, record.Event);\n\n        //    record = recorder.TakeFirst();\n        //    Assert.Equal(currentPage.BindingContext, record.Sender);\n        //    Assert.Equal(PageNavigationEvent.OnNavigatingTo, record.Event);\n\n        //    record = recorder.TakeFirst();\n        //    Assert.Equal(secondContentPage, record.Sender);\n        //    Assert.Equal(PageNavigationEvent.OnNavigatedFrom, record.Event);\n\n        //    record = recorder.TakeFirst();\n        //    Assert.Equal(secondContentPageViewModel, record.Sender);\n        //    Assert.Equal(PageNavigationEvent.OnNavigatedFrom, record.Event);\n\n        //    record = recorder.TakeFirst();\n        //    Assert.Equal(currentPage, record.Sender);\n        //    Assert.Equal(PageNavigationEvent.OnNavigatedTo, record.Event);\n\n        //    record = recorder.TakeFirst();\n        //    Assert.Equal(currentPage.BindingContext, record.Sender);\n        //    Assert.Equal(PageNavigationEvent.OnNavigatedTo, record.Event);\n\n        //    Assert.True(recorder.IsEmpty);\n        //}\n\n        [Fact]\n        public async Task NavigateAsync_From_NavigationPage_When_NotClearNavigationStack_And_SamePage()\n        {\n            var recorder = new PageNavigationEventRecorder(); ;\n            var navigationService = new PageNavigationServiceMock(_container, _app, recorder);\n            var contentPageMock = new ContentPageMock(recorder);\n            var navigationPage = new NavigationPageMock(recorder, contentPageMock);\n            navigationPage.ClearNavigationStackOnNavigation = false;\n\n            // Navigate to Page2\n            ((IPageAware)navigationService).Page = contentPageMock;\n            await navigationService.NavigateAsync(\"SecondContentPageMock\");\n\n            var secondContentPage = navigationPage.Navigation.NavigationStack.Last();\n\n            recorder.Clear();\n            ((IPageAware)navigationService).Page = navigationPage;\n            await navigationService.NavigateAsync(\"SecondContentPageMock\");\n\n            Assert.Equal(0, navigationPage.Navigation.ModalStack.Count);\n            Assert.Equal(2, navigationPage.Navigation.NavigationStack.Count);\n\n            var currentPage = navigationPage.Navigation.NavigationStack.Last();\n            Assert.Equal(secondContentPage, currentPage);\n\n            var record = recorder.TakeFirst();\n            Assert.Equal(secondContentPage, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnInitialized, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(secondContentPage.BindingContext, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnInitialized, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(secondContentPage, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnInitializedAsync, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(secondContentPage.BindingContext, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnInitializedAsync, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(secondContentPage, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnNavigatedFrom, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(secondContentPage.BindingContext, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnNavigatedFrom, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(secondContentPage, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnNavigatedTo, record.Event);\n\n            record = recorder.TakeFirst();\n            Assert.Equal(secondContentPage.BindingContext, record.Sender);\n            Assert.Equal(PageNavigationEvent.OnNavigatedTo, record.Event);\n\n            Assert.True(recorder.IsEmpty);\n        }\n\n\n        [Fact]\n        public async Task DeepNavigate_ToNavigationPage_ToTabbedPage_SelectContentPage()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync($\"NavigationPage/ContentPage/TabbedPage?{KnownNavigationParameters.SelectedTab}=Tab2\");\n\n            var navPage = rootPage.Navigation.ModalStack[0] as NavigationPageMock;\n            Assert.NotNull(navPage);\n\n            var contentPage = navPage.Navigation.NavigationStack[0] as ContentPageMock;\n            Assert.NotNull(contentPage);\n\n            var tabbedPage = navPage.Navigation.NavigationStack[1] as TabbedPageMock;\n            Assert.NotNull(tabbedPage.CurrentPage);\n            Assert.IsType<Tab2Mock>(tabbedPage.CurrentPage);\n        }\n\n        [Fact]\n        public async void DeepNavigate_From_ContentPage_To_ContentPage()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync(\"ContentPage/ContentPage\");\n\n            Assert.Single(rootPage.Navigation.ModalStack);\n            Assert.Single(rootPage.Navigation.ModalStack[0].Navigation.ModalStack);\n        }\n\n        [Fact]\n        public async void DeepNavigate_From_ContentPage_To_NavigationPage()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync(\"ContentPage/NavigationPage\");\n\n            Assert.Single(rootPage.Navigation.ModalStack);\n            Assert.Single(rootPage.Navigation.ModalStack[0].Navigation.ModalStack);\n        }\n\n        [Fact]\n        public async void DeepNavigate_From_ContentPage_To_NavigationPage_ToContentPage()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync(\"ContentPage/NavigationPage/ContentPage\");\n\n            var navPage = rootPage.Navigation.ModalStack[0].Navigation.ModalStack[0];\n            Assert.Single(navPage.Navigation.NavigationStack);\n        }\n\n        [Fact]\n        public async void DeepNavigate_From_ContentPage_To_NavigationPage_ToContentPage_ByAbsoluteName()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync(\"/NavigationPage/ContentPage\");\n\n            Assert.Equal(0, rootPage.Navigation.ModalStack.Count);\n\n            var navPage = _app.MainPage as Page;\n            Assert.IsType<NavigationPageMock>(navPage);\n            Assert.Single(navPage.Navigation.NavigationStack);\n        }\n\n        [Fact]\n        public async void DeepNavigate_From_ContentPage_To_NavigationPage_ToContentPage_ByAbsoluteUri()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync(new Uri(\"http://localhost/NavigationPage/ContentPage\", UriKind.Absolute));\n\n            Assert.Equal(0, rootPage.Navigation.ModalStack.Count);\n\n            var navPage = _app.MainPage as Page;\n            Assert.IsType<NavigationPageMock>(navPage);\n            Assert.Single(navPage.Navigation.NavigationStack);\n        }\n\n        [Fact]\n        public async void DeepNavigate_From_ContentPage_To_EmptyNavigationPage_ToContentPage()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync(\"ContentPage/NavigationPage-Empty/ContentPage\");\n\n            var navPage = rootPage.Navigation.ModalStack[0].Navigation.ModalStack[0];\n            Assert.Single(navPage.Navigation.NavigationStack);\n        }\n\n\n        [Fact]\n        public async void DeepNavigate_From_ContentPage_To_EmptyNavigationPage_ToContentPage_toContentPage()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync(\"ContentPage/NavigationPage-Empty/ContentPage/ContentPage1\");\n\n            var navPage = rootPage.Navigation.ModalStack[0].Navigation.ModalStack[0];\n\n            Assert.True(navPage.Navigation.NavigationStack.Count == 2);\n            var lastPage = navPage.Navigation.NavigationStack.LastOrDefault();\n            Assert.True(lastPage.GetType() == typeof(ContentPageMock1));\n            await navPage.Navigation.PopAsync();\n            lastPage = navPage.Navigation.NavigationStack.LastOrDefault();\n            Assert.True(lastPage.GetType() == typeof(ContentPageMock));\n        }\n\n        [Fact]\n        public async void DeepNavigate_To_EmptyNavigationPage_ToContentPage_toContentPage_toContentPage()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync(\"NavigationPage-Empty/ContentPage/ContentPage/ContentPage1\");\n\n            var navPage = rootPage.Navigation.ModalStack[0];\n            Assert.True(navPage.Navigation.NavigationStack.Count == 3);\n            var lastPage = navPage.Navigation.NavigationStack.LastOrDefault();\n            Assert.True(lastPage.GetType() == typeof(ContentPageMock1));\n        }\n\n        [Fact]\n        public async void DeepNavigate_From_ContentPage_To_NavigationPageWithNavigationStack_ToContentPage()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync(\"ContentPage/NavigationPageWithStack/ContentPage\");\n\n            var navPage = rootPage.Navigation.ModalStack[0].Navigation.ModalStack[0];\n            Assert.Single(navPage.Navigation.NavigationStack);\n        }\n\n        [Fact]\n        public async void DeepNavigate_From_ContentPage_To_NavigationPageWithNavigationStack_ToContentPage_ToContentPage()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync(\"ContentPage/NavigationPageWithStack/ContentPage/ContentPage1\");\n\n            var navPage = rootPage.Navigation.ModalStack[0].Navigation.ModalStack[0];\n            Assert.True(navPage.Navigation.NavigationStack.Count == 2);\n            var lastPage = navPage.Navigation.NavigationStack.LastOrDefault();\n            Assert.True(lastPage.GetType() == typeof(ContentPageMock1));\n            await navPage.Navigation.PopAsync();\n            lastPage = navPage.Navigation.NavigationStack.LastOrDefault();\n            Assert.True(lastPage.GetType() == typeof(ContentPageMock));\n        }\n\n        [Fact]\n        public async void DeepNavigate_From_ContentPage_To_NavigationPageWithDifferentNavigationStack_ToContentPage()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync(\"ContentPage/NavigationPageWithStackNoMatch/ContentPage\");\n\n            var navPage = rootPage.Navigation.ModalStack[0].Navigation.ModalStack[0];\n            Assert.Equal(1, navPage.Navigation.NavigationStack.Count);\n        }\n\n        [Fact]\n        public async void DeepNavigate_From_ContentPage_To_TabbedPage()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync(\"ContentPage/TabbedPage\");\n\n            Assert.Single(rootPage.Navigation.ModalStack);\n            Assert.Single(rootPage.Navigation.ModalStack[0].Navigation.ModalStack);\n        }\n\n        [Fact]\n        public async void DeepNavigate_From_ContentPage_To_FlyoutPage()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync(\"ContentPage/FlyoutPage\");\n\n            Assert.Single(rootPage.Navigation.ModalStack);\n            Assert.Single(rootPage.Navigation.ModalStack[0].Navigation.ModalStack);\n        }\n\n        #region FlyoutPage\n\n        [Fact]\n        public async void Navigate_FromFlyoutPage_ToSamePage()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new FlyoutPageMock();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            Assert.IsType<ContentPageMock>(rootPage.Detail);\n\n            await navigationService.NavigateAsync(\"TabbedPage\");\n\n            var firstDetailPage = rootPage.Detail;\n\n            Assert.IsType<TabbedPageMock>(firstDetailPage);\n\n            await navigationService.NavigateAsync(\"TabbedPage\");\n\n            Assert.Equal(firstDetailPage, rootPage.Detail);\n        }\n\n        [Fact]\n        public async void DeepNavigate_ToEmptyFlyoutPage_ToContentPage()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync(\"FlyoutPage-Empty/ContentPage\");\n\n            Assert.Equal(1, rootPage.Navigation.ModalStack.Count);\n            Assert.Equal(0, rootPage.Navigation.NavigationStack.Count);\n\n            var masterDetail = rootPage.Navigation.ModalStack[0] as FlyoutPageEmptyMock;\n            Assert.NotNull(masterDetail);\n            Assert.NotNull(masterDetail.Detail);\n            Assert.IsType<ContentPageMock>(masterDetail.Detail);\n        }\n\n        [Fact]\n        public async void DeepNavigate_ToEmptyFlyoutPage_ToContentPage_UseModalNavigation()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            //await navigationService.NavigateAsync(\"FlyoutPage-Empty/ContentPage\", useModalNavigation: true);\n            await navigationService.NavigateAsync(\"FlyoutPage-Empty/ContentPage\");\n\n            Assert.Equal(1, rootPage.Navigation.ModalStack.Count);\n            Assert.Equal(0, rootPage.Navigation.NavigationStack.Count);\n            var masterDetail = rootPage.Navigation.ModalStack[0] as FlyoutPageEmptyMock;\n            Assert.NotNull(masterDetail);\n            Assert.NotNull(masterDetail.Detail);\n            Assert.IsType<ContentPageMock>(masterDetail.Detail);\n        }\n\n        [Fact]\n        public async void DeepNavigate_ToEmptyFlyoutPage_ToContentPage_NotUseModalNavigation()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPageMock();\n            var navigationPage = new NavigationPage(rootPage);\n            ((IPageAware)navigationService).Page = rootPage;\n\n            Assert.Equal(1, rootPage.Navigation.NavigationStack.Count);\n            Assert.IsType<ContentPageMock>(navigationPage.CurrentPage);\n\n            await navigationService.NavigateAsync(\"FlyoutPage-Empty/ContentPage\");\n\n            Assert.Equal(0, rootPage.Navigation.ModalStack.Count);\n            Assert.Equal(2, rootPage.Navigation.NavigationStack.Count);\n            var masterDetail = rootPage.Navigation.NavigationStack[1] as FlyoutPageEmptyMock;\n            Assert.NotNull(masterDetail);\n            Assert.NotNull(masterDetail.Detail);\n            Assert.IsType<ContentPageMock>(masterDetail.Detail);\n        }\n\n        [Fact]\n        public async void DeepNavigate_ToEmptyFlyoutPage_ToNavigationPage()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync(\"FlyoutPage-Empty/NavigationPage\");\n\n            var masterDetail = rootPage.Navigation.ModalStack[0] as FlyoutPageEmptyMock;\n            Assert.NotNull(masterDetail);\n            Assert.NotNull(masterDetail.Detail);\n            Assert.IsType<NavigationPageMock>(masterDetail.Detail);\n        }\n\n        [Fact]\n        public async void DeepNavigate_ToEmptyFlyoutPage_ToEmptyNavigationPage_ToContentPage()\n        {\n            var applicationProvider = new ApplicationMock(null);\n            var navigationService = new PageNavigationServiceMock(_container, applicationProvider);\n\n            await navigationService.NavigateAsync(\"FlyoutPage-Empty/NavigationPage-Empty/ContentPage\");\n\n            var masterDetail = applicationProvider.MainPage as FlyoutPageEmptyMock;\n            Assert.NotNull(masterDetail);\n            Assert.NotNull(masterDetail.Detail);\n            Assert.IsType<NavigationPageEmptyMock>(masterDetail.Detail);\n            Assert.Equal(0, masterDetail.Navigation.ModalStack.Count);\n            Assert.Equal(0, masterDetail.Navigation.NavigationStack.Count);\n            Assert.Equal(0, masterDetail.Detail.Navigation.ModalStack.Count);\n            Assert.Equal(1, masterDetail.Detail.Navigation.NavigationStack.Count);\n            Assert.IsType<ContentPageMock>(masterDetail.Detail.Navigation.NavigationStack.Last());\n        }\n\n        [Fact]\n        public async void DeepNavigate_ToEmptyFlyoutPage_ToNavigationPage_ToContentPage()\n        {\n            var applicationProvider = new ApplicationMock(null);\n            var navigationService = new PageNavigationServiceMock(_container, applicationProvider);\n\n            await navigationService.NavigateAsync(\"FlyoutPage-Empty/NavigationPage/PageMock\");\n\n            var masterDetail = applicationProvider.MainPage as FlyoutPageEmptyMock;\n            Assert.NotNull(masterDetail);\n            Assert.NotNull(masterDetail.Detail);\n            Assert.IsType<NavigationPageMock>(masterDetail.Detail);\n            Assert.Equal(0, masterDetail.Navigation.ModalStack.Count);\n            Assert.Equal(0, masterDetail.Navigation.NavigationStack.Count);\n            Assert.Equal(0, masterDetail.Detail.Navigation.ModalStack.Count);\n            Assert.Equal(1, masterDetail.Detail.Navigation.NavigationStack.Count);\n            Assert.IsType<PageMock>(masterDetail.Detail.Navigation.NavigationStack.Last());\n        }\n\n        [Fact]\n        public async void DeepNavigate_ToFlyoutPage_ToDifferentPage()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync(\"FlyoutPage/TabbedPage\");\n\n            var masterDetail = rootPage.Navigation.ModalStack[0] as FlyoutPageMock;\n            Assert.NotNull(masterDetail);\n            Assert.NotNull(masterDetail.Detail);\n            Assert.IsType<TabbedPageMock>(masterDetail.Detail);\n        }\n\n        [Fact]\n        public async void DeepNavigate_ToFlyoutPage_ToSamePage_ToTabbedPage()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync(\"FlyoutPage/ContentPage/TabbedPage\");\n\n            var masterDetail = rootPage.Navigation.ModalStack[0] as FlyoutPageMock;\n            Assert.NotNull(masterDetail);\n            Assert.NotNull(masterDetail.Detail);\n            Assert.IsType<ContentPageMock>(masterDetail.Detail);\n\n            var tabbedPage = masterDetail.Navigation.ModalStack[0] as TabbedPageMock;\n            Assert.NotNull(tabbedPage);\n        }\n\n        [Fact]\n        public async void Navigate_FromFlyoutPage_ToTabbedPage_IsPresented()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new FlyoutPageMock();\n            ((IPageAware)navigationService).Page = rootPage;\n            rootPage.IsPresentedAfterNavigation = true;\n\n            Assert.IsType<ContentPageMock>(rootPage.Detail);\n            Assert.False(rootPage.IsPresented);\n\n            await navigationService.NavigateAsync(\"TabbedPage\");\n            Assert.IsType<TabbedPageMock>(rootPage.Detail);\n\n            Assert.True(rootPage.IsPresented);\n        }\n\n        [Fact]\n        public async void Navigate_FromFlyoutPage_ToTabbedPage_IsNotPresented()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new FlyoutPageMock();\n            ((IPageAware)navigationService).Page = rootPage;\n            rootPage.IsPresentedAfterNavigation = false;\n\n            Assert.IsType<ContentPageMock>(rootPage.Detail);\n            Assert.False(rootPage.IsPresented);\n\n            await navigationService.NavigateAsync(\"TabbedPage\");\n            Assert.IsType<TabbedPageMock>(rootPage.Detail);\n\n            Assert.False(rootPage.IsPresented);\n        }\n\n        [Fact]\n        public async void Navigate_FromFlyoutPage_ToTabbedPage_IsPresented_FromViewModel()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new FlyoutPageEmptyMock();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            ((FlyoutPageEmptyMockViewModel)rootPage.BindingContext).IsPresentedAfterNavigation = true;\n\n            Assert.Null(rootPage.Detail);\n            Assert.False(rootPage.IsPresented);\n\n            await navigationService.NavigateAsync(\"TabbedPage\");\n            Assert.IsType<TabbedPageMock>(rootPage.Detail);\n\n            Assert.True(rootPage.IsPresented);\n        }\n\n        [Fact]\n        public async void Navigate_FromFlyoutPage_ToTabbedPage_IsNotPresented_FromViewModel()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new FlyoutPageEmptyMock();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            ((FlyoutPageEmptyMockViewModel)rootPage.BindingContext).IsPresentedAfterNavigation = false;\n\n            Assert.Null(rootPage.Detail);\n            Assert.False(rootPage.IsPresented);\n\n            await navigationService.NavigateAsync(\"TabbedPage\");\n            Assert.IsType<TabbedPageMock>(rootPage.Detail);\n\n            Assert.False(rootPage.IsPresented);\n        }\n\n        [Fact]\n        public async void DeepNavigate_ToFlyoutPage_ToNavigationPage_ToTabbedPage_SelectTab()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync($\"FlyoutPage-Empty/NavigationPage/TabbedPage?{KnownNavigationParameters.SelectedTab}=Tab2\");\n\n            var mdpPage = rootPage.Navigation.ModalStack[0] as FlyoutPageEmptyMock;\n            var navPage = mdpPage.Detail as NavigationPageMock;\n            var tabbedPage = navPage.Navigation.NavigationStack[0] as TabbedPageMock;\n            Assert.NotNull(mdpPage);\n            Assert.NotNull(navPage);\n            Assert.NotNull(tabbedPage.CurrentPage);\n            Assert.IsType<Tab2Mock>(tabbedPage.CurrentPage);\n        }\n\n        [Fact]\n        public async void DeepNavigate_ToFlyoutPage_ToNavigationPage_ToContentPage_ToTabbedPage_SelectTab()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync($\"FlyoutPage-Empty/NavigationPage/ContentPage/TabbedPage?{KnownNavigationParameters.SelectedTab}=Tab2\");\n\n            var mdpPage = rootPage.Navigation.ModalStack[0] as FlyoutPageEmptyMock;\n            var navPage = mdpPage.Detail as NavigationPageMock;\n            var contentPage = navPage.Navigation.NavigationStack[0] as ContentPageMock;\n            var tabbedPage = navPage.Navigation.NavigationStack[1] as TabbedPageMock;\n            Assert.NotNull(mdpPage);\n            Assert.NotNull(navPage);\n            Assert.NotNull(tabbedPage.CurrentPage);\n            Assert.IsType<Tab2Mock>(tabbedPage.CurrentPage);\n        }\n\n        [Fact]\n        public async void DeepNavigate_FromFlyoutPage_ToExistingNavigationPage_ToExistingTabbedPage_SelectTab()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new FlyoutPageEmptyMock();\n            rootPage.Detail = new NavigationPageEmptyMock_Reused();\n            await rootPage.Detail.Navigation.PushAsync(new TabbedPageMock());\n            ((IPageAware)navigationService).Page = rootPage;\n\n            var navPage = rootPage.Detail as NavigationPageEmptyMock;\n            var tabbedPage = navPage.Navigation.NavigationStack[0] as TabbedPageMock;\n            Assert.NotNull(navPage);\n            Assert.NotNull(tabbedPage.CurrentPage);\n            Assert.IsType<Tab1Mock>(tabbedPage.CurrentPage);\n\n            await navigationService.NavigateAsync($\"NavigationPage-Empty-Reused/TabbedPage?{KnownNavigationParameters.SelectedTab}=Tab3\");\n\n            var existingNavPage = rootPage.Detail as NavigationPageEmptyMock_Reused;\n            var existingTabbedPage = navPage.Navigation.NavigationStack[0] as TabbedPageMock;\n            Assert.Equal(navPage, existingNavPage);\n            Assert.Equal(tabbedPage, existingTabbedPage);\n            Assert.IsType<Tab3Mock>(tabbedPage.CurrentPage);\n        }\n\n        #endregion\n\n        #region TabbedPage\n\n        [Fact]\n        public async void Navigate_FromContentPage_ToTabbedPage()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync($\"TabbedPage\");\n\n            var tabbedPage = rootPage.Navigation.ModalStack[0] as TabbedPageMock;\n            Assert.NotNull(tabbedPage);\n        }\n\n        [Fact]\n        public async void Navigate_FromNavigationPage_ToTabbedPage()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new NavigationPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync($\"TabbedPage\");\n\n            Assert.Single(rootPage.Navigation.NavigationStack);\n            Assert.IsType<TabbedPageMock>(rootPage.Navigation.NavigationStack[0]);\n        }\n\n        [Fact]\n        public async void Navigate_FromContentPage_ToTabbedPage_ToContentPage()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync($\"TabbedPage/ContentPage\");\n\n            var tabbedPage = rootPage.Navigation.ModalStack[0] as TabbedPageMock;\n            Assert.NotNull(tabbedPage);\n\n            Assert.True(tabbedPage.Navigation.ModalStack.Count > 0);\n\n            Assert.IsType<ContentPageMock>(tabbedPage.Navigation.ModalStack[0]);\n        }\n\n        [Fact]\n        public async void Navigate_FromNavigationPage_ToTabbedPage_ToContentPage()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new NavigationPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync($\"TabbedPage/ContentPage\");\n\n            Assert.True(rootPage.Navigation.NavigationStack.Count == 2);\n            Assert.IsType<TabbedPageMock>(rootPage.Navigation.NavigationStack[0]);\n            Assert.IsType<ContentPageMock>(rootPage.Navigation.NavigationStack[1]);\n        }\n\n        [Fact]\n        public async void Navigate_FromContentPage_ToTabbedPage_SelectedTab()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync($\"TabbedPage?{KnownNavigationParameters.SelectedTab}=Tab2\");\n\n            var tabbedPage = rootPage.Navigation.ModalStack[0] as TabbedPageMock;\n            Assert.NotNull(tabbedPage);\n            Assert.NotNull(tabbedPage.CurrentPage);\n            Assert.IsType<Tab2Mock>(tabbedPage.CurrentPage);\n        }\n        \n        [Fact]\n        public async void Navigate_FromContentPage_ToTabbedPage_WithTitleWithSelectedTab()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync($\"TabbedPage?{KnownNavigationParameters.SelectedTab}=Tab2&{KnownNavigationParameters.Title}=MyTitle\");\n\n            var tabbedPage = rootPage.Navigation.ModalStack[0] as TabbedPageMock;\n            Assert.NotNull(tabbedPage);\n            Assert.NotNull(tabbedPage.CurrentPage);\n            Assert.IsType<Tab2Mock>(tabbedPage.CurrentPage);\n            Assert.Equal(\"MyTitle\", tabbedPage.Title);\n        }\n        \n        [Fact]\n        public async void Navigate_FromContentPage_ToTabbedPage_WithTitle()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync($\"TabbedPage?{KnownNavigationParameters.Title}=MyTitle\");\n\n            var tabbedPage = rootPage.Navigation.ModalStack[0] as TabbedPageMock;\n            Assert.NotNull(tabbedPage);\n            Assert.Equal(\"MyTitle\", tabbedPage.Title);\n        }\n\n        [Fact]\n        public async void Navigate_FromContentPage_ToTabbedPage_SelectedTab_NavigationPage()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync($\"TabbedPage?{KnownNavigationParameters.SelectedTab}=ContentPage\");\n\n            var tabbedPage = rootPage.Navigation.ModalStack[0] as TabbedPageMock;\n            Assert.NotNull(tabbedPage);\n            Assert.NotNull(tabbedPage.CurrentPage);\n\n            var navPage = tabbedPage.CurrentPage as NavigationPageMock;\n            Assert.NotNull(navPage);\n            Assert.IsType<ContentPageMock>(navPage.CurrentPage);\n        }\n\n        [Fact]\n        public async void Navigate_FromContentPage_ToTabbedPage_SelectedTab_ToContentPage()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync($\"TabbedPage?{KnownNavigationParameters.SelectedTab}=Tab2/ContentPage\");\n\n            var tabbedPage = rootPage.Navigation.ModalStack[0] as TabbedPageMock;\n            Assert.NotNull(tabbedPage);\n            Assert.NotNull(tabbedPage.CurrentPage);\n            Assert.IsType<Tab2Mock>(tabbedPage.CurrentPage);\n\n            var contentPage = tabbedPage.Navigation.ModalStack[0] as ContentPageMock;\n            Assert.NotNull(contentPage);\n        }\n\n        [Fact]\n        public async void Navigate_FromNavigationPage_ToTabbedPage_SelectedTab_ToContentPage()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new NavigationPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync($\"TabbedPage?{KnownNavigationParameters.SelectedTab}=Tab2/ContentPage\");\n\n            Assert.True(rootPage.Navigation.NavigationStack.Count == 2);\n\n            var tabbedPage = rootPage.Navigation.NavigationStack[0] as TabbedPageMock;\n            Assert.NotNull(tabbedPage);\n            Assert.NotNull(tabbedPage.CurrentPage);\n            Assert.IsType<Tab2Mock>(tabbedPage.CurrentPage);\n\n            var contentPage = tabbedPage.Navigation.NavigationStack[1] as ContentPageMock;\n            Assert.NotNull(contentPage);\n        }\n\n        [Fact]\n        public async void Navigate_FromNavigationPage_ToTabbedPage_SelectedTab_NavigationPage_ToContentPage()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new NavigationPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync($\"TabbedPage?{KnownNavigationParameters.SelectedTab}=PageMock/ContentPage\");\n\n            Assert.True(rootPage.Navigation.NavigationStack.Count == 2);\n\n            var tabbedPage = rootPage.Navigation.NavigationStack[0] as TabbedPageMock;\n            Assert.NotNull(tabbedPage);\n            Assert.NotNull(tabbedPage.CurrentPage);\n            Assert.IsType<NavigationPageMock>(tabbedPage.CurrentPage);\n\n            var navPage = tabbedPage.CurrentPage as NavigationPageMock;\n            Assert.NotNull(navPage);\n            Assert.IsType<PageMock>(navPage.CurrentPage);\n\n            var contentPage = tabbedPage.Navigation.NavigationStack[1] as ContentPageMock;\n            Assert.NotNull(contentPage);\n        }\n\n        [Fact]\n        public async void Navigate_FromFlyoutPage_ToNavigationPage_ToTabbedPage_ToContentPage()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new FlyoutPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync($\"NavigationPage/TabbedPage/ContentPage\");\n\n            Assert.IsType<NavigationPageMock>(rootPage.Detail);\n\n            Assert.True(rootPage.Detail.Navigation.NavigationStack.Count == 2);\n\n            Assert.IsType<TabbedPageMock>(rootPage.Detail.Navigation.NavigationStack[0]);\n            Assert.IsType<ContentPageMock>(rootPage.Detail.Navigation.NavigationStack[1]);\n        }\n\n        [Fact]\n        public async void Navigate_FromFlyoutPage_ToNavigationPage_ToTabbedPage_SelectedTab()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new FlyoutPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync($\"NavigationPage/TabbedPage?{KnownNavigationParameters.SelectedTab}=Tab2\");\n\n            Assert.IsType<NavigationPageMock>(rootPage.Detail);\n\n            Assert.Single(rootPage.Navigation.NavigationStack);\n\n            var tabbedPage = rootPage.Detail.Navigation.NavigationStack[0] as TabbedPageMock;\n            Assert.NotNull(tabbedPage);\n            Assert.NotNull(tabbedPage.CurrentPage);\n            Assert.IsType<Tab2Mock>(tabbedPage.CurrentPage);\n        }\n\n        [Fact]\n        public async void Navigate_FromFlyoutPage_ToNavigationPage_ToTabbedPage_SelectedTab_ToContentPage()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new FlyoutPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync($\"NavigationPage/TabbedPage?{KnownNavigationParameters.SelectedTab}=Tab2/ContentPage\");\n\n            Assert.IsType<NavigationPageMock>(rootPage.Detail);\n\n            Assert.True(rootPage.Detail.Navigation.NavigationStack.Count == 2);\n\n            Assert.IsType<TabbedPageMock>(rootPage.Detail.Navigation.NavigationStack[0]);\n            Assert.IsType<Tab2Mock>(((TabbedPageMock)rootPage.Detail.Navigation.NavigationStack[0]).CurrentPage);\n\n            Assert.IsType<ContentPageMock>(rootPage.Detail.Navigation.NavigationStack[1]);\n        }\n\n        [Fact]\n        public async void Navigate_FromContentPage_ToTabbedPage_CreateTabs()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync($\"TabbedPage-Empty?{KnownNavigationParameters.CreateTab}=Tab1&{KnownNavigationParameters.CreateTab}=Tab2&{KnownNavigationParameters.CreateTab}=Tab3\");\n\n            var tabbedPage = rootPage.Navigation.ModalStack[0] as TabbedPageEmptyMock;\n            Assert.NotNull(tabbedPage);\n            Assert.Equal(3, tabbedPage.Children.Count());\n            Assert.IsType<Tab1Mock>(tabbedPage.Children[0]);\n            Assert.IsType<Tab2Mock>(tabbedPage.Children[1]);\n            Assert.IsType<Tab3Mock>(tabbedPage.Children[2]);\n        }\n\n        [Fact]\n        public async void Navigate_FromContentPage_ToTabbedPage_CreateTabs_SelectTab()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync($\"TabbedPage-Empty?{KnownNavigationParameters.CreateTab}=Tab1&{KnownNavigationParameters.CreateTab}=Tab2&{KnownNavigationParameters.CreateTab}=Tab3&{KnownNavigationParameters.SelectedTab}=Tab2\");\n\n            var tabbedPage = rootPage.Navigation.ModalStack[0] as TabbedPageEmptyMock;\n            Assert.NotNull(tabbedPage);\n            Assert.Equal(3, tabbedPage.Children.Count());\n            Assert.IsType<Tab1Mock>(tabbedPage.Children[0]);\n            Assert.IsType<Tab2Mock>(tabbedPage.Children[1]);\n            Assert.IsType<Tab3Mock>(tabbedPage.Children[2]);\n            Assert.IsType<Tab2Mock>(tabbedPage.CurrentPage);\n        }\n\n        [Fact]\n        public async void Navigate_FromContentPage_ToTabbedPage_CreateTabs_WithNavigationPage()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync($\"TabbedPage-Empty?{KnownNavigationParameters.CreateTab}=NavigationPage|Tab1&{KnownNavigationParameters.CreateTab}=Tab2&{KnownNavigationParameters.CreateTab}=Tab3\");\n\n            var tabbedPage = rootPage.Navigation.ModalStack[0] as TabbedPageEmptyMock;\n            Assert.NotNull(tabbedPage);\n            Assert.Equal(3, tabbedPage.Children.Count());\n\n            var navPage = tabbedPage.Children[0] as NavigationPageMock;\n            Assert.IsType<NavigationPageMock>(navPage);\n            Assert.IsType<Tab1Mock>(navPage.CurrentPage);\n            Assert.IsType<Tab2Mock>(tabbedPage.Children[1]);\n            Assert.IsType<Tab3Mock>(tabbedPage.Children[2]);\n        }\n\n        [Fact]\n        public async void Navigate_FromContentPage_ToTabbedPage_CreateTabs_WithNavigationPage_SelectTab()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new ContentPage();\n            ((IPageAware)navigationService).Page = rootPage;\n\n            await navigationService.NavigateAsync($\"TabbedPage-Empty?{KnownNavigationParameters.CreateTab}=Tab1&{KnownNavigationParameters.CreateTab}=NavigationPage|Tab2&{KnownNavigationParameters.CreateTab}=Tab3&{KnownNavigationParameters.SelectedTab}=Tab2\");\n\n            var tabbedPage = rootPage.Navigation.ModalStack[0] as TabbedPageEmptyMock;\n            Assert.NotNull(tabbedPage);\n            Assert.Equal(3, tabbedPage.Children.Count());\n\n            Assert.IsType<Tab1Mock>(tabbedPage.Children[0]);\n\n            var navPage = tabbedPage.Children[1] as NavigationPageMock;\n            Assert.IsType<NavigationPageMock>(navPage);\n            Assert.IsType<Tab2Mock>(navPage.CurrentPage);\n\n            Assert.IsType<Tab3Mock>(tabbedPage.Children[2]);\n        }\n\n        #endregion\n\n        #region Remove and Navigate - \"../\"\n\n        [Fact]\n        public async Task RemoveAndNavigate_OneLevel()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new NavigationPage();\n\n            await rootPage.Navigation.PushAsync(new ContentPageMock() { Title = \"Page 1\" });\n            await rootPage.Navigation.PushAsync(new ContentPageMock() { Title = \"Page 2\" });\n            await rootPage.Navigation.PushAsync(new ContentPageMock() { Title = \"Page 3\" });\n            await rootPage.Navigation.PushAsync(new ContentPageMock() { Title = \"Page 4\" });\n\n            Assert.Equal(4, rootPage.Navigation.NavigationStack.Count);\n            Assert.IsType<ContentPageMock>(rootPage.Navigation.NavigationStack.Last());\n\n            ((IPageAware)navigationService).Page = rootPage.Navigation.NavigationStack.Last();\n\n            await navigationService.NavigateAsync(\"../PageMock\");\n\n            Assert.Equal(4, rootPage.Navigation.NavigationStack.Count);\n            Assert.IsType<PageMock>(rootPage.Navigation.NavigationStack.Last());\n        }\n\n        [Fact]\n        public async Task RemoveAndNavigate_TwoLevels()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new NavigationPage();\n\n            await rootPage.Navigation.PushAsync(new ContentPageMock() { Title = \"Page 1\" });\n            await rootPage.Navigation.PushAsync(new ContentPageMock() { Title = \"Page 2\" });\n            await rootPage.Navigation.PushAsync(new ContentPageMock() { Title = \"Page 3\" });\n            await rootPage.Navigation.PushAsync(new ContentPageMock() { Title = \"Page 4\" });\n\n            Assert.Equal(4, rootPage.Navigation.NavigationStack.Count);\n            Assert.IsType<ContentPageMock>(rootPage.Navigation.NavigationStack.Last());\n\n            ((IPageAware)navigationService).Page = rootPage.Navigation.NavigationStack.Last();\n\n            await navigationService.NavigateAsync(\"../../PageMock\");\n\n            Assert.Equal(3, rootPage.Navigation.NavigationStack.Count);\n            Assert.IsType<PageMock>(rootPage.Navigation.NavigationStack.Last());\n        }\n\n        [Fact]\n        public async Task RemoveAndNavigate_ThreeLevels()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new NavigationPage();\n\n            await rootPage.Navigation.PushAsync(new ContentPageMock() { Title = \"Page 1\" });\n            await rootPage.Navigation.PushAsync(new ContentPageMock() { Title = \"Page 2\" });\n            await rootPage.Navigation.PushAsync(new ContentPageMock() { Title = \"Page 3\" });\n            await rootPage.Navigation.PushAsync(new ContentPageMock() { Title = \"Page 4\" });\n\n            Assert.Equal(4, rootPage.Navigation.NavigationStack.Count);\n            Assert.IsType<ContentPageMock>(rootPage.Navigation.NavigationStack.Last());\n\n            ((IPageAware)navigationService).Page = rootPage.Navigation.NavigationStack.Last();\n\n            await navigationService.NavigateAsync(\"../../../PageMock\");\n\n            Assert.Equal(2, rootPage.Navigation.NavigationStack.Count);\n            Assert.IsType<PageMock>(rootPage.Navigation.NavigationStack.Last());\n        }\n\n        [Fact]\n        public async Task RemoveAndNavigate_FourLevels()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new NavigationPage();\n\n            await rootPage.Navigation.PushAsync(new ContentPageMock() { Title = \"Page 1\" });\n            await rootPage.Navigation.PushAsync(new ContentPageMock() { Title = \"Page 2\" });\n            await rootPage.Navigation.PushAsync(new ContentPageMock() { Title = \"Page 3\" });\n            await rootPage.Navigation.PushAsync(new ContentPageMock() { Title = \"Page 4\" });\n\n            Assert.Equal(4, rootPage.Navigation.NavigationStack.Count);\n            Assert.IsType<ContentPageMock>(rootPage.Navigation.NavigationStack.Last());\n\n            ((IPageAware)navigationService).Page = rootPage.Navigation.NavigationStack.Last();\n\n            await navigationService.NavigateAsync(\"../../../../PageMock\");\n\n            Assert.Equal(1, rootPage.Navigation.NavigationStack.Count);\n            Assert.IsType<PageMock>(rootPage.Navigation.NavigationStack[0]);\n        }\n\n        #endregion\n\n        #region Remove and GoBack - \"../\"\n\n        [Fact]\n        public async Task RemoveAndGoBack_OneLevel()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new NavigationPage();\n\n            await rootPage.Navigation.PushAsync(new ContentPageMock() { Title = \"Page 1\" });\n            await rootPage.Navigation.PushAsync(new ContentPageMock() { Title = \"Page 2\" });\n            await rootPage.Navigation.PushAsync(new ContentPageMock() { Title = \"Page 3\" });\n            await rootPage.Navigation.PushAsync(new ContentPageMock() { Title = \"Page 4\" });\n\n            Assert.Equal(4, rootPage.Navigation.NavigationStack.Count);\n            Assert.IsType<ContentPageMock>(rootPage.Navigation.NavigationStack.Last());\n\n            ((IPageAware)navigationService).Page = rootPage.Navigation.NavigationStack.Last();\n\n            await navigationService.NavigateAsync(\"../\");\n\n            Assert.Equal(3, rootPage.Navigation.NavigationStack.Count);\n            Assert.IsType<ContentPageMock>(rootPage.Navigation.NavigationStack.Last());\n        }\n\n        [Fact]\n        public async Task RemoveAndGoBack_TwoLevels()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new NavigationPage();\n\n            await rootPage.Navigation.PushAsync(new ContentPageMock() { Title = \"Page 1\" });\n            await rootPage.Navigation.PushAsync(new ContentPageMock() { Title = \"Page 2\" });\n            await rootPage.Navigation.PushAsync(new ContentPageMock() { Title = \"Page 3\" });\n            await rootPage.Navigation.PushAsync(new ContentPageMock() { Title = \"Page 4\" });\n\n            Assert.Equal(4, rootPage.Navigation.NavigationStack.Count);\n            Assert.IsType<ContentPageMock>(rootPage.Navigation.NavigationStack.Last());\n\n            ((IPageAware)navigationService).Page = rootPage.Navigation.NavigationStack.Last();\n\n            await navigationService.NavigateAsync(\"../../\");\n\n            Assert.Equal(2, rootPage.Navigation.NavigationStack.Count);\n            Assert.IsType<ContentPageMock>(rootPage.Navigation.NavigationStack.Last());\n        }\n\n        [Fact]\n        public async Task RemoveAndGoBack_ThreeLevels()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new NavigationPage();\n\n            await rootPage.Navigation.PushAsync(new ContentPageMock() { Title = \"Page 1\" });\n            await rootPage.Navigation.PushAsync(new ContentPageMock() { Title = \"Page 2\" });\n            await rootPage.Navigation.PushAsync(new ContentPageMock() { Title = \"Page 3\" });\n            await rootPage.Navigation.PushAsync(new ContentPageMock() { Title = \"Page 4\" });\n\n            Assert.Equal(4, rootPage.Navigation.NavigationStack.Count);\n            Assert.IsType<ContentPageMock>(rootPage.Navigation.NavigationStack.Last());\n\n            ((IPageAware)navigationService).Page = rootPage.Navigation.NavigationStack.Last();\n\n            await navigationService.NavigateAsync(\"../../../\");\n\n            Assert.Equal(1, rootPage.Navigation.NavigationStack.Count);\n            Assert.IsType<ContentPageMock>(rootPage.Navigation.NavigationStack.Last());\n        }\n\n        [Fact]\n        public async void RemoveAndGoBack_WithNavigationParameters()\n        {\n            var navigationService = new PageNavigationServiceMock(_container, _app);\n            var rootPage = new NavigationPage();\n\n            await rootPage.Navigation.PushAsync(new ContentPageMock() { Title = \"Page 1\" });\n            await rootPage.Navigation.PushAsync(new ContentPageMock() { Title = \"Page 2\" });\n            await rootPage.Navigation.PushAsync(new ContentPageMock() { Title = \"Page 3\" });\n            await rootPage.Navigation.PushAsync(new ContentPageMock() { Title = \"Page 4\" });\n\n            Assert.Equal(4, rootPage.Navigation.NavigationStack.Count);\n            Assert.IsType<ContentPageMock>(rootPage.Navigation.NavigationStack.Last());\n\n            ((IPageAware)navigationService).Page = rootPage.Navigation.NavigationStack.Last();\n\n            var navParameters = new NavigationParameters();\n            navParameters.Add(\"id\", 3);\n\n            await navigationService.NavigateAsync(\"../\", navParameters);\n\n            var viewModel = rootPage.Navigation.NavigationStack.Last().BindingContext as ContentPageMockViewModel;\n            Assert.NotNull(viewModel);\n\n            Assert.NotNull(viewModel.NavigatedToParameters);\n            Assert.True(viewModel.NavigatedToParameters.Count > 0);\n            Assert.Equal(3, viewModel.NavigatedToParameters[\"id\"]);\n        }\n\n        #endregion\n\n\n        public void Dispose()\n        {\n            _container.Dispose();\n            _container = null;\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Mocks/Behaviors/EventToCommandBehaviorMock.cs",
    "content": "﻿using Prism.Behaviors;\n\nnamespace Prism.Maui.Tests.Mocks.Behaviors;\n\npublic class EventToCommandBehaviorMock : EventToCommandBehavior\n{\n    public void RaiseEvent(params object[] args)\n{\n        _handler.DynamicInvoke(args);\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Mocks/ContainerMock.cs",
    "content": "﻿using System;\nusing Moq;\nusing Prism.Maui.Tests.Mocks.ViewModels;\nusing Prism.Maui.Tests.Mocks.Views;\nusing Prism.Maui.Tests.Navigation.Mocks.Views;\n\nnamespace Prism.Maui.Tests.Mocks;\n\npublic static class ContainerMock\n{\n    public static Mock<IContainerExtension> CreateMock()\n    {\n        var mock = new Mock<IContainerExtension>();\n        mock.Setup(x => x.Register(It.IsAny<Type>(), It.IsAny<Type>()))\n            .Returns(mock.Object);\n        mock.Setup(x => x.Register(It.IsAny<Type>(), It.IsAny<Type>(), It.IsAny<string>()))\n            .Returns(mock.Object);\n        mock.Setup(x => x.RegisterSingleton(It.IsAny<Type>(), It.IsAny<Type>()))\n            .Returns(mock.Object);\n        mock.Setup(x => x.RegisterSingleton(It.IsAny<Type>(), It.IsAny<Type>(), It.IsAny<string>()))\n            .Returns(mock.Object);\n\n        mock.Setup(x => x.Resolve(typeof(object), \"PageMock\"))\n            .Returns(new PageMock());\n\n        mock.Setup(x => x.Resolve(typeof(object), \"ContentPage\"))\n            .Returns(new ContentPageMock());\n        mock.Setup(x => x.Resolve(typeof(object), \"ContentPage1\"))\n            .Returns(new ContentPageMock1());\n        mock.Setup(x => x.Resolve(typeof(object), typeof(ContentPageMockViewModel).FullName))\n            .Returns(new ContentPageMock());\n        mock.Setup(x => x.Resolve(typeof(object), typeof(ContentPageMock1ViewModel).FullName))\n            .Returns(new ContentPageMock1());\n\n        mock.Setup(x => x.Resolve(typeof(object), \"SecondContentPageMock\"))\n            .Returns(new SecondContentPageMock());\n\n        mock.Setup(x => x.Resolve(typeof(object), \"NavigationPage\"))\n            .Returns(new NavigationPageMock());\n        mock.Setup(x => x.Resolve(typeof(object), \"NavigationPage-Empty\"))\n            .Returns(new NavigationPageEmptyMock());\n        mock.Setup(x => x.Resolve(typeof(object), \"NavigationPage-Empty-Reused\"))\n            .Returns(new NavigationPageEmptyMock_Reused());\n        mock.Setup(x => x.Resolve(typeof(object), \"NavigationPageWithStack\"))\n            .Returns(new NavigationPageWithStackMock());\n        mock.Setup(x => x.Resolve(typeof(object), \"NavigationPageWithStackNoMatch\"))\n            .Returns(new NavigationPageWithStackNoMatchMock());\n\n        mock.Setup(x => x.Resolve(typeof(object), \"FlyoutPage\"))\n            .Returns(new FlyoutPageMock());\n        mock.Setup(x => x.Resolve(typeof(object), \"FlyoutPage-Empty\"))\n            .Returns(new FlyoutPageEmptyMock());\n\n        mock.Setup(x => x.Resolve(typeof(object), \"TabbedPage\"))\n            .Returns(new TabbedPageMock());\n        mock.Setup(x => x.Resolve(typeof(object), \"TabbedPage-Empty\"))\n            .Returns(new TabbedPageEmptyMock());\n        mock.Setup(x => x.Resolve(typeof(object), \"Tab1\"))\n            .Returns(new Tab1Mock());\n        mock.Setup(x => x.Resolve(typeof(object), \"Tab2\"))\n            .Returns(new Tab2Mock());\n        mock.Setup(x => x.Resolve(typeof(object), \"Tab3\"))\n            .Returns(new Tab3Mock());\n\n        return mock;\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Mocks/IPageNavigationEventRecordable.cs",
    "content": "﻿namespace Prism.Maui.Tests.Mocks;\n\npublic interface IPageNavigationEventRecordable\n{\n    PageNavigationEventRecorder PageNavigationEventRecorder { get; set; }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Mocks/Ioc/TestContainer.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Prism.Maui.Tests.Mocks.Ioc;\n\ninternal class TestContainer : IContainerExtension\n{\n    private List<object> _instances = new ();\n    private List<KeyValuePair<Type, Func<IContainerProvider, object>>> _factories = new();\n\n    public IScopedProvider CurrentScope { get; }\n\n    public IScopedProvider CreateScope()\n    {\n        throw new NotImplementedException();\n    }\n\n    public void FinalizeExtension()\n    {\n    }\n\n    public bool IsRegistered(Type type)\n    {\n        throw new NotImplementedException();\n    }\n\n    public bool IsRegistered(Type type, string name)\n    {\n        throw new NotImplementedException();\n    }\n\n    public IContainerRegistry Register(Type from, Type to)\n    {\n        return this;\n    }\n\n    public IContainerRegistry Register(Type from, Type to, string name)\n    {\n        return this;\n    }\n\n    public IContainerRegistry Register(Type type, Func<object> factoryMethod)\n    {\n        return this;\n    }\n\n    public IContainerRegistry Register(Type type, Func<IContainerProvider, object> factoryMethod)\n    {\n        return this;\n    }\n\n    public IContainerRegistry RegisterInstance(Type type, object instance)\n    {\n        _instances.Add(instance);\n        return this;\n    }\n\n    public IContainerRegistry RegisterInstance(Type type, object instance, string name)\n    {\n        throw new NotImplementedException();\n    }\n\n    public IContainerRegistry RegisterMany(Type type, params Type[] serviceTypes)\n    {\n        throw new NotImplementedException();\n    }\n\n    public IContainerRegistry RegisterManySingleton(Type type, params Type[] serviceTypes)\n    {\n        throw new NotImplementedException();\n    }\n\n    public IContainerRegistry RegisterScoped(Type from, Type to)\n    {\n        throw new NotImplementedException();\n    }\n\n    public IContainerRegistry RegisterScoped(Type type, Func<object> factoryMethod)\n    {\n        throw new NotImplementedException();\n    }\n\n    public IContainerRegistry RegisterScoped(Type type, Func<IContainerProvider, object> factoryMethod)\n    {\n        _factories.Add(new(type, factoryMethod));\n        return this;\n    }\n\n    public IContainerRegistry RegisterSingleton(Type from, Type to)\n    {\n        throw new NotImplementedException();\n    }\n\n    public IContainerRegistry RegisterSingleton(Type from, Type to, string name)\n    {\n        throw new NotImplementedException();\n    }\n\n    public IContainerRegistry RegisterSingleton(Type type, Func<object> factoryMethod)\n    {\n        throw new NotImplementedException();\n    }\n\n    public IContainerRegistry RegisterSingleton(Type type, Func<IContainerProvider, object> factoryMethod)\n    {\n        _factories.Add(new(type, factoryMethod));\n        return this;\n    }\n\n    public object Resolve(Type type)\n    {\n        return Resolve(type, Array.Empty<(Type, object)>());\n    }\n\n    public object Resolve(Type type, params (Type Type, object Instance)[] parameters)\n    {\n        if(type.IsGenericType && typeof(IEnumerable<>).MakeGenericType(type.GenericTypeArguments) == type)\n        {\n            var list = Activator.CreateInstance(typeof(List<>).MakeGenericType(type.GenericTypeArguments));\n            foreach(var item in _instances.Where(x => x.GetType().IsAssignableTo(type.GenericTypeArguments.First())))\n            {\n                var addMethod = list.GetType().GetMethod(\"Add\");\n                addMethod.Invoke(list, new[] { item });\n            }\n\n            foreach(var item in _factories.Where(x => x.Key == type.GenericTypeArguments.First()))\n            {\n                var addMethod = list.GetType().GetMethod(\"Add\");\n                addMethod.Invoke(list, new[] { item.Value(this) });\n            }\n\n            return list;\n        }\n        else if (type == typeof(IEnumerable<ViewRegistration>))\n            return _instances.OfType<ViewRegistration>();\n        else if (_instances.Any(x => x.GetType() == type || x.GetType().IsAssignableTo(type)))\n            return _instances.Last(x => x.GetType() == type || x.GetType().IsAssignableTo(type));\n\n        var constructor = type.GetConstructors()\n            .OrderByDescending(x => x.GetParameters().Length)\n            .FirstOrDefault();\n\n        if (constructor is null || !constructor.GetParameters().Any())\n        {\n            var aInstance = Activator.CreateInstance(type);\n            _instances.Add(aInstance);\n            return aInstance;\n        }\n\n        var args = new List<object>();\n        foreach(var parameter in constructor.GetParameters())\n        {\n            if (parameter.ParameterType == typeof(IEnumerable<ViewRegistration>))\n                args.Add(_instances.OfType<ViewRegistration>());\n            else if (parameter.ParameterType == typeof(IContainerExtension) || parameter.ParameterType == typeof(IContainerProvider))\n                args.Add(this);\n            else if (_instances.Any(x => x.GetType().IsAssignableTo(parameter.ParameterType)))\n                args.Add(_instances.Last(x => x.GetType().IsAssignableTo(parameter.ParameterType)));\n            else if (!type.IsAbstract && !type.IsInterface)\n                args.Add(Resolve(parameter.ParameterType, parameters));\n            else\n                throw new NotSupportedException();\n        }\n\n        var instance = constructor.Invoke(args.ToArray());\n        _instances.Add(instance);\n        return instance;\n    }\n\n    public object Resolve(Type type, string name)\n    {\n        throw new NotImplementedException();\n    }\n\n    public object Resolve(Type type, string name, params (Type Type, object Instance)[] parameters)\n    {\n        throw new NotImplementedException();\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Mocks/MockResourcesProvider.cs",
    "content": "﻿using Microsoft.Maui.Controls.Internals;\nusing Prism.Maui.Tests.Mocks;\n\n#pragma warning disable CS0612 // Type or member is obsolete\n[assembly: Dependency(typeof(MockResourcesProvider))]\n[assembly: Dependency(typeof(MockFontNamedSizeService))]\n#pragma warning restore CS0612 // Type or member is obsolete\n\nnamespace Prism.Maui.Tests.Mocks;\n\n[Obsolete]\ninternal class MockResourcesProvider : ISystemResourcesProvider\n{\n    public IResourceDictionary GetSystemResources()\n    {\n        var dictionary = new ResourceDictionary();\n        Style style;\n        style = new Style(typeof(Label));\n        dictionary[Device.Styles.BodyStyleKey] = style;\n\n        style = new Style(typeof(Label));\n        style.Setters.Add(Label.FontSizeProperty, 50);\n        dictionary[Device.Styles.TitleStyleKey] = style;\n\n        style = new Style(typeof(Label));\n        style.Setters.Add(Label.FontSizeProperty, 40);\n        dictionary[Device.Styles.SubtitleStyleKey] = style;\n\n        style = new Style(typeof(Label));\n        style.Setters.Add(Label.FontSizeProperty, 30);\n        dictionary[Device.Styles.CaptionStyleKey] = style;\n\n        style = new Style(typeof(Label));\n        style.Setters.Add(Label.FontSizeProperty, 20);\n        dictionary[Device.Styles.ListItemTextStyleKey] = style;\n\n        style = new Style(typeof(Label));\n        style.Setters.Add(Label.FontSizeProperty, 10);\n        dictionary[Device.Styles.ListItemDetailTextStyleKey] = style;\n\n        return dictionary;\n    }\n}\n\n[Obsolete]\npublic class MockFontNamedSizeService : IFontNamedSizeService\n{\n    public double GetNamedSize(NamedSize size, Type targetElement, bool useOldSizes)\n    {\n        return size switch\n        {\n            NamedSize.Default => 12,// new MockFontManager().DefaultFontSize,\n            NamedSize.Micro => (double)4,\n            NamedSize.Small => (double)8,\n            NamedSize.Medium => (double)12,\n            NamedSize.Large => (double)16,\n            _ => throw new ArgumentOutOfRangeException(nameof(size)),\n        };\n    }\n}"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Mocks/PageNavigationContainerMock.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing Moq;\n\nnamespace Prism.Maui.Tests.Mocks;\n\npublic class PageNavigationContainerMock : IContainerExtension, IDisposable\n{\n    Dictionary<string, Type> _registeredPages = new Dictionary<string, Type>();\n\n    public object Instance => throw new NotImplementedException();\n\n    public IScopedProvider CurrentScope { get; private set; }\n\n    public IContainerRegistry Register(string key, Type type)\n    {\n        throw new NotImplementedException();\n    }\n\n    public object Resolve(Type type)\n    {\n        return Activator.CreateInstance(type);\n    }\n\n    public object Resolve(Type type, string name)\n    {\n        if (_registeredPages.ContainsKey(name))\n            return Activator.CreateInstance(_registeredPages[name]);\n\n        return null;\n    }\n\n    public IContainerRegistry Register(Type from, Type to)\n    {\n        return this;\n    }\n\n    public IContainerRegistry Register(Type from, Type to, string name)\n    {\n        throw new NotImplementedException();\n    }\n\n    public IContainerRegistry RegisterInstance(Type type, object instance)\n    {\n        throw new NotImplementedException();\n    }\n\n    public IContainerRegistry RegisterSingleton(Type type)\n    {\n        throw new NotImplementedException();\n    }\n\n    public IContainerRegistry RegisterSingleton(Type from, Type to)\n    {\n        throw new NotImplementedException();\n    }\n\n    public IContainerRegistry RegisterType(Type type)\n    {\n        throw new NotImplementedException();\n    }\n\n    public IContainerRegistry RegisterType(Type type, string name)\n    {\n        throw new NotImplementedException();\n    }\n\n    public void Dispose()\n    {\n    }\n\n    public void FinalizeExtension()\n    {\n\n    }\n\n    public bool IsRegistered(Type type)\n    {\n        throw new NotImplementedException();\n    }\n\n    public bool IsRegistered(Type type, string name)\n    {\n        throw new NotImplementedException();\n    }\n\n    public IContainerRegistry RegisterInstance(Type type, object instance, string name)\n    {\n        throw new NotImplementedException();\n    }\n\n    public IContainerRegistry RegisterSingleton(Type from, Type to, string name)\n    {\n        throw new NotImplementedException();\n    }\n\n    public object Resolve(Type type, params (Type Type, object Instance)[] parameters)\n    {\n        throw new NotImplementedException();\n    }\n\n    public object Resolve(Type type, string name, params (Type Type, object Instance)[] parameters)\n    {\n        throw new NotImplementedException();\n    }\n\n    public IScopedProvider CreateScope()\n    {\n        CurrentScope = Mock.Of<IScopedProvider>();\n        return CurrentScope;\n    }\n\n    public IContainerRegistry RegisterSingleton(Type type, Func<object> factoryMethod)\n    {\n        throw new NotImplementedException();\n    }\n\n    public IContainerRegistry RegisterSingleton(Type type, Func<IContainerProvider, object> factoryMethod)\n    {\n        throw new NotImplementedException();\n    }\n\n    public IContainerRegistry RegisterManySingleton(Type type, params Type[] serviceTypes)\n    {\n        throw new NotImplementedException();\n    }\n\n    public IContainerRegistry Register(Type type, Func<object> factoryMethod)\n    {\n        throw new NotImplementedException();\n    }\n\n    public IContainerRegistry Register(Type type, Func<IContainerProvider, object> factoryMethod)\n    {\n        throw new NotImplementedException();\n    }\n\n    public IContainerRegistry RegisterMany(Type type, params Type[] serviceTypes)\n    {\n        throw new NotImplementedException();\n    }\n\n    public IContainerRegistry RegisterScoped(Type from, Type to)\n    {\n        throw new NotImplementedException();\n    }\n\n    public IContainerRegistry RegisterScoped(Type type, Func<object> factoryMethod)\n    {\n        throw new NotImplementedException();\n    }\n\n    public IContainerRegistry RegisterScoped(Type type, Func<IContainerProvider, object> factoryMethod)\n    {\n        throw new NotImplementedException();\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Mocks/PageNavigationEvent.cs",
    "content": "﻿namespace Prism.Maui.Tests.Mocks;\n\npublic enum PageNavigationEvent\n{\n    OnInitialized,\n    OnInitializedAsync,\n    OnNavigatedFrom,\n    OnNavigatedTo,\n    Destroy\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Mocks/PageNavigationEventRecorder.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Prism.Maui.Tests.Mocks;\n\npublic class PageNavigationEventRecorder\n{\n    private readonly Queue<PageNavigationRecord> _records = new Queue<PageNavigationRecord>();\n\n    public IReadOnlyList<PageNavigationRecord> Records => _records.ToList();\n\n    public bool IsEmpty => _records.Count == 0;\n\n    /// <summary>\n    /// Initialize Instance.\n    /// </summary>\n    public PageNavigationEventRecorder()\n    {\n    }\n\n    /// <summary>\n    /// Recorde navigation event.\n    /// </summary>\n    /// <param name=\"sender\"></param>\n    /// <param name=\"pageNavigationEvent\"></param>\n    public void Record(object sender, PageNavigationEvent pageNavigationEvent)\n    {\n        _records.Enqueue(new PageNavigationRecord(sender, pageNavigationEvent));\n    }\n\n    public PageNavigationRecord TakeFirst()\n    {\n        if (_records.Count == 0) throw new InvalidOperationException(\"Not exist records.\");\n\n        return _records.Dequeue();\n    }\n\n    public void Clear()\n    {\n        _records.Clear();\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Mocks/PageNavigationRecord.cs",
    "content": "﻿namespace Prism.Maui.Tests.Mocks;\n\npublic class PageNavigationRecord\n{\n    public object Sender { get; }\n    public PageNavigationEvent Event { get; }\n\n    public PageNavigationRecord(object sender, PageNavigationEvent @event)\n    {\n        Sender = sender;\n        Event = @event;\n    }\n\n    public override string ToString()\n    {\n        return $\"{Sender} - {Event}\";\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Mocks/TestDispatcher.cs",
    "content": "﻿using Microsoft.Maui.Dispatching;\n\nnamespace Prism.Maui.Tests.Mocks;\n\ninternal class TestDispatcher\n{\n    public static readonly IDispatcherProvider Provider = new DispatcherProviderMock();\n\n    public static IDispatcher Current => new DispatcherMock();\n\n    private class DispatcherProviderMock : IDispatcherProvider\n    {\n        public IDispatcher GetForCurrentThread() => new DispatcherMock();\n    }\n\n    private class DispatcherMock : IDispatcher\n    {\n        public bool IsDispatchRequired { get; }\n\n        public IDispatcherTimer CreateTimer() => new DispatchTimerMock();\n\n        public bool Dispatch(Action action) => true;\n\n        public bool DispatchDelayed(TimeSpan delay, Action action)\n        {\n            return delay > TimeSpan.Zero;\n        }\n    }\n\n    private class DispatchTimerMock : IDispatcherTimer\n    {\n        public TimeSpan Interval { get; set; }\n        public bool IsRepeating { get; set; }\n        public bool IsRunning { get; private set; }\n\n#pragma warning disable CS0067\n        public event EventHandler Tick;\n#pragma warning restore CS0067\n\n        public void Start()\n        {\n            IsRunning = true;\n        }\n\n        public void Stop()\n        {\n            IsRunning = false;\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Mocks/ViewModels/ContentPageMock1ViewModel.cs",
    "content": "﻿namespace Prism.Maui.Tests.Mocks.ViewModels\n{\n    public class ContentPageMock1ViewModel : ContentPageMockViewModel\n    {\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Mocks/ViewModels/ContentPageMockViewModel.cs",
    "content": "﻿using System;\nusing System.Threading.Tasks;\nusing Prism.Navigation;\n\nnamespace Prism.Maui.Tests.Mocks.ViewModels\n{\n    public class ContentPageMockViewModel : ViewModelBase, IConfirmNavigation\n    {\n        public bool OnConfirmNavigationCalled { get; private set; } = false;\n\n        public bool CanNavigate(INavigationParameters parameters)\n        {\n            OnConfirmNavigationCalled = true;\n\n            if (parameters.ContainsKey(\"canNavigate\"))\n                return (bool)parameters[\"canNavigate\"];\n\n            return true;\n        }\n    }\n\n    public class SecondContentPageMockViewModel : ViewModelBase\n    {\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Mocks/ViewModels/FlyoutPageMockViewModel.cs",
    "content": "﻿using System;\nusing Prism.Navigation;\n\nnamespace Prism.Maui.Tests.Mocks.ViewModels\n{\n    public class FlyoutPageMockViewModel : ViewModelBase\n    {\n    }\n\n    public class FlyoutPageEmptyMockViewModel : ViewModelBase, IFlyoutPageOptions\n    {\n        public bool IsPresentedAfterNavigation { get; set; }\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Mocks/ViewModels/NavigationPageMockViewModel.cs",
    "content": "﻿using Prism.Navigation;\n\nnamespace Prism.Maui.Tests.Mocks.ViewModels\n{\n    public class NavigationPageMockViewModel : ViewModelBase\n    {\n\n    }\n\n    public class NavigationPageEmptyMockViewModel : ViewModelBase\n    {\n\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Mocks/ViewModels/NavigationPathPageMockViewModel.cs",
    "content": "﻿using Prism.Navigation;\n\nnamespace Prism.Maui.Tests.Navigation.Mocks.ViewModels\n{\n    public class NavigationPathPageMockViewModel\n    {\n        public INavigationService NavigationService { get; }\n\n        public NavigationPathPageMockViewModel(INavigationService navigationService)\n        {\n            NavigationService = navigationService;\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Mocks/ViewModels/PageMockViewModel.cs",
    "content": "﻿namespace Prism.Maui.Tests.Mocks.ViewModels\n{\n    public class PageMockViewModel : ViewModelBase\n    {\n\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Mocks/ViewModels/Tab1MockViewModel.cs",
    "content": "﻿using Prism.Maui.Tests.Mocks.ViewModels;\n\nnamespace Prism.Maui.Tests.Navigation.Mocks.ViewModels\n{\n    public class Tab1MockViewModel : ViewModelBase\n    {\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Mocks/ViewModels/Tab2MockViewModel.cs",
    "content": "﻿using Prism.Maui.Tests.Mocks.ViewModels;\n\nnamespace Prism.Maui.Tests.Navigation.Mocks.ViewModels\n{\n    public class Tab2MockViewModel : ViewModelBase\n    {\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Mocks/ViewModels/Tab3MockViewModel.cs",
    "content": "﻿using Prism.Maui.Tests.Mocks.ViewModels;\n\nnamespace Prism.Maui.Tests.Navigation.Mocks.ViewModels\n{\n    public class Tab3MockViewModel : ViewModelBase\n    {\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Mocks/ViewModels/TabbedPageMockViewModel.cs",
    "content": "﻿namespace Prism.Maui.Tests.Mocks.ViewModels\n{\n    public class TabbedPageMockViewModel : ViewModelBase\n    {\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Mocks/ViewModels/VMLDisabledPageMockViewModel.cs",
    "content": "﻿namespace Prism.Maui.Tests.Mocks.ViewModels;\n\n// This should not be autowired\npublic class VMLDisabledPageMockViewModel\n{\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Mocks/ViewModels/ViewModelBase.cs",
    "content": "﻿using System;\nusing System.Threading.Tasks;\nusing Prism.Mvvm;\nusing Prism.Navigation;\n\nnamespace Prism.Maui.Tests.Mocks.ViewModels\n{\n    public class ViewModelBase : BindableBase, IInitialize, IInitializeAsync, INavigationAware, IDestructible, IPageNavigationEventRecordable\n    {\n        public INavigationParameters NavigatedToParameters { get; private set; }\n        public INavigationParameters NavigatedFromParameters { get; private set; }\n        public PageNavigationEventRecorder PageNavigationEventRecorder { get; set; }\n\n        public bool OnNavigatedToCalled { get; private set; } = false;\n\n        public bool InitializeCalled { get; private set; } = false;\n\n        public bool InitializeAsyncCalled { get; private set; } = false;\n\n        public bool OnNavigatedFromCalled { get; private set; } = false;\n\n        public bool DestroyCalled { get; private set; } = false;\n\n        public void OnNavigatedFrom(INavigationParameters parameters)\n        {\n            OnNavigatedFromCalled = true;\n            NavigatedFromParameters = parameters;\n            PageNavigationEventRecorder?.Record(this, PageNavigationEvent.OnNavigatedFrom);\n        }\n\n        public void OnNavigatedTo(INavigationParameters parameters)\n        {\n            OnNavigatedToCalled = true;\n            NavigatedToParameters = parameters;\n            PageNavigationEventRecorder?.Record(this, PageNavigationEvent.OnNavigatedTo);\n        }\n\n        public void Initialize(INavigationParameters parameters)\n        {\n            InitializeCalled = true;\n            PageNavigationEventRecorder?.Record(this, PageNavigationEvent.OnInitialized);\n        }\n\n        public Task InitializeAsync(INavigationParameters parameters)\n        {\n            InitializeAsyncCalled = true;\n            PageNavigationEventRecorder?.Record(this, PageNavigationEvent.OnInitializedAsync);\n            return Task.CompletedTask;\n        }\n\n        public void Destroy()\n        {\n            DestroyCalled = true;\n            PageNavigationEventRecorder?.Record(this, PageNavigationEvent.Destroy);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Mocks/Views/ContentPageMock.cs",
    "content": "﻿using System.Threading.Tasks;\nusing Microsoft.Maui.Controls;\n\nnamespace Prism.Maui.Tests.Mocks.Views;\n\npublic class ContentPageMock : ContentPage, IInitialize, IInitializeAsync, INavigationAware, IConfirmNavigationAsync, IDestructible, IPageNavigationEventRecordable\n{\n    public PageNavigationEventRecorder PageNavigationEventRecorder { get; set; }\n    public bool OnNavigatedToCalled { get; private set; } = false;\n    public bool OnNavigatedFromCalled { get; private set; } = false;\n    public bool InitializeCalled { get; private set; } = false;\n    public bool InitializeAsyncCalled { get; private set; } = false;\n\n    public bool OnConfirmNavigationCalled { get; private set; } = false;\n\n    public bool DestroyCalled { get; private set; } = false;\n\n    public ContentPageMock() : this(null)\n    {\n    }\n\n    public ContentPageMock(PageNavigationEventRecorder recorder)\n    {\n        PageNavigationEventRecorder = recorder;\n    }\n\n    protected override void OnBindingContextChanged()\n    {\n        if (BindingContext is not null && PageNavigationEventRecorder is not null)\n            ((IPageNavigationEventRecordable)BindingContext).PageNavigationEventRecorder = PageNavigationEventRecorder;\n    }\n\n    public void OnNavigatedFrom(INavigationParameters parameters)\n    {\n        OnNavigatedFromCalled = true;\n        PageNavigationEventRecorder?.Record(this, PageNavigationEvent.OnNavigatedFrom);\n    }\n\n    public void OnNavigatedTo(INavigationParameters parameters)\n    {\n        OnNavigatedToCalled = true;\n        PageNavigationEventRecorder?.Record(this, PageNavigationEvent.OnNavigatedTo);\n    }\n\n    public void Initialize(INavigationParameters parameters)\n    {\n        InitializeCalled = true;\n        PageNavigationEventRecorder?.Record(this, PageNavigationEvent.OnInitialized);\n    }\n\n    public Task InitializeAsync(INavigationParameters parameters)\n    {\n        InitializeAsyncCalled = true;\n        PageNavigationEventRecorder?.Record(this, PageNavigationEvent.OnInitializedAsync);\n        return Task.CompletedTask;\n    }\n\n    public Task<bool> CanNavigateAsync(INavigationParameters parameters)\n    {\n        return Task.Run(() =>\n        {\n            OnConfirmNavigationCalled = true;\n\n            if (parameters.ContainsKey(\"canNavigate\"))\n                return (bool)parameters[\"canNavigate\"];\n\n            return true;\n        });\n    }\n\n    public void Destroy()\n    {\n        DestroyCalled = true;\n        PageNavigationEventRecorder?.Record(this, PageNavigationEvent.Destroy);\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Mocks/Views/ContentPageMock1.cs",
    "content": "﻿namespace Prism.Maui.Tests.Mocks.Views;\n\npublic class ContentPageMock1 : ContentPageMock\n{\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Mocks/Views/FlyoutPageEmptyMock.cs",
    "content": "﻿using Microsoft.Maui.Controls;\n\nnamespace Prism.Maui.Tests.Mocks.Views;\n\npublic class FlyoutPageEmptyMock : FlyoutPage\n{\n    public FlyoutPageEmptyMock()\n    {\n        //ViewModelLocator.SetAutowireViewModel(this, true);\n        Flyout = new ContentPageMock { Title = \"Master\" };\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Mocks/Views/FlyoutPageMock.cs",
    "content": "﻿using Microsoft.Maui.Controls;\n\nnamespace Prism.Maui.Tests.Mocks.Views;\n\npublic class FlyoutPageMock : FlyoutPage, IFlyoutPageOptions, IDestructible, IPageNavigationEventRecordable\n{\n    public PageNavigationEventRecorder PageNavigationEventRecorder { get; set; }\n\n    public FlyoutPageMock() : this(null)\n    {\n    }\n\n    public FlyoutPageMock(PageNavigationEventRecorder recorder)\n    {\n        Flyout = new ContentPageMock(recorder) { Title = \"Master\" };\n        Detail = new ContentPageMock(recorder);\n\n        //ViewModelLocator.SetAutowireViewModel(this, true);\n\n        PageNavigationEventRecorder = recorder;\n        ((IPageNavigationEventRecordable)BindingContext).PageNavigationEventRecorder = recorder;\n    }\n\n    public FlyoutPageMock(PageNavigationEventRecorder recorder, Page masterPage, Page detailPage)\n    {\n        Flyout = masterPage;\n        Detail = detailPage;\n\n        //ViewModelLocator.SetAutowireViewModel(this, true);\n\n        PageNavigationEventRecorder = recorder;\n        ((IPageNavigationEventRecordable)BindingContext).PageNavigationEventRecorder = recorder;\n    }\n\n    public bool IsPresentedAfterNavigation { get; set; }\n    public void Destroy()\n    {\n        PageNavigationEventRecorder.Record(this, PageNavigationEvent.Destroy);\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Mocks/Views/NavigationPageEmptyMock.cs",
    "content": "﻿using System.Threading.Tasks;\nusing Microsoft.Maui.Controls;\n\nnamespace Prism.Maui.Tests.Mocks.Views;\n\npublic class NavigationPageEmptyMock : NavigationPage, INavigationAware, IConfirmNavigationAsync, IDestructible, IPageNavigationEventRecordable\n{\n    public PageNavigationEventRecorder PageNavigationEventRecorder { get; set; }\n    public NavigationPageEmptyMock() : base()\n    {\n\n    }\n\n    public NavigationPageEmptyMock(PageNavigationEventRecorder recorder)\n    {\n        //ViewModelLocator.SetAutowireViewModel(this, true);\n\n        PageNavigationEventRecorder = recorder;\n        ((IPageNavigationEventRecordable)BindingContext).PageNavigationEventRecorder = recorder;\n    }\n\n    public void OnNavigatedFrom(INavigationParameters parameters)\n    {\n        PageNavigationEventRecorder?.Record(this, PageNavigationEvent.OnNavigatedFrom);\n    }\n\n    public void OnNavigatedTo(INavigationParameters parameters)\n    {\n        PageNavigationEventRecorder?.Record(this, PageNavigationEvent.OnNavigatedTo);\n    }\n\n    public void OnNavigatingTo(INavigationParameters parameters)\n    {\n        PageNavigationEventRecorder?.Record(this, PageNavigationEvent.OnInitialized);\n    }\n\n    public Task<bool> CanNavigateAsync(INavigationParameters parameters)\n    {\n        return Task.Run(() =>\n        {\n            if (parameters.ContainsKey(\"canNavigate\"))\n                return (bool)parameters[\"canNavigate\"];\n\n            return true;\n        });\n    }\n\n    public void Destroy()\n    {\n        PageNavigationEventRecorder?.Record(this, PageNavigationEvent.Destroy);\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Mocks/Views/NavigationPageEmptyMock_Reused.cs",
    "content": "﻿namespace Prism.Maui.Tests.Mocks.Views;\n\npublic class NavigationPageEmptyMock_Reused : NavigationPageEmptyMock, INavigationPageOptions\n{\n    public bool ClearNavigationStackOnNavigation => false;\n\n    public NavigationPageEmptyMock_Reused() : base()\n    {\n\n    }\n\n    public NavigationPageEmptyMock_Reused(PageNavigationEventRecorder recorder) : base(recorder)\n    {\n\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Mocks/Views/NavigationPageMock.cs",
    "content": "﻿using Microsoft.Maui.Controls;\n\nnamespace Prism.Maui.Tests.Mocks.Views;\n\npublic class NavigationPageMock : NavigationPage, IDestructible, IPageNavigationEventRecordable, INavigationPageOptions, IInitialize, INavigationAware\n{\n    public bool DestroyCalled { get; private set; } = false;\n    public PageNavigationEventRecorder PageNavigationEventRecorder { get; set; }\n\n    public NavigationPageMock() : this(null)\n    {\n    }\n\n    public NavigationPageMock(PageNavigationEventRecorder recorder) : this(recorder, new ContentPageMock(recorder))\n    {\n    }\n\n    public NavigationPageMock(PageNavigationEventRecorder recorder, Page page) : base(page)\n    {\n        //ViewModelLocator.SetAutowireViewModel(this, true);\n\n        PageNavigationEventRecorder = recorder;\n        ((IPageNavigationEventRecordable)BindingContext).PageNavigationEventRecorder = recorder;\n    }\n\n    public void Destroy()\n    {\n        DestroyCalled = true;\n        PageNavigationEventRecorder?.Record(this, PageNavigationEvent.Destroy);\n    }\n\n    public bool ClearNavigationStackOnNavigation { get; set; } = true;\n    public void OnNavigatedFrom(INavigationParameters parameters)\n    {\n        PageNavigationEventRecorder?.Record(this, PageNavigationEvent.OnNavigatedFrom);\n    }\n\n    public void OnNavigatedTo(INavigationParameters parameters)\n    {\n        PageNavigationEventRecorder?.Record(this, PageNavigationEvent.OnNavigatedTo);\n    }\n\n    public void Initialize(INavigationParameters parameters)\n    {\n        PageNavigationEventRecorder?.Record(this, PageNavigationEvent.OnInitialized);\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Mocks/Views/NavigationPagePathPageMock.cs",
    "content": "﻿using Microsoft.Maui.Controls;\nusing Prism.Maui.Tests.Navigation.Mocks.ViewModels;\n\nnamespace Prism.Maui.Tests.Navigation.Mocks.Views;\n\npublic class NavigationPathPageMock : ContentPage\n{\n    public NavigationPathPageMockViewModel ViewModel { get; }\n    public NavigationPathPageMock()\n    {\n        //var navService = new PageNavigationServiceMock(null, new ApplicationMock(), null);\n        //((IPageAware)navService).Page = this;\n\n        //BindingContext = ViewModel = new NavigationPathPageMockViewModel(navService);\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Mocks/Views/NavigationPageWithStackMock.cs",
    "content": "﻿using Microsoft.Maui.Controls;\n\nnamespace Prism.Maui.Tests.Mocks.Views;\n\npublic class NavigationPageWithStackMock : NavigationPage\n{\n    public NavigationPageWithStackMock() : base()\n    {\n        var p1 = new ContentPageMock();\n        var p2 = new ContentPage();\n        var p3 = new ContentPage();\n\n        Navigation.PushAsync(p1);\n        p1.Navigation.PushAsync(p2);\n        p2.Navigation.PushAsync(p3);\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Mocks/Views/NavigationPageWithStackNoMatchMock.cs",
    "content": "﻿using Microsoft.Maui.Controls;\n\nnamespace Prism.Maui.Tests.Mocks.Views;\n\npublic class NavigationPageWithStackNoMatchMock : NavigationPage\n{\n    public NavigationPageWithStackNoMatchMock() : base()\n    {\n        var p1 = new ContentPage();\n        var p2 = new ContentPage();\n        var p3 = new ContentPage();\n\n        Navigation.PushAsync(p1);\n        p1.Navigation.PushAsync(p2);\n        p2.Navigation.PushAsync(p3);\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Mocks/Views/NavigationPathPageMock2.cs",
    "content": "﻿namespace Prism.Maui.Tests.Navigation.Mocks.Views;\n\npublic class NavigationPathPageMock2 : NavigationPathPageMock\n{\n    public NavigationPathPageMock2()\n    {\n\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Mocks/Views/NavigationPathPageMock3.cs",
    "content": "﻿namespace Prism.Maui.Tests.Navigation.Mocks.Views;\n\npublic class NavigationPathPageMock3 : NavigationPathPageMock\n{\n    public NavigationPathPageMock3()\n    {\n\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Mocks/Views/NavigationPathPageMock4.cs",
    "content": "﻿namespace Prism.Maui.Tests.Navigation.Mocks.Views;\n\npublic class NavigationPathPageMock4 : NavigationPathPageMock\n{\n    public NavigationPathPageMock4()\n    {\n\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Mocks/Views/NavigationPathTabbedPageMock.cs",
    "content": "﻿using Prism.Maui.Tests.Navigation.Mocks.ViewModels;\nusing Microsoft.Maui.Controls;\n\nnamespace Prism.Maui.Tests.Navigation.Mocks.Views;\n\npublic class NavigationPathTabbedPageMock : TabbedPage\n{\n    public NavigationPathPageMockViewModel ViewModel { get; }\n\n    public NavigationPathTabbedPageMock()\n    {\n        //var navService = new PageNavigationServiceMock(null, new ApplicationMock(), null);\n        //((IPageAware)navService).Page = this;\n\n        //BindingContext = ViewModel = new NavigationPathPageMockViewModel(navService);\n\n        Children.Add(new NavigationPathPageMock());\n        Children.Add(new NavigationPathPageMock2());\n        Children.Add(new NavigationPathPageMock3());\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Mocks/Views/PageMock.cs",
    "content": "﻿using System.Threading.Tasks;\nusing Microsoft.Maui.Controls;\n\nnamespace Prism.Maui.Tests.Mocks.Views;\n\npublic class PageMock : Page, IInitialize, INavigationAware, IConfirmNavigationAsync, IDestructible, IPageNavigationEventRecordable\n{\n    public PageNavigationEventRecorder PageNavigationEventRecorder { get; set; }\n\n    public PageMock() : this(null)\n    {\n\n    }\n\n    public PageMock(PageNavigationEventRecorder recorder)\n    {\n        PageNavigationEventRecorder = recorder;\n    }\n\n    public void OnNavigatedFrom(INavigationParameters parameters)\n    {\n        PageNavigationEventRecorder?.Record(this, PageNavigationEvent.OnNavigatedFrom);\n    }\n\n    public void OnNavigatedTo(INavigationParameters parameters)\n    {\n        PageNavigationEventRecorder?.Record(this, PageNavigationEvent.OnNavigatedTo);\n    }\n\n    public void Initialize(INavigationParameters parameters)\n    {\n        PageNavigationEventRecorder?.Record(this, PageNavigationEvent.OnInitialized);\n    }\n\n    public Task<bool> CanNavigateAsync(INavigationParameters parameters)\n    {\n        return Task.Run(() =>\n        {\n            if (parameters.ContainsKey(\"canNavigate\"))\n                return (bool)parameters[\"canNavigate\"];\n\n            return true;\n        });\n    }\n\n    public void Destroy()\n    {\n        PageNavigationEventRecorder?.Record(this, PageNavigationEvent.Destroy);\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Mocks/Views/SecondContentPageMock.cs",
    "content": "﻿namespace Prism.Maui.Tests.Mocks.Views;\n\npublic class SecondContentPageMock : ContentPageMock\n{\n    public SecondContentPageMock()\n    {\n    }\n\n    public SecondContentPageMock(PageNavigationEventRecorder recorder) : base(recorder)\n    {\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Mocks/Views/Tab1Mock.cs",
    "content": "﻿using Prism.Maui.Tests.Mocks;\nusing Prism.Maui.Tests.Mocks.Views;\n\nnamespace Prism.Maui.Tests.Navigation.Mocks.Views;\n\npublic class Tab1Mock : ContentPageMock\n{\n    public Tab1Mock() : this(null)\n    {\n    }\n\n    public Tab1Mock(PageNavigationEventRecorder recorder) : base(recorder)\n    {\n\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Mocks/Views/Tab2Mock.cs",
    "content": "﻿using Prism.Maui.Tests.Mocks;\nusing Prism.Maui.Tests.Mocks.Views;\n\nnamespace Prism.Maui.Tests.Navigation.Mocks.Views;\n\npublic class Tab2Mock : ContentPageMock\n{\n    public Tab2Mock() : this(null)\n    {\n    }\n\n    public Tab2Mock(PageNavigationEventRecorder recorder) : base(recorder)\n    {\n\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Mocks/Views/Tab3Mock.cs",
    "content": "﻿using Prism.Maui.Tests.Mocks;\nusing Prism.Maui.Tests.Mocks.Views;\n\nnamespace Prism.Maui.Tests.Navigation.Mocks.Views;\n\npublic class Tab3Mock : ContentPageMock\n{\n    public Tab3Mock() : this(null)\n    {\n    }\n\n    public Tab3Mock(PageNavigationEventRecorder recorder) : base(recorder)\n    {\n\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Mocks/Views/TabbedPageEmptyMock.cs",
    "content": "﻿using Microsoft.Maui.Controls;\n\nnamespace Prism.Maui.Tests.Navigation.Mocks.Views;\n\npublic class TabbedPageEmptyMock : TabbedPage\n{\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Mocks/Views/TabbedPageMock.cs",
    "content": "﻿using Microsoft.Maui.Controls;\nusing Prism.Maui.Tests.Navigation.Mocks.Views;\n\nnamespace Prism.Maui.Tests.Mocks.Views;\n\npublic class TabbedPageMock : TabbedPage, IDestructible, IInitialize, INavigationAware, IPageNavigationEventRecordable\n{\n    public bool DestroyCalled { get; private set; } = false;\n    public PageNavigationEventRecorder PageNavigationEventRecorder { get; set; }\n\n    public TabbedPageMock() : this(null)\n    {\n    }\n\n    public TabbedPageMock(PageNavigationEventRecorder recorder)\n    {\n        //ViewModelLocator.SetAutowireViewModel(this, true);\n\n        Children.Add(new Tab1Mock(recorder) { Title = \"Page 1\" });\n        Children.Add(new Tab2Mock() { Title = \"Page 2\", BindingContext = null });\n        Children.Add(new Tab3Mock(recorder) { Title = \"Page 3\" });\n        Children.Add(new NavigationPageMock(recorder, new ContentPageMock(recorder)) { Title = \"Page 4\" });\n        Children.Add(new NavigationPageMock(recorder, new PageMock()) { Title = \"Page 5\" });\n\n        PageNavigationEventRecorder = recorder;\n\n        var recordable = BindingContext as IPageNavigationEventRecordable;\n        if (recordable != null)\n            recordable.PageNavigationEventRecorder = recorder;\n    }\n\n\n    public void Destroy()\n    {\n        DestroyCalled = true;\n        PageNavigationEventRecorder?.Record(this, PageNavigationEvent.Destroy);\n    }\n\n    public void OnNavigatedFrom(INavigationParameters parameters)\n    {\n        PageNavigationEventRecorder?.Record(this, PageNavigationEvent.OnNavigatedFrom);\n    }\n\n    public void OnNavigatedTo(INavigationParameters parameters)\n    {\n        PageNavigationEventRecorder?.Record(this, PageNavigationEvent.OnNavigatedTo);\n    }\n\n    public void Initialize(INavigationParameters parameters)\n    {\n        PageNavigationEventRecorder?.Record(this, PageNavigationEvent.OnInitialized);\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Mocks/Views/VMLDisabledPageMock.cs",
    "content": "﻿using Microsoft.Maui.Controls;\n\nnamespace Prism.Maui.Tests.Mocks.Views;\n\npublic class VMLDisabledPageMock : ContentPage\n{\n    public VMLDisabledPageMock()\n    {\n        SetValue(ViewModelLocator.AutowireViewModelProperty, ViewModelLocatorBehavior.Disabled);\n    }\n}\n"
  },
  {
    "path": "tests/Maui/Prism.Maui.Tests/Prism.Maui.Tests.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFramework>net10.0</TargetFramework>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <Compile Remove=\"Fixtures\\PageNavigationServiceFixture.cs\" />\n    <None Include=\"Fixtures\\PageNavigationServiceFixture.cs\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Microsoft.Maui.Controls\" VersionOverride=\"10.0.10\" />\n    <PackageReference Include=\"GitHubActionsTestLogger\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"Microsoft.NET.Test.Sdk\" />\n    <PackageReference Include=\"Moq\" />\n    <PackageReference Include=\"xunit\" />\n    <PackageReference Include=\"xunit.runner.visualstudio\">\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n      <PrivateAssets>all</PrivateAssets>\n    </PackageReference>\n    <PackageReference Include=\"coverlet.collector\">\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n      <PrivateAssets>all</PrivateAssets>\n    </PackageReference>\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\..\\src\\Maui\\Prism.Maui\\Prism.Maui.csproj\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "tests/Prism.Core.Tests/Commands/AsyncDelegateCommandFixture.cs",
    "content": "﻿using System.Threading;\nusing System.Threading.Tasks;\nusing System.Windows.Input;\nusing Prism.Commands;\nusing Xunit;\n\nnamespace Prism.Tests.Commands;\n\npublic class AsyncDelegateCommandFixture\n{\n    [Fact]\n    public void WhenConstructedWithDelegate_InitializesValues()\n    {\n        var actual = new AsyncDelegateCommand(() => default);\n\n        Assert.NotNull(actual);\n    }\n\n    [Fact]\n    public async Task CannotExecuteWhileExecuting()\n    {\n        var tcs = new TaskCompletionSource<object>();\n        var command = new AsyncDelegateCommand(async () => await tcs.Task);\n\n        Assert.True(command.CanExecute());\n        var task = command.Execute();\n        Assert.False(command.CanExecute());\n        tcs.SetResult(\"complete\");\n        await task;\n        Assert.True(command.CanExecute());\n    }\n\n    [Fact]\n    public async Task CanExecuteParallelTaskWhenEnabled()\n    {\n        var tcs = new TaskCompletionSource<object>();\n        var command = new AsyncDelegateCommand(async () => await tcs.Task)\n            .EnableParallelExecution();\n\n        Assert.True(command.CanExecute());\n        var task = command.Execute();\n        Assert.True(command.CanExecute());\n        tcs.SetResult(\"complete\");\n        await task;\n        Assert.True(command.CanExecute());\n    }\n\n    [Fact]\n    public async Task CanExecuteChangedFiresWhenExecuting()\n    {\n        var tcs = new TaskCompletionSource<object> ();\n        var command = new AsyncDelegateCommand(async () => await tcs.Task);\n        bool canExecuteChanged = false;\n\n        command.CanExecuteChanged += Command_CanExecuteChanged;\n\n        void Command_CanExecuteChanged(object sender, System.EventArgs e)\n        {\n            canExecuteChanged = true;\n        }\n\n        var task = command.Execute();\n        command.CanExecuteChanged -= Command_CanExecuteChanged;\n\n        Assert.True(command.IsExecuting);\n        Assert.True(canExecuteChanged);\n        tcs.SetResult(null);\n        await task;\n        Assert.False(command.IsExecuting);\n    }\n\n    [Fact]\n    public async Task ExecuteAsync_ShouldExecuteCommandAsynchronously()\n    {\n        // Arrange\n        bool executed = false;\n        var tcs = new TaskCompletionSource<object>();\n        var command = new AsyncDelegateCommand(async (_) =>\n        {\n            await tcs.Task;\n            executed = true;\n        });\n\n        // Act\n        var task = command.Execute();\n        Assert.False(executed);\n        tcs.SetResult(\"complete\");\n        await task;\n\n        // Assert\n        Assert.True(executed);\n    }\n\n    [Fact]\n    public async Task ExecuteAsync_WithCancellationToken_ShouldExecuteCommandAsynchronously()\n    {\n        // Arrange\n        bool executionStarted = false;\n        bool executed = false;\n        bool taskCancelled = false;\n        var command = new AsyncDelegateCommand(Execute)\n            .Catch<TaskCanceledException>(ex =>\n            {\n                taskCancelled = true;\n            });\n\n        async Task Execute(CancellationToken token)\n        {\n            executionStarted = true;\n            await Task.Delay(1000, token);\n            executed = true;\n        }\n\n        // Act\n        using (var cancellationTokenSource = new CancellationTokenSource())\n        {\n            cancellationTokenSource.CancelAfter(50); // Cancel after 50 milliseconds\n            await command.Execute(cancellationTokenSource.Token);\n        }\n\n        // Assert\n        Assert.True(executionStarted);\n        Assert.False(executed);\n        Assert.True(taskCancelled);\n    }\n\n    [Fact]\n    public async Task ICommandExecute_UsesDefaultTokenSourceFactory()\n    {\n        var cts = new CancellationTokenSource();\n        var command = new AsyncDelegateCommand((token) => Task.Delay(1000, token))\n            .CancellationTokenSourceFactory(() => cts.Token);\n        ICommand iCommand = command;\n        iCommand.Execute(null);\n\n        Assert.True(command.IsExecuting);\n        cts.Cancel();\n        await Task.Delay(10);\n\n        Assert.False(command.IsExecuting);\n    }\n\n    [Fact]\n    public void ICommandExecute_HandlesErrorOnce()\n    {\n        var handled = 0;\n        ICommand command = new AsyncDelegateCommand<string>(str => throw new System.Exception(\"Test\"))\n            .Catch(ex => handled++);\n        command.Execute(string.Empty);\n        Assert.Equal(1, handled);\n    }\n}\n"
  },
  {
    "path": "tests/Prism.Core.Tests/Commands/CompositeCommandFixture.cs",
    "content": "using System;\nusing System.Windows.Input;\nusing Prism.Commands;\nusing Xunit;\n\nnamespace Prism.Tests.Commands\n{\n    public class CompositeCommandFixture\n    {\n        [Fact]\n        public void RegisterACommandShouldRaiseCanExecuteEvent()\n        {\n            TestableCompositeCommand multiCommand = new TestableCompositeCommand();\n            TestCommand testCommand = new TestCommand();\n\n            multiCommand.RegisterCommand(new TestCommand());\n            Assert.True(multiCommand.CanExecuteChangedRaised);\n        }\n\n        [Fact]\n        public void ShouldDelegateExecuteToSingleRegistrant()\n        {\n            TestableCompositeCommand multiCommand = new TestableCompositeCommand();\n            TestCommand testCommand = new TestCommand();\n\n            multiCommand.RegisterCommand(testCommand);\n\n            Assert.False(testCommand.ExecuteCalled);\n            multiCommand.Execute(null);\n            Assert.True(testCommand.ExecuteCalled);\n        }\n\n        [Fact]\n        public void ShouldDelegateExecuteToMultipleRegistrants()\n        {\n            TestableCompositeCommand multiCommand = new TestableCompositeCommand();\n            TestCommand testCommandOne = new TestCommand();\n            TestCommand testCommandTwo = new TestCommand();\n\n            multiCommand.RegisterCommand(testCommandOne);\n            multiCommand.RegisterCommand(testCommandTwo);\n\n            Assert.False(testCommandOne.ExecuteCalled);\n            Assert.False(testCommandTwo.ExecuteCalled);\n            multiCommand.Execute(null);\n            Assert.True(testCommandOne.ExecuteCalled);\n            Assert.True(testCommandTwo.ExecuteCalled);\n        }\n\n        [Fact]\n        public void ShouldDelegateCanExecuteToSingleRegistrant()\n        {\n            TestableCompositeCommand multiCommand = new TestableCompositeCommand();\n            TestCommand testCommand = new TestCommand();\n\n            multiCommand.RegisterCommand(testCommand);\n\n            Assert.False(testCommand.CanExecuteCalled);\n            multiCommand.CanExecute(null);\n            Assert.True(testCommand.CanExecuteCalled);\n        }\n\n        [Fact]\n        public void ShouldDelegateCanExecuteToMultipleRegistrants()\n        {\n            TestableCompositeCommand multiCommand = new TestableCompositeCommand();\n            TestCommand testCommandOne = new TestCommand();\n            TestCommand testCommandTwo = new TestCommand();\n\n            multiCommand.RegisterCommand(testCommandOne);\n            multiCommand.RegisterCommand(testCommandTwo);\n\n            Assert.False(testCommandOne.CanExecuteCalled);\n            Assert.False(testCommandTwo.CanExecuteCalled);\n            multiCommand.CanExecute(null);\n            Assert.True(testCommandOne.CanExecuteCalled);\n            Assert.True(testCommandTwo.CanExecuteCalled);\n        }\n\n        [Fact]\n        public void CanExecuteShouldReturnTrueIfAllRegistrantsTrue()\n        {\n            TestableCompositeCommand multiCommand = new TestableCompositeCommand();\n            TestCommand testCommandOne = new TestCommand() { CanExecuteValue = true };\n            TestCommand testCommandTwo = new TestCommand() { CanExecuteValue = true };\n\n            multiCommand.RegisterCommand(testCommandOne);\n            multiCommand.RegisterCommand(testCommandTwo);\n\n            Assert.True(multiCommand.CanExecute(null));\n        }\n\n        [Fact]\n        public void CanExecuteShouldReturnFalseIfASingleRegistrantsFalse()\n        {\n            TestableCompositeCommand multiCommand = new TestableCompositeCommand();\n            TestCommand testCommandOne = new TestCommand() { CanExecuteValue = true };\n            TestCommand testCommandTwo = new TestCommand() { CanExecuteValue = false };\n\n            multiCommand.RegisterCommand(testCommandOne);\n            multiCommand.RegisterCommand(testCommandTwo);\n\n            Assert.False(multiCommand.CanExecute(null));\n        }\n\n        [Fact]\n        public void ShouldReraiseCanExecuteChangedEvent()\n        {\n            TestableCompositeCommand multiCommand = new TestableCompositeCommand();\n            TestCommand testCommandOne = new TestCommand() { CanExecuteValue = true };\n\n            Assert.False(multiCommand.CanExecuteChangedRaised);\n            multiCommand.RegisterCommand(testCommandOne);\n            multiCommand.CanExecuteChangedRaised = false;\n\n            testCommandOne.FireCanExecuteChanged();\n            Assert.True(multiCommand.CanExecuteChangedRaised);\n        }\n\n        [Fact]\n        public void ShouldReraiseCanExecuteChangedEventAfterCollect()\n        {\n            TestableCompositeCommand multiCommand = new TestableCompositeCommand();\n            TestCommand testCommandOne = new TestCommand() { CanExecuteValue = true };\n\n            Assert.False(multiCommand.CanExecuteChangedRaised);\n            multiCommand.RegisterCommand(testCommandOne);\n            multiCommand.CanExecuteChangedRaised = false;\n\n            GC.Collect();\n\n            testCommandOne.FireCanExecuteChanged();\n            Assert.True(multiCommand.CanExecuteChangedRaised);\n        }\n\n        [Fact]\n        public void ShouldReraiseDelegateCommandCanExecuteChangedEventAfterCollect()\n        {\n            TestableCompositeCommand multiCommand = new TestableCompositeCommand();\n            DelegateCommand<object> delegateCommand = new DelegateCommand<object>(delegate { });\n\n            Assert.False(multiCommand.CanExecuteChangedRaised);\n            multiCommand.RegisterCommand(delegateCommand);\n            multiCommand.CanExecuteChangedRaised = false;\n\n            GC.Collect();\n\n            delegateCommand.RaiseCanExecuteChanged();\n\n            Assert.True(multiCommand.CanExecuteChangedRaised);\n        }\n\n        [Fact]\n        public void UnregisteringCommandWithNullThrows()\n        {\n            Assert.Throws<ArgumentNullException>(() =>\n            {\n                var compositeCommand = new CompositeCommand();\n                compositeCommand.UnregisterCommand(null);\n            });\n        }\n\n        [Fact]\n        public void UnregisterCommandRemovesFromExecuteDelegation()\n        {\n            TestableCompositeCommand multiCommand = new TestableCompositeCommand();\n            TestCommand testCommandOne = new TestCommand() { CanExecuteValue = true };\n\n            multiCommand.RegisterCommand(testCommandOne);\n            multiCommand.UnregisterCommand(testCommandOne);\n\n            Assert.False(testCommandOne.ExecuteCalled);\n            multiCommand.Execute(null);\n            Assert.False(testCommandOne.ExecuteCalled);\n        }\n\n        [Fact]\n        public void UnregisterCommandShouldRaiseCanExecuteEvent()\n        {\n            TestableCompositeCommand multiCommand = new TestableCompositeCommand();\n            TestCommand testCommandOne = new TestCommand();\n\n            multiCommand.RegisterCommand(testCommandOne);\n            multiCommand.CanExecuteChangedRaised = false;\n            multiCommand.UnregisterCommand(testCommandOne);\n\n            Assert.True(multiCommand.CanExecuteChangedRaised);\n        }\n\n        [Fact]\n        public void ExecuteDoesNotThrowWhenAnExecuteCommandModifiesTheCommandsCollection()\n        {\n            TestableCompositeCommand multiCommand = new TestableCompositeCommand();\n            SelfUnregisterableCommand commandOne = new SelfUnregisterableCommand(multiCommand);\n            SelfUnregisterableCommand commandTwo = new SelfUnregisterableCommand(multiCommand);\n\n            multiCommand.RegisterCommand(commandOne);\n            multiCommand.RegisterCommand(commandTwo);\n\n            multiCommand.Execute(null);\n\n            Assert.True(commandOne.ExecutedCalled);\n            Assert.True(commandTwo.ExecutedCalled);\n        }\n\n        [Fact]\n        public void UnregisterCommandDisconnectsCanExecuteChangedDelegate()\n        {\n            TestableCompositeCommand multiCommand = new TestableCompositeCommand();\n            TestCommand testCommandOne = new TestCommand() { CanExecuteValue = true };\n\n            multiCommand.RegisterCommand(testCommandOne);\n            multiCommand.UnregisterCommand(testCommandOne);\n            multiCommand.CanExecuteChangedRaised = false;\n            testCommandOne.FireCanExecuteChanged();\n            Assert.False(multiCommand.CanExecuteChangedRaised);\n        }\n\n        [Fact]\n        public void UnregisterCommandDisconnectsIsActiveChangedDelegate()\n        {\n            CompositeCommand activeAwareCommand = new CompositeCommand(true);\n            MockActiveAwareCommand commandOne = new MockActiveAwareCommand() { IsActive = true, IsValid = true };\n            MockActiveAwareCommand commandTwo = new MockActiveAwareCommand() { IsActive = false, IsValid = false };\n            activeAwareCommand.RegisterCommand(commandOne);\n            activeAwareCommand.RegisterCommand(commandTwo);\n\n            Assert.True(activeAwareCommand.CanExecute(null));\n\n            activeAwareCommand.UnregisterCommand(commandOne);\n\n            Assert.False(activeAwareCommand.CanExecute(null));\n        }\n\n        [Fact]\n        public void ShouldBubbleException()\n        {\n            Assert.Throws<DivideByZeroException>(() =>\n            {\n                TestableCompositeCommand multiCommand = new TestableCompositeCommand();\n                BadDivisionCommand testCommand = new BadDivisionCommand();\n\n                multiCommand.RegisterCommand(testCommand);\n                multiCommand.Execute(null);\n            });\n        }\n\n        [Fact]\n        public void CanExecuteShouldReturnFalseWithNoCommandsRegistered()\n        {\n            TestableCompositeCommand multiCommand = new TestableCompositeCommand();\n            Assert.False(multiCommand.CanExecute(null));\n        }\n\n        [Fact]\n        public void MultiDispatchCommandExecutesActiveRegisteredCommands()\n        {\n            CompositeCommand activeAwareCommand = new CompositeCommand();\n            MockActiveAwareCommand command = new MockActiveAwareCommand();\n            command.IsActive = true;\n            activeAwareCommand.RegisterCommand(command);\n\n            activeAwareCommand.Execute(null);\n\n            Assert.True(command.WasExecuted);\n        }\n\n        [Fact]\n        public void MultiDispatchCommandDoesNotExecutesInactiveRegisteredCommands()\n        {\n            CompositeCommand activeAwareCommand = new CompositeCommand(true);\n            MockActiveAwareCommand command = new MockActiveAwareCommand();\n            command.IsActive = false;\n            activeAwareCommand.RegisterCommand(command);\n\n            activeAwareCommand.Execute(null);\n\n            Assert.False(command.WasExecuted);\n        }\n\n        [Fact]\n        public void DispatchCommandDoesNotIncludeInactiveRegisteredCommandInVoting()\n        {\n            CompositeCommand activeAwareCommand = new CompositeCommand(true);\n            MockActiveAwareCommand command = new MockActiveAwareCommand();\n            activeAwareCommand.RegisterCommand(command);\n            command.IsValid = true;\n            command.IsActive = false;\n\n            Assert.False(activeAwareCommand.CanExecute(null), \"Registered Click is inactive so should not participate in CanExecute vote\");\n\n            command.IsActive = true;\n\n            Assert.True(activeAwareCommand.CanExecute(null));\n\n            command.IsValid = false;\n\n            Assert.False(activeAwareCommand.CanExecute(null));\n\n        }\n\n        [Fact]\n        public void DispatchCommandShouldIgnoreInactiveCommandsInCanExecuteVote()\n        {\n            CompositeCommand activeAwareCommand = new CompositeCommand(true);\n            MockActiveAwareCommand commandOne = new MockActiveAwareCommand() { IsActive = false, IsValid = false };\n            MockActiveAwareCommand commandTwo = new MockActiveAwareCommand() { IsActive = true, IsValid = true };\n\n            activeAwareCommand.RegisterCommand(commandOne);\n            activeAwareCommand.RegisterCommand(commandTwo);\n\n            Assert.True(activeAwareCommand.CanExecute(null));\n        }\n\n        [Fact]\n        public void ActivityCausesActiveAwareCommandToRequeryCanExecute()\n        {\n            CompositeCommand activeAwareCommand = new CompositeCommand(true);\n            MockActiveAwareCommand command = new MockActiveAwareCommand();\n            activeAwareCommand.RegisterCommand(command);\n            command.IsActive = true;\n\n            bool globalCanExecuteChangeFired = false;\n            activeAwareCommand.CanExecuteChanged += delegate\n                                                        {\n                                                            globalCanExecuteChangeFired = true;\n                                                        };\n\n            Assert.False(globalCanExecuteChangeFired);\n            command.IsActive = false;\n            Assert.True(globalCanExecuteChangeFired);\n        }\n\n        [Fact]\n        public void ShouldNotMonitorActivityIfUseActiveMonitoringFalse()\n        {\n            var mockCommand = new MockActiveAwareCommand();\n            mockCommand.IsValid = true;\n            mockCommand.IsActive = true;\n            var nonActiveAwareCompositeCommand = new CompositeCommand(false);\n            bool canExecuteChangedRaised = false;\n            nonActiveAwareCompositeCommand.RegisterCommand(mockCommand);\n            nonActiveAwareCompositeCommand.CanExecuteChanged += delegate\n            {\n                canExecuteChangedRaised = true;\n            };\n\n            mockCommand.IsActive = false;\n\n            Assert.False(canExecuteChangedRaised);\n\n            nonActiveAwareCompositeCommand.Execute(null);\n\n            Assert.True(mockCommand.WasExecuted);\n        }\n\n        [Fact]\n        public void ShouldRemoveCanExecuteChangedHandler()\n        {\n            bool canExecuteChangedRaised = false;\n\n            var compositeCommand = new CompositeCommand();\n            var commmand = new DelegateCommand(() => { });\n            compositeCommand.RegisterCommand(commmand);\n\n            EventHandler handler = (s, e) => canExecuteChangedRaised = true;\n\n            compositeCommand.CanExecuteChanged += handler;\n            commmand.RaiseCanExecuteChanged();\n\n            Assert.True(canExecuteChangedRaised);\n\n            canExecuteChangedRaised = false;\n            compositeCommand.CanExecuteChanged -= handler;\n            commmand.RaiseCanExecuteChanged();\n\n            Assert.False(canExecuteChangedRaised);\n        }\n\n        [Fact]\n        public void ShouldIgnoreChangesToIsActiveDuringExecution()\n        {\n            var firstCommand = new MockActiveAwareCommand { IsActive = true };\n            var secondCommand = new MockActiveAwareCommand { IsActive = true };\n\n            // During execution set the second command to inactive, this should not affect the currently\n            // executed selection.  \n            firstCommand.ExecuteAction += new Action<object>((object parameter) => secondCommand.IsActive = false);\n\n            var compositeCommand = new CompositeCommand(true);\n\n            compositeCommand.RegisterCommand(firstCommand);\n            compositeCommand.RegisterCommand(secondCommand);\n\n            compositeCommand.Execute(null);\n\n            Assert.True(secondCommand.WasExecuted);\n        }\n\n        [Fact]\n        public void RegisteringCommandInItselfThrows()\n        {\n            Assert.Throws<ArgumentException>(() =>\n            {\n                var compositeCommand = new CompositeCommand();\n                compositeCommand.RegisterCommand(compositeCommand);\n            });\n        }\n\n        [Fact]\n        public void RegisteringCommandWithNullThrows()\n        {\n            Assert.Throws<ArgumentNullException>(() =>\n            {\n                var compositeCommand = new CompositeCommand();\n                compositeCommand.RegisterCommand(null);\n            });\n        }\n\n        [Fact]\n        public void RegisteringCommandTwiceThrows()\n        {\n            Assert.Throws<InvalidOperationException>(() =>\n            {\n                var compositeCommand = new CompositeCommand();\n                var duplicateCommand = new TestCommand();\n                compositeCommand.RegisterCommand(duplicateCommand);\n\n                compositeCommand.RegisterCommand(duplicateCommand);\n            });\n\n        }\n\n        [Fact]\n        public void ShouldGetRegisteredCommands()\n        {\n            var firstCommand = new TestCommand();\n            var secondCommand = new TestCommand();\n\n            var compositeCommand = new CompositeCommand();\n            compositeCommand.RegisterCommand(firstCommand);\n            compositeCommand.RegisterCommand(secondCommand);\n\n            var commands = compositeCommand.RegisteredCommands;\n\n            Assert.True(commands.Count > 0);\n        }\n    }\n\n    internal class MockActiveAwareCommand : IActiveAware, ICommand\n    {\n        private bool _isActive;\n\n        public Action<object> ExecuteAction;\n\n\n        #region IActiveAware Members\n\n        public bool IsActive\n        {\n            get { return _isActive; }\n            set\n            {\n                if (_isActive != value)\n                {\n                    _isActive = value;\n                    OnActiveChanged(this, EventArgs.Empty);\n                }\n            }\n        }\n\n        public event EventHandler IsActiveChanged = delegate { };\n        #endregion\n\n        virtual protected void OnActiveChanged(object sender, EventArgs e)\n        {\n            IsActiveChanged(sender, e);\n        }\n\n        public bool WasExecuted { get; set; }\n        public bool IsValid { get; set; }\n\n\n        #region ICommand Members\n\n        public bool CanExecute(object parameter)\n        {\n            return IsValid;\n        }\n\n        public event EventHandler CanExecuteChanged = delegate { };\n\n        public void Execute(object parameter)\n        {\n            WasExecuted = true;\n            if (ExecuteAction != null)\n                ExecuteAction(parameter);\n        }\n\n        #endregion\n    }\n\n    internal class TestableCompositeCommand : CompositeCommand\n    {\n        public bool CanExecuteChangedRaised;\n        private EventHandler handler;\n\n        public TestableCompositeCommand()\n        {\n            this.handler = ((sender, e) => CanExecuteChangedRaised = true);\n            CanExecuteChanged += this.handler;\n        }\n    }\n\n    internal class TestCommand : ICommand\n    {\n        public bool CanExecuteCalled { get; set; }\n        public bool ExecuteCalled { get; set; }\n        public int ExecuteCallCount { get; set; }\n\n        public bool CanExecuteValue = true;\n\n        public void FireCanExecuteChanged()\n        {\n            CanExecuteChanged(this, EventArgs.Empty);\n        }\n        #region ICommand Members\n\n        public bool CanExecute(object parameter)\n        {\n            CanExecuteCalled = true;\n            return CanExecuteValue;\n        }\n\n        public event EventHandler CanExecuteChanged = delegate { };\n\n        public void Execute(object parameter)\n        {\n            ExecuteCalled = true;\n            ExecuteCallCount += 1;\n        }\n\n        #endregion\n    }\n\n    internal class BadDivisionCommand : ICommand\n    {\n        #region ICommand Members\n\n        public bool CanExecute(object parameter)\n        {\n            return true;\n        }\n\n        public event EventHandler CanExecuteChanged = delegate { };\n\n        public void Execute(object parameter)\n        {\n            throw new DivideByZeroException(\"Test Divide By Zero\");\n        }\n\n        #endregion\n    }\n\n    internal class SelfUnregisterableCommand : ICommand\n    {\n        public CompositeCommand Command;\n        public bool ExecutedCalled = false;\n\n        public SelfUnregisterableCommand(CompositeCommand command)\n        {\n            Command = command;\n        }\n\n        #region ICommand Members\n\n        public bool CanExecute(object parameter)\n        {\n            throw new NotImplementedException();\n        }\n\n        public event EventHandler CanExecuteChanged;\n\n        public void Execute(object parameter)\n        {\n            CanExecuteChanged(this, EventArgs.Empty);\n            Command.UnregisterCommand(this);\n            ExecutedCalled = true;\n        }\n\n        #endregion\n    }\n}\n"
  },
  {
    "path": "tests/Prism.Core.Tests/Commands/DelegateCommandFixture.cs",
    "content": "using System;\nusing System.IO;\nusing System.Windows.Input;\nusing Prism.Commands;\nusing Prism.Mvvm;\nusing Xunit;\n\nnamespace Prism.Tests.Commands\n{\n    /// <summary>\n    /// Summary description for DelegateCommandFixture\n    /// </summary>\n    public class DelegateCommandFixture : BindableBase\n    {\n        [Fact]\n        public void WhenConstructedWithGenericTypeOfObject_InitializesValues()\n        {\n            // Prepare\n\n            // Act\n            var actual = new DelegateCommand<object>(param => { });\n\n            // verify\n            Assert.NotNull(actual);\n        }\n\n        [Fact]\n        public void WhenConstructedWithGenericTypeOfNullable_InitializesValues()\n        {\n            // Prepare\n\n            // Act\n            var actual = new DelegateCommand<int?>(param => { });\n\n            // verify\n            Assert.NotNull(actual);\n        }\n\n        [Fact]\n        public void WhenConstructedWithGenericTypeIsNonNullableValueType_Throws()\n        {\n            Assert.Throws<InvalidCastException>(() =>\n            {\n                var actual = new DelegateCommand<int>(param => { });\n            });\n        }\n\n        [Fact]\n        public void ExecuteCallsPassedInExecuteDelegate()\n        {\n            var handlers = new DelegateHandlers();\n            var command = new DelegateCommand<object>(handlers.Execute);\n            object parameter = new object();\n\n            command.Execute(parameter);\n\n            Assert.Same(parameter, handlers.ExecuteParameter);\n        }\n\n        [Fact]\n        public void CanExecuteCallsPassedInCanExecuteDelegate()\n        {\n            var handlers = new DelegateHandlers();\n            var command = new DelegateCommand<object>(handlers.Execute, handlers.CanExecute);\n            object parameter = new object();\n\n            handlers.CanExecuteReturnValue = true;\n            bool retVal = command.CanExecute(parameter);\n\n            Assert.Same(parameter, handlers.CanExecuteParameter);\n            Assert.Equal(handlers.CanExecuteReturnValue, retVal);\n        }\n\n        [Fact]\n        public void CanExecuteReturnsTrueWithouthCanExecuteDelegate()\n        {\n            var handlers = new DelegateHandlers();\n            var command = new DelegateCommand<object>(handlers.Execute);\n\n            bool retVal = command.CanExecute(null);\n\n            Assert.True(retVal);\n        }\n\n        [Fact]\n        public void RaiseCanExecuteChangedRaisesCanExecuteChanged()\n        {\n            var handlers = new DelegateHandlers();\n            var command = new DelegateCommand<object>(handlers.Execute);\n            bool canExecuteChangedRaised = false;\n            command.CanExecuteChanged += delegate { canExecuteChangedRaised = true; };\n\n            command.RaiseCanExecuteChanged();\n\n            Assert.True(canExecuteChangedRaised);\n        }\n\n        [Fact]\n        public void CanRemoveCanExecuteChangedHandler()\n        {\n            var command = new DelegateCommand<object>((o) => { });\n\n            bool canExecuteChangedRaised = false;\n\n            EventHandler handler = (s, e) => canExecuteChangedRaised = true;\n\n            command.CanExecuteChanged += handler;\n            command.CanExecuteChanged -= handler;\n            command.RaiseCanExecuteChanged();\n\n            Assert.False(canExecuteChangedRaised);\n        }\n\n        [Fact]\n        public void ShouldPassParameterInstanceOnExecute()\n        {\n            bool executeCalled = false;\n            MyClass testClass = new MyClass();\n            ICommand command = new DelegateCommand<MyClass>(delegate (MyClass parameter)\n            {\n                Assert.Same(testClass, parameter);\n                executeCalled = true;\n            });\n\n            command.Execute(testClass);\n            Assert.True(executeCalled);\n        }\n\n        [Fact]\n        public void ShouldPassParameterInstanceOnCanExecute()\n        {\n            bool canExecuteCalled = false;\n            MyClass testClass = new MyClass();\n            ICommand command = new DelegateCommand<MyClass>((p) => { }, delegate (MyClass parameter)\n            {\n                Assert.Same(testClass, parameter);\n                canExecuteCalled = true;\n                return true;\n            });\n\n            command.CanExecute(testClass);\n            Assert.True(canExecuteCalled);\n        }\n\n        [Fact]\n        public void ShouldThrowIfAllDelegatesAreNull()\n        {\n            Assert.Throws<ArgumentNullException>(() =>\n            {\n                var command = new DelegateCommand<object>(null, null);\n            });\n        }\n\n        [Fact]\n        public void ShouldThrowIfExecuteMethodDelegateNull()\n        {\n            Assert.Throws<ArgumentNullException>(() =>\n            {\n                var command = new DelegateCommand<object>(null);\n            });\n        }\n\n        [Fact]\n        public void ShouldThrowIfCanExecuteMethodDelegateNull()\n        {\n            Assert.Throws<ArgumentNullException>(() =>\n            {\n                var command = new DelegateCommand<object>((o) => { }, null);\n            });\n        }\n\n        [Fact]\n        public void DelegateCommandShouldThrowIfAllDelegatesAreNull()\n        {\n            Assert.Throws<ArgumentNullException>(() =>\n            {\n                var command = new DelegateCommand(null, null);\n            });\n        }\n\n        [Fact]\n        public void DelegateCommandShouldThrowIfExecuteMethodDelegateNull()\n        {\n            Assert.Throws<ArgumentNullException>(() =>\n            {\n                var command = new DelegateCommand(null);\n            });\n        }\n\n        [Fact]\n        public void DelegateCommandGenericShouldThrowIfCanExecuteMethodDelegateNull()\n        {\n            Assert.Throws<ArgumentNullException>(() =>\n            {\n                var command = new DelegateCommand<object>((o) => { }, null);\n            });\n        }\n\n        [Fact]\n        public void IsActivePropertyIsFalseByDeafult()\n        {\n            var command = new DelegateCommand<object>(DoNothing);\n            Assert.False(command.IsActive);\n        }\n\n        [Fact]\n        public void IsActivePropertyChangeFiresEvent()\n        {\n            bool fired = false;\n            var command = new DelegateCommand<object>(DoNothing);\n            command.IsActiveChanged += delegate { fired = true; };\n            command.IsActive = true;\n\n            Assert.True(fired);\n        }\n\n        [Fact]\n        public void NonGenericDelegateCommandExecuteShouldInvokeExecuteAction()\n        {\n            bool executed = false;\n            var command = new DelegateCommand(() => { executed = true; });\n            command.Execute();\n\n            Assert.True(executed);\n        }\n\n        [Fact]\n        public void NonGenericDelegateCommandCanExecuteShouldInvokeCanExecuteFunc()\n        {\n            bool invoked = false;\n            var command = new DelegateCommand(() => { }, () => { invoked = true; return true; });\n\n            bool canExecute = command.CanExecute();\n\n            Assert.True(invoked);\n            Assert.True(canExecute);\n        }\n\n        [Fact]\n        public void NonGenericDelegateCommandShouldDefaultCanExecuteToTrue()\n        {\n            var command = new DelegateCommand(() => { });\n            Assert.True(command.CanExecute());\n        }\n\n        [Fact]\n        public void NonGenericDelegateThrowsIfDelegatesAreNull()\n        {\n            Assert.Throws<ArgumentNullException>(() =>\n            {\n                var command = new DelegateCommand(null, null);\n            });\n        }\n\n        [Fact]\n        public void NonGenericDelegateCommandThrowsIfExecuteDelegateIsNull()\n        {\n            Assert.Throws<ArgumentNullException>(() =>\n            {\n                var command = new DelegateCommand(null);\n            });\n        }\n\n        [Fact]\n        public void NonGenericDelegateCommandThrowsIfCanExecuteDelegateIsNull()\n        {\n            Assert.Throws<ArgumentNullException>(() =>\n            {\n                var command = new DelegateCommand(() => { }, null);\n            });\n        }\n\n        [Fact]\n        public void NonGenericDelegateCommandShouldObserveCanExecute()\n        {\n            bool canExecuteChangedRaised = false;\n\n            ICommand command = new DelegateCommand(() => { }).ObservesCanExecute(() => BoolProperty);\n\n            command.CanExecuteChanged += delegate { canExecuteChangedRaised = true; };\n\n            Assert.False(canExecuteChangedRaised);\n            Assert.False(command.CanExecute(null));\n\n            BoolProperty = true;\n\n            Assert.True(canExecuteChangedRaised);\n            Assert.True(command.CanExecute(null));\n        }\n\n        [Fact]\n        public void NonGenericDelegateCommandShouldObserveCanExecuteAndObserveOtherProperties()\n        {\n            bool canExecuteChangedRaised = false;\n\n            ICommand command = new DelegateCommand(() => { }).ObservesCanExecute(() => BoolProperty).ObservesProperty(() => IntProperty);\n\n            command.CanExecuteChanged += delegate { canExecuteChangedRaised = true; };\n\n            Assert.False(canExecuteChangedRaised);\n            Assert.False(command.CanExecute(null));\n\n            IntProperty = 10;\n\n            Assert.True(canExecuteChangedRaised);\n            Assert.False(command.CanExecute(null));\n\n            canExecuteChangedRaised = false;\n            Assert.False(canExecuteChangedRaised);\n\n            BoolProperty = true;\n\n            Assert.True(canExecuteChangedRaised);\n            Assert.True(command.CanExecute(null));\n        }\n\n        [Fact]\n        public void NonGenericDelegateCommandShouldNotObserveDuplicateCanExecute()\n        {\n            Assert.Throws<ArgumentException>(() =>\n            {\n                ICommand command = new DelegateCommand(() => { }).ObservesCanExecute(() => BoolProperty).ObservesCanExecute(() => BoolProperty);\n            });\n        }\n\n        [Fact]\n        public void NonGenericDelegateCommandShouldObserveOneProperty()\n        {\n            bool canExecuteChangedRaised = false;\n\n            var command = new DelegateCommand(() => { }).ObservesProperty(() => IntProperty);\n\n            command.CanExecuteChanged += delegate { canExecuteChangedRaised = true; };\n\n            IntProperty = 10;\n\n            Assert.True(canExecuteChangedRaised);\n        }\n\n        [Fact]\n        public void NonGenericDelegateCommandShouldObserveMultipleProperties()\n        {\n            bool canExecuteChangedRaised = false;\n\n            var command = new DelegateCommand(() => { }).ObservesProperty(() => IntProperty).ObservesProperty(() => BoolProperty);\n\n            command.CanExecuteChanged += delegate { canExecuteChangedRaised = true; };\n\n            IntProperty = 10;\n\n            Assert.True(canExecuteChangedRaised);\n\n            canExecuteChangedRaised = false;\n\n            BoolProperty = true;\n\n            Assert.True(canExecuteChangedRaised);\n        }\n\n        [Fact]\n        public void NonGenericDelegateCommandShouldNotObserveDuplicateProperties()\n        {\n            Assert.Throws<ArgumentException>(() =>\n            {\n                DelegateCommand command = new DelegateCommand(() => { }).ObservesProperty(() => IntProperty).ObservesProperty(() => IntProperty);\n            });\n        }\n\n        [Fact]\n        public void NonGenericDelegateCommandObservingPropertyShouldRaiseOnNullPropertyName()\n        {\n            bool canExecuteChangedRaised = false;\n\n            var command = new DelegateCommand(() => { }).ObservesProperty(() => IntProperty);\n\n            command.CanExecuteChanged += delegate { canExecuteChangedRaised = true; };\n\n            RaisePropertyChanged(null);\n\n            Assert.True(canExecuteChangedRaised);\n        }\n\n        [Fact]\n        public void NonGenericDelegateCommandObservingPropertyShouldRaiseOnEmptyPropertyName()\n        {\n            bool canExecuteChangedRaised = false;\n\n            var command = new DelegateCommand(() => { }).ObservesProperty(() => IntProperty);\n\n            command.CanExecuteChanged += delegate { canExecuteChangedRaised = true; };\n\n            RaisePropertyChanged(string.Empty);\n\n            Assert.True(canExecuteChangedRaised);\n        }\n\n        [Fact]\n        public void NonGenericDelegateCommandShouldObserveOneComplexProperty()\n        {\n            ComplexProperty = new ComplexType()\n            {\n                InnerComplexProperty = new ComplexType()\n            };\n\n            bool canExecuteChangedRaised = false;\n\n            var command = new DelegateCommand(() => { })\n                .ObservesProperty(() => ComplexProperty.InnerComplexProperty.IntProperty);\n\n            command.CanExecuteChanged += delegate { canExecuteChangedRaised = true; };\n\n            ComplexProperty.InnerComplexProperty.IntProperty = 10;\n\n            Assert.True(canExecuteChangedRaised);\n        }\n\n        [Fact]\n        public void NonGenericDelegateCommandNotObservingPropertiesShouldNotRaiseOnEmptyPropertyName()\n        {\n            bool canExecuteChangedRaised = false;\n\n            var command = new DelegateCommand(() => { });\n\n            command.CanExecuteChanged += delegate { canExecuteChangedRaised = true; };\n\n            RaisePropertyChanged(null);\n\n            Assert.False(canExecuteChangedRaised);\n        }\n\n        [Fact]\n        public void NonGenericDelegateCommandShouldObserveComplexPropertyWhenRootPropertyIsNull()\n        {\n            bool canExecuteChangedRaise = false;\n\n            ComplexProperty = null;\n\n            var command = new DelegateCommand(() => { })\n                .ObservesProperty(() => ComplexProperty.InnerComplexProperty.IntProperty);\n\n            command.CanExecuteChanged += delegate\n            {\n                canExecuteChangedRaise = true;\n            };\n\n            var newComplexObject = new ComplexType()\n            {\n                InnerComplexProperty = new ComplexType()\n                {\n                    IntProperty = 10\n                }\n            };\n\n            ComplexProperty = newComplexObject;\n\n            Assert.True(canExecuteChangedRaise);\n        }\n\n        [Fact]\n        public void NonGenericDelegateCommandShouldObserveComplexPropertyWhenParentPropertyIsNull()\n        {\n            bool canExecuteChangedRaise = false;\n\n            ComplexProperty = new ComplexType();\n\n            var command = new DelegateCommand(() => { })\n                .ObservesProperty(() => ComplexProperty.InnerComplexProperty.IntProperty);\n\n            command.CanExecuteChanged += delegate\n            {\n                canExecuteChangedRaise = true;\n            };\n\n            var newComplexObject = new ComplexType()\n            {\n                InnerComplexProperty = new ComplexType()\n                {\n                    IntProperty = 10\n                }\n            };\n\n            ComplexProperty.InnerComplexProperty = newComplexObject;\n\n            Assert.True(canExecuteChangedRaise);\n        }\n\n        [Fact]\n        public void NonGenericDelegateCommandPropertyObserverUnsubscribeUnusedListeners()\n        {\n            int canExecuteChangedRaiseCount = 0;\n\n            ComplexProperty = new ComplexType()\n            {\n                IntProperty = 1,\n                InnerComplexProperty = new ComplexType()\n                {\n                    IntProperty = 1,\n                    InnerComplexProperty = new ComplexType()\n                    {\n                        IntProperty = 1\n                    }\n                }\n            };\n\n            var command = new DelegateCommand(() => { })\n                .ObservesProperty(() => ComplexProperty.IntProperty)\n                .ObservesProperty(() => ComplexProperty.InnerComplexProperty.InnerComplexProperty.IntProperty)\n                .ObservesProperty(() => ComplexProperty.InnerComplexProperty.IntProperty);\n\n            command.CanExecuteChanged += delegate\n            {\n                canExecuteChangedRaiseCount++;\n            };\n\n            ComplexProperty.IntProperty = 2;\n            ComplexProperty.InnerComplexProperty.InnerComplexProperty.IntProperty = 2;\n            ComplexProperty.InnerComplexProperty.IntProperty = 2;\n\n            Assert.Equal(3, canExecuteChangedRaiseCount);\n\n            var innerInnerComplexProp = ComplexProperty.InnerComplexProperty.InnerComplexProperty;\n            var innerComplexProp = ComplexProperty.InnerComplexProperty;\n            var complexProp = ComplexProperty;\n\n            ComplexProperty = new ComplexType()\n            {\n                InnerComplexProperty = new ComplexType()\n                {\n                    InnerComplexProperty = new ComplexType()\n                }\n            };\n\n            Assert.Equal(0, innerInnerComplexProp.GetPropertyChangedSubscribledLenght());\n            Assert.Equal(0, innerComplexProp.GetPropertyChangedSubscribledLenght());\n            Assert.Equal(0, complexProp.GetPropertyChangedSubscribledLenght());\n\n            innerInnerComplexProp = ComplexProperty.InnerComplexProperty.InnerComplexProperty;\n            innerComplexProp = ComplexProperty.InnerComplexProperty;\n            complexProp = ComplexProperty;\n\n            ComplexProperty = null;\n\n            Assert.Equal(0, innerInnerComplexProp.GetPropertyChangedSubscribledLenght());\n            Assert.Equal(0, innerComplexProp.GetPropertyChangedSubscribledLenght());\n            Assert.Equal(0, complexProp.GetPropertyChangedSubscribledLenght());\n        }\n\n        [Fact]\n        public void GenericDelegateCommandShouldObserveCanExecute()\n        {\n            bool canExecuteChangedRaised = false;\n\n            ICommand command = new DelegateCommand<object>((o) => { }).ObservesCanExecute(() => BoolProperty);\n\n            command.CanExecuteChanged += delegate { canExecuteChangedRaised = true; };\n\n            Assert.False(canExecuteChangedRaised);\n            Assert.False(command.CanExecute(null));\n\n            BoolProperty = true;\n\n            Assert.True(canExecuteChangedRaised);\n            Assert.True(command.CanExecute(null));\n        }\n\n        [Fact]\n        public void GenericDelegateCommandWithNullableParameterShouldObserveCanExecute()\n        {\n            bool canExecuteChangedRaised = false;\n\n            ICommand command = new DelegateCommand<int?>((o) => { }).ObservesCanExecute(() => BoolProperty);\n\n            command.CanExecuteChanged += delegate { canExecuteChangedRaised = true; };\n\n            Assert.False(canExecuteChangedRaised);\n            Assert.False(command.CanExecute(null));\n\n            BoolProperty = true;\n\n            Assert.True(canExecuteChangedRaised);\n            Assert.True(command.CanExecute(null));\n        }\n\n        [Fact]\n        public void GenericDelegateCommandShouldObserveCanExecuteAndObserveOtherProperties()\n        {\n            bool canExecuteChangedRaised = false;\n\n            ICommand command = new DelegateCommand<object>((o) => { }).ObservesCanExecute(() => BoolProperty).ObservesProperty(() => IntProperty);\n\n            command.CanExecuteChanged += delegate { canExecuteChangedRaised = true; };\n\n            Assert.False(canExecuteChangedRaised);\n            Assert.False(command.CanExecute(null));\n\n            IntProperty = 10;\n\n            Assert.True(canExecuteChangedRaised);\n            Assert.False(command.CanExecute(null));\n\n            canExecuteChangedRaised = false;\n            Assert.False(canExecuteChangedRaised);\n\n            BoolProperty = true;\n\n            Assert.True(canExecuteChangedRaised);\n            Assert.True(command.CanExecute(null));\n        }\n\n        [Fact]\n        public void GenericDelegateCommandShouldNotObserveDuplicateCanExecute()\n        {\n            Assert.Throws<ArgumentException>(() =>\n            {\n                ICommand command =\n                    new DelegateCommand<object>((o) => { }).ObservesCanExecute(() => BoolProperty)\n                        .ObservesCanExecute(() => BoolProperty);\n            });\n        }\n\n        [Fact]\n        public void GenericDelegateCommandShouldObserveOneProperty()\n        {\n            bool canExecuteChangedRaised = false;\n\n            var command = new DelegateCommand<object>((o) => { }).ObservesProperty(() => IntProperty);\n\n            command.CanExecuteChanged += delegate { canExecuteChangedRaised = true; };\n\n            IntProperty = 10;\n\n            Assert.True(canExecuteChangedRaised);\n        }\n\n        [Fact]\n        public void GenericDelegateCommandShouldObserveMultipleProperties()\n        {\n            bool canExecuteChangedRaised = false;\n\n            var command = new DelegateCommand<object>((o) => { }).ObservesProperty(() => IntProperty).ObservesProperty(() => BoolProperty);\n\n            command.CanExecuteChanged += delegate { canExecuteChangedRaised = true; };\n\n            IntProperty = 10;\n\n            Assert.True(canExecuteChangedRaised);\n\n            canExecuteChangedRaised = false;\n\n            BoolProperty = true;\n\n            Assert.True(canExecuteChangedRaised);\n        }\n\n        [Fact]\n        public void GenericDelegateCommandShouldNotObserveDuplicateProperties()\n        {\n            Assert.Throws<ArgumentException>(() =>\n            {\n                DelegateCommand<object> command = new DelegateCommand<object>((o) => { }).ObservesProperty(() => IntProperty).ObservesProperty(() => IntProperty);\n            });\n        }\n\n        [Fact]\n        public void GenericDelegateCommandObservingPropertyShouldRaiseOnNullPropertyName()\n        {\n            bool canExecuteChangedRaised = false;\n\n            var command = new DelegateCommand<object>((o) => { }).ObservesProperty(() => IntProperty);\n\n            command.CanExecuteChanged += delegate { canExecuteChangedRaised = true; };\n\n            RaisePropertyChanged(null);\n\n            Assert.True(canExecuteChangedRaised);\n        }\n\n        [Fact]\n        public void GenericDelegateCommandObservingPropertyShouldRaiseOnEmptyPropertyName()\n        {\n            bool canExecuteChangedRaised = false;\n\n            var command = new DelegateCommand<object>((o) => { }).ObservesProperty(() => IntProperty);\n\n            command.CanExecuteChanged += delegate { canExecuteChangedRaised = true; };\n\n            RaisePropertyChanged(string.Empty);\n\n            Assert.True(canExecuteChangedRaised);\n        }\n\n        [Fact]\n        public void GenericDelegateCommandNotObservingPropertiesShouldNotRaiseOnEmptyPropertyName()\n        {\n            bool canExecuteChangedRaised = false;\n\n            var command = new DelegateCommand<object>((o) => { });\n\n            command.CanExecuteChanged += delegate { canExecuteChangedRaised = true; };\n\n            RaisePropertyChanged(null);\n\n            Assert.False(canExecuteChangedRaised);\n        }\n\n        [Fact]\n        public void GenericDelegateCommandShouldObserveComplexPropertyWhenParentPropertyIsNull()\n        {\n            bool canExecuteChangedRaise = false;\n\n            ComplexProperty = new ComplexType();\n\n            var command = new DelegateCommand<object>((o) => { })\n                .ObservesProperty(() => ComplexProperty.InnerComplexProperty.IntProperty);\n\n            command.CanExecuteChanged += delegate\n            {\n                canExecuteChangedRaise = true;\n            };\n\n            var newComplexObject = new ComplexType()\n            {\n                InnerComplexProperty = new ComplexType()\n                {\n                    IntProperty = 10\n                }\n            };\n\n            ComplexProperty.InnerComplexProperty = newComplexObject;\n\n            Assert.True(canExecuteChangedRaise);\n        }\n\n        [Fact]\n        public void GenericDelegateCommandShouldObserveComplexPropertyWhenRootPropertyIsNull()\n        {\n            bool canExecuteChangedRaise = false;\n\n            ComplexProperty = null;\n\n            var command = new DelegateCommand<object>((o) => { })\n                .ObservesProperty(() => ComplexProperty.InnerComplexProperty.IntProperty);\n\n            command.CanExecuteChanged += delegate\n            {\n                canExecuteChangedRaise = true;\n            };\n\n            var newComplexObject = new ComplexType()\n            {\n                InnerComplexProperty = new ComplexType()\n                {\n                    IntProperty = 10\n                }\n            };\n\n            ComplexProperty = newComplexObject;\n\n            Assert.True(canExecuteChangedRaise);\n        }\n\n        [Fact]\n        public void GenericDelegateCommandPropertyObserverUnsubscribeUnusedListeners()\n        {\n            int canExecuteChangedRaiseCount = 0;\n\n            ComplexProperty = new ComplexType()\n            {\n                IntProperty = 1,\n                InnerComplexProperty = new ComplexType()\n                {\n                    IntProperty = 1,\n                    InnerComplexProperty = new ComplexType()\n                    {\n                        IntProperty = 1\n                    }\n                }\n            };\n\n            var command = new DelegateCommand<object>((o) => { })\n                .ObservesProperty(() => ComplexProperty.IntProperty)\n                .ObservesProperty(() => ComplexProperty.InnerComplexProperty.InnerComplexProperty.IntProperty)\n                .ObservesProperty(() => ComplexProperty.InnerComplexProperty.IntProperty);\n\n            command.CanExecuteChanged += delegate\n            {\n                canExecuteChangedRaiseCount++;\n            };\n\n            ComplexProperty.IntProperty = 2;\n            ComplexProperty.InnerComplexProperty.InnerComplexProperty.IntProperty = 2;\n            ComplexProperty.InnerComplexProperty.IntProperty = 2;\n\n            Assert.Equal(3, canExecuteChangedRaiseCount);\n\n            var innerInnerComplexProp = ComplexProperty.InnerComplexProperty.InnerComplexProperty;\n            var innerComplexProp = ComplexProperty.InnerComplexProperty;\n            var complexProp = ComplexProperty;\n\n            ComplexProperty = new ComplexType()\n            {\n                InnerComplexProperty = new ComplexType()\n                {\n                    InnerComplexProperty = new ComplexType()\n                }\n            };\n\n            Assert.Equal(0, innerInnerComplexProp.GetPropertyChangedSubscribledLenght());\n            Assert.Equal(0, innerComplexProp.GetPropertyChangedSubscribledLenght());\n            Assert.Equal(0, complexProp.GetPropertyChangedSubscribledLenght());\n\n            innerInnerComplexProp = ComplexProperty.InnerComplexProperty.InnerComplexProperty;\n            innerComplexProp = ComplexProperty.InnerComplexProperty;\n            complexProp = ComplexProperty;\n\n            ComplexProperty = null;\n\n            Assert.Equal(0, innerInnerComplexProp.GetPropertyChangedSubscribledLenght());\n            Assert.Equal(0, innerComplexProp.GetPropertyChangedSubscribledLenght());\n            Assert.Equal(0, complexProp.GetPropertyChangedSubscribledLenght());\n        }\n\n        [Fact]\n        public void DelegateCommand_Catch_CatchesException()\n        {\n            var caught = false;\n            var command = new DelegateCommand(() => { throw new Exception(); })\n                .Catch<Exception>(ex => caught = true);\n            command.Execute();\n\n            Assert.True(caught);\n        }\n\n        [Fact]\n        public void DelegateCommandT_Catch_CatchesException()\n        {\n            var caught = false;\n            var command = new DelegateCommand<MyClass>(x => { throw new Exception(); })\n                .Catch<Exception>(ex => caught = true);\n            command.Execute(new MyClass());\n\n            Assert.True(caught);\n        }\n\n        [Fact]\n        public void DelegateCommand_Catch_CatchesExceptionWithParameter()\n        {\n            var caught = false;\n            object parameter = new object();\n            var command = new DelegateCommand(() => { throw new Exception(); })\n                .Catch<Exception>((ex, value) =>\n                {\n                    caught = true;\n                    parameter = value;\n                });\n            command.Execute();\n\n            Assert.True(caught);\n            Assert.Null(parameter);\n        }\n\n        [Fact]\n        public void DelegateCommandT_Catch_InvalidCastException()\n        {\n            var caught = false;\n            ICommand command = new DelegateCommand<MyClass>(x => { })\n                .Catch<Exception>(ex =>\n                {\n                    Assert.IsType<InvalidCastException>(ex);\n                    caught = true;\n                });\n\n            command.Execute(\"Test\");\n            Assert.True(caught);\n        }\n\n        [Fact]\n        public void DelegateCommandT_Catch_CatchesExceptionWithParameter()\n        {\n            var caught = false;\n            var parameter = new object();\n            var command = new DelegateCommand<MyClass>(x => { throw new Exception(); })\n                .Catch<Exception>((ex, value) =>\n                {\n                    caught = true;\n                    parameter = value;\n                });\n            command.Execute(new MyClass { Value = 3 });\n\n            Assert.True(caught);\n            Assert.IsType<MyClass>(parameter);\n            Assert.Equal(3, ((MyClass)parameter).Value);\n        }\n\n        [Fact]\n        public void DelegateCommand_Catch_CatchesSpecificException()\n        {\n            var caught = false;\n            var command = new DelegateCommand(() => { throw new FileNotFoundException(); })\n                .Catch<FileNotFoundException>(ex => caught = true);\n            command.Execute();\n\n            Assert.True(caught);\n        }\n\n        [Fact]\n        public void DelegateCommandT_Catch_CatchesSpecificException()\n        {\n            var caught = false;\n            var command = new DelegateCommand<MyClass>(x => { throw new FileNotFoundException(); })\n                .Catch<FileNotFoundException>(ex => caught = true);\n            command.Execute(new MyClass());\n\n            Assert.True(caught);\n        }\n\n        [Fact]\n        public void DelegateCommand_Catch_CatchesChildException()\n        {\n            var caught = false;\n            var command = new DelegateCommand(() => { throw new FileNotFoundException(); })\n                .Catch<IOException>(ex => caught = true);\n            command.Execute();\n\n            Assert.True(caught);\n        }\n\n        [Fact]\n        public void DelegateCommandT_Catch_CatchesChildException()\n        {\n            var caught = false;\n            var command = new DelegateCommand<MyClass>(x => { throw new FileNotFoundException(); })\n                .Catch<IOException>(ex => caught = true);\n            command.Execute(new MyClass());\n\n            Assert.True(caught);\n        }\n\n        [Fact]\n        public void DelegateCommand_Throws_CatchesException()\n        {\n            var caught = false;\n            var command = new DelegateCommand(() => { throw new Exception(); })\n                .Catch<FileNotFoundException>(ex => caught = true);\n            var ex = Record.Exception(() => command.Execute());\n\n            Assert.False(caught);\n            Assert.NotNull(ex);\n            Assert.IsType<Exception>(ex);\n        }\n\n        [Fact]\n        public void DelegateCommandT_Throws_CatchesException()\n        {\n            var caught = false;\n            var command = new DelegateCommand<MyClass>(x => { throw new Exception(); })\n                .Catch<FileNotFoundException>(ex => caught = true);\n            var ex = Record.Exception(() => command.Execute(new MyClass()));\n\n            Assert.False(caught);\n            Assert.NotNull(ex);\n            Assert.IsType<Exception>(ex);\n        }\n\n        public class ComplexType : TestPurposeBindableBase\n        {\n            private int _intProperty;\n            public int IntProperty\n            {\n                get { return _intProperty; }\n                set { SetProperty(ref _intProperty, value); }\n            }\n\n            private ComplexType _innerComplexProperty;\n            public ComplexType InnerComplexProperty\n            {\n                get { return _innerComplexProperty; }\n                set { SetProperty(ref _innerComplexProperty, value); }\n            }\n        }\n\n        private ComplexType _complexProperty;\n        public ComplexType ComplexProperty\n        {\n            get { return _complexProperty; }\n            set { SetProperty(ref _complexProperty, value); }\n        }\n\n        private bool _boolProperty;\n        public bool BoolProperty\n        {\n            get { return _boolProperty; }\n            set { SetProperty(ref _boolProperty, value); }\n        }\n\n        private int _intProperty;\n        public int IntProperty\n        {\n            get { return _intProperty; }\n            set { SetProperty(ref _intProperty, value); }\n        }\n\n        class CanExecutChangeHandler\n        {\n            public bool CanExeucteChangedHandlerCalled;\n            public void CanExecuteChangeHandler(object sender, EventArgs e)\n            {\n                CanExeucteChangedHandlerCalled = true;\n            }\n        }\n\n        internal void DoNothing(object param)\n        { }\n\n\n        class DelegateHandlers\n        {\n            public bool CanExecuteReturnValue = true;\n            public object CanExecuteParameter;\n            public object ExecuteParameter;\n\n            public bool CanExecute(object parameter)\n            {\n                CanExecuteParameter = parameter;\n                return CanExecuteReturnValue;\n            }\n\n            public void Execute(object parameter)\n            {\n                ExecuteParameter = parameter;\n            }\n        }\n    }\n\n    internal class MyClass\n    {\n        public int Value { get; set; }\n    }\n}\n"
  },
  {
    "path": "tests/Prism.Core.Tests/Commands/TestPurposeBindableBase.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Linq;\nusing System.Linq.Expressions;\nusing System.Runtime.CompilerServices;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Prism.Mvvm;\n\nnamespace Prism.Tests.Commands\n{\n    /// <summary>\n    /// Provides minimum functionality BindableBase based class in order to expose \n    /// GetPropertyChangedSubscribledLenght to test if PropertyObserve's \n    /// unsubscribing to PropertyChanged is working properly.\n    /// </summary>\n    public abstract class TestPurposeBindableBase : INotifyPropertyChanged\n    {\n        public event PropertyChangedEventHandler PropertyChanged;\n\n        public int GetPropertyChangedSubscribledLenght()\n        {\n            return PropertyChanged?.GetInvocationList()?.Length ?? 0;\n        }\n\n        protected virtual bool SetProperty<T>(ref T storage, T value, [CallerMemberName] string propertyName = null)\n        {\n            if (Equals(storage, value)) return false;\n\n            storage = value;\n            RaisePropertyChanged(propertyName);\n\n            return true;\n        }\n\n        protected void RaisePropertyChanged([CallerMemberName] string propertyName = null)\n        {\n            OnPropertyChanged(new PropertyChangedEventArgs(propertyName));\n        }\n\n        protected virtual void OnPropertyChanged(PropertyChangedEventArgs args)\n        {\n            PropertyChanged?.Invoke(this, args);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Prism.Core.Tests/Common/ListDictionaryFixture.cs",
    "content": "using Prism.Common;\nusing Xunit;\n\nnamespace Prism.Tests.Common\n{\n\n    public class ListDictionaryFixture\n    {\n        static ListDictionary<string, object> list;\n\n        public ListDictionaryFixture()\n        {\n            list = new ListDictionary<string, object>();\n        }\n\n        [Fact]\n        public void AddThrowsIfKeyNull()\n        {\n            var ex = Assert.Throws<ArgumentNullException>(() =>\n            {\n                list.Add(null, new object());\n            });\n\n        }\n\n        [Fact]\n        public void AddThrowsIfValueNull()\n        {\n            var ex = Assert.Throws<ArgumentNullException>(() =>\n            {\n                list.Add(\"\", null);\n            });\n\n        }\n\n        [Fact]\n        public void CanAddValue()\n        {\n            object value1 = new object();\n            object value2 = new object();\n\n            list.Add(\"foo\", value1);\n            list.Add(\"foo\", value2);\n\n            Assert.Equal(2, list[\"foo\"].Count);\n            Assert.Same(value1, list[\"foo\"][0]);\n            Assert.Same(value2, list[\"foo\"][1]);\n        }\n\n        [Fact]\n        public void CanIndexValuesByKey()\n        {\n            list.Add(\"foo\", new object());\n            list.Add(\"foo\", new object());\n\n            Assert.Equal(2, list[\"foo\"].Count);\n        }\n\n        [Fact]\n        public void ThrowsIfRemoveKeyNull()\n        {\n            var ex = Assert.Throws<ArgumentNullException>(() =>\n            {\n                list.RemoveValue(null, new object());\n            });\n\n        }\n\n        [Fact]\n        public void CanRemoveValue()\n        {\n            object value = new object();\n\n            list.Add(\"foo\", value);\n            list.RemoveValue(\"foo\", value);\n\n            Assert.Empty(list[\"foo\"]);\n        }\n\n        [Fact]\n        public void CanRemoveValueFromAllLists()\n        {\n            object value = new object();\n            list.Add(\"foo\", value);\n            list.Add(\"bar\", value);\n\n            list.RemoveValue(value);\n\n            Assert.Empty(list.Values);\n        }\n\n        [Fact]\n        public void RemoveNonExistingValueNoOp()\n        {\n            list.Add(\"foo\", new object());\n\n            list.RemoveValue(\"foo\", new object());\n        }\n\n        [Fact]\n        public void RemoveNonExistingKeyNoOp()\n        {\n            list.RemoveValue(\"foo\", new object());\n        }\n\n        [Fact]\n        public void ThrowsIfRemoveListKeyNull()\n        {\n            var ex = Assert.Throws<ArgumentNullException>(() =>\n            {\n                list.Remove(null);\n            });\n        }\n\n        [Fact]\n        public void CanRemoveList()\n        {\n            list.Add(\"foo\", new object());\n            list.Add(\"foo\", new object());\n\n            bool removed = list.Remove(\"foo\");\n\n            Assert.True(removed);\n            Assert.Empty(list.Keys);\n        }\n\n        [Fact]\n        public void CanSetList()\n        {\n            List<object> values = [new object()];\n            list.Add(\"foo\", new object());\n            list.Add(\"foo\", new object());\n\n            list[\"foo\"] = values;\n\n            Assert.Single(list[\"foo\"]);\n        }\n\n        [Fact]\n        public void CanEnumerateKeyValueList()\n        {\n            int count = 0;\n            list.Add(\"foo\", new object());\n            list.Add(\"foo\", new object());\n\n            foreach (KeyValuePair<string, IList<object>> pair in list)\n            {\n                foreach (object value in pair.Value)\n                {\n                    count++;\n                }\n                Assert.Equal(\"foo\", pair.Key);\n            }\n\n            Assert.Equal(2, count);\n        }\n\n        [Fact]\n        public void CanGetFlatListOfValues()\n        {\n            list.Add(\"foo\", new object());\n            list.Add(\"foo\", new object());\n            list.Add(\"bar\", new object());\n\n            IList<object> values = list.Values;\n\n            Assert.Equal(3, values.Count);\n        }\n\n        [Fact]\n        public void IndexerAccessAlwaysSucceeds()\n        {\n            IList<object> values = list[\"foo\"];\n\n            Assert.NotNull(values);\n        }\n\n        [Fact]\n        public void ThrowsIfContainsKeyNull()\n        {\n            var ex = Assert.Throws<ArgumentNullException>(() =>\n            {\n                list.ContainsKey(null);\n            });\n        }\n\n        [Fact]\n        public void CanAskContainsKey()\n        {\n            Assert.False(list.ContainsKey(\"foo\"));\n        }\n\n        [Fact]\n        public void CanAskContainsValueInAnyList()\n        {\n            object obj = new object();\n            list.Add(\"foo\", new object());\n            list.Add(\"bar\", new object());\n            list.Add(\"baz\", obj);\n\n            bool contains = list.ContainsValue(obj);\n\n            Assert.True(contains);\n        }\n\n        [Fact]\n        public void CanClearDictionary()\n        {\n            list.Add(\"foo\", new object());\n            list.Add(\"bar\", new object());\n            list.Add(\"baz\", new object());\n\n            list.Clear();\n\n            Assert.Empty(list);\n        }\n\n        [Fact]\n        public void CanGetFilteredValuesByKeys()\n        {\n            list.Add(\"foo\", new object());\n            list.Add(\"bar\", new object());\n            list.Add(\"baz\", new object());\n\n            IEnumerable<object> filtered = list.FindAllValuesByKey(delegate (string key)\n                                                                       {\n                                                                           return key.StartsWith(\"b\");\n                                                                       });\n\n            int count = 0;\n            foreach (object obj in filtered)\n            {\n                count++;\n            }\n\n            Assert.Equal(2, count);\n        }\n\n        [Fact]\n        public void CanGetFilteredValues()\n        {\n            list.Add(\"foo\", DateTime.Now);\n            list.Add(\"bar\", new object());\n            list.Add(\"baz\", DateTime.Today);\n\n            IEnumerable<object> filtered = list.FindAllValues(delegate (object value)\n                                                                  {\n                                                                      return value is DateTime;\n                                                                  });\n            int count = 0;\n            foreach (object obj in filtered)\n            {\n                count++;\n            }\n\n            Assert.Equal(2, count);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Prism.Core.Tests/Common/Mocks/MockEnum.cs",
    "content": "﻿namespace Prism.Tests.Common.Mocks\n{\n    internal enum MockEnum\n    {\n        None = 0,\n        Foo = 1,\n        Bar = 2,\n        Fizz = 3,\n        SomethingElse = 99\n    }\n}\n"
  },
  {
    "path": "tests/Prism.Core.Tests/Common/Mocks/MockParameters.cs",
    "content": "﻿using Prism.Common;\n\nnamespace Prism.Tests.Common.Mocks\n{\n    internal class MockParameters : ParametersBase\n    {\n        public MockParameters() { }\n        public MockParameters(string query) : base(query) { }\n    }\n}\n"
  },
  {
    "path": "tests/Prism.Core.Tests/Common/MulticastExceptionHandlerFixture.cs",
    "content": "﻿using Prism.Common;\nusing Xunit;\n\nnamespace Prism.Tests.Common;\n\n#nullable enable\npublic class MulticastExceptionHandlerFixture\n{\n    [Fact]\n    public void CanHandleGenericException()\n    {\n        var handler = new MulticastExceptionHandler();\n        void Callback(Exception exception) { }\n        handler.Register<Exception>(Callback);\n        Assert.True(handler.CanHandle(new Exception()));\n    }\n\n    [Fact]\n    public void DidHandleGenericException()\n    {\n        var handler = new MulticastExceptionHandler();\n        handler.Register<Exception>(Callback);\n        bool handled = false;\n        void Callback(Exception exception)\n        {\n            handled = true;\n        }\n        handler.Handle(new Exception());\n\n        Assert.True(handled);\n    }\n\n    [Fact]\n    public void CanHandleGenericExceptionAsync()\n    {\n        var handler = new MulticastExceptionHandler();\n        handler.Register<Exception>(Callback);\n        Task Callback(Exception exception)\n        {\n            return Task.CompletedTask;\n        }\n        Assert.True(handler.CanHandle(new Exception()));\n    }\n\n    [Fact]\n    public void CanHandleUsingBaseExceptionType()\n    {\n        var handler = new MulticastExceptionHandler();\n        handler.Register<IOException>(Callback);\n        Task Callback(IOException exception)\n        {\n            return Task.CompletedTask;\n        }\n        Assert.True(handler.CanHandle(new FileNotFoundException()));\n    }\n\n    [Fact]\n    public void DidHandleGenericExceptionAsync()\n    {\n        var handler = new MulticastExceptionHandler();\n        handler.Register<Exception>(Callback);\n        bool handled = false;\n        Task Callback(Exception exception)\n        {\n            handled = true;\n            return Task.CompletedTask;\n        }\n        handler.Handle(new Exception());\n\n        Assert.True(handled);\n    }\n    [Fact]\n    public void CanHandleSpecificException()\n    {\n        var handler = new MulticastExceptionHandler();\n        handler.Register<FileNotFoundException>(Callback);\n        void Callback(FileNotFoundException exception) { }\n        Assert.True(handler.CanHandle(new FileNotFoundException()));\n    }\n\n    [Fact]\n    public async Task DidHandleSpecificException()\n    {\n        var handler = new MulticastExceptionHandler();\n        handler.Register<FileNotFoundException>(Callback);\n        bool handled = false;\n        void Callback(FileNotFoundException exception)\n        {\n            handled = true;\n        }\n        await handler.HandleAsync(new FileNotFoundException());\n\n        Assert.True(handled);\n    }\n\n    [Fact]\n    public async Task DidHandleSpecificExceptionWithParameter()\n    {\n        var handler = new MulticastExceptionHandler();\n        var expected = Guid.NewGuid();\n        bool handled = false;\n        handler.Register<FileNotFoundException>(Callback);\n\n        void Callback(FileNotFoundException fnfe, object? parameter)\n        {\n            Assert.Equal(expected, parameter);\n            handled = true;\n        }\n        await handler.HandleAsync(new FileNotFoundException(), expected);\n\n        Assert.True(handled);\n    }\n\n    [Fact]\n    public void CanHandleSpecificExceptionAsync()\n    {\n        var handler = new MulticastExceptionHandler();\n        handler.Register<FileNotFoundException>(Callback);\n        Task Callback(FileNotFoundException exception)\n        {\n            return Task.CompletedTask;\n        }\n        Assert.True(handler.CanHandle(new FileNotFoundException()));\n    }\n\n    [Fact]\n    public async Task DidHandleSpecificExceptionAsync()\n    {\n        var handler = new MulticastExceptionHandler();\n        handler.Register<FileNotFoundException>(Callback);\n        bool handled = false;\n        Task Callback(FileNotFoundException exception)\n        {\n            handled = true;\n            return Task.CompletedTask;\n        }\n        await handler.HandleAsync(new FileNotFoundException());\n\n        Assert.True(handled);\n    }\n\n    [Fact]\n    public async Task DidHandleSpecificExceptionAsyncWithParameter()\n    {\n        var handler = new MulticastExceptionHandler();\n        bool handled = false;\n        var expected = Guid.NewGuid();\n        handler.Register<FileNotFoundException>(Callback);\n\n        Task Callback(FileNotFoundException fnfe, object?  parameter)\n        {\n            Assert.Equal(expected, parameter);\n            handled = true;\n            return Task.CompletedTask;\n        }\n        await handler.HandleAsync(new FileNotFoundException(), expected);\n\n        Assert.True(handled);\n    }\n\n    [Fact]\n    public async Task DidHandleSpecificExceptionAsyncWithParameterFirst()\n    {\n        var handler = new MulticastExceptionHandler();\n        bool handled = false;\n        var expected = Guid.NewGuid();\n        handler.Register<FileNotFoundException>(Callback);\n\n        Task Callback(object? parameter, FileNotFoundException fnfe)\n        {\n            Assert.Equal(expected, parameter);\n            handled = true;\n            return Task.CompletedTask;\n        }\n        await handler.HandleAsync(new FileNotFoundException(), expected);\n\n        Assert.True(handled);\n    }\n}\n"
  },
  {
    "path": "tests/Prism.Core.Tests/Common/ParametersFixture.cs",
    "content": "﻿#nullable enable\nusing Prism.Tests.Common.Mocks;\nusing Xunit;\n\nnamespace Prism.Tests.Common\n{\n    public class ParametersFixture\n    {\n        [Fact]\n        public void TryGetValueOfT()\n        {\n            var parameters = new MockParameters(\"mock=Foo&mock2=1\");\n            bool success = false;\n            MockEnum value = default;\n            MockEnum value1 = default;\n\n            var ex = Record.Exception(() => success = parameters.TryGetValue<MockEnum>(\"mock\", out value));\n            var ex2 = Record.Exception(() => success = parameters.TryGetValue<MockEnum>(\"mock2\", out value1));\n            Assert.Null(ex);\n            Assert.True(success);\n            Assert.Equal(MockEnum.Foo, value);\n            Assert.Equal(value, value1);\n        }\n\n        [Fact]\n        public void GetValuesOfT()\n        {\n            var parameters = new MockParameters(\"mock=Foo&mock=2&mock=Fizz\");\n\n            IEnumerable<MockEnum> values = [];\n\n            var ex = Record.Exception(() => values = parameters.GetValues<MockEnum>(\"mock\"));\n            Assert.Null(ex);\n            Assert.Equal(3, values.Count());\n            Assert.Equal(MockEnum.Foo, values.ElementAt(0));\n            Assert.Equal(MockEnum.Bar, values.ElementAt(1));\n            Assert.Equal(MockEnum.Fizz, values.ElementAt(2));\n        }\n\n\n        [Fact]\n        public void GetValue()\n        {\n            var parameters = new MockParameters(\"mock=Foo&mock1=2&mock2=Fizz\");\n            MockEnum value = default;\n            MockEnum value1 = default;\n\n            var ex = Record.Exception(() => value = parameters.GetValue<MockEnum>(\"mock\"));\n            var ex2 = Record.Exception(() => value1 = parameters.GetValue<MockEnum>(\"mock1\"));\n            Assert.Null(ex);\n            Assert.Equal(MockEnum.Foo, value);\n            Assert.Equal(MockEnum.Bar, value1);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Prism.Core.Tests/Events/BackgroundEventSubscriptionFixture.cs",
    "content": "using System;\nusing System.Threading;\nusing Prism.Events;\nusing Xunit;\n\nnamespace Prism.Tests.Events\n{\n    public class BackgroundEventSubscriptionFixture\n    {\n        [Fact]\n        public void ShouldReceiveDelegateOnDifferentThread()\n        {\n            ManualResetEvent completeEvent = new ManualResetEvent(false);\n            SynchronizationContext.SetSynchronizationContext(new SynchronizationContext());\n            SynchronizationContext calledSyncContext = null;\n            Action<object> action = delegate\n            {\n                calledSyncContext = SynchronizationContext.Current;\n                completeEvent.Set();\n            };\n\n            IDelegateReference actionDelegateReference = new MockDelegateReference() { Target = action };\n            IDelegateReference filterDelegateReference = new MockDelegateReference() { Target = (Predicate<object>)delegate { return true; } };\n\n            var eventSubscription = new BackgroundEventSubscription<object>(actionDelegateReference, filterDelegateReference);\n\n\n            var publishAction = eventSubscription.GetExecutionStrategy();\n\n            Assert.NotNull(publishAction);\n\n            publishAction.Invoke(null);\n\n            completeEvent.WaitOne(5000);\n\n            Assert.NotEqual(SynchronizationContext.Current, calledSyncContext);\n        }\n\n        [Fact]\n        public void ShouldReceiveDelegateOnDifferentThreadNonGeneric()\n        {\n            var completeEvent = new ManualResetEvent(false);\n            SynchronizationContext.SetSynchronizationContext(new SynchronizationContext());\n            SynchronizationContext calledSyncContext = null;\n            Action action = delegate\n            {\n                calledSyncContext = SynchronizationContext.Current;\n                completeEvent.Set();\n            };\n\n            IDelegateReference actionDelegateReference = new MockDelegateReference() { Target = action };\n\n            var eventSubscription = new BackgroundEventSubscription(actionDelegateReference);\n\n            var publishAction = eventSubscription.GetExecutionStrategy();\n\n            Assert.NotNull(publishAction);\n\n            publishAction.Invoke(null);\n\n            completeEvent.WaitOne(5000);\n\n            Assert.NotEqual(SynchronizationContext.Current, calledSyncContext);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Prism.Core.Tests/Events/DataEventArgsFixture.cs",
    "content": "using System;\nusing Prism.Events;\nusing Xunit;\n\nnamespace Prism.Tests.Events\n{\n    public class DataEventArgsFixture\n    {\n        [Fact]\n        public void CanPassData()\n        {\n            DataEventArgs<int> e = new DataEventArgs<int>(32);\n            Assert.Equal(32, e.Value);\n        }\n\n        [Fact]\n        public void IsEventArgs()\n        {\n            DataEventArgs<string> dea = new DataEventArgs<string>(\"\");\n            EventArgs ea = dea as EventArgs;\n            Assert.NotNull(ea);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Prism.Core.Tests/Events/DelegateReferenceFixture.cs",
    "content": "using System;\nusing System.Threading.Tasks;\nusing Prism.Events;\nusing Xunit;\n\nnamespace Prism.Tests.Events\n{\n    public class DelegateReferenceFixture\n    {\n        [Fact]\n        public void KeepAlivePreventsDelegateFromBeingCollected()\n        {\n            var delegates = new SomeClassHandler();\n            var delegateReference = new DelegateReference((Action<string>)delegates.DoEvent, true);\n\n            delegates = null;\n            GC.Collect();\n\n            Assert.NotNull(delegateReference.Target);\n        }\n\n        [Fact]\n        public async Task NotKeepAliveAllowsDelegateToBeCollected()\n        {\n            var delegates = new SomeClassHandler();\n            var delegateReference = new DelegateReference((Action<string>)delegates.DoEvent, false);\n\n            delegates = null;\n            await Task.Delay(100);\n            GC.Collect();\n\n            Assert.Null(delegateReference.Target);\n        }\n\n        [Fact]\n        public async Task NotKeepAliveKeepsDelegateIfStillAlive()\n        {\n            var delegates = new SomeClassHandler();\n            var delegateReference = new DelegateReference((Action<string>)delegates.DoEvent, false);\n\n            GC.Collect();\n\n            Assert.NotNull(delegateReference.Target);\n\n            GC.KeepAlive(delegates);  //Makes delegates ineligible for garbage collection until this point (to prevent oompiler optimizations that may release the referenced object prematurely).\n            delegates = null;\n            await Task.Delay(100);\n            GC.Collect();\n\n            Assert.Null(delegateReference.Target);\n        }\n\n        [Fact]\n        public void TargetShouldReturnAction()\n        {\n            var classHandler = new SomeClassHandler();\n            Action<string> myAction = new Action<string>(classHandler.MyAction);\n\n            var weakAction = new DelegateReference(myAction, false);\n\n            ((Action<string>)weakAction.Target)(\"payload\");\n            Assert.Equal(\"payload\", classHandler.MyActionArg);\n        }\n\n        [Fact]\n        public async Task ShouldAllowCollectionOfOriginalDelegate()\n        {\n            var classHandler = new SomeClassHandler();\n            Action<string> myAction = new Action<string>(classHandler.MyAction);\n\n            var weakAction = new DelegateReference(myAction, false);\n\n            var originalAction = new WeakReference(myAction);\n            myAction = null;\n            await Task.Delay(100);\n            GC.Collect();\n            Assert.False(originalAction.IsAlive);\n\n            ((Action<string>)weakAction.Target)(\"payload\");\n            Assert.Equal(\"payload\", classHandler.MyActionArg);\n        }\n\n        [Fact]\n        public async Task ShouldReturnNullIfTargetNotAlive()\n        {\n            SomeClassHandler handler = new SomeClassHandler();\n            var weakHandlerRef = new WeakReference(handler);\n\n            var action = new DelegateReference((Action<string>)handler.DoEvent, false);\n\n            handler = null;\n            await Task.Delay(100);\n            GC.Collect();\n            Assert.False(weakHandlerRef.IsAlive);\n\n            Assert.Null(action.Target);\n        }\n\n        [Fact]\n        public void WeakDelegateWorksWithStaticMethodDelegates()\n        {\n            var action = new DelegateReference((Action)SomeClassHandler.StaticMethod, false);\n\n            Assert.NotNull(action.Target);\n        }\n\n        [Fact]\n        public void TargetEqualsActionShouldReturnTrue()\n        {\n            var classHandler = new SomeClassHandler();\n            Action<string> myAction = new Action<string>(classHandler.MyAction);\n\n            var weakAction = new DelegateReference(myAction, false);\n\n            Assert.True(weakAction.TargetEquals(new Action<string>(classHandler.MyAction)));\n        }\n\n        [Fact]\n        public async Task TargetEqualsNullShouldReturnTrueIfTargetNotAlive()\n        {\n            SomeClassHandler handler = new SomeClassHandler();\n            var weakHandlerRef = new WeakReference(handler);\n\n            var action = new DelegateReference((Action<string>)handler.DoEvent, false);\n\n            handler = null;\n\n            // Intentional delay to encourage Garbage Collection to actually occur\n            await Task.Delay(100);\n            GC.Collect();\n            Assert.False(weakHandlerRef.IsAlive);\n\n            Assert.True(action.TargetEquals(null));\n        }\n\n        [Fact]\n        public void TargetEqualsNullShouldReturnFalseIfTargetAlive()\n        {\n            SomeClassHandler handler = new SomeClassHandler();\n            var weakHandlerRef = new WeakReference(handler);\n\n            var action = new DelegateReference((Action<string>)handler.DoEvent, false);\n\n            Assert.False(action.TargetEquals(null));\n            Assert.True(weakHandlerRef.IsAlive);\n            GC.KeepAlive(handler);\n        }\n\n        [Fact]\n        public void TargetEqualsWorksWithStaticMethodDelegates()\n        {\n            var action = new DelegateReference((Action)SomeClassHandler.StaticMethod, false);\n\n            Assert.True(action.TargetEquals((Action)SomeClassHandler.StaticMethod));\n        }\n\n        //todo: fix\n        //[Fact]\n        //public void NullDelegateThrows()\n        //{\n        //    Assert.ThrowsException<ArgumentNullException>(() =>\n        //    {\n        //        var action = new DelegateReference(null, true);\n        //    });\n        //}\n\n        public class SomeClassHandler\n        {\n            public string MyActionArg;\n\n            public void DoEvent(string value)\n            {\n                string myValue = value;\n            }\n\n            public static void StaticMethod()\n            {\n#pragma warning disable 0219\n                int i = 0;\n#pragma warning restore 0219\n            }\n\n            public void MyAction(string arg)\n            {\n                MyActionArg = arg;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Prism.Core.Tests/Events/DispatcherEventSubscriptionFixture.cs",
    "content": "using System;\nusing System.Threading;\nusing Prism.Events;\nusing Xunit;\n\nnamespace Prism.Tests.Events\n{\n    public class DispatcherEventSubscriptionFixture\n    {\n        [Fact]\n        public void ShouldCallInvokeOnDispatcher()\n        {\n            DispatcherEventSubscription<object> eventSubscription = null;\n\n            IDelegateReference actionDelegateReference = new MockDelegateReference()\n            {\n                Target = (Action<object>)(arg =>\n                {\n                    return;\n                })\n            };\n\n            IDelegateReference filterDelegateReference = new MockDelegateReference\n            {\n                Target = (Predicate<object>)(arg => true)\n            };\n            var mockSyncContext = new MockSynchronizationContext();\n\n            eventSubscription = new DispatcherEventSubscription<object>(actionDelegateReference, filterDelegateReference, mockSyncContext);\n\n            eventSubscription.GetExecutionStrategy().Invoke(new object[0]);\n\n            Assert.True(mockSyncContext.InvokeCalled);\n        }\n\n        [Fact]\n        public void ShouldCallInvokeOnDispatcherNonGeneric()\n        {\n            DispatcherEventSubscription eventSubscription = null;\n\n            IDelegateReference actionDelegateReference = new MockDelegateReference()\n            {\n                Target = (Action)(() =>\n                { })\n            };\n\n            var mockSyncContext = new MockSynchronizationContext();\n\n            eventSubscription = new DispatcherEventSubscription(actionDelegateReference, mockSyncContext);\n\n            eventSubscription.GetExecutionStrategy().Invoke(new object[0]);\n\n            Assert.True(mockSyncContext.InvokeCalled);\n        }\n\n        [Fact]\n        public void ShouldPassParametersCorrectly()\n        {\n            IDelegateReference actionDelegateReference = new MockDelegateReference()\n            {\n                Target =\n                    (Action<object>)(arg1 =>\n                    {\n                        return;\n                    })\n            };\n            IDelegateReference filterDelegateReference = new MockDelegateReference\n            {\n                Target = (Predicate<object>)(arg => true)\n            };\n\n            var mockSyncContext = new MockSynchronizationContext();\n\n            DispatcherEventSubscription<object> eventSubscription = new DispatcherEventSubscription<object>(actionDelegateReference, filterDelegateReference, mockSyncContext);\n\n            var executionStrategy = eventSubscription.GetExecutionStrategy();\n            Assert.NotNull(executionStrategy);\n\n            object argument1 = new object();\n\n            executionStrategy.Invoke(new[] { argument1 });\n\n            Assert.Same(argument1, mockSyncContext.InvokeArg);\n        }\n    }\n\n    internal class MockSynchronizationContext : SynchronizationContext\n    {\n        public bool InvokeCalled;\n        public object InvokeArg;\n\n        public override void Post(SendOrPostCallback d, object state)\n        {\n            InvokeCalled = true;\n            InvokeArg = state;\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Prism.Core.Tests/Events/EventAggregatorFixture.cs",
    "content": "using Prism.Events;\nusing Xunit;\n\nnamespace Prism.Tests.Events\n{\n    public class EventAggregatorFixture\n    {\n        [Fact]\n        public void GetReturnsSingleInstancesOfSameEventType()\n        {\n            var eventAggregator = new EventAggregator();\n            var instance1 = eventAggregator.GetEvent<MockEventBase>();\n            var instance2 = eventAggregator.GetEvent<MockEventBase>();\n\n            Assert.Same(instance2, instance1);\n        }\n\n        public class MockEventBase : EventBase { }\n    }\n}\n"
  },
  {
    "path": "tests/Prism.Core.Tests/Events/EventBaseFixture.cs",
    "content": "using System;\nusing Prism.Events;\nusing Xunit;\n\nnamespace Prism.Tests.Events\n{\n    public class EventBaseFixture\n    {\n        [Fact]\n        public void CanPublishSimpleEvents()\n        {\n            var eventBase = new TestableEventBase();\n            var eventSubscription = new MockEventSubscription();\n            bool eventPublished = false;\n            eventSubscription.GetPublishActionReturnValue = delegate\n                                                                {\n                                                                    eventPublished = true;\n                                                                };\n            eventBase.Subscribe(eventSubscription);\n\n            eventBase.Publish();\n\n            Assert.True(eventSubscription.GetPublishActionCalled);\n            Assert.True(eventPublished);\n        }\n\n        [Fact]\n        public void CanHaveMultipleSubscribersAndRaiseCustomEvent()\n        {\n            var customEvent = new TestableEventBase();\n            Payload payload = new Payload();\n            object[] received1 = null;\n            object[] received2 = null;\n            var eventSubscription1 = new MockEventSubscription();\n            eventSubscription1.GetPublishActionReturnValue = delegate (object[] args) { received1 = args; };\n            var eventSubscription2 = new MockEventSubscription();\n            eventSubscription2.GetPublishActionReturnValue = delegate (object[] args) { received2 = args; };\n\n            customEvent.Subscribe(eventSubscription1);\n            customEvent.Subscribe(eventSubscription2);\n\n            customEvent.Publish(payload);\n\n            Assert.Single(received1);\n            Assert.Same(received1[0], payload);\n\n            Assert.Single(received2);\n            Assert.Same(received2[0], payload);\n        }\n\n        [Fact]\n        public void ShouldSubscribeAndUnsubscribe()\n        {\n            var eventBase = new TestableEventBase();\n\n            var eventSubscription = new MockEventSubscription();\n            eventBase.Subscribe(eventSubscription);\n\n            Assert.NotNull(eventSubscription.SubscriptionToken);\n            Assert.True(eventBase.Contains(eventSubscription.SubscriptionToken));\n\n            eventBase.Unsubscribe(eventSubscription.SubscriptionToken);\n\n            Assert.False(eventBase.Contains(eventSubscription.SubscriptionToken));\n        }\n\n        [Fact]\n        public void WhenEventSubscriptionActionIsNullPruneItFromList()\n        {\n            var eventBase = new TestableEventBase();\n\n            var eventSubscription = new MockEventSubscription();\n            eventSubscription.GetPublishActionReturnValue = null;\n\n            var token = eventBase.Subscribe(eventSubscription);\n\n            eventBase.Publish();\n\n            Assert.False(eventBase.Contains(token));\n        }\n\n\n        class TestableEventBase : EventBase\n        {\n            public SubscriptionToken Subscribe(IEventSubscription subscription)\n            {\n                return base.InternalSubscribe(subscription);\n            }\n\n            public void Publish(params object[] arguments)\n            {\n                base.InternalPublish(arguments);\n            }\n        }\n\n        class MockEventSubscription : IEventSubscription\n        {\n            public Action<object[]> GetPublishActionReturnValue;\n            public bool GetPublishActionCalled;\n\n            public Action<object[]> GetExecutionStrategy()\n            {\n                GetPublishActionCalled = true;\n                return GetPublishActionReturnValue;\n            }\n\n            public SubscriptionToken SubscriptionToken { get; set; }\n        }\n\n        class Payload { }\n\n    }\n}\n"
  },
  {
    "path": "tests/Prism.Core.Tests/Events/EventSubscriptionFixture.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing Prism.Events;\nusing Xunit;\n\nnamespace Prism.Tests.Events\n{\n    public class EventSubscriptionFixture\n    {\n        [Fact]\n        public void NullTargetInActionThrows()\n        {\n            Assert.Throws<ArgumentException>(() =>\n            {\n                var actionDelegateReference = new MockDelegateReference()\n                {\n                    Target = null\n                };\n                var filterDelegateReference = new MockDelegateReference()\n                {\n                    Target = (Predicate<object>)(arg =>\n                    {\n                        return true;\n                    })\n                };\n                var eventSubscription = new EventSubscription<object>(actionDelegateReference,\n                                                                                filterDelegateReference);\n            });\n\n        }\n\n        [Fact]\n        public void NullTargetInActionThrowsNonGeneric()\n        {\n            Assert.Throws<ArgumentException>(() =>\n            {\n                var actionDelegateReference = new MockDelegateReference()\n                {\n                    Target = null\n                };\n                var eventSubscription = new EventSubscription(actionDelegateReference);\n            });\n        }\n\n        [Fact]\n        public void DifferentTargetTypeInActionThrows()\n        {\n            Assert.Throws<ArgumentException>(() =>\n            {\n                var actionDelegateReference = new MockDelegateReference()\n                {\n                    Target = (Action<int>)delegate { }\n                };\n                var filterDelegateReference = new MockDelegateReference()\n                {\n                    Target = (Predicate<string>)(arg =>\n                    {\n                        return true;\n                    })\n                };\n                var eventSubscription = new EventSubscription<string>(actionDelegateReference,\n                                                                                filterDelegateReference);\n            });\n        }\n\n        [Fact]\n        public void DifferentTargetTypeInActionThrowsNonGeneric()\n        {\n            Assert.Throws<ArgumentException>(() =>\n            {\n                var actionDelegateReference = new MockDelegateReference()\n                {\n                    Target = (Action<int>)delegate { }\n                };\n\n                var eventSubscription = new EventSubscription(actionDelegateReference);\n            });\n        }\n\n        [Fact]\n        public void NullActionThrows()\n        {\n            Assert.Throws<ArgumentNullException>(() =>\n            {\n                var filterDelegateReference = new MockDelegateReference()\n                {\n                    Target = (Predicate<object>)(arg =>\n                    {\n                        return true;\n                    })\n                };\n                var eventSubscription = new EventSubscription<object>(null, filterDelegateReference);\n            });\n        }\n\n        [Fact]\n        public void NullActionThrowsNonGeneric()\n        {\n            Assert.Throws<ArgumentNullException>(() =>\n            {\n                var eventSubscription = new EventSubscription(null);\n            });\n        }\n\n        [Fact]\n        public void NullTargetInFilterThrows()\n        {\n            Assert.Throws<ArgumentException>(() =>\n            {\n                var actionDelegateReference = new MockDelegateReference()\n                {\n                    Target = (Action<object>)delegate { }\n                };\n\n                var filterDelegateReference = new MockDelegateReference()\n                {\n                    Target = null\n                };\n                var eventSubscription = new EventSubscription<object>(actionDelegateReference,\n                                                                                filterDelegateReference);\n            });\n        }\n\n\n        [Fact]\n        public void DifferentTargetTypeInFilterThrows()\n        {\n            Assert.Throws<ArgumentException>(() =>\n            {\n                var actionDelegateReference = new MockDelegateReference()\n                {\n                    Target = (Action<string>)delegate { }\n                };\n\n                var filterDelegateReference = new MockDelegateReference()\n                {\n                    Target = (Predicate<int>)(arg =>\n                    {\n                        return true;\n                    })\n                };\n\n                var eventSubscription = new EventSubscription<string>(actionDelegateReference,\n                                                                                filterDelegateReference);\n            });\n        }\n\n        [Fact]\n        public void NullFilterThrows()\n        {\n            Assert.Throws<ArgumentNullException>(() =>\n            {\n                var actionDelegateReference = new MockDelegateReference()\n                {\n                    Target = (Action<object>)delegate { }\n                };\n\n                var eventSubscription = new EventSubscription<object>(actionDelegateReference,\n                                                                                null);\n            });\n        }\n\n        [Fact]\n        public void CanInitEventSubscription()\n        {\n            var actionDelegateReference = new MockDelegateReference((Action<object>)delegate { });\n            var filterDelegateReference = new MockDelegateReference((Predicate<object>)delegate { return true; });\n            var eventSubscription = new EventSubscription<object>(actionDelegateReference, filterDelegateReference);\n\n            var subscriptionToken = new SubscriptionToken(t => { });\n\n            eventSubscription.SubscriptionToken = subscriptionToken;\n\n            Assert.Same(actionDelegateReference.Target, eventSubscription.Action);\n            Assert.Same(filterDelegateReference.Target, eventSubscription.Filter);\n            Assert.Same(subscriptionToken, eventSubscription.SubscriptionToken);\n        }\n\n        [Fact]\n        public void CanInitEventSubscriptionNonGeneric()\n        {\n            var actionDelegateReference = new MockDelegateReference((Action)delegate { });\n            var eventSubscription = new EventSubscription(actionDelegateReference);\n\n            var subscriptionToken = new SubscriptionToken(t => { });\n\n            eventSubscription.SubscriptionToken = subscriptionToken;\n\n            Assert.Same(actionDelegateReference.Target, eventSubscription.Action);\n            Assert.Same(subscriptionToken, eventSubscription.SubscriptionToken);\n        }\n\n        [Fact]\n        public void GetPublishActionReturnsDelegateThatExecutesTheFilterAndThenTheAction()\n        {\n            var executedDelegates = new List<string>();\n            var actionDelegateReference =\n                new MockDelegateReference((Action<object>)delegate { executedDelegates.Add(\"Action\"); });\n\n            var filterDelegateReference = new MockDelegateReference((Predicate<object>)delegate\n            {\n                executedDelegates.Add(\n                    \"Filter\");\n                return true;\n            });\n\n            var eventSubscription = new EventSubscription<object>(actionDelegateReference, filterDelegateReference);\n\n\n            var publishAction = eventSubscription.GetExecutionStrategy();\n\n            Assert.NotNull(publishAction);\n\n            publishAction.Invoke(null);\n\n            Assert.Equal(2, executedDelegates.Count);\n            Assert.Equal(\"Filter\", executedDelegates[0]);\n            Assert.Equal(\"Action\", executedDelegates[1]);\n        }\n\n        [Fact]\n        public void GetPublishActionReturnsNullIfActionIsNull()\n        {\n            var actionDelegateReference = new MockDelegateReference((Action<object>)delegate { });\n            var filterDelegateReference = new MockDelegateReference((Predicate<object>)delegate { return true; });\n\n            var eventSubscription = new EventSubscription<object>(actionDelegateReference, filterDelegateReference);\n\n            var publishAction = eventSubscription.GetExecutionStrategy();\n\n            Assert.NotNull(publishAction);\n\n            actionDelegateReference.Target = null;\n\n            publishAction = eventSubscription.GetExecutionStrategy();\n\n            Assert.Null(publishAction);\n        }\n\n        [Fact]\n        public void GetPublishActionReturnsNullIfActionIsNullNonGeneric()\n        {\n            var actionDelegateReference = new MockDelegateReference((Action)delegate { });\n\n            var eventSubscription = new EventSubscription(actionDelegateReference);\n\n            var publishAction = eventSubscription.GetExecutionStrategy();\n\n            Assert.NotNull(publishAction);\n\n            actionDelegateReference.Target = null;\n\n            publishAction = eventSubscription.GetExecutionStrategy();\n\n            Assert.Null(publishAction);\n        }\n\n        [Fact]\n        public void GetPublishActionReturnsNullIfFilterIsNull()\n        {\n            var actionDelegateReference = new MockDelegateReference((Action<object>)delegate { });\n            var filterDelegateReference = new MockDelegateReference((Predicate<object>)delegate { return true; });\n\n            var eventSubscription = new EventSubscription<object>(actionDelegateReference, filterDelegateReference);\n\n            var publishAction = eventSubscription.GetExecutionStrategy();\n\n            Assert.NotNull(publishAction);\n\n            filterDelegateReference.Target = null;\n\n            publishAction = eventSubscription.GetExecutionStrategy();\n\n            Assert.Null(publishAction);\n        }\n\n        [Fact]\n        public void GetPublishActionDoesNotExecuteActionIfFilterReturnsFalse()\n        {\n            bool actionExecuted = false;\n            var actionDelegateReference = new MockDelegateReference()\n            {\n                Target = (Action<int>)delegate { actionExecuted = true; }\n            };\n            var filterDelegateReference = new MockDelegateReference((Predicate<int>)delegate\n            {\n                return false;\n            });\n\n            var eventSubscription = new EventSubscription<int>(actionDelegateReference, filterDelegateReference);\n\n\n            var publishAction = eventSubscription.GetExecutionStrategy();\n\n            publishAction.Invoke(new object[] { null });\n\n            Assert.False(actionExecuted);\n        }\n\n        [Fact]\n        public void StrategyPassesArgumentToDelegates()\n        {\n            string passedArgumentToAction = null;\n            string passedArgumentToFilter = null;\n\n            var actionDelegateReference = new MockDelegateReference((Action<string>)(obj => passedArgumentToAction = obj));\n            var filterDelegateReference = new MockDelegateReference((Predicate<string>)(obj =>\n            {\n                passedArgumentToFilter = obj;\n                return true;\n            }));\n\n            var eventSubscription = new EventSubscription<string>(actionDelegateReference, filterDelegateReference);\n            var publishAction = eventSubscription.GetExecutionStrategy();\n\n            publishAction.Invoke(new[] { \"TestString\" });\n\n            Assert.Equal(\"TestString\", passedArgumentToAction);\n            Assert.Equal(\"TestString\", passedArgumentToFilter);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Prism.Core.Tests/Events/MockDelegateReference.cs",
    "content": "\n\n\nusing System;\nusing Prism.Events;\n\nnamespace Prism.Tests.Events\n{\n    class MockDelegateReference : IDelegateReference\n    {\n        public Delegate Target { get; set; }\n\n        public MockDelegateReference()\n        {\n\n        }\n\n        public MockDelegateReference(Delegate target)\n        {\n            Target = target;\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Prism.Core.Tests/Events/PubSubEventFixture.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Prism.Events;\nusing Xunit;\n\nnamespace Prism.Tests.Events\n{\n    public class PubSubEventFixture\n    {\n        [Fact]\n        public void EnsureSubscriptionListIsEmptyAfterPublishingAMessage()\n        {\n            var pubSubEvent = new TestablePubSubEvent<string>();\n            SubscribeExternalActionWithoutReference(pubSubEvent);\n            GC.Collect();\n            pubSubEvent.Publish(\"testPayload\");\n            Assert.True(pubSubEvent.BaseSubscriptions.Count == 0, \"Subscriptionlist is not empty\");\n        }\n\n        [Fact]\n        public void EnsureSubscriptionListIsNotEmptyWithoutPublishOrSubscribe()\n        {\n            var pubSubEvent = new TestablePubSubEvent<string>();\n            SubscribeExternalActionWithoutReference(pubSubEvent);\n            GC.Collect();\n            Assert.True(pubSubEvent.BaseSubscriptions.Count == 1, \"Subscriptionlist is empty\");\n        }\n\n        [Fact]\n        public void EnsureSubscriptionListIsEmptyAfterSubscribeAgainAMessage()\n        {\n            var pubSubEvent = new TestablePubSubEvent<string>();\n            SubscribeExternalActionWithoutReference(pubSubEvent);\n            GC.Collect();\n            SubscribeExternalActionWithoutReference(pubSubEvent);\n            pubSubEvent.Prune();\n            Assert.True(pubSubEvent.BaseSubscriptions.Count == 1, \"Subscriptionlist is empty\");\n        }\n\n        private static void SubscribeExternalActionWithoutReference(TestablePubSubEvent<string> pubSubEvent)\n        {\n            pubSubEvent.Subscribe(new ExternalAction().ExecuteAction);\n        }\n\n\n        [Fact]\n        public void CanSubscribeAndRaiseEvent()\n        {\n            TestablePubSubEvent<string> pubSubEvent = new TestablePubSubEvent<string>();\n            bool published = false;\n            pubSubEvent.Subscribe(delegate { published = true; }, ThreadOption.PublisherThread, true, delegate { return true; });\n            pubSubEvent.Publish(null);\n\n            Assert.True(published);\n        }\n\n        [Fact]\n        public void CanSubscribeAndRaiseEventNonGeneric()\n        {\n            var pubSubEvent = new TestablePubSubEvent();\n            bool published = false;\n            pubSubEvent.Subscribe(delegate { published = true; }, ThreadOption.PublisherThread, true);\n            pubSubEvent.Publish();\n\n            Assert.True(published);\n        }\n\n        [Fact]\n        public void CanSubscribeAndRaiseCustomEvent()\n        {\n            var customEvent = new TestablePubSubEvent<Payload>();\n            Payload payload = new Payload();\n            var action = new ActionHelper();\n            customEvent.Subscribe(action.Action);\n\n            customEvent.Publish(payload);\n\n            Assert.Same(action.ActionArg<Payload>(), payload);\n        }\n\n        [Fact]\n        public void CanHaveMultipleSubscribersAndRaiseCustomEvent()\n        {\n            var customEvent = new TestablePubSubEvent<Payload>();\n            Payload payload = new Payload();\n            var action1 = new ActionHelper();\n            var action2 = new ActionHelper();\n            customEvent.Subscribe(action1.Action);\n            customEvent.Subscribe(action2.Action);\n\n            customEvent.Publish(payload);\n\n            Assert.Same(action1.ActionArg<Payload>(), payload);\n            Assert.Same(action2.ActionArg<Payload>(), payload);\n        }\n\n        [Fact]\n        public void CanHaveMultipleSubscribersAndRaiseEvent()\n        {\n            var customEvent = new TestablePubSubEvent();\n            var action1 = new ActionHelper();\n            var action2 = new ActionHelper();\n            customEvent.Subscribe(action1.Action);\n            customEvent.Subscribe(action2.Action);\n\n            customEvent.Publish();\n\n            Assert.True(action1.ActionCalled);\n            Assert.True(action2.ActionCalled);\n        }\n\n        [Fact]\n        public void SubscribeTakesExecuteDelegateThreadOptionAndFilter()\n        {\n            TestablePubSubEvent<string> pubSubEvent = new TestablePubSubEvent<string>();\n            var action = new ActionHelper();\n            pubSubEvent.Subscribe(action.Action);\n\n            pubSubEvent.Publish(\"test\");\n\n            Assert.Equal(\"test\", action.ActionArg<string>());\n\n        }\n\n        [Fact]\n        public void FilterEnablesActionTarget()\n        {\n            TestablePubSubEvent<string> pubSubEvent = new TestablePubSubEvent<string>();\n            var goodFilter = new MockFilter { FilterReturnValue = true };\n            var actionGoodFilter = new ActionHelper();\n            var badFilter = new MockFilter { FilterReturnValue = false };\n            var actionBadFilter = new ActionHelper();\n            pubSubEvent.Subscribe(actionGoodFilter.Action, ThreadOption.PublisherThread, true, goodFilter.FilterString);\n            pubSubEvent.Subscribe(actionBadFilter.Action, ThreadOption.PublisherThread, true, badFilter.FilterString);\n\n            pubSubEvent.Publish(\"test\");\n\n            Assert.True(actionGoodFilter.ActionCalled);\n            Assert.False(actionBadFilter.ActionCalled);\n\n        }\n\n        [Fact]\n        public void FilterEnablesActionTarget_Weak()\n        {\n            TestablePubSubEvent<string> pubSubEvent = new TestablePubSubEvent<string>();\n            var goodFilter = new MockFilter { FilterReturnValue = true };\n            var actionGoodFilter = new ActionHelper();\n            var badFilter = new MockFilter { FilterReturnValue = false };\n            var actionBadFilter = new ActionHelper();\n            pubSubEvent.Subscribe(actionGoodFilter.Action, goodFilter.FilterString);\n            pubSubEvent.Subscribe(actionBadFilter.Action, badFilter.FilterString);\n\n            pubSubEvent.Publish(\"test\");\n\n            Assert.True(actionGoodFilter.ActionCalled);\n            Assert.False(actionBadFilter.ActionCalled);\n\n        }\n\n        [Fact]\n        public void SubscribeDefaultsThreadOptionAndNoFilter()\n        {\n            TestablePubSubEvent<string> pubSubEvent = new TestablePubSubEvent<string>();\n            SynchronizationContext.SetSynchronizationContext(new SynchronizationContext());\n            SynchronizationContext calledSyncContext = null;\n            var myAction = new ActionHelper()\n            {\n                ActionToExecute =\n                    () => calledSyncContext = SynchronizationContext.Current\n            };\n            pubSubEvent.Subscribe(myAction.Action);\n\n            pubSubEvent.Publish(\"test\");\n\n            Assert.Equal(SynchronizationContext.Current, calledSyncContext);\n        }\n\n        [Fact]\n        public void SubscribeDefaultsThreadOptionAndNoFilterNonGeneric()\n        {\n            var pubSubEvent = new TestablePubSubEvent();\n            SynchronizationContext.SetSynchronizationContext(new SynchronizationContext());\n            SynchronizationContext calledSyncContext = null;\n            var myAction = new ActionHelper()\n            {\n                ActionToExecute =\n                    () => calledSyncContext = SynchronizationContext.Current\n            };\n            pubSubEvent.Subscribe(myAction.Action);\n\n            pubSubEvent.Publish();\n\n            Assert.Equal(SynchronizationContext.Current, calledSyncContext);\n        }\n\n        [Fact]\n        public void ShouldUnsubscribeFromPublisherThread()\n        {\n            var PubSubEvent = new TestablePubSubEvent<string>();\n\n            var actionEvent = new ActionHelper();\n            PubSubEvent.Subscribe(\n                actionEvent.Action,\n                ThreadOption.PublisherThread);\n\n            Assert.True(PubSubEvent.Contains(actionEvent.Action));\n            PubSubEvent.Unsubscribe(actionEvent.Action);\n            Assert.False(PubSubEvent.Contains(actionEvent.Action));\n        }\n\n        [Fact]\n        public void ShouldUnsubscribeFromPublisherThreadNonGeneric()\n        {\n            var pubSubEvent = new TestablePubSubEvent();\n\n            var actionEvent = new ActionHelper();\n            pubSubEvent.Subscribe(\n                actionEvent.Action,\n                ThreadOption.PublisherThread);\n\n            Assert.True(pubSubEvent.Contains(actionEvent.Action));\n            pubSubEvent.Unsubscribe(actionEvent.Action);\n            Assert.False(pubSubEvent.Contains(actionEvent.Action));\n        }\n\n        [Fact]\n        public void UnsubscribeShouldNotFailWithNonSubscriber()\n        {\n            TestablePubSubEvent<string> pubSubEvent = new TestablePubSubEvent<string>();\n\n            Action<string> subscriber = delegate { };\n            pubSubEvent.Unsubscribe(subscriber);\n        }\n\n        [Fact]\n        public void UnsubscribeShouldNotFailWithNonSubscriberNonGeneric()\n        {\n            var pubSubEvent = new TestablePubSubEvent();\n\n            Action subscriber = delegate { };\n            pubSubEvent.Unsubscribe(subscriber);\n        }\n\n        [Fact]\n        public void ShouldUnsubscribeFromBackgroundThread()\n        {\n            var PubSubEvent = new TestablePubSubEvent<string>();\n\n            var actionEvent = new ActionHelper();\n            PubSubEvent.Subscribe(\n                actionEvent.Action,\n                ThreadOption.BackgroundThread);\n\n            Assert.True(PubSubEvent.Contains(actionEvent.Action));\n            PubSubEvent.Unsubscribe(actionEvent.Action);\n            Assert.False(PubSubEvent.Contains(actionEvent.Action));\n        }\n\n        [Fact]\n        public void ShouldUnsubscribeFromBackgroundThreadNonGeneric()\n        {\n            var pubSubEvent = new TestablePubSubEvent();\n\n            var actionEvent = new ActionHelper();\n            pubSubEvent.Subscribe(\n                actionEvent.Action,\n                ThreadOption.BackgroundThread);\n\n            Assert.True(pubSubEvent.Contains(actionEvent.Action));\n            pubSubEvent.Unsubscribe(actionEvent.Action);\n            Assert.False(pubSubEvent.Contains(actionEvent.Action));\n        }\n\n        [Fact]\n        public void ShouldUnsubscribeFromUIThread()\n        {\n            var PubSubEvent = new TestablePubSubEvent<string>();\n            PubSubEvent.SynchronizationContext = new SynchronizationContext();\n\n            var actionEvent = new ActionHelper();\n            PubSubEvent.Subscribe(\n                actionEvent.Action,\n                ThreadOption.UIThread);\n\n            Assert.True(PubSubEvent.Contains(actionEvent.Action));\n            PubSubEvent.Unsubscribe(actionEvent.Action);\n            Assert.False(PubSubEvent.Contains(actionEvent.Action));\n        }\n\n        [Fact]\n        public void ShouldUnsubscribeFromUIThreadNonGeneric()\n        {\n            var pubSubEvent = new TestablePubSubEvent();\n            pubSubEvent.SynchronizationContext = new SynchronizationContext();\n\n            var actionEvent = new ActionHelper();\n            pubSubEvent.Subscribe(\n                actionEvent.Action,\n                ThreadOption.UIThread);\n\n            Assert.True(pubSubEvent.Contains(actionEvent.Action));\n            pubSubEvent.Unsubscribe(actionEvent.Action);\n            Assert.False(pubSubEvent.Contains(actionEvent.Action));\n        }\n\n        [Fact]\n        public void ShouldUnsubscribeASingleDelegate()\n        {\n            var PubSubEvent = new TestablePubSubEvent<string>();\n\n            int callCount = 0;\n\n            var actionEvent = new ActionHelper() { ActionToExecute = () => callCount++ };\n            PubSubEvent.Subscribe(actionEvent.Action);\n            PubSubEvent.Subscribe(actionEvent.Action);\n\n            PubSubEvent.Publish(null);\n            Assert.Equal<int>(2, callCount);\n\n            callCount = 0;\n            PubSubEvent.Unsubscribe(actionEvent.Action);\n            PubSubEvent.Publish(null);\n            Assert.Equal<int>(1, callCount);\n        }\n\n        [Fact]\n        public void ShouldUnsubscribeASingleDelegateNonGeneric()\n        {\n            var pubSubEvent = new TestablePubSubEvent();\n\n            int callCount = 0;\n\n            var actionEvent = new ActionHelper() { ActionToExecute = () => callCount++ };\n            pubSubEvent.Subscribe(actionEvent.Action);\n            pubSubEvent.Subscribe(actionEvent.Action);\n\n            pubSubEvent.Publish();\n            Assert.Equal<int>(2, callCount);\n\n            callCount = 0;\n            pubSubEvent.Unsubscribe(actionEvent.Action);\n            pubSubEvent.Publish();\n            Assert.Equal<int>(1, callCount);\n        }\n\n        [Fact]\n        public async Task ShouldNotExecuteOnGarbageCollectedDelegateReferenceWhenNotKeepAlive()\n        {\n            var PubSubEvent = new TestablePubSubEvent<string>();\n\n            ExternalAction externalAction = new ExternalAction();\n            PubSubEvent.Subscribe(externalAction.ExecuteAction);\n\n            PubSubEvent.Publish(\"testPayload\");\n            Assert.Equal(\"testPayload\", externalAction.PassedValue);\n\n            WeakReference actionEventReference = new WeakReference(externalAction);\n            externalAction = null;\n            await Task.Delay(100);\n            GC.Collect();\n            Assert.False(actionEventReference.IsAlive);\n\n            PubSubEvent.Publish(\"testPayload\");\n        }\n\n        [Fact]\n        public async Task ShouldNotExecuteOnGarbageCollectedDelegateReferenceWhenNotKeepAliveNonGeneric()\n        {\n            var pubSubEvent = new TestablePubSubEvent();\n\n            var externalAction = new ExternalAction();\n            pubSubEvent.Subscribe(externalAction.ExecuteAction);\n\n            pubSubEvent.Publish();\n            Assert.True(externalAction.Executed);\n\n            var actionEventReference = new WeakReference(externalAction);\n            externalAction = null;\n            await Task.Delay(100);\n            GC.Collect();\n            Assert.False(actionEventReference.IsAlive);\n\n            pubSubEvent.Publish();\n        }\n\n        [Fact]\n        public async Task ShouldNotExecuteOnGarbageCollectedFilterReferenceWhenNotKeepAlive()\n        {\n            var PubSubEvent = new TestablePubSubEvent<string>();\n\n            bool wasCalled = false;\n            var actionEvent = new ActionHelper() { ActionToExecute = () => wasCalled = true };\n\n            ExternalFilter filter = new ExternalFilter();\n            PubSubEvent.Subscribe(actionEvent.Action, ThreadOption.PublisherThread, false, filter.AlwaysTrueFilter);\n\n            PubSubEvent.Publish(\"testPayload\");\n            Assert.True(wasCalled);\n\n            wasCalled = false;\n            WeakReference filterReference = new WeakReference(filter);\n            filter = null;\n            await Task.Delay(100);\n            GC.Collect();\n            Assert.False(filterReference.IsAlive);\n\n            PubSubEvent.Publish(\"testPayload\");\n            Assert.False(wasCalled);\n        }\n\n        [Fact]\n        public void CanAddSubscriptionWhileEventIsFiring()\n        {\n            var PubSubEvent = new TestablePubSubEvent<string>();\n\n            var emptyAction = new ActionHelper();\n            var subscriptionAction = new ActionHelper\n            {\n                ActionToExecute = (() =>\n                                                  PubSubEvent.Subscribe(\n                                                      emptyAction.Action))\n            };\n\n            PubSubEvent.Subscribe(subscriptionAction.Action);\n\n            Assert.False(PubSubEvent.Contains(emptyAction.Action));\n\n            PubSubEvent.Publish(null);\n\n            Assert.True((PubSubEvent.Contains(emptyAction.Action)));\n        }\n\n        [Fact]\n        public void CanAddSubscriptionWhileEventIsFiringNonGeneric()\n        {\n            var pubSubEvent = new TestablePubSubEvent();\n\n            var emptyAction = new ActionHelper();\n            var subscriptionAction = new ActionHelper\n            {\n                ActionToExecute = (() =>\n                                          pubSubEvent.Subscribe(\n                                          emptyAction.Action))\n            };\n\n            pubSubEvent.Subscribe(subscriptionAction.Action);\n\n            Assert.False(pubSubEvent.Contains(emptyAction.Action));\n\n            pubSubEvent.Publish();\n\n            Assert.True((pubSubEvent.Contains(emptyAction.Action)));\n        }\n\n        [Fact]\n        public void InlineDelegateDeclarationsDoesNotGetCollectedIncorrectlyWithWeakReferences()\n        {\n            var PubSubEvent = new TestablePubSubEvent<string>();\n            bool published = false;\n            PubSubEvent.Subscribe(delegate { published = true; }, ThreadOption.PublisherThread, false, delegate { return true; });\n            GC.Collect();\n            PubSubEvent.Publish(null);\n\n            Assert.True(published);\n        }\n\n        [Fact]\n        public void InlineDelegateDeclarationsDoesNotGetCollectedIncorrectlyWithWeakReferencesNonGeneric()\n        {\n            var pubSubEvent = new TestablePubSubEvent();\n            bool published = false;\n            pubSubEvent.Subscribe(delegate { published = true; }, ThreadOption.PublisherThread, false);\n            GC.Collect();\n            pubSubEvent.Publish();\n\n            Assert.True(published);\n        }\n\n        [Fact]\n        public void ShouldNotGarbageCollectDelegateReferenceWhenUsingKeepAlive()\n        {\n            var PubSubEvent = new TestablePubSubEvent<string>();\n\n            var externalAction = new ExternalAction();\n            PubSubEvent.Subscribe(externalAction.ExecuteAction, ThreadOption.PublisherThread, true);\n\n            WeakReference actionEventReference = new WeakReference(externalAction);\n            externalAction = null;\n            GC.Collect();\n            GC.Collect();\n            Assert.True(actionEventReference.IsAlive);\n\n            PubSubEvent.Publish(\"testPayload\");\n\n            Assert.Equal(\"testPayload\", ((ExternalAction)actionEventReference.Target).PassedValue);\n        }\n\n        [Fact]\n        public void ShouldNotGarbageCollectDelegateReferenceWhenUsingKeepAliveNonGeneric()\n        {\n            var pubSubEvent = new TestablePubSubEvent();\n\n            var externalAction = new ExternalAction();\n            pubSubEvent.Subscribe(externalAction.ExecuteAction, ThreadOption.PublisherThread, true);\n\n            WeakReference actionEventReference = new WeakReference(externalAction);\n            externalAction = null;\n            GC.Collect();\n            GC.Collect();\n            Assert.True(actionEventReference.IsAlive);\n\n            pubSubEvent.Publish();\n\n            Assert.True(((ExternalAction)actionEventReference.Target).Executed);\n        }\n\n        [Fact]\n        public void RegisterReturnsTokenThatCanBeUsedToUnsubscribe()\n        {\n            var PubSubEvent = new TestablePubSubEvent<string>();\n            var emptyAction = new ActionHelper();\n\n            var token = PubSubEvent.Subscribe(emptyAction.Action);\n            PubSubEvent.Unsubscribe(token);\n\n            Assert.False(PubSubEvent.Contains(emptyAction.Action));\n        }\n\n        [Fact]\n        public void RegisterReturnsTokenThatCanBeUsedToUnsubscribeNonGeneric()\n        {\n            var pubSubEvent = new TestablePubSubEvent();\n            var emptyAction = new ActionHelper();\n\n            var token = pubSubEvent.Subscribe(emptyAction.Action);\n            pubSubEvent.Unsubscribe(token);\n\n            Assert.False(pubSubEvent.Contains(emptyAction.Action));\n        }\n\n        [Fact]\n        public void ContainsShouldSearchByToken()\n        {\n            var PubSubEvent = new TestablePubSubEvent<string>();\n            var emptyAction = new ActionHelper();\n            var token = PubSubEvent.Subscribe(emptyAction.Action);\n\n            Assert.True(PubSubEvent.Contains(token));\n\n            PubSubEvent.Unsubscribe(emptyAction.Action);\n            Assert.False(PubSubEvent.Contains(token));\n        }\n\n        [Fact]\n        public void ContainsShouldSearchByTokenNonGeneric()\n        {\n            var pubSubEvent = new TestablePubSubEvent();\n            var emptyAction = new ActionHelper();\n            var token = pubSubEvent.Subscribe(emptyAction.Action);\n\n            Assert.True(pubSubEvent.Contains(token));\n\n            pubSubEvent.Unsubscribe(emptyAction.Action);\n            Assert.False(pubSubEvent.Contains(token));\n        }\n\n        [Fact]\n        public void SubscribeDefaultsToPublisherThread()\n        {\n            var PubSubEvent = new TestablePubSubEvent<string>();\n            Action<string> action = delegate { };\n            var token = PubSubEvent.Subscribe(action, true);\n\n            Assert.Single(PubSubEvent.BaseSubscriptions);\n            Assert.Equal(typeof(EventSubscription<string>), PubSubEvent.BaseSubscriptions.ElementAt(0).GetType());\n        }\n\n        [Fact]\n        public void SubscribeDefaultsToPublisherThreadNonGeneric()\n        {\n            var pubSubEvent = new TestablePubSubEvent();\n            Action action = delegate { };\n            var token = pubSubEvent.Subscribe(action, true);\n\n            Assert.Single(pubSubEvent.BaseSubscriptions);\n            Assert.Equal(typeof(EventSubscription), pubSubEvent.BaseSubscriptions.ElementAt(0).GetType());\n        }\n\n        public class ExternalFilter\n        {\n            public bool AlwaysTrueFilter(string value)\n            {\n                return true;\n            }\n        }\n\n        public class ExternalAction\n        {\n            public string PassedValue;\n            public bool Executed = false;\n\n            public void ExecuteAction(string value)\n            {\n                PassedValue = value;\n                Executed = true;\n            }\n\n            public void ExecuteAction()\n            {\n                Executed = true;\n            }\n        }\n\n        class TestablePubSubEvent<TPayload> : PubSubEvent<TPayload>\n        {\n            public ICollection<IEventSubscription> BaseSubscriptions\n            {\n                get { return base.Subscriptions; }\n            }\n        }\n\n        class TestablePubSubEvent : PubSubEvent\n        {\n            public ICollection<IEventSubscription> BaseSubscriptions\n            {\n                get { return base.Subscriptions; }\n            }\n        }\n\n        public class Payload { }\n    }\n\n    public class ActionHelper\n    {\n        public bool ActionCalled;\n        public Action ActionToExecute = null;\n        private object actionArg;\n\n        public T ActionArg<T>()\n        {\n            return (T)actionArg;\n        }\n\n        public void Action(PubSubEventFixture.Payload arg)\n        {\n            Action((object)arg);\n        }\n\n        public void Action(string arg)\n        {\n            Action((object)arg);\n        }\n\n        public void Action(object arg)\n        {\n            actionArg = arg;\n            ActionCalled = true;\n            if (ActionToExecute != null)\n            {\n                ActionToExecute.Invoke();\n            }\n        }\n\n        public void Action()\n        {\n            ActionCalled = true;\n            if (ActionToExecute != null)\n            {\n                ActionToExecute.Invoke();\n            }\n        }\n    }\n\n    public class MockFilter\n    {\n        public bool FilterReturnValue;\n\n        public bool FilterString(string arg)\n        {\n            return FilterReturnValue;\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Prism.Core.Tests/Extensions/TaskExtensionsFixture.cs",
    "content": "﻿using System;\nusing System.Threading.Tasks;\nusing Xunit;\n\nnamespace Prism.Core.Tests.Extensions\n{\n    public class TaskExtensionsFixture\n    {\n        [Fact]\n        public void TaskIsCompleted()\n        {\n            var sus = new SystemUnderTest();\n\n            Assert.False(sus.TaskCompleted);\n            sus.RunATask().Await(() =>\n            {\n                Assert.True(sus.TaskCompleted);\n            });\n        }\n\n        [Fact]\n        public void TaskIsCompleted_WithResult()\n        {\n            var sus = new SystemUnderTest();\n\n            Assert.False(sus.TaskCompleted);\n            sus.RunATaskWithResult().Await((result) =>\n            {\n                Assert.True(sus.TaskCompleted);\n                Assert.Equal(SystemUnderTest.Result, result);\n            });\n        }\n\n        [Fact]\n        public void TaskHandlesException()\n        {\n            var sus = new SystemUnderTest();\n\n            Assert.False(sus.TaskCompleted);\n            sus.TaskThrowsException().Await((ex) =>\n            {\n                Assert.NotNull(ex);\n                Assert.IsType<Exception>(ex);\n                Assert.False(sus.TaskCompleted);\n            });\n        }\n\n        [Fact]\n        public void ExceptionInCompletedCallback_TriggersErrorCallback()\n        {\n            var sus = new SystemUnderTest();\n\n            sus.RunATask().Await(() =>\n            {\n                throw new Exception();\n            },\n            (ex) =>\n            {\n                Assert.NotNull(ex);\n                Assert.IsType<Exception>(ex);\n            });\n        }\n\n        [Fact]\n        public void ExceptionInCompletedCallback_WithResult_TriggersErrorCallback()\n        {\n            var sus = new SystemUnderTest();\n\n            sus.RunATaskWithResult().Await((result) =>\n            {\n                throw new Exception();\n            },\n            (ex) =>\n            {\n                Assert.NotNull(ex);\n                Assert.IsType<Exception>(ex);\n            });\n        }\n\n        class SystemUnderTest\n        {\n            public const string Result = \"RESULT\";\n\n            public bool TaskCompleted { get; set; } = false;\n\n            public async Task RunATask()\n            {\n                await Task.Delay(500);\n                TaskCompleted = true;\n            }\n\n            public async Task<string> RunATaskWithResult()\n            {\n                await Task.Delay(500);\n                TaskCompleted = true;\n                return Result;\n            }\n\n            public async Task TaskThrowsException()\n            {\n                await Task.Delay(500);\n                throw new System.Exception();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Prism.Core.Tests/Mocks/ViewModels/MockValidatingViewModel.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Prism.Mvvm;\n\nnamespace Prism.Tests.Mocks.ViewModels\n{\n    public class MockValidatingViewModel : BindableBase, INotifyDataErrorInfo\n    {\n        ErrorsContainer<string> _errorsContainer;\n\n        private int mockProperty;\n        public int MockProperty\n        {\n            get\n            {\n                return this.mockProperty;\n            }\n\n            set\n            {\n                this.SetProperty(ref mockProperty, value);\n\n                if (mockProperty < 0)\n                    _errorsContainer.SetErrors<int>(() => MockProperty, new string[] { \"value cannot be less than 0\" });\n            }\n        }\n\n        internal void ClearMockPropertyErrors()\n        {\n            _errorsContainer.ClearErrors<int>(() => MockProperty);\n        }\n\n        internal void SetMockPropertyErrorsWithNullCollection()\n        {\n            _errorsContainer.SetErrors<int>(() => MockProperty, null);\n        }\n\n        public MockValidatingViewModel()\n        {\n            _errorsContainer = new ErrorsContainer<string>(OnErrorsChanged);\n        }\n\n        public event System.EventHandler<DataErrorsChangedEventArgs> ErrorsChanged;\n        public void OnErrorsChanged(string propertyName)\n        {\n            var handler = ErrorsChanged;\n        }\n\n        public System.Collections.IEnumerable GetErrors(string propertyName)\n        {\n            return _errorsContainer.GetErrors(propertyName);\n        }\n\n        public bool HasErrors\n        {\n            get { return _errorsContainer.HasErrors; }\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Prism.Core.Tests/Mocks/ViewModels/MockViewModel.cs",
    "content": "\n\nusing System.ComponentModel;\nusing Prism.Mvvm;\n\nnamespace Prism.Tests.Mocks.ViewModels\n{\n    public class MockViewModel : BindableBase\n    {\n        private int mockProperty;\n\n        public int MockProperty\n        {\n            get\n            {\n                return this.mockProperty;\n            }\n\n            set\n            {\n                this.SetProperty(ref mockProperty, value);\n            }\n        }\n\n        internal void InvokeOnPropertyChanged()\n        {\n            RaisePropertyChanged(nameof(MockProperty));\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Prism.Core.Tests/Mocks/Views/Mock.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Prism.Tests.Mocks.Views\n{\n    public class Mock\n    {\n    }\n}\n"
  },
  {
    "path": "tests/Prism.Core.Tests/Mocks/Views/MockView.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Prism.Tests.Mocks.Views\n{\n    public class MockView\n    {\n    }\n}\n"
  },
  {
    "path": "tests/Prism.Core.Tests/Mvvm/BindableBaseFixture.cs",
    "content": "using Prism.Tests.Mocks.ViewModels;\nusing Xunit;\n\nnamespace Prism.Tests.Mvvm\n{\n    public class BindableBaseFixture\n    {\n        [Fact]\n        public void SetPropertyMethodShouldSetTheNewValue()\n        {\n            int value = 10;\n            MockViewModel mockViewModel = new MockViewModel();\n\n            Assert.Equal(0, mockViewModel.MockProperty);\n\n            mockViewModel.MockProperty = value;\n            Assert.Equal(value, mockViewModel.MockProperty);\n        }\n\n        [Fact]\n        public void SetPropertyMethodShouldNotSetTheNewValue()\n        {\n            int value = 10, newValue = 10;\n            MockViewModel mockViewModel = new MockViewModel();\n            mockViewModel.MockProperty = value;\n\n            bool invoked = false;\n            mockViewModel.PropertyChanged += (o, e) => { if (e.PropertyName.Equals(\"MockProperty\")) invoked = true; };\n            mockViewModel.MockProperty = newValue;\n\n            Assert.False(invoked);\n            Assert.Equal(value, mockViewModel.MockProperty);\n        }\n\n        [Fact]\n        public void SetPropertyMethodShouldRaisePropertyRaised()\n        {\n            bool invoked = false;\n            MockViewModel mockViewModel = new MockViewModel();\n\n            mockViewModel.PropertyChanged += (o, e) => { if (e.PropertyName.Equals(\"MockProperty\")) invoked = true; };\n            mockViewModel.MockProperty = 10;\n\n            Assert.True(invoked);\n        }\n\n        [Fact]\n        public void OnPropertyChangedShouldExtractPropertyNameCorrectly()\n        {\n            bool invoked = false;\n            MockViewModel mockViewModel = new MockViewModel();\n\n            mockViewModel.PropertyChanged += (o, e) => { if (e.PropertyName.Equals(\"MockProperty\")) invoked = true; };\n            mockViewModel.InvokeOnPropertyChanged();\n\n            Assert.True(invoked);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Prism.Core.Tests/Mvvm/ErrorsContainerFixture.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Prism.Mvvm;\nusing Xunit;\n\nnamespace Prism.Tests.Mvvm\n{\n    public class ErrorsContainerFixture\n    {\n        [Fact]\n        public void WhenCreatingAnInstanceWithANullAction_ThenAnExceptionIsThrown()\n        {\n            Assert.Throws<ArgumentNullException>(() => new ErrorsContainer<object>(null));\n        }\n\n        [Fact]\n        public void WhenCreatingInstance_ThenHasNoErrors()\n        {\n            var validation = new ErrorsContainer<string>(pn => { });\n\n            Assert.False(validation.HasErrors);\n            Assert.False(validation.GetErrors(\"property1\").Any());\n        }\n\n        [Fact]\n        public void WhenSettingErrorsForPropertyWithNoErrors_ThenNotifiesChangesAndHasErrors()\n        {\n            List<string> validatedProperties = new List<string>();\n\n            var validation = new ErrorsContainer<string>(pn => validatedProperties.Add(pn));\n\n            validation.SetErrors(\"property1\", new[] { \"message\" });\n\n            Assert.True(validation.HasErrors);\n            Assert.Contains(\"message\", validation.GetErrors(\"property1\"));\n            Assert.Equal(new[] { \"property1\" }, validatedProperties);\n        }\n\n        [Fact]\n        public void WhenSettingNoErrorsForPropertyWithNoErrors_ThenDoesNotNotifyChangesAndHasNoErrors()\n        {\n            List<string> validatedProperties = new List<string>();\n\n            var validation = new ErrorsContainer<string>(pn => validatedProperties.Add(pn));\n\n            validation.SetErrors(\"property1\", new string[0]);\n\n            Assert.False(validation.HasErrors);\n            Assert.False(validation.GetErrors(\"property1\").Any());\n            Assert.False(validatedProperties.Any());\n        }\n\n        [Fact]\n        public void WhenSettingErrorsForPropertyWithErrors_ThenNotifiesChangesAndHasErrors()\n        {\n            List<string> validatedProperties = new List<string>();\n\n            var validation = new ErrorsContainer<string>(pn => validatedProperties.Add(pn));\n\n            validation.SetErrors(\"property1\", new[] { \"message\" });\n\n            validatedProperties.Clear();\n\n            validation.SetErrors(\"property1\", new[] { \"message\" });\n\n            Assert.True(validation.HasErrors);\n            Assert.Contains(\"message\", validation.GetErrors(\"property1\"));\n            Assert.Equal(new[] { \"property1\" }, validatedProperties);\n        }\n\n        [Fact]\n        public void WhenSettingNoErrorsForPropertyWithErrors_ThenNotifiesChangesAndHasNoErrors()\n        {\n            List<string> validatedProperties = new List<string>();\n\n            var validation = new ErrorsContainer<string>(pn => validatedProperties.Add(pn));\n\n            validation.SetErrors(\"property1\", new[] { \"message\" });\n\n            validatedProperties.Clear();\n\n            validation.SetErrors(\"property1\", new string[0]);\n\n            Assert.False(validation.HasErrors);\n            Assert.False(validation.GetErrors(\"property1\").Any());\n            Assert.Equal(new[] { \"property1\" }, validatedProperties);\n        }\n\n        [Fact]\n        public void WhenClearingErrorsForPropertyWithErrors_ThenPropertyHasNoErrors()\n        {\n            List<string> validatedProperties = new List<string>();\n\n            var validation = new ErrorsContainer<string>(pn => validatedProperties.Add(pn));\n\n            validation.SetErrors(\"property1\", new[] { \"message\" });\n            validation.SetErrors(\"property2\", new[] { \"message2\" });\n\n            validation.ClearErrors(\"property1\");\n\n            Assert.True(validation.HasErrors);\n            Assert.False(validation.GetErrors(\"property1\").Any());\n            Assert.True(validation.GetErrors(\"property2\").Any());\n        }\n\n        [Fact]\n        public void WhenClearingErrorsWithNullPropertyname_ThenHasErrors()\n        {\n            List<string> validatedProperties = new List<string>();\n\n            var validation = new ErrorsContainer<string>(pn => validatedProperties.Add(pn));\n\n            validation.SetErrors(\"property1\", new[] { \"message\" });\n\n            validation.ClearErrors(null);\n\n            Assert.True(validation.HasErrors);\n            Assert.True(validation.GetErrors(\"property1\").Any());\n        }\n\n        [Fact]\n        public void WhenClearingErrorsForPropertyWithErrorsGeneric_ThenPropertyHasNoErrors()\n        {\n            var viewModel = new Prism.Tests.Mocks.ViewModels.MockValidatingViewModel();\n            viewModel.MockProperty = -5;\n            Assert.True(viewModel.HasErrors);\n\n            viewModel.ClearMockPropertyErrors();\n\n            Assert.False(viewModel.HasErrors);\n        }\n\n        [Fact]\n        public void WhenGettingErrors_ThenErrorsPerPropertyReturnd()\n        {\n            List<string> validatedProperties = new List<string>();\n\n            var validation = new ErrorsContainer<string>(pn => validatedProperties.Add(pn));\n\n            validation.SetErrors(\"property1\", new[] { \"message\" });\n            validation.SetErrors(\"property2\", new[] { \"message\" });\n\n            var errors = validation.GetErrors();\n\n            Assert.True(errors.Any());\n            Assert.True(errors.Count == 2);\n            Assert.Contains(errors, e => e.Key.Equals(\"property1\"));\n            Assert.Contains(errors, e => e.Key.Equals(\"property2\"));\n        }\n\n        [Fact]\n        public void WhenGettingErrorsWithPropertyName_ThenErrorsReturned()\n        {\n            List<string> validatedProperties = new List<string>();\n\n            var validation = new ErrorsContainer<string>(pn => validatedProperties.Add(pn));\n\n            validation.SetErrors(\"property1\", new[] { \"message\" });\n\n            var errors = validation.GetErrors(\"property1\");\n\n            Assert.True(errors.Any());\n        }\n\n        [Fact]\n        public void WhenGettingErrorsWithNullPropertyName_ThenNoErrorsReturned()\n        {\n            List<string> validatedProperties = new List<string>();\n\n            var validation = new ErrorsContainer<string>(pn => validatedProperties.Add(pn));\n\n            validation.SetErrors(\"property1\", new[] { \"message\" });\n\n            var errors = validation.GetErrors(null);\n\n            Assert.True(validation.HasErrors);\n            Assert.True(errors.Count() == 0);\n        }\n\n        [Fact]\n        public void WhenSettingsErrorsForPropertyWithNullCollection_ThenPropertyHasNoErrors()\n        {\n            var viewModel = new Prism.Tests.Mocks.ViewModels.MockValidatingViewModel();\n            viewModel.MockProperty = 10;\n            Assert.False(viewModel.HasErrors);\n\n            viewModel.SetMockPropertyErrorsWithNullCollection();\n\n            Assert.False(viewModel.HasErrors);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Prism.Core.Tests/Mvvm/PropertySupportFixture.cs",
    "content": "using System;\nusing Prism.Mvvm;\nusing Xunit;\n\nnamespace Prism.Tests.Mvvm\n{\n    public class PropertySupportFixture\n    {\n        [Fact]\n        public virtual void WhenExtractingNameFromAValidPropertyExpression_ThenPropertyNameReturned()\n        {\n            var propertyName = PropertySupport.ExtractPropertyName(() => this.InstanceProperty);\n            Assert.Equal(\"InstanceProperty\", propertyName);\n        }\n\n        [Fact]\n        public void WhenExpressionRepresentsAStaticProperty_ThenExceptionThrown()\n        {\n            Assert.Throws<ArgumentException>(() => PropertySupport.ExtractPropertyName(() => StaticProperty));\n        }\n\n        [Fact]\n        public void WhenExpressionIsNull_ThenAnExceptionIsThrown()\n        {\n            Assert.Throws<ArgumentNullException>(() => PropertySupport.ExtractPropertyName<int>(null));\n        }\n\n        [Fact]\n        public void WhenExpressionRepresentsANonMemberAccessExpression_ThenAnExceptionIsThrown()\n        {\n            Assert.Throws<ArgumentException>(() => PropertySupport.ExtractPropertyName(() => GetHashCode()));\n        }\n\n        [Fact]\n        public void WhenExpressionRepresentsANonPropertyMemberAccessExpression_ThenAnExceptionIsThrown()\n        {\n            Assert.Throws<ArgumentException>(() => PropertySupport.ExtractPropertyName(() => InstanceField));\n        }\n\n        public static int StaticProperty { get; set; }\n        public int InstanceProperty { get; set; }\n        public int InstanceField;\n        public static int SetOnlyStaticProperty { set { } }\n    }\n}\n"
  },
  {
    "path": "tests/Prism.Core.Tests/Mvvm/ViewModelLocationProviderFixture.cs",
    "content": "﻿using System;\nusing System.Reflection;\nusing Prism.Mvvm;\nusing Prism.Tests.Mocks.ViewModels;\nusing Prism.Tests.Mocks.Views;\nusing Xunit;\n\nnamespace Prism.Tests.Mvvm\n{\n    public class ViewModelLocationProviderFixture\n    {\n        [Fact]\n        public void ShouldLocateViewModelWithDefaultSettings()\n        {\n            ResetViewModelLocationProvider();\n\n            var view = new Mock();\n\n            ViewModelLocationProvider.AutoWireViewModelChanged(view, (v, vm) =>\n            {\n                Assert.NotNull(v);\n                Assert.NotNull(vm);\n                Assert.IsType<MockViewModel>(vm);\n            });\n        }\n\n        [Fact]\n        public void ShouldLocateViewModelWithDefaultSettingsForViewsThatEndWithView()\n        {\n            ResetViewModelLocationProvider();\n\n            var view = new MockView();\n\n            ViewModelLocationProvider.AutoWireViewModelChanged(view, (v, vm) =>\n            {\n                Assert.NotNull(v);\n                Assert.NotNull(vm);\n                Assert.IsType<MockViewModel>(vm);\n            });\n        }\n\n        [Fact]\n        public void ShouldUseCustomDefaultViewModelFactoryWhenSet()\n        {\n            ResetViewModelLocationProvider();\n\n            var view = new Mock();\n\n            object mockObject = new object();\n            ViewModelLocationProvider.SetDefaultViewModelFactory(viewType => mockObject);\n\n            ViewModelLocationProvider.AutoWireViewModelChanged(view, (v, vm) =>\n            {\n                Assert.NotNull(v);\n                Assert.NotNull(vm);\n                Assert.IsType(mockObject.GetType(), vm);\n            });\n        }\n\n        [Fact]\n        public void ShouldUseCustomDefaultViewTypeToViewModelTypeResolverWhenSet()\n        {\n            ResetViewModelLocationProvider();\n\n            var view = new Mock();\n\n            ViewModelLocationProvider.SetDefaultViewTypeToViewModelTypeResolver(viewType => typeof(ViewModelLocationProviderFixture));\n\n            ViewModelLocationProvider.AutoWireViewModelChanged(view, (v, vm) =>\n            {\n                Assert.NotNull(v);\n                Assert.NotNull(vm);\n                Assert.IsType<ViewModelLocationProviderFixture>(vm);\n            });\n        }\n\n        [Fact]\n        public void ShouldFailWhenCustomDefaultViewTypeToViewModelTypeResolverIsNull()\n        {\n            ResetViewModelLocationProvider();\n\n            var view = new Mock();\n\n            ViewModelLocationProvider.SetDefaultViewTypeToViewModelTypeResolver(viewType => null);\n\n            ViewModelLocationProvider.AutoWireViewModelChanged(view, (v, vm) =>\n            {\n                Assert.NotNull(v);\n                Assert.Null(vm);\n            });\n        }\n\n        [Fact]\n        public void ShouldUseCustomFactoryWhenSet()\n        {\n            ResetViewModelLocationProvider();\n\n            var view = new Mock();\n\n            string viewModel = \"Test String\";\n            ViewModelLocationProvider.Register(view.GetType().ToString(), () => viewModel);\n\n            ViewModelLocationProvider.AutoWireViewModelChanged(view, (v, vm) =>\n                {\n                    Assert.NotNull(v);\n                    Assert.NotNull(vm);\n                    Assert.Equal(viewModel, vm);\n                });\n        }\n\n        [Fact]\n        public void ShouldUseCustomFactoryWhenSet_Generic()\n        {\n            ResetViewModelLocationProvider();\n\n            var view = new Mock();\n\n            string viewModel = \"Test String\";\n            ViewModelLocationProvider.Register<Mock>(() => viewModel);\n\n            ViewModelLocationProvider.AutoWireViewModelChanged(view, (v, vm) =>\n            {\n                Assert.NotNull(v);\n                Assert.NotNull(vm);\n                Assert.Equal(viewModel, vm);\n            });\n        }\n\n        [Fact]\n        public void ShouldUseCustomTypeWhenSet()\n        {\n            ResetViewModelLocationProvider();\n\n            var view = new Mock();\n\n            ViewModelLocationProvider.Register(view.GetType().ToString(), typeof(ViewModelLocationProviderFixture));\n\n            ViewModelLocationProvider.AutoWireViewModelChanged(view, (v, vm) =>\n            {\n                Assert.NotNull(v);\n                Assert.NotNull(vm);\n                Assert.IsType<ViewModelLocationProviderFixture>(vm);\n            });\n        }\n\n        [Fact]\n        public void ShouldUseCustomTypeWhenSet_Generic()\n        {\n            ResetViewModelLocationProvider();\n\n            var view = new Mock();\n\n            ViewModelLocationProvider.Register<Mock, ViewModelLocationProviderFixture>();\n\n            ViewModelLocationProvider.AutoWireViewModelChanged(view, (v, vm) =>\n            {\n                Assert.NotNull(v);\n                Assert.NotNull(vm);\n                Assert.IsType<ViewModelLocationProviderFixture>(vm);\n            });\n        }\n\n        private static void ResetViewModelLocationProvider() =>\n            ViewModelLocationProvider.Reset();\n    }\n}\n"
  },
  {
    "path": "tests/Prism.Core.Tests/Navigation/NavigationParametersFixture.cs",
    "content": "﻿using System.Linq;\nusing Prism.Navigation;\nusing Xunit;\n\nnamespace Prism.Tests.Navigation\n{\n\n    public class NavigationParametersFixture\n    {\n        const string _uri = \"?id=3&name=brian\";\n        const string _uriWithNoQuestionMarkDelimiter = \"id=3&name=brian\";\n        const string _uriWithArray = \"color=red&color=white&color=blue\";\n        const string _uriWithJQueryArray = \"color[]=red&color[]=white&color[]=blue\";\n\n        [Fact]\n        public void ParametersParsedFromQuery()\n        {\n            var parameters = new NavigationParameters(_uri);\n            Assert.Equal(2, parameters.Count);\n            Assert.True(parameters.ContainsKey(\"id\"));\n            Assert.Equal(\"3\", parameters[\"id\"]);\n            Assert.True(parameters.ContainsKey(\"name\"));\n            Assert.Equal(\"brian\", parameters[\"name\"]);\n        }\n\n        [Fact]\n        public void ParametersParsedFromQueryWithNoQuestionMarkDelimiter()\n        {\n            var parameters = new NavigationParameters(_uriWithNoQuestionMarkDelimiter);\n            Assert.Equal(2, parameters.Count);\n            Assert.True(parameters.ContainsKey(\"id\"));\n            Assert.Equal(\"3\", parameters[\"id\"]);\n            Assert.True(parameters.ContainsKey(\"name\"));\n            Assert.Equal(\"brian\", parameters[\"name\"]);\n        }\n\n        [Fact]\n        public void ParametersParsedFromQueryWithArray()\n        {\n            var parameters = new NavigationParameters(_uriWithArray);\n            Assert.Equal(3, parameters.Count);\n            Assert.Contains(\"color\", parameters.Keys.ToArray());\n        }\n\n        [Fact]\n        public void ParametersParsedFromQueryWithJQueryArray()\n        {\n            var parameters = new NavigationParameters(_uriWithJQueryArray);\n            Assert.Equal(3, parameters.Count);\n            Assert.Contains(\"color[]\", parameters.Keys.ToArray());\n        }\n\n        [Fact]\n        public void EmptyNavigationParametersWhenGivenNull()\n        {\n            var parameters = new NavigationParameters(null);\n            Assert.NotNull(parameters);\n            Assert.Equal(0, parameters.Count);\n        }\n\n        [Fact]\n        public void EmptyNavigationParametersWhenGivenSpace()\n        {\n            var parameters = new NavigationParameters(\" \");\n            Assert.NotNull(parameters);\n            Assert.Equal(0, parameters.Count);\n        }\n\n        [Fact]\n        public void EmptyNavigationParametersWhenGivenNoValue()\n        {\n            var parameters = new NavigationParameters(\"id\");\n            Assert.NotNull(parameters);\n            Assert.Equal(0, parameters.Count);\n        }\n\n        [Fact]\n        public void ParametersHaveNoKeysWhenEmpty()\n        {\n            var parameters = new NavigationParameters();\n            Assert.Empty(parameters.Keys);\n        }\n\n        [Fact]\n        public void CountIsZeroWhenParametersAreEmpty()\n        {\n            var parameters = new NavigationParameters();\n            Assert.Equal(0, parameters.Count);\n        }\n\n        [Fact]\n        public void CountReturnsNumberOfParameters()\n        {\n            var parameters = new NavigationParameters($\"{_uri}&{_uriWithArray}\");\n            Assert.Equal(5, parameters.Count);\n        }\n\n        [Fact]\n        public void GetValueReturnsDefaultWhenGivenInvalidKey()\n        {\n            var parameters = new NavigationParameters();\n            var result = parameters.GetValue<int>(\"id\");\n            Assert.Equal(default(int), result);\n        }\n\n        [Fact]\n        public void TryGetValueReturnsDefaultWhenGivenInvalidKey()\n        {\n            var parameters = new NavigationParameters();\n            int value;\n            var result = parameters.TryGetValue(\"id\", out value);\n            Assert.False(result);\n            Assert.Equal(default(int), value);\n        }\n\n        [Fact]\n        public void GetValueReturnsDefaultWhenParameterValueIsNull()\n        {\n            var parameters = new NavigationParameters();\n            parameters.Add(\"value\", null);\n            var result = parameters.GetValue<int>(\"value\");\n            Assert.Equal(0, result);\n        }\n\n        [Fact]\n        public void TryGetValueReturnsDefaultWhenParameterValueIsNull()\n        {\n            var parameters = new NavigationParameters();\n            parameters.Add(\"value\", null);\n            int value;\n            var result = parameters.TryGetValue(\"value\", out value);\n            Assert.True(result);\n            Assert.Equal(0, value);\n        }\n\n        [Fact]\n        public void GetValueReturnsTypedParameterWhenParametersParsedFromQuery()\n        {\n            var parameters = new NavigationParameters(_uri);\n            var result = parameters.GetValue<int>(\"id\");\n            Assert.IsType<int>(result);\n            Assert.Equal(3, result);\n        }\n\n        [Fact]\n        public void TryGetValueReturnsTypedParameterWhenParametersParsedFromQuery()\n        {\n            var parameters = new NavigationParameters(_uri);\n            int value;\n            var result = parameters.TryGetValue(\"id\", out value);\n            Assert.True(result);\n            Assert.Equal(3, value);\n        }\n\n        [Fact]\n        public void GetValueReturnsNullWhenParameterValueIsNull()\n        {\n            var parameters = new NavigationParameters();\n            parameters.Add(\"value\", null);\n            var result = parameters.GetValue<object>(\"value\");\n            Assert.Null(result);\n        }\n\n        [Fact]\n        public void GetValuesReturnsEmptyArrayWhenGivenNoKey()\n        {\n            var parameters = new NavigationParameters();\n            var result = parameters.GetValues<object>(null);\n            Assert.Empty(result);\n        }\n\n        [Fact]\n        public void GetValuesReturnsEmptyArrayWhenGivenEmptyKey()\n        {\n            var parameters = new NavigationParameters();\n            var result = parameters.GetValues<object>(string.Empty);\n            Assert.Empty(result);\n        }\n\n        [Fact]\n        public void GetValuesReturnsEmptyArrayWhenParametersParsedFromQueryWithInvalidKey()\n        {\n            var parameters = new NavigationParameters(_uriWithArray);\n            var result = parameters.GetValues<object>(\"id\");\n            Assert.Empty(result);\n        }\n\n        [Fact]\n        public void GetValuesReturnsArrayWhenParametersParsedFromQuery()\n        {\n            var parameters = new NavigationParameters(_uriWithArray);\n            var result = parameters.GetValues<object>(\"color\");\n            Assert.Equal(3, result.Count());\n            Assert.Contains(\"red\", result);\n            Assert.Contains(\"white\", result);\n            Assert.Contains(\"blue\", result);\n        }\n\n        [Fact]\n        public void GetValuesReturnsArrayWhenNotUsingQuery()\n        {\n            var parameters = new NavigationParameters\n            {\n                { \"id\", new Person() },\n                { \"id\", new Person() },\n                { \"id\", null } // null value should be ignored\n            };\n            var result = parameters.GetValues<Person>(\"id\").ToArray();\n            Assert.Equal(2, result.Count());\n            Assert.IsType<Person>(result[0]);\n            Assert.IsType<Person>(result[1]);\n        }\n\n        [Fact]\n        public void GetValuesConvertsValuesToStringWhenGivenUriQuery()\n        {\n            var parameters = new NavigationParameters(_uriWithArray);\n            var result = parameters.GetValues<string>(\"color\").ToArray();\n            Assert.Equal(3, result.Count());\n\n            Assert.IsType<string>(result[0]);\n            Assert.IsType<string>(result[1]);\n            Assert.IsType<string>(result[2]);\n        }\n\n        [Fact]\n        public void GetValuesConvertsValuesToIntWhenGivenUriQuery()\n        {\n            var parameters = new NavigationParameters(\"id=1&id=2&id=3\");\n            var result = parameters.GetValues<int>(\"id\").ToArray();\n            Assert.Equal(3, result.Count());\n            Assert.IsType<int>(result[0]);\n            Assert.IsType<int>(result[1]);\n            Assert.IsType<int>(result[2]);\n        }\n\n        [Fact]\n        public void GetValueUseParentClassAsTypeParameter()\n        {\n            var parameters = new NavigationParameters();\n            parameters.Add(\"id\", new Child());\n\n            Assert.NotNull(parameters.GetValue<Person>(\"id\"));\n        }\n\n        [Fact]\n        public void TryGetValueUseParentClassAsTypeParameter()\n        {\n            var parameters = new NavigationParameters();\n            parameters.Add(\"id\", new Child());\n\n            Person value;\n            var result = parameters.TryGetValue<Person>(\"id\", out value);\n            Assert.True(result);\n            Assert.IsType<Child>(value);\n        }\n\n        [Fact]\n        public void GetValuesUseParentClassAsTypeParameter()\n        {\n            var parameters = new NavigationParameters();\n            parameters.Add(\"id\", new Child());\n            parameters.Add(\"id\", new Child());\n            parameters.Add(\"id\", new Person());\n\n            var result = parameters.GetValues<Person>(\"id\").ToArray();\n\n            Assert.Equal(3, result.Count());\n            Assert.NotNull(result[0]);\n            Assert.NotNull(result[1]);\n            Assert.NotNull(result[2]);\n        }\n\n        [Fact]\n        public void ToStringWorksWithNullParameterValues()\n        {\n            var parameters = new NavigationParameters();\n            parameters.Add(\"id1\", 1);\n            parameters.Add(\"id2\", null);\n            parameters.Add(\"id3\", 3);\n\n            var result = parameters.ToString();\n\n            Assert.Equal(\"?id1=1&id2=&id3=3\", result);\n        }\n    }\n\n    public class Person\n    { }\n\n    public class Child : Person\n    { }\n}\n"
  },
  {
    "path": "tests/Prism.Core.Tests/Prism.Core.Tests.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFrameworks>net10.0</TargetFrameworks>\n    <IsPackable>false</IsPackable>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"coverlet.collector\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"GitHubActionsTestLogger\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"Microsoft.NET.Test.Sdk\" />\n    <PackageReference Include=\"Moq\" />\n    <PackageReference Include=\"xunit\" />\n    <PackageReference Include=\"xunit.runner.visualstudio\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>\n    </PackageReference>\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\src\\Prism.Core\\Prism.Core.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <Service Include=\"{82a7f48d-3b50-4b1e-b82e-3ada8210c358}\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "tests/Wpf/Prism.Container.Wpf.Shared/Fixtures/Application/PrismApplicationFixture.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace Prism.Container.Wpf.Tests.Fixtures.Application\n{\n    public class PrismApplicationFixture\n    {\n        // TODO: Brian please write some tests for PrismApplication...\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Container.Wpf.Shared/Fixtures/Bootstrapper/BootstrapperFixture.cs",
    "content": "﻿using System;\nusing Prism.Container.Wpf.Mocks;\nusing Prism.Ioc;\nusing Prism.Modularity;\nusing Prism.Navigation.Regions;\nusing Xunit;\nusing static Prism.Container.Wpf.Tests.ContainerHelper;\n\nnamespace Prism.Container.Wpf.Tests.Bootstrapper\n{\n    [Collection(nameof(ContainerExtension))]\n    public class BootstrapperFixture\n    {\n        [StaFact]\n        public void ContainerDefaultsToNull()\n        {\n            var bootstrapper = new MockBootstrapper();\n            var container = bootstrapper.ContainerExtension;\n\n            Assert.Null(container);\n        }\n\n        [StaFact]\n        public void CanCreateConcreteBootstrapper()\n        {\n            new MockBootstrapper();\n        }\n\n        [StaFact]\n        public void CreateContainerShouldInitializeContainer()\n        {\n            var bootstrapper = new MockBootstrapper();\n\n            var container = bootstrapper.CallCreateContainer();\n\n            Assert.NotNull(container);\n            Assert.IsAssignableFrom(BaseContainerInterfaceType, container);\n        }\n\n        [StaFact]\n        public void ConfigureContainerAddsModuleCatalogToContainer()\n        {\n            var bootstrapper = new MockBootstrapper();\n            bootstrapper.Run();\n\n            var returnedCatalog = bootstrapper.ContainerExtension.Resolve<IModuleCatalog>();\n            Assert.NotNull(returnedCatalog);\n            Assert.IsType<ModuleCatalog>(returnedCatalog);\n        }\n\n        [StaFact]\n        public void ConfigureContainerAddsRegionNavigationJournalEntryToContainer()\n        {\n            var bootstrapper = new MockBootstrapper();\n            bootstrapper.Run();\n\n            var actual1 = bootstrapper.ContainerExtension.Resolve<IRegionNavigationJournalEntry>();\n            var actual2 = bootstrapper.ContainerExtension.Resolve<IRegionNavigationJournalEntry>();\n\n            Assert.NotNull(actual1);\n            Assert.NotNull(actual2);\n            Assert.NotSame(actual1, actual2);\n        }\n\n        [StaFact]\n        public void ConfigureContainerAddsRegionNavigationJournalToContainer()\n        {\n            var bootstrapper = new MockBootstrapper();\n            bootstrapper.Run();\n\n            var actual1 = bootstrapper.ContainerExtension.Resolve<IRegionNavigationJournal>();\n            var actual2 = bootstrapper.ContainerExtension.Resolve<IRegionNavigationJournal>();\n\n            Assert.NotNull(actual1);\n            Assert.NotNull(actual2);\n            Assert.NotSame(actual1, actual2);\n        }\n\n        [StaFact]\n        public void ConfigureContainerAddsRegionNavigationServiceToContainer()\n        {\n            var bootstrapper = new MockBootstrapper();\n            bootstrapper.Run();\n\n            var actual1 = bootstrapper.ContainerExtension.Resolve<IRegionNavigationService>();\n            var actual2 = bootstrapper.ContainerExtension.Resolve<IRegionNavigationService>();\n\n            Assert.NotNull(actual1);\n            Assert.NotNull(actual2);\n            Assert.NotSame(actual1, actual2);\n        }\n\n        [StaFact]\n        public void ConfigureContainerAddsNavigationTargetHandlerToContainer()\n        {\n            var bootstrapper = new MockBootstrapper();\n            bootstrapper.Run();\n\n            var actual1 = bootstrapper.ContainerExtension.Resolve<IRegionNavigationContentLoader>();\n            var actual2 = bootstrapper.ContainerExtension.Resolve<IRegionNavigationContentLoader>();\n\n            Assert.NotNull(actual1);\n            Assert.NotNull(actual2);\n            Assert.Same(actual1, actual2);\n        }\n\n        [StaFact]\n        public void RegisterFrameworkExceptionTypesShouldRegisterResolutionFailedException()\n        {\n            var bootstrapper = new MockBootstrapper();\n\n            bootstrapper.CallRegisterFrameworkExceptionTypes();\n\n            Assert.True(ExceptionExtensions.IsFrameworkExceptionRegistered(RegisteredFrameworkException));\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Container.Wpf.Shared/Fixtures/Bootstrapper/BootstrapperNullModuleCatalogFixture.cs",
    "content": "﻿using System;\nusing Prism.Container.Wpf.Mocks;\nusing Prism.IocContainer.Wpf.Tests.Support;\nusing Xunit;\n\nnamespace Prism.Container.Wpf.Tests.Bootstrapper\n{\n    public class BootstrapperNullModuleCatalogFixture : BootstrapperFixtureBase\n    {\n        [Fact]\n        public void NullModuleCatalogThrowsOnDefaultModuleInitialization()\n        {\n            var bootstrapper = new NullModuleCatalogBootstrapper();\n\n            AssertExceptionThrownOnRun(bootstrapper, typeof(InvalidOperationException), \"IModuleCatalog\");\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Container.Wpf.Shared/Fixtures/Bootstrapper/BootstrapperRunMethodFixture.cs",
    "content": "using Moq;\nusing Prism.Container.Wpf.Mocks;\nusing Prism.Events;\nusing Prism.Ioc;\nusing Prism.Modularity;\nusing Prism.Navigation.Regions;\nusing Xunit;\n\nnamespace Prism.Container.Wpf.Tests.Bootstrapper\n{\n    [Collection(nameof(ContainerExtension))]\n    public partial class BootstrapperRunMethodFixture\n    {\n        [StaFact]\n        public void CanRunBootstrapper()\n        {\n            var bootstrapper = new MockBootstrapper();\n            bootstrapper.Run();\n        }\n\n        [StaFact]\n        public void RunShouldNotFailIfReturnedNullShell()\n        {\n            var bootstrapper = new MockBootstrapper { ShellObject = null };\n            bootstrapper.Run();\n        }\n\n        [StaFact]\n        public void RunSetsCurrentContainer()\n        {\n            var bootstrapper = new MockBootstrapper();\n            bootstrapper.Run();\n\n            Assert.NotNull(ContainerLocator.Container);\n            Assert.IsType(ContainerHelper.ContainerExtensionType, ContainerLocator.Container);\n        }\n\n        [StaFact]\n        public void RunShouldInitializeContainer()\n        {\n            var bootstrapper = new MockBootstrapper();\n            var container = bootstrapper.BaseContainer;\n\n            Assert.Null(container);\n\n            bootstrapper.Run();\n\n            container = bootstrapper.BaseContainer;\n\n            Assert.NotNull(container);\n            Assert.IsType(ContainerHelper.BaseContainerType, container);\n        }\n\n        [StaFact]\n        public void RunShouldCallInitializeModules()\n        {\n            var bootstrapper = new MockBootstrapper();\n            bootstrapper.Run();\n\n            Assert.True(bootstrapper.InitializeModulesCalled);\n        }\n\n        [StaFact]\n        public void RunShouldCallConfigureDefaultRegionBehaviors()\n        {\n            var bootstrapper = new MockBootstrapper();\n\n            bootstrapper.Run();\n\n            Assert.True(bootstrapper.ConfigureDefaultRegionBehaviorsCalled);\n        }\n\n        [StaFact]\n        public void RunShouldCallConfigureRegionAdapterMappings()\n        {\n            var bootstrapper = new MockBootstrapper();\n\n            bootstrapper.Run();\n\n            Assert.True(bootstrapper.ConfigureRegionAdapterMappingsCalled);\n        }\n\n        [StaFact]\n        public void RunShouldAssignRegionManagerToReturnedShell()\n        {\n            var bootstrapper = new MockBootstrapper();\n\n            bootstrapper.Run();\n\n            Assert.NotNull(RegionManager.GetRegionManager(bootstrapper.BaseShell));\n        }\n\n        [StaFact]\n        public void RunShouldCallCreateModuleCatalog()\n        {\n            var bootstrapper = new MockBootstrapper();\n\n            bootstrapper.Run();\n\n            Assert.True(bootstrapper.CreateModuleCatalogCalled);\n        }\n\n        [StaFact]\n        public void RunShouldCallConfigureModuleCatalog()\n        {\n            var bootstrapper = new MockBootstrapper();\n\n            bootstrapper.Run();\n\n            Assert.True(bootstrapper.ConfigureModuleCatalogCalled);\n        }\n\n        [StaFact]\n        public void RunShouldCallCreateContainer()\n        {\n            var bootstrapper = new MockBootstrapper();\n\n            bootstrapper.Run();\n\n            Assert.True(bootstrapper.CreateContainerCalled);\n        }\n\n        [StaFact]\n        public void RunShouldCallCreateShell()\n        {\n            var bootstrapper = new MockBootstrapper();\n\n            bootstrapper.Run();\n\n            Assert.True(bootstrapper.CreateShellCalled);\n        }\n\n        [StaFact]\n        public void RunShouldCallRegisterRequiredTypes()\n        {\n            var bootstrapper = new MockBootstrapper();\n\n            bootstrapper.Run();\n\n            Assert.True(bootstrapper.RegisterRequiredTypesCalled);\n        }\n\n        [StaFact]\n        public void RunShouldCallRegisterTypes()\n        {\n            var bootstrapper = new MockBootstrapper();\n\n            bootstrapper.Run();\n\n            Assert.True(bootstrapper.RegisterTypesCalled);\n        }\n\n        [StaFact]\n        public void SetsContainerLocatorCurrentContainer()\n        {\n            ContainerLocator.ResetContainer();\n            Assert.False(ContainerLocator.IsInitialized);\n            var bootstrapper = new MockBootstrapper();\n\n            bootstrapper.Run();\n\n            Assert.NotNull(ContainerLocator.Container);\n            Assert.Same(bootstrapper.Container, ContainerLocator.Container);\n        }\n\n        [StaFact]\n        public void RunShouldCallConfigureViewModelLocator()\n        {\n            var bootstrapper = new MockBootstrapper();\n\n            bootstrapper.Run();\n\n            Assert.True(bootstrapper.ConfigureViewModelLocatorCalled);\n        }\n\n        [StaFact]\n        public void ModuleManagerRunCalled()\n        {\n            // Have to use a non-mocked container because of IsRegistered<> extension method, Registrations property,and ContainerRegistration\n            var mockedModuleInitializer = new Mock<IModuleInitializer>();\n            var mockedModuleManager = new Mock<IModuleManager>();\n            var regionAdapterMappings = new RegionAdapterMappings();\n            var container = ContainerHelper.CreateContainerExtension();\n            var regionBehaviorFactory = new RegionBehaviorFactory(container);\n\n            container.RegisterInstance<IContainerExtension>(container);\n            container.RegisterInstance<IModuleCatalog>(new ModuleCatalog());\n            container.RegisterInstance<IModuleInitializer>(mockedModuleInitializer.Object);\n            container.RegisterInstance<IModuleManager>(mockedModuleManager.Object);\n            container.RegisterInstance<RegionAdapterMappings>(regionAdapterMappings);\n\n            container.RegisterSingleton(typeof(RegionAdapterMappings), typeof(RegionAdapterMappings));\n            container.RegisterSingleton(typeof(IRegionManager), typeof(RegionManager));\n            container.RegisterSingleton(typeof(IEventAggregator), typeof(EventAggregator));\n            container.RegisterSingleton(typeof(IRegionViewRegistry), typeof(RegionViewRegistry));\n            container.RegisterSingleton(typeof(IRegionBehaviorFactory), typeof(RegionBehaviorFactory));\n            container.RegisterSingleton(typeof(IRegionNavigationJournalEntry), typeof(RegionNavigationJournalEntry));\n            container.RegisterSingleton(typeof(IRegionNavigationJournal), typeof(RegionNavigationJournal));\n            container.RegisterSingleton(typeof(IRegionNavigationService), typeof(RegionNavigationService));\n            container.RegisterSingleton(typeof(IRegionNavigationContentLoader), typeof(RegionNavigationContentLoader));\n\n            container.RegisterInstance<SelectorRegionAdapter>(new SelectorRegionAdapter(regionBehaviorFactory));\n            container.RegisterInstance<ItemsControlRegionAdapter>(new ItemsControlRegionAdapter(regionBehaviorFactory));\n            container.RegisterInstance<ContentControlRegionAdapter>(new ContentControlRegionAdapter(regionBehaviorFactory));\n\n            var bootstrapper = new MockedContainerBootstrapper(container.GetBaseContainer());\n            bootstrapper.Run(false);\n\n            mockedModuleManager.Verify(mm => mm.Run(), Times.Once());\n        }\n\n        [StaFact]\n        public void RunShouldCallTheMethodsInOrder()\n        {\n            var bootstrapper = new MockBootstrapper();\n            bootstrapper.Run();\n\n            var index = 0;\n            Assert.Equal(\"ConfigureViewModelLocator\", bootstrapper.MethodCalls[index++]);\n            Assert.Equal(\"CreateContainerExtension\", bootstrapper.MethodCalls[index++]);\n            Assert.Equal(\"CreateModuleCatalog\", bootstrapper.MethodCalls[index++]);\n            Assert.Equal(\"RegisterRequiredTypes\", bootstrapper.MethodCalls[index++]);\n            Assert.Equal(\"RegisterTypes\", bootstrapper.MethodCalls[index++]);\n            Assert.Equal(\"ConfigureModuleCatalog\", bootstrapper.MethodCalls[index++]);\n            Assert.Equal(\"ConfigureRegionAdapterMappings\", bootstrapper.MethodCalls[index++]);\n            Assert.Equal(\"ConfigureDefaultRegionBehaviors\", bootstrapper.MethodCalls[index++]);\n            Assert.Equal(\"RegisterFrameworkExceptionTypes\", bootstrapper.MethodCalls[index++]);\n            Assert.Equal(\"CreateShell\", bootstrapper.MethodCalls[index++]);\n            Assert.Equal(\"InitializeShell\", bootstrapper.MethodCalls[index++]);\n            Assert.Equal(\"InitializeModules\", bootstrapper.MethodCalls[index++]);\n            Assert.Equal(\"OnInitialized\", bootstrapper.MethodCalls[index++]);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Container.Wpf.Shared/Fixtures/ContainerExtensionCollection.cs",
    "content": "﻿using Xunit;\n\nnamespace Prism.Container.Wpf.Tests\n{\n    public class ContainerExtension { }\n\n    [CollectionDefinition(nameof(ContainerExtension), DisableParallelization = true)]\n    public class ContainerExtensionCollection : ICollectionFixture<ContainerExtension>\n    {\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Container.Wpf.Shared/Fixtures/Ioc/ContainerExtensionFixture.cs",
    "content": "﻿using System.Collections.Generic;\nusing Prism.Ioc;\nusing Prism.IocContainer.Wpf.Tests.Support.Mocks;\nusing Xunit;\nusing static Prism.Container.Wpf.Tests.ContainerHelper;\n\nnamespace Prism.Container.Wpf.Tests.Ioc\n{\n    public class ContainerExtensionFixture\n    {\n        [Fact]\n        public void ExtensionReturnsTrueIfThereIsAPolicyForType()\n        {\n            var container = CreateContainerExtension();\n\n            container.Register<object, string>();\n            Assert.True(container.IsRegistered(typeof(object)));\n            Assert.False(container.IsRegistered(typeof(int)));\n\n            container.Register<IList<int>, List<int>>();\n\n            Assert.True(container.IsRegistered(typeof(IList<int>)));\n            Assert.False(container.IsRegistered(typeof(IList<string>)));\n\n            container.Register(typeof(IDictionary<,>), typeof(Dictionary<,>));\n            Assert.True(container.IsRegistered(typeof(IDictionary<,>)));\n        }\n\n        [Fact]\n        public void TryResolveShouldResolveTheElementIfElementExist()\n        {\n            var container = CreateContainerExtension();\n            container.Register<IService, MockService>();\n\n            object dependantA = null;\n            var ex = Record.Exception(() => dependantA = container.Resolve<IService>());\n            Assert.Null(ex);\n            Assert.NotNull(dependantA);\n        }\n\n        [Fact]\n        public void TryResolveShouldReturnNullIfElementNotExist()\n        {\n            var container = CreateContainerExtension();\n\n            object dependantA = null;\n            var ex = Record.Exception(() => dependantA = container.Resolve<IDependantA>());\n            Assert.NotNull(ex);\n            Assert.Null(dependantA);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Container.Wpf.Shared/Fixtures/Ioc/ContainerProviderExtensionFixture.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\nusing System.Text;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Xaml;\nusing Prism.Ioc;\nusing Prism.IocContainer.Wpf.Tests.Support.Mocks;\nusing Xunit;\n\nnamespace Prism.Container.Wpf.Tests.Ioc\n{\n    public class ContainerProviderExtensionFixture : IDisposable\n    {\n        private static readonly MockService _unnamedService = new MockService();\n        private static readonly IReadOnlyDictionary<string, MockService> _namedServiceDictionary = new Dictionary<string, MockService>\n        {\n            [\"A\"] = new MockService(),\n            [\"B\"] = new MockService(),\n        };\n\n        private static readonly IContainerExtension _containerExtension\n             = ContainerHelper.CreateContainerExtension();\n\n        static ContainerProviderExtensionFixture()\n        {\n            // Preload assembly to resolve 'xmlns:prism' on xaml.\n            Assembly.Load(\"Prism.Wpf\");\n\n            _containerExtension.RegisterInstance<IService>(_unnamedService);\n            foreach (var kvp in _namedServiceDictionary)\n            {\n                _containerExtension.RegisterInstance<IService>(kvp.Value, kvp.Key);\n            }\n        }\n\n        public ContainerProviderExtensionFixture()\n        {\n            ContainerLocator.ResetContainer();\n            ContainerLocator.SetContainerExtension(_containerExtension);\n        }\n\n        public void Dispose()\n        {\n            ContainerLocator.ResetContainer();\n        }\n\n        [Fact]\n        public void CanResolveUnnamedServiceUsingConstructor()\n        {\n            var containerProvider = new ContainerProviderExtension(typeof(IService));\n            var service = containerProvider.ProvideValue(null);\n\n            Assert.Same(_unnamedService, service);\n        }\n\n        [Fact]\n        public void CanResolveUnnamedServiceUsingProperty()\n        {\n            var containerProvider = new ContainerProviderExtension\n            {\n                Type = typeof(IService)\n            };\n            var service = containerProvider.ProvideValue(null);\n\n            Assert.Same(_unnamedService, service);\n        }\n\n        [Theory]\n        [InlineData(\"A\")]\n        [InlineData(\"B\")]\n        public void CanResolvedNamedServiceUsingConstructor(string name)\n        {\n            var expectedService = _namedServiceDictionary[name];\n\n            var containerProvider = new ContainerProviderExtension(typeof(IService))\n            {\n                Name = name,\n            };\n            var service = containerProvider.ProvideValue(null);\n\n            Assert.Same(expectedService, service);\n        }\n\n        [Theory]\n        [InlineData(\"A\")]\n        [InlineData(\"B\")]\n        public void CanResolvedNamedServiceUsingProperty(string name)\n        {\n            var expectedService = _namedServiceDictionary[name];\n\n            var containerProvider = new ContainerProviderExtension()\n            {\n                Type = typeof(IService),\n                Name = name,\n            };\n            var service = containerProvider.ProvideValue(null);\n\n            Assert.Same(expectedService, service);\n        }\n\n        private const string _xamlWithMarkupExtension =\n@\"<Window \n  xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'\n  xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'\n  xmlns:prism='http://prismlibrary.com/'\n  xmlns:mocks='clr-namespace:Prism.IocContainer.Wpf.Tests.Support.Mocks;assembly=Prism.IocContainer.Wpf.Tests.Support'\n  DataContext='{prism:ContainerProvider mocks:IService}' />\";\n\n        private const string _xamlWithXmlElement =\n@\"<Window\n  xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'\n  xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'\n  xmlns:prism='http://prismlibrary.com/'\n  xmlns:mocks='clr-namespace:Prism.IocContainer.Wpf.Tests.Support.Mocks;assembly=Prism.IocContainer.Wpf.Tests.Support'>\n  <Window.DataContext>\n    <prism:ContainerProvider Type='mocks:IService' />\n  </Window.DataContext>\n</Window>\";\n\n        [Theory]\n        [InlineData(_xamlWithMarkupExtension)]\n        [InlineData(_xamlWithXmlElement)]\n        public void CanResolveServiceFromXaml(string xaml)\n        {\n            // Don't use StaTheoryAttribute. \n            // If use StaTheoryAttribute, ContainerLocator.Current will be changed by other test method\n            // and Window.DataContext will be null.\n\n            object dataContext = null;\n            var thread = new Thread(() =>\n            {\n                using (var reader = new StringReader(xaml))\n                {\n                    var window = XamlServices.Load(reader) as Window;\n                    dataContext = window.DataContext;\n                }\n            });\n            thread.SetApartmentState(ApartmentState.STA);\n            thread.Start();\n            thread.Join();\n\n            Assert.Same(_unnamedService, dataContext);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Container.Wpf.Shared/Fixtures/Mvvm/ViewModelLocatorFixture.cs",
    "content": "﻿using Prism.Container.Wpf.Mocks;\nusing Prism.Ioc;\nusing Prism.IocContainer.Wpf.Tests.Support.Mocks;\nusing Prism.IocContainer.Wpf.Tests.Support.Mocks.ViewModels;\nusing Prism.IocContainer.Wpf.Tests.Support.Mocks.Views;\nusing Prism.Mvvm;\nusing Xunit;\n\nnamespace Prism.Container.Wpf.Tests.Mvvm\n{\n    [Collection(nameof(ContainerExtension))]\n    public class ViewModelLocatorFixture\n    {\n        [StaFact]\n        public void ShouldLocateViewModelAndResolveWithContainer()\n        {\n            var bootstrapper = new MockBootstrapper();\n            bootstrapper.Run();\n\n            bootstrapper.ContainerRegistry.Register<IService, MockService>();\n\n            var view = new MockView();\n            Assert.Null(view.DataContext);\n\n            ViewModelLocator.SetAutoWireViewModel(view, true);\n            Assert.NotNull(view.DataContext);\n            Assert.IsType<MockViewModel>(view.DataContext);\n\n            Assert.NotNull(((MockViewModel)view.DataContext).MockService);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Container.Wpf.Shared/Fixtures/Regions/RegionNavigationContentLoaderFixture.cs",
    "content": "﻿using System.Linq;\nusing Prism.Ioc;\nusing Prism.IocContainer.Wpf.Tests.Support.Mocks.Views;\nusing Prism.Navigation.Regions;\nusing Xunit;\nusing static Prism.Container.Wpf.Tests.ContainerHelper;\n\nnamespace Prism.Container.Wpf.Tests.Regions\n{\n    [Collection(nameof(ContainerExtension))]\n    public class RegionNavigationContentLoaderFixture\n    {\n        readonly IContainerExtension _container;\n\n        public RegionNavigationContentLoaderFixture()\n        {\n            _container = CreateContainerExtension();\n            _container.RegisterInstance<IContainerExtension>(_container);\n            _container.Register<IRegionNavigationService, RegionNavigationService>();\n            _container.Register(typeof(IRegionNavigationContentLoader), typeof(RegionNavigationContentLoader));\n            _container.Register<IRegionNavigationJournal, RegionNavigationJournal>();\n            ContainerLocator.ResetContainer();\n            ContainerLocator.SetContainerExtension(_container);\n        }\n\n        [StaFact]\n        public void ShouldFindCandidateViewInRegion()\n        {\n            _container.RegisterForNavigation<MockView>();\n            //_container.RegisterType<object, MockView>(\"MockView\");\n\n            // We cannot access the UnityRegionNavigationContentLoader directly so we need to call its\n            // GetCandidatesFromRegion method through a navigation request.\n            IRegion testRegion = new Region();\n\n            MockView view = new MockView();\n            testRegion.Add(view);\n            testRegion.Deactivate(view);\n\n            Assert.True(((IContainerRegistry)_container).IsRegistered<object>(\"MockView\"));\n\n            testRegion.RequestNavigate(\"MockView\");\n\n            Assert.Contains(view, testRegion.Views);\n            Assert.Single(testRegion.Views);\n            Assert.Single(testRegion.ActiveViews);\n            Assert.Contains(view, testRegion.ActiveViews);\n        }\n\n        [StaFact]\n        public void ShouldFindCandidateViewWithFriendlyNameInRegion()\n        {\n            _container.RegisterForNavigation<MockView>(\"SomeView\");\n\n            // We cannot access the Container specific RegionNavigationContentLoader directly so we need to call its\n            // GetCandidatesFromRegion method through a navigation request.\n            IRegion testRegion = new Region();\n\n            var view = _container.Resolve<object>(\"SomeView\") as MockView;\n            testRegion.Add(view);\n            testRegion.Deactivate(view);\n\n            Assert.Empty(testRegion.ActiveViews);\n            testRegion.RequestNavigate(\"SomeView\");\n\n            Assert.Contains(view, testRegion.Views);\n            Assert.Single(testRegion.Views);\n            Assert.Single(testRegion.ActiveViews);\n            Assert.Contains(view, testRegion.ActiveViews);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Container.Wpf.Shared/Mocks/NullModuleCatalogBootstrapper.cs",
    "content": "﻿using System.Windows;\nusing Prism.Ioc;\nusing Prism.Modularity;\n\nnamespace Prism.Container.Wpf.Mocks\n{\n    internal partial class NullModuleCatalogBootstrapper\n    {\n        protected override IModuleCatalog CreateModuleCatalog()\n        {\n            return null;\n        }\n\n        protected override DependencyObject CreateShell()\n        {\n            return null;\n        }\n\n        protected override void RegisterTypes(IContainerRegistry containerRegistry)\n        {\n\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Container.Wpf.Shared/Prism.Container.Wpf.Shared.projitems",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <PropertyGroup>\n    <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>\n    <HasSharedItems>true</HasSharedItems>\n    <SharedGUID>bd42a7d6-a84d-4d27-9c28-7f6a2ec477f1</SharedGUID>\n  </PropertyGroup>\n  <PropertyGroup Label=\"Configuration\">\n    <Import_RootNamespace>Prism.Container.Wpf.Tests</Import_RootNamespace>\n  </PropertyGroup>\n  <ItemGroup>\n    <Compile Include=\"$(MSBuildThisFileDirectory)Fixtures\\Application\\PrismApplicationFixture.cs\" />\n    <Compile Include=\"$(MSBuildThisFileDirectory)Fixtures\\ContainerExtensionCollection.cs\" />\n    <Compile Include=\"$(MSBuildThisFileDirectory)Fixtures\\Bootstrapper\\BootstrapperFixture.cs\" />\n    <Compile Include=\"$(MSBuildThisFileDirectory)Fixtures\\Bootstrapper\\BootstrapperNullModuleCatalogFixture.cs\" />\n    <Compile Include=\"$(MSBuildThisFileDirectory)Fixtures\\Bootstrapper\\BootstrapperRunMethodFixture.cs\" />\n    <Compile Include=\"$(MSBuildThisFileDirectory)Fixtures\\Ioc\\ContainerExtensionFixture.cs\" />\n    <Compile Include=\"$(MSBuildThisFileDirectory)Fixtures\\Ioc\\ContainerProviderExtensionFixture.cs\" />\n    <Compile Include=\"$(MSBuildThisFileDirectory)Mocks\\NullModuleCatalogBootstrapper.cs\" />\n    <Compile Include=\"$(MSBuildThisFileDirectory)Fixtures\\Mvvm\\ViewModelLocatorFixture.cs\" />\n    <Compile Include=\"$(MSBuildThisFileDirectory)Fixtures\\Regions\\RegionNavigationContentLoaderFixture.cs\" />\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "tests/Wpf/Prism.Container.Wpf.Shared/Prism.Container.Wpf.Shared.shproj",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"15.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <PropertyGroup Label=\"Globals\">\n    <ProjectGuid>bd42a7d6-a84d-4d27-9c28-7f6a2ec477f1</ProjectGuid>\n    <MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>\n  </PropertyGroup>\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <Import Project=\"$(MSBuildExtensionsPath32)\\Microsoft\\VisualStudio\\v$(VisualStudioVersion)\\CodeSharing\\Microsoft.CodeSharing.Common.Default.props\" />\n  <Import Project=\"$(MSBuildExtensionsPath32)\\Microsoft\\VisualStudio\\v$(VisualStudioVersion)\\CodeSharing\\Microsoft.CodeSharing.Common.props\" />\n  <PropertyGroup />\n  <Import Project=\"Prism.Container.Wpf.Shared.projitems\" Label=\"Shared\" />\n  <Import Project=\"$(MSBuildExtensionsPath32)\\Microsoft\\VisualStudio\\v$(VisualStudioVersion)\\CodeSharing\\Microsoft.CodeSharing.CSharp.targets\" />\n</Project>\n"
  },
  {
    "path": "tests/Wpf/Prism.DryIoc.Wpf.Tests/ContainerHelper.cs",
    "content": "﻿using System;\nusing DryIoc;\nusing Prism.Container.DryIoc;\nusing Prism.Ioc;\n\nnamespace Prism.Container.Wpf.Tests\n{\n    public static class ContainerHelper\n    {\n        private static Rules CreateContainerRules() => Rules.Default.WithAutoConcreteTypeResolution()\n                                                                    .With(Made.Of(FactoryMethod.ConstructorWithResolvableArguments))\n                                                                    .WithDefaultIfAlreadyRegistered(IfAlreadyRegistered.Replace);\n\n        public static IContainer CreateContainer() =>\n            new global::DryIoc.Container(CreateContainerRules());\n\n        public static IContainerExtension CreateContainerExtension() =>\n        new DryIocContainerExtension(CreateContainer());\n\n        public static IContainer GetBaseContainer(this IContainerExtension container) =>\n            ((IContainerProvider)container).GetContainer();\n\n        public static IContainer GetBaseContainer(this IContainerProvider container) =>\n            container.GetContainer();\n\n        public static Type ContainerExtensionType => typeof(DryIocContainerExtension);\n\n        public static Type BaseContainerType => typeof(global::DryIoc.Container);\n\n        public static Type BaseContainerInterfaceType = typeof(IContainer);\n\n        public static Type RegisteredFrameworkException = typeof(ContainerException);\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.DryIoc.Wpf.Tests/ContainerResources.cs",
    "content": "﻿namespace Prism.Container.Wpf.Tests\n{\n    internal class ContainerResources : Prism.DryIoc.Properties.Resources\n    {\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.DryIoc.Wpf.Tests/Fixtures/BootstrapperRunMethodFixture.cs",
    "content": "using System;\nusing DryIoc;\nusing Moq;\nusing Prism.Container.DryIoc;\nusing Prism.Container.Wpf.Mocks;\nusing Prism.DryIoc;\nusing Prism.Events;\nusing Prism.Ioc;\nusing Prism.Modularity;\nusing Prism.Navigation.Regions;\nusing Xunit;\n\nnamespace Prism.Container.Wpf.Tests.Bootstrapper\n{\n    public partial class BootstrapperRunMethodFixture\n    {\n        [StaFact]\n        public void RunAddsCompositionContainerToContainer()\n        {\n            var bootstrapper = new MockBootstrapper();\n\n            var createdContainer = bootstrapper.CallCreateContainer();\n            var returnedContainer = createdContainer.Resolve<IContainer>();\n            Assert.NotNull(returnedContainer);\n            Assert.Equal(typeof(global::DryIoc.Container), returnedContainer.GetType());\n        }\n\n        [StaFact]\n        public void RunRegistersInstanceOfIModuleCatalog()\n        {\n            var mockedContainer = new Mock<IContainer>();\n            SetupMockedContainerForVerificationTests(mockedContainer);\n\n            var bootstrapper = new MockedContainerBootstrapper(mockedContainer.Object);\n\n            bootstrapper.Run();\n\n            mockedContainer.Verify(c => c.Register(It.IsAny<Factory>(), typeof(IModuleCatalog), It.IsAny<object>(), It.IsAny<IfAlreadyRegistered?>(), It.IsAny<bool>()));\n        }\n\n        [StaFact]\n        public void RunRegistersTypeForIModuleInitializer()\n        {\n            var mockedContainer = new Mock<IContainer>();\n            SetupMockedContainerForVerificationTests(mockedContainer);\n\n            var bootstrapper = new MockedContainerBootstrapper(mockedContainer.Object);\n\n            bootstrapper.Run();\n\n            mockedContainer.Verify(c => c.Register(It.IsAny<Factory>(), typeof(IModuleInitializer), null, It.IsAny<IfAlreadyRegistered?>(), It.IsAny<bool>()), Times.Once());\n        }\n\n        [StaFact]\n        public void RunRegistersTypeForIRegionManager()\n        {\n            var mockedContainer = new Mock<IContainer>();\n            SetupMockedContainerForVerificationTests(mockedContainer);\n\n            var bootstrapper = new MockedContainerBootstrapper(mockedContainer.Object);\n\n            bootstrapper.Run();\n\n            mockedContainer.Verify(c => c.Register(It.IsAny<Factory>(), typeof(IRegionManager), null, It.IsAny<IfAlreadyRegistered?>(), It.IsAny<bool>()), Times.Once());\n        }\n\n        [StaFact]\n        public void RunRegistersTypeForRegionAdapterMappings()\n        {\n            var mockedContainer = new Mock<IContainer>();\n            SetupMockedContainerForVerificationTests(mockedContainer);\n\n            var bootstrapper = new MockedContainerBootstrapper(mockedContainer.Object);\n\n            bootstrapper.Run();\n\n            mockedContainer.Verify(c => c.Register(It.IsAny<Factory>(), typeof(RegionAdapterMappings), null, It.IsAny<IfAlreadyRegistered?>(), It.IsAny<bool>()), Times.Once());\n        }\n\n        [StaFact]\n        public void RunRegistersTypeForIRegionViewRegistry()\n        {\n            var mockedContainer = new Mock<IContainer>();\n            SetupMockedContainerForVerificationTests(mockedContainer);\n\n            var bootstrapper = new MockedContainerBootstrapper(mockedContainer.Object);\n\n            bootstrapper.Run();\n\n            mockedContainer.Verify(c => c.Register(It.IsAny<Factory>(), typeof(IRegionViewRegistry), null, It.IsAny<IfAlreadyRegistered?>(), It.IsAny<bool>()), Times.Once());\n        }\n\n        [StaFact]\n        public void RunRegistersTypeForIRegionBehaviorFactory()\n        {\n            var mockedContainer = new Mock<IContainer>();\n            SetupMockedContainerForVerificationTests(mockedContainer);\n\n            var bootstrapper = new MockedContainerBootstrapper(mockedContainer.Object);\n\n            bootstrapper.Run();\n\n            mockedContainer.Verify(c => c.Register(It.IsAny<Factory>(), typeof(IRegionBehaviorFactory), null, It.IsAny<IfAlreadyRegistered?>(), It.IsAny<bool>()), Times.Once());\n        }\n\n        [StaFact]\n        public void RunRegistersTypeForIEventAggregator()\n        {\n            var mockedContainer = new Mock<IContainer>();\n            SetupMockedContainerForVerificationTests(mockedContainer);\n\n            var bootstrapper = new MockedContainerBootstrapper(mockedContainer.Object);\n\n            bootstrapper.Run();\n\n            mockedContainer.Verify(c => c.Register(It.IsAny<Factory>(), typeof(IEventAggregator), null, It.IsAny<IfAlreadyRegistered?>(), It.IsAny<bool>()), Times.Once());\n        }\n\n        [StaFact]\n        public void RunFalseShouldNotRegisterDefaultServicesAndTypes()\n        {\n            var mockedContainer = new Mock<IContainer>();\n            SetupMockedContainerForVerificationTests(mockedContainer);\n\n            var bootstrapper = new MockedContainerBootstrapper(mockedContainer.Object);\n            bootstrapper.Run(false);\n\n            mockedContainer.Verify(c => c.Register(It.IsAny<Factory>(), typeof(IEventAggregator), null, It.IsAny<IfAlreadyRegistered?>(), It.IsAny<bool>()), Times.Never());\n            mockedContainer.Verify(c => c.Register(It.IsAny<Factory>(), typeof(IRegionManager), null, It.IsAny<IfAlreadyRegistered?>(), It.IsAny<bool>()), Times.Never());\n            mockedContainer.Verify(c => c.Register(It.IsAny<Factory>(), typeof(RegionAdapterMappings), null, It.IsAny<IfAlreadyRegistered?>(), It.IsAny<bool>()), Times.Never());\n            mockedContainer.Verify(c => c.Register(It.IsAny<Factory>(), typeof(IModuleInitializer), null, It.IsAny<IfAlreadyRegistered?>(), It.IsAny<bool>()), Times.Never());\n        }\n\n        private static void SetupMockedContainerForVerificationTests(Mock<IContainer> mockedContainer)\n        {\n            var mockedModuleInitializer = new Mock<IModuleInitializer>();\n            var mockedModuleManager = new Mock<IModuleManager>();\n            var regionAdapterMappings = new RegionAdapterMappings();\n\n            var containerExtension = new DryIocContainerExtension(mockedContainer.Object);\n            var regionBehaviorFactory = new RegionBehaviorFactory(containerExtension);\n\n            mockedContainer.Setup(c => c.Register(It.IsAny<Factory>(), It.IsAny<Type>(), It.IsAny<string>(), It.IsAny<IfAlreadyRegistered?>(), It.IsAny<bool>()));\n\n            // NOTE: The actual method called by Prism's DryIocContainerExtension is off over the IResolver not IContainer\n            mockedContainer.As<IResolver>().Setup(r => r.Resolve(typeof(IModuleCatalog), It.IsAny<object>(), IfUnresolved.Throw, It.IsAny<Type>(), It.IsAny<Request>(), It.IsAny<object[]>())).Returns(\n                new ModuleCatalog());\n\n            mockedContainer.As<IResolver>().Setup(c => c.Resolve(typeof(IModuleInitializer), It.IsAny<object>(), IfUnresolved.Throw, It.IsAny<Type>(), It.IsAny<Request>(), It.IsAny<object[]>())).Returns(\n                mockedModuleInitializer.Object);\n\n            mockedContainer.As<IResolver>().Setup(c => c.Resolve(typeof(IModuleManager), It.IsAny<object>(), IfUnresolved.Throw, It.IsAny<Type>(), It.IsAny<Request>(), It.IsAny<object[]>())).Returns(\n                mockedModuleManager.Object);\n\n            mockedContainer.As<IResolver>().Setup(c => c.Resolve(typeof(RegionAdapterMappings), It.IsAny<object>(), IfUnresolved.Throw, It.IsAny<Type>(), It.IsAny<Request>(), It.IsAny<object[]>())).Returns(\n                regionAdapterMappings);\n\n            mockedContainer.As<IResolver>().Setup(c => c.Resolve(typeof(SelectorRegionAdapter), It.IsAny<object>(), IfUnresolved.Throw, It.IsAny<Type>(), It.IsAny<Request>(), It.IsAny<object[]>())).Returns(\n                new SelectorRegionAdapter(regionBehaviorFactory));\n\n            mockedContainer.As<IResolver>().Setup(c => c.Resolve(typeof(ItemsControlRegionAdapter), It.IsAny<object>(), IfUnresolved.Throw, It.IsAny<Type>(), It.IsAny<Request>(), It.IsAny<object[]>())).Returns(\n                new ItemsControlRegionAdapter(regionBehaviorFactory));\n\n            mockedContainer.As<IResolver>().Setup(c => c.Resolve(typeof(ContentControlRegionAdapter), It.IsAny<object>(), IfUnresolved.Throw, It.IsAny<Type>(), It.IsAny<Request>(), It.IsAny<object[]>())).Returns(\n                new ContentControlRegionAdapter(regionBehaviorFactory));\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.DryIoc.Wpf.Tests/Mocks/MockBootstrapper.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Reflection;\nusing System.Windows;\nusing System.Windows.Controls;\nusing DryIoc;\nusing Prism.Container.DryIoc;\nusing Prism.DryIoc;\nusing Prism.Ioc;\nusing Prism.Modularity;\nusing Prism.Navigation.Regions;\n\nnamespace Prism.Container.Wpf.Mocks\n{\n    internal class MockBootstrapper : PrismBootstrapper\n    {\n        public List<string> MethodCalls = new List<string>();\n        public bool InitializeModulesCalled;\n        public bool ConfigureRegionAdapterMappingsCalled;\n        public RegionAdapterMappings DefaultRegionAdapterMappings;\n        public bool CreateModuleCatalogCalled;\n        public bool RegisterRequiredTypesCalled;\n        public bool RegisterTypesCalled;\n        public bool CreateShellCalled;\n        public bool CreateContainerCalled;\n        public bool ConfigureModuleCatalogCalled;\n        public bool InitializeShellCalled;\n        public bool OnInitializeCalled;\n        public bool ConfigureViewModelLocatorCalled;\n        public bool ConfigureDefaultRegionBehaviorsCalled;\n        public UserControl ShellObject = new UserControl();\n\n        public DependencyObject BaseShell => base.Shell;\n\n        public IContainer BaseContainer\n        {\n            get => base.Container?.GetContainer();\n        }\n\n        public IContainerExtension ContainerExtension => (IContainerExtension)base.Container;\n\n        public IContainerRegistry ContainerRegistry => (IContainerRegistry)base.Container;\n\n        public IContainer CallCreateContainer()\n        {\n            var containerExt = this.CreateContainerExtension();\n            return ((IContainerExtension<IContainer>)containerExt).Instance;\n        }\n\n        protected override DependencyObject CreateShell()\n        {\n            this.MethodCalls.Add(MethodBase.GetCurrentMethod().Name);\n            this.CreateShellCalled = true;\n            return ShellObject;\n        }\n\n        protected override void RegisterRequiredTypes(IContainerRegistry containerRegistry)\n        {\n            this.MethodCalls.Add(MethodBase.GetCurrentMethod().Name);\n            this.RegisterRequiredTypesCalled = true;\n            base.RegisterRequiredTypes(containerRegistry);\n        }\n\n        protected override void RegisterTypes(IContainerRegistry containerRegistry)\n        {\n            this.MethodCalls.Add(MethodBase.GetCurrentMethod().Name);\n            this.RegisterTypesCalled = true;\n        }\n\n        protected override void Initialize()\n        {\n            ContainerLocator.ResetContainer();\n            base.Initialize();\n        }\n\n        protected override IContainerExtension CreateContainerExtension()\n        {\n            this.MethodCalls.Add(MethodBase.GetCurrentMethod().Name);\n            this.CreateContainerCalled = true;\n            return base.CreateContainerExtension();\n        }\n\n        protected override void ConfigureViewModelLocator()\n        {\n            this.MethodCalls.Add(MethodBase.GetCurrentMethod().Name);\n            this.ConfigureViewModelLocatorCalled = true;\n            base.ConfigureViewModelLocator();\n        }\n\n        protected override IModuleCatalog CreateModuleCatalog()\n        {\n            this.MethodCalls.Add(MethodBase.GetCurrentMethod().Name);\n            this.CreateModuleCatalogCalled = true;\n            return base.CreateModuleCatalog();\n        }\n\n        protected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog)\n        {\n            this.MethodCalls.Add(MethodBase.GetCurrentMethod().Name);\n            this.ConfigureModuleCatalogCalled = true;\n            base.ConfigureModuleCatalog(moduleCatalog);\n        }\n\n        protected override void InitializeShell(DependencyObject shell)\n        {\n            this.MethodCalls.Add(MethodBase.GetCurrentMethod().Name);\n            this.InitializeShellCalled = true;\n            base.InitializeShell(shell);\n        }\n\n        protected override void OnInitialized()\n        {\n            this.MethodCalls.Add(MethodBase.GetCurrentMethod().Name);\n            this.OnInitializeCalled = true;\n            base.OnInitialized();\n        }\n\n        protected override void InitializeModules()\n        {\n            this.MethodCalls.Add(MethodBase.GetCurrentMethod().Name);\n            this.InitializeModulesCalled = true;\n            base.InitializeModules();\n        }\n\n        protected override void ConfigureDefaultRegionBehaviors(IRegionBehaviorFactory regionBehaviors)\n        {\n            this.MethodCalls.Add(MethodBase.GetCurrentMethod().Name);\n            this.ConfigureDefaultRegionBehaviorsCalled = true;\n            base.ConfigureDefaultRegionBehaviors(regionBehaviors);\n        }\n\n        protected override void ConfigureRegionAdapterMappings(RegionAdapterMappings regionAdapterMappings)\n        {\n            this.MethodCalls.Add(MethodBase.GetCurrentMethod().Name);\n            ConfigureRegionAdapterMappingsCalled = true;\n\n            base.ConfigureRegionAdapterMappings(regionAdapterMappings);\n\n            DefaultRegionAdapterMappings = regionAdapterMappings;\n        }\n\n        protected override void RegisterFrameworkExceptionTypes()\n        {\n            this.MethodCalls.Add(MethodBase.GetCurrentMethod().Name);\n            base.RegisterFrameworkExceptionTypes();\n        }\n\n        public void CallRegisterFrameworkExceptionTypes()\n        {\n            base.RegisterFrameworkExceptionTypes();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.DryIoc.Wpf.Tests/Mocks/MockedContainerBootstrapper.cs",
    "content": "﻿using System.Windows;\nusing System.Windows.Controls;\nusing DryIoc;\nusing Prism.Container.DryIoc;\nusing Prism.DryIoc;\nusing Prism.Ioc;\n\nnamespace Prism.Container.Wpf.Mocks\n{\n    internal class MockedContainerBootstrapper : PrismBootstrapper\n    {\n        private readonly IContainer _container;\n\n        public MockedContainerBootstrapper(IContainer container)\n        {\n            ContainerLocator.ResetContainer();\n            this._container = container;\n        }\n\n        bool _useDefaultConfiguration = true;\n\n        public void Run(bool useDefaultConfiguration)\n        {\n            _useDefaultConfiguration = useDefaultConfiguration;\n\n            base.Run();\n        }\n\n        protected override IContainerExtension CreateContainerExtension()\n        {\n            return new DryIocContainerExtension(_container);\n        }\n\n        protected override DependencyObject CreateShell()\n        {\n            return new UserControl();\n        }\n\n        protected override void InitializeShell(DependencyObject shell)\n        {\n\n        }\n\n        protected override void RegisterTypes(IContainerRegistry containerRegistry)\n        {\n\n        }\n\n        protected override void RegisterRequiredTypes(IContainerRegistry containerRegistry)\n        {\n            if (_useDefaultConfiguration)\n                base.RegisterRequiredTypes(containerRegistry);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.DryIoc.Wpf.Tests/Mocks/NullLoggerBootstrapper.cs",
    "content": "﻿using System.Windows;\nusing Prism.DryIoc;\nusing Prism.Ioc;\n\nnamespace Prism.Container.Wpf.Mocks\n{\n    internal partial class NullLoggerBootstrapper : PrismBootstrapper\n    {\n        protected override void RegisterTypes(IContainerRegistry containerRegistry)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        protected override DependencyObject CreateShell()\n        {\n            throw new System.NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.DryIoc.Wpf.Tests/Mocks/NullModuleCatalogBootstrapper.cs",
    "content": "﻿using Prism.DryIoc;\n\nnamespace Prism.Container.Wpf.Mocks\n{\n    internal partial class NullModuleCatalogBootstrapper : PrismBootstrapper\n    {\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.DryIoc.Wpf.Tests/Prism.DryIoc.Wpf.Tests.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project Sdk=\"Microsoft.NET.Sdk.WindowsDesktop\">\n\n  <PropertyGroup>\n    <TargetFramework>net472</TargetFramework>\n    <IsPackable>false</IsPackable>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"coverlet.collector\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"GitHubActionsTestLogger\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"Microsoft.NET.Test.Sdk\" />\n    <PackageReference Include=\"Moq\" />\n    <PackageReference Include=\"xunit\" />\n    <PackageReference Include=\"xunit.runner.visualstudio\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"Xunit.StaFact\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\..\\src\\Wpf\\Prism.DryIoc.Wpf\\Prism.DryIoc.Wpf.csproj\" />\n    <ProjectReference Include=\"..\\Prism.IocContainer.Wpf.Tests.Support\\Prism.IocContainer.Wpf.Tests.Support.csproj\" />\n  </ItemGroup>\n\n  <Import Project=\"..\\Prism.Container.Wpf.Shared\\Prism.Container.Wpf.Shared.projitems\" Label=\"Shared\" />\n\n</Project>\n"
  },
  {
    "path": "tests/Wpf/Prism.IocContainer.Wpf.Tests.Support/BootstrapperFixtureBase.cs",
    "content": "using System;\nusing Xunit;\n\nnamespace Prism.IocContainer.Wpf.Tests.Support\n{\n    public class BootstrapperFixtureBase\n    {\n        protected static void AssertExceptionThrownOnRun(PrismBootstrapperBase bootstrapper, Type expectedExceptionType, string expectedExceptionMessageSubstring)\n        {\n            bool exceptionThrown = false;\n            try\n            {\n                bootstrapper.Run();\n            }\n            catch (Exception ex)\n            {\n                Assert.Equal(expectedExceptionType, ex.GetType());\n                Assert.Contains(expectedExceptionMessageSubstring, ex.Message);\n                exceptionThrown = true;\n            }\n\n            if (!exceptionThrown)\n            {\n                //Assert.Fail(\"Exception not thrown.\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.IocContainer.Wpf.Tests.Support/Mocks/DependantA.cs",
    "content": "namespace Prism.IocContainer.Wpf.Tests.Support.Mocks\n{\n    public class DependantA : IDependantA\n    {\n        public DependantA(IDependantB dependantB)\n        {\n            MyDependantB = dependantB;\n        }\n\n        public IDependantB MyDependantB { get; set; }\n    }\n\n    public interface IDependantA\n    {\n        IDependantB MyDependantB { get; }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.IocContainer.Wpf.Tests.Support/Mocks/DependantB.cs",
    "content": "namespace Prism.IocContainer.Wpf.Tests.Support.Mocks\n{\n    public class DependantB : IDependantB\n    {\n        public DependantB(IService service)\n        {\n            MyService = service;\n        }\n\n        public IService MyService { get; set; }\n    }\n\n    public interface IDependantB\n    {\n        IService MyService { get; }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.IocContainer.Wpf.Tests.Support/Mocks/MockModuleLoader.cs",
    "content": "using Prism.Modularity;\n\nnamespace Prism.IocContainer.Wpf.Tests.Support.Mocks\n{\n    public class MockModuleInitializer : IModuleInitializer\n    {\n        public bool LoadCalled;\n\n        public void Initialize(IModuleInfo moduleInfo)\n        {\n            LoadCalled = true;\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.IocContainer.Wpf.Tests.Support/Mocks/MockRegionManager.cs",
    "content": "using System;\nusing Prism.Ioc;\nusing Prism.Navigation;\nusing Prism.Navigation.Regions;\n\nnamespace Prism.IocContainer.Wpf.Tests.Support.Mocks\n{\n    public class MockRegionManager : IRegionManager\n    {\n        #region IRegionManager Members\n\n        public IRegionCollection Regions\n        {\n            get { throw new NotImplementedException(); }\n        }\n\n        public IRegionManager CreateRegionManager()\n        {\n            throw new NotImplementedException();\n        }\n\n        public IRegionManager AddToRegion(string regionName, object view)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IRegionManager RegisterViewWithRegion(string regionName, Type viewType)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IRegionManager RegisterViewWithRegion(string regionName, Func<object> getContentDelegate)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RequestNavigate(string regionName, Uri source, Action<NavigationResult> navigationCallback)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RequestNavigate(string regionName, Uri source)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RequestNavigate(string regionName, string source, Action<NavigationResult> navigationCallback)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RequestNavigate(string regionName, string source)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RequestNavigate(string regionName, Uri target, Action<NavigationResult> navigationCallback, INavigationParameters navigationParameters)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RequestNavigate(string regionName, string target, Action<NavigationResult> navigationCallback, INavigationParameters navigationParameters)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RequestNavigate(string regionName, Uri target, INavigationParameters navigationParameters)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RequestNavigate(string regionName, string target, INavigationParameters navigationParameters)\n        {\n            throw new NotImplementedException();\n        }\n\n        #endregion\n\n        public bool Navigate(Uri source)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IRegionManager AddToRegion(string regionName, string viewName)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IRegionManager RegisterViewWithRegion(string regionName, string viewName)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IRegionManager RegisterViewWithRegion(string regionName, Func<IContainerProvider, object> getContentDelegate)\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.IocContainer.Wpf.Tests.Support/Mocks/MockService.cs",
    "content": "namespace Prism.IocContainer.Wpf.Tests.Support.Mocks\n{\n    public class MockService : IService\n    {\n    }\n\n    public interface IService { }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.IocContainer.Wpf.Tests.Support/Mocks/ViewModels/MockViewModel.cs",
    "content": "﻿using Prism.Mvvm;\n\nnamespace Prism.IocContainer.Wpf.Tests.Support.Mocks.ViewModels\n{\n    public class MockViewModel : BindableBase\n    {\n        private IService _mockService;\n        public IService MockService\n        {\n            get { return _mockService; }\n            set { SetProperty(ref _mockService, value); }\n        }\n\n        public MockViewModel(IService mockService)\n        {\n            _mockService = mockService;\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.IocContainer.Wpf.Tests.Support/Mocks/Views/MockView.cs",
    "content": "﻿using System.Windows;\n\nnamespace Prism.IocContainer.Wpf.Tests.Support.Mocks.Views\n{\n    public class MockView : FrameworkElement\n    {\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.IocContainer.Wpf.Tests.Support/Prism.IocContainer.Wpf.Tests.Support.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project Sdk=\"Microsoft.NET.Sdk.WindowsDesktop\">\n\n  <PropertyGroup>\n    <TargetFramework>net472</TargetFramework>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"coverlet.collector\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"GitHubActionsTestLogger\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"xunit\" />\n    <PackageReference Include=\"xunit.runner.visualstudio\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>\n    </PackageReference>\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\..\\src\\Wpf\\Prism.Wpf\\Prism.Wpf.csproj\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "tests/Wpf/Prism.Unity.Wpf.Tests/ContainerHelper.cs",
    "content": "﻿using System;\nusing Prism.Container.Unity;\nusing Prism.Ioc;\nusing Unity;\n\nnamespace Prism.Container.Wpf.Tests\n{\n    public static class ContainerHelper\n    {\n        public static IUnityContainer CreateContainer() =>\n            new UnityContainer();\n\n        public static IContainerExtension CreateContainerExtension() =>\n            new UnityContainerExtension(CreateContainer());\n\n        public static IUnityContainer GetBaseContainer(this IContainerExtension container) =>\n            ((IContainerProvider)container).GetContainer();\n\n        public static IUnityContainer GetBaseContainer(this IContainerProvider container) =>\n            container.GetContainer();\n\n        public static Type ContainerExtensionType => typeof(UnityContainerExtension);\n\n        public static Type BaseContainerType => typeof(UnityContainer);\n\n        public static Type BaseContainerInterfaceType = typeof(IUnityContainer);\n\n        public static Type RegisteredFrameworkException = typeof(ResolutionFailedException);\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Unity.Wpf.Tests/ContainerResources.cs",
    "content": "﻿namespace Prism.Container.Wpf.Tests\n{\n    internal class ContainerResources : Prism.Unity.Properties.Resources\n    {\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Unity.Wpf.Tests/Fixtures/BootstrapperRunMethodFixture.cs",
    "content": "﻿using System;\nusing Moq;\nusing Prism.Container.Unity;\nusing Prism.Container.Wpf.Mocks;\nusing Prism.Events;\nusing Prism.Ioc;\nusing Prism.Modularity;\nusing Prism.Navigation.Regions;\nusing Unity;\nusing Unity.Lifetime;\nusing Xunit;\n\nnamespace Prism.Container.Wpf.Tests.Bootstrapper\n{\n    public partial class BootstrapperRunMethodFixture\n    {\n        [StaFact]\n        public void RunAddsCompositionContainerToContainer()\n        {\n            var bootstrapper = new MockBootstrapper();\n\n            var createdContainer = bootstrapper.CallCreateContainer();\n            var returnedContainer = createdContainer.Resolve<IUnityContainer>();\n            Assert.NotNull(returnedContainer);\n            Assert.Equal(typeof(UnityContainer), returnedContainer.GetType());\n        }\n\n        [StaFact]\n        public void RunRegistersInstanceOfIModuleCatalog()\n        {\n            var mockedContainer = new Mock<IUnityContainer>();\n            SetupMockedContainerForVerificationTests(mockedContainer);\n\n            var bootstrapper = new MockedContainerBootstrapper(mockedContainer.Object);\n\n            bootstrapper.Run();\n\n            mockedContainer.Verify(c => c.RegisterInstance(typeof(IModuleCatalog), null, It.IsAny<object>(), It.IsAny<IInstanceLifetimeManager>()), Times.Once());\n        }\n\n        [StaFact]\n        public void RunRegistersTypeForIModuleInitializer()\n        {\n            var mockedContainer = new Mock<IUnityContainer>();\n            SetupMockedContainerForVerificationTests(mockedContainer);\n\n            var bootstrapper = new MockedContainerBootstrapper(mockedContainer.Object);\n\n            bootstrapper.Run();\n\n            mockedContainer.Verify(c => c.RegisterType(typeof(IModuleInitializer), It.IsAny<Type>(), null, It.IsAny<ITypeLifetimeManager>()), Times.Once());\n        }\n\n        [StaFact]\n        public void RunRegistersTypeForIRegionManager()\n        {\n            var mockedContainer = new Mock<IUnityContainer>();\n            SetupMockedContainerForVerificationTests(mockedContainer);\n\n            var bootstrapper = new MockedContainerBootstrapper(mockedContainer.Object);\n\n            bootstrapper.Run();\n\n            mockedContainer.Verify(c => c.RegisterType(typeof(IRegionManager), It.IsAny<Type>(), null, It.IsAny<ITypeLifetimeManager>()), Times.Once());\n        }\n\n        [StaFact]\n        public void RunRegistersTypeForRegionAdapterMappings()\n        {\n            var mockedContainer = new Mock<IUnityContainer>();\n            SetupMockedContainerForVerificationTests(mockedContainer);\n\n            var bootstrapper = new MockedContainerBootstrapper(mockedContainer.Object);\n\n            bootstrapper.Run();\n\n            mockedContainer.Verify(c => c.RegisterType(typeof(RegionAdapterMappings), It.IsAny<Type>(), null, It.IsAny<ITypeLifetimeManager>()), Times.Once());\n        }\n\n        [StaFact]\n        public void RunRegistersTypeForIRegionViewRegistry()\n        {\n            var mockedContainer = new Mock<IUnityContainer>();\n            SetupMockedContainerForVerificationTests(mockedContainer);\n\n            var bootstrapper = new MockedContainerBootstrapper(mockedContainer.Object);\n\n            bootstrapper.Run();\n\n            mockedContainer.Verify(c => c.RegisterType(typeof(IRegionViewRegistry), It.IsAny<Type>(), null, It.IsAny<ITypeLifetimeManager>()), Times.Once());\n        }\n\n        [StaFact]\n        public void RunRegistersTypeForIRegionBehaviorFactory()\n        {\n            var mockedContainer = new Mock<IUnityContainer>();\n            SetupMockedContainerForVerificationTests(mockedContainer);\n\n            var bootstrapper = new MockedContainerBootstrapper(mockedContainer.Object);\n\n            bootstrapper.Run();\n\n            mockedContainer.Verify(c => c.RegisterType(typeof(IRegionBehaviorFactory), It.IsAny<Type>(), null, It.IsAny<ITypeLifetimeManager>()), Times.Once());\n        }\n\n        [StaFact]\n        public void RunRegistersTypeForIEventAggregator()\n        {\n            var mockedContainer = new Mock<IUnityContainer>();\n            SetupMockedContainerForVerificationTests(mockedContainer);\n\n            var bootstrapper = new MockedContainerBootstrapper(mockedContainer.Object);\n\n            bootstrapper.Run();\n\n            mockedContainer.Verify(c => c.RegisterType(typeof(IEventAggregator), It.IsAny<Type>(), null, It.IsAny<ITypeLifetimeManager>()), Times.Once());\n        }\n\n        [StaFact]\n        public void RunFalseShouldNotRegisterDefaultServicesAndTypes()\n        {\n            var mockedContainer = new Mock<IUnityContainer>();\n            SetupMockedContainerForVerificationTests(mockedContainer);\n\n            var bootstrapper = new MockedContainerBootstrapper(mockedContainer.Object);\n            bootstrapper.Run(false);\n\n            mockedContainer.Verify(c => c.RegisterType(typeof(IEventAggregator), It.IsAny<Type>(), null, It.IsAny<ITypeLifetimeManager>()), Times.Never());\n            mockedContainer.Verify(c => c.RegisterType(typeof(IRegionManager), It.IsAny<Type>(), null, It.IsAny<ITypeLifetimeManager>()), Times.Never());\n            mockedContainer.Verify(c => c.RegisterType(typeof(RegionAdapterMappings), It.IsAny<Type>(), null, It.IsAny<ITypeLifetimeManager>()), Times.Never());\n            mockedContainer.Verify(c => c.RegisterType(typeof(IModuleInitializer), It.IsAny<Type>(), null, It.IsAny<ITypeLifetimeManager>()), Times.Never());\n        }\n\n        private static void SetupMockedContainerForVerificationTests(Mock<IUnityContainer> mockedContainer)\n        {\n            var mockedModuleInitializer = new Mock<IModuleInitializer>();\n            var mockedModuleManager = new Mock<IModuleManager>();\n            var regionAdapterMappings = new RegionAdapterMappings();\n\n            var containerExtension = new UnityContainerExtension(mockedContainer.Object);\n            var regionBehaviorFactory = new RegionBehaviorFactory(containerExtension);\n\n            mockedContainer.Setup(c => c.RegisterInstance(It.IsAny<Type>(), It.IsAny<string>(), It.IsAny<object>(), It.IsAny<IInstanceLifetimeManager>()));\n\n            mockedContainer.Setup(c => c.Resolve(typeof(IModuleCatalog), (string)null)).Returns(\n                new ModuleCatalog());\n\n            mockedContainer.Setup(c => c.Resolve(typeof(IModuleInitializer), (string)null)).Returns(\n                mockedModuleInitializer.Object);\n\n            mockedContainer.Setup(c => c.Resolve(typeof(IModuleManager), (string)null)).Returns(\n                mockedModuleManager.Object);\n\n            mockedContainer.Setup(c => c.Resolve(typeof(RegionAdapterMappings), (string)null)).Returns(\n                regionAdapterMappings);\n\n            mockedContainer.Setup(c => c.Resolve(typeof(SelectorRegionAdapter), (string)null)).Returns(\n                new SelectorRegionAdapter(regionBehaviorFactory));\n\n            mockedContainer.Setup(c => c.Resolve(typeof(ItemsControlRegionAdapter), (string)null)).Returns(\n                new ItemsControlRegionAdapter(regionBehaviorFactory));\n\n            mockedContainer.Setup(c => c.Resolve(typeof(ContentControlRegionAdapter), (string)null)).Returns(\n                new ContentControlRegionAdapter(regionBehaviorFactory));\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Unity.Wpf.Tests/Mocks/MockBootstrapper.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Reflection;\nusing System.Windows;\nusing System.Windows.Controls;\nusing Prism.Container.Unity;\nusing Prism.Ioc;\nusing Prism.Modularity;\nusing Prism.Navigation.Regions;\nusing Prism.Unity;\nusing Unity;\n\nnamespace Prism.Container.Wpf.Mocks\n{\n    internal class MockBootstrapper : PrismBootstrapper\n    {\n        public List<string> MethodCalls = new List<string>();\n        public bool InitializeModulesCalled;\n        public bool ConfigureRegionAdapterMappingsCalled;\n        public RegionAdapterMappings DefaultRegionAdapterMappings;\n        public bool CreateModuleCatalogCalled;\n        public bool RegisterRequiredTypesCalled;\n        public bool RegisterTypesCalled;\n        public bool CreateShellCalled;\n        public bool CreateContainerCalled;\n        public bool ConfigureModuleCatalogCalled;\n        public bool InitializeShellCalled;\n        public bool OnInitializeCalled;\n        public bool ConfigureViewModelLocatorCalled;\n        public bool ConfigureDefaultRegionBehaviorsCalled;\n        public UserControl ShellObject = new UserControl();\n\n        public DependencyObject BaseShell => base.Shell;\n\n        public IUnityContainer BaseContainer\n        {\n            get => base.Container?.GetContainer();\n        }\n\n        public IContainerExtension ContainerExtension => (IContainerExtension)base.Container;\n\n        public IContainerRegistry ContainerRegistry => (IContainerRegistry)base.Container;\n\n        public IUnityContainer CallCreateContainer()\n        {\n            var containerExt = this.CreateContainerExtension();\n            return ((IContainerExtension<IUnityContainer>)containerExt).Instance;\n        }\n\n        protected override DependencyObject CreateShell()\n        {\n            this.MethodCalls.Add(MethodBase.GetCurrentMethod().Name);\n            this.CreateShellCalled = true;\n            return ShellObject;\n        }\n\n        protected override void RegisterRequiredTypes(IContainerRegistry containerRegistry)\n        {\n            this.MethodCalls.Add(MethodBase.GetCurrentMethod().Name);\n            this.RegisterRequiredTypesCalled = true;\n            base.RegisterRequiredTypes(containerRegistry);\n        }\n\n        protected override void RegisterTypes(IContainerRegistry containerRegistry)\n        {\n            this.MethodCalls.Add(MethodBase.GetCurrentMethod().Name);\n            this.RegisterTypesCalled = true;\n        }\n\n        protected override void Initialize()\n        {\n            ContainerLocator.ResetContainer();\n            base.Initialize();\n        }\n\n        protected override IContainerExtension CreateContainerExtension()\n        {\n            this.MethodCalls.Add(MethodBase.GetCurrentMethod().Name);\n            this.CreateContainerCalled = true;\n            return base.CreateContainerExtension();\n        }\n\n        protected override void ConfigureViewModelLocator()\n        {\n            this.MethodCalls.Add(MethodBase.GetCurrentMethod().Name);\n            this.ConfigureViewModelLocatorCalled = true;\n            base.ConfigureViewModelLocator();\n        }\n\n        protected override IModuleCatalog CreateModuleCatalog()\n        {\n            this.MethodCalls.Add(MethodBase.GetCurrentMethod().Name);\n            this.CreateModuleCatalogCalled = true;\n            return base.CreateModuleCatalog();\n        }\n\n        protected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog)\n        {\n            this.MethodCalls.Add(MethodBase.GetCurrentMethod().Name);\n            this.ConfigureModuleCatalogCalled = true;\n            base.ConfigureModuleCatalog(moduleCatalog);\n        }\n\n        protected override void InitializeShell(DependencyObject shell)\n        {\n            this.MethodCalls.Add(MethodBase.GetCurrentMethod().Name);\n            this.InitializeShellCalled = true;\n            base.InitializeShell(shell);\n        }\n\n        protected override void OnInitialized()\n        {\n            this.MethodCalls.Add(MethodBase.GetCurrentMethod().Name);\n            this.OnInitializeCalled = true;\n            base.OnInitialized();\n        }\n\n        protected override void InitializeModules()\n        {\n            this.MethodCalls.Add(MethodBase.GetCurrentMethod().Name);\n            this.InitializeModulesCalled = true;\n            base.InitializeModules();\n        }\n\n        protected override void ConfigureDefaultRegionBehaviors(IRegionBehaviorFactory regionBehaviors)\n        {\n            this.MethodCalls.Add(MethodBase.GetCurrentMethod().Name);\n            this.ConfigureDefaultRegionBehaviorsCalled = true;\n            base.ConfigureDefaultRegionBehaviors(regionBehaviors);\n        }\n\n        protected override void ConfigureRegionAdapterMappings(RegionAdapterMappings regionAdapterMappings)\n        {\n            this.MethodCalls.Add(MethodBase.GetCurrentMethod().Name);\n            ConfigureRegionAdapterMappingsCalled = true;\n\n            base.ConfigureRegionAdapterMappings(regionAdapterMappings);\n\n            DefaultRegionAdapterMappings = regionAdapterMappings;\n        }\n\n        protected override void RegisterFrameworkExceptionTypes()\n        {\n            this.MethodCalls.Add(MethodBase.GetCurrentMethod().Name);\n            base.RegisterFrameworkExceptionTypes();\n        }\n\n        public void CallRegisterFrameworkExceptionTypes()\n        {\n            base.RegisterFrameworkExceptionTypes();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Unity.Wpf.Tests/Mocks/MockedContainerBootstrapper.cs",
    "content": "﻿using System.Windows;\nusing System.Windows.Controls;\nusing Prism.Container.Unity;\nusing Prism.Ioc;\nusing Prism.Unity;\nusing Unity;\n\nnamespace Prism.Container.Wpf.Mocks\n{\n    internal class MockedContainerBootstrapper : PrismBootstrapper\n    {\n        private readonly IUnityContainer _container;\n\n        public MockedContainerBootstrapper(IUnityContainer container)\n        {\n            ContainerLocator.ResetContainer();\n            this._container = container;\n        }\n\n        bool _useDefaultConfiguration = true;\n\n        public void Run(bool useDefaultConfiguration)\n        {\n            _useDefaultConfiguration = useDefaultConfiguration;\n\n            base.Run();\n        }\n\n        protected override IContainerExtension CreateContainerExtension()\n        {\n            return new UnityContainerExtension(_container);\n        }\n\n        protected override DependencyObject CreateShell()\n        {\n            return new UserControl();\n        }\n\n        protected override void InitializeShell(DependencyObject shell)\n        {\n\n        }\n\n        protected override void RegisterTypes(IContainerRegistry containerRegistry)\n        {\n\n        }\n\n        protected override void RegisterRequiredTypes(IContainerRegistry containerRegistry)\n        {\n            if (_useDefaultConfiguration)\n                base.RegisterRequiredTypes(containerRegistry);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Unity.Wpf.Tests/Mocks/NullLoggerBootstrapper.cs",
    "content": "﻿using System.Windows;\nusing Prism.Ioc;\nusing Prism.Unity;\n\nnamespace Prism.Container.Wpf.Mocks\n{\n    internal partial class NullLoggerBootstrapper : PrismBootstrapper\n    {\n        protected override void RegisterTypes(IContainerRegistry containerRegistry)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        protected override DependencyObject CreateShell()\n        {\n            throw new System.NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Unity.Wpf.Tests/Mocks/NullModuleCatalogBootstrapper.cs",
    "content": "﻿using Prism.Unity;\n\nnamespace Prism.Container.Wpf.Mocks\n{\n    internal partial class NullModuleCatalogBootstrapper : PrismBootstrapper\n    {\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Unity.Wpf.Tests/Prism.Unity.Wpf.Tests.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project Sdk=\"Microsoft.NET.Sdk.WindowsDesktop\">\n\n  <PropertyGroup>\n    <TargetFramework>net472</TargetFramework>\n    <IsPackable>false</IsPackable>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"coverlet.collector\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"GitHubActionsTestLogger\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"Microsoft.NET.Test.Sdk\" />\n    <PackageReference Include=\"Moq\" />\n    <PackageReference Include=\"xunit\" />\n    <PackageReference Include=\"xunit.runner.visualstudio\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"Xunit.StaFact\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\..\\src\\Wpf\\Prism.Unity.Wpf\\Prism.Unity.Wpf.csproj\" />\n    <ProjectReference Include=\"..\\Prism.IocContainer.Wpf.Tests.Support\\Prism.IocContainer.Wpf.Tests.Support.csproj\" />\n  </ItemGroup>\n\n  <Import Project=\"..\\Prism.Container.Wpf.Shared\\Prism.Container.Wpf.Shared.projitems\" Label=\"Shared\" />\n\n</Project>\n"
  },
  {
    "path": "tests/Wpf/Prism.Unity.Wpf.Tests/app.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <runtime>\n    <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n      <dependentAssembly>\n        <assemblyIdentity name=\"Microsoft.Practices.ServiceLocation\" publicKeyToken=\"31bf3856ad364e35\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-1.3.0.0\" newVersion=\"1.3.0.0\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"Castle.Core\" publicKeyToken=\"407dd0808d44fbdc\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.0.0.0\" newVersion=\"4.0.0.0\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"CommonServiceLocator\" publicKeyToken=\"489b6accfaf20ef0\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-2.0.2.0\" newVersion=\"2.0.2.0\" />\n      </dependentAssembly>\n    </assemblyBinding>\n  </runtime>\n</configuration>"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/App.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <configSections>\n    <section name=\"modules\" type=\"Prism.Modularity.ModulesConfigurationSection, Prism.Wpf\"></section>\n  </configSections>\n  <modules>\n    <module assemblyFile=\".\\MocksModules\\MockModuleA.dll\" moduleType=\"Prism.Wpf.Tests.Mocks.Modules.MockModuleA\" moduleName=\"MockModuleA\" />\n  </modules>\n  <startup>\n    <supportedRuntime version=\"v4.0\" sku=\".NETFramework,Version=v4.5\" />\n  </startup>\n  <runtime>\n    <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n      <dependentAssembly>\n        <assemblyIdentity name=\"Microsoft.Practices.ServiceLocation\" publicKeyToken=\"31bf3856ad364e35\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-1.3.0.0\" newVersion=\"1.3.0.0\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"Castle.Core\" publicKeyToken=\"407dd0808d44fbdc\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.0.0.0\" newVersion=\"4.0.0.0\" />\n      </dependentAssembly>\n    </assemblyBinding>\n  </runtime>\n</configuration>\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/CollectionChangedTracker.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Collections.Specialized;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Prism.Wpf.Tests\n{\n    public class CollectionChangedTracker\n    {\n        private readonly List<NotifyCollectionChangedEventArgs> eventList = new List<NotifyCollectionChangedEventArgs>();\n\n        public CollectionChangedTracker(INotifyCollectionChanged collection)\n        {\n            collection.CollectionChanged += OnCollectionChanged;\n        }\n\n        public IEnumerable<NotifyCollectionChangedAction> ActionsFired { get { return this.eventList.Select(e => e.Action); } }\n        public IEnumerable<NotifyCollectionChangedEventArgs> NotifyEvents { get { return this.eventList; } }\n\n        private void OnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)\n        {\n            this.eventList.Add(e);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/CollectionExtensionsFixture.cs",
    "content": "\n\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests\n{\n\n    public class CollectionExtensionsFixture\n    {\n        [Fact]\n        public void CanAddRangeToCollection()\n        {\n            Collection<object> col = new Collection<object>();\n            List<object> itemsToAdd = new List<object> { \"1\", \"2\" };\n\n            col.AddRange(itemsToAdd);\n\n            Assert.Equal(2, col.Count);\n            Assert.Equal(\"1\", col[0]);\n            Assert.Equal(\"2\", col[1]);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/CompilerHelper.Desktop.cs",
    "content": "\n\nusing System;\nusing System.CodeDom.Compiler;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Reflection;\nusing System.Text;\nusing Microsoft.CSharp;\nusing Prism.Ioc;\nusing Prism.Modularity;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests\n{\n    public class CompilerHelper\n    {\n        private static string moduleTemplate =\n            @\"using System;\n            using Prism.Ioc;\n            using Prism.Modularity;\n\n            namespace TestModules\n            {\n                #module#\n\t            public class #className#Class : IModule\n\t            {\n                    public void OnInitialized(IContainerProvider containerProvider)\n                    {\n                        Console.WriteLine(\"\"#className#.Start\"\");\n                    }\n\n                    public void RegisterTypes(IContainerRegistry containerRegistry)\n                    {\n                        \n                    }\n                }\n            }\";\n\n        public static Assembly CompileFileAndLoadAssembly(string input, string output, params string[] references)\n        {\n            return CompileFile(input, output, references).CompiledAssembly;\n        }\n\n        public static CompilerResults CompileFile(string input, string output, params string[] references)\n        {\n            CreateOutput(output);\n\n            List<string> referencedAssemblies = new List<string>(references.Length + 3);\n\n            referencedAssemblies.AddRange(references);\n            referencedAssemblies.Add(\"System.dll\");\n            referencedAssemblies.Add(typeof(IContainerRegistry).Assembly.CodeBase.Replace(@\"file:///\", \"\"));\n            referencedAssemblies.Add(typeof(IModule).Assembly.CodeBase.Replace(@\"file:///\", \"\"));\n            referencedAssemblies.Add(typeof(ModuleAttribute).Assembly.CodeBase.Replace(@\"file:///\", \"\"));\n\n            CSharpCodeProvider codeProvider = new CSharpCodeProvider();\n            CompilerParameters cp = new CompilerParameters(referencedAssemblies.ToArray(), output);\n\n            using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(input))\n            {\n                if (stream == null)\n                {\n                    throw new ArgumentException(\"input\");\n                }\n\n                StreamReader reader = new StreamReader(stream);\n                string source = reader.ReadToEnd();\n                CompilerResults results = codeProvider.CompileAssemblyFromSource(cp, source);\n                ThrowIfCompilerError(results);\n                return results;\n            }\n        }\n\n        public static void CreateOutput(string output)\n        {\n            string dir = Path.GetDirectoryName(output);\n            if (!Directory.Exists(dir))\n            {\n                Directory.CreateDirectory(dir);\n            }\n            else\n            {\n                //Delete the file if exists\n                if (File.Exists(output))\n                {\n                    try\n                    {\n                        File.Delete(output);\n                    }\n                    catch (UnauthorizedAccessException)\n                    {\n                        //The file might be locked by Visual Studio, so rename it\n                        if (File.Exists(output + \".locked\"))\n                            File.Delete(output + \".locked\");\n                        File.Move(output, output + \".locked\");\n                    }\n                }\n            }\n        }\n\n        public static CompilerResults CompileCode(string code, string output)\n        {\n            CreateOutput(output);\n            List<string> referencedAssemblies = new List<string>();\n            referencedAssemblies.Add(\"System.dll\");\n            referencedAssemblies.Add(typeof(IContainerExtension).Assembly.CodeBase.Replace(@\"file:///\", \"\"));\n            referencedAssemblies.Add(typeof(IModule).Assembly.CodeBase.Replace(@\"file:///\", \"\"));\n            referencedAssemblies.Add(typeof(ModuleAttribute).Assembly.CodeBase.Replace(@\"file:///\", \"\"));\n\n            CompilerResults results = new CSharpCodeProvider().CompileAssemblyFromSource(\n                new CompilerParameters(referencedAssemblies.ToArray(), output), code);\n\n            ThrowIfCompilerError(results);\n\n            return results;\n        }\n\n        public static string GenerateDynamicModule(string assemblyName, string moduleName, string outpath, params string[] dependencies)\n        {\n            CreateOutput(outpath);\n\n            // Create temporary module.\n            string moduleCode = moduleTemplate.Replace(\"#className#\", assemblyName);\n            if (!string.IsNullOrEmpty(moduleName))\n            {\n                moduleCode = moduleCode.Replace(\"#module#\", String.Format(\"[Module(ModuleName = \\\"{0}\\\") #dependencies#]\", moduleName));\n            }\n            else\n            {\n                moduleCode = moduleCode.Replace(\"#module#\", \"\");\n            }\n\n            string depString = string.Empty;\n\n            foreach (string module in dependencies)\n            {\n                depString += String.Format(\", ModuleDependency(\\\"{0}\\\")\", module);\n            }\n\n            moduleCode = moduleCode.Replace(\"#dependencies#\", depString);\n\n            CompileCode(moduleCode, outpath);\n\n            return outpath;\n        }\n\n        public static string GenerateDynamicModule(string assemblyName, string moduleName, params string[] dependencies)\n        {\n            string assemblyFile = assemblyName + \".dll\";\n            string outpath = Path.Combine(assemblyName, assemblyFile);\n\n            return GenerateDynamicModule(assemblyName, moduleName, outpath, dependencies);\n        }\n\n        public static void ThrowIfCompilerError(CompilerResults results)\n        {\n            if (results.Errors.HasErrors)\n            {\n                StringBuilder sb = new StringBuilder();\n                sb.AppendLine(\"Compilation failed.\");\n                foreach (CompilerError error in results.Errors)\n                {\n                    sb.AppendLine(error.ToString());\n                }\n                Assert.False(results.Errors.HasErrors, sb.ToString());\n            }\n        }\n\n        public static void CleanUpDirectory(string path)\n        {\n            if (!Directory.Exists(path))\n            {\n                Directory.CreateDirectory(path);\n            }\n            else\n            {\n                foreach (string file in Directory.GetFiles(path))\n                {\n                    try\n                    {\n                        File.Delete(file);\n                    }\n                    catch (UnauthorizedAccessException)\n                    {\n                        //The file might be locked by Visual Studio, so rename it\n                        if (File.Exists(file + \".locked\"))\n                            File.Delete(file + \".locked\");\n                        File.Move(file, file + \".locked\");\n                    }\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/ExceptionAssert.cs",
    "content": "﻿using System;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests\n{\n    public static class ExceptionAssert\n    {\n        public static void Throws<TException>(Action action)\n            where TException : Exception\n        {\n            Throws(typeof(TException), action);\n        }\n\n        public static void Throws(Type expectedExceptionType, Action action)\n        {\n            try\n            {\n                action();\n            }\n            catch (Exception ex)\n            {\n                Assert.IsType(expectedExceptionType, ex);\n                return;\n            }\n\n            //Assert.Fail(\"No exception thrown.  Expected exception type of {0}.\", expectedExceptionType.Name);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Interactivity/CommandBehaviorBaseFixture.cs",
    "content": "using System;\nusing System.Windows;\nusing System.Windows.Input;\nusing Prism.Interactivity;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Interactivity\n{\n\n    public class CommandBehaviorBaseFixture\n    {\n        [Fact]\n        public void ExecuteUsesCommandParameterWhenSet()\n        {\n            var targetUIElement = new UIElement();\n            var target = new TestableCommandBehaviorBase(targetUIElement);\n            target.CommandParameter = \"123\";\n            TestCommand testCommand = new TestCommand();\n            target.Command = testCommand;\n\n            target.ExecuteCommand(\"testparam\");\n\n            Assert.Equal(\"123\", testCommand.ExecuteCalledWithParameter);\n        }\n\n        [Fact]\n        public void ExecuteUsesParameterWhenCommandParameterNotSet()\n        {\n            var targetUIElement = new UIElement();\n            var target = new TestableCommandBehaviorBase(targetUIElement);\n            TestCommand testCommand = new TestCommand();\n            target.Command = testCommand;\n\n            target.ExecuteCommand(\"testparam\");\n\n            Assert.Equal(\"testparam\", testCommand.ExecuteCalledWithParameter);\n        }\n\n        [Fact]\n        public void CommandBehaviorBaseAllowsDisableByDefault()\n        {\n            var targetUIElement = new UIElement();\n            var target = new TestableCommandBehaviorBase(targetUIElement);\n\n            Assert.True(target.AutoEnable);\n        }\n\n        [StaFact]\n        public void CommandBehaviorBaseEnablesUIElement()\n        {\n            var targetUIElement = new UIElement();\n            targetUIElement.IsEnabled = false;\n\n            var target = new TestableCommandBehaviorBase(targetUIElement);\n            TestCommand testCommand = new TestCommand();\n            target.Command = testCommand;\n            target.ExecuteCommand(null);\n\n            Assert.True(targetUIElement.IsEnabled);\n        }\n\n        [StaFact]\n        public void CommandBehaviorBaseDisablesUIElement()\n        {\n            var targetUIElement = new UIElement();\n            targetUIElement.IsEnabled = true;\n\n            var target = new TestableCommandBehaviorBase(targetUIElement);\n            TestCommand testCommand = new TestCommand();\n            testCommand.CanExecuteResult = false;\n            target.Command = testCommand;\n            target.ExecuteCommand(null);\n\n            Assert.False(targetUIElement.IsEnabled);\n        }\n\n        [StaFact]\n        public void WhenAutoEnableIsFalse_ThenDisabledUIElementRemainsDisabled()\n        {\n            var targetUIElement = new UIElement();\n            targetUIElement.IsEnabled = false;\n\n            var target = new TestableCommandBehaviorBase(targetUIElement);\n            target.AutoEnable = false;\n            TestCommand testCommand = new TestCommand();\n            target.Command = testCommand;\n            target.ExecuteCommand(null);\n\n            Assert.False(targetUIElement.IsEnabled);\n        }\n\n        [StaFact]\n        public void WhenAutoEnableIsUpdated_ThenDisabledUIElementIsEnabled()\n        {\n            var targetUIElement = new UIElement();\n            targetUIElement.IsEnabled = false;\n\n            var target = new TestableCommandBehaviorBase(targetUIElement);\n            target.AutoEnable = false;\n            TestCommand testCommand = new TestCommand();\n            target.Command = testCommand;\n            target.ExecuteCommand(null);\n\n            Assert.False(targetUIElement.IsEnabled);\n\n            target.AutoEnable = true;\n\n            Assert.True(targetUIElement.IsEnabled);\n        }\n\n        [StaFact]\n        public void WhenAutoEnableIsUpdated_ThenEnabledUIElementIsDisabled()\n        {\n            var targetUIElement = new UIElement();\n            targetUIElement.IsEnabled = true;\n\n            var target = new TestableCommandBehaviorBase(targetUIElement);\n            target.AutoEnable = false;\n            TestCommand testCommand = new TestCommand();\n            testCommand.CanExecuteResult = false;\n            target.Command = testCommand;\n            target.ExecuteCommand(null);\n\n            Assert.True(targetUIElement.IsEnabled);\n\n            target.AutoEnable = true;\n\n            Assert.False(targetUIElement.IsEnabled);\n        }\n    }\n\n    class TestableCommandBehaviorBase : CommandBehaviorBase<UIElement>\n    {\n        public TestableCommandBehaviorBase(UIElement targetObject)\n            : base(targetObject)\n        { }\n\n        public new void ExecuteCommand(object parameter)\n        {\n            base.ExecuteCommand(parameter);\n        }\n    }\n\n    class TestCommand : ICommand\n    {\n        bool _canExecte = true;\n        public bool CanExecuteResult\n        {\n            get { return _canExecte; }\n            set { _canExecte = value; }\n        }\n\n        public object CanExecuteCalledWithParameter { get; set; }\n        public bool CanExecute(object parameter)\n        {\n            CanExecuteCalledWithParameter = parameter;\n            return CanExecuteResult;\n        }\n\n        public event EventHandler CanExecuteChanged;\n\n        public object ExecuteCalledWithParameter { get; set; }\n        public void Execute(object parameter)\n        {\n            ExecuteCalledWithParameter = parameter;\n        }\n    }\n\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Interactivity/InvokeCommandActionFixture.cs",
    "content": "﻿using System;\nusing System.Windows.Controls;\nusing Prism.Interactivity;\nusing Prism.Wpf.Tests.Mocks;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Interactivity\n{\n\n    public class InvokeCommandActionFixture\n    {\n        [StaFact]\n        public void WhenCommandPropertyIsSet_ThenHooksUpCommandBehavior()\n        {\n            var someControl = new TextBox();\n            var commandAction = new InvokeCommandAction();\n            var command = new MockCommand();\n            commandAction.Attach(someControl);\n            commandAction.Command = command;\n\n            Assert.False(command.ExecuteCalled);\n\n            commandAction.InvokeAction(null);\n\n            Assert.True(command.ExecuteCalled);\n            Assert.Same(command, commandAction.GetValue(InvokeCommandAction.CommandProperty));\n        }\n\n        [StaFact]\n        public void WhenAttachedAfterCommandPropertyIsSetAndInvoked_ThenInvokesCommand()\n        {\n            var someControl = new TextBox();\n            var commandAction = new InvokeCommandAction();\n            var command = new MockCommand();\n            commandAction.Command = command;\n            commandAction.Attach(someControl);\n\n            Assert.False(command.ExecuteCalled);\n\n            commandAction.InvokeAction(null);\n\n            Assert.True(command.ExecuteCalled);\n            Assert.Same(command, commandAction.GetValue(InvokeCommandAction.CommandProperty));\n        }\n\n        [StaFact]\n        public void WhenChangingProperty_ThenUpdatesCommand()\n        {\n            var someControl = new TextBox();\n            var oldCommand = new MockCommand();\n            var newCommand = new MockCommand();\n            var commandAction = new InvokeCommandAction();\n            commandAction.Attach(someControl);\n            commandAction.Command = oldCommand;\n            commandAction.Command = newCommand;\n            commandAction.InvokeAction(null);\n\n            Assert.True(newCommand.ExecuteCalled);\n            Assert.False(oldCommand.ExecuteCalled);\n        }\n\n        [StaFact]\n        public void WhenInvokedWithCommandParameter_ThenPassesCommandParaeterToExecute()\n        {\n            var someControl = new TextBox();\n            var command = new MockCommand();\n            var parameter = new object();\n            var commandAction = new InvokeCommandAction();\n            commandAction.Attach(someControl);\n            commandAction.Command = command;\n            commandAction.CommandParameter = parameter;\n\n            Assert.Null(command.ExecuteParameter);\n\n            commandAction.InvokeAction(null);\n\n            Assert.True(command.ExecuteCalled);\n            Assert.NotNull(command.ExecuteParameter);\n            Assert.Same(parameter, command.ExecuteParameter);\n        }\n\n        [StaFact]\n        public void WhenCommandParameterChanged_ThenUpdatesIsEnabledState()\n        {\n            var someControl = new TextBox();\n            var command = new MockCommand();\n            var parameter = new object();\n            var commandAction = new InvokeCommandAction();\n            commandAction.Attach(someControl);\n            commandAction.Command = command;\n\n            Assert.Null(command.CanExecuteParameter);\n            Assert.True(someControl.IsEnabled);\n\n            command.CanExecuteReturnValue = false;\n            commandAction.CommandParameter = parameter;\n\n            Assert.NotNull(command.CanExecuteParameter);\n            Assert.Same(parameter, command.CanExecuteParameter);\n            Assert.False(someControl.IsEnabled);\n        }\n\n        [StaFact]\n        public void WhenCanExecuteChanged_ThenUpdatesIsEnabledState()\n        {\n            var someControl = new TextBox();\n            var command = new MockCommand();\n            var parameter = new object();\n            var commandAction = new InvokeCommandAction();\n            commandAction.Attach(someControl);\n            commandAction.Command = command;\n            commandAction.CommandParameter = parameter;\n\n            Assert.True(someControl.IsEnabled);\n\n            command.CanExecuteReturnValue = false;\n            command.RaiseCanExecuteChanged();\n\n            Assert.NotNull(command.CanExecuteParameter);\n            Assert.Same(parameter, command.CanExecuteParameter);\n            Assert.False(someControl.IsEnabled);\n        }\n\n        [StaFact]\n        public void WhenDetatched_ThenSetsCommandAndCommandParameterToNull()\n        {\n            var someControl = new TextBox();\n            var command = new MockCommand();\n            var parameter = new object();\n            var commandAction = new InvokeCommandAction();\n            commandAction.Attach(someControl);\n            commandAction.Command = command;\n            commandAction.CommandParameter = parameter;\n\n            Assert.NotNull(commandAction.Command);\n            Assert.NotNull(commandAction.CommandParameter);\n\n            commandAction.Detach();\n\n            Assert.Null(commandAction.Command);\n            Assert.Null(commandAction.CommandParameter);\n        }\n\n        [StaFact]\n        public void WhenCommandIsSetAndThenBehaviorIsAttached_ThenCommandsCanExecuteIsCalledOnce()\n        {\n            var someControl = new TextBox();\n            var command = new MockCommand();\n            var commandAction = new InvokeCommandAction();\n            commandAction.Command = command;\n            commandAction.Attach(someControl);\n\n            Assert.Equal(1, command.CanExecuteTimesCalled);\n        }\n\n        [StaFact]\n        public void WhenCommandAndCommandParameterAreSetPriorToBehaviorBeingAttached_ThenCommandIsExecutedCorrectlyOnInvoke()\n        {\n            var someControl = new TextBox();\n            var command = new MockCommand();\n            var parameter = new object();\n            var commandAction = new InvokeCommandAction();\n            commandAction.Command = command;\n            commandAction.CommandParameter = parameter;\n            commandAction.Attach(someControl);\n\n            commandAction.InvokeAction(null);\n\n            Assert.True(command.ExecuteCalled);\n        }\n\n        [StaFact]\n        public void WhenCommandParameterNotSet_ThenEventArgsPassed()\n        {\n            var eventArgs = new TestEventArgs(null);\n            var someControl = new TextBox();\n            var command = new MockCommand();\n            var parameter = new object();\n            var commandAction = new InvokeCommandAction();\n            commandAction.Command = command;\n            commandAction.Attach(someControl);\n\n            commandAction.InvokeAction(eventArgs);\n\n            Assert.IsType<TestEventArgs>(command.ExecuteParameter);\n        }\n\n        [StaFact]\n        public void WhenCommandParameterNotSetAndEventArgsParameterPathSet_ThenPathedValuePassed()\n        {\n            var eventArgs = new TestEventArgs(\"testname\");\n            var someControl = new TextBox();\n            var command = new MockCommand();\n            var parameter = new object();\n            var commandAction = new InvokeCommandAction();\n            commandAction.Command = command;\n            commandAction.TriggerParameterPath = \"Thing1.Thing2.Name\";\n            commandAction.Attach(someControl);\n\n            commandAction.InvokeAction(eventArgs);\n\n            Assert.Equal(\"testname\", command.ExecuteParameter);\n        }\n\n        [StaFact]\n        public void WhenAttachedAndCanExecuteReturnsTrue_ThenDisabledUIElementIsEnabled()\n        {\n            var someControl = new TextBox();\n            someControl.IsEnabled = false;\n\n            var command = new MockCommand();\n            command.CanExecuteReturnValue = true;\n            var commandAction = new InvokeCommandAction();\n            commandAction.Command = command;\n            commandAction.Attach(someControl);\n\n            Assert.True(someControl.IsEnabled);\n        }\n\n        [StaFact]\n        public void WhenAttachedAndCanExecuteReturnsFalse_ThenEnabledUIElementIsDisabled()\n        {\n            var someControl = new TextBox();\n            someControl.IsEnabled = true;\n\n            var command = new MockCommand();\n            command.CanExecuteReturnValue = false;\n            var commandAction = new InvokeCommandAction();\n            commandAction.Command = command;\n            commandAction.Attach(someControl);\n\n            Assert.False(someControl.IsEnabled);\n        }\n\n        [StaFact]\n        public void WhenAutoEnableIsFalse_ThenDisabledUIElementRemainsDisabled()\n        {\n            var someControl = new TextBox();\n            someControl.IsEnabled = false;\n\n            var command = new MockCommand();\n            command.CanExecuteReturnValue = true;\n            var commandAction = new InvokeCommandAction();\n            commandAction.AutoEnable = false;\n            commandAction.Command = command;\n            commandAction.Attach(someControl);\n\n            Assert.False(someControl.IsEnabled);\n        }\n\n        [StaFact]\n        public void WhenAutoEnableIsFalse_ThenEnabledUIElementRemainsEnabled()\n        {\n            var someControl = new TextBox();\n            someControl.IsEnabled = true;\n\n            var command = new MockCommand();\n            command.CanExecuteReturnValue = false;\n            var commandAction = new InvokeCommandAction();\n            commandAction.AutoEnable = false;\n            commandAction.Command = command;\n            commandAction.Attach(someControl);\n\n            Assert.True(someControl.IsEnabled);\n        }\n\n        [StaFact]\n        public void WhenAutoEnableIsUpdated_ThenDisabledUIElementIsEnabled()\n        {\n            var someControl = new TextBox();\n            someControl.IsEnabled = false;\n\n            var command = new MockCommand();\n            var commandAction = new InvokeCommandAction();\n            commandAction.AutoEnable = false;\n            commandAction.Command = command;\n            commandAction.Attach(someControl);\n\n            Assert.False(someControl.IsEnabled);\n\n            commandAction.AutoEnable = true;\n\n            Assert.True(someControl.IsEnabled);\n        }\n\n        [StaFact]\n        public void WhenAutoEnableIsUpdated_ThenEnabledUIElementIsDisabled()\n        {\n            var someControl = new TextBox();\n            someControl.IsEnabled = true;\n\n            var command = new MockCommand();\n            command.CanExecuteReturnValue = false;\n            var commandAction = new InvokeCommandAction();\n            commandAction.AutoEnable = false;\n            commandAction.Command = command;\n            commandAction.Attach(someControl);\n\n            Assert.True(someControl.IsEnabled);\n\n            commandAction.AutoEnable = true;\n\n            Assert.False(someControl.IsEnabled);\n        }\n    }\n\n    class TestEventArgs : EventArgs\n    {\n        public TestEventArgs(string name)\n        {\n            this.Thing1 = new Thing1 { Thing2 = new Thing2 { Name = name } };\n        }\n\n        public Thing1 Thing1 { get; set; }\n    }\n\n    class Thing1\n    {\n        public Thing2 Thing2 { get; set; }\n    }\n\n    class Thing2\n    {\n        public string Name { get; set; }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Mocks/MockAsyncModuleTypeLoader.cs",
    "content": "\n\nusing System;\nusing System.Threading;\nusing Prism.Modularity;\n\nnamespace Prism.Wpf.Tests.Mocks\n{\n    public class MockAsyncModuleTypeLoader : IModuleTypeLoader\n    {\n        private ManualResetEvent callbackEvent;\n\n        public MockAsyncModuleTypeLoader(ManualResetEvent callbackEvent)\n        {\n            this.callbackEvent = callbackEvent;\n        }\n\n        public int SleepTimeOut { get; set; }\n\n        public Exception CallbackArgumentError { get; set; }\n\n        public bool CanLoadModuleType(IModuleInfo moduleInfo)\n        {\n            return true;\n        }\n\n        public void LoadModuleType(IModuleInfo moduleInfo)\n        {\n            Thread retrieverThread = new Thread(() =>\n            {\n                Thread.Sleep(SleepTimeOut);\n\n                this.RaiseLoadModuleCompleted(new LoadModuleCompletedEventArgs(moduleInfo, CallbackArgumentError));\n                callbackEvent.Set();\n            });\n            retrieverThread.Start();\n        }\n\n\n        public event EventHandler<ModuleDownloadProgressChangedEventArgs> ModuleDownloadProgressChanged;\n\n        private void RaiseLoadModuleProgressChanged(ModuleDownloadProgressChangedEventArgs e)\n        {\n            this.ModuleDownloadProgressChanged?.Invoke(this, e);\n        }\n\n        public event EventHandler<LoadModuleCompletedEventArgs> LoadModuleCompleted;\n\n        private void RaiseLoadModuleCompleted(LoadModuleCompletedEventArgs e)\n        {\n            this.LoadModuleCompleted?.Invoke(this, e);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Mocks/MockClickableObject.cs",
    "content": "\n\nusing System.Windows.Controls.Primitives;\n\nnamespace Prism.Wpf.Tests.Mocks\n{\n    internal class MockClickableObject : ButtonBase\n    {\n        public void RaiseClick()\n        {\n            OnClick();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Mocks/MockCommand.cs",
    "content": "\n\nusing System;\nusing System.Windows.Input;\n\nnamespace Prism.Wpf.Tests.Mocks\n{\n    internal class MockCommand : ICommand\n    {\n        public bool ExecuteCalled { get; set; }\n        public bool CanExecuteReturnValue = true;\n        public object ExecuteParameter;\n        public object CanExecuteParameter;\n        public int CanExecuteTimesCalled;\n\n        public event EventHandler CanExecuteChanged;\n\n        public void Execute(object parameter)\n        {\n            ExecuteCalled = true;\n            ExecuteParameter = parameter;\n        }\n\n        public bool CanExecute(object parameter)\n        {\n            CanExecuteTimesCalled++;\n            CanExecuteParameter = parameter;\n            return CanExecuteReturnValue;\n        }\n\n        public void RaiseCanExecuteChanged()\n        {\n            if (this.CanExecuteChanged != null)\n                this.CanExecuteChanged(this, EventArgs.Empty);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Mocks/MockConfigurationStore.Desktop.cs",
    "content": "\n\nusing Prism.Modularity;\n\nnamespace Prism.Wpf.Tests.Mocks\n{\n    public class MockConfigurationStore : IConfigurationStore\n    {\n        private ModulesConfigurationSection _section = new ModulesConfigurationSection();\n\n        public ModuleConfigurationElement[] Modules\n        {\n            set { _section.Modules = new ModuleConfigurationElementCollection(value); }\n        }\n\n        public ModulesConfigurationSection RetrieveModuleConfigurationSection()\n        {\n            return _section;\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Mocks/MockContainerAdapter.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing Prism.Ioc;\n\nnamespace Prism.Wpf.Tests.Mocks\n{\n    internal class MockContainerAdapter : IContainerExtension\n    {\n        public Dictionary<Type, object> ResolvedInstances = new Dictionary<Type, object>();\n\n        public IScopedProvider CurrentScope { get; }\n\n        public void CreateScope()\n        {\n            throw new NotImplementedException();\n        }\n\n        public void FinalizeExtension()\n        {\n\n        }\n\n        public bool IsRegistered(Type type)\n        {\n            throw new NotImplementedException();\n        }\n\n        public bool IsRegistered(Type type, string name)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IContainerRegistry Register(Type from, Type to)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IContainerRegistry Register(Type from, Type to, string name)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IContainerRegistry Register(Type type, Func<object> factoryMethod)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IContainerRegistry Register(Type type, Func<IContainerProvider, object> factoryMethod)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IContainerRegistry RegisterInstance(Type type, object instance)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IContainerRegistry RegisterInstance(Type type, object instance, string name)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IContainerRegistry RegisterMany(Type type, params Type[] serviceTypes)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IContainerRegistry RegisterManySingleton(Type type, params Type[] serviceTypes)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IContainerRegistry RegisterScoped(Type from, Type to)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IContainerRegistry RegisterScoped(Type type, Func<object> factoryMethod)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IContainerRegistry RegisterScoped(Type type, Func<IContainerProvider, object> factoryMethod)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IContainerRegistry RegisterSingleton(Type from, Type to)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IContainerRegistry RegisterSingleton(Type from, Type to, string name)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IContainerRegistry RegisterSingleton(Type type, Func<object> factoryMethod)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IContainerRegistry RegisterSingleton(Type type, Func<IContainerProvider, object> factoryMethod)\n        {\n            throw new NotImplementedException();\n        }\n\n        public object Resolve(Type type)\n        {\n            object resolvedInstance;\n            if (!this.ResolvedInstances.ContainsKey(type))\n            {\n                resolvedInstance = Activator.CreateInstance(type);\n                this.ResolvedInstances.Add(type, resolvedInstance);\n            }\n            else\n            {\n                resolvedInstance = this.ResolvedInstances[type];\n            }\n\n            return resolvedInstance;\n        }\n\n        public object Resolve(Type type, string name)\n        {\n            throw new NotImplementedException();\n        }\n\n        public object Resolve(Type type, params (Type Type, object Instance)[] parameters)\n        {\n            throw new NotImplementedException();\n        }\n\n        public object Resolve(Type type, string name, params (Type Type, object Instance)[] parameters)\n        {\n            throw new NotImplementedException();\n        }\n\n        IScopedProvider IContainerProvider.CreateScope()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Mocks/MockDelegateReference.cs",
    "content": "\n\nusing System;\nusing Prism.Events;\n\nnamespace Prism.Wpf.Tests.Mocks\n{\n    class MockDelegateReference : IDelegateReference\n    {\n        public Delegate Target { get; set; }\n\n        public MockDelegateReference()\n        {\n\n        }\n\n        public MockDelegateReference(Delegate target)\n        {\n            Target = target;\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Mocks/MockDependencyObject.cs",
    "content": "\n\nusing System.Windows;\n\nnamespace Prism.Wpf.Tests.Mocks\n{\n    public class MockDependencyObject : DependencyObject\n    {\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Mocks/MockFrameworkContentElement.cs",
    "content": "﻿using System.Windows;\n\nnamespace Prism.Wpf.Tests.Mocks\n{\n    class MockFrameworkContentElement : FrameworkContentElement\n    {\n        public void RaiseLoaded()\n        {\n            this.RaiseEvent(new RoutedEventArgs(LoadedEvent));\n        }\n\n        public void RaiseUnloaded()\n        {\n            this.RaiseEvent(new RoutedEventArgs(UnloadedEvent));\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Mocks/MockFrameworkElement.cs",
    "content": "﻿using System.Windows;\n\nnamespace Prism.Wpf.Tests.Mocks\n{\n    public class MockFrameworkElement : FrameworkElement\n    {\n        public void RaiseLoaded()\n        {\n            this.RaiseEvent(new RoutedEventArgs(LoadedEvent));\n        }\n\n        public void RaiseUnloaded()\n        {\n            this.RaiseEvent(new RoutedEventArgs(UnloadedEvent));\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Mocks/MockHostAwareRegionBehavior.cs",
    "content": "\n\nusing System.Windows;\nusing Prism.Navigation.Regions;\nusing Prism.Navigation.Regions.Behaviors;\n\nnamespace Prism.Wpf.Tests.Mocks\n{\n    public class MockHostAwareRegionBehavior : IHostAwareRegionBehavior\n    {\n        public IRegion Region { get; set; }\n\n        public void Attach()\n        {\n\n        }\n\n        public DependencyObject HostControl { get; set; }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Mocks/MockModuleTypeLoader.cs",
    "content": "\n\nusing System;\nusing System.Collections.Generic;\nusing Prism.Modularity;\n\nnamespace Prism.Wpf.Tests.Mocks\n{\n    public class MockModuleTypeLoader : IModuleTypeLoader\n    {\n        public List<IModuleInfo> LoadedModules = new List<IModuleInfo>();\n        public bool canLoadModuleTypeReturnValue = true;\n        public Exception LoadCompletedError;\n\n        public bool CanLoadModuleType(IModuleInfo moduleInfo)\n        {\n            return canLoadModuleTypeReturnValue;\n        }\n\n        public void LoadModuleType(IModuleInfo moduleInfo)\n        {\n            this.LoadedModules.Add(moduleInfo);\n            this.RaiseLoadModuleCompleted(new LoadModuleCompletedEventArgs(moduleInfo, this.LoadCompletedError));\n        }\n\n        public event EventHandler<ModuleDownloadProgressChangedEventArgs> ModuleDownloadProgressChanged;\n\n        public void RaiseLoadModuleProgressChanged(ModuleDownloadProgressChangedEventArgs e)\n        {\n            this.ModuleDownloadProgressChanged?.Invoke(this, e);\n        }\n\n        public event EventHandler<LoadModuleCompletedEventArgs> LoadModuleCompleted;\n\n        public void RaiseLoadModuleCompleted(ModuleInfo moduleInfo, Exception error)\n        {\n            this.RaiseLoadModuleCompleted(new LoadModuleCompletedEventArgs(moduleInfo, error));\n        }\n\n        public void RaiseLoadModuleCompleted(LoadModuleCompletedEventArgs e)\n        {\n            this.LoadModuleCompleted?.Invoke(this, e);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Mocks/MockPresentationRegion.cs",
    "content": "using System;\nusing System.ComponentModel;\nusing Prism.Navigation;\nusing Prism.Navigation.Regions;\n\nnamespace Prism.Wpf.Tests.Mocks\n{\n    class MockPresentationRegion : IRegion\n    {\n        public MockViewsCollection MockViews = new MockViewsCollection();\n        public MockViewsCollection MockActiveViews = new MockViewsCollection();\n\n        public MockPresentationRegion()\n        {\n            Behaviors = new MockRegionBehaviorCollection();\n        }\n\n        public IRegionManager Add(string viewName) => throw new NotImplementedException();\n\n        public IRegionManager Add(object view)\n        {\n            MockViews.Items.Add(view);\n\n            return null;\n        }\n\n        public void Remove(object view)\n        {\n            MockViews.Items.Remove(view);\n            MockActiveViews.Items.Remove(view);\n        }\n\n        public void Activate(object view)\n        {\n            MockActiveViews.Items.Add(view);\n        }\n\n        public IRegionManager Add(object view, string viewName)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IRegionManager Add(object view, string viewName, bool createRegionManagerScope)\n        {\n            throw new NotImplementedException();\n        }\n\n        public object GetView(string viewName)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IRegionManager RegionManager { get; set; }\n\n        public IRegionBehaviorCollection Behaviors { get; set; }\n\n        public IViewsCollection Views\n        {\n            get { return MockViews; }\n        }\n\n        public IViewsCollection ActiveViews\n        {\n            get { return MockActiveViews; }\n        }\n\n        public void Deactivate(object view)\n        {\n            MockActiveViews.Items.Remove(view);\n        }\n\n        private object context;\n        public object Context\n        {\n            get { return context; }\n            set\n            {\n                context = value;\n                OnPropertyChange(\"Context\");\n            }\n        }\n\n        public INavigationParameters NavigationParameters\n        {\n            get { throw new System.NotImplementedException(); }\n            set { throw new System.NotImplementedException(); }\n        }\n\n        private string name;\n        public string Name\n        {\n            get { return this.name; }\n            set\n            {\n                this.name = value;\n                this.OnPropertyChange(\"Name\");\n            }\n        }\n\n        public event PropertyChangedEventHandler PropertyChanged;\n\n        public void OnPropertyChange(string propertyName)\n        {\n            if (PropertyChanged != null)\n            {\n                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));\n            }\n        }\n\n        public bool Navigate(Uri source)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RequestNavigate(Uri target, Action<NavigationResult> navigationCallback)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RequestNavigate(Uri target, Action<NavigationResult> navigationCallback, INavigationParameters navigationParameters)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RemoveAll()\n        {\n            throw new NotImplementedException();\n        }\n\n        public IRegionNavigationService NavigationService\n        {\n            get { throw new NotImplementedException(); }\n            set { throw new System.NotImplementedException(); }\n        }\n\n\n        public Comparison<object> SortComparison\n        {\n            get\n            {\n                throw new NotImplementedException();\n            }\n            set\n            {\n                throw new NotImplementedException();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Mocks/MockRegion.cs",
    "content": "using System;\nusing System.ComponentModel;\nusing Prism.Navigation;\nusing Prism.Navigation.Regions;\n\nnamespace Prism.Wpf.Tests.Mocks\n{\n    internal class MockRegion : IRegion\n    {\n        public event PropertyChangedEventHandler PropertyChanged;\n        public Func<string, object> GetViewStringDelegate { get; set; }\n\n        private MockViewsCollection views = new MockViewsCollection();\n\n        public IViewsCollection Views\n        {\n            get { return views; }\n        }\n\n        public IViewsCollection ActiveViews\n        {\n            get { throw new System.NotImplementedException(); }\n        }\n\n        public object Context\n        {\n            get { throw new System.NotImplementedException(); }\n            set { throw new System.NotImplementedException(); }\n        }\n\n        public INavigationParameters NavigationParameters\n        {\n            get { throw new System.NotImplementedException(); }\n            set { throw new System.NotImplementedException(); }\n        }\n\n        public string Name { get; set; }\n\n        public IRegionManager Add(string viewName) => throw new NotImplementedException();\n\n        public IRegionManager Add(object view)\n        {\n            this.views.Add(view);\n            return null;\n        }\n\n        public IRegionManager Add(object view, string viewName)\n        {\n            return Add(view);\n        }\n\n        public IRegionManager Add(object view, string viewName, bool createRegionManagerScope)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public void Remove(object view)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public void Activate(object view)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public void Deactivate(object view)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public object GetView(string viewName)\n        {\n            return GetViewStringDelegate(viewName);\n        }\n\n        public IRegionManager RegionManager { get; set; }\n\n        public IRegionBehaviorCollection Behaviors\n        {\n            get { throw new System.NotImplementedException(); }\n        }\n\n        public bool Navigate(System.Uri source)\n        {\n            throw new System.NotImplementedException();\n        }\n\n\n        public void RequestNavigate(System.Uri target, System.Action<NavigationResult> navigationCallback)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public void RequestNavigate(System.Uri target, System.Action<NavigationResult> navigationCallback, INavigationParameters navigationParameters)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public void RemoveAll()\n        {\n            throw new NotImplementedException();\n        }\n\n        public IRegionNavigationService NavigationService\n        {\n            get { throw new System.NotImplementedException(); }\n            set { throw new System.NotImplementedException(); }\n        }\n\n\n        public System.Comparison<object> SortComparison\n        {\n            get\n            {\n                throw new System.NotImplementedException();\n            }\n            set\n            {\n                throw new System.NotImplementedException();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Mocks/MockRegionAdapter.cs",
    "content": "\n\nusing System.Collections.Generic;\nusing System.Windows;\nusing Prism.Navigation.Regions;\n\nnamespace Prism.Wpf.Tests.Mocks\n{\n    internal class MockRegionAdapter : IRegionAdapter\n    {\n        public List<string> CreatedRegions = new List<string>();\n        public MockRegionManagerAccessor Accessor;\n\n\n        public IRegion Initialize(object regionTarget, string regionName)\n        {\n            CreatedRegions.Add(regionName);\n\n            var region = new MockPresentationRegion();\n            RegionManager.GetObservableRegion(regionTarget as DependencyObject).Value = region;\n\n            // Fire update regions again. This also happens if a region is created and added to the regionmanager\n            if (this.Accessor != null)\n                Accessor.UpdateRegions();\n\n            return region;\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Mocks/MockRegionBehavior.cs",
    "content": "\n\nusing System;\nusing Prism.Navigation.Regions;\n\nnamespace Prism.Wpf.Tests.Mocks\n{\n    public class MockRegionBehavior : IRegionBehavior\n    {\n        public IRegion Region\n        {\n            get; set;\n        }\n\n        public Func<object> OnAttach;\n\n        public void Attach()\n        {\n            if (OnAttach != null)\n                OnAttach();\n\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Mocks/MockRegionBehaviorB.cs",
    "content": "using Prism.Navigation.Regions;\n\nnamespace Prism.Wpf.Tests.Mocks\n{\n    public class MockRegionBehaviorB : IRegionBehavior\n    {\n        public IRegion Region\n        {\n            get; set;\n        }\n\n        public Func<object> OnAttach;\n\n        public void Attach()\n        {\n            if (OnAttach != null)\n                OnAttach();\n\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Mocks/MockRegionBehaviorCollection.cs",
    "content": "\n\nusing System.Collections;\nusing System.Collections.Generic;\nusing Prism.Navigation.Regions;\n\nnamespace Prism.Wpf.Tests.Mocks\n{\n    internal class MockRegionBehaviorCollection : Dictionary<string, IRegionBehavior>, IRegionBehaviorCollection\n    {\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return GetEnumerator();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Mocks/MockRegionManager.cs",
    "content": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing Prism.Ioc;\nusing Prism.Navigation;\nusing Prism.Navigation.Regions;\n\nnamespace Prism.Wpf.Tests.Mocks\n{\n    internal class MockRegionManager : IRegionManager\n    {\n        private IRegionCollection regions = new MockRegionCollection();\n        internal MockRegionCollection MockRegionCollection\n        {\n            get\n            {\n                return regions as MockRegionCollection;\n            }\n        }\n\n        public IRegionCollection Regions\n        {\n            get { return regions; }\n        }\n\n        public IRegionManager CreateRegionManager()\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public IRegionManager AddToRegion(string regionName, object view)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public IRegionManager RegisterViewWithRegion(string regionName, Type viewType)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IRegionManager RegisterViewWithRegion(string regionName, Func<IContainerProvider, object> getContentDelegate)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RequestNavigate(string regionName, Uri source, Action<NavigationResult> navigationCallback)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RequestNavigate(string regionName, Uri source)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RequestNavigate(string regionName, string source, Action<NavigationResult> navigationCallback)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RequestNavigate(string regionName, string source)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RequestNavigate(string regionName, Uri target, Action<NavigationResult> navigationCallback, INavigationParameters navigationParameters)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RequestNavigate(string regionName, string target, Action<NavigationResult> navigationCallback, INavigationParameters navigationParameters)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RequestNavigate(string regionName, Uri target, INavigationParameters navigationParameters)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RequestNavigate(string regionName, string target, INavigationParameters navigationParameters)\n        {\n            throw new NotImplementedException();\n        }\n\n        public bool Navigate(System.Uri source)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public IRegionManager AddToRegion(string regionName, string viewName)\n        {\n            throw new NotImplementedException();\n        }\n\n        public IRegionManager RegisterViewWithRegion(string regionName, string viewName)\n        {\n            throw new NotImplementedException();\n        }\n    }\n\n    internal class MockRegionCollection : List<IRegion>, IRegionCollection\n    {\n        IEnumerator<IRegion> IEnumerable<IRegion>.GetEnumerator()\n        {\n            throw new System.NotImplementedException();\n        }\n\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return GetEnumerator();\n        }\n\n        public IRegion this[string regionName]\n        {\n            get { return this[0]; }\n        }\n\n        void IRegionCollection.Add(IRegion region)\n        {\n            this.Add(region);\n        }\n\n        public bool Remove(string regionName)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public bool ContainsRegionWithName(string regionName)\n        {\n            return true;\n        }\n\n        public void Add(string regionName, IRegion region)\n        {\n            throw new NotImplementedException();\n        }\n\n        public event System.Collections.Specialized.NotifyCollectionChangedEventHandler CollectionChanged;\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Mocks/MockRegionManagerAccessor.cs",
    "content": "\n\nusing System;\nusing System.Windows;\nusing Prism.Navigation.Regions;\n\nnamespace Prism.Wpf.Tests.Mocks\n{\n    internal class MockRegionManagerAccessor : IRegionManagerAccessor\n    {\n        public Func<DependencyObject, string> GetRegionName;\n        public Func<DependencyObject, IRegionManager> GetRegionManager;\n\n        public event EventHandler UpdatingRegions;\n\n        string IRegionManagerAccessor.GetRegionName(DependencyObject element)\n        {\n            return this.GetRegionName(element);\n        }\n\n        IRegionManager IRegionManagerAccessor.GetRegionManager(DependencyObject element)\n        {\n            if (this.GetRegionManager != null)\n            {\n                return this.GetRegionManager(element);\n            }\n\n            return null;\n        }\n\n        public void UpdateRegions()\n        {\n            if (this.UpdatingRegions != null)\n            {\n                this.UpdatingRegions(this, EventArgs.Empty);\n            }\n        }\n\n        public int GetSubscribersCount()\n        {\n            return this.UpdatingRegions != null ? this.UpdatingRegions.GetInvocationList().Length : 0;\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Mocks/MockSortableViews.cs",
    "content": "\n\nusing Prism.Navigation.Regions;\n\nnamespace Prism.Wpf.Tests.Mocks\n{\n    [ViewSortHint(\"01\")]\n    internal class MockSortableView1\n    {\n    }\n\n    [ViewSortHint(\"02\")]\n    internal class MockSortableView2\n    {\n    }\n\n    [ViewSortHint(\"03\")]\n    internal class MockSortableView3\n    {\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Mocks/MockViewsCollection.cs",
    "content": "\n\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Collections.Specialized;\nusing Prism.Navigation.Regions;\n\nnamespace Prism.Wpf.Tests.Mocks\n{\n    class MockViewsCollection : IViewsCollection\n    {\n        public ObservableCollection<object> Items = new ObservableCollection<object>();\n\n        public void Add(object view)\n        {\n            Items.Add(view);\n        }\n\n        public bool Contains(object value)\n        {\n            return Items.Contains(value);\n        }\n\n        public IEnumerator<object> GetEnumerator()\n        {\n            return Items.GetEnumerator();\n        }\n\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return GetEnumerator();\n        }\n\n        public event NotifyCollectionChangedEventHandler CollectionChanged\n        {\n            add { Items.CollectionChanged += value; }\n            remove { Items.CollectionChanged -= value; }\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Mocks/Modules/MockAbstractModule.cs",
    "content": "using System;\nusing Prism.Ioc;\nusing Prism.Modularity;\n\nnamespace Prism.Wpf.Tests.Mocks.Modules\n{\n    public abstract class MockAbstractModule : IModule\n    {\n        public void OnInitialized(IContainerProvider containerProvider)\n        {\n\n        }\n\n        public void RegisterTypes(IContainerRegistry containerRegistry)\n        {\n\n        }\n    }\n\n    public class MockInheritingModule : MockAbstractModule\n    {\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Mocks/Modules/MockAttributedModule.cs",
    "content": "using System;\nusing Prism.Ioc;\nusing Prism.Modularity;\n\nnamespace Prism.Wpf.Tests.Mocks.Modules\n{\n    [Module(ModuleName = \"TestModule\", OnDemand = true)]\n    public class MockAttributedModule : IModule\n    {\n        public void OnInitialized(IContainerProvider containerProvider)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RegisterTypes(IContainerRegistry containerRegistry)\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Mocks/Modules/MockDependantModule.cs",
    "content": "using System;\nusing Prism.Ioc;\nusing Prism.Modularity;\n\nnamespace Prism.Wpf.Tests.Mocks.Modules\n{\n    [Module(ModuleName = \"DependantModule\")]\n    [ModuleDependency(\"DependencyModule\")]\n    public class DependantModule : IModule\n    {\n        public void OnInitialized(IContainerProvider containerProvider)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RegisterTypes(IContainerRegistry containerRegistry)\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Mocks/Modules/MockDependencyModule.cs",
    "content": "using System;\nusing Prism.Ioc;\nusing Prism.Modularity;\n\nnamespace Prism.Wpf.Tests.Mocks.Modules\n{\n    [Module(ModuleName = \"DependencyModule\")]\n    public class DependencyModule : IModule\n    {\n        public void OnInitialized(IContainerProvider containerProvider)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RegisterTypes(IContainerRegistry containerRegistry)\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Mocks/Modules/MockExposingTypeFromGacAssemblyModule.cs",
    "content": "using System;\nusing Prism.Ioc;\nusing Prism.Modularity;\n\nnamespace Prism.Wpf.Tests.Mocks.Modules\n{\n    public class MockExposingTypeFromGacAssemblyModule : IModule\n    {\n        public void OnInitialized(IContainerProvider containerProvider)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RegisterTypes(IContainerRegistry containerRegistry)\n        {\n            throw new NotImplementedException();\n        }\n    }\n\n    public class SomeContractReferencingTransactionsAssembly : System.Transactions.IDtcTransaction\n    {\n        public void Commit(int retaining, int commitType, int reserved)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public void Abort(IntPtr reason, int retaining, int async)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public void GetTransactionInfo(IntPtr transactionInformation)\n        {\n            throw new System.NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Mocks/Modules/MockModuleA.cs",
    "content": "using System;\nusing Prism.Ioc;\nusing Prism.Modularity;\n\nnamespace Prism.Wpf.Tests.Mocks.Modules\n{\n    public class MockModuleA : IModule\n    {\n        public void OnInitialized(IContainerProvider containerProvider)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RegisterTypes(IContainerRegistry containerRegistry)\n        {\n            throw new NotImplementedException();\n        }\n    }\n\n    public class DummyClass\n    {\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Mocks/Modules/MockModuleReferencedAssembly.cs",
    "content": "\n\nnamespace Prism.Wpf.Tests.Mocks.Modules\n{\n    public class MockReferencedModule\n    {\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Mocks/Modules/MockModuleReferencingAssembly.cs",
    "content": "using System;\nusing Prism.Ioc;\nusing Prism.Modularity;\n\nnamespace Prism.Wpf.Tests.Mocks.Modules\n{\n    public class MockModuleReferencingAssembly : IModule\n    {\n        public void OnInitialized(IContainerProvider containerProvider)\n        {\n            MockReferencedModule instance = new MockReferencedModule();\n        }\n\n        public void RegisterTypes(IContainerRegistry containerRegistry)\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Mocks/Modules/MockModuleReferencingOtherModule.cs",
    "content": "using System;\nusing Prism.Ioc;\nusing Prism.Modularity;\n\nnamespace Prism.Wpf.Tests.Mocks.Modules\n{\n    public class MockModuleReferencingOtherModule : IModule\n    {\n        public void OnInitialized(IContainerProvider containerProvider)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RegisterTypes(IContainerRegistry containerRegistry)\n        {\n            throw new NotImplementedException();\n        }\n    }\n\n    public class MyDummyClass : DummyClass { }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Mocks/Modules/MockModuleThrowingException.cs",
    "content": "using System;\nusing Prism.Ioc;\nusing Prism.Modularity;\n\nnamespace Prism.Wpf.Tests.Mocks.Modules\n{\n    public class MockModuleThrowingException : IModule\n    {\n        public void OnInitialized(IContainerProvider containerProvider)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RegisterTypes(IContainerRegistry containerRegistry)\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Mocks/ViewModels/MockOptOutViewModel.cs",
    "content": "﻿using Prism.Mvvm;\n\nnamespace Prism.Wpf.Tests.Mocks.ViewModels\n{\n    public class MockOptOutViewModel : BindableBase\n    {\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Mocks/ViewModels/MockViewModel.cs",
    "content": "﻿using Prism.Mvvm;\n\nnamespace Prism.Wpf.Tests.Mocks.ViewModels\n{\n    public class MockViewModel : BindableBase\n    {\n        private int mockProperty;\n\n        public int MockProperty\n        {\n            get\n            {\n                return this.mockProperty;\n            }\n\n            set\n            {\n                this.SetProperty(ref mockProperty, value);\n            }\n        }\n\n        internal void InvokeOnPropertyChanged()\n        {\n            this.RaisePropertyChanged(nameof(MockProperty));\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Mocks/Views/Mock.cs",
    "content": "﻿using System.Windows;\n\nnamespace Prism.Wpf.Tests.Mocks.Views\n{\n    public class Mock : FrameworkElement\n    {\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Mocks/Views/MockOptOut.cs",
    "content": "﻿using System.Windows;\nusing Prism.Mvvm;\n\nnamespace Prism.Wpf.Tests.Mocks.Views\n{\n    public class MockOptOut : FrameworkElement\n    {\n        public MockOptOut()\n        {\n            ViewModelLocator.SetAutoWireViewModel(this, false);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Mocks/Views/MockView.cs",
    "content": "﻿using System.Windows;\n\nnamespace Prism.Wpf.Tests.Mocks.Views\n{\n    public class MockView : FrameworkElement\n    {\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Modularity/AssemblyResolverFixture.Desktop.cs",
    "content": "\n\nusing System;\nusing System.IO;\nusing Prism.Modularity;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Modularity\n{\n\n    public class AssemblyResolverFixture : IDisposable\n    {\n        private const string ModulesDirectory1 = @\".\\DynamicModules\\MocksModulesAssemblyResolve\";\n\n        public AssemblyResolverFixture()\n        {\n            CleanUpDirectories();\n        }\n\n        private void CleanUpDirectories()\n        {\n            CompilerHelper.CleanUpDirectory(ModulesDirectory1);\n        }\n\n        [Fact]\n        public void ShouldThrowOnInvalidAssemblyFilePath()\n        {\n            bool exceptionThrown = false;\n            using (var resolver = new AssemblyResolver())\n            {\n                try\n                {\n                    resolver.LoadAssemblyFrom(null);\n                }\n                catch (ArgumentException)\n                {\n                    exceptionThrown = true;\n                }\n\n                Assert.True(exceptionThrown);\n\n\n                try\n                {\n                    resolver.LoadAssemblyFrom(\"file://InexistentFile.dll\");\n                    exceptionThrown = false;\n                }\n                catch (FileNotFoundException)\n                {\n                    exceptionThrown = true;\n                }\n\n                Assert.True(exceptionThrown);\n\n\n                try\n                {\n                    resolver.LoadAssemblyFrom(\"InvalidUri.dll\");\n                    exceptionThrown = false;\n                }\n                catch (ArgumentException)\n                {\n                    exceptionThrown = true;\n                }\n\n                Assert.True(exceptionThrown);\n            }\n        }\n\n        [Fact]\n        public void ShouldResolveTypeFromAbsoluteUriToAssembly()\n        {\n            string assemblyPath = CompilerHelper.GenerateDynamicModule(\"ModuleInLoadedFromContext1\", \"Module\", ModulesDirectory1 + @\"\\ModuleInLoadedFromContext1.dll\");\n            var uriBuilder = new UriBuilder\n            {\n                Host = String.Empty,\n                Scheme = Uri.UriSchemeFile,\n                Path = Path.GetFullPath(assemblyPath)\n            };\n            var assemblyUri = uriBuilder.Uri;\n            using (var resolver = new AssemblyResolver())\n            {\n                Type resolvedType =\n                    Type.GetType(\n                        \"TestModules.ModuleInLoadedFromContext1Class, ModuleInLoadedFromContext1, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null\");\n                Assert.Null(resolvedType);\n\n                resolver.LoadAssemblyFrom(assemblyUri.ToString());\n\n                resolvedType =\n                    Type.GetType(\n                        \"TestModules.ModuleInLoadedFromContext1Class, ModuleInLoadedFromContext1, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null\");\n                Assert.NotNull(resolvedType);\n            }\n        }\n\n        [Fact]\n        public void ShouldResolvePartialAssemblyName()\n        {\n            string assemblyPath = CompilerHelper.GenerateDynamicModule(\"ModuleInLoadedFromContext2\", \"Module\", ModulesDirectory1 + @\"\\ModuleInLoadedFromContext2.dll\");\n            var uriBuilder = new UriBuilder\n            {\n                Host = String.Empty,\n                Scheme = Uri.UriSchemeFile,\n                Path = Path.GetFullPath(assemblyPath)\n            };\n            var assemblyUri = uriBuilder.Uri;\n            using (var resolver = new AssemblyResolver())\n            {\n                resolver.LoadAssemblyFrom(assemblyUri.ToString());\n\n                Type resolvedType =\n                    Type.GetType(\"TestModules.ModuleInLoadedFromContext2Class, ModuleInLoadedFromContext2\");\n\n                Assert.NotNull(resolvedType);\n\n                resolvedType =\n                    Type.GetType(\"TestModules.ModuleInLoadedFromContext2Class, ModuleInLoadedFromContext2, Version=0.0.0.0\");\n\n                Assert.NotNull(resolvedType);\n\n                resolvedType =\n                    Type.GetType(\"TestModules.ModuleInLoadedFromContext2Class, ModuleInLoadedFromContext2, Version=0.0.0.0, Culture=neutral\");\n\n                Assert.NotNull(resolvedType);\n            }\n        }\n\n        public void Dispose()\n        {\n            CleanUpDirectories();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Modularity/ConfigurationModuleCatalogFixture.Desktop.cs",
    "content": "\n\nusing System;\nusing System.Configuration;\nusing System.Linq;\nusing Prism.Modularity;\nusing Prism.Wpf.Tests.Mocks;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Modularity\n{\n    public class ConfigurationModuleCatalogFixture\n    {\n        [Fact]\n        public void CanInitConfigModuleEnumerator()\n        {\n            MockConfigurationStore store = new MockConfigurationStore();\n            ConfigurationModuleCatalog catalog = new ConfigurationModuleCatalog\n            {\n                Store = store\n            };\n            Assert.NotNull(catalog);\n        }\n\n        [Fact]\n        public void NullConfigurationStoreThrows()\n        {\n            var ex = Assert.Throws<InvalidOperationException>(() =>\n            {\n                ConfigurationModuleCatalog catalog = new ConfigurationModuleCatalog() { Store = null };\n                catalog.Load();\n            });\n\n        }\n\n        [Fact]\n        public void ShouldReturnAListOfModuleInfo()\n        {\n            MockConfigurationStore store = new MockConfigurationStore\n            {\n                Modules = new[] { new ModuleConfigurationElement(@\"MocksModules\\MockModuleA.dll\", \"TestModules.MockModuleAClass\", \"MockModuleA\", false) }\n            };\n\n            ConfigurationModuleCatalog catalog = new ConfigurationModuleCatalog() { Store = store };\n            catalog.Load();\n\n            var modules = catalog.Modules;\n\n            Assert.NotNull(modules);\n            Assert.Single(modules);\n            Assert.NotEqual(InitializationMode.WhenAvailable, modules.First().InitializationMode);\n            Assert.NotNull(modules.First().Ref);\n            Assert.StartsWith(\"file://\", modules.First().Ref);\n            Assert.Contains(@\"MocksModules/MockModuleA.dll\", modules.First().Ref);\n            Assert.NotNull(modules.First().ModuleType);\n            Assert.Equal(\"TestModules.MockModuleAClass\", modules.First().ModuleType);\n\n        }\n\n        [Fact]\n        public void GetZeroModules()\n        {\n            MockConfigurationStore store = new MockConfigurationStore();\n            ConfigurationModuleCatalog catalog = new ConfigurationModuleCatalog() { Store = store };\n            catalog.Load();\n\n            Assert.Empty(catalog.Modules);\n        }\n\n        [Fact]\n        public void EnumeratesThreeModulesWithDependencies()\n        {\n            var store = new MockConfigurationStore();\n            var module1 = new ModuleConfigurationElement(\"Module1.dll\", \"Test.Module1\", \"Module1\", false)\n            {\n                Dependencies = new ModuleDependencyCollection(\n                new[] { new ModuleDependencyConfigurationElement(\"Module2\") })\n            };\n\n            var module2 = new ModuleConfigurationElement(\"Module2.dll\", \"Test.Module2\", \"Module2\", false)\n            {\n                Dependencies = new ModuleDependencyCollection(\n                new[] { new ModuleDependencyConfigurationElement(\"Module3\") })\n            };\n\n            var module3 = new ModuleConfigurationElement(\"Module3.dll\", \"Test.Module3\", \"Module3\", false);\n            store.Modules = new[] { module3, module2, module1 };\n\n            ConfigurationModuleCatalog catalog = new ConfigurationModuleCatalog() { Store = store };\n            catalog.Load();\n\n            var modules = catalog.Modules;\n\n            Assert.Equal(3, modules.Count());\n            Assert.Contains(modules, module => module.ModuleName == \"Module1\");\n            Assert.Contains(modules, module => module.ModuleName == \"Module2\");\n            Assert.Contains(modules, module => module.ModuleName == \"Module3\");\n        }\n\n        [Fact]\n        public void EnumerateThrowsIfDuplicateNames()\n        {\n            var ex = Assert.Throws<ConfigurationErrorsException>(() =>\n            {\n                MockConfigurationStore store = new MockConfigurationStore();\n                var module1 = new ModuleConfigurationElement(\"Module1.dll\", \"Test.Module1\", \"Module1\", false);\n                var module2 = new ModuleConfigurationElement(\"Module2.dll\", \"Test.Module2\", \"Module1\", false);\n                store.Modules = new[] { module2, module1 };\n                ConfigurationModuleCatalog catalog = new ConfigurationModuleCatalog() { Store = store };\n                catalog.Load();\n            });\n\n        }\n\n        [Fact]\n        public void EnumerateNotThrowsIfDuplicateAssemblyFile()\n        {\n            MockConfigurationStore store = new MockConfigurationStore();\n            var module1 = new ModuleConfigurationElement(\"Module1.dll\", \"Test.Module1\", \"Module1\", false);\n            var module2 = new ModuleConfigurationElement(\"Module1.dll\", \"Test.Module2\", \"Module2\", false);\n            store.Modules = new[] { module2, module1 };\n            ConfigurationModuleCatalog catalog = new ConfigurationModuleCatalog() { Store = store };\n            catalog.Load();\n\n            Assert.Equal(2, catalog.Modules.Count());\n        }\n\n        [Fact]\n        public void GetStartupLoadedModulesDoesntRetrieveOnDemandLoaded()\n        {\n            MockConfigurationStore store = new MockConfigurationStore();\n            var module1 = new ModuleConfigurationElement(\"Module1.dll\", \"Test.Module1\", \"Module1\", false);\n            store.Modules = new[] { module1 };\n\n            ConfigurationModuleCatalog catalog = new ConfigurationModuleCatalog() { Store = store };\n            catalog.Load();\n\n            Assert.Single(catalog.Modules);\n            Assert.Equal<int>(0, catalog.Modules.Count(m => m.InitializationMode != InitializationMode.OnDemand));\n        }\n\n        [Fact]\n        public void GetModulesNotThrownIfModuleSectionIsNotDeclared()\n        {\n            MockNullConfigurationStore store = new MockNullConfigurationStore();\n\n            ConfigurationModuleCatalog catalog = new ConfigurationModuleCatalog() { Store = store };\n            catalog.Load();\n\n            var modules = catalog.Modules;\n\n            Assert.NotNull(modules);\n            Assert.Empty(modules);\n        }\n\n        internal class MockNullConfigurationStore : IConfigurationStore\n        {\n            public ModulesConfigurationSection RetrieveModuleConfigurationSection()\n            {\n                return null;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Modularity/ConfigurationStoreFixture.Desktop.cs",
    "content": "\n\nusing Prism.Modularity;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Modularity\n{\n\n    public class ConfigurationStoreFixture\n    {\n        [Fact]\n        public void ShouldRetrieveModuleConfiguration()\n        {\n            ConfigurationStore store = new ConfigurationStore();\n            var section = store.RetrieveModuleConfigurationSection();\n\n            Assert.NotNull(section);\n            Assert.NotNull(section.Modules);\n            Assert.Single(section.Modules);\n            Assert.NotNull(section.Modules[0].AssemblyFile);\n            Assert.Equal(\"MockModuleA\", section.Modules[0].ModuleName);\n            Assert.NotNull(section.Modules[0].AssemblyFile);\n            Assert.Contains(@\"MocksModules\\MockModuleA.dll\", section.Modules[0].AssemblyFile);\n            Assert.NotNull(section.Modules[0].ModuleType);\n            Assert.True(section.Modules[0].StartupLoaded);\n            Assert.Equal(\"Prism.Wpf.Tests.Mocks.Modules.MockModuleA\", section.Modules[0].ModuleType);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Modularity/DirectoryModuleCatalogFixture.Desktop.cs",
    "content": "#if DEBUG\n\nusing System;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\nusing System.Reflection.Emit;\nusing System.Security.Policy;\nusing System.Threading;\nusing Prism.Modularity;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Modularity\n{\n    public class DirectoryModuleCatalogFixture : IDisposable\n    {\n        private const string ModulesDirectory1 = @\".\\DynamicModules\\MocksModules1\";\n        private const string ModulesDirectory2 = @\".\\DynamicModules\\AttributedModules\";\n        private const string ModulesDirectory3 = @\".\\DynamicModules\\DependantModules\";\n        private const string ModulesDirectory4 = @\".\\DynamicModules\\MocksModules2\";\n        private const string ModulesDirectory5 = @\".\\DynamicModules\\ModulesMainDomain\\\";\n        private const string ModulesDirectory6 = @\".\\DynamicModules\\Special char #\";\n        private const string InvalidModulesDirectory = @\".\\Modularity\";\n\n        public DirectoryModuleCatalogFixture()\n        {\n            CleanUpDirectories();\n        }\n\n        private void CleanUpDirectories()\n        {\n            CompilerHelper.CleanUpDirectory(ModulesDirectory1);\n            CompilerHelper.CleanUpDirectory(ModulesDirectory2);\n            CompilerHelper.CleanUpDirectory(ModulesDirectory3);\n            CompilerHelper.CleanUpDirectory(ModulesDirectory4);\n            CompilerHelper.CleanUpDirectory(ModulesDirectory5);\n            CompilerHelper.CleanUpDirectory(InvalidModulesDirectory);\n        }\n\n        [Fact]\n        public void NullPathThrows()\n        {\n            var ex = Assert.Throws<InvalidOperationException>(() =>\n            {\n                DirectoryModuleCatalog catalog = new DirectoryModuleCatalog();\n                catalog.Load();\n            });\n        }\n\n        [Fact]\n        public void EmptyPathThrows()\n        {\n            var ex = Assert.Throws<InvalidOperationException>(() =>\n            {\n                DirectoryModuleCatalog catalog = new DirectoryModuleCatalog\n                {\n                    ModulePath = string.Empty\n                };\n                catalog.Load();\n            });\n\n        }\n\n        [Fact]\n        public void NonExistentPathThrows()\n        {\n            var ex = Assert.Throws<InvalidOperationException>(() =>\n            {\n                DirectoryModuleCatalog catalog = new DirectoryModuleCatalog\n                {\n                    ModulePath = \"NonExistentPath\"\n                };\n                catalog.Load();\n            });\n        }\n\n        [Fact]\n        public void ShouldReturnAListOfModuleInfo()\n        {\n            CompilerHelper.CompileFile(@\"Prism.Wpf.Tests.Mocks.Modules.MockModuleA.cs\",\n                                       ModulesDirectory1 + @\"\\MockModuleA.dll\");\n\n\n            DirectoryModuleCatalog catalog = new DirectoryModuleCatalog\n            {\n                ModulePath = ModulesDirectory1\n            };\n            catalog.Load();\n\n            var modules = catalog.Modules.ToArray();\n\n            Assert.NotNull(modules);\n            Assert.Single(modules);\n            Assert.NotNull(modules[0].Ref);\n            Assert.StartsWith(\"file://\", modules[0].Ref);\n            Assert.Contains(@\"MockModuleA.dll\", modules[0].Ref);\n            Assert.NotNull(modules[0].ModuleType);\n            Assert.Contains(\"Prism.Wpf.Tests.Mocks.Modules.MockModuleA\", modules[0].ModuleType);\n        }\n\n        [Fact]\n        public void ShouldCorrectlyEscapeRef()\n        {\n            string assemblyPath = ModulesDirectory6 + @\"\\Mock Module #.dll\";\n            CompilerHelper.CompileFile(@\"Prism.Wpf.Tests.Mocks.Modules.MockModuleA.cs\", assemblyPath);\n            string fullAssemblyPath = Path.GetFullPath(assemblyPath);\n\n            DirectoryModuleCatalog catalog = new DirectoryModuleCatalog\n            {\n                ModulePath = ModulesDirectory6\n            };\n            catalog.Load();\n\n            var modules = catalog.Modules.ToArray();\n\n            Assert.NotNull(modules);\n            Assert.Single(modules);\n            Assert.NotNull(modules[0].Ref);\n\n            string moduleRef = modules[0].Ref;\n            // = new Uri(moduleRef);\n            Assert.True(Uri.TryCreate(moduleRef, UriKind.Absolute, out Uri moduleUri));\n\n            Assert.Equal(fullAssemblyPath, moduleUri.LocalPath);\n        }\n\n        //TODO: figure out how ot translat ehtese tests to Xunit\n        //[Fact]\n        //[DeploymentItem(@\"Modularity\\NotAValidDotNetDll.txt.dll\", @\".\\Modularity\")]\n        //public void ShouldNotThrowWithNonValidDotNetAssembly()\n        //{\n        //    DirectoryModuleCatalog catalog = new DirectoryModuleCatalog\n        //    {\n        //        ModulePath = InvalidModulesDirectory\n        //    };\n        //    try\n        //    {\n        //        catalog.Load();\n        //    }\n        //    catch (Exception)\n        //    {\n        //        //Assert.Fail(\"Should not have thrown.\");\n        //    }\n\n        //    var modules = catalog.Modules.ToArray();\n        //    Assert.NotNull(modules);\n        //    Assert.Equal(0, modules.Length);\n        //}\n\n        //[Fact]\n        //[DeploymentItem(@\"Modularity\\NotAValidDotNetDll.txt.dll\", InvalidModulesDirectory)]\n        //public void LoadsValidAssembliesWhenInvalidDllsArePresent()\n        //{\n        //    CompilerHelper.CompileFile(@\"Prism.Wpf.Tests.Mocks.Modules.MockModuleA.cs\",\n        //                               InvalidModulesDirectory + @\"\\MockModuleA.dll\");\n\n        //    DirectoryModuleCatalog catalog = new DirectoryModuleCatalog\n        //    {\n        //        ModulePath = InvalidModulesDirectory\n        //    };\n        //    try\n        //    {\n        //        catalog.Load();\n        //    }\n        //    catch (Exception)\n        //    {\n        //        //Assert.Fail(\"Should not have thrown.\");\n        //    }\n\n        //    var modules = catalog.Modules.ToArray();\n\n        //    Assert.NotNull(modules);\n        //    Assert.Equal(1, modules.Length);\n        //    Assert.NotNull(modules[0].Ref);\n        //    Assert.StartsWith(modules[0].Ref, \"file://\");\n        //    Assert.True(modules[0].Ref.Contains(@\"MockModuleA.dll\"));\n        //    Assert.NotNull(modules[0].ModuleType);\n        //    Assert.Contains(modules[0].ModuleType, \"Prism.Wpf.Tests.Mocks.Modules.MockModuleA\");\n        //}\n\n        [Fact]\n        public void ShouldNotThrowWithLoadFromByteAssemblies()\n        {\n            CompilerHelper.CleanUpDirectory(@\".\\CompileOutput\\\");\n            CompilerHelper.CleanUpDirectory(@\".\\IgnoreLoadFromByteAssembliesTestDir\\\");\n            var results = CompilerHelper.CompileFile(@\"Prism.Wpf.Tests.Mocks.Modules.MockModuleA.cs\",\n                                                     @\".\\CompileOutput\\MockModuleA.dll\");\n\n            CompilerHelper.CompileFile(@\"Prism.Wpf.Tests.Mocks.Modules.MockAttributedModule.cs\",\n                                       @\".\\IgnoreLoadFromByteAssembliesTestDir\\MockAttributedModule.dll\");\n\n            string path = @\".\\IgnoreLoadFromByteAssembliesTestDir\";\n\n            AppDomain testDomain = null;\n            try\n            {\n                testDomain = CreateAppDomain();\n                RemoteDirectoryLookupCatalog remoteEnum = CreateRemoteDirectoryModuleCatalogInAppDomain(testDomain);\n\n                remoteEnum.LoadDynamicEmittedModule();\n\n                remoteEnum.LoadAssembliesByByte(@\".\\CompileOutput\\MockModuleA.dll\");\n\n                var infos = remoteEnum.DoEnumeration(path);\n\n                Assert.NotNull(\n                    infos.FirstOrDefault(x => x.ModuleType.IndexOf(\"Prism.Wpf.Tests.Mocks.Modules.MockAttributedModule\") >= 0)\n                    );\n            }\n            finally\n            {\n                if (testDomain != null)\n                    AppDomain.Unload(testDomain);\n            }\n        }\n\n        [Fact]\n        public void ShouldGetModuleNameFromAttribute()\n        {\n            CompilerHelper.CompileFile(@\"Prism.Wpf.Tests.Mocks.Modules.MockAttributedModule.cs\",\n                                       ModulesDirectory2 + @\"\\MockAttributedModule.dll\");\n\n\n            DirectoryModuleCatalog catalog = new DirectoryModuleCatalog\n            {\n                ModulePath = ModulesDirectory2\n            };\n            catalog.Load();\n\n            var modules = catalog.Modules.ToArray();\n\n            Assert.Single(modules);\n            Assert.Equal(\"TestModule\", modules[0].ModuleName);\n        }\n\n        [Fact]\n        public void ShouldGetDependantModulesFromAttribute()\n        {\n            CompilerHelper.CompileFile(@\"Prism.Wpf.Tests.Mocks.Modules.MockDependencyModule.cs\",\n                                       ModulesDirectory3 + @\"\\DependencyModule.dll\");\n\n            CompilerHelper.CompileFile(@\"Prism.Wpf.Tests.Mocks.Modules.MockDependantModule.cs\",\n                                       ModulesDirectory3 + @\"\\DependantModule.dll\");\n\n            DirectoryModuleCatalog catalog = new DirectoryModuleCatalog\n            {\n                ModulePath = ModulesDirectory3\n            };\n            catalog.Load();\n\n            var modules = catalog.Modules.ToArray();\n\n            Assert.Equal(2, modules.Length);\n            var dependantModule = modules.First(module => module.ModuleName == \"DependantModule\");\n            var dependencyModule = modules.First(module => module.ModuleName == \"DependencyModule\");\n            Assert.NotNull(dependantModule);\n            Assert.NotNull(dependencyModule);\n            Assert.NotNull(dependantModule.DependsOn);\n            Assert.Single(dependantModule.DependsOn);\n            Assert.Equal(dependencyModule.ModuleName, dependantModule.DependsOn[0]);\n        }\n\n        [Fact]\n        public void UseClassNameAsModuleNameWhenNotSpecifiedInAttribute()\n        {\n            CompilerHelper.CompileFile(@\"Prism.Wpf.Tests.Mocks.Modules.MockModuleA.cs\",\n                                       ModulesDirectory1 + @\"\\MockModuleA.dll\");\n\n            DirectoryModuleCatalog catalog = new DirectoryModuleCatalog\n            {\n                ModulePath = ModulesDirectory1\n            };\n            catalog.Load();\n\n            var modules = catalog.Modules.ToArray();\n\n            Assert.NotNull(modules);\n            Assert.Equal(\"MockModuleA\", modules[0].ModuleName);\n        }\n\n        [Fact]\n        public void ShouldDefaultInitializationModeToWhenAvailable()\n        {\n            CompilerHelper.CompileFile(@\"Prism.Wpf.Tests.Mocks.Modules.MockModuleA.cs\",\n                                       ModulesDirectory1 + @\"\\MockModuleA.dll\");\n\n            DirectoryModuleCatalog catalog = new DirectoryModuleCatalog\n            {\n                ModulePath = ModulesDirectory1\n            };\n            catalog.Load();\n\n            var modules = catalog.Modules.ToArray();\n\n            Assert.NotNull(modules);\n            Assert.Equal(InitializationMode.WhenAvailable, modules[0].InitializationMode);\n        }\n\n        [Fact]\n        public void ShouldGetOnDemandFromAttribute()\n        {\n            CompilerHelper.CompileFile(@\"Prism.Wpf.Tests.Mocks.Modules.MockAttributedModule.cs\",\n                                       ModulesDirectory3 + @\"\\MockAttributedModule.dll\");\n\n            DirectoryModuleCatalog catalog = new DirectoryModuleCatalog\n            {\n                ModulePath = ModulesDirectory3\n            };\n            catalog.Load();\n\n            var modules = catalog.Modules.ToArray();\n\n            Assert.Single(modules);\n            Assert.Equal(InitializationMode.OnDemand, modules[0].InitializationMode);\n\n        }\n\n        [Fact]\n        public void ShouldNotLoadAssembliesInCurrentAppDomain()\n        {\n            CompilerHelper.CompileFile(@\"Prism.Wpf.Tests.Mocks.Modules.MockModuleA.cs\",\n                                       ModulesDirectory4 + @\"\\MockModuleA.dll\");\n\n            DirectoryModuleCatalog catalog = new DirectoryModuleCatalog\n            {\n                ModulePath = ModulesDirectory4\n            };\n            catalog.Load();\n\n            var modules = catalog.Modules.ToArray();\n\n            // filtering out dynamic assemblies due to using a dynamic mocking framework.\n            Assembly loadedAssembly = AppDomain.CurrentDomain.GetAssemblies().Where(assembly => !assembly.IsDynamic)\n                .Where(assembly => assembly.Location.Equals(modules[0].Ref, StringComparison.InvariantCultureIgnoreCase))\n                .FirstOrDefault();\n            Assert.Null(loadedAssembly);\n        }\n\n        [Fact]\n        public void ShouldNotGetModuleInfoForAnAssemblyAlreadyLoadedInTheMainDomain()\n        {\n            var assemblyPath = Assembly.GetCallingAssembly().Location;\n            DirectoryModuleCatalog catalog = new DirectoryModuleCatalog\n            {\n                ModulePath = ModulesDirectory5\n            };\n            catalog.Load();\n\n            var modules = catalog.Modules.ToArray();\n\n            Assert.Empty(modules);\n        }\n\n        [Fact]\n        public void ShouldLoadAssemblyEvenIfTheyAreReferencingEachOther()\n        {\n            CompilerHelper.CompileFile(@\"Prism.Wpf.Tests.Mocks.Modules.MockModuleA.cs\",\n                                       ModulesDirectory4 + @\"\\MockModuleZZZ.dll\");\n\n            CompilerHelper.CompileFile(@\"Prism.Wpf.Tests.Mocks.Modules.MockModuleReferencingOtherModule.cs\",\n                                       ModulesDirectory4 + @\"\\MockModuleReferencingOtherModule.dll\", ModulesDirectory4 + @\"\\MockModuleZZZ.dll\");\n\n            DirectoryModuleCatalog catalog = new DirectoryModuleCatalog\n            {\n                ModulePath = ModulesDirectory4\n            };\n            catalog.Load();\n\n            var modules = catalog.Modules.ToArray();\n\n            Assert.Equal(2, modules.Count());\n        }\n        //Disabled Warning\t\n        // 'System.Security.Policy.Evidence.Count' is obsolete: '\n        // \"Evidence should not be treated as an ICollection. Please use GetHostEnumerator and GetAssemblyEnumerator to \n        // iterate over the evidence to collect a count.\"'\n#pragma warning disable 0618\n        [Fact]\n        public void CreateChildAppDomainHasParentEvidenceAndSetup()\n        {\n            TestableDirectoryModuleCatalog catalog = new TestableDirectoryModuleCatalog\n            {\n                ModulePath = ModulesDirectory4\n            };\n            catalog.Load();\n            Evidence parentEvidence = new Evidence();\n            AppDomainSetup parentSetup = new AppDomainSetup\n            {\n                ApplicationName = \"Test Parent\"\n            };\n            AppDomain parentAppDomain = AppDomain.CreateDomain(\"Parent\", parentEvidence, parentSetup);\n            AppDomain childDomain = catalog.BuildChildDomain(parentAppDomain);\n\n            Assert.Equal(parentEvidence.Count, childDomain.Evidence.Count);\n            Assert.Equal(\"Test Parent\", childDomain.SetupInformation.ApplicationName);\n            Assert.NotEqual(AppDomain.CurrentDomain.Evidence.Count, childDomain.Evidence.Count);\n            Assert.NotEqual(AppDomain.CurrentDomain.SetupInformation.ApplicationName, childDomain.SetupInformation.ApplicationName);\n        }\n#pragma warning restore 0618\n\n        [Fact]\n        public void ShouldLoadFilesEvenIfDynamicAssemblyExists()\n        {\n            CompilerHelper.CleanUpDirectory(@\".\\CompileOutput\\\");\n            CompilerHelper.CleanUpDirectory(@\".\\IgnoreDynamicGeneratedFilesTestDir\\\");\n            CompilerHelper.CompileFile(@\"Prism.Wpf.Tests.Mocks.Modules.MockAttributedModule.cs\",\n                                       @\".\\IgnoreDynamicGeneratedFilesTestDir\\MockAttributedModule.dll\");\n\n            string path = @\".\\IgnoreDynamicGeneratedFilesTestDir\";\n\n            AppDomain testDomain = null;\n            try\n            {\n                testDomain = CreateAppDomain();\n                RemoteDirectoryLookupCatalog remoteEnum = CreateRemoteDirectoryModuleCatalogInAppDomain(testDomain);\n\n                remoteEnum.LoadDynamicEmittedModule();\n\n                var infos = remoteEnum.DoEnumeration(path);\n\n                Assert.NotNull(\n                    infos.FirstOrDefault(x => x.ModuleType.IndexOf(\"Prism.Wpf.Tests.Mocks.Modules.MockAttributedModule\") >= 0)\n                    );\n            }\n            finally\n            {\n                if (testDomain != null)\n                    AppDomain.Unload(testDomain);\n            }\n        }\n\n        [Fact]\n        public void ShouldLoadAssemblyEvenIfIsExposingTypesFromAnAssemblyInTheGac()\n        {\n            CompilerHelper.CompileFile(@\"Prism.Wpf.Tests.Mocks.Modules.MockExposingTypeFromGacAssemblyModule.cs\",\n                                       ModulesDirectory4 + @\"\\MockExposingTypeFromGacAssemblyModule.dll\", @\"System.Transactions.dll\");\n\n            DirectoryModuleCatalog catalog = new DirectoryModuleCatalog\n            {\n                ModulePath = ModulesDirectory4\n            };\n            catalog.Load();\n\n            var modules = catalog.Modules.ToArray();\n\n            Assert.Single(modules);\n        }\n\n        [Fact]\n        public void ShouldNotFailWhenAlreadyLoadedAssembliesAreAlsoFoundOnTargetDirectory()\n        {\n            CompilerHelper.CompileFile(@\"Prism.Wpf.Tests.Mocks.Modules.MockModuleA.cs\",\n                                       ModulesDirectory1 + @\"\\MockModuleA.dll\");\n\n            string filename = typeof(DirectoryModuleCatalog).Assembly.Location;\n            string destinationFileName = Path.Combine(ModulesDirectory1, Path.GetFileName(filename));\n            File.Copy(filename, destinationFileName);\n\n            DirectoryModuleCatalog catalog = new DirectoryModuleCatalog\n            {\n                ModulePath = ModulesDirectory1\n            };\n            catalog.Load();\n\n            var modules = catalog.Modules.ToArray();\n            Assert.Single(modules);\n        }\n\n        [Fact]\n        public void ShouldIgnoreAbstractClassesThatImplementIModule()\n        {\n            CompilerHelper.CleanUpDirectory(ModulesDirectory1);\n            CompilerHelper.CompileFile(@\"Prism.Wpf.Tests.Mocks.Modules.MockAbstractModule.cs\",\n                                     ModulesDirectory1 + @\"\\MockAbstractModule.dll\");\n\n            string filename = typeof(DirectoryModuleCatalog).Assembly.Location;\n            string destinationFileName = Path.Combine(ModulesDirectory1, Path.GetFileName(filename));\n            File.Copy(filename, destinationFileName);\n\n            DirectoryModuleCatalog catalog = new DirectoryModuleCatalog\n            {\n                ModulePath = ModulesDirectory1\n            };\n            catalog.Load();\n\n            var modules = catalog.Modules.ToArray();\n            Assert.Single(modules);\n            Assert.Equal(\"MockInheritingModule\", modules[0].ModuleName);\n\n            CompilerHelper.CleanUpDirectory(ModulesDirectory1);\n        }\n\n\n\n\n        private AppDomain CreateAppDomain()\n        {\n            Evidence evidence = AppDomain.CurrentDomain.Evidence;\n            AppDomainSetup setup = AppDomain.CurrentDomain.SetupInformation;\n\n            return AppDomain.CreateDomain(\"TestDomain\", evidence, setup);\n        }\n\n        private RemoteDirectoryLookupCatalog CreateRemoteDirectoryModuleCatalogInAppDomain(AppDomain testDomain)\n        {\n            RemoteDirectoryLookupCatalog remoteEnum;\n            Type remoteEnumType = typeof(RemoteDirectoryLookupCatalog);\n\n            remoteEnum = (RemoteDirectoryLookupCatalog)testDomain.CreateInstanceFrom(\n                                               remoteEnumType.Assembly.Location, remoteEnumType.FullName).Unwrap();\n            return remoteEnum;\n        }\n\n        public void Dispose()\n        {\n            CleanUpDirectories();\n        }\n\n        private class TestableDirectoryModuleCatalog : DirectoryModuleCatalog\n        {\n            public new AppDomain BuildChildDomain(AppDomain currentDomain)\n            {\n                return base.BuildChildDomain(currentDomain);\n            }\n        }\n\n\n        private class RemoteDirectoryLookupCatalog : MarshalByRefObject\n        {\n\n            public void LoadAssembliesByByte(string assemblyPath)\n            {\n                byte[] assemblyBytes = File.ReadAllBytes(assemblyPath);\n                AppDomain.CurrentDomain.Load(assemblyBytes);\n            }\n\n            public IModuleInfo[] DoEnumeration(string path)\n            {\n                DirectoryModuleCatalog catalog = new DirectoryModuleCatalog\n                {\n                    ModulePath = path\n                };\n                catalog.Load();\n                return catalog.Modules.ToArray();\n            }\n\n            public void LoadDynamicEmittedModule()\n            {\n                // create a dynamic assembly and module \n                AssemblyName assemblyName = new AssemblyName\n                {\n                    Name = \"DynamicBuiltAssembly\"\n                };\n                AssemblyBuilder assemblyBuilder = Thread.GetDomain().DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.RunAndSave);\n                ModuleBuilder module = assemblyBuilder.DefineDynamicModule(\"DynamicBuiltAssembly.dll\");\n\n                // create a new type\n                TypeBuilder typeBuilder = module.DefineType(\"DynamicBuiltType\", TypeAttributes.Public | TypeAttributes.Class);\n\n                // Create the type\n                Type helloWorldType = typeBuilder.CreateType();\n\n            }\n        }\n    }\n}\n#endif\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Modularity/FileModuleTypeLoaderFixture.Desktop.cs",
    "content": "\n\nusing System;\nusing System.Collections.ObjectModel;\nusing Moq;\nusing Prism.Modularity;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Modularity\n{\n\n    public class FileModuleTypeLoaderFixture\n    {\n        [Fact]\n        public void CanRetrieveModule()\n        {\n            var assemblyResolver = new MockAssemblyResolver();\n            var retriever = new FileModuleTypeLoader(assemblyResolver);\n            string assembly = CompilerHelper.GenerateDynamicModule(\"FileModuleA\", null);\n            string assemblyRef = \"file://\" + assembly;\n            var fileModuleInfo = CreateModuleInfo(assemblyRef, \"TestModules.FileModuleAClass\", \"ModuleA\", true, null);\n\n            bool loadCompleted = false;\n            retriever.LoadModuleCompleted += delegate (object sender, LoadModuleCompletedEventArgs e)\n            {\n                loadCompleted = true;\n            };\n\n            retriever.LoadModuleType(fileModuleInfo);\n\n            Assert.True(loadCompleted);\n            Assert.Equal(assemblyRef, assemblyResolver.LoadAssemblyFromArgument);\n        }\n\n        [Fact]\n        public void ShouldReturnErrorToCallback()\n        {\n            var assemblyResolver = new MockAssemblyResolver();\n            var retriever = new FileModuleTypeLoader(assemblyResolver);\n            var fileModuleInfo = CreateModuleInfo(\"NonExistentFile.dll\", \"NonExistentModule\", \"NonExistent\", true, null);\n\n            assemblyResolver.ThrowOnLoadAssemblyFrom = true;\n            Exception resultException = null;\n\n            bool loadCompleted = false;\n            retriever.LoadModuleCompleted += delegate (object sender, LoadModuleCompletedEventArgs e)\n            {\n                loadCompleted = true;\n                resultException = e.Error;\n            };\n\n            retriever.LoadModuleType(fileModuleInfo);\n\n            Assert.True(loadCompleted);\n            Assert.NotNull(resultException);\n        }\n\n        [Fact]\n        public void CanRetrieveWithCorrectRef()\n        {\n            var retriever = new FileModuleTypeLoader();\n            var moduleInfo = new ModuleInfo() { Ref = \"file://somefile\" };\n\n            Assert.True(retriever.CanLoadModuleType(moduleInfo));\n        }\n\n        [Fact]\n        public void CannotRetrieveWithIncorrectRef()\n        {\n            var retriever = new FileModuleTypeLoader();\n            var moduleInfo = new ModuleInfo() { Ref = \"NotForLocalRetrieval\" };\n\n            Assert.False(retriever.CanLoadModuleType(moduleInfo));\n        }\n\n\n        [Fact]\n        public void FileModuleTypeLoaderCanBeDisposed()\n        {\n            var typeLoader = new FileModuleTypeLoader();\n            var disposable = typeLoader as IDisposable;\n\n            Assert.NotNull(disposable);\n        }\n\n        [Fact]\n        public void FileModuleTypeLoaderDisposeNukesAssemblyResolver()\n        {\n            Mock<IAssemblyResolver> mockResolver = new Mock<IAssemblyResolver>();\n            var disposableMockResolver = mockResolver.As<IDisposable>();\n            disposableMockResolver.Setup(resolver => resolver.Dispose());\n\n            var typeLoader = new FileModuleTypeLoader(mockResolver.Object);\n\n            typeLoader.Dispose();\n\n            disposableMockResolver.Verify(resolver => resolver.Dispose(), Times.Once());\n        }\n\n        [Fact]\n        public void FileModuleTypeLoaderDisposeDoesNotThrowWithNonDisposableAssemblyResolver()\n        {\n            Mock<IAssemblyResolver> mockResolver = new Mock<IAssemblyResolver>();\n            var typeLoader = new FileModuleTypeLoader(mockResolver.Object);\n            try\n            {\n                typeLoader.Dispose();\n            }\n            catch (Exception)\n            {\n                //Assert.Fail();\n            }\n        }\n\n        private static ModuleInfo CreateModuleInfo(string assemblyFile, string moduleType, string moduleName, bool startupLoaded, params string[] dependsOn)\n        {\n            ModuleInfo moduleInfo = new ModuleInfo(moduleName, moduleType)\n            {\n                InitializationMode = startupLoaded ? InitializationMode.WhenAvailable : InitializationMode.OnDemand,\n                Ref = assemblyFile,\n            };\n            if (dependsOn != null)\n            {\n                moduleInfo.DependsOn.AddRange(dependsOn);\n            }\n\n            return moduleInfo;\n        }\n    }\n\n    internal class MockAssemblyResolver : IAssemblyResolver\n    {\n        public string LoadAssemblyFromArgument;\n        public bool ThrowOnLoadAssemblyFrom;\n\n        public void LoadAssemblyFrom(string assemblyFilePath)\n        {\n            LoadAssemblyFromArgument = assemblyFilePath;\n            if (ThrowOnLoadAssemblyFrom)\n                throw new Exception();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Modularity/ModuleAttributeFixture.Desktop.cs",
    "content": "\n\nusing Prism.Modularity;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Modularity\n{\n\n    public class ModuleAttributeFixture\n    {\n        [Fact]\n        public void StartupLoadedDefaultsToTrue()\n        {\n            var moduleAttribute = new ModuleAttribute();\n\n            Assert.False(moduleAttribute.OnDemand);\n        }\n\n        [Fact]\n        public void CanGetAndSetProperties()\n        {\n            var moduleAttribute = new ModuleAttribute();\n            moduleAttribute.ModuleName = \"Test\";\n            moduleAttribute.OnDemand = true;\n\n            Assert.Equal(\"Test\", moduleAttribute.ModuleName);\n            Assert.True(moduleAttribute.OnDemand);\n        }\n\n        [Fact]\n        public void ModuleDependencyAttributeStoresModuleName()\n        {\n            var moduleDependencyAttribute = new ModuleDependencyAttribute(\"Test\");\n\n            Assert.Equal(\"Test\", moduleDependencyAttribute.ModuleName);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Modularity/ModuleCatalogFixture.cs",
    "content": "\n\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\nusing Prism.Modularity;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Modularity\n{\n    public class ModuleCatalogFixture\n    {\n        [Fact]\n        public void CanCreateCatalogFromList()\n        {\n            var moduleInfo = new ModuleInfo(\"MockModule\", \"type\");\n            List<ModuleInfo> moduleInfos = new List<ModuleInfo> { moduleInfo };\n\n            var moduleCatalog = new ModuleCatalog(moduleInfos);\n\n            Assert.Single(moduleCatalog.Modules);\n            Assert.Equal(moduleInfo, moduleCatalog.Modules.ElementAt(0));\n        }\n\n        [Fact]\n        public void CanGetDependenciesForModule()\n        {\n            // A <- B\n            var moduleInfoA = CreateModuleInfo(\"A\");\n            var moduleInfoB = CreateModuleInfo(\"B\", \"A\");\n            List<ModuleInfo> moduleInfos = new List<ModuleInfo>\n                                               {\n                                                   moduleInfoA\n                                                   , moduleInfoB\n                                               };\n            var moduleCatalog = new ModuleCatalog(moduleInfos);\n\n            var dependentModules = moduleCatalog.GetDependentModules(moduleInfoB);\n\n            Assert.Single(dependentModules);\n            Assert.Equal(moduleInfoA, dependentModules.ElementAt(0));\n        }\n\n        [Fact]\n        public void CanCompleteListWithTheirDependencies()\n        {\n            // A <- B <- C\n            var moduleInfoA = CreateModuleInfo(\"A\");\n            var moduleInfoB = CreateModuleInfo(\"B\", \"A\");\n            var moduleInfoC = CreateModuleInfo(\"C\", \"B\");\n            var moduleInfoOrphan = CreateModuleInfo(\"X\", \"B\");\n\n            List<ModuleInfo> moduleInfos = new List<ModuleInfo>\n                                               {\n                                                   moduleInfoA\n                                                   , moduleInfoB\n                                                   , moduleInfoC\n                                                   , moduleInfoOrphan\n                                               };\n            var moduleCatalog = new ModuleCatalog(moduleInfos);\n\n            var dependantModules = moduleCatalog.CompleteListWithDependencies(new[] { moduleInfoC });\n\n            Assert.Equal(3, dependantModules.Count());\n            Assert.Contains(moduleInfoA, dependantModules);\n            Assert.Contains(moduleInfoB, dependantModules);\n            Assert.Contains(moduleInfoC, dependantModules);\n        }\n\n        [Fact]\n        public void ShouldThrowOnCyclicDependency()\n        {\n            var ex = Assert.Throws<CyclicDependencyFoundException>(() =>\n            {\n                // A <- B <- C <- A\n                var moduleInfoA = CreateModuleInfo(\"A\", \"C\");\n                var moduleInfoB = CreateModuleInfo(\"B\", \"A\");\n                var moduleInfoC = CreateModuleInfo(\"C\", \"B\");\n\n                List<ModuleInfo> moduleInfos = new List<ModuleInfo>\n                                               {\n                                                   moduleInfoA\n                                                   , moduleInfoB\n                                                   , moduleInfoC\n                                               };\n                new ModuleCatalog(moduleInfos).Validate();\n            });\n\n        }\n\n\n        [Fact]\n        public void ShouldThrowOnDuplicateModule()\n        {\n            var ex = Assert.Throws<DuplicateModuleException>(() =>\n            {\n                var moduleInfoA1 = CreateModuleInfo(\"A\");\n                var moduleInfoA2 = CreateModuleInfo(\"A\");\n\n                List<ModuleInfo> moduleInfos = new List<ModuleInfo>\n                                               {\n                                                   moduleInfoA1\n                                                   , moduleInfoA2\n                                               };\n                new ModuleCatalog(moduleInfos).Validate();\n            });\n        }\n\n        [Fact]\n        public void ShouldThrowOnMissingDependency()\n        {\n            var ex = Assert.Throws<ModularityException>(() =>\n            {\n                var moduleInfoA = CreateModuleInfo(\"A\", \"B\");\n\n                List<ModuleInfo> moduleInfos = new List<ModuleInfo>\n                                               {\n                                                   moduleInfoA\n                                               };\n                new ModuleCatalog(moduleInfos).Validate();\n            });\n        }\n\n        [Fact]\n        public void CanAddModules()\n        {\n            var catalog = new ModuleCatalog();\n\n            catalog.AddModule(typeof(MockModule));\n\n            Assert.Single(catalog.Modules);\n            Assert.Equal(\"MockModule\", catalog.Modules.First().ModuleName);\n        }\n\n        [Fact]\n        public void CanAddGroups()\n        {\n            var catalog = new ModuleCatalog();\n\n            ModuleInfo moduleInfo = new ModuleInfo();\n            ModuleInfoGroup group = new ModuleInfoGroup { moduleInfo };\n            catalog.Items.Add(group);\n\n            Assert.Single(catalog.Modules);\n            Assert.Same(moduleInfo, catalog.Modules.ElementAt(0));\n        }\n\n        [Fact]\n        public void ShouldAggregateGroupsAndLooseModuleInfos()\n        {\n            var catalog = new ModuleCatalog();\n            ModuleInfo moduleInfo1 = new ModuleInfo();\n            ModuleInfo moduleInfo2 = new ModuleInfo();\n            ModuleInfo moduleInfo3 = new ModuleInfo();\n\n            catalog.Items.Add(new ModuleInfoGroup() { moduleInfo1 });\n            catalog.Items.Add(new ModuleInfoGroup() { moduleInfo2 });\n            catalog.AddModule(moduleInfo3);\n\n            Assert.Equal(3, catalog.Modules.Count());\n            Assert.Contains(moduleInfo1, catalog.Modules);\n            Assert.Contains(moduleInfo2, catalog.Modules);\n            Assert.Contains(moduleInfo3, catalog.Modules);\n        }\n\n        [Fact]\n        public void CompleteListWithDependenciesThrowsWithNull()\n        {\n            var ex = Assert.Throws<ArgumentNullException>(() =>\n            {\n                var catalog = new ModuleCatalog();\n                catalog.CompleteListWithDependencies(null);\n            });\n\n        }\n\n        [Fact]\n        public void LooseModuleIfDependentOnModuleInGroupThrows()\n        {\n            var catalog = new ModuleCatalog();\n            catalog.Items.Add(new ModuleInfoGroup() { CreateModuleInfo(\"ModuleA\") });\n            catalog.AddModule(CreateModuleInfo(\"ModuleB\", \"ModuleA\"));\n\n            try\n            {\n                catalog.Validate();\n            }\n            catch (Exception ex)\n            {\n                Assert.IsType<ModularityException>(ex);\n                Assert.Equal(\"ModuleB\", ((ModularityException)ex).ModuleName);\n\n                return;\n            }\n\n            //Assert.Fail(\"Exception not thrown.\");\n        }\n\n        [Fact]\n        public void ModuleInGroupDependsOnModuleInOtherGroupThrows()\n        {\n            var catalog = new ModuleCatalog();\n            catalog.Items.Add(new ModuleInfoGroup() { CreateModuleInfo(\"ModuleA\") });\n            catalog.Items.Add(new ModuleInfoGroup() { CreateModuleInfo(\"ModuleB\", \"ModuleA\") });\n\n            try\n            {\n                catalog.Validate();\n            }\n            catch (Exception ex)\n            {\n                Assert.IsType<ModularityException>(ex);\n                Assert.Equal(\"ModuleB\", ((ModularityException)ex).ModuleName);\n\n                return;\n            }\n\n            //Assert.Fail(\"Exception not thrown.\");\n        }\n\n        [Fact]\n        public void ShouldRevalidateWhenAddingNewModuleIfValidated()\n        {\n            var testableCatalog = new TestableModuleCatalog();\n            testableCatalog.Items.Add(new ModuleInfoGroup() { CreateModuleInfo(\"ModuleA\") });\n            testableCatalog.Validate();\n            testableCatalog.Items.Add(new ModuleInfoGroup() { CreateModuleInfo(\"ModuleB\") });\n            Assert.True(testableCatalog.ValidateCalled);\n        }\n\n        [Fact]\n        public void ModuleInGroupCanDependOnModuleInSameGroup()\n        {\n            var catalog = new ModuleCatalog();\n            var moduleA = CreateModuleInfo(\"ModuleA\");\n            var moduleB = CreateModuleInfo(\"ModuleB\", \"ModuleA\");\n            catalog.Items.Add(new ModuleInfoGroup()\n                                  {\n                                      moduleA,\n                                      moduleB\n                                  });\n\n            var moduleBDependencies = catalog.GetDependentModules(moduleB);\n\n            Assert.Single(moduleBDependencies);\n            Assert.Equal(moduleA, moduleBDependencies.First());\n\n        }\n\n        [Fact]\n        public void StartupModuleDependentOnAnOnDemandModuleThrows()\n        {\n            var catalog = new ModuleCatalog();\n            var moduleOnDemand = CreateModuleInfo(\"ModuleA\");\n            moduleOnDemand.InitializationMode = InitializationMode.OnDemand;\n            catalog.AddModule(moduleOnDemand);\n            catalog.AddModule(CreateModuleInfo(\"ModuleB\", \"ModuleA\"));\n\n            try\n            {\n                catalog.Validate();\n            }\n            catch (Exception ex)\n            {\n                Assert.IsType<ModularityException>(ex);\n                Assert.Equal(\"ModuleB\", ((ModularityException)ex).ModuleName);\n\n                return;\n            }\n\n            //Assert.Fail(\"Exception not thrown.\");\n        }\n\n        [Fact]\n        public void ShouldReturnInCorrectRetrieveOrderWhenCompletingListWithDependencies()\n        {\n            // A <- B <- C <- D,    C <- X\n            var moduleA = CreateModuleInfo(\"A\");\n            var moduleB = CreateModuleInfo(\"B\", \"A\");\n            var moduleC = CreateModuleInfo(\"C\", \"B\");\n            var moduleD = CreateModuleInfo(\"D\", \"C\");\n            var moduleX = CreateModuleInfo(\"X\", \"C\");\n\n            var moduleCatalog = new ModuleCatalog();\n            // Add the modules in random order\n            moduleCatalog.AddModule(moduleB);\n            moduleCatalog.AddModule(moduleA);\n            moduleCatalog.AddModule(moduleD);\n            moduleCatalog.AddModule(moduleX);\n            moduleCatalog.AddModule(moduleC);\n\n            var dependantModules = moduleCatalog.CompleteListWithDependencies(new[] { moduleD, moduleX }).ToList();\n\n            Assert.Equal(5, dependantModules.Count);\n            Assert.True(dependantModules.IndexOf(moduleA) < dependantModules.IndexOf(moduleB));\n            Assert.True(dependantModules.IndexOf(moduleB) < dependantModules.IndexOf(moduleC));\n            Assert.True(dependantModules.IndexOf(moduleC) < dependantModules.IndexOf(moduleD));\n            Assert.True(dependantModules.IndexOf(moduleC) < dependantModules.IndexOf(moduleX));\n        }\n\n        [Fact]\n        public void ShouldLoadAndValidateOnInitialize()\n        {\n            var catalog = new TestableModuleCatalog();\n\n            var testableCatalog = new TestableModuleCatalog();\n            Assert.False(testableCatalog.LoadCalled);\n            Assert.False(testableCatalog.ValidateCalled);\n\n            testableCatalog.Initialize();\n            Assert.True(testableCatalog.LoadCalled);\n            Assert.True(testableCatalog.ValidateCalled);\n            Assert.True(testableCatalog.LoadCalledFirst);\n        }\n\n        [Fact]\n        public void ShouldNotLoadAgainIfInitializedCalledMoreThanOnce()\n        {\n            var catalog = new TestableModuleCatalog();\n\n            var testableCatalog = new TestableModuleCatalog();\n            Assert.False(testableCatalog.LoadCalled);\n            Assert.False(testableCatalog.ValidateCalled);\n\n            testableCatalog.Initialize();\n            Assert.Equal<int>(1, testableCatalog.LoadCalledCount);\n            testableCatalog.Initialize();\n            Assert.Equal<int>(1, testableCatalog.LoadCalledCount);\n        }\n\n        [Fact]\n        public void ShouldNotLoadAgainDuringInitialize()\n        {\n            var catalog = new TestableModuleCatalog();\n\n            var testableCatalog = new TestableModuleCatalog();\n            Assert.False(testableCatalog.LoadCalled);\n            Assert.False(testableCatalog.ValidateCalled);\n\n            testableCatalog.Load();\n            Assert.Equal<int>(1, testableCatalog.LoadCalledCount);\n            testableCatalog.Initialize();\n            Assert.Equal<int>(1, testableCatalog.LoadCalledCount);\n        }\n\n\n        [Fact]\n        public void ShouldAllowLoadToBeInvokedTwice()\n        {\n            var catalog = new TestableModuleCatalog();\n\n            var testableCatalog = new TestableModuleCatalog();\n            testableCatalog.Load();\n            Assert.Equal<int>(1, testableCatalog.LoadCalledCount);\n            testableCatalog.Load();\n            Assert.Equal<int>(2, testableCatalog.LoadCalledCount);\n        }\n\n        [Fact]\n        public void CanAddModule1()\n        {\n            ModuleCatalog catalog = new ModuleCatalog();\n\n            catalog.AddModule(\"Module\", \"ModuleType\", InitializationMode.OnDemand, \"DependsOn1\", \"DependsOn2\");\n\n            Assert.Single(catalog.Modules);\n            Assert.Equal(\"Module\", catalog.Modules.First().ModuleName);\n            Assert.Equal(\"ModuleType\", catalog.Modules.First().ModuleType);\n            Assert.Equal(InitializationMode.OnDemand, catalog.Modules.First().InitializationMode);\n            Assert.Equal(2, catalog.Modules.First().DependsOn.Count);\n            Assert.Equal(\"DependsOn1\", catalog.Modules.First().DependsOn[0]);\n            Assert.Equal(\"DependsOn2\", catalog.Modules.First().DependsOn[1]);\n\n        }\n\n        [Fact]\n        public void CanAddModule2()\n        {\n            ModuleCatalog catalog = new ModuleCatalog();\n\n            catalog.AddModule(\"Module\", \"ModuleType\", \"DependsOn1\", \"DependsOn2\");\n\n            Assert.Single(catalog.Modules);\n            Assert.Equal(\"Module\", catalog.Modules.First().ModuleName);\n            Assert.Equal(\"ModuleType\", catalog.Modules.First().ModuleType);\n            Assert.Equal(InitializationMode.WhenAvailable, catalog.Modules.First().InitializationMode);\n            Assert.Equal(2, catalog.Modules.First().DependsOn.Count);\n            Assert.Equal(\"DependsOn1\", catalog.Modules.First().DependsOn[0]);\n            Assert.Equal(\"DependsOn2\", catalog.Modules.First().DependsOn[1]);\n\n        }\n        [Fact]\n        public void CanAddModule3()\n        {\n            ModuleCatalog catalog = new ModuleCatalog();\n\n            catalog.AddModule(typeof(MockModule), InitializationMode.OnDemand, \"DependsOn1\", \"DependsOn2\");\n\n            Assert.Single(catalog.Modules);\n            Assert.Equal(\"MockModule\", catalog.Modules.First().ModuleName);\n            Assert.Equal(typeof(MockModule).AssemblyQualifiedName, catalog.Modules.First().ModuleType);\n            Assert.Equal(InitializationMode.OnDemand, catalog.Modules.First().InitializationMode);\n            Assert.Equal(2, catalog.Modules.First().DependsOn.Count);\n            Assert.Equal(\"DependsOn1\", catalog.Modules.First().DependsOn[0]);\n            Assert.Equal(\"DependsOn2\", catalog.Modules.First().DependsOn[1]);\n\n        }\n\n        [Fact]\n        public void CanAddModule4()\n        {\n            ModuleCatalog catalog = new ModuleCatalog();\n\n            catalog.AddModule(typeof(MockModule), \"DependsOn1\", \"DependsOn2\");\n\n            Assert.Single(catalog.Modules);\n            Assert.Equal(\"MockModule\", catalog.Modules.First().ModuleName);\n            Assert.Equal(typeof(MockModule).AssemblyQualifiedName, catalog.Modules.First().ModuleType);\n            Assert.Equal(InitializationMode.WhenAvailable, catalog.Modules.First().InitializationMode);\n            Assert.Equal(2, catalog.Modules.First().DependsOn.Count);\n            Assert.Equal(\"DependsOn1\", catalog.Modules.First().DependsOn[0]);\n            Assert.Equal(\"DependsOn2\", catalog.Modules.First().DependsOn[1]);\n\n        }\n\n        [Fact]\n        public void CanAddGroup()\n        {\n            ModuleCatalog catalog = new ModuleCatalog();\n\n            catalog.Items.Add(new ModuleInfoGroup());\n\n            catalog.AddGroup(InitializationMode.OnDemand, \"Ref1\",\n                             new ModuleInfo(\"M1\", \"T1\"),\n                             new ModuleInfo(\"M2\", \"T2\", \"M1\"));\n\n            Assert.Equal(2, catalog.Modules.Count());\n\n            var module1 = catalog.Modules.First();\n            var module2 = catalog.Modules.Skip(1).First();\n\n\n            Assert.Equal(\"M1\", module1.ModuleName);\n            Assert.Equal(\"T1\", module1.ModuleType);\n            Assert.Equal(\"Ref1\", module1.Ref);\n            Assert.Equal(InitializationMode.OnDemand, module1.InitializationMode);\n\n            Assert.Equal(\"M2\", module2.ModuleName);\n            Assert.Equal(\"T2\", module2.ModuleType);\n            Assert.Equal(\"Ref1\", module2.Ref);\n            Assert.Equal(InitializationMode.OnDemand, module2.InitializationMode);\n        }\n\n\n        private class TestableModuleCatalog : ModuleCatalog\n        {\n            public bool ValidateCalled { get; set; }\n            public bool LoadCalledFirst { get; set; }\n            public bool LoadCalled\n            {\n                get { return LoadCalledCount > 0; }\n            }\n            public int LoadCalledCount { get; set; }\n\n            public override void Validate()\n            {\n                ValidateCalled = true;\n                Validated = true;\n            }\n\n            protected override void InnerLoad()\n            {\n                if (ValidateCalled == false && !LoadCalled)\n                    LoadCalledFirst = true;\n\n                LoadCalledCount++;\n            }\n\n        }\n\n        private static ModuleInfo CreateModuleInfo(string name, params string[] dependsOn)\n        {\n            ModuleInfo moduleInfo = new ModuleInfo(name, name);\n            moduleInfo.DependsOn.AddRange(dependsOn);\n            return moduleInfo;\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Modularity/ModuleCatalogXaml/InvalidDependencyModuleCatalog.xaml",
    "content": "﻿<Modularity:ModuleCatalog xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n                          xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n                          xmlns:sys=\"clr-namespace:System;assembly=mscorlib\"\n                          xmlns:Modularity=\"clr-namespace:Prism.Modularity;assembly=Prism.Wpf\">\n\n  <Modularity:ModuleInfoGroup Ref=\"ModuleGroup1\" InitializationMode=\"WhenAvailable\">\n\n    <Modularity:ModuleInfo ModuleName=\"Module1InModuleGroup2\" ModuleType=\"Module2Type\">\n      <Modularity:ModuleInfo.DependsOn>\n        <sys:String>InvalidModuleDependency</sys:String>\n      </Modularity:ModuleInfo.DependsOn>\n    </Modularity:ModuleInfo>\n\n    <Modularity:ModuleInfo ModuleName=\"Module2InModuleGroup2\" ModuleType=\"ModuleType\" />\n\n  </Modularity:ModuleInfoGroup>\n\n</Modularity:ModuleCatalog>\n\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Modularity/ModuleCatalogXaml/SimpleModuleCatalog.xaml",
    "content": "﻿<Modularity:ModuleCatalog xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n                          xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n                          xmlns:sys=\"clr-namespace:System;assembly=mscorlib\"\n                          xmlns:Modularity=\"clr-namespace:Prism.Modularity;assembly=Prism.Wpf\">\n\n  <Modularity:ModuleInfoGroup Ref=\"ModuleGroup1\" InitializationMode=\"OnDemand\">\n    <Modularity:ModuleInfo ModuleName=\"Module1\" ModuleType=\"Module1Type\" />\n  </Modularity:ModuleInfoGroup>\n\n  <Modularity:ModuleInfoGroup Ref=\"ModuleGroup2\" InitializationMode=\"WhenAvailable\">\n\n    <Modularity:ModuleInfo ModuleName=\"Module2InModuleGroup2\" ModuleType=\"Module2Type\">\n      <Modularity:ModuleInfo.DependsOn>\n        <sys:String>Module3InModuleGroup2</sys:String>\n      </Modularity:ModuleInfo.DependsOn>\n    </Modularity:ModuleInfo>\n\n    <Modularity:ModuleInfo ModuleName=\"Module3InModuleGroup2\" ModuleType=\"ModuleType\" />\n\n  </Modularity:ModuleInfoGroup>\n\n  <Modularity:ModuleInfo Ref=\"file://Module3\" ModuleName=\"Module3\" ModuleType=\"Module3Type\" />\n\n  <Modularity:ModuleInfoGroup InitializationMode=\"OnDemand\">\n    <Modularity:ModuleInfo Ref=\"Module4\" ModuleName=\"Module4\" ModuleType=\"Module1Type\" />\n  </Modularity:ModuleInfoGroup>\n\n</Modularity:ModuleCatalog>\n\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Modularity/ModuleDependencySolverFixture.cs",
    "content": "\n\nusing System;\nusing System.Collections.Generic;\nusing Prism.Modularity;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Modularity\n{\n\n    public class ModuleDependencySolverFixture\n    {\n        private ModuleDependencySolver solver;\n\n        public ModuleDependencySolverFixture()\n        {\n            solver = new ModuleDependencySolver();\n        }\n\n        [Fact]\n        public void ModuleDependencySolverIsAvailable()\n        {\n            Assert.NotNull(solver);\n        }\n\n        [Fact]\n        public void CanAddModuleName()\n        {\n            solver.AddModule(\"ModuleA\");\n            Assert.Equal(1, solver.ModuleCount);\n        }\n\n        [Fact]\n        public void CannotAddNullModuleName()\n        {\n            var ex = Assert.Throws<ArgumentException>(() =>\n            {\n                solver.AddModule(null);\n            });\n\n        }\n\n        [Fact]\n        public void CannotAddEmptyModuleName()\n        {\n            var ex = Assert.Throws<ArgumentException>(() =>\n            {\n                solver.AddModule(String.Empty);\n            });\n\n        }\n\n        [Fact]\n        public void CannotAddDependencyWithoutAddingModule()\n        {\n            var ex = Assert.Throws<ArgumentException>(() =>\n            {\n                solver.AddDependency(\"ModuleA\", \"ModuleB\");\n            });\n\n        }\n\n        [Fact]\n        public void CanAddModuleDepedency()\n        {\n            solver.AddModule(\"ModuleA\");\n            solver.AddModule(\"ModuleB\");\n            solver.AddDependency(\"ModuleB\", \"ModuleA\");\n            Assert.Equal(2, solver.ModuleCount);\n        }\n\n        [Fact]\n        public void CanSolveAcyclicDependencies()\n        {\n            solver.AddModule(\"ModuleA\");\n            solver.AddModule(\"ModuleB\");\n            solver.AddDependency(\"ModuleB\", \"ModuleA\");\n            string[] result = solver.Solve();\n            Assert.Equal(2, result.Length);\n            Assert.Equal(\"ModuleA\", result[0]);\n            Assert.Equal(\"ModuleB\", result[1]);\n        }\n\n        [Fact]\n        public void FailsWithSimpleCycle()\n        {\n            var ex = Assert.Throws<CyclicDependencyFoundException>(() =>\n            {\n                solver.AddModule(\"ModuleB\");\n                solver.AddDependency(\"ModuleB\", \"ModuleB\");\n                string[] result = solver.Solve();\n            });\n\n        }\n\n        [Fact]\n        public void CanSolveForest()\n        {\n            solver.AddModule(\"ModuleA\");\n            solver.AddModule(\"ModuleB\");\n            solver.AddModule(\"ModuleC\");\n            solver.AddModule(\"ModuleD\");\n            solver.AddModule(\"ModuleE\");\n            solver.AddModule(\"ModuleF\");\n            solver.AddDependency(\"ModuleC\", \"ModuleB\");\n            solver.AddDependency(\"ModuleB\", \"ModuleA\");\n            solver.AddDependency(\"ModuleE\", \"ModuleD\");\n            string[] result = solver.Solve();\n            Assert.Equal(6, result.Length);\n            List<string> test = new List<string>(result);\n            Assert.True(test.IndexOf(\"ModuleA\") < test.IndexOf(\"ModuleB\"));\n            Assert.True(test.IndexOf(\"ModuleB\") < test.IndexOf(\"ModuleC\"));\n            Assert.True(test.IndexOf(\"ModuleD\") < test.IndexOf(\"ModuleE\"));\n        }\n\n        [Fact]\n        public void FailsWithComplexCycle()\n        {\n            var ex = Assert.Throws<CyclicDependencyFoundException>(() =>\n            {\n                solver.AddModule(\"ModuleA\");\n                solver.AddModule(\"ModuleB\");\n                solver.AddModule(\"ModuleC\");\n                solver.AddModule(\"ModuleD\");\n                solver.AddModule(\"ModuleE\");\n                solver.AddModule(\"ModuleF\");\n                solver.AddDependency(\"ModuleC\", \"ModuleB\");\n                solver.AddDependency(\"ModuleB\", \"ModuleA\");\n                solver.AddDependency(\"ModuleE\", \"ModuleD\");\n                solver.AddDependency(\"ModuleE\", \"ModuleC\");\n                solver.AddDependency(\"ModuleF\", \"ModuleE\");\n                solver.AddDependency(\"ModuleD\", \"ModuleF\");\n                solver.AddDependency(\"ModuleB\", \"ModuleD\");\n                solver.Solve();\n            });\n\n        }\n\n        [Fact]\n        public void FailsWithMissingModule()\n        {\n            var ex = Assert.Throws<ModularityException>(() =>\n            {\n                solver.AddModule(\"ModuleA\");\n                solver.AddDependency(\"ModuleA\", \"ModuleB\");\n                solver.Solve();\n            });\n\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Modularity/ModuleInfoGroupExtensionsFixture.cs",
    "content": "\n\nusing System;\nusing System.Linq;\nusing Prism.Ioc;\nusing Prism.Modularity;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Modularity\n{\n    /// <summary>\n    /// Summary description for ModuleInfoGroupExtensionsFixture\n    /// </summary>\n\n    public class ModuleInfoGroupExtensionsFixture\n    {\n        [Fact]\n        public void ShouldAddModuleToModuleInfoGroup()\n        {\n            string moduleName = \"MockModule\";\n            ModuleInfoGroup groupInfo = new ModuleInfoGroup();\n            groupInfo.AddModule(moduleName, typeof(MockModule));\n\n            Assert.Single(groupInfo);\n            Assert.Equal(moduleName, groupInfo.ElementAt(0).ModuleName);\n        }\n\n        [Fact]\n        public void ShouldSetModuleTypeCorrectly()\n        {\n            ModuleInfoGroup groupInfo = new ModuleInfoGroup();\n            groupInfo.AddModule(\"MockModule\", typeof(MockModule));\n\n            Assert.Single(groupInfo);\n            Assert.Equal(typeof(MockModule).AssemblyQualifiedName, groupInfo.ElementAt(0).ModuleType);\n        }\n\n        [Fact]\n        public void NullTypeThrows()\n        {\n            var ex = Assert.Throws<ArgumentNullException>(() =>\n            {\n                ModuleInfoGroup groupInfo = new ModuleInfoGroup();\n                groupInfo.AddModule(\"NullModule\", null);\n            });\n\n        }\n\n        [Fact]\n        public void ShouldSetDependencies()\n        {\n            string dependency1 = \"ModuleA\";\n            string dependency2 = \"ModuleB\";\n\n            ModuleInfoGroup groupInfo = new ModuleInfoGroup();\n            groupInfo.AddModule(\"MockModule\", typeof(MockModule), dependency1, dependency2);\n\n            Assert.NotNull(groupInfo.ElementAt(0).DependsOn);\n            Assert.Equal(2, groupInfo.ElementAt(0).DependsOn.Count);\n            Assert.Contains(dependency1, groupInfo.ElementAt(0).DependsOn);\n            Assert.Contains(dependency2, groupInfo.ElementAt(0).DependsOn);\n        }\n\n        [Fact]\n        public void ShouldUseTypeNameIfNoNameSpecified()\n        {\n            ModuleInfoGroup groupInfo = new ModuleInfoGroup();\n            groupInfo.AddModule(typeof(MockModule));\n\n            Assert.Single(groupInfo);\n            Assert.Equal(typeof(MockModule).Name, groupInfo.ElementAt(0).ModuleName);\n        }\n\n\n        public class MockModule : IModule\n        {\n            public void OnInitialized(IContainerProvider containerProvider)\n            {\n\n            }\n\n            public void RegisterTypes(IContainerRegistry containerRegistry)\n            {\n\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Modularity/ModuleInfoGroupFixture.cs",
    "content": "\n\nusing Prism.Modularity;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Modularity\n{\n\n    public class ModuleInfoGroupFixture\n    {\n        [Fact]\n        public void ShouldForwardValuesToModuleInfo()\n        {\n            ModuleInfoGroup group = new ModuleInfoGroup();\n            group.Ref = \"MyCustomGroupRef\";\n            ModuleInfo moduleInfo = new ModuleInfo();\n            Assert.Null(moduleInfo.Ref);\n\n            group.Add(moduleInfo);\n\n            Assert.Equal(group.Ref, moduleInfo.Ref);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Modularity/ModuleInitializerFixture.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing Prism.Ioc;\nusing Prism.Modularity;\nusing Prism.Wpf.Tests.Mocks;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Modularity\n{\n    /// <summary>\n    /// Summary description for ModuleInitializerFixture\n    /// </summary>\n\n    public class ModuleInitializerFixture\n    {\n        [Fact]\n        public void NullContainerThrows()\n        {\n            var ex = Assert.Throws<ArgumentNullException>(() =>\n            {\n                ModuleInitializer loader = new ModuleInitializer(null);\n            });\n\n        }\n\n        [Fact]\n        public void InitializationExceptionsAreWrapped()\n        {\n            var ex = Assert.Throws<ModuleInitializeException>(() =>\n            {\n                var moduleInfo = CreateModuleInfo(typeof(ExceptionThrowingModule));\n\n                ModuleInitializer loader = new ModuleInitializer(new MockContainerAdapter());\n\n                loader.Initialize(moduleInfo);\n            });\n\n        }\n\n\n        [Fact]\n        public void ShouldResolveModuleAndInitializeSingleModule()\n        {\n            IContainerExtension containerFacade = new MockContainerAdapter();\n            var service = new ModuleInitializer(containerFacade);\n            FirstTestModule.wasInitializedOnce = false;\n            var info = CreateModuleInfo(typeof(FirstTestModule));\n            service.Initialize(info);\n            Assert.True(FirstTestModule.wasInitializedOnce);\n        }\n\n\n        [Fact]\n        public void ShouldLogModuleInitializeErrorsAndContinueLoading()\n        {\n            IContainerExtension containerFacade = new MockContainerAdapter();\n            var service = new CustomModuleInitializerService(containerFacade);\n            var invalidModule = CreateModuleInfo(typeof(InvalidModule));\n\n            Assert.False(service.HandleModuleInitializerrorCalled);\n            service.Initialize(invalidModule);\n            Assert.True(service.HandleModuleInitializerrorCalled);\n        }\n\n        [Fact]\n        public void ShouldLogModuleInitializationError()\n        {\n            IContainerExtension containerFacade = new MockContainerAdapter();\n            var service = new ModuleInitializer(containerFacade);\n            ExceptionThrowingModule.wasInitializedOnce = false;\n            var exceptionModule = CreateModuleInfo(typeof(ExceptionThrowingModule));\n\n            try\n            {\n                service.Initialize(exceptionModule);\n            }\n            catch (ModuleInitializeException mie)\n            {\n                Assert.Contains(\"ExceptionThrowingModule\", mie.Message);\n            }\n        }\n\n        [Fact]\n        public void ShouldThrowExceptionIfBogusType()\n        {\n            var moduleInfo = new ModuleInfo(\"TestModule\", \"BadAssembly.BadType\");\n\n            ModuleInitializer loader = new ModuleInitializer(new MockContainerAdapter());\n\n            try\n            {\n                loader.Initialize(moduleInfo);\n                //Assert.Fail(\"Did not throw exception\");\n            }\n            catch (ModuleInitializeException ex)\n            {\n                Assert.Contains(\"BadAssembly.BadType\", ex.Message);\n            }\n            catch (Exception)\n            {\n                //Assert.Fail();\n            }\n\n        }\n\n        private static ModuleInfo CreateModuleInfo(Type type, params string[] dependsOn)\n        {\n            ModuleInfo moduleInfo = new ModuleInfo(type.Name, type.AssemblyQualifiedName);\n            moduleInfo.DependsOn.AddRange(dependsOn);\n            return moduleInfo;\n        }\n\n        public static class ModuleLoadTracker\n        {\n            public static readonly Stack<Type> ModuleLoadStack = new Stack<Type>();\n        }\n\n        public class FirstTestModule : IModule\n        {\n            public static bool wasInitializedOnce;\n\n            public void OnInitialized(IContainerProvider containerProvider)\n            {\n                wasInitializedOnce = true;\n                ModuleLoadTracker.ModuleLoadStack.Push(GetType());\n            }\n\n            public void RegisterTypes(IContainerRegistry containerRegistry)\n            {\n\n            }\n        }\n\n        public class SecondTestModule : IModule\n        {\n            public static bool wasInitializedOnce;\n            public static long initializedOnTickCount;\n\n            public void OnInitialized(IContainerProvider containerProvider)\n            {\n                wasInitializedOnce = true;\n                ModuleLoadTracker.ModuleLoadStack.Push(GetType());\n            }\n\n            public void RegisterTypes(IContainerRegistry containerRegistry)\n            {\n\n            }\n        }\n\n        public class DependantModule : IModule\n        {\n            public static bool wasInitializedOnce;\n\n            public void OnInitialized(IContainerProvider containerProvider)\n            {\n                wasInitializedOnce = true;\n                ModuleLoadTracker.ModuleLoadStack.Push(GetType());\n            }\n\n            public void RegisterTypes(IContainerRegistry containerRegistry)\n            {\n\n            }\n        }\n\n        public class DependencyModule : IModule\n        {\n            public static bool wasInitializedOnce;\n            public static long initializedOnTickCount;\n\n            public void OnInitialized(IContainerProvider containerProvider)\n            {\n                wasInitializedOnce = true;\n                ModuleLoadTracker.ModuleLoadStack.Push(GetType());\n            }\n\n            public void RegisterTypes(IContainerRegistry containerRegistry)\n            {\n\n            }\n        }\n\n        public class ExceptionThrowingModule : IModule\n        {\n            public static bool wasInitializedOnce;\n            public static long initializedOnTickCount;\n\n            public void OnInitialized(IContainerProvider containerProvider)\n            {\n                throw new InvalidOperationException(\"Intialization can't be performed\");\n            }\n\n            public void RegisterTypes(IContainerRegistry containerRegistry)\n            {\n                throw new NotImplementedException();\n            }\n        }\n\n        public class InvalidModule { }\n\n        public class CustomModuleInitializerService : ModuleInitializer\n        {\n            public bool HandleModuleInitializerrorCalled;\n\n            public CustomModuleInitializerService(IContainerExtension containerFacade)\n                : base(containerFacade)\n            {\n            }\n\n            public override void HandleModuleInitializationError(IModuleInfo moduleInfo, string assemblyName, Exception exception)\n            {\n                HandleModuleInitializerrorCalled = true;\n            }\n        }\n\n        public class Module1 : IModule\n        {\n            void IModule.OnInitialized(IContainerProvider containerProvider) { }\n            void IModule.RegisterTypes(IContainerRegistry containerRegistry) { }\n        }\n        public class Module2 : IModule\n        {\n            void IModule.OnInitialized(IContainerProvider containerProvider) { }\n            void IModule.RegisterTypes(IContainerRegistry containerRegistry) { }\n        }\n        public class Module3 : IModule\n        {\n            void IModule.OnInitialized(IContainerProvider containerProvider) { }\n            void IModule.RegisterTypes(IContainerRegistry containerRegistry) { }\n        }\n        public class Module4 : IModule\n        {\n            void IModule.OnInitialized(IContainerProvider containerProvider) { }\n            void IModule.RegisterTypes(IContainerRegistry containerRegistry) { }\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Modularity/ModuleManagerExtensionsFixture.cs",
    "content": "﻿using Moq;\nusing Prism.Modularity;\nusing Prism.Wpf.Tests.Mocks.Modules;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Modularity\n{\n    public class ModuleManagerExtensionsFixture\n    {\n        [Fact]\n        public void ModuleManagerExposesIModuleCatalogModules()\n        {\n            var modules = new[]\n            {\n                new ModuleInfo(typeof(MockModuleA))\n            };\n            var moduleCatalogMock = new Mock<IModuleCatalog>();\n            moduleCatalogMock.Setup(c => c.Modules).Returns(modules);\n            IModuleManager manager = new ModuleManager(Mock.Of<IModuleInitializer>(), moduleCatalogMock.Object);\n\n            Assert.Same(modules, manager.Modules);\n        }\n\n        [Fact]\n        public void ModuleManagerReturnsCorrectModuleStateWithGeneric()\n        {\n            var moduleInfo = new ModuleInfo(typeof(MockModuleA));\n            var moduleCatalogMock = new Mock<IModuleCatalog>();\n            moduleCatalogMock.Setup(c => c.Modules).Returns(new[] { moduleInfo });\n            IModuleManager manager = new ModuleManager(Mock.Of<IModuleInitializer>(), moduleCatalogMock.Object);\n\n            Assert.Equal(moduleInfo.State, manager.GetModuleState<MockModuleA>());\n            moduleInfo.State = ModuleState.LoadingTypes;\n            Assert.Equal(moduleInfo.State, manager.GetModuleState<MockModuleA>());\n        }\n\n        [Fact]\n        public void ModuleManagerReturnsCorrectModuleStateWithName()\n        {\n            var moduleInfo = new ModuleInfo(typeof(MockModuleA));\n            var moduleCatalogMock = new Mock<IModuleCatalog>();\n            moduleCatalogMock.Setup(c => c.Modules).Returns(new[] { moduleInfo });\n            IModuleManager manager = new ModuleManager(Mock.Of<IModuleInitializer>(), moduleCatalogMock.Object);\n\n            Assert.Equal(moduleInfo.State, manager.GetModuleState(nameof(MockModuleA)));\n            moduleInfo.State = ModuleState.LoadingTypes;\n            Assert.Equal(moduleInfo.State, manager.GetModuleState(nameof(MockModuleA)));\n        }\n\n        [Fact]\n        public void ModuleManagerReturnsCorrectInitializationStateWithGeneric()\n        {\n            var moduleInfo = new ModuleInfo(typeof(MockModuleA));\n            var moduleCatalogMock = new Mock<IModuleCatalog>();\n            moduleCatalogMock.Setup(c => c.Modules).Returns(new[] { moduleInfo });\n            IModuleManager manager = new ModuleManager(Mock.Of<IModuleInitializer>(), moduleCatalogMock.Object);\n\n            Assert.False(manager.IsModuleInitialized<MockModuleA>());\n            moduleInfo.State = ModuleState.Initializing;\n            Assert.False(manager.IsModuleInitialized<MockModuleA>());\n            moduleInfo.State = ModuleState.Initialized;\n            Assert.True(manager.IsModuleInitialized<MockModuleA>());\n        }\n\n        [Fact]\n        public void ModuleManagerReturnsCorrectInitializationStateWithName()\n        {\n            var moduleInfo = new ModuleInfo(typeof(MockModuleA));\n            var moduleCatalogMock = new Mock<IModuleCatalog>();\n            moduleCatalogMock.Setup(c => c.Modules).Returns(new[] { moduleInfo });\n            IModuleManager manager = new ModuleManager(Mock.Of<IModuleInitializer>(), moduleCatalogMock.Object);\n\n            Assert.False(manager.IsModuleInitialized(nameof(MockModuleA)));\n            moduleInfo.State = ModuleState.Initializing;\n            Assert.False(manager.IsModuleInitialized(nameof(MockModuleA)));\n            moduleInfo.State = ModuleState.Initialized;\n            Assert.True(manager.IsModuleInitialized(nameof(MockModuleA)));\n        }\n\n        [Fact]\n        public void ModuleManagerLoadModuleGeneric_CallsLoadModuleWithName()\n        {\n            var managerMock = new Mock<IModuleManager>();\n            managerMock.Object.LoadModule<MockModuleA>();\n            managerMock.Verify(m => m.LoadModule(nameof(MockModuleA)));\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Modularity/ModuleManagerFixture.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing Moq;\nusing Prism.Ioc;\nusing Prism.Modularity;\nusing Prism.Wpf.Tests.Mocks;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Modularity\n{\n\n    public class ModuleManagerFixture\n    {\n        [Fact]\n        public void NullLoaderThrows()\n        {\n            var ex = Assert.Throws<ArgumentNullException>(() =>\n            {\n                new ModuleManager(null, new MockModuleCatalog());\n            });\n\n        }\n\n        [Fact]\n        public void NullCatalogThrows()\n        {\n            var ex = Assert.Throws<ArgumentNullException>(() =>\n            {\n                new ModuleManager(new MockModuleInitializer(), null);\n            });\n\n        }\n\n        [Fact]\n        public void ShouldInvokeRetrieverForModules()\n        {\n            var loader = new MockModuleInitializer();\n            var moduleInfo = CreateModuleInfo(\"needsRetrieval\", InitializationMode.WhenAvailable);\n            var catalog = new MockModuleCatalog { Modules = { moduleInfo } };\n            ModuleManager manager = new ModuleManager(loader, catalog);\n            var moduleTypeLoader = new MockModuleTypeLoader();\n            manager.ModuleTypeLoaders = new List<IModuleTypeLoader> { moduleTypeLoader };\n\n            manager.Run();\n\n            Assert.Contains(moduleInfo, moduleTypeLoader.LoadedModules);\n        }\n\n        [Fact]\n        public void ShouldInitializeModulesOnRetrievalCompleted()\n        {\n            var loader = new MockModuleInitializer();\n            var backgroungModuleInfo = CreateModuleInfo(\"NeedsRetrieval\", InitializationMode.WhenAvailable);\n            var catalog = new MockModuleCatalog { Modules = { backgroungModuleInfo } };\n            ModuleManager manager = new ModuleManager(loader, catalog);\n            var moduleTypeLoader = new MockModuleTypeLoader();\n            manager.ModuleTypeLoaders = new List<IModuleTypeLoader> { moduleTypeLoader };\n            Assert.False(loader.InitializeCalled);\n\n            manager.Run();\n\n            Assert.True(loader.InitializeCalled);\n            Assert.Single(loader.InitializedModules);\n            Assert.Equal(backgroungModuleInfo, loader.InitializedModules[0]);\n        }\n\n        [Fact]\n        public void ShouldInitializeModuleOnDemand()\n        {\n            var loader = new MockModuleInitializer();\n            var onDemandModule = CreateModuleInfo(\"NeedsRetrieval\", InitializationMode.OnDemand);\n            var catalog = new MockModuleCatalog { Modules = { onDemandModule } };\n            ModuleManager manager = new ModuleManager(loader, catalog);\n            var moduleRetriever = new MockModuleTypeLoader();\n            manager.ModuleTypeLoaders = new List<IModuleTypeLoader> { moduleRetriever };\n            manager.Run();\n\n            Assert.False(loader.InitializeCalled);\n            Assert.Empty(moduleRetriever.LoadedModules);\n\n            manager.LoadModule(\"NeedsRetrieval\");\n\n            Assert.Single(moduleRetriever.LoadedModules);\n            Assert.True(loader.InitializeCalled);\n            Assert.Single(loader.InitializedModules);\n            Assert.Equal(onDemandModule, loader.InitializedModules[0]);\n        }\n\n        [Fact]\n        public void InvalidOnDemandModuleNameThrows()\n        {\n            var ex = Assert.Throws<ModuleNotFoundException>(() =>\n            {\n                var loader = new MockModuleInitializer();\n\n                var catalog = new MockModuleCatalog { Modules = new List<IModuleInfo> { CreateModuleInfo(\"Missing\", InitializationMode.OnDemand) } };\n\n                ModuleManager manager = new ModuleManager(loader, catalog);\n                var moduleTypeLoader = new MockModuleTypeLoader();\n\n                manager.ModuleTypeLoaders = new List<IModuleTypeLoader> { moduleTypeLoader };\n                manager.Run();\n\n                manager.LoadModule(\"NonExistent\");\n            });\n\n\n        }\n\n        [Fact]\n        public void EmptyOnDemandModuleReturnedThrows()\n        {\n            var ex = Assert.Throws<ModuleNotFoundException>(() =>\n            {\n                var loader = new MockModuleInitializer();\n\n                var catalog = new MockModuleCatalog { CompleteListWithDependencies = modules => new List<ModuleInfo>() };\n                ModuleManager manager = new ModuleManager(loader, catalog);\n                var moduleRetriever = new MockModuleTypeLoader();\n                manager.ModuleTypeLoaders = new List<IModuleTypeLoader> { moduleRetriever };\n                manager.Run();\n\n                manager.LoadModule(\"NullModule\");\n            });\n\n\n        }\n\n        [Fact]\n        public void ShouldNotLoadTypeIfModuleInitialized()\n        {\n            var loader = new MockModuleInitializer();\n            var alreadyPresentModule = CreateModuleInfo(typeof(MockModule), InitializationMode.WhenAvailable);\n            alreadyPresentModule.State = ModuleState.ReadyForInitialization;\n            var catalog = new MockModuleCatalog { Modules = { alreadyPresentModule } };\n            var manager = new ModuleManager(loader, catalog);\n            var moduleTypeLoader = new MockModuleTypeLoader();\n            manager.ModuleTypeLoaders = new List<IModuleTypeLoader> { moduleTypeLoader };\n\n            manager.Run();\n\n            Assert.DoesNotContain(alreadyPresentModule, moduleTypeLoader.LoadedModules);\n            Assert.True(loader.InitializeCalled);\n            Assert.Single(loader.InitializedModules);\n            Assert.Equal(alreadyPresentModule, loader.InitializedModules[0]);\n        }\n\n        [Fact]\n        public void ShouldNotLoadSameModuleTwice()\n        {\n            var loader = new MockModuleInitializer();\n            var onDemandModule = CreateModuleInfo(typeof(MockModule), InitializationMode.OnDemand);\n            var catalog = new MockModuleCatalog { Modules = { onDemandModule } };\n            var manager = new ModuleManager(loader, catalog);\n            manager.Run();\n            manager.LoadModule(\"MockModule\");\n            loader.InitializeCalled = false;\n            manager.LoadModule(\"MockModule\");\n\n            Assert.False(loader.InitializeCalled);\n        }\n\n        [Fact]\n        public void ShouldNotLoadModuleThatNeedsRetrievalTwice()\n        {\n            var loader = new MockModuleInitializer();\n            var onDemandModule = CreateModuleInfo(\"ModuleThatNeedsRetrieval\", InitializationMode.OnDemand);\n            var catalog = new MockModuleCatalog { Modules = { onDemandModule } };\n            var manager = new ModuleManager(loader, catalog);\n            var moduleTypeLoader = new MockModuleTypeLoader();\n            manager.ModuleTypeLoaders = new List<IModuleTypeLoader> { moduleTypeLoader };\n            manager.Run();\n            manager.LoadModule(\"ModuleThatNeedsRetrieval\");\n            moduleTypeLoader.RaiseLoadModuleCompleted(new LoadModuleCompletedEventArgs(onDemandModule, null));\n            loader.InitializeCalled = false;\n\n            manager.LoadModule(\"ModuleThatNeedsRetrieval\");\n\n            Assert.False(loader.InitializeCalled);\n        }\n\n        [Fact]\n        public void ShouldCallValidateCatalogBeforeGettingGroupsFromCatalog()\n        {\n            var loader = new MockModuleInitializer();\n            var catalog = new MockModuleCatalog();\n            var manager = new ModuleManager(loader, catalog);\n            bool validateCatalogCalled = false;\n            bool getModulesCalledBeforeValidate = false;\n\n            catalog.ValidateCatalog = () => validateCatalogCalled = true;\n            catalog.CompleteListWithDependencies = f =>\n                                                     {\n                                                         if (!validateCatalogCalled)\n                                                         {\n                                                             getModulesCalledBeforeValidate = true;\n                                                         }\n\n                                                         return null;\n                                                     };\n            manager.Run();\n\n            Assert.True(validateCatalogCalled);\n            Assert.False(getModulesCalledBeforeValidate);\n        }\n\n        [Fact]\n        public void ShouldNotInitializeIfDependenciesAreNotMet()\n        {\n            var loader = new MockModuleInitializer();\n            var requiredModule = CreateModuleInfo(\"ModuleThatNeedsRetrieval1\", InitializationMode.WhenAvailable);\n            requiredModule.ModuleName = \"RequiredModule\";\n            var dependantModuleInfo = CreateModuleInfo(\"ModuleThatNeedsRetrieval2\", InitializationMode.WhenAvailable, \"RequiredModule\");\n\n            var catalog = new MockModuleCatalog { Modules = { requiredModule, dependantModuleInfo } };\n            catalog.GetDependentModules = m => new[] { requiredModule };\n\n            ModuleManager manager = new ModuleManager(loader, catalog);\n            var moduleTypeLoader = new MockModuleTypeLoader();\n            manager.ModuleTypeLoaders = new List<IModuleTypeLoader> { moduleTypeLoader };\n\n            manager.Run();\n\n            moduleTypeLoader.RaiseLoadModuleCompleted(new LoadModuleCompletedEventArgs(dependantModuleInfo, null));\n\n            Assert.False(loader.InitializeCalled);\n            Assert.Empty(loader.InitializedModules);\n        }\n\n        [Fact]\n        public void ShouldInitializeIfDependenciesAreMet()\n        {\n            var initializer = new MockModuleInitializer();\n            var requiredModule = CreateModuleInfo(\"ModuleThatNeedsRetrieval1\", InitializationMode.WhenAvailable);\n            requiredModule.ModuleName = \"RequiredModule\";\n            var dependantModuleInfo = CreateModuleInfo(\"ModuleThatNeedsRetrieval2\", InitializationMode.WhenAvailable, \"RequiredModule\");\n\n            var catalog = new MockModuleCatalog { Modules = { requiredModule, dependantModuleInfo } };\n            catalog.GetDependentModules = delegate (IModuleInfo module)\n                                              {\n                                                  if (module == dependantModuleInfo)\n                                                      return new[] { requiredModule };\n                                                  else\n                                                      return null;\n                                              };\n\n            ModuleManager manager = new ModuleManager(initializer, catalog);\n            var moduleTypeLoader = new MockModuleTypeLoader();\n            manager.ModuleTypeLoaders = new List<IModuleTypeLoader> { moduleTypeLoader };\n\n            manager.Run();\n\n            Assert.True(initializer.InitializeCalled);\n            Assert.Equal(2, initializer.InitializedModules.Count);\n        }\n\n        [Fact]\n        public void ShouldThrowOnRetrieverErrorAndWrapException()\n        {\n            var loader = new MockModuleInitializer();\n            var moduleInfo = CreateModuleInfo(\"NeedsRetrieval\", InitializationMode.WhenAvailable);\n            var catalog = new MockModuleCatalog { Modules = { moduleInfo } };\n            ModuleManager manager = new ModuleManager(loader, catalog);\n            var moduleTypeLoader = new MockModuleTypeLoader();\n\n            Exception retrieverException = new Exception();\n            moduleTypeLoader.LoadCompletedError = retrieverException;\n\n            manager.ModuleTypeLoaders = new List<IModuleTypeLoader> { moduleTypeLoader };\n            Assert.False(loader.InitializeCalled);\n\n            try\n            {\n                manager.Run();\n            }\n            catch (Exception ex)\n            {\n                Assert.IsType<ModuleTypeLoadingException>(ex);\n                Assert.Equal(moduleInfo.ModuleName, ((ModularityException)ex).ModuleName);\n                Assert.Contains(moduleInfo.ModuleName, ex.Message);\n                Assert.Same(retrieverException, ex.InnerException);\n                return;\n            }\n\n            //Assert.Fail(\"Exception not thrown.\");\n        }\n\n        [Fact]\n        public void ShouldThrowIfNoRetrieverCanRetrieveModule()\n        {\n            var ex = Assert.Throws<ModuleTypeLoaderNotFoundException>(() =>\n            {\n\n                var loader = new MockModuleInitializer();\n                var catalog = new MockModuleCatalog { Modules = { CreateModuleInfo(\"ModuleThatNeedsRetrieval\", InitializationMode.WhenAvailable) } };\n                ModuleManager manager = new ModuleManager(loader, catalog)\n                {\n                    ModuleTypeLoaders = new List<IModuleTypeLoader> { new MockModuleTypeLoader() { canLoadModuleTypeReturnValue = false } }\n                };\n                manager.Run();\n            });\n\n        }\n\n        [Fact]\n        public void ShouldWorkIfModuleLoadsAnotherOnDemandModuleWhenInitializing()\n        {\n            var initializer = new StubModuleInitializer();\n            var onDemandModule = CreateModuleInfo(typeof(MockModule), InitializationMode.OnDemand);\n            onDemandModule.ModuleName = \"OnDemandModule\";\n            var moduleThatLoadsOtherModule = CreateModuleInfo(typeof(MockModule), InitializationMode.WhenAvailable);\n            var catalog = new MockModuleCatalog { Modules = { moduleThatLoadsOtherModule, onDemandModule } };\n            ModuleManager manager = new ModuleManager(initializer, catalog);\n\n            bool onDemandModuleWasInitialized = false;\n            initializer.Initialize = m =>\n                                     {\n                                         if (m == moduleThatLoadsOtherModule)\n                                         {\n                                             manager.LoadModule(\"OnDemandModule\");\n                                         }\n                                         else if (m == onDemandModule)\n                                         {\n                                             onDemandModuleWasInitialized = true;\n                                         }\n                                     };\n\n            manager.Run();\n\n            Assert.True(onDemandModuleWasInitialized);\n        }\n\n\n        [Fact]\n        public void ModuleManagerIsDisposable()\n        {\n            Mock<IModuleInitializer> mockInit = new Mock<IModuleInitializer>();\n            var moduleInfo = CreateModuleInfo(\"needsRetrieval\", InitializationMode.WhenAvailable);\n            var catalog = new Mock<IModuleCatalog>();\n            ModuleManager manager = new ModuleManager(mockInit.Object, catalog.Object);\n\n            IDisposable disposableManager = manager as IDisposable;\n            Assert.NotNull(disposableManager);\n        }\n\n        [Fact]\n        public void DisposeDoesNotThrowWithNonDisposableTypeLoaders()\n        {\n            Mock<IModuleInitializer> mockInit = new Mock<IModuleInitializer>();\n            var moduleInfo = CreateModuleInfo(\"needsRetrieval\", InitializationMode.WhenAvailable);\n            var catalog = new Mock<IModuleCatalog>();\n            ModuleManager manager = new ModuleManager(mockInit.Object, catalog.Object);\n\n            var mockTypeLoader = new Mock<IModuleTypeLoader>();\n            manager.ModuleTypeLoaders = new List<IModuleTypeLoader> { mockTypeLoader.Object };\n\n            try\n            {\n                manager.Dispose();\n            }\n            catch (Exception)\n            {\n                //Assert.Fail();\n            }\n        }\n\n        [Fact]\n        public void DisposeCleansUpDisposableTypeLoaders()\n        {\n            Mock<IModuleInitializer> mockInit = new Mock<IModuleInitializer>();\n            var moduleInfo = CreateModuleInfo(\"needsRetrieval\", InitializationMode.WhenAvailable);\n            var catalog = new Mock<IModuleCatalog>();\n            ModuleManager manager = new ModuleManager(mockInit.Object, catalog.Object);\n\n            var mockTypeLoader = new Mock<IModuleTypeLoader>();\n            var disposableMockTypeLoader = mockTypeLoader.As<IDisposable>();\n            disposableMockTypeLoader.Setup(loader => loader.Dispose());\n\n            manager.ModuleTypeLoaders = new List<IModuleTypeLoader> { mockTypeLoader.Object };\n\n            manager.Dispose();\n\n            disposableMockTypeLoader.Verify(loader => loader.Dispose(), Times.Once());\n        }\n\n        [Fact]\n        public void DisposeDoesNotThrowWithMixedTypeLoaders()\n        {\n            Mock<IModuleInitializer> mockInit = new Mock<IModuleInitializer>();\n            var moduleInfo = CreateModuleInfo(\"needsRetrieval\", InitializationMode.WhenAvailable);\n            var catalog = new Mock<IModuleCatalog>();\n            ModuleManager manager = new ModuleManager(mockInit.Object, catalog.Object);\n\n            var mockTypeLoader1 = new Mock<IModuleTypeLoader>();\n\n            var mockTypeLoader = new Mock<IModuleTypeLoader>();\n            var disposableMockTypeLoader = mockTypeLoader.As<IDisposable>();\n            disposableMockTypeLoader.Setup(loader => loader.Dispose());\n\n            manager.ModuleTypeLoaders = new List<IModuleTypeLoader>() { mockTypeLoader1.Object, mockTypeLoader.Object };\n\n            try\n            {\n                manager.Dispose();\n            }\n            catch (Exception)\n            {\n                //Assert.Fail();\n            }\n\n            disposableMockTypeLoader.Verify(loader => loader.Dispose(), Times.Once());\n        }\n        private static ModuleInfo CreateModuleInfo(string name, InitializationMode initializationMode, params string[] dependsOn)\n        {\n            ModuleInfo moduleInfo = new ModuleInfo(name, name)\n            {\n                InitializationMode = initializationMode\n            };\n            moduleInfo.DependsOn.AddRange(dependsOn);\n            return moduleInfo;\n        }\n\n        private static ModuleInfo CreateModuleInfo(Type type, InitializationMode initializationMode, params string[] dependsOn)\n        {\n            ModuleInfo moduleInfo = new ModuleInfo(type.Name, type.AssemblyQualifiedName)\n            {\n                InitializationMode = initializationMode\n            };\n            moduleInfo.DependsOn.AddRange(dependsOn);\n            return moduleInfo;\n        }\n    }\n\n    internal class MockModule : IModule\n    {\n        public void OnInitialized(IContainerProvider containerProvider)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void RegisterTypes(IContainerRegistry containerRegistry)\n        {\n            throw new NotImplementedException();\n        }\n    }\n\n    internal class MockModuleCatalog : IModuleCatalog\n    {\n        public List<IModuleInfo> Modules = new List<IModuleInfo>();\n        public Func<IModuleInfo, IEnumerable<IModuleInfo>> GetDependentModules;\n\n        public Func<IEnumerable<IModuleInfo>, IEnumerable<IModuleInfo>> CompleteListWithDependencies;\n        public Action ValidateCatalog;\n\n        public void Initialize()\n        {\n            this.ValidateCatalog?.Invoke();\n        }\n\n        IEnumerable<IModuleInfo> IModuleCatalog.Modules => Modules;\n\n        IEnumerable<IModuleInfo> IModuleCatalog.GetDependentModules(IModuleInfo moduleInfo)\n        {\n            if (GetDependentModules == null)\n                return new List<IModuleInfo>();\n\n            return GetDependentModules(moduleInfo);\n        }\n\n        IEnumerable<IModuleInfo> IModuleCatalog.CompleteListWithDependencies(IEnumerable<IModuleInfo> modules)\n        {\n            if (CompleteListWithDependencies != null)\n                return CompleteListWithDependencies(modules);\n            return modules;\n        }\n\n\n        public IModuleCatalog AddModule(IModuleInfo moduleInfo)\n        {\n            this.Modules.Add(moduleInfo);\n            return this;\n        }\n    }\n\n    internal class MockModuleInitializer : IModuleInitializer\n    {\n        public bool InitializeCalled;\n        public List<IModuleInfo> InitializedModules = new List<IModuleInfo>();\n\n        public void Initialize(IModuleInfo moduleInfo)\n        {\n            InitializeCalled = true;\n            this.InitializedModules.Add(moduleInfo);\n        }\n    }\n\n    internal class StubModuleInitializer : IModuleInitializer\n    {\n        public Action<ModuleInfo> Initialize;\n\n        void IModuleInitializer.Initialize(IModuleInfo moduleInfo)\n        {\n            this.Initialize((ModuleInfo)moduleInfo);\n        }\n    }\n\n    internal class MockDelegateModuleInitializer : IModuleInitializer\n    {\n        public Action<ModuleInfo> LoadBody;\n\n        public void Initialize(IModuleInfo moduleInfo)\n        {\n            LoadBody((ModuleInfo)moduleInfo);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Modularity/XamlModuleCatalogFixture.cs",
    "content": "﻿using System;\nusing System.IO;\nusing System.Linq;\nusing Prism.Modularity;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Modularity\n{\n    public class XamlModuleCatalogFixture\n    {\n        private const string _simpleCatalogPackUri = \"/Prism.Wpf.Tests;component/Modularity/ModuleCatalogXaml/SimpleModuleCatalog.xaml\";\n        private const string _invalidDependencyCatalogPackUri = \"/Prism.Wpf.Tests;component/Modularity/ModuleCatalogXaml/InvalidDependencyModuleCatalog.xaml\";\n\n        [Fact]\n        public void XamlModuleCatalog_LoadsXamlFile()\n        {\n            var catalog = new XamlModuleCatalog(_simpleCatalogPackUri);\n            catalog.Initialize();\n\n            Assert.NotNull(catalog);\n        }\n\n        [Fact]\n        public void XamlModuleCatalog_HasModules()\n        {\n            var catalog = new XamlModuleCatalog(_simpleCatalogPackUri);\n            catalog.Initialize();\n\n            Assert.NotNull(catalog);\n            Assert.Equal(5, catalog.Modules.Count());\n        }\n\n        [Fact]\n        public void XamlModuleCatalog_SupportsLegacyFileFormat()\n        {\n            var expectedModulePath = Path.GetFullPath(\"Module3\");\n\n            var catalog = new XamlModuleCatalog(_simpleCatalogPackUri);\n            catalog.Initialize();\n\n            Assert.NotNull(catalog);\n\n            var module3 = catalog.Modules.SingleOrDefault(x => x.ModuleName == \"Module3\");\n\n            Assert.NotNull(module3);\n\n            Uri uri = new Uri(module3.Ref);\n\n            Assert.True(uri.IsFile);\n            Assert.Equal(expectedModulePath, uri.LocalPath);\n        }\n\n        [Fact]\n        public void XamlModuleCatalog_HasGroups()\n        {\n            var catalog = new XamlModuleCatalog(_simpleCatalogPackUri);\n            catalog.Initialize();\n\n            Assert.NotNull(catalog);\n            Assert.Equal(3, catalog.Groups.Count());\n        }\n\n        [Fact]\n        public void XamlModuleCatalog_ModuleRefs_Equal_GroupRefs()\n        {\n            var catalog = new XamlModuleCatalog(_simpleCatalogPackUri);\n            catalog.Initialize();\n\n            Assert.NotNull(catalog);\n\n            foreach (var group in catalog.Groups)\n            {\n                foreach (var module in group)\n                {\n                    if (!string.IsNullOrEmpty(group.Ref))\n                        Assert.Equal(group.Ref, module.Ref);\n                }\n            }\n        }\n\n        [Fact]\n        public void XamlModuleCatalog_GroupsHaveValidRefs()\n        {\n            var catalog = new XamlModuleCatalog(_simpleCatalogPackUri);\n            catalog.Initialize();\n\n            Assert.NotNull(catalog);\n\n            foreach (var group in catalog.Groups)\n            {\n                if (!string.IsNullOrEmpty(group.Ref))\n                {\n                    var uri = new Uri(group.Ref);\n\n                    Assert.True(uri.IsFile);\n                }\n            }\n        }\n\n        [Fact]\n        public void XamlModuleCatalog_GroupWithNoRef_ModulesHaveValidRefs()\n        {\n            var catalog = new XamlModuleCatalog(_simpleCatalogPackUri);\n            catalog.Initialize();\n\n            Assert.NotNull(catalog);\n\n            foreach (var group in catalog.Groups)\n            {\n                foreach (var module in group)\n                {\n                    Assert.NotNull(module.Ref);\n\n                    var uri = new Uri(module.Ref);\n\n                    Assert.True(uri.IsFile);\n                }\n            }\n        }\n\n        [Fact]\n        public void ShouldThrowOnInvalidDependency()\n        {\n            var catalog = new XamlModuleCatalog(_invalidDependencyCatalogPackUri);\n\n            var ex = Assert.Throws<ModularityException>(() =>\n            {\n                catalog.Initialize();\n            });\n\n            Assert.Contains(\"A module declared a dependency on another module which is not declared to be loaded\", ex.Message);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Mvvm/ViewModelLocatorFixture.cs",
    "content": "﻿using System;\nusing System.Reflection;\nusing Prism.Mvvm;\nusing Prism.Wpf.Tests.Mocks.ViewModels;\nusing Prism.Wpf.Tests.Mocks.Views;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Mvvm\n{\n\n    public class ViewModelLocatorFixture\n    {\n        [StaFact]\n        public void ShouldLocateViewModelWithDefaultSettings()\n        {\n            ResetViewModelLocationProvider();\n\n            Mock view = new Mock();\n            Assert.Null(view.DataContext);\n\n            ViewModelLocator.SetAutoWireViewModel(view, true);\n            Assert.NotNull(view.DataContext);\n            Assert.IsType<MockViewModel>(view.DataContext);\n        }\n\n        [StaFact]\n        public void ShouldLocateViewModelWithDefaultSettingsForViewsThatEndWithView()\n        {\n            ResetViewModelLocationProvider();\n\n            MockView view = new MockView();\n            Assert.Null(view.DataContext);\n\n            ViewModelLocator.SetAutoWireViewModel(view, true);\n            Assert.NotNull(view.DataContext);\n            Assert.IsType<MockViewModel>(view.DataContext);\n        }\n\n        [StaFact]\n        public void ShouldUseCustomDefaultViewModelFactoryWhenSet()\n        {\n            ResetViewModelLocationProvider();\n\n            Mock view = new Mock();\n            Assert.Null(view.DataContext);\n\n            object mockObject = new object();\n            ViewModelLocationProvider.SetDefaultViewModelFactory(viewType => mockObject);\n\n            ViewModelLocator.SetAutoWireViewModel(view, true);\n            Assert.NotNull(view.DataContext);\n            ReferenceEquals(view.DataContext, mockObject);\n        }\n\n        [StaFact]\n        public void ShouldUseCustomDefaultViewTypeToViewModelTypeResolverWhenSet()\n        {\n            ResetViewModelLocationProvider();\n\n            Mock view = new Mock();\n            Assert.Null(view.DataContext);\n\n            ViewModelLocationProvider.SetDefaultViewTypeToViewModelTypeResolver(viewType => typeof(ViewModelLocatorFixture));\n\n            ViewModelLocator.SetAutoWireViewModel(view, true);\n            Assert.NotNull(view.DataContext);\n            Assert.IsType<ViewModelLocatorFixture>(view.DataContext);\n        }\n\n        [StaFact]\n        public void ShouldUseCustomFactoryWhenSet()\n        {\n            ResetViewModelLocationProvider();\n\n            Mock view = new Mock();\n            Assert.Null(view.DataContext);\n\n            string viewModel = \"Test String\";\n            ViewModelLocationProvider.Register(view.GetType().ToString(), () => viewModel);\n\n            ViewModelLocator.SetAutoWireViewModel(view, true);\n            Assert.NotNull(view.DataContext);\n            ReferenceEquals(view.DataContext, viewModel);\n        }\n\n        internal static void ResetViewModelLocationProvider()\n        {\n            Type staticType = typeof(ViewModelLocationProvider);\n            ConstructorInfo ci = staticType.TypeInitializer;\n            object[] parameters = new object[0];\n            ci.Invoke(null, parameters);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Prism.Wpf.Tests.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project Sdk=\"Microsoft.NET.Sdk.WindowsDesktop\">\n  <PropertyGroup>\n    <TargetFramework>net472</TargetFramework>\n    <IsPackable>false</IsPackable>\n  </PropertyGroup>\n  <ItemGroup>\n    <BootstrapperPackage Include=\".NETFramework,Version=v4.0\">\n      <Visible>False</Visible>\n      <ProductName>Microsoft .NET Framework 4 %28x86 and x64%29</ProductName>\n      <Install>true</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Client.3.5\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.3.5.SP1\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Windows.Installer.3.1\">\n      <Visible>False</Visible>\n      <ProductName>Windows Installer 3.1</ProductName>\n      <Install>true</Install>\n    </BootstrapperPackage>\n  </ItemGroup>\n  <ItemGroup>\n    <Reference Include=\"System.Transactions\" />\n    <PackageReference Include=\"coverlet.collector\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"GitHubActionsTestLogger\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"Microsoft.NET.Test.Sdk\" />\n    <PackageReference Include=\"Moq\" />\n    <PackageReference Include=\"xunit\" />\n    <PackageReference Include=\"xunit.runner.visualstudio\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"Xunit.StaFact\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\..\\src\\Wpf\\Prism.Wpf\\Prism.Wpf.csproj\" />\n    <ProjectReference Include=\"..\\Prism.IocContainer.Wpf.Tests.Support\\Prism.IocContainer.Wpf.Tests.Support.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <EmbeddedResource Include=\"Mocks\\Modules\\*.cs\" />\n    <Page Remove=\"Modularity\\ModuleCatalogXaml\\InvalidDependencyModuleCatalog.xaml\" />\n    <Resource Include=\"Modularity\\ModuleCatalogXaml\\InvalidDependencyModuleCatalog.xaml\">\n      <SubType>Designer</SubType>\n      <Generator>MSBuild:Compile</Generator>\n    </Resource>\n    <Resource Include=\"Modularity\\ModuleCatalogXaml\\SimpleModuleCatalog.xaml\">\n      <SubType>Designer</SubType>\n      <Generator>MSBuild:Compile</Generator>\n      <SubType>Designer</SubType>\n    </Resource>\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/PrismApplicationBaseFixture.cs",
    "content": "﻿using System;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Controls.Primitives;\nusing Moq;\nusing Prism.Events;\nusing Prism.Ioc;\nusing Prism.Modularity;\nusing Prism.Navigation.Regions;\nusing Prism.Navigation.Regions.Behaviors;\nusing Prism.Dialogs;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests\n{\n    public class PrismApplicationSetup : IDisposable\n    {\n        public PrismApplication Application { get; set; }\n\n        public PrismApplicationSetup()\n        {\n            ContainerLocator.ResetContainer();\n            Application = new PrismApplication();\n            Application.CallOnStartup();\n        }\n\n        public void Dispose()\n        {\n            ContainerLocator.ResetContainer();\n            Application.Shutdown();\n        }\n    }\n\n    public class PrismApplicationBaseFixture : IClassFixture<PrismApplicationSetup>\n    {\n        PrismApplication application = null;\n\n        public PrismApplicationBaseFixture(PrismApplicationSetup setup)\n        {\n            application = setup.Application;\n        }\n\n        [Fact]\n        public void applicationShouldCallConfigureViewModelLocator()\n        {\n            Assert.True(application.ConfigureViewModelLocatorWasCalled);\n        }\n\n        [Fact]\n        public void applicationShouldCallInitialize()\n        {\n            Assert.True(application.InitializeCalled);\n        }\n\n        [Fact]\n        public void applicationShouldCallCreateContainerExtension()\n        {\n            Assert.True(application.CreateContainerExtensionCalled);\n        }\n\n        [Fact]\n        public void applicationShouldCallCreateModuleCatalog()\n        {\n            Assert.True(application.CreateModuleCatalogCalled);\n        }\n\n        [Fact]\n        public void applicationShouldCallRegisterRequiredTypes()\n        {\n            Assert.True(application.RegisterRequiredTypesCalled);\n        }\n\n        [Fact]\n        public void applicationShouldCallRegisterTypes()\n        {\n            Assert.True(application.RegisterTypesWasCalled);\n        }\n\n        [Fact]\n        public void applicationShouldCallConfigureDefaultRegionBehaviors()\n        {\n            Assert.True(application.ConfigureDefaultRegionBehaviorsCalled);\n        }\n\n        [Fact]\n        public void applicationShouldCallConfigureRegionAdapterMappings()\n        {\n            Assert.True(application.ConfigureRegionAdapterMappingsCalled);\n        }\n\n        [Fact]\n        public void applicationShouldCallRegisterFrameworkExceptionTypes()\n        {\n            Assert.True(application.RegisterFrameworkExceptionTypesCalled);\n        }\n\n        [Fact]\n        public void applicationShouldCallCreateShell()\n        {\n            Assert.True(application.CreateShellWasCalled);\n        }\n\n        [Fact]\n        public void applicationShouldCallInitializeShell()\n        {\n            //in our mock Shell is null, so this INitializeShell should not be called by the application\n            Assert.False(application.InitializeShellWasCalled);\n        }\n\n        [Fact]\n        public void applicationShouldCallOnInitialized()\n        {\n            Assert.True(application.OnInitializedWasCalled);\n        }\n\n        [Fact]\n        public void applicationShouldCallConfigureModuleCatalog()\n        {\n            Assert.True(application.ConfigureModuleCatalogCalled);\n        }\n\n        [Fact]\n        public void applicationShouldCallInitializeModules()\n        {\n            Assert.True(application.InitializeModulesCalled);\n        }\n\n        [Fact]\n        public void CreateModuleCatalogShouldReturnDefaultModuleCatalog()\n        {\n            Assert.NotNull(application.DefaultModuleCatalog);\n        }\n\n        [Fact]\n        public void ConfigureRegionAdapterMappingsShouldRegisterItemsControlMapping()\n        {\n            Assert.NotNull(application.DefaultRegionAdapterMappings);\n            Assert.NotNull(application.DefaultRegionAdapterMappings.GetMapping(typeof(ItemsControl)));\n        }\n\n        [Fact]\n        public void ConfigureRegionAdapterMappingsShouldRegisterSelectorMapping()\n        {\n            Assert.NotNull(application.DefaultRegionAdapterMappings);\n            Assert.NotNull(application.DefaultRegionAdapterMappings.GetMapping(typeof(Selector)));\n        }\n\n        [Fact]\n        public void ConfigureRegionAdapterMappingsShouldRegisterContentControlMapping()\n        {\n            Assert.NotNull(application.DefaultRegionAdapterMappings);\n            Assert.NotNull(application.DefaultRegionAdapterMappings.GetMapping(typeof(ContentControl)));\n        }\n\n        [Fact]\n        public void ConfigureDefaultRegionBehaviorsShouldAddAutoPopulateRegionBehavior()\n        {\n            Assert.True(application.DefaultRegionBehaviorTypes.ContainsKey(AutoPopulateRegionBehavior.BehaviorKey));\n        }\n\n        [Fact]\n        public void ConfigureDefaultRegionBehaviorsShouldBindRegionContextToDependencyObjectBehavior()\n        {\n            Assert.True(application.DefaultRegionBehaviorTypes.ContainsKey(BindRegionContextToDependencyObjectBehavior.BehaviorKey));\n        }\n\n        [Fact]\n        public void ConfigureDefaultRegionBehaviorsShouldAddRegionActiveAwareBehavior()\n        {\n            Assert.True(application.DefaultRegionBehaviorTypes.ContainsKey(RegionActiveAwareBehavior.BehaviorKey));\n        }\n\n        [Fact]\n        public void ConfigureDefaultRegionBehaviorsShouldAddSyncRegionContextWithHostBehavior()\n        {\n            Assert.True(application.DefaultRegionBehaviorTypes.ContainsKey(SyncRegionContextWithHostBehavior.BehaviorKey));\n        }\n\n        [Fact]\n        public void ConfigureDefaultRegionBehaviorsShouldAddRegionManagerRegistrationBehavior()\n        {\n            Assert.True(application.DefaultRegionBehaviorTypes.ContainsKey(RegionManagerRegistrationBehavior.BehaviorKey));\n        }\n\n        [Fact]\n        public void ConfigureDefaultRegionBehaviorsShouldAddRegionLifetimeBehavior()\n        {\n            Assert.True(application.DefaultRegionBehaviorTypes.ContainsKey(RegionMemberLifetimeBehavior.BehaviorKey));\n        }\n\n        [Fact]\n        public void RequiredTypesAreRegistered()\n        {\n            application.MockContainer.Verify(x => x.RegisterInstance(typeof(IModuleCatalog), It.IsAny<IModuleCatalog>()), Times.Once);\n\n            application.MockContainer.Verify(x => x.RegisterSingleton(typeof(IDialogService), typeof(DialogService)), Times.Once);\n            application.MockContainer.Verify(x => x.RegisterSingleton(typeof(IModuleInitializer), typeof(ModuleInitializer)), Times.Once);\n            application.MockContainer.Verify(x => x.RegisterSingleton(typeof(IModuleManager), typeof(ModuleManager)), Times.Once);\n            application.MockContainer.Verify(x => x.RegisterSingleton(typeof(RegionAdapterMappings), typeof(RegionAdapterMappings)), Times.Once);\n            application.MockContainer.Verify(x => x.RegisterSingleton(typeof(IRegionManager), typeof(RegionManager)), Times.Once);\n            application.MockContainer.Verify(x => x.RegisterSingleton(typeof(IRegionNavigationContentLoader), typeof(RegionNavigationContentLoader)), Times.Once);\n            application.MockContainer.Verify(x => x.RegisterSingleton(typeof(IEventAggregator), typeof(EventAggregator)), Times.Once);\n            application.MockContainer.Verify(x => x.RegisterSingleton(typeof(IRegionViewRegistry), typeof(RegionViewRegistry)), Times.Once);\n            application.MockContainer.Verify(x => x.RegisterSingleton(typeof(IRegionBehaviorFactory), typeof(RegionBehaviorFactory)), Times.Once);\n\n            application.MockContainer.Verify(x => x.Register(typeof(IRegionNavigationJournalEntry), typeof(RegionNavigationJournalEntry)), Times.Once);\n            application.MockContainer.Verify(x => x.Register(typeof(IRegionNavigationJournal), typeof(RegionNavigationJournal)), Times.Once);\n            application.MockContainer.Verify(x => x.Register(typeof(IRegionNavigationService), typeof(RegionNavigationService)), Times.Once);\n            application.MockContainer.Verify(x => x.Register(typeof(IDialogWindow), typeof(DialogWindow)), Times.Once);\n        }\n    }\n\n    public class PrismApplication : PrismApplicationBase\n    {\n        public Mock<IContainerExtension> MockContainer { get; private set; }\n\n        public IModuleCatalog DefaultModuleCatalog => Container.Resolve<IModuleCatalog>();\n\n        public IRegionBehaviorFactory DefaultRegionBehaviorTypes => Container.Resolve<IRegionBehaviorFactory>();\n\n        public RegionAdapterMappings DefaultRegionAdapterMappings => Container.Resolve<RegionAdapterMappings>();\n\n        public bool ConfigureViewModelLocatorWasCalled { get; set; }\n        public bool CreateShellWasCalled { get; set; }\n        public bool InitializeShellWasCalled { get; set; }\n        public bool OnInitializedWasCalled { get; set; }\n        public bool RegisterTypesWasCalled { get; set; }\n        public bool InitializeModulesCalled { get; internal set; }\n        public bool ConfigureModuleCatalogCalled { get; internal set; }\n        public bool RegisterFrameworkExceptionTypesCalled { get; internal set; }\n        public bool ConfigureRegionAdapterMappingsCalled { get; internal set; }\n        public bool ConfigureDefaultRegionBehaviorsCalled { get; internal set; }\n        public bool RegisterRequiredTypesCalled { get; internal set; }\n        public bool CreateModuleCatalogCalled { get; internal set; }\n        public bool CreateContainerExtensionCalled { get; internal set; }\n        public bool InitializeCalled { get; internal set; }\n\n        public void CallOnStartup()\n        {\n            base.OnStartup(null);\n        }\n\n        protected override void Initialize()\n        {\n            InitializeCalled = true;\n\n            ContainerLocator.ResetContainer();\n            MockContainer = new Mock<IContainerExtension>();\n\n            base.Initialize();\n        }\n\n        protected override IContainerExtension CreateContainerExtension()\n        {\n            CreateContainerExtensionCalled = true;\n            return MockContainer.Object;\n        }\n\n        protected override void ConfigureViewModelLocator()\n        {\n            ConfigureViewModelLocatorWasCalled = true;\n            //setting this breaks other tests using VML.\n            //We need to revist those tests to ensure it is being reset each time.\n            //base.ConfigureViewModelLocator();\n        }\n\n        protected override IModuleCatalog CreateModuleCatalog()\n        {\n            CreateModuleCatalogCalled = true;\n\n            var moduleCatalog = base.CreateModuleCatalog();\n            MockContainer.Setup(x => x.Resolve(typeof(IModuleCatalog))).Returns(moduleCatalog);\n            return moduleCatalog;\n        }\n\n        protected override Window CreateShell()\n        {\n            CreateShellWasCalled = true;\n            return null;\n        }\n\n        protected override void InitializeShell(Window shell)\n        {\n            InitializeShellWasCalled = false;\n        }\n\n        protected override void RegisterRequiredTypes(IContainerRegistry containerRegistry)\n        {\n            RegisterRequiredTypesCalled = true;\n\n            base.RegisterRequiredTypes(containerRegistry);\n\n            var moduleInitializer = new ModuleInitializer(MockContainer.Object);\n            MockContainer.Setup(x => x.Resolve(typeof(IModuleInitializer))).Returns(moduleInitializer);\n            MockContainer.Setup(x => x.Resolve(typeof(IModuleManager))).Returns(new ModuleManager(moduleInitializer, DefaultModuleCatalog));\n            MockContainer.Setup(x => x.Resolve(typeof(IRegionBehaviorFactory))).Returns(new RegionBehaviorFactory(MockContainer.Object));\n\n            var regionBehaviorFactory = new RegionBehaviorFactory(MockContainer.Object);\n            MockContainer.Setup(x => x.Resolve(typeof(IRegionBehaviorFactory))).Returns(regionBehaviorFactory);\n\n            MockContainer.Setup(x => x.Resolve(typeof(RegionAdapterMappings))).Returns(new RegionAdapterMappings());\n            MockContainer.Setup(x => x.Resolve(typeof(SelectorRegionAdapter))).Returns(new SelectorRegionAdapter(regionBehaviorFactory));\n            MockContainer.Setup(x => x.Resolve(typeof(ItemsControlRegionAdapter))).Returns(new ItemsControlRegionAdapter(regionBehaviorFactory));\n            MockContainer.Setup(x => x.Resolve(typeof(ContentControlRegionAdapter))).Returns(new ContentControlRegionAdapter(regionBehaviorFactory));\n        }\n\n        protected override void RegisterTypes(IContainerRegistry containerRegistry)\n        {\n            RegisterTypesWasCalled = true;\n        }\n\n        protected override void OnInitialized()\n        {\n            OnInitializedWasCalled = true;\n        }\n\n        protected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog)\n        {\n            ConfigureModuleCatalogCalled = true;\n            base.ConfigureModuleCatalog(moduleCatalog);\n        }\n\n        protected override void InitializeModules()\n        {\n            InitializeModulesCalled = true;\n            base.InitializeModules();\n        }\n\n        protected override void RegisterFrameworkExceptionTypes()\n        {\n            RegisterFrameworkExceptionTypesCalled = true;\n            base.RegisterFrameworkExceptionTypes();\n        }\n\n        protected override void ConfigureRegionAdapterMappings(RegionAdapterMappings regionAdapterMappings)\n        {\n            ConfigureRegionAdapterMappingsCalled = true;\n            base.ConfigureRegionAdapterMappings(regionAdapterMappings);\n        }\n\n        protected override void ConfigureDefaultRegionBehaviors(IRegionBehaviorFactory regionBehaviors)\n        {\n            ConfigureDefaultRegionBehaviorsCalled = true;\n            base.ConfigureDefaultRegionBehaviors(regionBehaviors);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/PrismBootstapperBaseFixture.cs",
    "content": "﻿using System;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Controls.Primitives;\nusing Moq;\nusing Prism.Events;\nusing Prism.Ioc;\nusing Prism.Modularity;\nusing Prism.Navigation.Regions;\nusing Prism.Navigation.Regions.Behaviors;\nusing Prism.Dialogs;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests\n{\n    public class PrismBootstapperSetup : IDisposable\n    {\n        public PrismBootstrapper Bootstrapper { get; set; }\n\n        public PrismBootstapperSetup()\n        {\n            ContainerLocator.ResetContainer();\n            Bootstrapper = new PrismBootstrapper();\n            Bootstrapper.Run();\n        }\n\n        public void Dispose()\n        {\n            ContainerLocator.ResetContainer();\n        }\n    }\n\n    public class PrismBootstapperBaseFixture : IClassFixture<PrismBootstapperSetup>\n    {\n        PrismBootstrapper bootstrapper = null;\n\n        public PrismBootstapperBaseFixture(PrismBootstapperSetup setup)\n        {\n            bootstrapper = setup.Bootstrapper;\n        }\n\n        [Fact]\n        public void BootstrapperShouldCallConfigureViewModelLocator()\n        {\n            Assert.True(bootstrapper.ConfigureViewModelLocatorWasCalled);\n        }\n\n        [Fact]\n        public void BootstrapperShouldCallInitialize()\n        {\n            Assert.True(bootstrapper.InitializeCalled);\n        }\n\n        [Fact]\n        public void BootstrapperShouldCallCreateContainerExtension()\n        {\n            Assert.True(bootstrapper.CreateContainerExtensionCalled);\n        }\n\n        [Fact]\n        public void BootstrapperShouldCallCreateModuleCatalog()\n        {\n            Assert.True(bootstrapper.CreateModuleCatalogCalled);\n        }\n\n        [Fact]\n        public void BootstrapperShouldCallRegisterRequiredTypes()\n        {\n            Assert.True(bootstrapper.RegisterRequiredTypesCalled);\n        }\n\n        [Fact]\n        public void BootstrapperShouldCallRegisterTypes()\n        {\n            Assert.True(bootstrapper.RegisterTypesWasCalled);\n        }\n\n        [Fact]\n        public void BootstrapperShouldCallConfigureDefaultRegionBehaviors()\n        {\n            Assert.True(bootstrapper.ConfigureDefaultRegionBehaviorsCalled);\n        }\n\n        [Fact]\n        public void BootstrapperShouldCallConfigureRegionAdapterMappings()\n        {\n            Assert.True(bootstrapper.ConfigureRegionAdapterMappingsCalled);\n        }\n\n        [Fact]\n        public void BootstrapperShouldCallRegisterFrameworkExceptionTypes()\n        {\n            Assert.True(bootstrapper.RegisterFrameworkExceptionTypesCalled);\n        }\n\n        [Fact]\n        public void BootstrapperShouldCallCreateShell()\n        {\n            Assert.True(bootstrapper.CreateShellWasCalled);\n        }\n\n        [Fact]\n        public void BootstrapperShouldCallInitializeShell()\n        {\n            //in our mock Shell is null, so this INitializeShell should not be called by the bootstrapper\n            Assert.False(bootstrapper.InitializeShellWasCalled);\n        }\n\n        [Fact]\n        public void BootstrapperShouldCallOnInitialized()\n        {\n            Assert.True(bootstrapper.OnInitializedWasCalled);\n        }\n\n        [Fact]\n        public void BootstrapperShouldCallConfigureModuleCatalog()\n        {\n            Assert.True(bootstrapper.ConfigureModuleCatalogCalled);\n        }\n\n        [Fact]\n        public void BootstrapperShouldCallInitializeModules()\n        {\n            Assert.True(bootstrapper.InitializeModulesCalled);\n        }\n\n        [Fact]\n        public void CreateModuleCatalogShouldReturnDefaultModuleCatalog()\n        {\n            Assert.NotNull(bootstrapper.DefaultModuleCatalog);\n        }\n\n        [Fact]\n        public void ConfigureRegionAdapterMappingsShouldRegisterItemsControlMapping()\n        {\n            Assert.NotNull(bootstrapper.DefaultRegionAdapterMappings);\n            Assert.NotNull(bootstrapper.DefaultRegionAdapterMappings.GetMapping(typeof(ItemsControl)));\n        }\n\n        [Fact]\n        public void ConfigureRegionAdapterMappingsShouldRegisterSelectorMapping()\n        {\n            Assert.NotNull(bootstrapper.DefaultRegionAdapterMappings);\n            Assert.NotNull(bootstrapper.DefaultRegionAdapterMappings.GetMapping(typeof(Selector)));\n        }\n\n        [Fact]\n        public void ConfigureRegionAdapterMappingsShouldRegisterContentControlMapping()\n        {\n            Assert.NotNull(bootstrapper.DefaultRegionAdapterMappings);\n            Assert.NotNull(bootstrapper.DefaultRegionAdapterMappings.GetMapping(typeof(ContentControl)));\n        }\n\n        [Fact]\n        public void ConfigureDefaultRegionBehaviorsShouldAddAutoPopulateRegionBehavior()\n        {\n            Assert.True(bootstrapper.DefaultRegionBehaviorTypes.ContainsKey(AutoPopulateRegionBehavior.BehaviorKey));\n        }\n\n        [Fact]\n        public void ConfigureDefaultRegionBehaviorsShouldBindRegionContextToDependencyObjectBehavior()\n        {\n            Assert.True(bootstrapper.DefaultRegionBehaviorTypes.ContainsKey(BindRegionContextToDependencyObjectBehavior.BehaviorKey));\n        }\n\n        [Fact]\n        public void ConfigureDefaultRegionBehaviorsShouldAddRegionActiveAwareBehavior()\n        {\n            Assert.True(bootstrapper.DefaultRegionBehaviorTypes.ContainsKey(RegionActiveAwareBehavior.BehaviorKey));\n        }\n\n        [Fact]\n        public void ConfigureDefaultRegionBehaviorsShouldAddSyncRegionContextWithHostBehavior()\n        {\n            Assert.True(bootstrapper.DefaultRegionBehaviorTypes.ContainsKey(SyncRegionContextWithHostBehavior.BehaviorKey));\n        }\n\n        [Fact]\n        public void ConfigureDefaultRegionBehaviorsShouldAddRegionManagerRegistrationBehavior()\n        {\n            Assert.True(bootstrapper.DefaultRegionBehaviorTypes.ContainsKey(RegionManagerRegistrationBehavior.BehaviorKey));\n        }\n\n        [Fact]\n        public void ConfigureDefaultRegionBehaviorsShouldAddRegionLifetimeBehavior()\n        {\n            Assert.True(bootstrapper.DefaultRegionBehaviorTypes.ContainsKey(RegionMemberLifetimeBehavior.BehaviorKey));\n        }\n\n        [Fact]\n        public void RequiredTypesAreRegistered()\n        {\n            bootstrapper.MockContainer.Verify(x => x.RegisterInstance(typeof(IModuleCatalog), It.IsAny<IModuleCatalog>()), Times.Once);\n\n            bootstrapper.MockContainer.Verify(x => x.RegisterSingleton(typeof(IDialogService), typeof(DialogService)), Times.Once);\n            bootstrapper.MockContainer.Verify(x => x.RegisterSingleton(typeof(IModuleInitializer), typeof(ModuleInitializer)), Times.Once);\n            bootstrapper.MockContainer.Verify(x => x.RegisterSingleton(typeof(IModuleManager), typeof(ModuleManager)), Times.Once);\n            bootstrapper.MockContainer.Verify(x => x.RegisterSingleton(typeof(RegionAdapterMappings), typeof(RegionAdapterMappings)), Times.Once);\n            bootstrapper.MockContainer.Verify(x => x.RegisterSingleton(typeof(IRegionManager), typeof(RegionManager)), Times.Once);\n            bootstrapper.MockContainer.Verify(x => x.RegisterSingleton(typeof(IRegionNavigationContentLoader), typeof(RegionNavigationContentLoader)), Times.Once);\n            bootstrapper.MockContainer.Verify(x => x.RegisterSingleton(typeof(IEventAggregator), typeof(EventAggregator)), Times.Once);\n            bootstrapper.MockContainer.Verify(x => x.RegisterSingleton(typeof(IRegionViewRegistry), typeof(RegionViewRegistry)), Times.Once);\n            bootstrapper.MockContainer.Verify(x => x.RegisterSingleton(typeof(IRegionBehaviorFactory), typeof(RegionBehaviorFactory)), Times.Once);\n\n            bootstrapper.MockContainer.Verify(x => x.Register(typeof(IRegionNavigationJournalEntry), typeof(RegionNavigationJournalEntry)), Times.Once);\n            bootstrapper.MockContainer.Verify(x => x.Register(typeof(IRegionNavigationJournal), typeof(RegionNavigationJournal)), Times.Once);\n            bootstrapper.MockContainer.Verify(x => x.Register(typeof(IRegionNavigationService), typeof(RegionNavigationService)), Times.Once);\n            bootstrapper.MockContainer.Verify(x => x.Register(typeof(IDialogWindow), typeof(DialogWindow)), Times.Once);\n        }\n    }\n\n    public class PrismBootstrapper : PrismBootstrapperBase\n    {\n        public Mock<IContainerExtension> MockContainer { get; private set; }\n\n        public IModuleCatalog DefaultModuleCatalog => Container.Resolve<IModuleCatalog>();\n\n        public IRegionBehaviorFactory DefaultRegionBehaviorTypes => Container.Resolve<IRegionBehaviorFactory>();\n\n        public RegionAdapterMappings DefaultRegionAdapterMappings => Container.Resolve<RegionAdapterMappings>();\n\n        public bool ConfigureViewModelLocatorWasCalled { get; set; }\n        public bool CreateShellWasCalled { get; set; }\n        public bool InitializeShellWasCalled { get; set; }\n        public bool OnInitializedWasCalled { get; set; }\n        public bool RegisterTypesWasCalled { get; set; }\n        public bool InitializeModulesCalled { get; internal set; }\n        public bool ConfigureModuleCatalogCalled { get; internal set; }\n        public bool RegisterFrameworkExceptionTypesCalled { get; internal set; }\n        public bool ConfigureRegionAdapterMappingsCalled { get; internal set; }\n        public bool ConfigureDefaultRegionBehaviorsCalled { get; internal set; }\n        public bool RegisterRequiredTypesCalled { get; internal set; }\n        public bool CreateModuleCatalogCalled { get; internal set; }\n        public bool CreateContainerExtensionCalled { get; internal set; }\n        public bool InitializeCalled { get; internal set; }\n\n        protected override void Initialize()\n        {\n            InitializeCalled = true;\n\n            ContainerLocator.ResetContainer();\n            MockContainer = new Mock<IContainerExtension>();\n\n            base.Initialize();\n        }\n\n        protected override IContainerExtension CreateContainerExtension()\n        {\n            CreateContainerExtensionCalled = true;\n            return MockContainer.Object;\n        }\n\n        protected override void ConfigureViewModelLocator()\n        {\n            ConfigureViewModelLocatorWasCalled = true;\n            //setting this breaks other tests using VML.\n            //We need to revist those tests to ensure it is being reset each time.\n            //base.ConfigureViewModelLocator();\n        }\n\n        protected override IModuleCatalog CreateModuleCatalog()\n        {\n            CreateModuleCatalogCalled = true;\n\n            var moduleCatalog = base.CreateModuleCatalog();\n            MockContainer.Setup(x => x.Resolve(typeof(IModuleCatalog))).Returns(moduleCatalog);\n            return moduleCatalog;\n        }\n\n        protected override DependencyObject CreateShell()\n        {\n            CreateShellWasCalled = true;\n            return null;\n        }\n\n        protected override void InitializeShell(DependencyObject shell)\n        {\n            InitializeShellWasCalled = false;\n        }\n\n        protected override void RegisterRequiredTypes(IContainerRegistry containerRegistry)\n        {\n            RegisterRequiredTypesCalled = true;\n\n            base.RegisterRequiredTypes(containerRegistry);\n\n            var moduleInitializer = new ModuleInitializer(MockContainer.Object);\n            MockContainer.Setup(x => x.Resolve(typeof(IModuleInitializer))).Returns(moduleInitializer);\n            MockContainer.Setup(x => x.Resolve(typeof(IModuleManager))).Returns(new ModuleManager(moduleInitializer, DefaultModuleCatalog));\n            MockContainer.Setup(x => x.Resolve(typeof(IRegionBehaviorFactory))).Returns(new RegionBehaviorFactory(MockContainer.Object));\n\n            var regionBehaviorFactory = new RegionBehaviorFactory(MockContainer.Object);\n            MockContainer.Setup(x => x.Resolve(typeof(IRegionBehaviorFactory))).Returns(regionBehaviorFactory);\n\n            MockContainer.Setup(x => x.Resolve(typeof(RegionAdapterMappings))).Returns(new RegionAdapterMappings());\n            MockContainer.Setup(x => x.Resolve(typeof(SelectorRegionAdapter))).Returns(new SelectorRegionAdapter(regionBehaviorFactory));\n            MockContainer.Setup(x => x.Resolve(typeof(ItemsControlRegionAdapter))).Returns(new ItemsControlRegionAdapter(regionBehaviorFactory));\n            MockContainer.Setup(x => x.Resolve(typeof(ContentControlRegionAdapter))).Returns(new ContentControlRegionAdapter(regionBehaviorFactory));\n        }\n\n        protected override void RegisterTypes(IContainerRegistry containerRegistry)\n        {\n            RegisterTypesWasCalled = true;\n        }\n\n        protected override void OnInitialized()\n        {\n            OnInitializedWasCalled = true;\n        }\n\n        protected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog)\n        {\n            ConfigureModuleCatalogCalled = true;\n            base.ConfigureModuleCatalog(moduleCatalog);\n        }\n\n        protected override void InitializeModules()\n        {\n            InitializeModulesCalled = true;\n            base.InitializeModules();\n        }\n\n        protected override void RegisterFrameworkExceptionTypes()\n        {\n            RegisterFrameworkExceptionTypesCalled = true;\n            base.RegisterFrameworkExceptionTypes();\n        }\n\n        protected override void ConfigureRegionAdapterMappings(RegionAdapterMappings regionAdapterMappings)\n        {\n            ConfigureRegionAdapterMappingsCalled = true;\n            base.ConfigureRegionAdapterMappings(regionAdapterMappings);\n        }\n\n        protected override void ConfigureDefaultRegionBehaviors(IRegionBehaviorFactory regionBehaviors)\n        {\n            ConfigureDefaultRegionBehaviorsCalled = true;\n            base.ConfigureDefaultRegionBehaviors(regionBehaviors);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Regions/AllActiveRegionFixture.cs",
    "content": "using System;\nusing Moq;\nusing Prism.Ioc;\nusing Prism.Navigation.Regions;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Regions\n{\n    public class AllActiveRegionFixture\n    {\n        [Fact]\n        public void AddingViewsToRegionMarksThemAsActive()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            IRegion region = new AllActiveRegion();\n            var view = new object();\n\n            region.Add(view);\n\n            Assert.True(region.ActiveViews.Contains(view));\n        }\n\n        [Fact]\n        public void DeactivateThrows()\n        {\n            var ex = Assert.Throws<InvalidOperationException>(() =>\n            {\n                IRegion region = new AllActiveRegion();\n                var view = new object();\n                region.Add(view);\n\n                region.Deactivate(view);\n            });\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Regions/Behaviors/AutoPopulateRegionBehaviorFixture.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing Moq;\nusing Prism.Ioc;\nusing Prism.Navigation.Regions;\nusing Prism.Navigation.Regions.Behaviors;\nusing Prism.Wpf.Tests.Mocks;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Regions.Behaviors\n{\n\n    public class AutoPopulateRegionBehaviorFixture\n    {\n        [Fact]\n        public void ShouldGetViewsFromRegistryOnAttach()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            var region = new MockPresentationRegion() { Name = \"MyRegion\" };\n            var viewFactory = new MockRegionContentRegistry();\n            var view = new object();\n            viewFactory.GetContentsReturnValue.Add(view);\n            var behavior = new AutoPopulateRegionBehavior(viewFactory)\n            {\n                Region = region\n            };\n\n            behavior.Attach();\n\n            Assert.Equal(\"MyRegion\", viewFactory.GetContentsArgumentRegionName);\n            Assert.Single(region.MockViews.Items);\n            Assert.Equal(view, region.MockViews.Items[0]);\n        }\n\n        [Fact]\n        public void ShouldGetViewsFromRegistryWhenRegisteringItAfterAttach()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            var region = new MockPresentationRegion() { Name = \"MyRegion\" };\n            var viewFactory = new MockRegionContentRegistry();\n            var behavior = new AutoPopulateRegionBehavior(viewFactory)\n            {\n                Region = region\n            };\n            var view = new object();\n\n            behavior.Attach();\n            viewFactory.GetContentsReturnValue.Add(view);\n            viewFactory.RaiseContentRegistered(\"MyRegion\", view);\n\n            Assert.Equal(\"MyRegion\", viewFactory.GetContentsArgumentRegionName);\n            Assert.Single(region.MockViews.Items);\n            Assert.Equal(view, region.MockViews.Items[0]);\n        }\n\n        [Fact]\n        public void NullRegionThrows()\n        {\n            var ex = Assert.Throws<InvalidOperationException>(() =>\n            {\n                var behavior = new AutoPopulateRegionBehavior(new MockRegionContentRegistry());\n\n                behavior.Attach();\n            });\n\n        }\n\n        [Fact]\n        public void CanAttachBeforeSettingName()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            var region = new MockPresentationRegion() { Name = null };\n            var viewFactory = new MockRegionContentRegistry();\n            var view = new object();\n            viewFactory.GetContentsReturnValue.Add(view);\n            var behavior = new AutoPopulateRegionBehavior(viewFactory)\n            {\n                Region = region\n            };\n\n            behavior.Attach();\n            Assert.False(viewFactory.GetContentsCalled);\n\n            region.Name = \"MyRegion\";\n\n            Assert.True(viewFactory.GetContentsCalled);\n            Assert.Equal(\"MyRegion\", viewFactory.GetContentsArgumentRegionName);\n            Assert.Single(region.MockViews.Items);\n            Assert.Equal(view, region.MockViews.Items[0]);\n        }\n\n        private class MockRegionContentRegistry : IRegionViewRegistry\n        {\n            public readonly List<object> GetContentsReturnValue = new List<object>();\n            public string GetContentsArgumentRegionName;\n            public bool GetContentsCalled;\n\n            public event EventHandler<ViewRegisteredEventArgs> ContentRegistered;\n\n            public IEnumerable<object> GetContents(string regionName, IContainerProvider container)\n            {\n                GetContentsCalled = true;\n                this.GetContentsArgumentRegionName = regionName;\n                return this.GetContentsReturnValue;\n            }\n\n            public void RaiseContentRegistered(string regionName, object view)\n            {\n                this.ContentRegistered(this, new ViewRegisteredEventArgs(regionName, _ => view));\n            }\n\n            public void RegisterViewWithRegion(string regionName, Type viewType)\n            {\n                throw new NotImplementedException();\n            }\n\n            public void RegisterViewWithRegion(string regionName, Func<IContainerProvider, object> getContentDelegate)\n            {\n                throw new NotImplementedException();\n            }\n\n            public void RegisterViewWithRegion(string regionName, string targetName)\n            {\n                throw new NotImplementedException();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Regions/Behaviors/BindRegionContextToDependencyObjectBehaviorFixture.cs",
    "content": "\n\nusing Prism.Navigation.Regions;\nusing Prism.Navigation.Regions.Behaviors;\nusing Prism.Wpf.Tests.Mocks;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Regions.Behaviors\n{\n\n    public class BindRegionContextToDependencyObjectBehaviorFixture\n    {\n        [StaFact]\n        public void ShouldSetRegionContextOnAddedView()\n        {\n            var behavior = new BindRegionContextToDependencyObjectBehavior();\n            var region = new MockPresentationRegion();\n            behavior.Region = region;\n            region.Context = \"MyContext\";\n            var view = new MockDependencyObject();\n\n            behavior.Attach();\n            region.Add(view);\n\n            var context = RegionContext.GetObservableContext(view);\n            Assert.NotNull(context.Value);\n            Assert.Equal(\"MyContext\", context.Value);\n        }\n\n        [StaFact]\n        public void ShouldSetRegionContextOnAlreadyAddedViews()\n        {\n            var behavior = new BindRegionContextToDependencyObjectBehavior();\n            var region = new MockPresentationRegion();\n            var view = new MockDependencyObject();\n            region.Add(view);\n            behavior.Region = region;\n            region.Context = \"MyContext\";\n\n            behavior.Attach();\n\n            var context = RegionContext.GetObservableContext(view);\n            Assert.NotNull(context.Value);\n            Assert.Equal(\"MyContext\", context.Value);\n        }\n\n        [StaFact]\n        public void ShouldRemoveContextToViewRemovedFromRegion()\n        {\n            var behavior = new BindRegionContextToDependencyObjectBehavior();\n            var region = new MockPresentationRegion();\n            var view = new MockDependencyObject();\n            region.Add(view);\n            behavior.Region = region;\n            region.Context = \"MyContext\";\n            behavior.Attach();\n\n            region.Remove(view);\n\n            var context = RegionContext.GetObservableContext(view);\n            Assert.Null(context.Value);\n        }\n\n        [StaFact]\n        public void ShouldSetRegionContextOnContextChange()\n        {\n            var behavior = new BindRegionContextToDependencyObjectBehavior();\n            var region = new MockPresentationRegion();\n            var view = new MockDependencyObject();\n            region.Add(view);\n            behavior.Region = region;\n            region.Context = \"MyContext\";\n            behavior.Attach();\n            Assert.Equal(\"MyContext\", RegionContext.GetObservableContext(view).Value);\n\n            region.Context = \"MyNewContext\";\n            region.OnPropertyChange(\"Context\");\n\n            Assert.Equal(\"MyNewContext\", RegionContext.GetObservableContext(view).Value);\n        }\n\n        [StaFact]\n        public void WhenAViewIsRemovedFromARegion_ThenRegionContextIsNotClearedInRegion()\n        {\n            var behavior = new BindRegionContextToDependencyObjectBehavior();\n            var region = new MockPresentationRegion();\n\n            behavior.Region = region;\n            behavior.Attach();\n\n            var myView = new MockFrameworkElement();\n\n            region.Add(myView);\n            region.Context = \"new context\";\n\n            region.Remove(myView);\n\n            Assert.NotNull(region.Context);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Regions/Behaviors/ClearChildViewsRegionBehaviorFixture.cs",
    "content": "\n\nusing Prism.Navigation.Regions;\nusing Prism.Navigation.Regions.Behaviors;\nusing Prism.Wpf.Tests.Mocks;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Regions.Behaviors\n{\n\n    public class ClearChildViewsRegionBehaviorFixture\n    {\n        [StaFact]\n        public void WhenClearChildViewsPropertyIsNotSet_ThenChildViewsRegionManagerIsNotCleared()\n        {\n            var regionManager = new MockRegionManager();\n\n            var region = new Region();\n            region.RegionManager = regionManager;\n\n            var behavior = new ClearChildViewsRegionBehavior();\n            behavior.Region = region;\n            behavior.Attach();\n\n            var childView = new MockFrameworkElement();\n            region.Add(childView);\n\n            Assert.Equal(regionManager, childView.GetValue(RegionManager.RegionManagerProperty));\n\n            region.RegionManager = null;\n\n            Assert.Equal(regionManager, childView.GetValue(RegionManager.RegionManagerProperty));\n        }\n\n        [StaFact]\n        public void WhenClearChildViewsPropertyIsTrue_ThenChildViewsRegionManagerIsCleared()\n        {\n            var regionManager = new MockRegionManager();\n\n            var region = new Region();\n            region.RegionManager = regionManager;\n\n            var behavior = new ClearChildViewsRegionBehavior();\n            behavior.Region = region;\n            behavior.Attach();\n\n            var childView = new MockFrameworkElement();\n            region.Add(childView);\n\n            ClearChildViewsRegionBehavior.SetClearChildViews(childView, true);\n\n            Assert.Equal(regionManager, childView.GetValue(RegionManager.RegionManagerProperty));\n\n            region.RegionManager = null;\n\n            Assert.Null(childView.GetValue(RegionManager.RegionManagerProperty));\n        }\n\n        [StaFact]\n        public void WhenRegionManagerChangesToNotNullValue_ThenChildViewsRegionManagerIsNotCleared()\n        {\n            var regionManager = new MockRegionManager();\n\n            var region = new Region();\n            region.RegionManager = regionManager;\n\n            var behavior = new ClearChildViewsRegionBehavior();\n            behavior.Region = region;\n            behavior.Attach();\n\n            var childView = new MockFrameworkElement();\n            region.Add(childView);\n\n            childView.SetValue(ClearChildViewsRegionBehavior.ClearChildViewsProperty, true);\n\n            Assert.Equal(regionManager, childView.GetValue(RegionManager.RegionManagerProperty));\n\n            region.RegionManager = new MockRegionManager();\n\n            Assert.NotNull(childView.GetValue(RegionManager.RegionManagerProperty));\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Regions/Behaviors/DelayedRegionCreationBehaviorFixture.cs",
    "content": "using Prism.Navigation.Regions;\nusing Prism.Navigation.Regions.Behaviors;\nusing Prism.Wpf.Tests.Mocks;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Regions.Behaviors\n{\n\n    public class DelayedRegionCreationBehaviorFixture\n    {\n        private DelayedRegionCreationBehavior GetBehavior(DependencyObject control, MockRegionManagerAccessor accessor, MockRegionAdapter adapter)\n        {\n            var mappings = new RegionAdapterMappings();\n            mappings.RegisterMapping(control.GetType(), adapter);\n            var behavior = new DelayedRegionCreationBehavior(mappings);\n            behavior.RegionManagerAccessor = accessor;\n            behavior.TargetElement = control;\n            return behavior;\n        }\n\n\n        private DelayedRegionCreationBehavior GetBehavior(DependencyObject control, MockRegionManagerAccessor accessor)\n        {\n            return GetBehavior(control, accessor, new MockRegionAdapter());\n        }\n\n        [StaFact]\n        public void RegionWillNotGetCreatedTwiceWhenThereAreMoreRegions()\n        {\n            var control1 = new MockFrameworkElement();\n            var control2 = new MockFrameworkElement();\n\n            var accessor = new MockRegionManagerAccessor\n            {\n                GetRegionName = d => d == control1 ? \"Region1\" : \"Region2\"\n            };\n\n            var adapter = new MockRegionAdapter();\n            adapter.Accessor = accessor;\n\n            var behavior1 = GetBehavior(control1, accessor, adapter);\n            var behavior2 = GetBehavior(control2, accessor, adapter);\n\n            behavior1.Attach();\n            behavior2.Attach();\n\n            accessor.UpdateRegions();\n\n            Assert.Contains(\"Region1\", adapter.CreatedRegions);\n            Assert.Contains(\"Region2\", adapter.CreatedRegions);\n            Assert.Equal(1, adapter.CreatedRegions.Count((name) => name == \"Region2\"));\n\n        }\n\n\n        [StaFact]\n        public void RegionGetsCreatedWhenAccessingRegions()\n        {\n            var control1 = new MockFrameworkElement();\n            var control2 = new MockFrameworkContentElement();\n\n            var accessor = new MockRegionManagerAccessor\n            {\n                GetRegionName = d => \"myRegionName\"\n            };\n\n            var behavior1 = GetBehavior(control1, accessor);\n            behavior1.Attach();\n            var behavior2 = GetBehavior(control2, accessor);\n            behavior2.Attach();\n\n            accessor.UpdateRegions();\n\n            Assert.NotNull(RegionManager.GetObservableRegion(control1).Value);\n            Assert.IsAssignableFrom<IRegion>(RegionManager.GetObservableRegion(control1).Value);\n            Assert.NotNull(RegionManager.GetObservableRegion(control2).Value);\n            Assert.IsAssignableFrom<IRegion>(RegionManager.GetObservableRegion(control2).Value);\n        }\n\n        [StaFact]\n        public void RegionDoesNotGetCreatedTwiceWhenUpdatingRegions()\n        {\n            var control = new MockFrameworkElement();\n\n            var accessor = new MockRegionManagerAccessor\n            {\n                GetRegionName = d => \"myRegionName\"\n            };\n\n            var behavior = GetBehavior(control, accessor);\n            behavior.Attach();\n            accessor.UpdateRegions();\n            IRegion region = RegionManager.GetObservableRegion(control).Value;\n\n            accessor.UpdateRegions();\n\n            Assert.Same(region, RegionManager.GetObservableRegion(control).Value);\n        }\n\n        [StaFact]\n        public async Task BehaviorDoesNotPreventControlFromBeingGarbageCollected()\n        {\n            var control = new MockFrameworkElement();\n            WeakReference controlWeakReference = new WeakReference(control);\n\n            var accessor = new MockRegionManagerAccessor\n            {\n                GetRegionName = d => \"myRegionName\"\n            };\n\n            var behavior = GetBehavior(control, accessor);\n            behavior.Attach();\n\n            Assert.True(controlWeakReference.IsAlive);\n            GC.KeepAlive(control);\n\n            control = null;\n            await Task.Delay(10);\n            GC.Collect();\n\n            Assert.False(controlWeakReference.IsAlive);\n        }\n\n        [StaFact]\n        public async Task BehaviorDoesNotPreventControlFromBeingGarbageCollectedWhenRegionWasCreated()\n        {\n            var control = new MockFrameworkElement();\n            WeakReference controlWeakReference = new WeakReference(control);\n\n            var accessor = new MockRegionManagerAccessor\n            {\n                GetRegionName = d => \"myRegionName\"\n            };\n\n            var behavior = GetBehavior(control, accessor);\n            behavior.Attach();\n            accessor.UpdateRegions();\n\n            Assert.True(controlWeakReference.IsAlive);\n            GC.KeepAlive(control);\n\n            control = null;\n            await Task.Delay(10);\n            GC.Collect();\n\n            Assert.False(controlWeakReference.IsAlive);\n        }\n\n        [StaFact]\n        public void BehaviorShouldUnhookEventWhenDetaching()\n        {\n            var control = new MockFrameworkElement();\n\n            var accessor = new MockRegionManagerAccessor\n            {\n                GetRegionName = d => \"myRegionName\",\n            };\n            var behavior = GetBehavior(control, accessor);\n            behavior.Attach();\n\n            int startingCount = accessor.GetSubscribersCount();\n\n            behavior.Detach();\n\n            Assert.Equal<int>(startingCount - 1, accessor.GetSubscribersCount());\n        }\n\n        [StaFact()]\n        public void ShouldCleanupBehaviorOnceRegionIsCreated()\n        {\n            var control = new MockFrameworkElement();\n            var control2 = new MockFrameworkContentElement();\n\n            var accessor = new MockRegionManagerAccessor\n            {\n                GetRegionName = d => \"myRegionName\"\n            };\n\n            var behavior = GetBehavior(control, accessor);\n            WeakReference behaviorWeakReference = new WeakReference(behavior);\n            behavior.Attach();\n            accessor.UpdateRegions();\n            Assert.True(behaviorWeakReference.IsAlive);\n            GC.KeepAlive(behavior);\n\n            behavior = null;\n            GC.Collect();\n\n            Assert.False(behaviorWeakReference.IsAlive);\n\n            var behavior2 = GetBehavior(control2, accessor);\n            WeakReference behaviorWeakReference2 = new WeakReference(behavior2);\n            behavior2.Attach();\n            accessor.UpdateRegions();\n            Assert.True(behaviorWeakReference2.IsAlive);\n            GC.KeepAlive(behavior2);\n\n            behavior2 = null;\n            GC.Collect();\n\n            Assert.False(behaviorWeakReference2.IsAlive);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Regions/Behaviors/RegionActiveAwareBehaviorFixture.cs",
    "content": "\n\nusing System;\nusing System.Windows;\nusing Moq;\nusing Prism.Navigation.Regions;\nusing Prism.Navigation.Regions.Behaviors;\nusing Prism.Wpf.Tests.Mocks;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Regions.Behaviors\n{\n\n    public class RegionActiveAwareBehaviorFixture\n    {\n        [StaFact]\n        public void SetsIsActivePropertyOnIActiveAwareObjects()\n        {\n            var region = new MockPresentationRegion();\n            region.RegionManager = new MockRegionManager();\n            var behavior = new RegionActiveAwareBehavior { Region = region };\n            behavior.Attach();\n            var collection = region.MockActiveViews.Items;\n\n            ActiveAwareFrameworkElement activeAwareObject = new ActiveAwareFrameworkElement();\n\n            Assert.False(activeAwareObject.IsActive);\n            collection.Add(activeAwareObject);\n\n            Assert.True(activeAwareObject.IsActive);\n\n            collection.Remove(activeAwareObject);\n            Assert.False(activeAwareObject.IsActive);\n        }\n\n        [StaFact]\n        public void SetsIsActivePropertyOnIActiveAwareDataContexts()\n        {\n            var region = new MockPresentationRegion();\n            var behavior = new RegionActiveAwareBehavior { Region = region };\n            behavior.Attach();\n            var collection = region.MockActiveViews.Items;\n\n            ActiveAwareFrameworkElement activeAwareObject = new ActiveAwareFrameworkElement();\n\n            var frameworkElementMock = new Mock<FrameworkElement>();\n            var frameworkElement = frameworkElementMock.Object;\n            frameworkElement.DataContext = activeAwareObject;\n\n            Assert.False(activeAwareObject.IsActive);\n            collection.Add(frameworkElement);\n\n            Assert.True(activeAwareObject.IsActive);\n\n            collection.Remove(frameworkElement);\n            Assert.False(activeAwareObject.IsActive);\n        }\n\n        [StaFact]\n        public void SetsIsActivePropertyOnBothIActiveAwareViewAndDataContext()\n        {\n            var region = new MockPresentationRegion();\n            var behavior = new RegionActiveAwareBehavior { Region = region };\n            behavior.Attach();\n            var collection = region.MockActiveViews.Items;\n\n            var activeAwareMock = new Mock<IActiveAware>();\n            activeAwareMock.SetupProperty(o => o.IsActive);\n            var activeAwareObject = activeAwareMock.Object;\n\n            var frameworkElementMock = new Mock<FrameworkElement>();\n            frameworkElementMock.As<IActiveAware>().SetupProperty(o => o.IsActive);\n            var frameworkElement = frameworkElementMock.Object;\n            frameworkElement.DataContext = activeAwareObject;\n\n            Assert.False(((IActiveAware)frameworkElement).IsActive);\n            Assert.False(activeAwareObject.IsActive);\n            collection.Add(frameworkElement);\n\n            Assert.True(((IActiveAware)frameworkElement).IsActive);\n            Assert.True(activeAwareObject.IsActive);\n\n            collection.Remove(frameworkElement);\n            Assert.False(((IActiveAware)frameworkElement).IsActive);\n            Assert.False(activeAwareObject.IsActive);\n        }\n\n        [StaFact]\n        public void DetachStopsListeningForChanges()\n        {\n            var region = new MockPresentationRegion();\n            var behavior = new RegionActiveAwareBehavior { Region = region };\n            var collection = region.MockActiveViews.Items;\n            behavior.Attach();\n            behavior.Detach();\n            ActiveAwareFrameworkElement activeAwareObject = new ActiveAwareFrameworkElement();\n\n            collection.Add(activeAwareObject);\n\n            Assert.False(activeAwareObject.IsActive);\n        }\n\n        [StaFact]\n        public void DoesNotThrowWhenAddingNonActiveAwareObjects()\n        {\n            var region = new MockPresentationRegion();\n            var behavior = new RegionActiveAwareBehavior { Region = region };\n            behavior.Attach();\n            var collection = region.MockActiveViews.Items;\n\n            collection.Add(new object());\n        }\n\n        [StaFact]\n        public void DoesNotThrowWhenAddingNonActiveAwareDataContexts()\n        {\n            var region = new MockPresentationRegion();\n            var behavior = new RegionActiveAwareBehavior { Region = region };\n            behavior.Attach();\n            var collection = region.MockActiveViews.Items;\n\n            var frameworkElementMock = new Mock<FrameworkElement>();\n            var frameworkElement = frameworkElementMock.Object;\n            frameworkElement.DataContext = new object();\n\n\n            collection.Add(frameworkElement);\n        }\n\n        [StaFact]\n        public void WhenParentViewGetsActivatedOrDeactivated_ThenChildViewIsNotUpdated()\n        {\n            var scopedRegionManager = new RegionManager();\n            var scopedRegion = new Region { Name = \"MyScopedRegion\", RegionManager = scopedRegionManager };\n            scopedRegionManager.Regions.Add(scopedRegion);\n            var behaviorForScopedRegion = new RegionActiveAwareBehavior { Region = scopedRegion };\n            behaviorForScopedRegion.Attach();\n            var childActiveAwareView = new ActiveAwareFrameworkElement();\n\n            var region = new MockPresentationRegion();\n            var behavior = new RegionActiveAwareBehavior { Region = region };\n            behavior.Attach();\n\n            var view = new MockFrameworkElement();\n            region.Add(view);\n            RegionManager.SetRegionManager(view, scopedRegionManager);\n            region.Activate(view);\n\n            scopedRegion.Add(childActiveAwareView);\n            scopedRegion.Activate(childActiveAwareView);\n\n            Assert.True(childActiveAwareView.IsActive);\n\n            region.Deactivate(view);\n\n            Assert.True(childActiveAwareView.IsActive);\n        }\n\n        [StaFact]\n        public void WhenParentViewGetsActivatedOrDeactivated_ThenSyncedChildViewIsUpdated()\n        {\n            var scopedRegionManager = new RegionManager();\n            var scopedRegion = new Region { Name = \"MyScopedRegion\", RegionManager = scopedRegionManager };\n            scopedRegionManager.Regions.Add(scopedRegion);\n            var behaviorForScopedRegion = new RegionActiveAwareBehavior { Region = scopedRegion };\n            behaviorForScopedRegion.Attach();\n            var childActiveAwareView = new SyncedActiveAwareObject();\n\n            var region = new MockPresentationRegion();\n            var behavior = new RegionActiveAwareBehavior { Region = region };\n            behavior.Attach();\n\n            var view = new MockFrameworkElement();\n            region.Add(view);\n            RegionManager.SetRegionManager(view, scopedRegionManager);\n            region.Activate(view);\n\n            scopedRegion.Add(childActiveAwareView);\n            scopedRegion.Activate(childActiveAwareView);\n\n            Assert.True(childActiveAwareView.IsActive);\n\n            region.Deactivate(view);\n\n            Assert.False(childActiveAwareView.IsActive);\n        }\n\n        [StaFact]\n        public void WhenParentViewGetsActivatedOrDeactivated_ThenSyncedChildViewWithAttributeInVMIsUpdated()\n        {\n            var scopedRegionManager = new RegionManager();\n            var scopedRegion = new Region { Name = \"MyScopedRegion\", RegionManager = scopedRegionManager };\n            scopedRegionManager.Regions.Add(scopedRegion);\n            var behaviorForScopedRegion = new RegionActiveAwareBehavior { Region = scopedRegion };\n            behaviorForScopedRegion.Attach();\n            var childActiveAwareView = new ActiveAwareFrameworkElement();\n            childActiveAwareView.DataContext = new SyncedActiveAwareObjectViewModel();\n\n            var region = new MockPresentationRegion();\n            var behavior = new RegionActiveAwareBehavior { Region = region };\n            behavior.Attach();\n\n            var view = new MockFrameworkElement();\n            region.Add(view);\n            RegionManager.SetRegionManager(view, scopedRegionManager);\n            region.Activate(view);\n\n            scopedRegion.Add(childActiveAwareView);\n            scopedRegion.Activate(childActiveAwareView);\n\n            Assert.True(childActiveAwareView.IsActive);\n\n            region.Deactivate(view);\n\n            Assert.False(childActiveAwareView.IsActive);\n        }\n\n        [StaFact]\n        public void WhenParentViewGetsActivatedOrDeactivated_ThenSyncedChildViewModelThatIsNotAFrameworkElementIsNotUpdated()\n        {\n            var scopedRegionManager = new RegionManager();\n            var scopedRegion = new Region { Name = \"MyScopedRegion\", RegionManager = scopedRegionManager };\n            scopedRegionManager.Regions.Add(scopedRegion);\n            var behaviorForScopedRegion = new RegionActiveAwareBehavior { Region = scopedRegion };\n            behaviorForScopedRegion.Attach();\n            var childActiveAwareView = new ActiveAwareObject();\n\n            var region = new MockPresentationRegion();\n            var behavior = new RegionActiveAwareBehavior { Region = region };\n            behavior.Attach();\n\n            var view = new MockFrameworkElement();\n            region.Add(view);\n            RegionManager.SetRegionManager(view, scopedRegionManager);\n            region.Activate(view);\n\n            scopedRegion.Add(childActiveAwareView);\n            scopedRegion.Activate(childActiveAwareView);\n\n            Assert.True(childActiveAwareView.IsActive);\n\n            region.Deactivate(view);\n\n            Assert.True(childActiveAwareView.IsActive);\n        }\n\n        [StaFact]\n        public void WhenParentViewGetsActivatedOrDeactivated_ThenSyncedChildViewNotInActiveViewsIsNotUpdated()\n        {\n            var scopedRegionManager = new RegionManager();\n            var scopedRegion = new Region { Name = \"MyScopedRegion\", RegionManager = scopedRegionManager };\n            scopedRegionManager.Regions.Add(scopedRegion);\n            var behaviorForScopedRegion = new RegionActiveAwareBehavior { Region = scopedRegion };\n            behaviorForScopedRegion.Attach();\n            var childActiveAwareView = new SyncedActiveAwareObject();\n\n            var region = new MockPresentationRegion();\n            var behavior = new RegionActiveAwareBehavior { Region = region };\n            behavior.Attach();\n\n            var view = new MockFrameworkElement();\n            region.Add(view);\n            RegionManager.SetRegionManager(view, scopedRegionManager);\n            region.Activate(view);\n\n            scopedRegion.Add(childActiveAwareView);\n            scopedRegion.Deactivate(childActiveAwareView);\n\n            Assert.False(childActiveAwareView.IsActive);\n\n            region.Deactivate(view);\n\n            Assert.False(childActiveAwareView.IsActive);\n\n            region.Activate(view);\n\n            Assert.False(childActiveAwareView.IsActive);\n        }\n\n        [StaFact]\n        public void WhenParentViewWithoutScopedRegionGetsActivatedOrDeactivated_ThenSyncedChildViewIsNotUpdated()\n        {\n            var commonRegionManager = new RegionManager();\n            var nonScopedRegion = new Region { Name = \"MyRegion\", RegionManager = commonRegionManager };\n            commonRegionManager.Regions.Add(nonScopedRegion);\n            var behaviorForScopedRegion = new RegionActiveAwareBehavior { Region = nonScopedRegion };\n            behaviorForScopedRegion.Attach();\n            var childActiveAwareView = new SyncedActiveAwareObject();\n\n            var region = new MockPresentationRegion { RegionManager = commonRegionManager };\n            var behavior = new RegionActiveAwareBehavior { Region = region };\n            behavior.Attach();\n\n            var view = new MockFrameworkElement();\n            region.Add(view);\n            RegionManager.SetRegionManager(view, commonRegionManager);\n            region.Activate(view);\n\n            nonScopedRegion.Add(childActiveAwareView);\n            nonScopedRegion.Activate(childActiveAwareView);\n\n            Assert.True(childActiveAwareView.IsActive);\n\n            region.Deactivate(view);\n\n            Assert.True(childActiveAwareView.IsActive);\n        }\n\n        class ActiveAwareObject : IActiveAware\n        {\n            public bool IsActive { get; set; }\n            public event EventHandler IsActiveChanged;\n        }\n\n        class ActiveAwareFrameworkElement : FrameworkElement, IActiveAware\n        {\n            public bool IsActive { get; set; }\n            public event EventHandler IsActiveChanged;\n        }\n\n        [SyncActiveState]\n        class SyncedActiveAwareObject : IActiveAware\n        {\n            public bool IsActive { get; set; }\n            public event EventHandler IsActiveChanged;\n        }\n\n        [SyncActiveState]\n        class SyncedActiveAwareObjectViewModel : IActiveAware\n        {\n            public bool IsActive { get; set; }\n            public event EventHandler IsActiveChanged;\n        }\n\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Regions/Behaviors/RegionManagerRegistrationBehaviorFixture.cs",
    "content": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\nusing System.Windows.Controls;\nusing Prism.Ioc;\nusing Prism.Navigation;\nusing Prism.Navigation.Regions;\nusing Prism.Navigation.Regions.Behaviors;\nusing Prism.Wpf.Tests.Mocks;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Regions.Behaviors\n{\n\n    public class RegionManagerRegistrationBehaviorFixture\n    {\n        [StaFact]\n        public void ShouldRegisterRegionIfRegionManagerIsSet()\n        {\n            var control = new ItemsControl();\n            var regionManager = new MockRegionManager();\n            var accessor = new MockRegionManagerAccessor\n            {\n                GetRegionManager = d => regionManager\n            };\n            var region = new MockPresentationRegion() { Name = \"myRegionName\" };\n            var behavior = new RegionManagerRegistrationBehavior()\n            {\n                RegionManagerAccessor = accessor,\n                Region = region,\n                HostControl = control\n            };\n\n            behavior.Attach();\n\n            Assert.True(regionManager.MockRegionCollection.AddCalled);\n            Assert.Same(region, regionManager.MockRegionCollection.AddArgument);\n        }\n\n        [StaFact]\n        public void DoesNotFailIfRegionManagerIsNotSet()\n        {\n            var control = new ItemsControl();\n            var accessor = new MockRegionManagerAccessor();\n\n            var behavior = new RegionManagerRegistrationBehavior()\n            {\n                RegionManagerAccessor = accessor,\n                Region = new MockPresentationRegion() { Name = \"myRegionWithoutManager\" },\n                HostControl = control\n            };\n            behavior.Attach();\n        }\n\n        [StaFact]\n        public void RegionGetsAddedInRegionManagerWhenAddedIntoAScopeAndAccessingRegions()\n        {\n            var regionManager = new MockRegionManager();\n            var control = new MockFrameworkElement();\n\n            var regionScopeControl = new ContentControl();\n            var accessor = new MockRegionManagerAccessor\n            {\n                GetRegionManager = d => d == regionScopeControl ? regionManager : null\n            };\n\n            var behavior = new RegionManagerRegistrationBehavior()\n            {\n                RegionManagerAccessor = accessor,\n                Region = new MockPresentationRegion() { Name = \"myRegionName\" },\n                HostControl = control\n            };\n            behavior.Attach();\n\n            Assert.False(regionManager.MockRegionCollection.AddCalled);\n\n            regionScopeControl.Content = control;\n            accessor.UpdateRegions();\n\n            Assert.True(regionManager.MockRegionCollection.AddCalled);\n        }\n\n        [StaFact]\n        public void RegionDoesNotGetAddedTwiceWhenUpdatingRegions()\n        {\n            var regionManager = new MockRegionManager();\n            var control = new MockFrameworkElement();\n\n            var regionScopeControl = new ContentControl();\n            var accessor = new MockRegionManagerAccessor\n            {\n                GetRegionManager = d => d == regionScopeControl ? regionManager : null\n            };\n\n            var behavior = new RegionManagerRegistrationBehavior()\n            {\n                RegionManagerAccessor = accessor,\n                Region = new MockPresentationRegion() { Name = \"myRegionName\" },\n                HostControl = control\n            };\n            behavior.Attach();\n\n            Assert.False(regionManager.MockRegionCollection.AddCalled);\n\n            regionScopeControl.Content = control;\n            accessor.UpdateRegions();\n\n            Assert.True(regionManager.MockRegionCollection.AddCalled);\n            regionManager.MockRegionCollection.AddCalled = false;\n\n            accessor.UpdateRegions();\n            Assert.False(regionManager.MockRegionCollection.AddCalled);\n        }\n\n        [StaFact]\n        public void RegionGetsRemovedFromRegionManagerWhenRemovedFromScope()\n        {\n            var regionManager = new MockRegionManager();\n            var control = new MockFrameworkElement();\n            var regionScopeControl = new ContentControl();\n            var accessor = new MockRegionManagerAccessor\n            {\n                GetRegionManager = d => d == regionScopeControl ? regionManager : null\n            };\n\n            var region = new MockPresentationRegion() { Name = \"myRegionName\" };\n            var behavior = new RegionManagerRegistrationBehavior()\n            {\n                RegionManagerAccessor = accessor,\n                Region = region,\n                HostControl = control\n            };\n            behavior.Attach();\n\n            regionScopeControl.Content = control;\n            accessor.UpdateRegions();\n            Assert.True(regionManager.MockRegionCollection.AddCalled);\n            Assert.Same(region, regionManager.MockRegionCollection.AddArgument);\n\n            regionScopeControl.Content = null;\n            accessor.UpdateRegions();\n\n            Assert.True(regionManager.MockRegionCollection.RemoveCalled);\n        }\n\n        [StaFact]\n        public void CanAttachBeforeSettingName()\n        {\n            var control = new ItemsControl();\n            var regionManager = new MockRegionManager();\n            var accessor = new MockRegionManagerAccessor\n            {\n                GetRegionManager = d => regionManager\n            };\n            var region = new MockPresentationRegion() { Name = null };\n            var behavior = new RegionManagerRegistrationBehavior()\n            {\n                RegionManagerAccessor = accessor,\n                Region = region,\n                HostControl = control\n            };\n\n            behavior.Attach();\n            Assert.False(regionManager.MockRegionCollection.AddCalled);\n\n            region.Name = \"myRegionName\";\n\n            Assert.True(regionManager.MockRegionCollection.AddCalled);\n            Assert.Same(region, regionManager.MockRegionCollection.AddArgument);\n        }\n\n        [StaFact]\n        public void HostControlSetAfterAttachThrows()\n        {\n            var ex = Assert.Throws<InvalidOperationException>(() =>\n            {\n                var behavior = new RegionManagerRegistrationBehavior();\n                var hostControl1 = new MockDependencyObject();\n                var hostControl2 = new MockDependencyObject();\n                behavior.HostControl = hostControl1;\n                behavior.Attach();\n                behavior.HostControl = hostControl2;\n            });\n\n        }\n\n        [StaFact]\n        public async Task BehaviorDoesNotPreventRegionManagerFromBeingGarbageCollected()\n        {\n            var control = new MockFrameworkElement();\n            var regionManager = new MockRegionManager();\n            var regionManagerWeakReference = new WeakReference(regionManager);\n\n            var accessor = new MockRegionManagerAccessor\n            {\n                GetRegionName = d => \"myRegionName\",\n                GetRegionManager = d => regionManager\n            };\n\n            var behavior = new RegionManagerRegistrationBehavior()\n            {\n                RegionManagerAccessor = accessor,\n                Region = new MockPresentationRegion(),\n                HostControl = control\n            };\n            behavior.Attach();\n\n            Assert.True(regionManagerWeakReference.IsAlive);\n            GC.KeepAlive(regionManager);\n\n            regionManager = null;\n            await Task.Delay(50);\n\n            GC.Collect();\n\n            Assert.False(regionManagerWeakReference.IsAlive);\n        }\n\n        internal class MockRegionManager : IRegionManager\n        {\n            public MockRegionCollection MockRegionCollection = new MockRegionCollection();\n\n            #region IRegionManager Members\n\n            public IRegionCollection Regions\n            {\n                get { return this.MockRegionCollection; }\n            }\n\n            IRegionManager IRegionManager.CreateRegionManager()\n            {\n                throw new System.NotImplementedException();\n            }\n\n            public IRegionManager AddToRegion(string regionName, object view)\n            {\n                throw new NotImplementedException();\n            }\n\n            public IRegionManager RegisterViewWithRegion(string regionName, Type viewType)\n            {\n                throw new NotImplementedException();\n            }\n\n            public IRegionManager RegisterViewWithRegion(string regionName, Func<IContainerProvider, object> getContentDelegate)\n            {\n                throw new NotImplementedException();\n            }\n\n            public void RequestNavigate(string regionName, Uri source, Action<NavigationResult> navigationCallback)\n            {\n                throw new NotImplementedException();\n            }\n\n            public void RequestNavigate(string regionName, Uri source)\n            {\n                throw new NotImplementedException();\n            }\n\n            public void RequestNavigate(string regionName, string source, Action<NavigationResult> navigationCallback)\n            {\n                throw new NotImplementedException();\n            }\n\n            public void RequestNavigate(string regionName, string source)\n            {\n                throw new NotImplementedException();\n            }\n\n            public void RequestNavigate(string regionName, Uri target, Action<NavigationResult> navigationCallback, INavigationParameters navigationParameters)\n            {\n                throw new NotImplementedException();\n            }\n\n            public void RequestNavigate(string regionName, string target, Action<NavigationResult> navigationCallback, INavigationParameters navigationParameters)\n            {\n                throw new NotImplementedException();\n            }\n\n            public void RequestNavigate(string regionName, Uri target, INavigationParameters navigationParameters)\n            {\n                throw new NotImplementedException();\n            }\n\n            public void RequestNavigate(string regionName, string target, INavigationParameters navigationParameters)\n            {\n                throw new NotImplementedException();\n            }\n\n            #endregion\n\n            public bool Navigate(Uri source)\n            {\n                throw new NotImplementedException();\n            }\n\n            public IRegionManager AddToRegion(string regionName, string viewName)\n            {\n                throw new NotImplementedException();\n            }\n\n            public IRegionManager RegisterViewWithRegion(string regionName, string viewName)\n            {\n                throw new NotImplementedException();\n            }\n        }\n    }\n\n    internal class MockRegionCollection : IRegionCollection\n    {\n        public bool RemoveCalled;\n        public bool AddCalled;\n        public IRegion AddArgument;\n\n        IEnumerator<IRegion> IEnumerable<IRegion>.GetEnumerator()\n        {\n            throw new System.NotImplementedException();\n        }\n\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public IRegion this[string regionName]\n        {\n            get { throw new System.NotImplementedException(); }\n        }\n\n        public void Add(IRegion region)\n        {\n            AddCalled = true;\n            AddArgument = region;\n        }\n\n        public bool Remove(string regionName)\n        {\n            RemoveCalled = true;\n            return true;\n        }\n\n        public bool ContainsRegionWithName(string regionName)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public void Add(string regionName, IRegion region)\n        {\n            throw new NotImplementedException();\n        }\n\n        public event System.Collections.Specialized.NotifyCollectionChangedEventHandler CollectionChanged;\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Regions/Behaviors/RegionMemberLifetimeBehaviorFixture.cs",
    "content": "\n\nusing Moq;\nusing Prism.Navigation.Regions;\nusing Prism.Navigation.Regions.Behaviors;\nusing Prism.Wpf.Tests.Mocks;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Regions.Behaviors\n{\n\n    public class RegionMemberLifetimeBehaviorFixture\n    {\n        protected Region Region { get; set; }\n        protected RegionMemberLifetimeBehavior Behavior { get; set; }\n\n        public RegionMemberLifetimeBehaviorFixture()\n        {\n            Arrange();\n        }\n\n        protected virtual void Arrange()\n        {\n            this.Region = new Region();\n            this.Behavior = new RegionMemberLifetimeBehavior();\n            this.Behavior.Region = this.Region;\n            this.Behavior.Attach();\n        }\n\n        [Fact]\n        public void WhenBehaviorAttachedThenReportsIsAttached()\n        {\n            Assert.True(Behavior.IsAttached);\n        }\n\n        [Fact]\n        public void WhenIRegionMemberLifetimeItemReturnsKeepAliveFalseRemovesWhenInactive()\n        {\n            // Arrange\n            var regionItemMock = new Mock<IRegionMemberLifetime>();\n            regionItemMock.Setup(i => i.KeepAlive).Returns(false);\n\n            Region.Add(regionItemMock.Object);\n            Region.Activate(regionItemMock.Object);\n\n            // Act\n            Region.Deactivate(regionItemMock.Object);\n\n            // Assert\n            Assert.False(Region.Views.Contains(regionItemMock.Object));\n        }\n\n        [Fact]\n        public void WhenIRegionMemberLifetimeItemReturnsKeepAliveTrueDoesNotRemoveOnDeactivation()\n        {\n            // Arrange\n            var regionItemMock = new Mock<IRegionMemberLifetime>();\n            regionItemMock.Setup(i => i.KeepAlive).Returns(true);\n\n            Region.Add(regionItemMock.Object);\n            Region.Activate(regionItemMock.Object);\n\n            // Act\n            Region.Deactivate(regionItemMock.Object);\n\n            // Assert\n            Assert.True(Region.Views.Contains(regionItemMock.Object));\n\n        }\n\n        [Fact]\n        public void WhenIRegionMemberLifetimeItemReturnsKeepAliveFalseCanRemoveFromRegion()\n        {\n            // Arrange\n            var regionItemMock = new Mock<IRegionMemberLifetime>();\n            regionItemMock.Setup(i => i.KeepAlive).Returns(false);\n\n            var view = regionItemMock.Object;\n\n            Region.Add(view);\n            Region.Activate(view);\n\n            // The presence of the following two lines is essential for the test:\n            // we want to access both ActiveView and Views in that order\n            Assert.True(Region.ActiveViews.Contains(view));\n            Assert.True(Region.Views.Contains(view));\n\n            // Act\n            // This may throw\n            Region.Remove(view);\n\n            // Assert\n            Assert.False(Region.Views.Contains(view));\n            Assert.False(Region.ActiveViews.Contains(view));\n        }\n\n        [Fact]\n        public void WhenRegionContainsMultipleMembers_OnlyRemovesThoseDeactivated()\n        {\n            // Arrange\n            var firstMockItem = new Mock<IRegionMemberLifetime>();\n            firstMockItem.Setup(i => i.KeepAlive).Returns(true);\n\n            var secondMockItem = new Mock<IRegionMemberLifetime>();\n            secondMockItem.Setup(i => i.KeepAlive).Returns(false);\n\n            Region.Add(firstMockItem.Object);\n            Region.Activate(firstMockItem.Object);\n\n            Region.Add(secondMockItem.Object);\n            Region.Activate(secondMockItem.Object);\n\n            // Act\n            Region.Deactivate(secondMockItem.Object);\n\n            // Assert\n            Assert.True(Region.Views.Contains(firstMockItem.Object));\n            Assert.False(Region.Views.Contains(secondMockItem.Object));\n        }\n\n        [Fact]\n        public void WhenMemberNeverActivatedThenIsNotRemovedOnAnothersDeactivation()\n        {\n            // Arrange\n            var firstMockItem = new Mock<IRegionMemberLifetime>();\n            firstMockItem.Setup(i => i.KeepAlive).Returns(false);\n\n            var secondMockItem = new Mock<IRegionMemberLifetime>();\n            secondMockItem.Setup(i => i.KeepAlive).Returns(false);\n\n            Region.Add(firstMockItem.Object);  // Never activated\n\n            Region.Add(secondMockItem.Object);\n            Region.Activate(secondMockItem.Object);\n\n            // Act\n            Region.Deactivate(secondMockItem.Object);\n\n            // Assert\n            Assert.True(Region.Views.Contains(firstMockItem.Object));\n            Assert.False(Region.Views.Contains(secondMockItem.Object));\n        }\n\n        [StaFact]\n        public virtual void RemovesRegionItemIfDataContextReturnsKeepAliveFalse()\n        {\n            // Arrange\n            var regionItemMock = new Mock<IRegionMemberLifetime>();\n            regionItemMock.Setup(i => i.KeepAlive).Returns(false);\n\n            var regionItem = new MockFrameworkElement();\n            regionItem.DataContext = regionItemMock.Object;\n\n            Region.Add(regionItem);\n            Region.Activate(regionItem);\n\n            // Act\n            Region.Deactivate(regionItem);\n\n            // Assert\n            Assert.False(Region.Views.Contains(regionItem));\n        }\n\n        [StaFact]\n        public virtual void RemovesOnlyDeactivatedItemsInRegionBasedOnDataContextKeepAlive()\n        {\n            // Arrange\n            var regionItemDataContextToKeepAlive = new Mock<IRegionMemberLifetime>();\n            regionItemDataContextToKeepAlive.Setup(i => i.KeepAlive).Returns(true);\n\n            var regionItemToKeepAlive = new MockFrameworkElement();\n            regionItemToKeepAlive.DataContext = regionItemDataContextToKeepAlive.Object;\n            Region.Add(regionItemToKeepAlive);\n            Region.Activate(regionItemToKeepAlive);\n\n            var regionItemMock = new Mock<IRegionMemberLifetime>();\n            regionItemMock.Setup(i => i.KeepAlive).Returns(false);\n\n            var regionItem = new MockFrameworkElement();\n            regionItem.DataContext = regionItemMock.Object;\n\n            Region.Add(regionItem);\n            Region.Activate(regionItem);\n\n            // Act\n            Region.Deactivate(regionItem);\n\n            // Assert\n            Assert.False(Region.Views.Contains(regionItem));\n            Assert.True(Region.Views.Contains(regionItemToKeepAlive));\n        }\n\n        [Fact]\n        public virtual void WillRemoveDeactivatedItemIfKeepAliveAttributeFalse()\n        {\n            // Arrange\n            var regionItem = new RegionMemberNotKeptAlive();\n\n            Region.Add(regionItem);\n            Region.Activate(regionItem);\n\n            // Act\n            Region.Deactivate(regionItem);\n\n            // Assert\n            Assert.False(Region.Views.Contains((object)regionItem));\n        }\n\n        [Fact]\n        public virtual void WillNotRemoveDeactivatedItemIfKeepAliveAttributeTrue()\n        {\n            // Arrange\n            var regionItem = new RegionMemberKeptAlive();\n\n            Region.Add(regionItem);\n            Region.Activate(regionItem);\n\n            // Act\n            Region.Deactivate(regionItem);\n\n            // Assert\n            Assert.True(Region.Views.Contains((object)regionItem));\n        }\n\n        [StaFact]\n        public virtual void WillRemoveDeactivatedItemIfDataContextKeepAliveAttributeFalse()\n        {\n            // Arrange\n            var regionItemDataContext = new RegionMemberNotKeptAlive();\n            var regionItem = new MockFrameworkElement() { DataContext = regionItemDataContext };\n            Region.Add(regionItem);\n            Region.Activate(regionItem);\n\n            // Act\n            Region.Deactivate(regionItem);\n\n            // Assert\n            Assert.False(Region.Views.Contains(regionItem));\n        }\n\n        [RegionMemberLifetime(KeepAlive = false)]\n        public class RegionMemberNotKeptAlive\n        {\n        }\n\n        [RegionMemberLifetime(KeepAlive = true)]\n        public class RegionMemberKeptAlive\n        {\n        }\n\n\n    }\n\n\n    public class RegionMemberLifetimeBehaviorAgainstSingleActiveRegionFixture\n                : RegionMemberLifetimeBehaviorFixture\n    {\n        protected override void Arrange()\n        {\n            this.Region = new SingleActiveRegion();\n            this.Behavior = new RegionMemberLifetimeBehavior();\n            this.Behavior.Region = this.Region;\n            this.Behavior.Attach();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Regions/Behaviors/SelectorItemsSourceSyncRegionBehaviorFixture.cs",
    "content": "\n\nusing System;\nusing System.Collections;\nusing System.Linq;\nusing System.Windows.Controls;\nusing System.Windows.Controls.Primitives;\nusing System.Windows.Data;\nusing Prism.Navigation.Regions;\nusing Prism.Navigation.Regions.Behaviors;\nusing Prism.Wpf.Tests.Mocks;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Regions.Behaviors\n{\n\n    public class SelectorItemsSourceSyncRegionBehaviorFixture\n    {\n        [StaFact]\n        public void CanAttachToSelector()\n        {\n            SelectorItemsSourceSyncBehavior behavior = CreateBehavior();\n            behavior.Attach();\n\n            Assert.True(behavior.IsAttached);\n        }\n\n        [StaFact]\n        public void AttachSetsItemsSourceOfSelector()\n        {\n            SelectorItemsSourceSyncBehavior behavior = CreateBehavior();\n\n            var v1 = new Button();\n            var v2 = new Button();\n\n            behavior.Region.Add(v1);\n            behavior.Region.Add(v2);\n\n            behavior.Attach();\n\n            Assert.Equal(2, (behavior.HostControl as Selector).Items.Count);\n        }\n\n        [StaFact]\n        public void IfViewsHaveSortHintThenViewsAreProperlySorted()\n        {\n            SelectorItemsSourceSyncBehavior behavior = CreateBehavior();\n\n            var v1 = new MockSortableView1();\n            var v2 = new MockSortableView2();\n            var v3 = new MockSortableView3();\n            behavior.Attach();\n\n            behavior.Region.Add(v3);\n            behavior.Region.Add(v2);\n            behavior.Region.Add(v1);\n\n            Assert.Equal(3, (behavior.HostControl as Selector).Items.Count);\n\n            Assert.Same(v1, (behavior.HostControl as Selector).Items[0]);\n            Assert.Same(v2, (behavior.HostControl as Selector).Items[1]);\n            Assert.Same(v3, (behavior.HostControl as Selector).Items[2]);\n        }\n\n\n        [StaFact]\n        public void SelectionChangedShouldChangeActiveViews()\n        {\n            SelectorItemsSourceSyncBehavior behavior = CreateBehavior();\n\n            var v1 = new Button();\n            var v2 = new Button();\n\n            behavior.Region.Add(v1);\n            behavior.Region.Add(v2);\n\n            behavior.Attach();\n\n            (behavior.HostControl as Selector).SelectedItem = v1;\n            var activeViews = behavior.Region.ActiveViews;\n\n            Assert.Single(activeViews);\n            Assert.Equal(v1, activeViews.First());\n\n            (behavior.HostControl as Selector).SelectedItem = v2;\n\n            Assert.Single(activeViews);\n            Assert.Equal(v2, activeViews.First());\n        }\n\n        [StaFact]\n        public void ActiveViewChangedShouldChangeSelectedItem()\n        {\n            SelectorItemsSourceSyncBehavior behavior = CreateBehavior();\n\n            var v1 = new Button();\n            var v2 = new Button();\n\n            behavior.Region.Add(v1);\n            behavior.Region.Add(v2);\n\n            behavior.Attach();\n\n            behavior.Region.Activate(v1);\n            Assert.Equal(v1, (behavior.HostControl as Selector).SelectedItem);\n\n            behavior.Region.Activate(v2);\n            Assert.Equal(v2, (behavior.HostControl as Selector).SelectedItem);\n        }\n\n        [StaFact]\n        public void ItemsSourceSetThrows()\n        {\n            var ex = Assert.Throws<InvalidOperationException>(() =>\n            {\n                SelectorItemsSourceSyncBehavior behavior = CreateBehavior();\n\n                (behavior.HostControl as Selector).ItemsSource = new[] { new Button() };\n\n                behavior.Attach();\n            });\n\n        }\n\n        [StaFact]\n        public void ControlWithExistingBindingOnItemsSourceWithNullValueThrows()\n        {\n            var behavor = CreateBehavior();\n\n            Binding binding = new Binding(\"Enumerable\");\n            binding.Source = new SimpleModel() { Enumerable = null };\n            (behavor.HostControl as Selector).SetBinding(ItemsControl.ItemsSourceProperty, binding);\n\n            try\n            {\n                behavor.Attach();\n\n            }\n            catch (Exception ex)\n            {\n                Assert.IsType<InvalidOperationException>(ex);\n                Assert.Contains(\"ItemsControl's ItemsSource property is not empty.\", ex.Message);\n            }\n        }\n\n        [StaFact]\n        public void AddingViewToTwoRegionsThrows()\n        {\n            var ex = Assert.Throws<InvalidOperationException>(() =>\n            {\n                var behavior1 = CreateBehavior();\n                var behavior2 = CreateBehavior();\n\n                behavior1.Attach();\n                behavior2.Attach();\n                var v1 = new Button();\n\n                behavior1.Region.Add(v1);\n                behavior2.Region.Add(v1);\n            });\n\n        }\n\n        [StaFact]\n        public void ReactivatingViewAddsViewToTab()\n        {\n            var behavior1 = CreateBehavior();\n            behavior1.Attach();\n\n            var v1 = new Button();\n            var v2 = new Button();\n\n            behavior1.Region.Add(v1);\n            behavior1.Region.Add(v2);\n\n            behavior1.Region.Activate(v1);\n            Assert.True(behavior1.Region.ActiveViews.First() == v1);\n\n            behavior1.Region.Activate(v2);\n            Assert.True(behavior1.Region.ActiveViews.First() == v2);\n\n            behavior1.Region.Activate(v1);\n            Assert.True(behavior1.Region.ActiveViews.First() == v1);\n        }\n\n        [StaFact]\n        public void ShouldAllowMultipleSelectedItemsForListBox()\n        {\n            var behavior1 = CreateBehavior();\n            ListBox listBox = new ListBox();\n            listBox.SelectionMode = SelectionMode.Multiple;\n            behavior1.HostControl = listBox;\n            behavior1.Attach();\n\n            var v1 = new Button();\n            var v2 = new Button();\n\n            behavior1.Region.Add(v1);\n            behavior1.Region.Add(v2);\n\n            listBox.SelectedItems.Add(v1);\n            listBox.SelectedItems.Add(v2);\n\n            Assert.True(behavior1.Region.ActiveViews.Contains(v1));\n            Assert.True(behavior1.Region.ActiveViews.Contains(v2));\n\n        }\n\n        private SelectorItemsSourceSyncBehavior CreateBehavior()\n        {\n            Region region = new Region();\n            Selector selector = new TabControl();\n\n            var behavior = new SelectorItemsSourceSyncBehavior();\n            behavior.HostControl = selector;\n            behavior.Region = region;\n            return behavior;\n        }\n\n        private class SimpleModel\n        {\n            public IEnumerable Enumerable { get; set; }\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Regions/Behaviors/SyncRegionContextWithHostBehaviorFixture.cs",
    "content": "\n\nusing System;\nusing System.Windows;\nusing Prism.Common;\nusing Prism.Navigation.Regions;\nusing Prism.Navigation.Regions.Behaviors;\nusing Prism.Wpf.Tests.Mocks;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Regions.Behaviors\n{\n\n    public class SyncRegionContextWithHostBehaviorFixture\n    {\n        [StaFact]\n        public void ShouldForwardRegionContextValueToHostControl()\n        {\n            MockPresentationRegion region = new MockPresentationRegion();\n\n            SyncRegionContextWithHostBehavior behavior = new SyncRegionContextWithHostBehavior();\n            behavior.Region = region;\n            DependencyObject mockDependencyObject = new MockDependencyObject();\n            behavior.HostControl = mockDependencyObject;\n\n            behavior.Attach();\n            Assert.Null(region.Context);\n            RegionContext.GetObservableContext(mockDependencyObject).Value = \"NewValue\";\n\n            Assert.Equal(\"NewValue\", region.Context);\n\n        }\n\n        [StaFact]\n        public void ShouldUpdateHostControlRegionContextValueWhenContextOfRegionChanges()\n        {\n            MockPresentationRegion region = new MockPresentationRegion();\n\n            SyncRegionContextWithHostBehavior behavior = new SyncRegionContextWithHostBehavior();\n            behavior.Region = region;\n            DependencyObject mockDependencyObject = new MockDependencyObject();\n            behavior.HostControl = mockDependencyObject;\n\n            ObservableObject<object> observableRegionContext = RegionContext.GetObservableContext(mockDependencyObject);\n\n            behavior.Attach();\n            Assert.Null(observableRegionContext.Value);\n            region.Context = \"NewValue\";\n\n            Assert.Equal(\"NewValue\", observableRegionContext.Value);\n\n        }\n\n        [StaFact]\n        public void ShouldGetInitialValueFromHostAndSetOnRegion()\n        {\n            MockPresentationRegion region = new MockPresentationRegion();\n\n            SyncRegionContextWithHostBehavior behavior = new SyncRegionContextWithHostBehavior();\n            behavior.Region = region;\n            DependencyObject mockDependencyObject = new MockDependencyObject();\n            behavior.HostControl = mockDependencyObject;\n\n            RegionContext.GetObservableContext(mockDependencyObject).Value = \"NewValue\";\n\n            Assert.Null(region.Context);\n            behavior.Attach();\n            Assert.Equal(\"NewValue\", region.Context);\n\n        }\n\n        [StaFact]\n        public void AttachShouldNotThrowWhenHostControlNull()\n        {\n            MockPresentationRegion region = new MockPresentationRegion();\n\n            SyncRegionContextWithHostBehavior behavior = new SyncRegionContextWithHostBehavior();\n            behavior.Region = region;\n            behavior.Attach();\n        }\n\n        [StaFact]\n        public void AttachShouldNotThrowWhenHostControlNullAndRegionContextSet()\n        {\n            MockPresentationRegion region = new MockPresentationRegion();\n\n            SyncRegionContextWithHostBehavior behavior = new SyncRegionContextWithHostBehavior();\n            behavior.Region = region;\n            behavior.Attach();\n            region.Context = \"Changed\";\n        }\n\n        [StaFact]\n        public void ChangingRegionContextObservableObjectValueShouldAlsoChangeRegionContextDependencyProperty()\n        {\n            MockPresentationRegion region = new MockPresentationRegion();\n\n            SyncRegionContextWithHostBehavior behavior = new SyncRegionContextWithHostBehavior();\n            behavior.Region = region;\n            DependencyObject hostControl = new MockDependencyObject();\n            behavior.HostControl = hostControl;\n\n            behavior.Attach();\n\n            Assert.Null(RegionManager.GetRegionContext(hostControl));\n            RegionContext.GetObservableContext(hostControl).Value = \"NewValue\";\n\n            Assert.Equal(\"NewValue\", RegionManager.GetRegionContext(hostControl));\n        }\n\n        [StaFact]\n        public void AttachShouldChangeRegionContextDependencyProperty()\n        {\n            MockPresentationRegion region = new MockPresentationRegion();\n\n            SyncRegionContextWithHostBehavior behavior = new SyncRegionContextWithHostBehavior();\n            behavior.Region = region;\n            DependencyObject hostControl = new MockDependencyObject();\n            behavior.HostControl = hostControl;\n\n            RegionContext.GetObservableContext(hostControl).Value = \"NewValue\";\n\n            Assert.Null(RegionManager.GetRegionContext(hostControl));\n            behavior.Attach();\n            Assert.Equal(\"NewValue\", RegionManager.GetRegionContext(hostControl));\n        }\n\n        [StaFact]\n        public void SettingHostControlAfterAttachThrows()\n        {\n            var ex = Assert.Throws<InvalidOperationException>(() =>\n            {\n                SyncRegionContextWithHostBehavior behavior = new SyncRegionContextWithHostBehavior();\n                DependencyObject hostControl1 = new MockDependencyObject();\n                behavior.HostControl = hostControl1;\n\n                behavior.Attach();\n                DependencyObject hostControl2 = new MockDependencyObject();\n                behavior.HostControl = hostControl2;\n            });\n\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Regions/ContentControlRegionAdapterFixture.cs",
    "content": "\n\nusing System;\nusing System.Linq;\nusing System.Windows.Controls;\nusing System.Windows.Data;\nusing Prism.Navigation.Regions;\nusing Prism.Wpf.Tests.Mocks;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Regions\n{\n\n    public class ContentControlRegionAdapterFixture\n    {\n        [StaFact]\n        public void AdapterAssociatesSelectorWithRegionActiveViews()\n        {\n            var control = new ContentControl();\n            IRegionAdapter adapter = new TestableContentControlRegionAdapter();\n\n            MockPresentationRegion region = (MockPresentationRegion)adapter.Initialize(control, \"Region1\");\n            Assert.NotNull(region);\n\n            Assert.Null(control.Content);\n            region.MockActiveViews.Items.Add(new object());\n\n            Assert.NotNull(control.Content);\n            Assert.Same(control.Content, region.ActiveViews.ElementAt(0));\n\n            region.MockActiveViews.Items.Add(new object());\n            Assert.Same(control.Content, region.ActiveViews.ElementAt(0));\n\n            region.MockActiveViews.Items.RemoveAt(0);\n            Assert.Same(control.Content, region.ActiveViews.ElementAt(0));\n\n            region.MockActiveViews.Items.RemoveAt(0);\n            Assert.Null(control.Content);\n        }\n\n\n        [StaFact]\n        public void ControlWithExistingContentThrows()\n        {\n            var control = new ContentControl() { Content = new object() };\n\n            IRegionAdapter adapter = new TestableContentControlRegionAdapter();\n\n            try\n            {\n                var region = (MockPresentationRegion)adapter.Initialize(control, \"Region1\");\n                //Assert.Fail();\n            }\n            catch (Exception ex)\n            {\n                Assert.IsType<InvalidOperationException>(ex);\n                Assert.Contains(\"ContentControl's Content property is not empty.\", ex.Message);\n            }\n        }\n\n        [StaFact]\n        public void ControlWithExistingBindingOnContentWithNullValueThrows()\n        {\n            var control = new ContentControl();\n            Binding binding = new Binding(\"ObjectContents\");\n            binding.Source = new SimpleModel() { ObjectContents = null };\n            control.SetBinding(ContentControl.ContentProperty, binding);\n\n            IRegionAdapter adapter = new TestableContentControlRegionAdapter();\n\n            try\n            {\n                var region = (MockPresentationRegion)adapter.Initialize(control, \"Region1\");\n                //Assert.Fail();\n            }\n            catch (Exception ex)\n            {\n                Assert.IsType<InvalidOperationException>(ex);\n                Assert.Contains(\"ContentControl's Content property is not empty.\", ex.Message);\n            }\n        }\n\n        [StaFact]\n        public void AddedItemShouldBeActivated()\n        {\n            var control = new ContentControl();\n            IRegionAdapter adapter = new TestableContentControlRegionAdapter();\n\n            MockPresentationRegion region = (MockPresentationRegion)adapter.Initialize(control, \"Region1\");\n\n            var mockView = new object();\n            region.Add(mockView);\n\n            Assert.Single(region.ActiveViews);\n            Assert.True(region.ActiveViews.Contains(mockView));\n        }\n\n        [StaFact]\n        public void ShouldNotActivateAdditionalViewsAdded()\n        {\n            var control = new ContentControl();\n            IRegionAdapter adapter = new TestableContentControlRegionAdapter();\n\n            MockPresentationRegion region = (MockPresentationRegion)adapter.Initialize(control, \"Region1\");\n\n            var mockView = new object();\n            region.Add(mockView);\n            region.Add(new object());\n\n            Assert.Single(region.ActiveViews);\n            Assert.True(region.ActiveViews.Contains(mockView));\n        }\n\n        [StaFact]\n        public void ShouldActivateAddedViewWhenNoneIsActive()\n        {\n            var control = new ContentControl();\n            IRegionAdapter adapter = new TestableContentControlRegionAdapter();\n\n            MockPresentationRegion region = (MockPresentationRegion)adapter.Initialize(control, \"Region1\");\n\n            var mockView1 = new object();\n            region.Add(mockView1);\n            region.Deactivate(mockView1);\n\n            var mockView2 = new object();\n            region.Add(mockView2);\n\n            Assert.Single(region.ActiveViews);\n            Assert.True(region.ActiveViews.Contains(mockView2));\n        }\n\n        [StaFact]\n        public void CanRemoveViewWhenNoneActive()\n        {\n            var control = new ContentControl();\n            IRegionAdapter adapter = new TestableContentControlRegionAdapter();\n\n            MockPresentationRegion region = (MockPresentationRegion)adapter.Initialize(control, \"Region1\");\n\n            var mockView1 = new object();\n            region.Add(mockView1);\n            region.Deactivate(mockView1);\n            region.Remove(mockView1);\n            Assert.Empty(region.ActiveViews);\n        }\n\n        class SimpleModel\n        {\n            public Object ObjectContents { get; set; }\n        }\n\n        private class TestableContentControlRegionAdapter : ContentControlRegionAdapter\n        {\n            public TestableContentControlRegionAdapter() : base(null)\n            {\n            }\n\n            private MockPresentationRegion region = new MockPresentationRegion();\n\n            protected override IRegion CreateRegion()\n            {\n                return region;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Regions/ItemsControlRegionAdapterFixture.cs",
    "content": "\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Windows.Controls;\nusing System.Windows.Data;\nusing Moq;\nusing Prism.Ioc;\nusing Prism.Navigation.Regions;\nusing Prism.Wpf.Tests.Mocks;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Regions\n{\n\n    public class ItemsControlRegionAdapterFixture\n    {\n        [StaFact]\n        public void AdapterAssociatesItemsControlWithRegion()\n        {\n            var control = new ItemsControl();\n            IRegionAdapter adapter = new TestableItemsControlRegionAdapter();\n\n            IRegion region = adapter.Initialize(control, \"Region1\");\n            Assert.NotNull(region);\n\n            Assert.Same(control.ItemsSource, region.Views);\n        }\n\n        [StaFact]\n        public void AdapterAssignsARegionThatHasAllViewsActive()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            var control = new ItemsControl();\n            IRegionAdapter adapter = new ItemsControlRegionAdapter(null);\n\n            IRegion region = adapter.Initialize(control, \"Region1\");\n            Assert.NotNull(region);\n            Assert.IsType<AllActiveRegion>(region);\n        }\n\n\n        [StaFact]\n        public void ShouldMoveAlreadyExistingContentInControlToRegion()\n        {\n            var control = new ItemsControl();\n            var view = new object();\n            control.Items.Add(view);\n            IRegionAdapter adapter = new TestableItemsControlRegionAdapter();\n\n            var region = (MockPresentationRegion)adapter.Initialize(control, \"Region1\");\n\n            Assert.Single(region.MockViews);\n            Assert.Same(view, region.MockViews.ElementAt(0));\n            Assert.Same(view, control.Items[0]);\n        }\n\n        [StaFact]\n        public void ControlWithExistingItemSourceThrows()\n        {\n            var control = new ItemsControl() { ItemsSource = new List<string>() };\n\n            IRegionAdapter adapter = new TestableItemsControlRegionAdapter();\n\n            try\n            {\n                var region = (MockPresentationRegion)adapter.Initialize(control, \"Region1\");\n                //Assert.Fail();\n            }\n            catch (Exception ex)\n            {\n                Assert.IsType<InvalidOperationException>(ex);\n                Assert.Contains(\"ItemsControl's ItemsSource property is not empty.\", ex.Message);\n            }\n        }\n\n        [StaFact]\n        public void ControlWithExistingBindingOnItemsSourceWithNullValueThrows()\n        {\n            var control = new ItemsControl();\n            Binding binding = new Binding(\"Enumerable\");\n            binding.Source = new SimpleModel() { Enumerable = null };\n            control.SetBinding(ItemsControl.ItemsSourceProperty, binding);\n\n            IRegionAdapter adapter = new TestableItemsControlRegionAdapter();\n\n            try\n            {\n                var region = (MockPresentationRegion)adapter.Initialize(control, \"Region1\");\n                //Assert.Fail();\n            }\n            catch (Exception ex)\n            {\n                Assert.IsType<InvalidOperationException>(ex);\n                Assert.Contains(\"ItemsControl's ItemsSource property is not empty.\", ex.Message);\n            }\n        }\n\n        class SimpleModel\n        {\n            public IEnumerable Enumerable { get; set; }\n        }\n\n        private class TestableItemsControlRegionAdapter : ItemsControlRegionAdapter\n        {\n            public TestableItemsControlRegionAdapter() : base(null)\n            {\n            }\n\n            private MockPresentationRegion region = new MockPresentationRegion();\n\n            protected override IRegion CreateRegion()\n            {\n                return region;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Regions/LocatorNavigationTargetHandlerFixture.cs",
    "content": "using System;\nusing System.Windows;\nusing Moq;\nusing Prism.Ioc;\nusing Prism.Ioc.Internals;\nusing Prism.Navigation.Regions;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Regions\n{\n\n    public class LocatorNavigationTargetHandlerFixture\n    {\n        [Fact]\n        public void WhenViewExistsAndDoesNotImplementINavigationAware_ThenReturnsView()\n        {\n            // Arrange\n\n            var containerMock = new Mock<IContainerExtension>();\n            ContainerLocator.SetContainerExtension(containerMock.Object);\n\n            var region = new Region();\n\n            var view = new TestView();\n\n            region.Add(view);\n\n            var navigationContext = new NavigationContext(null, new Uri(view.GetType().Name, UriKind.Relative));\n\n            var navigationTargetHandler = new TestRegionNavigationContentLoader(containerMock.Object);\n\n\n            // Act\n\n            var returnedView = navigationTargetHandler.LoadContent(region, navigationContext);\n\n\n            // Assert\n\n            Assert.Same(view, returnedView);\n        }\n\n        [Fact]\n        public void WhenRegionHasMultipleViews_ThenViewsWithMatchingTypeNameAreConsidered()\n        {\n            // Arrange\n\n            var containerMock = new Mock<IContainerExtension>();\n            ContainerLocator.SetContainerExtension(containerMock.Object);\n\n            var region = new Region();\n\n            var view1 = new TestView();\n            var view2 = new Test2View();\n\n            region.Add(view1);\n            region.Add(view2);\n\n            var navigationContext = new NavigationContext(null, new Uri(view2.GetType().Name, UriKind.Relative));\n\n            var navigationTargetHandler = new TestRegionNavigationContentLoader(containerMock.Object);\n\n\n            // Act\n\n            var returnedView = navigationTargetHandler.LoadContent(region, navigationContext);\n\n\n            // Assert\n\n            Assert.Same(view2, returnedView);\n        }\n\n        [Fact]\n        public void WhenRegionHasMultipleViews_ThenViewsWithMatchingFullTypeNameAreConsidered()\n        {\n            // Arrange\n\n            var containerMock = new Mock<IContainerExtension>();\n            ContainerLocator.SetContainerExtension(containerMock.Object);\n\n            var region = new Region();\n\n            var view1 = new TestView();\n            var view2 = new Test2View();\n\n            region.Add(view1);\n            region.Add(view2);\n\n            var navigationContext = new NavigationContext(null, new Uri(view2.GetType().FullName, UriKind.Relative));\n\n            var navigationTargetHandler = new TestRegionNavigationContentLoader(containerMock.Object);\n\n\n            // Act\n\n            var returnedView = navigationTargetHandler.LoadContent(region, navigationContext);\n\n\n            // Assert\n\n            Assert.Same(view2, returnedView);\n        }\n\n        [Fact]\n        public void WhenViewExistsAndImplementsINavigationAware_ThenViewIsQueriedForNavigationAndIsReturnedIfAcceptsIt()\n        {\n            // Arrange\n\n            var containerMock = new Mock<IContainerExtension>();\n            ContainerLocator.SetContainerExtension(containerMock.Object);\n\n            var region = new Region();\n\n            var viewMock = new Mock<INavigationAware>();\n            viewMock\n                .Setup(v => v.IsNavigationTarget(It.IsAny<NavigationContext>()))\n                .Returns(true)\n                .Verifiable();\n\n            region.Add(viewMock.Object);\n\n            var navigationContext = new NavigationContext(null, new Uri(viewMock.Object.GetType().Name, UriKind.Relative));\n\n            var navigationTargetHandler = new TestRegionNavigationContentLoader(containerMock.Object);\n\n\n            // Act\n\n            var returnedView = navigationTargetHandler.LoadContent(region, navigationContext);\n\n\n            // Assert\n\n            Assert.Same(viewMock.Object, returnedView);\n            viewMock.VerifyAll();\n        }\n\n        [StaFact]\n        public void WhenViewExistsAndHasDataContextThatImplementsINavigationAware_ThenDataContextIsQueriedForNavigationAndIsReturnedIfAcceptsIt()\n        {\n            // Arrange\n\n            var containerMock = new Mock<IContainerExtension>();\n            ContainerLocator.SetContainerExtension(containerMock.Object);\n\n            var region = new Region();\n\n            var dataContextMock = new Mock<INavigationAware>();\n            dataContextMock\n                .Setup(v => v.IsNavigationTarget(It.IsAny<NavigationContext>()))\n                .Returns(true)\n                .Verifiable();\n            var viewMock = new Mock<FrameworkElement>();\n            viewMock.Object.DataContext = dataContextMock.Object;\n\n            region.Add(viewMock.Object);\n\n            var navigationContext = new NavigationContext(null, new Uri(viewMock.Object.GetType().Name, UriKind.Relative));\n\n            var navigationTargetHandler = new TestRegionNavigationContentLoader(containerMock.Object);\n\n\n            // Act\n\n            var returnedView = navigationTargetHandler.LoadContent(region, navigationContext);\n\n\n            // Assert\n\n            Assert.Same(viewMock.Object, returnedView);\n            dataContextMock.VerifyAll();\n        }\n\n        [Fact]\n        public void WhenNoCurrentMatchingViewExists_ThenReturnsNewlyCreatedInstanceWithServiceLocatorAddedToTheRegion()\n        {\n            // Arrange\n\n            var containerMock = new Mock<IContainerExtension>();\n            ContainerLocator.SetContainerExtension(containerMock.Object);\n\n            var region = new Region();\n\n            var view = new TestView();\n\n            containerMock.Setup(sl => sl.Resolve(typeof(object), view.GetType().Name)).Returns(view);\n\n            var navigationContext = new NavigationContext(null, new Uri(view.GetType().Name, UriKind.Relative));\n\n            var navigationTargetHandler = new TestRegionNavigationContentLoader(containerMock.Object);\n\n\n            // Act\n\n            var returnedView = navigationTargetHandler.LoadContent(region, navigationContext);\n\n\n            // Assert\n\n            Assert.Same(view, returnedView);\n            Assert.True(region.Views.Contains(view));\n        }\n\n        [Fact]\n        public void WhenViewExistsAndImplementsINavigationAware_ThenViewIsQueriedForNavigationAndNewInstanceIsCreatedIfItRejectsIt()\n        {\n            // Arrange\n\n            var containerMock = new Mock<IContainerExtension>();\n            ContainerLocator.SetContainerExtension(containerMock.Object);\n\n            var region = new Region();\n\n            var viewMock = new Mock<INavigationAware>();\n            viewMock\n                .Setup(v => v.IsNavigationTarget(It.IsAny<NavigationContext>()))\n                .Returns(false)\n                .Verifiable();\n\n            region.Add(viewMock.Object);\n\n            var newView = new TestView();\n\n            containerMock.Setup(sl => sl.Resolve(typeof(object), viewMock.Object.GetType().Name)).Returns(newView);\n\n            var navigationContext = new NavigationContext(null, new Uri(viewMock.Object.GetType().Name, UriKind.Relative));\n\n            var navigationTargetHandler = new TestRegionNavigationContentLoader(containerMock.Object);\n\n\n            // Act\n\n            var returnedView = navigationTargetHandler.LoadContent(region, navigationContext);\n\n\n            // Assert\n\n            Assert.Same(newView, returnedView);\n            Assert.True(region.Views.Contains(newView));\n            viewMock.VerifyAll();\n        }\n\n        [StaFact]\n        public void WhenViewExistsAndHasDataContextThatImplementsINavigationAware_ThenDataContextIsQueriedForNavigationAndNewInstanceIsCreatedIfItRejectsIt()\n        {\n            // Arrange\n            var containerMock = new Mock<IContainerExtension>();\n            ContainerLocator.SetContainerExtension(containerMock.Object);\n\n            var region = new Region();\n\n            var dataContextMock = new Mock<INavigationAware>();\n            dataContextMock\n                .Setup(v => v.IsNavigationTarget(It.IsAny<NavigationContext>()))\n                .Returns(false)\n                .Verifiable();\n            var viewMock = new Mock<FrameworkElement>();\n            viewMock.Object.DataContext = dataContextMock.Object;\n\n            region.Add(viewMock.Object);\n\n            var newView = new TestView();\n\n            containerMock.Setup(sl => sl.Resolve(typeof(object), viewMock.Object.GetType().Name)).Returns(newView);\n\n            var navigationContext = new NavigationContext(null, new Uri(viewMock.Object.GetType().Name, UriKind.Relative));\n\n            var navigationTargetHandler = new TestRegionNavigationContentLoader(containerMock.Object);\n\n            // Act\n            var returnedView = navigationTargetHandler.LoadContent(region, navigationContext);\n\n            // Assert\n            Assert.Same(newView, returnedView);\n            Assert.True(region.Views.Contains(newView));\n            dataContextMock.VerifyAll();\n        }\n\n        [Fact]\n        public void WhenViewCannotBeCreated_ThenThrowsAnException()\n        {\n            var containerMock = new Mock<IContainerExtension>();\n            ContainerLocator.SetContainerExtension(containerMock.Object);\n\n            containerMock.Setup(sl => sl.Resolve(typeof(object), typeof(TestView).Name)).Throws<ActivationException>();\n\n            var region = new Region();\n\n            var navigationContext = new NavigationContext(null, new Uri(typeof(TestView).Name, UriKind.Relative));\n\n            var navigationTargetHandler = new TestRegionNavigationContentLoader(containerMock.Object);\n\n            // Act\n\n            ExceptionAssert.Throws<InvalidOperationException>(\n                () =>\n                {\n                    navigationTargetHandler.LoadContent(region, navigationContext);\n\n                });\n        }\n\n        [Fact]\n        public void WhenViewAddedByHandlerDoesNotImplementINavigationAware_ThenReturnsView()\n        {\n            // Arrange\n            var containerMock = new Mock<IContainerExtension>();\n            ContainerLocator.SetContainerExtension(containerMock.Object);\n\n            var region = new Region();\n\n            var view = new TestView();\n\n            containerMock.Setup(sl => sl.Resolve(typeof(object), view.GetType().Name)).Returns(view);\n\n            var navigationContext = new NavigationContext(null, new Uri(view.GetType().Name, UriKind.Relative));\n\n            var navigationTargetHandler = new TestRegionNavigationContentLoader(containerMock.Object);\n\n            // Act\n            var firstReturnedView = navigationTargetHandler.LoadContent(region, navigationContext);\n            var secondReturnedView = navigationTargetHandler.LoadContent(region, navigationContext);\n\n            // Assert\n            Assert.Same(view, firstReturnedView);\n            Assert.Same(view, secondReturnedView);\n            containerMock.Verify(sl => sl.Resolve(typeof(object), view.GetType().Name), Times.Once());\n        }\n\n        [Fact]\n        public void WhenRequestingContentForNullRegion_ThenThrows()\n        {\n            var containerMock = new Mock<IContainerExtension>();\n\n            var navigationContext = new NavigationContext(null, new Uri(\"/\", UriKind.Relative));\n\n            var navigationTargetHandler = new TestRegionNavigationContentLoader(containerMock.Object);\n\n\n            ExceptionAssert.Throws<ArgumentNullException>(\n                () =>\n                {\n                    navigationTargetHandler.LoadContent(null, navigationContext);\n\n                });\n        }\n\n        [Fact]\n        public void WhenRequestingContentForNullContext_ThenThrows()\n        {\n            var containerMock = new Mock<IContainerExtension>();\n            ContainerLocator.SetContainerExtension(containerMock.Object);\n\n            var region = new Region();\n\n            var navigationTargetHandler = new TestRegionNavigationContentLoader(containerMock.Object);\n\n\n            ExceptionAssert.Throws<ArgumentNullException>(\n                () =>\n                {\n                    navigationTargetHandler.LoadContent(region, null);\n\n                });\n        }\n\n        public class TestRegionNavigationContentLoader : RegionNavigationContentLoader\n        {\n            public TestRegionNavigationContentLoader(IContainerExtension container)\n                : base(container)\n            { }\n        }\n\n        public class TestView { }\n\n        public class Test2View { }\n    }\n\n    public class ActivationException : Exception\n    {\n        public ActivationException()\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Regions/NavigationAsyncExtensionsFixture.cs",
    "content": "\n\nusing System;\nusing Moq;\nusing Prism.Navigation;\nusing Prism.Navigation.Regions;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Regions\n{\n\n    public class NavigationAsyncExtensionsFixture\n    {\n        [Fact]\n        public void WhenNavigatingWithANullThis_ThenThrows()\n        {\n            INavigateAsync navigate = null;\n            string target = \"\";\n\n            ExceptionAssert.Throws<ArgumentNullException>(\n                () =>\n                {\n                    navigate.RequestNavigate(target);\n                });\n        }\n\n        [Fact]\n        public void WhenNavigatingWithANullStringTarget_ThenThrows()\n        {\n            INavigateAsync navigate = new Mock<INavigateAsync>().Object;\n            string target = null;\n\n            ExceptionAssert.Throws<ArgumentNullException>(\n                () =>\n                {\n                    navigate.RequestNavigate(target);\n                });\n        }\n\n        [Fact]\n        public void WhenNavigatingWithARelativeStringTarget_ThenNavigatesToRelativeUri()\n        {\n            var navigateMock = new Mock<INavigateAsync>();\n            navigateMock\n                .Setup(nv =>\n                    nv.RequestNavigate(\n                        It.Is<Uri>(u => !u.IsAbsoluteUri && u.OriginalString == \"relative\"),\n                        It.Is<Action<NavigationResult>>(c => c != null),\n                        It.IsAny<INavigationParameters>()))\n                .Verifiable();\n\n            string target = \"relative\";\n\n            navigateMock.Object.RequestNavigate(target);\n\n            navigateMock.VerifyAll();\n        }\n\n        [Fact]\n        public void WhenNavigatingWithAnAbsoluteStringTarget_ThenNavigatesToAbsoluteUri()\n        {\n            var navigateMock = new Mock<INavigateAsync>();\n            navigateMock\n                .Setup(nv =>\n                    nv.RequestNavigate(\n                        It.Is<Uri>(u => u.IsAbsoluteUri && u.Host == \"test\" && u.AbsolutePath == \"/path\"),\n                        It.Is<Action<NavigationResult>>(c => c != null),\n                        It.IsAny<INavigationParameters>()))\n                .Verifiable();\n\n            string target = \"http://test/path\";\n\n            navigateMock.Object.RequestNavigate(target);\n\n            navigateMock.VerifyAll();\n        }\n\n        [Fact]\n        public void WhenNavigatingWithANullThisAndAUri_ThenThrows()\n        {\n            INavigateAsync navigate = null;\n            Uri target = new Uri(\"test\", UriKind.Relative);\n\n            ExceptionAssert.Throws<ArgumentNullException>(\n                () =>\n                {\n                    navigate.RequestNavigate(target);\n                });\n        }\n\n        [Fact]\n        public void WhenNavigatingWithAUri_ThenNavigatesToUriWithCallback()\n        {\n            Uri target = new Uri(\"relative\", UriKind.Relative);\n\n            var navigateMock = new Mock<INavigateAsync>();\n            navigateMock\n                .Setup(nv =>\n                    nv.RequestNavigate(\n                        target,\n                        It.Is<Action<NavigationResult>>(c => c != null),\n                        It.IsAny<INavigationParameters>()))\n                .Verifiable();\n\n\n            navigateMock.Object.RequestNavigate(target);\n\n            navigateMock.VerifyAll();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Regions/NavigationContextFixture.cs",
    "content": "using System;\nusing System.Linq;\nusing Moq;\nusing Prism.Navigation.Regions;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Regions\n{\n\n    public class NavigationContextFixture\n    {\n        [Fact]\n        public void WhenCreatingANewContextForAUriWithAQuery_ThenNewContextInitializesPropertiesAndExtractsTheQuery()\n        {\n            var uri = new Uri(\"test?name=value\", UriKind.Relative);\n\n            var navigationJournalMock = new Mock<IRegionNavigationJournal>();\n            var navigationServiceMock = new Mock<IRegionNavigationService>();\n\n            IRegion region = new Region();\n            navigationServiceMock.SetupGet(n => n.Region).Returns(region);\n            navigationServiceMock.SetupGet(x => x.Journal).Returns(navigationJournalMock.Object);\n\n            var context = new NavigationContext(navigationServiceMock.Object, uri);\n\n            Assert.Same(navigationServiceMock.Object, context.NavigationService);\n            Assert.Equal(uri, context.Uri);\n            Assert.Single(context.Parameters);\n            Assert.Equal(\"value\", context.Parameters[\"name\"]);\n        }\n\n        [Fact]\n        public void WhenCreatingANewContextForAUriWithNoQuery_ThenNewContextInitializesPropertiesGetsEmptyQuery()\n        {\n            var uri = new Uri(\"test\", UriKind.Relative);\n\n            var navigationJournalMock = new Mock<IRegionNavigationJournal>();\n\n            var navigationServiceMock = new Mock<IRegionNavigationService>();\n            navigationServiceMock.SetupGet(x => x.Journal).Returns(navigationJournalMock.Object);\n\n            var context = new NavigationContext(navigationServiceMock.Object, uri);\n\n            Assert.Same(navigationServiceMock.Object, context.NavigationService);\n            Assert.Equal(uri, context.Uri);\n            Assert.Empty(context.Parameters);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Regions/RegionAdapterBaseFixture.cs",
    "content": "\n\nusing System;\nusing Prism.Navigation.Regions;\nusing Prism.Wpf.Tests.Mocks;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Regions\n{\n\n    public class RegionAdapterBaseFixture\n    {\n        [Fact]\n        public void IncorrectTypeThrows()\n        {\n            var ex = Assert.Throws<InvalidOperationException>(() =>\n            {\n                IRegionAdapter adapter = new TestableRegionAdapterBase();\n                adapter.Initialize(new MockDependencyObject(), \"Region1\");\n            });\n        }\n\n        [Fact]\n        public void InitializeSetsRegionName()\n        {\n            IRegionAdapter adapter = new TestableRegionAdapterBase();\n            var region = adapter.Initialize(new MockRegionTarget(), \"Region1\");\n            Assert.Equal(\"Region1\", region.Name);\n        }\n\n        [Fact]\n        public void NullRegionNameThrows()\n        {\n            var ex = Assert.Throws<ArgumentNullException>(() =>\n            {\n                IRegionAdapter adapter = new TestableRegionAdapterBase();\n                var region = adapter.Initialize(new MockRegionTarget(), null);\n            });\n\n        }\n\n        [Fact]\n        public void NullObjectThrows()\n        {\n            var ex = Assert.Throws<ArgumentNullException>(() =>\n            {\n                IRegionAdapter adapter = new TestableRegionAdapterBase();\n                adapter.Initialize(null, \"Region1\");\n            });\n\n        }\n\n\n        [Fact]\n        public void CreateRegionReturnValueIsPassedToAdapt()\n        {\n            var regionTarget = new MockRegionTarget();\n            var adapter = new TestableRegionAdapterBase();\n\n            adapter.Initialize(regionTarget, \"Region1\");\n\n            Assert.Same(adapter.CreateRegionReturnValue, adapter.AdaptArgumentRegion);\n            Assert.Same(regionTarget, adapter.adaptArgumentRegionTarget);\n        }\n\n        [Fact]\n        public void CreateRegionReturnValueIsPassedToAttachBehaviors()\n        {\n            var regionTarget = new MockRegionTarget();\n            var adapter = new TestableRegionAdapterBase();\n\n            var region = adapter.Initialize(regionTarget, \"Region1\");\n\n            Assert.Same(adapter.CreateRegionReturnValue, adapter.AttachBehaviorsArgumentRegion);\n            Assert.Same(regionTarget, adapter.attachBehaviorsArgumentTargetToAdapt);\n        }\n\n        class TestableRegionAdapterBase : RegionAdapterBase<MockRegionTarget>\n        {\n            public IRegion CreateRegionReturnValue = new MockPresentationRegion();\n            public IRegion AdaptArgumentRegion;\n            public MockRegionTarget adaptArgumentRegionTarget;\n            public IRegion AttachBehaviorsArgumentRegion;\n            public MockRegionTarget attachBehaviorsArgumentTargetToAdapt;\n\n            public TestableRegionAdapterBase() : base(null)\n            {\n\n            }\n\n            protected override void Adapt(IRegion region, MockRegionTarget regionTarget)\n            {\n                AdaptArgumentRegion = region;\n                adaptArgumentRegionTarget = regionTarget;\n            }\n\n            protected override IRegion CreateRegion()\n            {\n                return CreateRegionReturnValue;\n            }\n\n            protected override void AttachBehaviors(IRegion region, MockRegionTarget regionTarget)\n            {\n                AttachBehaviorsArgumentRegion = region;\n                attachBehaviorsArgumentTargetToAdapt = regionTarget;\n                base.AttachBehaviors(region, regionTarget);\n            }\n        }\n\n        class MockRegionTarget\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Regions/RegionAdapterMappingsFixture.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Windows.Controls;\nusing Moq;\nusing Prism.Ioc;\nusing Prism.Navigation.Regions;\nusing Prism.Wpf.Tests.Mocks;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Regions\n{\n\n    public class RegionAdapterMappingsFixture\n    {\n        [Fact]\n        public void ShouldGetRegisteredMapping()\n        {\n            var regionAdapterMappings = new RegionAdapterMappings();\n            Type registeredType = typeof(ItemsControl);\n            var regionAdapter = new MockRegionAdapter();\n\n            regionAdapterMappings.RegisterMapping(registeredType, regionAdapter);\n            var returnedAdapter = regionAdapterMappings.GetMapping(registeredType);\n\n            Assert.NotNull(returnedAdapter);\n            Assert.Same(regionAdapter, returnedAdapter);\n        }\n\n        [Fact]\n        public void ShouldGetRegisteredMapping_UsingGenericControl()\n        {\n            var regionAdapterMappings = new RegionAdapterMappings();\n            var regionAdapter = new MockRegionAdapter();\n\n            regionAdapterMappings.RegisterMapping<ItemsControl>(regionAdapter);\n\n            var returnedAdapter = regionAdapterMappings.GetMapping<ItemsControl>();\n\n            Assert.NotNull(returnedAdapter);\n            Assert.Same(regionAdapter, returnedAdapter);\n        }\n\n        [Fact]\n        public void ShouldGetRegisteredMapping_UsingGenericControlAndAdapter()\n        {\n            try\n            {\n                var regionAdapterMappings = new RegionAdapterMappings();\n                var regionAdapter = new MockRegionAdapter();\n\n                var containerMock = new Mock<IContainerExtension>();\n                containerMock.Setup(c => c.Resolve(typeof(MockRegionAdapter)))\n                             .Returns(regionAdapter);\n                ContainerLocator.ResetContainer();\n                ContainerLocator.SetContainerExtension(containerMock.Object);\n\n                regionAdapterMappings.RegisterMapping<ItemsControl, MockRegionAdapter>();\n\n                var returnedAdapter = regionAdapterMappings.GetMapping<ItemsControl>();\n\n                Assert.NotNull(returnedAdapter);\n                Assert.Same(regionAdapter, returnedAdapter);\n            }\n            finally\n            {\n                ContainerLocator.ResetContainer();\n            }\n        }\n\n        [Fact]\n        public void ShouldGetMappingForDerivedTypesThanTheRegisteredOnes()\n        {\n            var regionAdapterMappings = new RegionAdapterMappings();\n            var regionAdapter = new MockRegionAdapter();\n\n            regionAdapterMappings.RegisterMapping(typeof(ItemsControl), regionAdapter);\n            var returnedAdapter = regionAdapterMappings.GetMapping(typeof(ItemsControlDescendant));\n\n            Assert.NotNull(returnedAdapter);\n            Assert.Same(regionAdapter, returnedAdapter);\n        }\n\n        [Fact]\n        public void GetMappingOfUnregisteredTypeThrows()\n        {\n            var ex = Assert.Throws<KeyNotFoundException>(() =>\n            {\n                var regionAdapterMappings = new RegionAdapterMappings();\n                regionAdapterMappings.GetMapping(typeof(object));\n            });\n\n        }\n\n        [Fact]\n        public void ShouldGetTheMostSpecializedMapping()\n        {\n            var regionAdapterMappings = new RegionAdapterMappings();\n            var genericAdapter = new MockRegionAdapter();\n            var specializedAdapter = new MockRegionAdapter();\n\n            regionAdapterMappings.RegisterMapping(typeof(ItemsControl), genericAdapter);\n            regionAdapterMappings.RegisterMapping(typeof(ItemsControlDescendant), specializedAdapter);\n            var returnedAdapter = regionAdapterMappings.GetMapping(typeof(ItemsControlDescendant));\n\n            Assert.NotNull(returnedAdapter);\n            Assert.Same(specializedAdapter, returnedAdapter);\n        }\n\n        [Fact]\n        public void RegisterAMappingThatAlreadyExistsThrows()\n        {\n            var ex = Assert.Throws<InvalidOperationException>(() =>\n            {\n                var regionAdapterMappings = new RegionAdapterMappings();\n                var regionAdapter = new MockRegionAdapter();\n\n                regionAdapterMappings.RegisterMapping(typeof(ItemsControl), regionAdapter);\n                regionAdapterMappings.RegisterMapping(typeof(ItemsControl), regionAdapter);\n            });\n        }\n\n        [Fact]\n        public void NullControlThrows()\n        {\n            var ex = Assert.Throws<ArgumentNullException>(() =>\n            {\n                var regionAdapterMappings = new RegionAdapterMappings();\n                var regionAdapter = new MockRegionAdapter();\n\n                regionAdapterMappings.RegisterMapping(null, regionAdapter);\n            });\n\n        }\n\n        [Fact]\n        public void NullAdapterThrows()\n        {\n            var ex = Assert.Throws<ArgumentNullException>(() =>\n            {\n                var regionAdapterMappings = new RegionAdapterMappings();\n\n                regionAdapterMappings.RegisterMapping(typeof(ItemsControl), null);\n            });\n\n        }\n\n        class ItemsControlDescendant : ItemsControl { }\n\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Regions/RegionBehaviorCollectionFixture.cs",
    "content": "\n\nusing Prism.Navigation.Regions;\nusing Prism.Wpf.Tests.Mocks;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Regions\n{\n\n    public class RegionBehaviorCollectionFixture\n    {\n        [Fact]\n        public void CanAttachRegionBehaviors()\n        {\n            RegionBehaviorCollection behaviorCollection = new RegionBehaviorCollection(new MockPresentationRegion());\n\n            var mock1 = new MockRegionBehavior();\n            bool mock1Attached = false;\n            mock1.OnAttach = () => mock1Attached = true;\n            behaviorCollection.Add(\"Mock1\", mock1);\n\n            var mock2 = new MockRegionBehavior();\n            bool mock2Attached = false;\n            mock2.OnAttach = () => mock2Attached = true;\n            behaviorCollection.Add(\"Mock2\", mock2);\n\n            Assert.True(mock1Attached);\n            Assert.True(mock2Attached);\n        }\n\n        [Fact]\n        public void ShouldAddRegionWhenAddingBehavior()\n        {\n            var region = new MockPresentationRegion();\n            RegionBehaviorCollection behaviorCollection = new RegionBehaviorCollection(region);\n            var behavior = new MockRegionBehavior();\n\n            behaviorCollection.Add(\"Mock\", behavior);\n\n            Assert.NotNull(behavior.Region);\n            Assert.Same(region, behavior.Region);\n        }\n\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Regions/RegionBehaviorFactoryFixture.cs",
    "content": "\n\nusing System;\nusing System.Linq;\nusing Moq;\nusing Prism.Ioc;\nusing Prism.Navigation.Regions;\nusing Prism.Wpf.Tests.Mocks;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Regions\n{\n\n    public class RegionBehaviorFactoryFixture\n    {\n        [Fact]\n        public void CanRegisterType()\n        {\n            RegionBehaviorFactory factory = new RegionBehaviorFactory(null);\n\n            factory.AddIfMissing(\"key1\", typeof(MockRegionBehavior));\n            factory.AddIfMissing(\"key2\", typeof(MockRegionBehavior));\n\n            Assert.Equal(2, factory.Count());\n            Assert.True(factory.ContainsKey(\"key1\"));\n\n        }\n\n        [Fact]\n        public void WillNotAddTypesWithDuplicateKeys()\n        {\n            RegionBehaviorFactory factory = new RegionBehaviorFactory(null);\n\n            factory.AddIfMissing(\"key1\", typeof(MockRegionBehavior));\n            factory.AddIfMissing(\"key1\", typeof(MockRegionBehavior));\n\n            Assert.Single(factory);\n        }\n\n        [Fact]\n        public void AddTypeThatDoesNotInheritFromIRegionBehaviorThrows()\n        {\n            var ex = Assert.Throws<ArgumentException>(() =>\n            {\n                RegionBehaviorFactory factory = new RegionBehaviorFactory(null);\n\n                factory.AddIfMissing(\"key1\", typeof(object));\n            });\n\n        }\n\n        [Fact]\n        public void CanCreateRegisteredType()\n        {\n            var expectedBehavior = new MockRegionBehavior();\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(c => c.Resolve(typeof(MockRegionBehavior))).Returns(expectedBehavior);\n            RegionBehaviorFactory factory = new RegionBehaviorFactory(containerMock.Object);\n\n            factory.AddIfMissing(\"key1\", typeof(MockRegionBehavior));\n            var behavior = factory.CreateFromKey(\"key1\");\n\n            Assert.Same(expectedBehavior, behavior);\n        }\n\n        [Fact]\n        public void CreateWithUnknownKeyThrows()\n        {\n            var ex = Assert.Throws<ArgumentException>(() =>\n            {\n                RegionBehaviorFactory factory = new RegionBehaviorFactory(null);\n\n                factory.CreateFromKey(\"Key1\");\n            });\n\n        }\n\n        [Fact]\n        public void ExistingBehavior_IsReplaced_WithCustomBehavior()\n        {\n            var expectedBehavior = new MockRegionBehaviorB();\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(c => c.Resolve(typeof(MockRegionBehaviorB))).Returns(expectedBehavior);\n\n            RegionBehaviorFactory factory = new RegionBehaviorFactory(containerMock.Object);\n\n            factory.AddIfMissing<MockRegionBehavior>(\"key1\");\n            factory.AddOrReplace<MockRegionBehaviorB>(\"key1\");\n\n            Assert.Single(factory);\n            Assert.True(factory.ContainsKey(\"key1\"));\n            Assert.IsType<MockRegionBehaviorB>(factory.CreateFromKey(\"key1\"));\n        }\n\n        [Fact]\n        public void MissingBehavior_IsAdded()\n        {\n            var expectedBehavior = new MockRegionBehaviorB();\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(c => c.Resolve(typeof(MockRegionBehaviorB))).Returns(expectedBehavior);\n\n            RegionBehaviorFactory factory = new RegionBehaviorFactory(containerMock.Object);\n\n            factory.AddOrReplace<MockRegionBehaviorB>(\"key1\");\n\n            Assert.Single(factory);\n            Assert.True(factory.ContainsKey(\"key1\"));\n            Assert.IsType<MockRegionBehaviorB>(factory.CreateFromKey(\"key1\"));\n        }\n\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Regions/RegionBehaviorFixture.cs",
    "content": "\n\nusing System;\nusing Prism.Navigation.Regions;\nusing Prism.Wpf.Tests.Mocks;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Regions\n{\n\n    public class RegionBehaviorFixture\n    {\n        [Fact]\n        public void CannotChangeRegionAfterAttach()\n        {\n            var ex = Assert.Throws<InvalidOperationException>(() =>\n            {\n                TestableRegionBehavior regionBehavior = new TestableRegionBehavior();\n\n                regionBehavior.Region = new MockPresentationRegion();\n\n                regionBehavior.Attach();\n                regionBehavior.Region = new MockPresentationRegion();\n            });\n\n        }\n\n        [Fact]\n        public void ShouldFailWhenAttachedWithoutRegion()\n        {\n            var ex = Assert.Throws<InvalidOperationException>(() =>\n            {\n                TestableRegionBehavior regionBehavior = new TestableRegionBehavior();\n                regionBehavior.Attach();\n            });\n\n        }\n\n        [Fact]\n        public void ShouldCallOnAttachWhenAttachMethodIsInvoked()\n        {\n            TestableRegionBehavior regionBehavior = new TestableRegionBehavior();\n\n            regionBehavior.Region = new MockPresentationRegion();\n\n            regionBehavior.Attach();\n\n            Assert.True(regionBehavior.onAttachCalled);\n        }\n\n        private class TestableRegionBehavior : RegionBehavior\n        {\n            public bool onAttachCalled;\n\n            protected override void OnAttach()\n            {\n                onAttachCalled = true;\n            }\n        }\n    }\n\n\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Regions/RegionFixture.cs",
    "content": "using System;\nusing System.Collections.Specialized;\nusing System.Linq;\nusing Moq;\nusing Prism.Ioc;\nusing Prism.Navigation;\nusing Prism.Navigation.Regions;\nusing Prism.Wpf.Tests.Mocks;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Regions\n{\n    public class RegionFixture\n    {\n        [Fact]\n        public void WhenRegionConstructed_SortComparisonIsDefault()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            IRegion region = new Region();\n\n            Assert.NotNull(region.SortComparison);\n            Assert.Equal(region.SortComparison, Region.DefaultSortComparison);\n        }\n\n        [Fact]\n        public void CanAddContentToRegion()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            IRegion region = new Region();\n\n            Assert.Empty(region.Views.Cast<object>());\n\n            region.Add(new object());\n\n            Assert.Single(region.Views.Cast<object>());\n        }\n\n\n        [Fact]\n        public void CanRemoveContentFromRegion()\n        {\n            IRegion region = new Region();\n            object view = new object();\n\n            region.Add(view);\n            region.Remove(view);\n\n            Assert.Empty(region.Views.Cast<object>());\n        }\n\n        [Fact]\n        public void RemoveInexistentViewThrows()\n        {\n            var ex = Assert.Throws<ArgumentException>(() =>\n            {\n                IRegion region = new Region();\n                object view = new object();\n\n                region.Remove(view);\n\n                Assert.Empty(region.Views.Cast<object>());\n            });\n\n        }\n\n        [Fact]\n        public void RegionExposesCollectionOfContainedViews()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            IRegion region = new Region();\n\n            object view = new object();\n\n            region.Add(view);\n\n            var views = region.Views;\n\n            Assert.NotNull(views);\n            Assert.Single(views.Cast<object>());\n            Assert.Same(view, views.Cast<object>().ElementAt(0));\n        }\n\n        [Fact]\n        public void CanAddAndRetrieveNamedViewInstance()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            IRegion region = new Region();\n            object myView = new object();\n            region.Add(myView, \"MyView\");\n            object returnedView = region.GetView(\"MyView\");\n\n            Assert.NotNull(returnedView);\n            Assert.Same(returnedView, myView);\n        }\n\n        [Fact]\n        public void AddingDuplicateNamedViewThrows()\n        {\n            var ex = Assert.Throws<InvalidOperationException>(() =>\n            {\n                IRegion region = new Region();\n\n                region.Add(new object(), \"MyView\");\n                region.Add(new object(), \"MyView\");\n            });\n\n        }\n\n        [Fact]\n        public void AddNamedViewIsAlsoListedInViewsCollection()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            IRegion region = new Region();\n            object myView = new object();\n\n            region.Add(myView, \"MyView\");\n\n            Assert.Single(region.Views.Cast<object>());\n            Assert.Same(myView, region.Views.Cast<object>().ElementAt(0));\n        }\n\n        [Fact]\n        public void GetViewReturnsNullWhenViewDoesNotExistInRegion()\n        {\n            IRegion region = new Region();\n\n            Assert.Null(region.GetView(\"InexistentView\"));\n        }\n\n\n        [Fact]\n        public void GetViewWithNullOrEmptyStringThrows()\n        {\n            var ex = Assert.Throws<ArgumentException>(() =>\n            {\n                IRegion region = new Region();\n\n                region.GetView(string.Empty);\n            });\n\n        }\n\n        [Fact]\n        public void AddNamedViewWithNullOrEmptyStringNameThrows()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            var ex = Assert.Throws<ArgumentException>(() =>\n            {\n                IRegion region = new Region();\n\n                region.Add(new object(), string.Empty);\n            });\n\n        }\n\n        [Fact]\n        public void GetViewReturnsNullAfterRemovingViewFromRegion()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            IRegion region = new Region();\n            object myView = new object();\n            region.Add(myView, \"MyView\");\n            region.Remove(myView);\n\n            Assert.Null(region.GetView(\"MyView\"));\n        }\n\n        [Fact]\n        public void AddViewPassesSameScopeByDefaultToView()\n        {\n            var regionManager = new MockRegionManager();\n            IRegion region = new Region();\n            region.RegionManager = regionManager;\n            var myView = new MockDependencyObject();\n\n            region.Add(myView);\n\n            Assert.Same(regionManager, myView.GetValue(RegionManager.RegionManagerProperty));\n        }\n\n        [Fact]\n        public void AddViewPassesSameScopeByDefaultToNamedView()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            var regionManager = new MockRegionManager();\n            IRegion region = new Region();\n            region.RegionManager = regionManager;\n            var myView = new MockDependencyObject();\n\n            region.Add(myView, \"MyView\");\n\n            Assert.Same(regionManager, myView.GetValue(RegionManager.RegionManagerProperty));\n        }\n\n        [Fact]\n        public void AddViewPassesDifferentScopeWhenAdding()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            var regionManager = new MockRegionManager();\n            IRegion region = new Region();\n            region.RegionManager = regionManager;\n            var myView = new MockDependencyObject();\n\n            region.Add(myView, \"MyView\", true);\n\n            Assert.NotSame(regionManager, myView.GetValue(RegionManager.RegionManagerProperty));\n        }\n\n        [Fact]\n        public void CreatingNewScopesAsksTheRegionManagerForNewInstance()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            var regionManager = new MockRegionManager();\n            IRegion region = new Region();\n            region.RegionManager = regionManager;\n            var myView = new object();\n\n            region.Add(myView, \"MyView\", true);\n\n            Assert.True(regionManager.CreateRegionManagerCalled);\n        }\n\n        [Fact]\n        public void AddViewReturnsExistingRegionManager()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            var regionManager = new MockRegionManager();\n            IRegion region = new Region();\n            region.RegionManager = regionManager;\n            var myView = new object();\n\n            var returnedRegionManager = region.Add(myView, \"MyView\", false);\n\n            Assert.Same(regionManager, returnedRegionManager);\n        }\n\n        [Fact]\n        public void AddViewReturnsNewRegionManager()\n        {\n            var regionManager = new MockRegionManager();\n            IRegion region = new Region();\n            region.RegionManager = regionManager;\n            var myView = new object();\n\n            var returnedRegionManager = region.Add(myView, \"MyView\", true);\n\n            Assert.NotSame(regionManager, returnedRegionManager);\n        }\n\n        [Fact]\n        public void AddingNonDependencyObjectToRegionDoesNotThrow()\n        {\n            IRegion region = new Region();\n            object model = new object();\n\n            region.Add(model);\n\n            Assert.Single(region.Views.Cast<object>());\n        }\n\n        [Fact]\n        public void ActivateNonAddedViewThrows()\n        {\n            var ex = Assert.Throws<ArgumentException>(() =>\n            {\n                IRegion region = new Region();\n\n                object nonAddedView = new object();\n\n                region.Activate(nonAddedView);\n            });\n\n        }\n\n        [Fact]\n        public void DeactivateNonAddedViewThrows()\n        {\n            var ex = Assert.Throws<ArgumentException>(() =>\n            {\n                IRegion region = new Region();\n\n                object nonAddedView = new object();\n\n                region.Deactivate(nonAddedView);\n            });\n\n        }\n\n        [Fact]\n        public void ActivateNullViewThrows()\n        {\n            var ex = Assert.Throws<ArgumentNullException>(() =>\n            {\n                IRegion region = new Region();\n\n                region.Activate(null);\n            });\n\n        }\n\n        [Fact]\n        public void AddViewRaisesCollectionViewEvent()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            bool viewAddedCalled = false;\n\n            IRegion region = new Region();\n            region.Views.CollectionChanged += (sender, e) =>\n                                                  {\n                                                      if (e.Action == NotifyCollectionChangedAction.Add)\n                                                          viewAddedCalled = true;\n                                                  };\n\n            object model = new object();\n            Assert.False(viewAddedCalled);\n            region.Add(model);\n\n            Assert.True(viewAddedCalled);\n        }\n\n        [Fact]\n        public void ViewAddedEventPassesTheViewAddedInTheEventArgs()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            object viewAdded = null;\n\n            IRegion region = new Region();\n            region.Views.CollectionChanged += (sender, e) =>\n                                                  {\n                                                      if (e.Action == NotifyCollectionChangedAction.Add)\n                                                      {\n                                                          viewAdded = e.NewItems[0];\n                                                      }\n                                                  };\n            object model = new object();\n            Assert.Null(viewAdded);\n            region.Add(model);\n\n            Assert.NotNull(viewAdded);\n            Assert.Same(model, viewAdded);\n        }\n\n        [Fact]\n        public void RemoveViewFiresViewRemovedEvent()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            bool viewRemoved = false;\n\n            IRegion region = new Region();\n            object model = new object();\n            region.Views.CollectionChanged += (sender, e) =>\n                                                  {\n                                                      if (e.Action == NotifyCollectionChangedAction.Remove)\n                                                          viewRemoved = true;\n                                                  };\n\n            region.Add(model);\n            Assert.False(viewRemoved);\n\n            region.Remove(model);\n\n            Assert.True(viewRemoved);\n        }\n\n        [Fact]\n        public void ViewRemovedEventPassesTheViewRemovedInTheEventArgs()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            object removedView = null;\n\n            IRegion region = new Region();\n            region.Views.CollectionChanged += (sender, e) =>\n                                                  {\n                                                      if (e.Action == NotifyCollectionChangedAction.Remove)\n                                                          removedView = e.OldItems[0];\n                                                  };\n            object model = new object();\n            region.Add(model);\n            Assert.Null(removedView);\n\n            region.Remove(model);\n\n            Assert.Same(model, removedView);\n        }\n\n        [Fact]\n        public void ShowViewFiresViewShowedEvent()\n        {\n            bool viewActivated = false;\n\n            IRegion region = new Region();\n            object model = new object();\n            region.ActiveViews.CollectionChanged += (o, e) =>\n                                                        {\n                                                            if (e.Action == NotifyCollectionChangedAction.Add && e.NewItems.Contains(model))\n                                                                viewActivated = true;\n                                                        };\n            region.Add(model);\n            Assert.False(viewActivated);\n\n            region.Activate(model);\n\n            Assert.True(viewActivated);\n        }\n\n        [Fact]\n        public void AddingSameViewTwiceThrows()\n        {\n            object view = new object();\n            IRegion region = new Region();\n            region.Add(view);\n\n            try\n            {\n                region.Add(view);\n                //Assert.Fail();\n            }\n            catch (InvalidOperationException ex)\n            {\n                Assert.Equal(\"View already exists in region.\", ex.Message);\n            }\n            catch\n            {\n                //Assert.Fail();\n            }\n        }\n\n        [Fact]\n        public void RemovingViewAlsoRemovesItFromActiveViews()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            IRegion region = new Region();\n            object model = new object();\n            region.Add(model);\n            region.Activate(model);\n            Assert.True(region.ActiveViews.Contains(model));\n\n            region.Remove(model);\n\n            Assert.False(region.ActiveViews.Contains(model));\n        }\n\n        [Fact]\n        public void ShouldGetNotificationWhenContextChanges()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            IRegion region = new Region();\n            bool contextChanged = false;\n            region.PropertyChanged += (s, args) => { if (args.PropertyName == \"Context\") contextChanged = true; };\n\n            region.Context = \"MyNewContext\";\n\n            Assert.True(contextChanged);\n        }\n\n        [Fact]\n        public void ChangingNameOnceItIsSetThrows()\n        {\n            var ex = Assert.Throws<InvalidOperationException>(() =>\n            {\n                var region = new Region\n                {\n                    Name = \"MyRegion\"\n                };\n\n                region.Name = \"ChangedRegionName\";\n            });\n\n        }\n\n        private class MockRegionManager : IRegionManager\n        {\n            public bool CreateRegionManagerCalled;\n\n            public IRegionManager CreateRegionManager()\n            {\n                CreateRegionManagerCalled = true;\n                return new MockRegionManager();\n            }\n\n            public IRegionManager AddToRegion(string regionName, object view)\n            {\n                throw new NotImplementedException();\n            }\n\n            public IRegionManager RegisterViewWithRegion(string regionName, Type viewType)\n            {\n                throw new NotImplementedException();\n            }\n\n            public IRegionManager RegisterViewWithRegion(string regionName, Func<IContainerProvider, object> getContentDelegate)\n            {\n                throw new NotImplementedException();\n            }\n\n            public void RequestNavigate(string regionName, Uri source, Action<NavigationResult> navigationCallback)\n            {\n                throw new NotImplementedException();\n            }\n\n            public void RequestNavigate(string regionName, Uri source)\n            {\n                throw new NotImplementedException();\n            }\n\n            public void RequestNavigate(string regionName, string source, Action<NavigationResult> navigationCallback)\n            {\n                throw new NotImplementedException();\n            }\n\n            public void RequestNavigate(string regionName, string source)\n            {\n                throw new NotImplementedException();\n            }\n\n            public void RequestNavigate(string regionName, Uri target, Action<NavigationResult> navigationCallback, INavigationParameters navigationParameters)\n            {\n                throw new NotImplementedException();\n            }\n\n            public void RequestNavigate(string regionName, string target, Action<NavigationResult> navigationCallback, INavigationParameters navigationParameters)\n            {\n                throw new NotImplementedException();\n            }\n\n            public void RequestNavigate(string regionName, Uri target, INavigationParameters navigationParameters)\n            {\n                throw new NotImplementedException();\n            }\n\n            public void RequestNavigate(string regionName, string target, INavigationParameters navigationParameters)\n            {\n                throw new NotImplementedException();\n            }\n\n            public IRegionCollection Regions\n            {\n                get { throw new NotImplementedException(); }\n            }\n\n            public IRegion AttachNewRegion(object regionTarget, string regionName)\n            {\n                throw new NotImplementedException();\n            }\n\n            public bool Navigate(Uri source)\n            {\n                throw new NotImplementedException();\n            }\n\n            public IRegionManager AddToRegion(string regionName, string viewName)\n            {\n                throw new NotImplementedException();\n            }\n\n            public IRegionManager RegisterViewWithRegion(string regionName, string viewName)\n            {\n                throw new NotImplementedException();\n            }\n        }\n\n        [Fact]\n        public void NavigateDelegatesToIRegionNavigationService()\n        {\n            try\n            {\n                // Prepare\n                IRegion region = new Region();\n\n                object view = new object();\n                region.Add(view);\n\n                Uri uri = new Uri(view.GetType().Name, UriKind.Relative);\n                Action<NavigationResult> navigationCallback = nr => { };\n                NavigationParameters navigationParameters = new NavigationParameters();\n\n                Mock<IRegionNavigationService> mockRegionNavigationService = new Mock<IRegionNavigationService>();\n                mockRegionNavigationService.Setup(x => x.RequestNavigate(uri, navigationCallback, navigationParameters)).Verifiable();\n\n                var containerMock = new Mock<IContainerExtension>();\n                containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationService))).Returns(mockRegionNavigationService.Object);\n                ContainerLocator.ResetContainer();\n                ContainerLocator.SetContainerExtension(containerMock.Object);\n\n                // Act\n                region.RequestNavigate(uri, navigationCallback, navigationParameters);\n\n                // Verify\n                mockRegionNavigationService.VerifyAll();\n            }\n            finally\n            {\n                ContainerLocator.ResetContainer();\n            }\n        }\n\n        [Fact]\n        public void WhenViewsWithSortHintsAdded_RegionSortsViews()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            IRegion region = new Region();\n\n            object view1 = new ViewOrder1();\n            object view2 = new ViewOrder2();\n            object view3 = new ViewOrder3();\n\n            region.Add(view1);\n            region.Add(view2);\n            region.Add(view3);\n\n            Assert.Equal(3, region.Views.Count());\n            Assert.Same(view2, region.Views.ElementAt(0));\n            Assert.Same(view3, region.Views.ElementAt(1));\n            Assert.Same(view1, region.Views.ElementAt(2));\n        }\n\n        [StaFact]\n        public void WhenViewHasBeenRemovedAndRegionManagerPropertyCleared_ThenItCanBeAddedAgainToARegion()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            IRegion region = new Region { RegionManager = new MockRegionManager() };\n\n            var view = new MockFrameworkElement();\n\n            var scopedRegionManager = region.Add(view, null, true);\n\n            Assert.Equal(view, region.Views.First());\n\n            region.Remove(view);\n\n            view.ClearValue(RegionManager.RegionManagerProperty);\n\n            Assert.Empty(region.Views.Cast<object>());\n\n            var newScopedRegion = region.Add(view, null, true);\n\n            Assert.Equal(view, region.Views.First());\n\n            Assert.Same(newScopedRegion, view.GetValue(RegionManager.RegionManagerProperty));\n        }\n\n        [ViewSortHint(\"C\")]\n        private class ViewOrder1 { };\n        [ViewSortHint(\"A\")]\n        private class ViewOrder2 { };\n        [ViewSortHint(\"B\")]\n        private class ViewOrder3 { };\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Regions/RegionManagerFixture.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Collections.Specialized;\nusing System.Threading.Tasks;\nusing Moq;\nusing Prism.Ioc;\nusing Prism.Navigation.Regions;\nusing Prism.Wpf.Tests.Mocks;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Regions\n{\n    public class RegionManagerFixture\n    {\n        [Fact]\n        public void CanAddRegion()\n        {\n            IRegion region1 = new MockPresentationRegion();\n            region1.Name = \"MainRegion\";\n\n            RegionManager regionManager = new RegionManager();\n            regionManager.Regions.Add(region1);\n\n            IRegion region2 = regionManager.Regions[\"MainRegion\"];\n            Assert.Same(region1, region2);\n        }\n\n        [Fact]\n        public void ShouldFailIfRegionDoesntExists()\n        {\n            var ex = Assert.Throws<KeyNotFoundException>(() =>\n            {\n                RegionManager regionManager = new RegionManager();\n                IRegion region = regionManager.Regions[\"nonExistentRegion\"];\n            });\n        }\n\n        [Fact]\n        public void CanCheckTheExistenceOfARegion()\n        {\n            RegionManager regionManager = new RegionManager();\n            bool result = regionManager.Regions.ContainsRegionWithName(\"noRegion\");\n\n            Assert.False(result);\n\n            IRegion region = new MockPresentationRegion();\n            region.Name = \"noRegion\";\n            regionManager.Regions.Add(region);\n\n            result = regionManager.Regions.ContainsRegionWithName(\"noRegion\");\n\n            Assert.True(result);\n        }\n\n        [Fact]\n        public void AddingMultipleRegionsWithSameNameThrowsArgumentException()\n        {\n            var ex = Assert.Throws<ArgumentException>(() =>\n            {\n                var regionManager = new RegionManager();\n                regionManager.Regions.Add(new MockPresentationRegion { Name = \"region name\" });\n                regionManager.Regions.Add(new MockPresentationRegion { Name = \"region name\" });\n            });\n\n        }\n\n        [Fact]\n        public void AddPassesItselfAsTheRegionManagerOfTheRegion()\n        {\n            var regionManager = new RegionManager();\n            var region = new MockPresentationRegion\n            {\n                Name = \"region\"\n            };\n            regionManager.Regions.Add(region);\n\n            Assert.Same(regionManager, region.RegionManager);\n        }\n\n        [Fact]\n        public void CreateRegionManagerCreatesANewInstance()\n        {\n            var regionManager = new RegionManager();\n            var createdRegionManager = regionManager.CreateRegionManager();\n            Assert.NotNull(createdRegionManager);\n            Assert.IsType<RegionManager>(createdRegionManager);\n            Assert.NotSame(regionManager, createdRegionManager);\n        }\n\n        [Fact]\n        public void CanRemoveRegion()\n        {\n            var regionManager = new RegionManager();\n            IRegion region = new MockPresentationRegion\n            {\n                Name = \"TestRegion\"\n            };\n            regionManager.Regions.Add(region);\n\n            regionManager.Regions.Remove(\"TestRegion\");\n\n            Assert.False(regionManager.Regions.ContainsRegionWithName(\"TestRegion\"));\n        }\n\n        [Fact]\n        public void ShouldRemoveRegionManagerWhenRemoving()\n        {\n            var regionManager = new RegionManager();\n            var region = new MockPresentationRegion\n            {\n                Name = \"TestRegion\"\n            };\n            regionManager.Regions.Add(region);\n\n            regionManager.Regions.Remove(\"TestRegion\");\n\n            Assert.Null(region.RegionManager);\n        }\n\n        [Fact]\n        public void UpdatingRegionsGetsCalledWhenAccessingRegionMembers()\n        {\n            var listener = new MySubscriberClass();\n\n            try\n            {\n                RegionManager.UpdatingRegions += listener.OnUpdatingRegions;\n                RegionManager regionManager = new RegionManager();\n                regionManager.Regions.ContainsRegionWithName(\"TestRegion\");\n                Assert.True(listener.OnUpdatingRegionsCalled);\n\n                listener.OnUpdatingRegionsCalled = false;\n                regionManager.Regions.Add(new MockPresentationRegion() { Name = \"TestRegion\" });\n                Assert.True(listener.OnUpdatingRegionsCalled);\n\n                listener.OnUpdatingRegionsCalled = false;\n                var region = regionManager.Regions[\"TestRegion\"];\n                Assert.True(listener.OnUpdatingRegionsCalled);\n\n                listener.OnUpdatingRegionsCalled = false;\n                regionManager.Regions.Remove(\"TestRegion\");\n                Assert.True(listener.OnUpdatingRegionsCalled);\n\n                listener.OnUpdatingRegionsCalled = false;\n                regionManager.Regions.GetEnumerator();\n                Assert.True(listener.OnUpdatingRegionsCalled);\n            }\n            finally\n            {\n                RegionManager.UpdatingRegions -= listener.OnUpdatingRegions;\n            }\n        }\n\n        [StaFact]\n        public void ShouldSetObservableRegionContextWhenRegionContextChanges()\n        {\n            var region = new MockPresentationRegion();\n            var view = new MockDependencyObject();\n\n            var observableObject = RegionContext.GetObservableContext(view);\n\n            bool propertyChangedCalled = false;\n            observableObject.PropertyChanged += (sender, args) => propertyChangedCalled = true;\n\n            Assert.Null(observableObject.Value);\n            RegionManager.SetRegionContext(view, \"MyContext\");\n            Assert.True(propertyChangedCalled);\n            Assert.Equal(\"MyContext\", observableObject.Value);\n        }\n\n        [Fact]\n        public async Task ShouldNotPreventSubscribersToStaticEventFromBeingGarbageCollected()\n        {\n            var subscriber = new MySubscriberClass();\n            RegionManager.UpdatingRegions += subscriber.OnUpdatingRegions;\n            RegionManager.UpdateRegions();\n            Assert.True(subscriber.OnUpdatingRegionsCalled);\n            WeakReference subscriberWeakReference = new WeakReference(subscriber);\n\n            subscriber = null;\n            await Task.Delay(50);\n            GC.Collect();\n\n            Assert.False(subscriberWeakReference.IsAlive);\n        }\n\n        [Fact]\n        public void ExceptionMessageWhenCallingUpdateRegionsShouldBeClear()\n        {\n            try\n            {\n                ExceptionExtensions.RegisterFrameworkExceptionType(typeof(FrameworkException));\n                RegionManager.UpdatingRegions += new EventHandler(RegionManager_UpdatingRegions);\n\n                try\n                {\n                    RegionManager.UpdateRegions();\n                    //Assert.Fail();\n                }\n                catch (Exception ex)\n                {\n                    Assert.Contains(\"Abcde\", ex.Message);\n                }\n            }\n            finally\n            {\n                RegionManager.UpdatingRegions -= new EventHandler(RegionManager_UpdatingRegions);\n            }\n        }\n\n        private void RegionManager_UpdatingRegions(object sender, EventArgs e)\n        {\n            try\n            {\n                throw new Exception(\"Abcde\");\n            }\n            catch (Exception ex)\n            {\n                throw new FrameworkException(ex);\n            }\n        }\n\n\n        internal class MySubscriberClass\n        {\n            public bool OnUpdatingRegionsCalled;\n\n            public void OnUpdatingRegions(object sender, EventArgs e)\n            {\n                OnUpdatingRegionsCalled = true;\n            }\n        }\n\n        [Fact]\n        public void WhenAddingRegions_ThenRegionsCollectionNotifiesUpdate()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            var regionManager = new RegionManager();\n\n            var region1 = new Region { Name = \"region1\" };\n            var region2 = new Region { Name = \"region2\" };\n\n            NotifyCollectionChangedEventArgs args = null;\n            regionManager.Regions.CollectionChanged += (s, e) => args = e;\n\n            regionManager.Regions.Add(region1);\n\n            Assert.Equal(NotifyCollectionChangedAction.Add, args.Action);\n            Assert.Equal(new object[] { region1 }, args.NewItems);\n            Assert.Equal(0, args.NewStartingIndex);\n            Assert.Null(args.OldItems);\n            Assert.Equal(-1, args.OldStartingIndex);\n\n            regionManager.Regions.Add(region2);\n\n            Assert.Equal(NotifyCollectionChangedAction.Add, args.Action);\n            Assert.Equal(new object[] { region2 }, args.NewItems);\n            Assert.Equal(0, args.NewStartingIndex);\n            Assert.Null(args.OldItems);\n            Assert.Equal(-1, args.OldStartingIndex);\n        }\n\n        [Fact]\n        public void WhenRemovingRegions_ThenRegionsCollectionNotifiesUpdate()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            var regionManager = new RegionManager();\n\n            var region1 = new Region { Name = \"region1\" };\n            var region2 = new Region { Name = \"region2\" };\n\n            regionManager.Regions.Add(region1);\n            regionManager.Regions.Add(region2);\n\n            NotifyCollectionChangedEventArgs args = null;\n            regionManager.Regions.CollectionChanged += (s, e) => args = e;\n\n            regionManager.Regions.Remove(\"region2\");\n\n            Assert.Equal(NotifyCollectionChangedAction.Remove, args.Action);\n            Assert.Equal(new object[] { region2 }, args.OldItems);\n            Assert.Equal(0, args.OldStartingIndex);\n            Assert.Null(args.NewItems);\n            Assert.Equal(-1, args.NewStartingIndex);\n\n            regionManager.Regions.Remove(\"region1\");\n\n            Assert.Equal(NotifyCollectionChangedAction.Remove, args.Action);\n            Assert.Equal(new object[] { region1 }, args.OldItems);\n            Assert.Equal(0, args.OldStartingIndex);\n            Assert.Null(args.NewItems);\n            Assert.Equal(-1, args.NewStartingIndex);\n        }\n\n        [Fact]\n        public void WhenRemovingNonExistingRegion_ThenRegionsCollectionDoesNotNotifyUpdate()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            var regionManager = new RegionManager();\n\n            var region1 = new Region { Name = \"region1\" };\n\n            regionManager.Regions.Add(region1);\n\n            NotifyCollectionChangedEventArgs args = null;\n            regionManager.Regions.CollectionChanged += (s, e) => args = e;\n\n            regionManager.Regions.Remove(\"region2\");\n\n            Assert.Null(args);\n        }\n\n        [Fact]\n        public void CanAddViewToRegion()\n        {\n            var regionManager = new RegionManager();\n            var view1 = new object();\n            var view2 = new object();\n\n\n            IRegion region = new MockRegion\n            {\n                Name = \"RegionName\"\n            };\n            regionManager.Regions.Add(region);\n\n            regionManager.AddToRegion(\"RegionName\", view1);\n            regionManager.AddToRegion(\"RegionName\", view2);\n\n            Assert.True(regionManager.Regions[\"RegionName\"].Views.Contains(view1));\n            Assert.True(regionManager.Regions[\"RegionName\"].Views.Contains(view2));\n        }\n\n        [Fact]\n        public void CanRegisterViewType()\n        {\n            try\n            {\n                var mockRegionContentRegistry = new MockRegionContentRegistry();\n\n                string regionName = null;\n                Type viewType = null;\n\n                mockRegionContentRegistry.RegisterContentWithViewType = (name, type) =>\n                {\n                    regionName = name;\n                    viewType = type;\n                    return null;\n                };\n                var containerMock = new Mock<IContainerExtension>();\n                containerMock.Setup(c => c.Resolve(typeof(IRegionViewRegistry))).Returns(mockRegionContentRegistry);\n                ContainerLocator.SetContainerExtension(containerMock.Object);\n\n                var regionManager = new RegionManager();\n\n                regionManager.RegisterViewWithRegion(\"Region1\", typeof(object));\n\n                Assert.Equal(\"Region1\", regionName);\n                Assert.Equal(typeof(object), viewType);\n\n\n            }\n            finally\n            {\n                ContainerLocator.ResetContainer();\n            }\n        }\n\n        [Fact]\n        public void CanRegisterViewTypeGeneric()\n        {\n            try\n            {\n                var mockRegionContentRegistry = new MockRegionContentRegistry();\n\n                string regionName = null;\n                Type viewType = null;\n\n                mockRegionContentRegistry.RegisterContentWithViewType = (name, type) =>\n                {\n                    regionName = name;\n                    viewType = type;\n                    return null;\n                };\n                var containerMock = new Mock<IContainerExtension>();\n                containerMock.Setup(c => c.Resolve(typeof(IRegionViewRegistry))).Returns(mockRegionContentRegistry);\n                ContainerLocator.ResetContainer();\n                ContainerLocator.SetContainerExtension(containerMock.Object);\n\n                var regionManager = new RegionManager();\n\n                regionManager.RegisterViewWithRegion<object>(\"Region1\");\n\n                Assert.Equal(\"Region1\", regionName);\n                Assert.Equal(typeof(object), viewType);\n\n\n            }\n            finally\n            {\n                ContainerLocator.ResetContainer();\n            }\n        }\n\n        [Fact]\n        public void CanRegisterDelegate()\n        {\n            try\n            {\n                ContainerLocator.ResetContainer();\n                var mockRegionContentRegistry = new MockRegionContentRegistry();\n\n                string regionName = null;\n                Func<IContainerProvider, object> contentDelegate = null;\n\n                Func<IContainerProvider, object> expectedDelegate = _ => true;\n                mockRegionContentRegistry.RegisterContentWithDelegate = (name, usedDelegate) =>\n                {\n                    regionName = name;\n                    contentDelegate = usedDelegate;\n                    return null;\n                };\n                var containerMock = new Mock<IContainerExtension>();\n                containerMock.Setup(c => c.Resolve(typeof(IRegionViewRegistry))).Returns(mockRegionContentRegistry);\n                ContainerLocator.SetContainerExtension(containerMock.Object);\n\n                var regionManager = new RegionManager();\n\n                regionManager.RegisterViewWithRegion(\"Region1\", expectedDelegate);\n\n                Assert.Equal(\"Region1\", regionName);\n                Assert.Equal(expectedDelegate, contentDelegate);\n            }\n            finally\n            {\n                ContainerLocator.ResetContainer();\n            }\n        }\n\n        [Fact]\n        public void CanAddRegionToRegionManager()\n        {\n            var regionManager = new RegionManager();\n            var region = new MockRegion();\n\n            regionManager.Regions.Add(\"region\", region);\n\n            Assert.Single(regionManager.Regions);\n            Assert.Equal(\"region\", region.Name);\n        }\n\n        [Fact]\n        public void ShouldThrowIfRegionNameArgumentIsDifferentToRegionNameProperty()\n        {\n            var ex = Assert.Throws<ArgumentException>(() =>\n            {\n                var regionManager = new RegionManager();\n                var region = new MockRegion\n                {\n                    Name = \"region\"\n                };\n\n                regionManager.Regions.Add(\"another region\", region);\n            });\n        }\n    }\n\n    internal class FrameworkException : Exception\n    {\n        public FrameworkException(Exception inner)\n            : base(string.Empty, inner)\n        {\n\n        }\n    }\n\n    internal class MockRegionContentRegistry : IRegionViewRegistry\n    {\n        public Func<string, Type, object> RegisterContentWithViewType;\n        public Func<string, Func<IContainerProvider, object>, object> RegisterContentWithDelegate;\n        public event EventHandler<ViewRegisteredEventArgs> ContentRegistered;\n        public IEnumerable<object> GetContents(string regionName, IContainerProvider container)\n        {\n            return null;\n        }\n\n        public void RegisterViewWithRegion(string regionName, string targetName)\n        {\n            throw new NotImplementedException();\n        }\n\n        void IRegionViewRegistry.RegisterViewWithRegion(string regionName, Type viewType)\n        {\n            RegisterContentWithViewType?.Invoke(regionName, viewType);\n        }\n\n        void IRegionViewRegistry.RegisterViewWithRegion(string regionName, Func<IContainerProvider, object> getContentDelegate)\n        {\n            RegisterContentWithDelegate?.Invoke(regionName, getContentDelegate);\n\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Regions/RegionManagerRequestNavigateFixture.cs",
    "content": "﻿using System;\nusing Moq;\nusing Prism.Ioc;\nusing Prism.Navigation;\nusing Prism.Navigation.Regions;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Regions\n{\n\n    public class RegionManagerRequestNavigateFixture\n    {\n        const string region = \"Region\";\n        const string nonExistentRegion = \"NonExistentRegion\";\n        const string source = \"Source\";\n\n        private static Uri sourceUri = new Uri(source, UriKind.RelativeOrAbsolute);\n        private static NavigationParameters parameters = new NavigationParameters();\n        private static Action<NavigationResult> callback = (_) => { };\n\n        private static Mock<IRegion> mockRegion;\n        private static RegionManager regionManager;\n\n        public RegionManagerRequestNavigateFixture()\n        {\n            mockRegion = new Mock<IRegion>();\n            mockRegion.SetupGet((r) => r.Name).Returns(region);\n\n            regionManager = new RegionManager();\n            regionManager.Regions.Add(mockRegion.Object);\n        }\n\n        [Fact]\n        public void ThrowsWhenNavigationCallbackIsNull()\n        {\n            ExceptionAssert.Throws<ArgumentNullException>(() =>\n                regionManager.RequestNavigate(region, source, null, parameters)\n            );\n\n            ExceptionAssert.Throws<ArgumentNullException>(() =>\n                regionManager.RequestNavigate(region, source, navigationCallback: null)\n            );\n\n            ExceptionAssert.Throws<ArgumentNullException>(() =>\n                regionManager.RequestNavigate(region, sourceUri, null, parameters)\n            );\n\n            ExceptionAssert.Throws<ArgumentNullException>(() =>\n                regionManager.RequestNavigate(region, sourceUri, navigationCallback: null)\n            );\n        }\n\n        [Fact]\n        public void WhenNonExistentRegion_ReturnNavigationResultFalse()\n        {\n            NavigationResult result;\n\n            result = null;\n            regionManager.RequestNavigate(nonExistentRegion, source, (r) => result = r, parameters);\n            Assert.False(result.Success);\n\n            result = null;\n            regionManager.RequestNavigate(nonExistentRegion, source, (r) => result = r);\n            Assert.False(result.Success);\n\n            result = null;\n            regionManager.RequestNavigate(nonExistentRegion, sourceUri, (r) => result = r, parameters);\n            Assert.False(result.Success);\n\n            result = null;\n            regionManager.RequestNavigate(nonExistentRegion, sourceUri, (r) => result = r);\n            Assert.False(result.Success);\n        }\n\n        [Fact]\n        public void DelegatesCallToRegion_RegionSource()\n        {\n            regionManager.RequestNavigate(region, source);\n            mockRegion.Verify((r) => r.RequestNavigate(sourceUri, It.IsAny<Action<NavigationResult>>(), It.IsAny<INavigationParameters>()));\n        }\n\n        [Fact]\n        public void DelegatesCallToRegion_RegionTarget()\n        {\n            regionManager.RequestNavigate(region, sourceUri);\n            mockRegion.Verify((r) => r.RequestNavigate(sourceUri, It.IsAny<Action<NavigationResult>>(), It.IsAny<INavigationParameters>()));\n        }\n\n        [Fact]\n        public void DelegatesCallToRegion_RegionSourceParameters()\n        {\n            regionManager.RequestNavigate(region, source, parameters);\n            mockRegion.Verify((r) => r.RequestNavigate(sourceUri, It.IsAny<Action<NavigationResult>>(), parameters));\n        }\n\n        [Fact]\n        public void DelegatesCallToRegion_RegionSourceUriParameters()\n        {\n            regionManager.RequestNavigate(region, sourceUri, parameters);\n            mockRegion.Verify((r) => r.RequestNavigate(sourceUri, It.IsAny<Action<NavigationResult>>(), parameters));\n        }\n\n        [Fact]\n        public void DelegatesCallToRegion_RegionSourceCallback()\n        {\n            regionManager.RequestNavigate(region, source, callback);\n            mockRegion.Verify((r) => r.RequestNavigate(sourceUri, callback, It.IsAny<INavigationParameters>()));\n        }\n\n        [Fact]\n        public void DelegatesCallToRegion_RegionTargetCallback()\n        {\n            regionManager.RequestNavigate(region, sourceUri, callback);\n            mockRegion.Verify((r) => r.RequestNavigate(sourceUri, callback, It.IsAny<INavigationParameters>()));\n        }\n\n        [Fact]\n        public void DelegatesCallToRegion_RegionSourceCallbackParameters()\n        {\n            regionManager.RequestNavigate(region, source, callback, parameters);\n            mockRegion.Verify((r) => r.RequestNavigate(sourceUri, callback, parameters));\n        }\n\n        [Fact]\n        public void DelegatesCallToRegion_RegionSourceUriCallbackParameters()\n        {\n            regionManager.RequestNavigate(region, sourceUri, callback, parameters);\n            mockRegion.Verify((r) => r.RequestNavigate(sourceUri, callback, parameters));\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Regions/RegionNavigationJournalFixture.cs",
    "content": "using System;\nusing Moq;\nusing Prism.Navigation;\nusing Prism.Navigation.Regions;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Regions\n{\n    public class RegionNavigationJournalFixture\n    {\n        [Fact]\n        public void ConstructingJournalInitializesValues()\n        {\n            // Act\n            RegionNavigationJournal target = new RegionNavigationJournal();\n\n            // Verify\n            Assert.False(target.CanGoBack);\n            Assert.False(target.CanGoForward);\n            Assert.Null(target.CurrentEntry);\n            Assert.Null(target.NavigationTarget);\n        }\n\n        [Fact]\n        public void SettingNavigationServiceUpdatesValue()\n        {\n            // Prepare\n            RegionNavigationJournal target = new RegionNavigationJournal();\n\n            Mock<INavigateAsync> mockINavigate = new Mock<INavigateAsync>();\n\n            // Act\n            target.NavigationTarget = mockINavigate.Object;\n\n            // Verify\n            Assert.Same(mockINavigate.Object, target.NavigationTarget);\n        }\n\n        [Fact]\n        public void RecordingNavigationUpdatesNavigationState()\n        {\n            // Prepare\n            RegionNavigationJournal target = new RegionNavigationJournal();\n\n            Uri uri = new Uri(\"Uri\", UriKind.Relative);\n            RegionNavigationJournalEntry entry = new RegionNavigationJournalEntry() { Uri = uri };\n\n            // Act\n            target.RecordNavigation(entry, true);\n\n            // Verify\n            Assert.False(target.CanGoBack);\n            Assert.False(target.CanGoForward);\n            Assert.Same(entry, target.CurrentEntry);\n        }\n\n        [Fact]\n        public void RecordingNavigationMultipleTimesUpdatesNavigationState()\n        {\n            // Prepare\n            RegionNavigationJournal target = new RegionNavigationJournal();\n\n            Uri uri1 = new Uri(\"Uri1\", UriKind.Relative);\n            RegionNavigationJournalEntry entry1 = new RegionNavigationJournalEntry() { Uri = uri1 };\n\n            Uri uri2 = new Uri(\"Uri2\", UriKind.Relative);\n            RegionNavigationJournalEntry entry2 = new RegionNavigationJournalEntry() { Uri = uri2 };\n\n            Uri uri3 = new Uri(\"Uri3\", UriKind.Relative);\n            RegionNavigationJournalEntry entry3 = new RegionNavigationJournalEntry() { Uri = uri3 };\n\n            // Act\n            target.RecordNavigation(entry1, true);\n            target.RecordNavigation(entry2, true);\n            target.RecordNavigation(entry3, true);\n\n            // Verify\n            Assert.True(target.CanGoBack);\n            Assert.False(target.CanGoForward);\n            Assert.Same(entry3, target.CurrentEntry);\n        }\n\n        [Fact]\n        public void ClearUpdatesNavigationState()\n        {\n            // Prepare\n            RegionNavigationJournal target = new RegionNavigationJournal();\n\n            Uri uri1 = new Uri(\"Uri1\", UriKind.Relative);\n            RegionNavigationJournalEntry entry1 = new RegionNavigationJournalEntry() { Uri = uri1 };\n\n            Uri uri2 = new Uri(\"Uri2\", UriKind.Relative);\n            RegionNavigationJournalEntry entry2 = new RegionNavigationJournalEntry() { Uri = uri2 };\n\n            Uri uri3 = new Uri(\"Uri3\", UriKind.Relative);\n            RegionNavigationJournalEntry entry3 = new RegionNavigationJournalEntry() { Uri = uri3 };\n\n            target.RecordNavigation(entry1, true);\n            target.RecordNavigation(entry2, true);\n            target.RecordNavigation(entry3, true);\n\n            // Act\n            target.Clear();\n\n            // Verify\n            Assert.False(target.CanGoBack);\n            Assert.False(target.CanGoForward);\n            Assert.Null(target.CurrentEntry);\n        }\n\n        [Fact]\n        public void GoBackNavigatesBack()\n        {\n            // Prepare\n            RegionNavigationJournal target = new RegionNavigationJournal();\n\n            Mock<INavigateAsync> mockNavigationTarget = new Mock<INavigateAsync>();\n            target.NavigationTarget = mockNavigationTarget.Object;\n\n            Uri uri1 = new Uri(\"Uri1\", UriKind.Relative);\n            RegionNavigationJournalEntry entry1 = new RegionNavigationJournalEntry() { Uri = uri1 };\n\n            Uri uri2 = new Uri(\"Uri2\", UriKind.Relative);\n            RegionNavigationJournalEntry entry2 = new RegionNavigationJournalEntry() { Uri = uri2 };\n\n            Uri uri3 = new Uri(\"Uri3\", UriKind.Relative);\n            RegionNavigationJournalEntry entry3 = new RegionNavigationJournalEntry() { Uri = uri3 };\n\n            target.RecordNavigation(entry1, true);\n            target.RecordNavigation(entry2, true);\n            target.RecordNavigation(entry3, true);\n\n\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri1, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri2, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri3, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n\n            // Act\n            target.GoBack();\n\n            // Verify\n            Assert.True(target.CanGoBack);\n            Assert.True(target.CanGoForward);\n            Assert.Same(entry2, target.CurrentEntry);\n\n            mockNavigationTarget.Verify(x => x.RequestNavigate(uri1, It.IsAny<Action<NavigationResult>>(), null), Times.Never());\n            mockNavigationTarget.Verify(x => x.RequestNavigate(uri2, It.IsAny<Action<NavigationResult>>(), null), Times.Once());\n            mockNavigationTarget.Verify(x => x.RequestNavigate(uri3, It.IsAny<Action<NavigationResult>>(), null), Times.Never());\n        }\n\n        [Fact]\n        public void GoBackDoesNotChangeStateWhenNavigationFails()\n        {\n            // Prepare\n            RegionNavigationJournal target = new RegionNavigationJournal();\n\n            Mock<INavigateAsync> mockNavigationTarget = new Mock<INavigateAsync>();\n            target.NavigationTarget = mockNavigationTarget.Object;\n\n            Uri uri1 = new Uri(\"Uri1\", UriKind.Relative);\n            RegionNavigationJournalEntry entry1 = new RegionNavigationJournalEntry() { Uri = uri1 };\n\n            Uri uri2 = new Uri(\"Uri2\", UriKind.Relative);\n            RegionNavigationJournalEntry entry2 = new RegionNavigationJournalEntry() { Uri = uri2 };\n\n            Uri uri3 = new Uri(\"Uri3\", UriKind.Relative);\n            RegionNavigationJournalEntry entry3 = new RegionNavigationJournalEntry() { Uri = uri3 };\n\n            target.RecordNavigation(entry1, true);\n            target.RecordNavigation(entry2, true);\n            target.RecordNavigation(entry3, true);\n\n\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri1, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri2, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, false)));\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri3, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n\n            // Act\n            target.GoBack();\n\n            // Verify\n            Assert.True(target.CanGoBack);\n            Assert.False(target.CanGoForward);\n            Assert.Same(entry3, target.CurrentEntry);\n\n            mockNavigationTarget.Verify(x => x.RequestNavigate(uri1, It.IsAny<Action<NavigationResult>>(), null), Times.Never());\n            mockNavigationTarget.Verify(x => x.RequestNavigate(uri2, It.IsAny<Action<NavigationResult>>(), null), Times.Once());\n            mockNavigationTarget.Verify(x => x.RequestNavigate(uri3, It.IsAny<Action<NavigationResult>>(), null), Times.Never());\n        }\n\n        [Fact]\n        public void GoBackMultipleTimesNavigatesBack()\n        {\n            // Prepare\n            RegionNavigationJournal target = new RegionNavigationJournal();\n\n            Mock<INavigateAsync> mockNavigationTarget = new Mock<INavigateAsync>();\n            target.NavigationTarget = mockNavigationTarget.Object;\n\n            Uri uri1 = new Uri(\"Uri1\", UriKind.Relative);\n            RegionNavigationJournalEntry entry1 = new RegionNavigationJournalEntry() { Uri = uri1 };\n\n            Uri uri2 = new Uri(\"Uri2\", UriKind.Relative);\n            RegionNavigationJournalEntry entry2 = new RegionNavigationJournalEntry() { Uri = uri2 };\n\n            Uri uri3 = new Uri(\"Uri3\", UriKind.Relative);\n            RegionNavigationJournalEntry entry3 = new RegionNavigationJournalEntry() { Uri = uri3 };\n\n            target.RecordNavigation(entry1, true);\n            target.RecordNavigation(entry2, true);\n            target.RecordNavigation(entry3, true);\n\n\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri1, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri2, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri3, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n\n            // Act\n            target.GoBack();\n            target.GoBack();\n\n            // Verify\n            Assert.False(target.CanGoBack);\n            Assert.True(target.CanGoForward);\n            Assert.Same(entry1, target.CurrentEntry);\n\n            mockNavigationTarget.Verify(x => x.RequestNavigate(uri1, It.IsAny<Action<NavigationResult>>(), null), Times.Once());\n            mockNavigationTarget.Verify(x => x.RequestNavigate(uri2, It.IsAny<Action<NavigationResult>>(), null), Times.Once());\n            mockNavigationTarget.Verify(x => x.RequestNavigate(uri3, It.IsAny<Action<NavigationResult>>(), null), Times.Never());\n        }\n\n        [Fact]\n        public void GoForwardNavigatesForward()\n        {\n            // Prepare\n            RegionNavigationJournal target = new RegionNavigationJournal();\n\n            Mock<INavigateAsync> mockNavigationTarget = new Mock<INavigateAsync>();\n            target.NavigationTarget = mockNavigationTarget.Object;\n\n            Uri uri1 = new Uri(\"Uri1\", UriKind.Relative);\n            RegionNavigationJournalEntry entry1 = new RegionNavigationJournalEntry() { Uri = uri1 };\n\n            Uri uri2 = new Uri(\"Uri2\", UriKind.Relative);\n            RegionNavigationJournalEntry entry2 = new RegionNavigationJournalEntry() { Uri = uri2 };\n\n            Uri uri3 = new Uri(\"Uri3\", UriKind.Relative);\n            RegionNavigationJournalEntry entry3 = new RegionNavigationJournalEntry() { Uri = uri3 };\n\n            target.RecordNavigation(entry1, true);\n            target.RecordNavigation(entry2, true);\n            target.RecordNavigation(entry3, true);\n\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri1, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri2, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri3, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n\n            target.GoBack();\n            target.GoBack();\n\n            // Act\n            target.GoForward();\n\n            // Verify\n            Assert.True(target.CanGoBack);\n            Assert.True(target.CanGoForward);\n            Assert.Same(entry2, target.CurrentEntry);\n\n            mockNavigationTarget.Verify(x => x.RequestNavigate(uri1, It.IsAny<Action<NavigationResult>>(), null), Times.Once());\n            mockNavigationTarget.Verify(x => x.RequestNavigate(uri2, It.IsAny<Action<NavigationResult>>(), null), Times.Exactly(2));\n            mockNavigationTarget.Verify(x => x.RequestNavigate(uri3, It.IsAny<Action<NavigationResult>>(), null), Times.Never());\n        }\n\n        [Fact]\n        public void GoForwardDoesNotChangeStateWhenNavigationFails()\n        {\n            // Prepare\n            RegionNavigationJournal target = new RegionNavigationJournal();\n\n            Mock<INavigateAsync> mockNavigationTarget = new Mock<INavigateAsync>();\n            target.NavigationTarget = mockNavigationTarget.Object;\n\n            Uri uri1 = new Uri(\"Uri1\", UriKind.Relative);\n            RegionNavigationJournalEntry entry1 = new RegionNavigationJournalEntry() { Uri = uri1 };\n\n            Uri uri2 = new Uri(\"Uri2\", UriKind.Relative);\n            RegionNavigationJournalEntry entry2 = new RegionNavigationJournalEntry() { Uri = uri2 };\n\n            Uri uri3 = new Uri(\"Uri3\", UriKind.Relative);\n            RegionNavigationJournalEntry entry3 = new RegionNavigationJournalEntry() { Uri = uri3 };\n\n            target.RecordNavigation(entry1, true);\n            target.RecordNavigation(entry2, true);\n            target.RecordNavigation(entry3, true);\n\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri1, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri2, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri3, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, false)));\n\n            target.GoBack();\n\n            // Act\n            target.GoForward();\n\n            // Verify\n            Assert.True(target.CanGoBack);\n            Assert.True(target.CanGoForward);\n            Assert.Same(entry2, target.CurrentEntry);\n\n            mockNavigationTarget.Verify(x => x.RequestNavigate(uri1, It.IsAny<Action<NavigationResult>>(), null), Times.Never());\n            mockNavigationTarget.Verify(x => x.RequestNavigate(uri2, It.IsAny<Action<NavigationResult>>(), null), Times.Once());\n            mockNavigationTarget.Verify(x => x.RequestNavigate(uri3, It.IsAny<Action<NavigationResult>>(), null), Times.Once());\n        }\n\n        [Fact]\n        public void GoForwardMultipleTimesNavigatesForward()\n        {\n            // Prepare\n            RegionNavigationJournal target = new RegionNavigationJournal();\n\n            Mock<INavigateAsync> mockNavigationTarget = new Mock<INavigateAsync>();\n            target.NavigationTarget = mockNavigationTarget.Object;\n\n            Uri uri1 = new Uri(\"Uri1\", UriKind.Relative);\n            RegionNavigationJournalEntry entry1 = new RegionNavigationJournalEntry() { Uri = uri1 };\n\n            Uri uri2 = new Uri(\"Uri2\", UriKind.Relative);\n            RegionNavigationJournalEntry entry2 = new RegionNavigationJournalEntry() { Uri = uri2 };\n\n            Uri uri3 = new Uri(\"Uri3\", UriKind.Relative);\n            RegionNavigationJournalEntry entry3 = new RegionNavigationJournalEntry() { Uri = uri3 };\n\n            target.RecordNavigation(entry1, true);\n            target.RecordNavigation(entry2, true);\n            target.RecordNavigation(entry3, true);\n\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri1, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri2, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri3, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n\n            target.GoBack();\n            target.GoBack();\n\n            // Act\n            target.GoForward();\n            target.GoForward();\n\n            // Verify\n            Assert.True(target.CanGoBack);\n            Assert.False(target.CanGoForward);\n            Assert.Same(entry3, target.CurrentEntry);\n\n            mockNavigationTarget.Verify(x => x.RequestNavigate(uri1, It.IsAny<Action<NavigationResult>>(), null), Times.Once());\n            mockNavigationTarget.Verify(x => x.RequestNavigate(uri2, It.IsAny<Action<NavigationResult>>(), null), Times.Exactly(2));\n            mockNavigationTarget.Verify(x => x.RequestNavigate(uri3, It.IsAny<Action<NavigationResult>>(), null), Times.Once());\n        }\n\n        [Fact]\n        public void WhenNavigationToNewUri_ThenCanNoLongerNavigateForward()\n        {\n            // Prepare\n            RegionNavigationJournal target = new RegionNavigationJournal();\n\n            Mock<INavigateAsync> mockNavigationTarget = new Mock<INavigateAsync>();\n            target.NavigationTarget = mockNavigationTarget.Object;\n\n            Uri uri1 = new Uri(\"Uri1\", UriKind.Relative);\n            RegionNavigationJournalEntry entry1 = new RegionNavigationJournalEntry() { Uri = uri1 };\n\n            Uri uri2 = new Uri(\"Uri2\", UriKind.Relative);\n            RegionNavigationJournalEntry entry2 = new RegionNavigationJournalEntry() { Uri = uri2 };\n\n            Uri uri3 = new Uri(\"Uri3\", UriKind.Relative);\n            RegionNavigationJournalEntry entry3 = new RegionNavigationJournalEntry() { Uri = uri3 };\n\n            Uri uri4 = new Uri(\"Uri4\", UriKind.Relative);\n            RegionNavigationJournalEntry entry4 = new RegionNavigationJournalEntry() { Uri = uri4 };\n\n            target.RecordNavigation(entry1, true);\n            target.RecordNavigation(entry2, true);\n\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri1, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri2, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri3, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n\n            target.GoBack();\n\n            Assert.True(target.CanGoForward);\n\n            // Act\n            target.RecordNavigation(entry3, true);\n\n            // Verify\n            Assert.False(target.CanGoForward);\n            Assert.Equal(entry3, target.CurrentEntry);\n        }\n\n        [Fact]\n        public void WhenSavePreviousFalseDoNotRecordEntry()\n        {\n            // Prepare\n            RegionNavigationJournal target = new RegionNavigationJournal();\n\n            Mock<INavigateAsync> mockNavigationTarget = new Mock<INavigateAsync>();\n            target.NavigationTarget = mockNavigationTarget.Object;\n\n            Uri uri1 = new Uri(\"Uri1\", UriKind.Relative);\n            RegionNavigationJournalEntry entry1 = new RegionNavigationJournalEntry() { Uri = uri1 };\n\n            Uri uri2 = new Uri(\"Uri2\", UriKind.Relative);\n            RegionNavigationJournalEntry entry2 = new RegionNavigationJournalEntry() { Uri = uri2 };\n\n            Uri uri3 = new Uri(\"Uri3\", UriKind.Relative);\n            RegionNavigationJournalEntry entry3 = new RegionNavigationJournalEntry() { Uri = uri3 };\n\n            Uri uri4 = new Uri(\"Uri4\", UriKind.Relative);\n            RegionNavigationJournalEntry entry4 = new RegionNavigationJournalEntry() { Uri = uri4 };\n\n            target.RecordNavigation(entry1, true);\n            target.RecordNavigation(entry2, true);\n            target.RecordNavigation(entry3, false);\n            target.RecordNavigation(entry4, true);\n\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri1, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri2, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri3, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n            mockNavigationTarget\n                .Setup(x => x.RequestNavigate(uri4, It.IsAny<Action<NavigationResult>>(), null))\n                .Callback<Uri, Action<NavigationResult>, INavigationParameters>((u, c, n) => c(new NavigationResult(null, true)));\n\n            Assert.Equal(entry4, target.CurrentEntry);\n\n            target.GoBack();\n\n            Assert.True(target.CanGoBack);\n            Assert.True(target.CanGoForward);\n            Assert.Same(entry2, target.CurrentEntry);\n\n            mockNavigationTarget.Verify(x => x.RequestNavigate(uri1, It.IsAny<Action<NavigationResult>>(), null), Times.Never());\n            mockNavigationTarget.Verify(x => x.RequestNavigate(uri2, It.IsAny<Action<NavigationResult>>(), null), Times.Once());\n            mockNavigationTarget.Verify(x => x.RequestNavigate(uri3, It.IsAny<Action<NavigationResult>>(), null), Times.Never());\n            mockNavigationTarget.Verify(x => x.RequestNavigate(uri4, It.IsAny<Action<NavigationResult>>(), null), Times.Never());\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Regions/RegionNavigationServiceFixture.new.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Windows;\nusing Moq;\nusing Prism.Ioc;\nusing Prism.Navigation;\nusing Prism.Navigation.Regions;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Regions\n{\n    public class RegionNavigationServiceFixture\n    {\n        [Fact]\n        public void WhenNavigating_ViewIsActivated()\n        {\n            // Prepare\n            object view = new object();\n            Uri viewUri = new Uri(view.GetType().Name, UriKind.Relative);\n\n            IRegion region = new Region();\n            region.Add(view);\n\n            string regionName = \"RegionName\";\n            RegionManager regionManager = new RegionManager();\n            regionManager.Regions.Add(regionName, region);\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(new RegionNavigationJournalEntry());\n\n            var container = containerMock.Object;\n            RegionNavigationContentLoader contentLoader = new RegionNavigationContentLoader(container);\n            IRegionNavigationJournal journal = new Mock<IRegionNavigationJournal>().Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            // Act\n            bool isNavigationSuccessful = false;\n            target.RequestNavigate(viewUri, nr => isNavigationSuccessful = nr.Success == true);\n\n            // Verify\n            Assert.True(isNavigationSuccessful);\n            bool isViewActive = region.ActiveViews.Contains(view);\n            Assert.True(isViewActive);\n        }\n\n        [Fact]\n        public void WhenNavigatingWithQueryString_ViewIsActivated()\n        {\n            // Prepare\n            object view = new object();\n            Uri viewUri = new Uri(view.GetType().Name + \"?MyQuery=true\", UriKind.Relative);\n\n            IRegion region = new Region();\n            region.Add(view);\n\n            string regionName = \"RegionName\";\n            RegionManager regionManager = new RegionManager();\n            regionManager.Regions.Add(regionName, region);\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(new RegionNavigationJournalEntry());\n\n            IContainerExtension container = containerMock.Object;\n            RegionNavigationContentLoader contentLoader = new RegionNavigationContentLoader(container);\n            IRegionNavigationJournal journal = new Mock<IRegionNavigationJournal>().Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            // Act\n            bool isNavigationSuccessful = false;\n            target.RequestNavigate(viewUri, nr => isNavigationSuccessful = nr.Success == true);\n\n            // Verify\n            Assert.True(isNavigationSuccessful);\n            bool isViewActive = region.ActiveViews.Contains(view);\n            Assert.True(isViewActive);\n        }\n\n        [Fact]\n        public void WhenNavigatingAndViewCannotBeAcquired_ThenNavigationResultHasError()\n        {\n            // Prepare\n            object view = new object();\n            Uri viewUri = new Uri(view.GetType().Name, UriKind.Relative);\n\n            IRegion region = new Region();\n            region.Add(view);\n\n            string otherType = \"OtherType\";\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(new RegionNavigationJournalEntry());\n            IContainerExtension container = containerMock.Object;\n\n            Mock<IRegionNavigationContentLoader> targetHandlerMock = new Mock<IRegionNavigationContentLoader>();\n            targetHandlerMock.Setup(th => th.LoadContent(It.IsAny<IRegion>(), It.IsAny<NavigationContext>())).Throws<ArgumentException>();\n\n            IRegionNavigationJournal journal = new Mock<IRegionNavigationJournal>().Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, targetHandlerMock.Object, journal)\n            {\n                Region = region\n            };\n\n            // Act\n            Exception error = null;\n            target.RequestNavigate(\n                new Uri(otherType.GetType().Name, UriKind.Relative),\n                nr =>\n                {\n                    error = nr.Exception;\n                });\n\n            // Verify\n            bool isViewActive = region.ActiveViews.Contains(view);\n            Assert.False(isViewActive);\n            Assert.IsType<ArgumentException>(error);\n        }\n\n        [Fact]\n        public void WhenNavigatingWithNullUri_Throws()\n        {\n            // Prepare\n            IRegion region = new Region();\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(new RegionNavigationJournalEntry());\n\n            IContainerExtension container = containerMock.Object;\n            RegionNavigationContentLoader contentLoader = new Mock<RegionNavigationContentLoader>(container).Object;\n            IRegionNavigationJournal journal = new Mock<IRegionNavigationJournal>().Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            // Act\n            NavigationResult navigationResult = null;\n            target.RequestNavigate((Uri)null, nr => navigationResult = nr);\n\n            // Verify\n            Assert.False(navigationResult.Success);\n            Assert.NotNull(navigationResult.Exception);\n            Assert.IsType<ArgumentNullException>(navigationResult.Exception);\n        }\n\n        [Fact]\n        public void WhenNavigatingAndViewImplementsINavigationAware_ThenNavigatedIsInvokedOnNavigation()\n        {\n            // Prepare\n            var region = new Region();\n\n            var viewMock = new Mock<INavigationAware>();\n            viewMock.Setup(ina => ina.IsNavigationTarget(It.IsAny<NavigationContext>())).Returns(true);\n            var view = viewMock.Object;\n            region.Add(view);\n\n            var navigationUri = new Uri(view.GetType().Name, UriKind.Relative);\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(new RegionNavigationJournalEntry());\n\n            IContainerExtension container = containerMock.Object;\n            RegionNavigationContentLoader contentLoader = new RegionNavigationContentLoader(container);\n            IRegionNavigationJournal journal = new Mock<IRegionNavigationJournal>().Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            // Act\n            target.RequestNavigate(navigationUri, nr => { });\n\n            // Verify\n            viewMock.Verify(v => v.OnNavigatedTo(It.Is<NavigationContext>(nc => nc.Uri == navigationUri && nc.NavigationService == target)));\n        }\n\n        [StaFact]\n        public void WhenNavigatingAndDataContextImplementsINavigationAware_ThenNavigatedIsInvokesOnNavigation()\n        {\n            // Prepare\n            var region = new Region();\n\n            Mock<FrameworkElement> mockFrameworkElement = new Mock<FrameworkElement>();\n            Mock<INavigationAware> mockINavigationAwareDataContext = new Mock<INavigationAware>();\n            mockINavigationAwareDataContext.Setup(ina => ina.IsNavigationTarget(It.IsAny<NavigationContext>())).Returns(true);\n            mockFrameworkElement.Object.DataContext = mockINavigationAwareDataContext.Object;\n\n            var view = mockFrameworkElement.Object;\n            region.Add(view);\n\n            var navigationUri = new Uri(view.GetType().Name, UriKind.Relative);\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(new RegionNavigationJournalEntry());\n\n            IContainerExtension container = containerMock.Object;\n            RegionNavigationContentLoader contentLoader = new RegionNavigationContentLoader(container);\n            IRegionNavigationJournal journal = new Mock<IRegionNavigationJournal>().Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            // Act\n            target.RequestNavigate(navigationUri, nr => { });\n\n            // Verify\n            mockINavigationAwareDataContext.Verify(v => v.OnNavigatedTo(It.Is<NavigationContext>(nc => nc.Uri == navigationUri)));\n        }\n\n        [StaFact]\n        public void WhenNavigatingAndBothViewAndDataContextImplementINavigationAware_ThenNavigatedIsInvokesOnNavigation()\n        {\n            // Prepare\n            var region = new Region();\n\n            Mock<FrameworkElement> mockFrameworkElement = new Mock<FrameworkElement>();\n            Mock<INavigationAware> mockINavigationAwareView = mockFrameworkElement.As<INavigationAware>();\n            mockINavigationAwareView.Setup(ina => ina.IsNavigationTarget(It.IsAny<NavigationContext>())).Returns(true);\n\n            Mock<INavigationAware> mockINavigationAwareDataContext = new Mock<INavigationAware>();\n            mockINavigationAwareDataContext.Setup(ina => ina.IsNavigationTarget(It.IsAny<NavigationContext>())).Returns(true);\n            mockFrameworkElement.Object.DataContext = mockINavigationAwareDataContext.Object;\n\n            var view = mockFrameworkElement.Object;\n            region.Add(view);\n\n            var navigationUri = new Uri(view.GetType().Name, UriKind.Relative);\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(new RegionNavigationJournalEntry());\n\n            IContainerExtension container = containerMock.Object;\n            RegionNavigationContentLoader contentLoader = new RegionNavigationContentLoader(container);\n            IRegionNavigationJournal journal = new Mock<IRegionNavigationJournal>().Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            // Act\n            target.RequestNavigate(navigationUri, nr => { });\n\n            // Verify\n            mockINavigationAwareView.Verify(v => v.OnNavigatedTo(It.Is<NavigationContext>(nc => nc.Uri == navigationUri)));\n            mockINavigationAwareDataContext.Verify(v => v.OnNavigatedTo(It.Is<NavigationContext>(nc => nc.Uri == navigationUri)));\n        }\n\n        [Fact]\n        public void WhenNavigating_NavigationIsRecordedInJournal()\n        {\n            // Prepare\n            object view = new object();\n            Uri viewUri = new Uri(view.GetType().Name, UriKind.Relative);\n\n            IRegion region = new Region();\n            region.Add(view);\n\n            string regionName = \"RegionName\";\n            RegionManager regionManager = new RegionManager();\n            regionManager.Regions.Add(regionName, region);\n\n            IRegionNavigationJournalEntry journalEntry = new RegionNavigationJournalEntry();\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(journalEntry);\n\n            IContainerExtension container = containerMock.Object;\n            ContainerLocator.SetContainerExtension(container);\n            RegionNavigationContentLoader contentLoader = new RegionNavigationContentLoader(container);\n\n            var journalMock = new Mock<IRegionNavigationJournal>();\n            journalMock.Setup(x => x.RecordNavigation(journalEntry, true)).Verifiable();\n\n            IRegionNavigationJournal journal = journalMock.Object;\n\n\n            RegionNavigationService target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            // Act\n            target.RequestNavigate(viewUri, nr => { });\n\n            // Verify\n            Assert.NotNull(journalEntry);\n            Assert.Equal(viewUri, journalEntry.Uri);\n            journalMock.VerifyAll();\n        }\n\n        [Fact]\n        public void WhenNavigatingAndCurrentlyActiveViewImplementsINavigateWithVeto_ThenNavigationRequestQueriesForVeto()\n        {\n            // Prepare\n            var region = new Region();\n\n            var viewMock = new Mock<IConfirmNavigationRequest>();\n            viewMock\n                .Setup(ina => ina.ConfirmNavigationRequest(It.IsAny<NavigationContext>(), It.IsAny<Action<bool>>()))\n                .Verifiable();\n\n            var view = viewMock.Object;\n            region.Add(view);\n            region.Activate(view);\n\n            var navigationUri = new Uri(view.GetType().Name, UriKind.Relative);\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(new RegionNavigationJournalEntry());\n\n            IContainerExtension container = containerMock.Object;\n            RegionNavigationContentLoader contentLoader = new Mock<RegionNavigationContentLoader>(container).Object;\n            IRegionNavigationJournal journal = new Mock<IRegionNavigationJournal>().Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            // Act\n            target.RequestNavigate(navigationUri, nr => { });\n\n            // Verify\n            viewMock.VerifyAll();\n        }\n\n        [Fact]\n        public void WhenNavigating_ThenNavigationRequestQueriesForVetoOnAllActiveViewsIfAllSucceed()\n        {\n            // Prepare\n            var region = new Region();\n\n            var view1Mock = new Mock<IConfirmNavigationRequest>();\n            view1Mock\n                .Setup(ina => ina.ConfirmNavigationRequest(It.IsAny<NavigationContext>(), It.IsAny<Action<bool>>()))\n                .Callback<NavigationContext, Action<bool>>((nc, c) => c(true))\n                .Verifiable();\n\n            var view1 = view1Mock.Object;\n            region.Add(view1);\n            region.Activate(view1);\n\n            var view2Mock = new Mock<IConfirmNavigationRequest>();\n\n            var view2 = view2Mock.Object;\n            region.Add(view2);\n\n            var view3Mock = new Mock<INavigationAware>();\n\n            var view3 = view3Mock.Object;\n            region.Add(view3);\n            region.Activate(view3);\n\n            var view4Mock = new Mock<IConfirmNavigationRequest>();\n            view4Mock\n                .Setup(ina => ina.ConfirmNavigationRequest(It.IsAny<NavigationContext>(), It.IsAny<Action<bool>>()))\n                .Callback<NavigationContext, Action<bool>>((nc, c) => c(true))\n                .Verifiable();\n\n            var view4 = view4Mock.Object;\n            region.Add(view4);\n            region.Activate(view4);\n\n            var navigationUri = new Uri(view1.GetType().Name, UriKind.Relative);\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(new RegionNavigationJournalEntry());\n\n            IContainerExtension container = containerMock.Object;\n            RegionNavigationContentLoader contentLoader = new Mock<RegionNavigationContentLoader>(container).Object;\n            IRegionNavigationJournal journal = new Mock<IRegionNavigationJournal>().Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            // Act\n            target.RequestNavigate(navigationUri, nr => { });\n\n            // Verify\n            view1Mock.VerifyAll();\n            view2Mock.Verify(ina => ina.ConfirmNavigationRequest(It.IsAny<NavigationContext>(), It.IsAny<Action<bool>>()), Times.Never());\n            view3Mock.VerifyAll();\n            view4Mock.VerifyAll();\n        }\n\n        [Fact]\n        public void WhenRequestNavigateAwayAcceptsThroughCallback_ThenNavigationProceeds()\n        {\n            // Prepare\n            var region = new Region();\n\n            var view1Mock = new Mock<IConfirmNavigationRequest>();\n            view1Mock\n                .Setup(ina => ina.ConfirmNavigationRequest(It.IsAny<NavigationContext>(), It.IsAny<Action<bool>>()))\n                .Callback<NavigationContext, Action<bool>>((nc, c) => c(true))\n                .Verifiable();\n\n            var view1 = view1Mock.Object;\n\n            var view2 = new object();\n\n            region.Add(view1);\n            region.Add(view2);\n\n            region.Activate(view1);\n\n            var navigationUri = new Uri(view2.GetType().Name, UriKind.Relative);\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(new RegionNavigationJournalEntry());\n\n            IContainerExtension container = containerMock.Object;\n            RegionNavigationContentLoader contentLoader = new RegionNavigationContentLoader(container);\n            IRegionNavigationJournal journal = new Mock<IRegionNavigationJournal>().Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            // Act\n            var navigationSucceeded = false;\n            target.RequestNavigate(navigationUri, nr => { navigationSucceeded = nr.Success == true; });\n\n            // Verify\n            view1Mock.VerifyAll();\n            Assert.True(navigationSucceeded);\n            Assert.Equal(new object[] { view1, view2 }, region.ActiveViews.ToArray());\n        }\n\n        [Fact]\n        public void WhenRequestNavigateAwayRejectsThroughCallback_ThenNavigationDoesNotProceed()\n        {\n            // Prepare\n            var region = new Region();\n\n            var view1Mock = new Mock<IConfirmNavigationRequest>();\n            view1Mock\n                .Setup(ina => ina.ConfirmNavigationRequest(It.IsAny<NavigationContext>(), It.IsAny<Action<bool>>()))\n                .Callback<NavigationContext, Action<bool>>((nc, c) => c(false))\n                .Verifiable();\n\n            var view1 = view1Mock.Object;\n\n            var view2 = new object();\n\n            region.Add(view1);\n            region.Add(view2);\n\n            region.Activate(view1);\n\n            var navigationUri = new Uri(view2.GetType().Name, UriKind.Relative);\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(new RegionNavigationJournalEntry());\n\n            IContainerExtension container = containerMock.Object;\n            RegionNavigationContentLoader contentLoader = new Mock<RegionNavigationContentLoader>(container).Object;\n            IRegionNavigationJournal journal = new Mock<IRegionNavigationJournal>().Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            // Act\n            var navigationFailed = false;\n            target.RequestNavigate(navigationUri, nr => { navigationFailed = nr.Success == false; });\n\n            // Verify\n            view1Mock.VerifyAll();\n            Assert.True(navigationFailed);\n            Assert.Equal(new object[] { view1 }, region.ActiveViews.ToArray());\n        }\n\n        [StaFact]\n        public void WhenNavigatingAndDataContextOnCurrentlyActiveViewImplementsINavigateWithVeto_ThenNavigationRequestQueriesForVeto()\n        {\n            // Prepare\n            var region = new Region();\n\n            var viewModelMock = new Mock<IConfirmNavigationRequest>();\n            viewModelMock\n                .Setup(ina => ina.ConfirmNavigationRequest(It.IsAny<NavigationContext>(), It.IsAny<Action<bool>>()))\n                .Verifiable();\n\n            var viewMock = new Mock<FrameworkElement>();\n\n            var view = viewMock.Object;\n            view.DataContext = viewModelMock.Object;\n\n            region.Add(view);\n            region.Activate(view);\n\n            var navigationUri = new Uri(view.GetType().Name, UriKind.Relative);\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(new RegionNavigationJournalEntry());\n\n            IContainerExtension container = containerMock.Object;\n            RegionNavigationContentLoader contentLoader = new Mock<RegionNavigationContentLoader>(container).Object;\n            IRegionNavigationJournal journal = new Mock<IRegionNavigationJournal>().Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            // Act\n            target.RequestNavigate(navigationUri, nr => { });\n\n            // Verify\n            viewModelMock.VerifyAll();\n        }\n\n        [StaFact]\n        public void WhenRequestNavigateAwayOnDataContextAcceptsThroughCallback_ThenNavigationProceeds()\n        {\n            // Prepare\n            var region = new Region();\n\n            var view1DataContextMock = new Mock<IConfirmNavigationRequest>();\n            view1DataContextMock\n                .Setup(ina => ina.ConfirmNavigationRequest(It.IsAny<NavigationContext>(), It.IsAny<Action<bool>>()))\n                .Callback<NavigationContext, Action<bool>>((nc, c) => c(true))\n                .Verifiable();\n\n            var view1Mock = new Mock<FrameworkElement>();\n            var view1 = view1Mock.Object;\n            view1.DataContext = view1DataContextMock.Object;\n\n            var view2 = new object();\n\n            region.Add(view1);\n            region.Add(view2);\n\n            region.Activate(view1);\n\n            var navigationUri = new Uri(view2.GetType().Name, UriKind.Relative);\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(new RegionNavigationJournalEntry());\n\n            IContainerExtension container = containerMock.Object;\n            RegionNavigationContentLoader contentLoader = new RegionNavigationContentLoader(container);\n            IRegionNavigationJournal journal = new Mock<IRegionNavigationJournal>().Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            // Act\n            var navigationSucceeded = false;\n            target.RequestNavigate(navigationUri, nr => { navigationSucceeded = nr.Success == true; });\n\n            // Verify\n            view1DataContextMock.VerifyAll();\n            Assert.True(navigationSucceeded);\n            Assert.Equal(new object[] { view1, view2 }, region.ActiveViews.ToArray());\n        }\n\n        [StaFact]\n        public void WhenRequestNavigateAwayOnDataContextRejectsThroughCallback_ThenNavigationDoesNotProceed()\n        {\n            // Prepare\n            var region = new Region();\n\n            var view1DataContextMock = new Mock<IConfirmNavigationRequest>();\n            view1DataContextMock\n                .Setup(ina => ina.ConfirmNavigationRequest(It.IsAny<NavigationContext>(), It.IsAny<Action<bool>>()))\n                .Callback<NavigationContext, Action<bool>>((nc, c) => c(false))\n                .Verifiable();\n\n            var view1Mock = new Mock<FrameworkElement>();\n            var view1 = view1Mock.Object;\n            view1.DataContext = view1DataContextMock.Object;\n\n            var view2 = new object();\n\n            region.Add(view1);\n            region.Add(view2);\n\n            region.Activate(view1);\n\n            var navigationUri = new Uri(view2.GetType().Name, UriKind.Relative);\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(new RegionNavigationJournalEntry());\n\n            IContainerExtension container = containerMock.Object;\n            RegionNavigationContentLoader contentLoader = new Mock<RegionNavigationContentLoader>(container).Object;\n            IRegionNavigationJournal journal = new Mock<IRegionNavigationJournal>().Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            // Act\n            var navigationFailed = false;\n            target.RequestNavigate(navigationUri, nr => { navigationFailed = nr.Success == false; });\n\n            // Verify\n            view1DataContextMock.VerifyAll();\n            Assert.True(navigationFailed);\n            Assert.Equal(new object[] { view1 }, region.ActiveViews.ToArray());\n        }\n\n        [Fact]\n        public void WhenViewAcceptsNavigationOutAfterNewIncomingRequestIsReceived_ThenOriginalRequestIsIgnored()\n        {\n            var region = new Region();\n\n            var viewMock = new Mock<IConfirmNavigationRequest>();\n            var view = viewMock.Object;\n\n            var confirmationRequests = new List<Action<bool>>();\n\n            viewMock\n                .Setup(icnr => icnr.ConfirmNavigationRequest(It.IsAny<NavigationContext>(), It.IsAny<Action<bool>>()))\n                .Callback<NavigationContext, Action<bool>>((nc, c) => { confirmationRequests.Add(c); });\n\n            region.Add(view);\n            region.Activate(view);\n\n            var navigationUri = new Uri(\"\", UriKind.Relative);\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock\n                .Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry)))\n                .Returns(new RegionNavigationJournalEntry());\n\n            var contentLoaderMock = new Mock<IRegionNavigationContentLoader>();\n            contentLoaderMock\n                .Setup(cl => cl.LoadContent(region, It.IsAny<NavigationContext>()))\n                .Returns(view);\n\n            var container = containerMock.Object;\n            var contentLoader = contentLoaderMock.Object;\n            var journal = new Mock<IRegionNavigationJournal>().Object;\n\n            var target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            bool firstNavigation = false;\n            bool secondNavigation = false;\n            target.RequestNavigate(navigationUri, nr => firstNavigation = nr.Success);\n            target.RequestNavigate(navigationUri, nr => secondNavigation = nr.Success);\n\n            Assert.Equal(2, confirmationRequests.Count);\n\n            confirmationRequests[0](true);\n            confirmationRequests[1](true);\n\n            Assert.False(firstNavigation);\n            Assert.True(secondNavigation);\n        }\n\n        [StaFact]\n        public void WhenViewModelAcceptsNavigationOutAfterNewIncomingRequestIsReceived_ThenOriginalRequestIsIgnored()\n        {\n            var region = new Region();\n\n            var viewModelMock = new Mock<IConfirmNavigationRequest>();\n\n            var viewMock = new Mock<FrameworkElement>();\n            var view = viewMock.Object;\n            view.DataContext = viewModelMock.Object;\n\n            var confirmationRequests = new List<Action<bool>>();\n\n            viewModelMock\n                .Setup(icnr => icnr.ConfirmNavigationRequest(It.IsAny<NavigationContext>(), It.IsAny<Action<bool>>()))\n                .Callback<NavigationContext, Action<bool>>((nc, c) => { confirmationRequests.Add(c); });\n\n            region.Add(view);\n            region.Activate(view);\n\n            var navigationUri = new Uri(\"\", UriKind.Relative);\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock\n                .Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry)))\n                .Returns(new RegionNavigationJournalEntry());\n\n            var contentLoaderMock = new Mock<IRegionNavigationContentLoader>();\n            contentLoaderMock\n                .Setup(cl => cl.LoadContent(region, It.IsAny<NavigationContext>()))\n                .Returns(view);\n\n            var container = containerMock.Object;\n            var contentLoader = contentLoaderMock.Object;\n            var journal = new Mock<IRegionNavigationJournal>().Object;\n\n            var target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            bool firstNavigation = false;\n            bool secondNavigation = false;\n            target.RequestNavigate(navigationUri, nr => firstNavigation = nr.Success);\n            target.RequestNavigate(navigationUri, nr => secondNavigation = nr.Success);\n\n            Assert.Equal(2, confirmationRequests.Count);\n\n            confirmationRequests[0](true);\n            confirmationRequests[1](true);\n\n            Assert.False(firstNavigation);\n            Assert.True(secondNavigation);\n        }\n\n        [Fact]\n        public void BeforeNavigating_NavigatingEventIsRaised()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            // Prepare\n            object view = new object();\n            Uri viewUri = new Uri(view.GetType().Name, UriKind.Relative);\n\n            IRegion region = new Region();\n            region.Add(view);\n\n            string regionName = \"RegionName\";\n            RegionManager regionManager = new RegionManager();\n            regionManager.Regions.Add(regionName, region);\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(new RegionNavigationJournalEntry());\n\n            IContainerExtension container = containerMock.Object;\n            RegionNavigationContentLoader contentLoader = new RegionNavigationContentLoader(container);\n            IRegionNavigationJournal journal = new Mock<IRegionNavigationJournal>().Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            bool isNavigatingRaised = false;\n            target.Navigating += delegate (object sender, RegionNavigationEventArgs e)\n            {\n                if (sender == target)\n                {\n                    isNavigatingRaised = true;\n                }\n            };\n\n            // Act\n            bool isNavigationSuccessful = false;\n            target.RequestNavigate(viewUri, nr => isNavigationSuccessful = nr.Success == true);\n\n            // Verify\n            Assert.True(isNavigationSuccessful);\n            Assert.True(isNavigatingRaised);\n        }\n\n        [Fact]\n        public void WhenNavigationSucceeds_NavigatedIsRaised()\n        {\n            // Prepare\n            object view = new object();\n            Uri viewUri = new Uri(view.GetType().Name, UriKind.Relative);\n\n            IRegion region = new Region();\n            region.Add(view);\n\n            string regionName = \"RegionName\";\n            RegionManager regionManager = new RegionManager();\n            regionManager.Regions.Add(regionName, region);\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(new RegionNavigationJournalEntry());\n\n            IContainerExtension container = containerMock.Object;\n            RegionNavigationContentLoader contentLoader = new RegionNavigationContentLoader(container);\n            IRegionNavigationJournal journal = new Mock<IRegionNavigationJournal>().Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            bool isNavigatedRaised = false;\n            target.Navigated += delegate (object sender, RegionNavigationEventArgs e)\n            {\n                if (sender == target)\n                {\n                    isNavigatedRaised = true;\n                }\n            };\n\n            // Act\n            bool isNavigationSuccessful = false;\n            target.RequestNavigate(viewUri, nr => isNavigationSuccessful = nr.Success == true);\n\n            // Verify\n            Assert.True(isNavigationSuccessful);\n            Assert.True(isNavigatedRaised);\n        }\n\n        [Fact]\n        public void WhenTargetViewCreationThrowsWithAsyncConfirmation_ThenExceptionIsProvidedToNavigationCallback()\n        {\n            var containerMock = new Mock<IContainerExtension>();\n\n            var targetException = new Exception();\n            var targetHandlerMock = new Mock<IRegionNavigationContentLoader>();\n            targetHandlerMock\n                .Setup(th => th.LoadContent(It.IsAny<IRegion>(), It.IsAny<NavigationContext>()))\n                .Throws(targetException);\n\n            var journalMock = new Mock<IRegionNavigationJournal>();\n\n            Action<bool> navigationCallback = null;\n            var viewMock = new Mock<IConfirmNavigationRequest>();\n            viewMock\n                .Setup(v => v.ConfirmNavigationRequest(It.IsAny<NavigationContext>(), It.IsAny<Action<bool>>()))\n                .Callback<NavigationContext, Action<bool>>((nc, c) => { navigationCallback = c; });\n\n            var region = new Region();\n            region.Add(viewMock.Object);\n            region.Activate(viewMock.Object);\n\n            var target = new RegionNavigationService(containerMock.Object, targetHandlerMock.Object, journalMock.Object)\n            {\n                Region = region\n            };\n\n            NavigationResult result = null;\n            target.RequestNavigate(new Uri(\"\", UriKind.Relative), nr => result = nr);\n            navigationCallback(true);\n\n            Assert.NotNull(result);\n            Assert.Same(targetException, result.Exception);\n        }\n\n        [Fact]\n        public void WhenNavigatingFromViewThatIsNavigationAware_ThenNotifiesActiveViewNavigatingFrom()\n        {\n            // Arrange\n            var region = new Region();\n            var viewMock = new Mock<INavigationAware>();\n            var view = viewMock.Object;\n            region.Add(view);\n\n            var view2 = new object();\n            region.Add(view2);\n\n            region.Activate(view);\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(new RegionNavigationJournalEntry());\n\n            var navigationUri = new Uri(view2.GetType().Name, UriKind.Relative);\n            IContainerExtension container = containerMock.Object;\n            RegionNavigationContentLoader contentLoader = new Mock<RegionNavigationContentLoader>(container).Object;\n            IRegionNavigationJournal journal = new Mock<IRegionNavigationJournal>().Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            // Act\n            target.RequestNavigate(navigationUri, nr => { });\n\n            // Verify\n            viewMock.Verify(v => v.OnNavigatedFrom(It.Is<NavigationContext>(ctx => ctx.Uri == navigationUri && ctx.Parameters.Count() == 0)));\n        }\n\n        [Fact]\n        public void WhenNavigationFromViewThatIsNavigationAware_OnlyNotifiesOnNavigateFromForActiveViews()\n        {\n            // Arrange\n\n            bool navigationFromInvoked = false;\n\n            var region = new Region();\n\n            var viewMock = new Mock<INavigationAware>();\n            viewMock\n                .Setup(x => x.OnNavigatedFrom(It.IsAny<NavigationContext>())).Callback(() => navigationFromInvoked = true);\n            var view = viewMock.Object;\n            region.Add(view);\n\n            var targetViewMock = new Mock<INavigationAware>();\n            region.Add(targetViewMock.Object);\n\n            var activeViewMock = new Mock<INavigationAware>();\n            region.Add(activeViewMock.Object);\n\n            region.Activate(activeViewMock.Object);\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(new RegionNavigationJournalEntry());\n\n            var navigationUri = new Uri(targetViewMock.Object.GetType().Name, UriKind.Relative);\n            IContainerExtension container = containerMock.Object;\n            RegionNavigationContentLoader contentLoader = new Mock<RegionNavigationContentLoader>(container).Object;\n            IRegionNavigationJournal journal = new Mock<IRegionNavigationJournal>().Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            // Act\n            target.RequestNavigate(navigationUri, nr => { });\n\n            // Verify\n            Assert.False(navigationFromInvoked);\n        }\n\n        [StaFact]\n        public void WhenNavigatingFromActiveViewWithNavigatinAwareDataConext_NotifiesContextOfNavigatingFrom()\n        {\n            // Arrange\n            var region = new Region();\n\n            var mockDataContext = new Mock<INavigationAware>();\n\n            var view1Mock = new Mock<FrameworkElement>();\n            var view1 = view1Mock.Object;\n            view1.DataContext = mockDataContext.Object;\n\n            region.Add(view1);\n\n            var view2 = new object();\n            region.Add(view2);\n\n            region.Activate(view1);\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(new RegionNavigationJournalEntry());\n\n            var navigationUri = new Uri(view2.GetType().Name, UriKind.Relative);\n            IContainerExtension container = containerMock.Object;\n            RegionNavigationContentLoader contentLoader = new Mock<RegionNavigationContentLoader>(container).Object;\n            IRegionNavigationJournal journal = new Mock<IRegionNavigationJournal>().Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            // Act\n            target.RequestNavigate(navigationUri, nr => { });\n\n            // Verify\n            mockDataContext.Verify(v => v.OnNavigatedFrom(It.Is<NavigationContext>(ctx => ctx.Uri == navigationUri && ctx.Parameters.Count() == 0)));\n        }\n\n        [Fact]\n        public void WhenNavigatingWithNullCallback_ThenThrows()\n        {\n            var region = new Region();\n\n            var navigationUri = new Uri(\"/\", UriKind.Relative);\n            IContainerExtension container = new Mock<IContainerExtension>().Object;\n            RegionNavigationContentLoader contentLoader = new Mock<RegionNavigationContentLoader>(container).Object;\n            IRegionNavigationJournal journal = new Mock<IRegionNavigationJournal>().Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            ExceptionAssert.Throws<ArgumentNullException>(\n                () =>\n                {\n                    target.RequestNavigate(navigationUri, null);\n                });\n        }\n\n        [Fact]\n        public void WhenNavigatingWithNoRegionSet_ThenMarshallExceptionToCallback()\n        {\n            var navigationUri = new Uri(\"/\", UriKind.Relative);\n            IContainerExtension container = new Mock<IContainerExtension>().Object;\n            RegionNavigationContentLoader contentLoader = new Mock<RegionNavigationContentLoader>(container).Object;\n            IRegionNavigationJournal journal = new Mock<IRegionNavigationJournal>().Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, contentLoader, journal);\n\n            Exception error = null;\n            target.RequestNavigate(navigationUri, nr => error = nr.Exception);\n\n            Assert.NotNull(error);\n            Assert.IsType<InvalidOperationException>(error);\n        }\n\n        [Fact]\n        public void WhenNavigatingWithNullUri_ThenMarshallExceptionToCallback()\n        {\n            IContainerExtension container = new Mock<IContainerExtension>().Object;\n            RegionNavigationContentLoader contentLoader = new Mock<RegionNavigationContentLoader>(container).Object;\n            IRegionNavigationJournal journal = new Mock<IRegionNavigationJournal>().Object;\n\n            RegionNavigationService target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = new Region()\n            };\n\n            Exception error = null;\n            target.RequestNavigate(null, nr => error = nr.Exception);\n\n            Assert.NotNull(error);\n            Assert.IsType<ArgumentNullException>(error);\n        }\n\n\n        [Fact]\n        public void WhenNavigationFailsBecauseTheContentViewCannotBeRetrieved_ThenNavigationFailedIsRaised()\n        {\n            // Prepare\n            var region = new Region { Name = \"RegionName\" };\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(new RegionNavigationJournalEntry());\n\n            var contentLoaderMock = new Mock<IRegionNavigationContentLoader>();\n            contentLoaderMock\n                .Setup(cl => cl.LoadContent(region, It.IsAny<NavigationContext>()))\n                .Throws<InvalidOperationException>();\n\n            var container = containerMock.Object;\n            var contentLoader = contentLoaderMock.Object;\n            var journal = new Mock<IRegionNavigationJournal>().Object;\n\n            var target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            RegionNavigationFailedEventArgs eventArgs = null;\n            target.NavigationFailed += delegate (object sender, RegionNavigationFailedEventArgs e)\n            {\n                if (sender == target)\n                {\n                    eventArgs = e;\n                }\n            };\n\n            // Act\n            bool? isNavigationSuccessful = null;\n            target.RequestNavigate(new Uri(\"invalid\", UriKind.Relative), nr => isNavigationSuccessful = nr.Success);\n\n            // Verify\n            Assert.False(isNavigationSuccessful.Value);\n            Assert.NotNull(eventArgs);\n            Assert.NotNull(eventArgs.Error);\n        }\n\n        [Fact]\n        public void WhenNavigationFailsBecauseActiveViewRejectsIt_ThenNavigationFailedIsRaised()\n        {\n            // Prepare\n            var region = new Region { Name = \"RegionName\" };\n\n            var view1Mock = new Mock<IConfirmNavigationRequest>();\n            view1Mock\n                .Setup(ina => ina.ConfirmNavigationRequest(It.IsAny<NavigationContext>(), It.IsAny<Action<bool>>()))\n                .Callback<NavigationContext, Action<bool>>((nc, c) => c(false))\n                .Verifiable();\n\n            var view1 = view1Mock.Object;\n\n            var view2 = new object();\n\n            region.Add(view1);\n            region.Add(view2);\n\n            region.Activate(view1);\n\n            var navigationUri = new Uri(view2.GetType().Name, UriKind.Relative);\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(new RegionNavigationJournalEntry());\n\n            var contentLoaderMock = new Mock<IRegionNavigationContentLoader>();\n            contentLoaderMock\n                .Setup(cl => cl.LoadContent(region, It.IsAny<NavigationContext>()))\n                .Returns(view2);\n\n            var container = containerMock.Object;\n            var contentLoader = contentLoaderMock.Object;\n            var journal = new Mock<IRegionNavigationJournal>().Object;\n\n            var target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            RegionNavigationFailedEventArgs eventArgs = null;\n            target.NavigationFailed += delegate (object sender, RegionNavigationFailedEventArgs e)\n            {\n                if (sender == target)\n                {\n                    eventArgs = e;\n                }\n            };\n\n            // Act\n            bool? isNavigationSuccessful = null;\n            target.RequestNavigate(navigationUri, nr => isNavigationSuccessful = nr.Success);\n\n            // Verify\n            view1Mock.VerifyAll();\n            Assert.False(isNavigationSuccessful.Value);\n            Assert.NotNull(eventArgs);\n            Assert.Null(eventArgs.Error);\n        }\n\n        [StaFact]\n        public void WhenNavigationFailsBecauseDataContextForActiveViewRejectsIt_ThenNavigationFailedIsRaised()\n        {\n            // Prepare\n            var region = new Region { Name = \"RegionName\" };\n\n            var viewModel1Mock = new Mock<IConfirmNavigationRequest>();\n            viewModel1Mock\n                .Setup(ina => ina.ConfirmNavigationRequest(It.IsAny<NavigationContext>(), It.IsAny<Action<bool>>()))\n                .Callback<NavigationContext, Action<bool>>((nc, c) => c(false))\n                .Verifiable();\n\n            var view1Mock = new Mock<FrameworkElement>();\n            var view1 = view1Mock.Object;\n            view1.DataContext = viewModel1Mock.Object;\n\n            var view2 = new object();\n\n            region.Add(view1);\n            region.Add(view2);\n\n            region.Activate(view1);\n\n            var navigationUri = new Uri(view2.GetType().Name, UriKind.Relative);\n\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(x => x.Resolve(typeof(IRegionNavigationJournalEntry))).Returns(new RegionNavigationJournalEntry());\n\n            var contentLoaderMock = new Mock<IRegionNavigationContentLoader>();\n            contentLoaderMock\n                .Setup(cl => cl.LoadContent(region, It.IsAny<NavigationContext>()))\n                .Returns(view2);\n\n            var container = containerMock.Object;\n            var contentLoader = contentLoaderMock.Object;\n            var journal = new Mock<IRegionNavigationJournal>().Object;\n\n            var target = new RegionNavigationService(container, contentLoader, journal)\n            {\n                Region = region\n            };\n\n            RegionNavigationFailedEventArgs eventArgs = null;\n            target.NavigationFailed += delegate (object sender, RegionNavigationFailedEventArgs e)\n            {\n                if (sender == target)\n                {\n                    eventArgs = e;\n                }\n            };\n\n            // Act\n            bool? isNavigationSuccessful = null;\n            target.RequestNavigate(navigationUri, nr => isNavigationSuccessful = nr.Success);\n\n            // Verify\n            viewModel1Mock.VerifyAll();\n            Assert.False(isNavigationSuccessful.Value);\n            Assert.NotNull(eventArgs);\n            Assert.Null(eventArgs.Error);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Regions/RegionViewRegistryFixture.cs",
    "content": "using System;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing Moq;\nusing Prism.Ioc;\nusing Prism.Navigation.Regions;\nusing Prism.Wpf.Tests.Mvvm;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Regions\n{\n\n    public class RegionViewRegistryFixture\n    {\n        [Fact]\n        public void CanRegisterContentAndRetrieveIt()\n        {\n            var containerMock = new Mock<IContainerExtension>();\n            ContainerLocator.SetContainerExtension(containerMock.Object);\n            containerMock.Setup(c => c.Resolve(typeof(MockContentObject))).Returns(new MockContentObject());\n            var registry = new RegionViewRegistry(containerMock.Object);\n\n            registry.RegisterViewWithRegion(\"MyRegion\", typeof(MockContentObject));\n            var result = registry.GetContents(\"MyRegion\");\n\n            //Assert.Equal(typeof(MockContentObject), calledType);\n            Assert.NotNull(result);\n            Assert.Single(result);\n            Assert.IsType<MockContentObject>(result.ElementAt(0));\n        }\n\n        [Fact]\n        public void ShouldRaiseEventWhenAddingContent()\n        {\n            var listener = new MySubscriberClass();\n            var containerMock = new Mock<IContainerExtension>();\n            containerMock.Setup(c => c.Resolve(typeof(MockContentObject))).Returns(new MockContentObject());\n            var registry = new RegionViewRegistry(containerMock.Object);\n\n            registry.ContentRegistered += listener.OnContentRegistered;\n\n            registry.RegisterViewWithRegion(\"MyRegion\", typeof(MockContentObject));\n\n            Assert.NotNull(listener.onViewRegisteredArguments);\n            Assert.NotNull(listener.onViewRegisteredArguments.GetView);\n\n            var result = listener.onViewRegisteredArguments.GetView(containerMock.Object);\n            Assert.NotNull(result);\n            Assert.IsType<MockContentObject>(result);\n        }\n\n        [Fact]\n        public void CanRegisterContentAsDelegateAndRetrieveIt()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            var registry = new RegionViewRegistry(null);\n            var content = new MockContentObject();\n\n            registry.RegisterViewWithRegion(\"MyRegion\", () => content);\n            var result = registry.GetContents(\"MyRegion\");\n\n            Assert.NotNull(result);\n            Assert.Single(result);\n            Assert.Same(content, result.ElementAt(0));\n        }\n\n        [Fact]\n        public async Task ShouldNotPreventSubscribersFromBeingGarbageCollected()\n        {\n            var registry = new RegionViewRegistry(null);\n            var subscriber = new MySubscriberClass();\n            registry.ContentRegistered += subscriber.OnContentRegistered;\n\n            WeakReference subscriberWeakReference = new WeakReference(subscriber);\n\n            subscriber = null;\n            await Task.Delay(50);\n            GC.Collect();\n\n            Assert.False(subscriberWeakReference.IsAlive);\n        }\n\n        [Fact]\n        public void OnRegisterErrorShouldGiveClearException()\n        {\n            var registry = new RegionViewRegistry(null);\n            registry.ContentRegistered += new EventHandler<ViewRegisteredEventArgs>(FailWithInvalidOperationException);\n\n            try\n            {\n                registry.RegisterViewWithRegion(\"R1\", typeof(object));\n                //Assert.Fail();\n            }\n            catch (ViewRegistrationException ex)\n            {\n                Assert.Contains(\"Dont do this\", ex.Message);\n                Assert.Contains(\"R1\", ex.Message);\n                Assert.Equal(\"Dont do this\", ex.InnerException.Message);\n            }\n            catch (Exception)\n            {\n                //Assert.Fail(\"Wrong exception type\");\n            }\n        }\n\n        [Fact]\n        public void OnRegisterErrorShouldSkipFrameworkExceptions()\n        {\n            ExceptionExtensions.RegisterFrameworkExceptionType(typeof(FrameworkException));\n            var registry = new RegionViewRegistry(null);\n            registry.ContentRegistered += new EventHandler<ViewRegisteredEventArgs>(FailWithFrameworkException);\n            var ex = Record.Exception(() => registry.RegisterViewWithRegion(\"R1\", typeof(object)));\n            Assert.NotNull(ex);\n            Assert.IsType<ViewRegistrationException>(ex);\n            Assert.Contains(\"Dont do this\", ex.Message);\n            Assert.Contains(\"R1\", ex.Message);\n        }\n\n        [StaFact]\n        public void RegisterViewWithRegion_ShouldHaveViewModel_ByDefault()\n        {\n            ViewModelLocatorFixture.ResetViewModelLocationProvider();\n\n            var containerMock = new Mock<IContainerExtension>();\n            ContainerLocator.SetContainerExtension(containerMock.Object);\n            containerMock.Setup(c => c.Resolve(typeof(Mocks.Views.Mock))).Returns(new Mocks.Views.Mock());\n            containerMock.Setup(c => c.Resolve(typeof(Mocks.ViewModels.MockViewModel))).Returns(new Mocks.ViewModels.MockViewModel());\n            var registry = new RegionViewRegistry(containerMock.Object);\n\n            registry.RegisterViewWithRegion(\"MyRegion\", typeof(Mocks.Views.Mock));\n\n            var result = registry.GetContents(\"MyRegion\");\n            Assert.NotNull(result);\n            Assert.Single(result);\n\n            var view = result.ElementAt(0) as FrameworkElement;\n            Assert.IsType<Mocks.Views.Mock>(view);\n            Assert.NotNull(view.DataContext);\n            Assert.IsType<Mocks.ViewModels.MockViewModel>(view.DataContext);\n        }\n\n        [StaFact]\n        public void RegisterViewWithRegion_ShouldNotHaveViewModel_OnOptOut()\n        {\n            ViewModelLocatorFixture.ResetViewModelLocationProvider();\n\n            var containerMock = new Mock<IContainerExtension>();\n            ContainerLocator.SetContainerExtension(containerMock.Object);\n            containerMock.Setup(c => c.Resolve(typeof(Mocks.Views.MockOptOut))).Returns(new Mocks.Views.MockOptOut());\n            containerMock.Setup(c => c.Resolve(typeof(Mocks.ViewModels.MockOptOutViewModel))).Returns(new Mocks.ViewModels.MockOptOutViewModel());\n            var registry = new RegionViewRegistry(containerMock.Object);\n\n            registry.RegisterViewWithRegion(\"MyRegion\", typeof(Mocks.Views.MockOptOut));\n\n            var result = registry.GetContents(\"MyRegion\");\n            Assert.NotNull(result);\n            Assert.Single(result);\n\n            var view = result.ElementAt(0) as FrameworkElement;\n            Assert.IsType<Mocks.Views.MockOptOut>(view);\n            Assert.Null(view.DataContext);\n        }\n\n        private void FailWithFrameworkException(object sender, ViewRegisteredEventArgs e)\n        {\n            try\n            {\n                FailWithInvalidOperationException(sender, e);\n            }\n            catch (Exception ex)\n            {\n                throw new FrameworkException(ex);\n            }\n        }\n\n        private void FailWithInvalidOperationException(object sender, ViewRegisteredEventArgs e)\n        {\n            throw new InvalidOperationException(\"Dont do this\");\n        }\n\n        private class MockContentObject\n        {\n        }\n\n        private class MySubscriberClass\n        {\n            public ViewRegisteredEventArgs onViewRegisteredArguments;\n            public void OnContentRegistered(object sender, ViewRegisteredEventArgs e)\n            {\n                onViewRegisteredArguments = e;\n            }\n        }\n\n        private class FrameworkException : Exception\n        {\n            public FrameworkException(Exception innerException)\n                : base(\"\", innerException)\n            {\n\n            }\n        }\n\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Regions/SelectorRegionAdapterFixture.cs",
    "content": "\n\nusing System;\nusing System.Threading.Tasks;\nusing System.Windows.Controls;\nusing Moq;\nusing Prism.Ioc;\nusing Prism.Navigation.Regions;\nusing Prism.Navigation.Regions.Behaviors;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Regions\n{\n\n    public class SelectorRegionAdapterFixture\n    {\n        [StaFact]\n        public void AdapterAddsSelectorItemsSourceSyncBehavior()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            var control = new ListBox();\n            IRegionAdapter adapter = new TestableSelectorRegionAdapter();\n\n            IRegion region = adapter.Initialize(control, \"Region1\");\n            Assert.NotNull(region);\n\n            Assert.IsType<SelectorItemsSourceSyncBehavior>(region.Behaviors[\"SelectorItemsSourceSyncBehavior\"]);\n\n        }\n\n\n        [StaFact]\n        public async Task AdapterDoesNotPreventRegionFromBeingGarbageCollected()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            var selector = new ListBox();\n            object model = new object();\n            IRegionAdapter adapter = new SelectorRegionAdapter(null);\n\n            var region = adapter.Initialize(selector, \"Region1\");\n            region.Add(model);\n\n            var regionWeakReference = new WeakReference(region);\n            var controlWeakReference = new WeakReference(selector);\n            Assert.True(regionWeakReference.IsAlive);\n            Assert.True(controlWeakReference.IsAlive);\n\n            region = null;\n            selector = null;\n            await Task.Delay(50);\n            GC.Collect();\n            GC.Collect();\n\n            Assert.False(regionWeakReference.IsAlive);\n            Assert.False(controlWeakReference.IsAlive);\n        }\n\n        [StaFact]\n        public void ActivatingTheViewShouldUpdateTheSelectedItem()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            var selector = new ListBox();\n            var view1 = new object();\n            var view2 = new object();\n\n            IRegionAdapter adapter = new SelectorRegionAdapter(null);\n\n            var region = adapter.Initialize(selector, \"Region1\");\n            region.Add(view1);\n            region.Add(view2);\n\n            Assert.NotEqual(view1, selector.SelectedItem);\n\n            region.Activate(view1);\n\n            Assert.Equal(view1, selector.SelectedItem);\n\n            region.Activate(view2);\n\n            Assert.Equal(view2, selector.SelectedItem);\n        }\n\n        [StaFact]\n        public void DeactivatingTheSelectedViewShouldUpdateTheSelectedItem()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            var selector = new ListBox();\n            var view1 = new object();\n            IRegionAdapter adapter = new SelectorRegionAdapter(null);\n            var region = adapter.Initialize(selector, \"Region1\");\n            region.Add(view1);\n\n            region.Activate(view1);\n\n            Assert.Equal(view1, selector.SelectedItem);\n\n            region.Deactivate(view1);\n\n            Assert.NotEqual(view1, selector.SelectedItem);\n        }\n\n\n        private class TestableSelectorRegionAdapter : SelectorRegionAdapter\n        {\n            public TestableSelectorRegionAdapter()\n                : base(null)\n            {\n            }\n\n\n            protected override IRegion CreateRegion()\n            {\n                return new Region();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Regions/SingleActiveRegionFixture.cs",
    "content": "using Moq;\nusing Prism.Ioc;\nusing Prism.Navigation.Regions;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Regions\n{\n    public class SingleActiveRegionFixture\n    {\n        [Fact]\n        public void ActivatingNewViewDeactivatesCurrent()\n        {\n            ContainerLocator.SetContainerExtension(Mock.Of<IContainerExtension>());\n            IRegion region = new SingleActiveRegion();\n            var view = new object();\n            region.Add(view);\n            region.Activate(view);\n\n            Assert.True(region.ActiveViews.Contains(view));\n\n            var view2 = new object();\n            region.Add(view2);\n            region.Activate(view2);\n\n            Assert.False(region.ActiveViews.Contains(view));\n            Assert.True(region.ActiveViews.Contains(view2));\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Wpf/Prism.Wpf.Tests/Regions/ViewsCollectionFixture.cs",
    "content": "\n\nusing System;\nusing System.Collections;\nusing System.Collections.ObjectModel;\nusing System.Collections.Specialized;\nusing System.Linq;\nusing System.Windows.Data;\nusing Prism.Navigation.Regions;\nusing Prism.Wpf.Tests.Mocks;\nusing Xunit;\n\nnamespace Prism.Wpf.Tests.Regions\n{\n\n    public class ViewsCollectionFixture\n    {\n        [Fact]\n        public void CanWrapCollectionCollection()\n        {\n            var originalCollection = new ObservableCollection<ItemMetadata>();\n            IViewsCollection viewsCollection = new ViewsCollection(originalCollection, x => true);\n\n            Assert.Empty(viewsCollection);\n\n            var item = new object();\n            originalCollection.Add(new ItemMetadata(item));\n            Assert.Single(viewsCollection);\n            Assert.Same(item, viewsCollection.First());\n        }\n\n        [Fact]\n        public void CanFilterCollection()\n        {\n            var originalCollection = new ObservableCollection<ItemMetadata>();\n            IViewsCollection viewsCollection = new ViewsCollection(originalCollection, x => x.Name == \"Possible\");\n\n            originalCollection.Add(new ItemMetadata(new object()));\n\n            Assert.Empty(viewsCollection);\n\n            var item = new object();\n            originalCollection.Add(new ItemMetadata(item) { Name = \"Possible\" });\n            Assert.Single(viewsCollection);\n\n            Assert.Same(item, viewsCollection.First());\n        }\n\n        [Fact]\n        public void RaisesCollectionChangedWhenFilteredCollectionChanges()\n        {\n            var originalCollection = new ObservableCollection<ItemMetadata>();\n            IViewsCollection viewsCollection = new ViewsCollection(originalCollection, x => x.IsActive);\n            bool collectionChanged = false;\n            viewsCollection.CollectionChanged += (s, e) => collectionChanged = true;\n\n            originalCollection.Add(new ItemMetadata(new object()) { IsActive = true });\n\n            Assert.True(collectionChanged);\n        }\n\n        [Fact]\n        public void RaisesCollectionChangedWithAddAndRemoveWhenFilteredCollectionChanges()\n        {\n            var originalCollection = new ObservableCollection<ItemMetadata>();\n            IViewsCollection viewsCollection = new ViewsCollection(originalCollection, x => x.IsActive);\n            bool addedToCollection = false;\n            bool removedFromCollection = false;\n            viewsCollection.CollectionChanged += (s, e) =>\n                                                     {\n                                                         if (e.Action == NotifyCollectionChangedAction.Add)\n                                                         {\n                                                             addedToCollection = true;\n                                                         }\n                                                         else if (e.Action == NotifyCollectionChangedAction.Remove)\n                                                         {\n                                                             removedFromCollection = true;\n                                                         }\n                                                     };\n            var filteredInObject = new ItemMetadata(new object()) { IsActive = true };\n\n            originalCollection.Add(filteredInObject);\n\n            Assert.True(addedToCollection);\n            Assert.False(removedFromCollection);\n\n            originalCollection.Remove(filteredInObject);\n\n            Assert.True(removedFromCollection);\n        }\n\n        [Fact]\n        public void DoesNotRaiseCollectionChangedWhenAddingOrRemovingFilteredOutObject()\n        {\n            var originalCollection = new ObservableCollection<ItemMetadata>();\n            IViewsCollection viewsCollection = new ViewsCollection(originalCollection, x => x.IsActive);\n            bool collectionChanged = false;\n            viewsCollection.CollectionChanged += (s, e) => collectionChanged = true;\n            var filteredOutObject = new ItemMetadata(new object()) { IsActive = false };\n\n            originalCollection.Add(filteredOutObject);\n            originalCollection.Remove(filteredOutObject);\n\n            Assert.False(collectionChanged);\n        }\n\n        [Fact]\n        public void CollectionChangedPassesWrappedItemInArgumentsWhenAdding()\n        {\n            var originalCollection = new ObservableCollection<ItemMetadata>();\n            var filteredInObject = new ItemMetadata(new object());\n            originalCollection.Add(filteredInObject);\n\n            IViewsCollection viewsCollection = new ViewsCollection(originalCollection, x => true);\n            IList oldItemsPassed = null;\n            viewsCollection.CollectionChanged += (s, e) => { oldItemsPassed = e.OldItems; };\n            originalCollection.Remove(filteredInObject);\n\n            Assert.NotNull(oldItemsPassed);\n            Assert.Single(oldItemsPassed);\n            Assert.Same(filteredInObject.Item, oldItemsPassed[0]);\n        }\n\n        [Fact]\n        public void CollectionChangedPassesWrappedItemInArgumentsWhenRemoving()\n        {\n            var originalCollection = new ObservableCollection<ItemMetadata>();\n            IViewsCollection viewsCollection = new ViewsCollection(originalCollection, x => true);\n            IList newItemsPassed = null;\n            viewsCollection.CollectionChanged += (s, e) => { newItemsPassed = e.NewItems; };\n            var filteredInObject = new ItemMetadata(new object());\n\n            originalCollection.Add(filteredInObject);\n\n            Assert.NotNull(newItemsPassed);\n            Assert.Single(newItemsPassed);\n            Assert.Same(filteredInObject.Item, newItemsPassed[0]);\n        }\n\n        [Fact]\n        public void EnumeratesWrappedItems()\n        {\n            var originalCollection = new ObservableCollection<ItemMetadata>()\n                                         {\n                                             new ItemMetadata(new object()),\n                                             new ItemMetadata(new object())\n                                         };\n            IViewsCollection viewsCollection = new ViewsCollection(originalCollection, x => true);\n            Assert.Equal(2, viewsCollection.Count());\n\n            Assert.Same(originalCollection[0].Item, viewsCollection.ElementAt(0));\n            Assert.Same(originalCollection[1].Item, viewsCollection.ElementAt(1));\n        }\n\n        [Fact]\n        public void ChangingMetadataOnItemAddsOrRemovesItFromTheFilteredCollection()\n        {\n            var originalCollection = new ObservableCollection<ItemMetadata>();\n            IViewsCollection viewsCollection = new ViewsCollection(originalCollection, x => x.IsActive);\n            bool addedToCollection = false;\n            bool removedFromCollection = false;\n            viewsCollection.CollectionChanged += (s, e) =>\n                                                     {\n                                                         if (e.Action == NotifyCollectionChangedAction.Add)\n                                                         {\n                                                             addedToCollection = true;\n                                                         }\n                                                         else if (e.Action == NotifyCollectionChangedAction.Remove)\n                                                         {\n                                                             removedFromCollection = true;\n                                                         }\n                                                     };\n\n            originalCollection.Add(new ItemMetadata(new object()) { IsActive = true });\n            Assert.True(addedToCollection);\n            Assert.False(removedFromCollection);\n            addedToCollection = false;\n\n            originalCollection[0].IsActive = false;\n\n            Assert.Empty(viewsCollection);\n            Assert.True(removedFromCollection);\n            Assert.False(addedToCollection);\n            Assert.Empty(viewsCollection);\n            addedToCollection = false;\n            removedFromCollection = false;\n\n            originalCollection[0].IsActive = true;\n\n            Assert.Single(viewsCollection);\n            Assert.True(addedToCollection);\n            Assert.False(removedFromCollection);\n        }\n\n        [Fact]\n        public void AddingToOriginalCollectionFiresAddCollectionChangeEvent()\n        {\n            var originalCollection = new ObservableCollection<ItemMetadata>();\n            IViewsCollection viewsCollection = new ViewsCollection(originalCollection, (i) => true);\n\n            var eventTracker = new CollectionChangedTracker(viewsCollection);\n\n            originalCollection.Add(new ItemMetadata(new object()));\n\n            Assert.Contains(NotifyCollectionChangedAction.Add, eventTracker.ActionsFired);\n        }\n\n        [Fact]\n        public void AddingToOriginalCollectionFiresResetNotificationIfSortComparisonSet()\n        {\n            // Reset is fired to support the need to resort after updating the collection\n            var originalCollection = new ObservableCollection<ItemMetadata>();\n            var viewsCollection = new ViewsCollection(originalCollection, (i) => true);\n            viewsCollection.SortComparison = (a, b) => { return 0; };\n\n            var eventTracker = new CollectionChangedTracker(viewsCollection);\n\n            originalCollection.Add(new ItemMetadata(new object()));\n\n            Assert.Contains(NotifyCollectionChangedAction.Add, eventTracker.ActionsFired);\n            Assert.Equal(\n                1,\n                eventTracker.ActionsFired.Count(a => a == NotifyCollectionChangedAction.Reset));\n        }\n\n        [Fact]\n        public void OnAddNotifyCollectionChangedThenIndexProvided()\n        {\n            var originalCollection = new ObservableCollection<ItemMetadata>();\n            IViewsCollection viewsCollection = new ViewsCollection(originalCollection, (i) => true);\n\n            var eventTracker = new CollectionChangedTracker(viewsCollection);\n\n            originalCollection.Add(new ItemMetadata(\"a\"));\n\n            var addEvent = eventTracker.NotifyEvents.Single(e => e.Action == NotifyCollectionChangedAction.Add);\n            Assert.Equal(0, addEvent.NewStartingIndex);\n        }\n\n        [Fact]\n        public void OnRemoveNotifyCollectionChangedThenIndexProvided()\n        {\n            var originalCollection = new ObservableCollection<ItemMetadata>();\n            originalCollection.Add(new ItemMetadata(\"a\"));\n            originalCollection.Add(new ItemMetadata(\"b\"));\n            originalCollection.Add(new ItemMetadata(\"c\"));\n            IViewsCollection viewsCollection = new ViewsCollection(originalCollection, (i) => true);\n\n            var eventTracker = new CollectionChangedTracker(viewsCollection);\n            originalCollection.RemoveAt(1);\n\n            var removeEvent = eventTracker.NotifyEvents.Single(e => e.Action == NotifyCollectionChangedAction.Remove);\n            Assert.NotNull(removeEvent);\n            Assert.Equal(1, removeEvent.OldStartingIndex);\n        }\n\n        [Fact]\n        public void OnRemoveOfFilterMatchingItemThenViewCollectionRelativeIndexProvided()\n        {\n            var originalCollection = new ObservableCollection<ItemMetadata>();\n            originalCollection.Add(new ItemMetadata(\"a\"));\n            originalCollection.Add(new ItemMetadata(\"b\"));\n            originalCollection.Add(new ItemMetadata(\"c\"));\n            IViewsCollection viewsCollection = new ViewsCollection(originalCollection, (i) => !\"b\".Equals(i.Item));\n\n            var eventTracker = new CollectionChangedTracker(viewsCollection);\n            originalCollection.RemoveAt(2);\n\n            var removeEvent = eventTracker.NotifyEvents.Single(e => e.Action == NotifyCollectionChangedAction.Remove);\n            Assert.NotNull(removeEvent);\n            Assert.Equal(1, removeEvent.OldStartingIndex);\n        }\n\n\n        [Fact]\n        public void RemovingFromFilteredCollectionDoesNotThrow()\n        {\n            var originalCollection = new ObservableCollection<ItemMetadata>();\n            originalCollection.Add(new ItemMetadata(\"a\"));\n            originalCollection.Add(new ItemMetadata(\"b\"));\n            originalCollection.Add(new ItemMetadata(\"c\"));\n            IViewsCollection viewsCollection = new ViewsCollection(originalCollection, (i) => true);\n\n            CollectionViewSource cvs = new CollectionViewSource { Source = viewsCollection };\n\n            var view = cvs.View;\n            //try\n            //{\n            originalCollection.RemoveAt(1);\n            //}\n            //catch (Exception ex)\n            //{\n            //Assert.Fail(ex.Message);\n            //}\n        }\n\n        [Fact]\n        public void ViewsCollectionSortedAfterAddingItemToOriginalCollection()\n        {\n            var originalCollection = new ObservableCollection<ItemMetadata>();\n            ViewsCollection viewsCollection = new ViewsCollection(originalCollection, (i) => true);\n            viewsCollection.SortComparison = Region.DefaultSortComparison;\n\n            var view1 = new MockSortableView1();\n            var view2 = new MockSortableView2();\n            var view3 = new MockSortableView3();\n\n            originalCollection.Add(new ItemMetadata(view2));\n            originalCollection.Add(new ItemMetadata(view3));\n            originalCollection.Add(new ItemMetadata(view1));\n\n            Assert.Same(view1, viewsCollection.ElementAt(0));\n            Assert.Same(view2, viewsCollection.ElementAt(1));\n            Assert.Same(view3, viewsCollection.ElementAt(2));\n        }\n\n        [Fact]\n        public void ChangingSortComparisonCausesResortingOfCollection()\n        {\n            var originalCollection = new ObservableCollection<ItemMetadata>();\n            ViewsCollection viewsCollection = new ViewsCollection(originalCollection, (i) => true);\n\n            var view1 = new MockSortableView1();\n            var view2 = new MockSortableView2();\n            var view3 = new MockSortableView3();\n\n            originalCollection.Add(new ItemMetadata(view2));\n            originalCollection.Add(new ItemMetadata(view3));\n            originalCollection.Add(new ItemMetadata(view1));\n\n            // ensure items are in original order\n            Assert.Same(view2, viewsCollection.ElementAt(0));\n            Assert.Same(view3, viewsCollection.ElementAt(1));\n            Assert.Same(view1, viewsCollection.ElementAt(2));\n\n            // change sort comparison\n            viewsCollection.SortComparison = Region.DefaultSortComparison;\n\n            // ensure items are properly sorted\n            Assert.Same(view1, viewsCollection.ElementAt(0));\n            Assert.Same(view2, viewsCollection.ElementAt(1));\n            Assert.Same(view3, viewsCollection.ElementAt(2));\n        }\n    }\n}\n"
  },
  {
    "path": "version.json",
    "content": "{\n  \"$schema\": \"https://raw.githubusercontent.com/AArnott/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json\",\n  \"version\": \"9.1-pre\",\n  \"assemblyVersion\": {\n    \"precision\": \"revision\"\n  },\n  \"publicReleaseRefSpec\": [\n    \"^refs/heads/master$\",\n    \"^refs/heads/release/stable/\\\\d+\\\\.\\\\d+$\"\n  ]\n}\n"
  },
  {
    "path": "winappsdk-workarounds.targets",
    "content": "<Project>\n  <!--\n    Workaround to avoid including Uno.Toolkit.UI XBFs in the PRI file:\n      > C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\MSBuild\\Current\\Bin\\Microsoft.Common.CurrentVersion.targets(5097,5):\n      > error MSB3030: Could not copy the file \"D:\\a\\1\\s\\src\\Uno.Toolkit.UI\\obj\\Uno.Toolkit.WinUI\\Release\\net5.0-windows10.0.19041\\Controls\\AutoLayout\\AutoLayout.xbf\" because it was not found.\n      > [D:\\a\\1\\s\\src\\Uno.Toolkit.RuntimeTests\\Uno.Toolkit.RuntimeTests.WinUI.csproj]\n    Just <Import /> this file into the winui project appearing in the `[]` bracket.\n  -->\n  <Target Name=\"AdjustGetPackagingOutput1\" AfterTargets=\"GetMrtPackagingOutputs\">\n    <Message Importance=\"high\" Text=\"Applying NuGet packaging workaround for dependent PRI files exclusion\" />\n    <ItemGroup>\n      <_OtherPriFiles Include=\"@(PackagingOutputs)\" Condition=\"'%(Extension)' == '.pri' and ('%(PackagingOutputs.ReferenceSourceTarget)' == 'ProjectReference' or '%(PackagingOutputs.NugetSourceType)'=='Package')\" />\n      <PackagingOutputs Remove=\"@(_OtherPriFiles)\" />\n    </ItemGroup>\n  </Target>\n\n  <Target Name=\"AdjustGetPackagingOutput2\" BeforeTargets=\"AddPriPayloadFilesToCopyToOutputDirectoryItems\">\n    <Message Importance=\"high\" Text=\"Applying NuGet packaging workaround for dependent PRI files exclusion\" />\n    <ItemGroup>\n      <_OtherPriFiles1 Include=\"@(_ReferenceRelatedPaths)\" Condition=\"'%(Extension)' == '.pri' and ('%(_ReferenceRelatedPaths.ReferenceSourceTarget)' == 'ProjectReference' or '%(_ReferenceRelatedPaths.NugetSourceType)'=='Package')\" />\n      <_ReferenceRelatedPaths Remove=\"@(_OtherPriFiles1)\" />\n\n      <_OtherPriFiles2 Include=\"@(ReferenceCopyLocalPaths)\" Condition=\"'%(Extension)' == '.pri' and ('%(ReferenceCopyLocalPaths.ReferenceSourceTarget)' == 'ProjectReference' or '%(ReferenceCopyLocalPaths.NugetSourceType)'=='Package')\" />\n      <ReferenceCopyLocalPaths Remove=\"@(_OtherPriFiles2)\" />\n    </ItemGroup>\n  </Target>\n</Project>\n"
  },
  {
    "path": "xunit.runner.json",
    "content": "{\n    \"maxParallelThreads\": 1\n}"
  }
]