Skip to content

Commit

Permalink
Documentation changes
Browse files Browse the repository at this point in the history
  • Loading branch information
egvijayanand committed Feb 28, 2022
1 parent 3395f65 commit 72d6e46
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 4 deletions.
56 changes: 52 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,29 @@
### CLI Project and Item Templates for developing Xamarin.Forms App that runs on iOS, Android, and Windows
### Project and Item Templates for building native apps for iOS, Android, UWP, macOS, Tizen from a single, shared C# codebase.

[![VijayAnand.FormsTemplates - NuGet Package](https://badgen.net/nuget/v/VijayAnand.FormsTemplates/)](https://www.nuget.org/packages/VijayAnand.FormsTemplates/)
#### Available to install from

Project template for Xamarin.Forms Class Library and is named as `formsclasslib`
|NuGet|VS Marketplace|
|:---:|:---:|
|[![VijayAnand.FormsTemplates - NuGet Package](https://badgen.net/nuget/v/VijayAnand.FormsTemplates/)](https://www.nuget.org/packages/VijayAnand.FormsTemplates/)|[![Xamarin.Forms Project and Item Templates - VS Marketplace](https://badgen.net/vs-marketplace/v/egvijayanand.xamarin-forms-templates)](https://marketplace.visualstudio.com/items?itemName=egvijayanand.xamarin-forms-templates)|

#### Access within Visual Studio IDE

![Install from VS Marketplace](images/xamarin-forms-vs-extension.png)

![Xamarin.Forms Class Library Project Template](images/xamarin-forms-class-library.png)

![Xamarin.Forms Class Library - Project Options](images/xamarin-forms-class-library-options.png)

![Xamarin.Forms - Item Templates](images/xamarin-forms-item-templates.png)

#### Access via CLI

Item templates for ContentPage, ContentView, and ShellPage in XAML and named as `forms-page`, `forms-view`, and `forms-shell` respectively.
Project template for Xamarin.Forms Class Library and is named as `formsclasslib`

Project template currently target Xamarin.Forms 5.0 Service Release 9 (ver. 5.0.0.2337).

Item templates for ContentPage, ContentView, ShellPage, and ResourceDictionary in XAML and named as `forms-page`, `forms-view`, `forms-shell`, and `forms-resdict` respectively.

To install the template NuGet package, use the below .NET CLI command:

```shell
Expand All @@ -18,22 +34,54 @@ If you've already installed this package, then it can be updated to the latest v

```shell
dotnet new --update-check
```
```shell
dotnet new --update-apply
```
Use the below .NET CLI command to create the project, pages, and views out these templates:

```shell
dotnet new formsclasslib -n MyApp.Core
```

Class library project templates take the below optional parameters to include the officially supported Xamarin.CommunityToolkit, Xamarin.CommunityToolkit.Markup or both NuGet packages:

* `-it` | `--include-toolkit` - Default value is `false`
* `-im` | `--include-markup` - Default value is `false`

Note: `v2.0.0` is the NuGet package version being added out-of-the-box.

```shell
dotnet new formsclasslib -n MyApp.UI -it -im
```

Page:
```shell
dotnet new forms-page -n LoginPage -na MyApp.Views
```

View:
```shell
dotnet new forms-view -n CardView -na MyApp.Views
```

Shell:
```shell
dotnet new forms-shell -n AppShell -na MyApp
```

Resource Dictionary:

With C# code-behind file:
```shell
dotnet new forms-resdict -n DarkTheme -na MyApp.Themes
```

Without C# code-behind file - Xaml Only (Option can be `-xo` or `--xaml-only`):
```shell
dotnet new forms-resdict -n DarkTheme -na MyApp.Themes -xo
```

Here `-n` denotes the name of the project/page/view that is to be created (for pages/views, don't need to suffix it with .xaml, it will be added automatically) (Can also be specified as `--name`).

*Note: If name parameter is not provided, the .NET CLI template engine will take the current folder name in the context as its name.*
Expand Down
Binary file added images/xamarin-forms-class-library-options.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/xamarin-forms-class-library.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/xamarin-forms-item-templates.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/xamarin-forms-vs-extension.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 72d6e46

Please sign in to comment.