Skip to content

Commit 4e46ac5

Browse files
authored
Merge pull request #33 from kazo0/feature/xf-sample
Add Xamarin.Forms Sample
2 parents 51b5b0d + fc5c4dc commit 4e46ac5

File tree

230 files changed

+25680
-86
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

230 files changed

+25680
-86
lines changed

azure-pipelines.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ pool:
88
vmImage: 'windows-latest'
99

1010
variables:
11-
solution: '**/*.sln'
11+
solutionUwp: 'samples/MvvmSampleUwp.sln'
12+
solutionXf: 'samples/MvvmSampleUwp.sln'
1213
buildPlatform: 'x86|x64|ARM|ARM64'
1314
buildConfiguration: 'Release'
1415
appxPackageDir: '$(build.artifactStagingDirectory)\AppxPackages\\'
@@ -26,6 +27,12 @@ steps:
2627
- task: VSBuild@1
2728
inputs:
2829
platform: 'x86'
29-
solution: '$(solution)'
30+
solution: '$(solutionUwp)'
3031
configuration: '$(buildConfiguration)'
3132
msbuildArgs: '/p:AppxBundlePlatforms="$(buildPlatform)" /p:AppxPackageDir="$(appxPackageDir)" /p:AppxBundle=Always /p:UapAppxPackageBuildMode=StoreUpload'
33+
34+
- task: VSBuild@1
35+
inputs:
36+
platform: 'Any CPU'
37+
solution: '$(solutionXf)'
38+
configuration: '$(buildConfiguration)'
File renamed without changes.
File renamed without changes.

samples/MvvmSampleUwp/MvvmSampleUwp/Assets/docs/Ioc.md renamed to samples/MvvmSample.Core/Docs/Ioc.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ dev_langs:
77
- csharp
88
---
99

10-
# Ioc ([Inversion of control](https://en.wikipedia.org/wiki/Inversion_of_control))
10+
# Ioc (Inversion of control)
1111

12-
Inversion of Control is a common pattern that can be used to increase modularity in the codebase of an application when using the MVVM pattern. A frequently used way to enable this is to use _dependency injection_ (DI), which consists of creating a number of services that are injected into backend classes (i.e. passed as parameters to the viewmodel constructors). Doing this allows code using these services not to rely on the implementation details of these services, and it also makes it easy to swap the concrete implementations of these services. This pattern also makes it easy to make platform-specific features available to backend code, by abstracting them through a service which is then injected where needed. Since services are then isolated from where they are used, they become more testable as well.
12+
[Inversion of Control](https://en.wikipedia.org/wiki/Inversion_of_control) is a common pattern that can be used to increase modularity in the codebase of an application when using the MVVM pattern. A frequently used way to enable this is to use _dependency injection_ (DI), which consists of creating a number of services that are injected into backend classes (i.e. passed as parameters to the viewmodel constructors). Doing this allows code using these services not to rely on the implementation details of these services, and it also makes it easy to swap the concrete implementations of these services. This pattern also makes it easy to make platform-specific features available to backend code, by abstracting them through a service which is then injected where needed. Since services are then isolated from where they are used, they become more testable as well.
1313

1414
The MVVM Toolkit doesn't provide built-in APIs to facilitate the usage of this pattern, as dedicated libraries specifically exist for this, such as the `Microsoft.Extensions.DependencyInjection` package. It provides a fully featured and powerful set of dependency injection APIs already and can be easily setup to use the [`IServiceProvider`](https://docs.microsoft.com/dotnet/api/system.iserviceprovider) interface. The following guide will refer to this library and provide a series of examples of how to integrate it into applications using the MVVM pattern with the MVVM Toolkit.
1515

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

samples/MvvmSampleUwp/MvvmSampleUwp/Assets/docs/RelayCommand.md renamed to samples/MvvmSample.Core/Docs/RelayCommand.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ dev_langs:
77
- csharp
88
---
99

10-
# RelayCommand and RelayCommand<T>
10+
# RelayCommand
1111

1212
The [`RelayCommand`](https://docs.microsoft.com/dotnet/api/microsoft.toolkit.mvvm.input.RelayCommand) and [`RelayCommand<T>`](https://docs.microsoft.com/dotnet/api/microsoft.toolkit.mvvm.input.RelayCommand-1) are `ICommand` implementations that can expose a method or delegate to the view. These types act as a way to bind commands between the viewmodel and UI elements.
1313

samples/MvvmSampleUwp/MvvmSampleUwp/Helpers/MarkdownHelper.cs renamed to samples/MvvmSample.Core/Helpers/MarkdownHelper.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
using System.Linq;
77
using System.Text.RegularExpressions;
88

9-
namespace MvvmSampleUwp.Helpers
9+
namespace MvvmSample.Core.Helpers
1010
{
1111
/// <summary>
1212
/// A simple class to help with basic operations on markdown documents.
@@ -21,7 +21,8 @@ public static class MarkdownHelper
2121
public static IReadOnlyDictionary<string, string> GetParagraphs(string text)
2222
{
2323
return
24-
Regex.Matches(text, @"(?<=\W)#+ ([^\n]+).+?(?=\W#|$)", RegexOptions.Singleline)
24+
Regex.Matches(text, @"(?<=\W)#+ ([^\n]+).+?(?=\W#|$)", RegexOptions.Singleline)
25+
.OfType<Match>()
2526
.ToDictionary(
2627
m => m.Groups[1].Value.Trim().Replace("&lt;", "<"),
2728
m => m.Groups[0].Value.Trim().Replace("&lt;", "<").Replace("[!WARNING]", "**WARNING:**").Replace("[!NOTE]", "**NOTE:**"));

0 commit comments

Comments
 (0)