Skip to content

Commit

Permalink
Merge pull request #32 from egvijayanand/working
Browse files Browse the repository at this point in the history
Changes for Preview 12
  • Loading branch information
egvijayanand authored Feb 4, 2022
2 parents 6d44741 + df0346c commit bf196d0
Show file tree
Hide file tree
Showing 82 changed files with 757 additions and 852 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ This repository is to host the .NET MAUI Project and Item templates and Code Sni

We all know that .NET MAUI is an evolution of Xamarin.Forms.

And now, .NET MAUI Preview 10 released on Mon, Nov 8, 2021 along with VS2022 Preview 1.0 (17.1.0)
And now, .NET MAUI Preview 12 released on 19 Jan 2022 along with VS2022 Version 17.1.0 Preview 3.0

Templates have been updated to support the latest release.

Expand All @@ -17,10 +17,10 @@ Extension is made available in the [Visual Studio Marketplace](https://marketpla

This has Project Templates for:

* .NET MAUI App (Preview 10)
* .NET MAUI App (C#) (Preview 10)
* .NET MAUI Blazor App (Preview 10)
* .NET MAUI Class Library (Preview 10)
* .NET MAUI App (Preview 12)
* .NET MAUI App (C#) (Preview 12)
* .NET MAUI Blazor App (Preview 12)
* .NET MAUI Class Library (Preview 12)

![Create Project - Visual Studio](images/maui-project-templates.png)

Expand All @@ -31,6 +31,7 @@ And has Item Templates for:
* Content View (.NET MAUI)
* Content View (C#) (.NET MAUI)
* Resource Dictionary (.NET MAUI)
* Resource Dictionary (XAML only)(.NET MAUI)
* Shell Page (.NET MAUI)

Now VS2022 extension is loaded with 25+ C# and XAML Code Snippets.
Expand Down
Binary file modified images/add-new-item.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 modified images/maui-project-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 not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>Async Method</Title>
<Shortcut>amethod</Shortcut>
<Description>Code snippet for async method</Description>
<Author>Vijay Anand E G</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
<SnippetType>SurroundsWith</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>name</ID>
<ToolTip>Method name</ToolTip>
<Default>MyMethod</Default>
</Literal>
</Declarations>
<Code Language="CSharp" Kind="method decl">
<![CDATA[private async Task $name$()
{
$selected$$end$
}]]>
</Code>
<Imports>
<Import>
<Namespace>System.Threading.Tasks</Namespace>
</Import>
</Imports>
</Snippet>
</CodeSnippet>
</CodeSnippets>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<CodeSnippet Format="1.0.0">
<Header>
<Title>Comet Property</Title>
<Shortcut>propcomet</Shortcut>
<Shortcut>propc</Shortcut>
<Description>Code snippet for Comet Property</Description>
<Author>Vijay Anand E G</Author>
<SnippetTypes>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<CodeSnippet Format="1.0.0">
<Header>
<Title>Cross Platform</Title>
<Shortcut>xplat</Shortcut>
<Shortcut>cp</Shortcut>
<Description>Code snippet for Cross Platform</Description>
<Author>Vijay Anand E G</Author>
<SnippetTypes>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,19 @@
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>type</ID>
<ToolTip>Return type</ToolTip>
<Default>void</Default>
</Literal>
<Literal>
<ID>name</ID>
<ToolTip>Method name</ToolTip>
<Default>MyMethod</Default>
</Literal>
</Declarations>
<Code Language="CSharp" Kind="method decl">
<![CDATA[private void $name$()
<![CDATA[private $type$ $name$()
{
$selected$$end$
}]]>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<CodeSnippet Format="1.0.0">
<Header>
<Title>Record Struct</Title>
<Shortcut>recstruct</Shortcut>
<Shortcut>rstruct</Shortcut>
<Description>
Code snippet for Record Struct
Language Version: C# 10.0 or higher
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,12 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="ItemTemplates\MauiResDictXaml.zip">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<VSIXSubPath>ItemTemplates\MAUI</VSIXSubPath>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<None Include="MauiSnippets\CSharp\asyncMethod.snippet" />
<None Include="source.extension.vsixmanifest">
<SubType>Designer</SubType>
<Generator>VsixManifestGenerator</Generator>
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion src/Extensions/MauiTemplates/MauiTemplates/license.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 Vijay Anand E G
Copyright (c) 2022 Vijay Anand E G

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Binary file modified src/Extensions/MauiTemplates/MauiTemplates/readme.docx
Binary file not shown.
Binary file modified src/Extensions/MauiTemplates/MauiTemplates/readme.pdf
Binary file not shown.
207 changes: 125 additions & 82 deletions src/Extensions/MauiTemplates/MauiTemplates/readme.rtf

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions src/Extensions/MauiTemplates/MauiTemplates/release-notes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
What's new in ver. 1.0.0.9:
What's new in ver. 1.0.0.10:

Templates updated to support .NET MAUI Preview 10.
Templates updated to support .NET MAUI Preview 12

Added XAML only ResourceDictionary template
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ internal sealed partial class Vsix
{
public const string Id = "MauiTemplates.20dca96a-7311-401f-84ed-980478fb319b";
public const string Name = ".NET MAUI Project and Item Templates";
public const string Description = @".NET MAUI Project, Item Templates, and Code Snippets for Visual Studio 2022 (.NET MAUI Preview 10).";
public const string Description = @".NET MAUI Project, Item Templates, and Code Snippets for Visual Studio 2022 (.NET MAUI Preview 12).";
public const string Language = "en-US";
public const string Version = "1.0.0.9";
public const string Version = "1.0.0.10";
public const string Author = "Vijay Anand E G";
public const string Tags = "MAUI, iOS, Android, macOS, WinUI, Windows, Desktop, Mobile, Blazor, WinUI, .NET MAUI, Mac Catalyst, Templates, VS2022, Visual Studio, WinUI3, Preview 10, Code Snippets";
public const string Tags = "MAUI, iOS, Android, macOS, WinUI, Windows, Desktop, Mobile, Blazor, WinUI, .NET MAUI, Mac Catalyst, Templates, VS2022, Visual Studio, WinUI3, Preview 12, Code Snippets";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="MauiTemplates.20dca96a-7311-401f-84ed-980478fb319b"
Version="1.0.0.9"
Version="1.0.0.10"
Language="en-US"
Publisher="Vijay Anand E G" />
<DisplayName>.NET MAUI Project and Item Templates</DisplayName>
<Description xml:space="preserve">.NET MAUI Project, Item Templates, and Code Snippets for Visual Studio 2022 (.NET MAUI Preview 10).</Description>
<Description xml:space="preserve">.NET MAUI Project, Item Templates, and Code Snippets for Visual Studio 2022 (.NET MAUI Preview 12).</Description>
<MoreInfo>https://github.com/egvijayanand/dotnet-maui-templates</MoreInfo>
<License>license.txt</License>
<GettingStartedGuide>readme.rtf</GettingStartedGuide>
<ReleaseNotes>release-notes.txt</ReleaseNotes>
<Icon>Resources\Icon.png</Icon>
<PreviewImage>Resources\Icon.png</PreviewImage>
<Tags>MAUI, iOS, Android, macOS, WinUI, Windows, Desktop, Mobile, Blazor, WinUI, .NET MAUI, Mac Catalyst, Templates, VS2022, Visual Studio, WinUI3, Preview 10, Code Snippets</Tags>
<Tags>MAUI, iOS, Android, macOS, WinUI, Windows, Desktop, Mobile, Blazor, WinUI, .NET MAUI, Mac Catalyst, Templates, VS2022, Visual Studio, WinUI3, Preview 12, Code Snippets</Tags>
<Preview>true</Preview>
</Metadata>
<Installation>
Expand All @@ -37,7 +37,7 @@
Version="[17.1,)"
DisplayName="Visual Studio core editor" />
<Prerequisite Id="Microsoft.VisualStudio.ComponentGroup.Maui.All"
Version="[17.1.31902.195,18.0)"
Version="[17.1.32112.364,18.0)"
DisplayName=".NET MAUI (Preview)" />
</Prerequisites>
<Assets>
Expand Down Expand Up @@ -101,5 +101,10 @@
Path="ProjectTemplates"
TargetVersion="[17.1, 18.0)"
d:TargetPath="ProjectTemplates\MauiAppCS.zip" />
<Asset Type="Microsoft.VisualStudio.ItemTemplate"
d:Source="File"
Path="ItemTemplates"
TargetVersion="[17.1, 18.0)"
d:TargetPath="ItemTemplates\MauiResDictXaml.zip" />
</Assets>
</PackageManifest>
6 changes: 3 additions & 3 deletions src/ItemTemplates/MauiPageCS/MauiPageCS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class $safeitemname$ : ContentPage
{
public $safeitemname$()
{
BackgroundColor = Colors.White;
BackgroundColor = Colors.White;
Content = new StackLayout
{
Children =
Expand All @@ -22,8 +22,8 @@ public class $safeitemname$ : ContentPage
{
Text = "Welcome to .NET MAUI!!!",
TextColor = Colors.Purple,
HorizontalOptions = LayoutOptions.CenterAndExpand,
VerticalOptions = LayoutOptions.CenterAndExpand
HorizontalOptions = LayoutOptions.Center,
VerticalOptions = LayoutOptions.Center
}
}
};
Expand Down
16 changes: 8 additions & 8 deletions src/ItemTemplates/MauiPageXaml/MauiPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:$rootnamespace$"
BackgroundColor="White">
<ContentPage.Content>
<StackLayout>
<Label Text="Welcome to .NET MAUI!!!"
HorizontalOptions="CenterAndExpand"
TextColor="Purple"
VerticalOptions="CenterAndExpand"/>
</StackLayout>
</ContentPage.Content>
<ContentPage.Content>
<StackLayout>
<Label Text="Welcome to .NET MAUI!!!"
HorizontalOptions="Center"
TextColor="Purple"
VerticalOptions="Center"/>
</StackLayout>
</ContentPage.Content>
</ContentPage>
15 changes: 15 additions & 0 deletions src/ItemTemplates/MauiResDictXaml/MauiResDictXaml.vstemplate
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<VSTemplate Version="3.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Item">
<TemplateData>
<DefaultName>MyTheme.xaml</DefaultName>
<Name>Resource Dictionary (XAML only)(.NET MAUI)</Name>
<Description>A page for defining resources using only XAML.</Description>
<ProjectType>CSharp</ProjectType>
<ProjectSubType>MAUI</ProjectSubType>
<SortOrder>100</SortOrder>
<Icon>__TemplateIcon.ico</Icon>
</TemplateData>
<TemplateContent>
<References/>
<ProjectItem TargetFileName="$fileinputname$.xaml" ReplaceParameters="true">MauiResDictXaml.xaml</ProjectItem>
</TemplateContent>
</VSTemplate>
9 changes: 9 additions & 0 deletions src/ItemTemplates/MauiResDictXaml/MauiResDictXaml.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xaml-comp compile="true" ?>
<ResourceDictionary xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:$rootnamespace$">
<!--
Define your resources here
-->
</ResourceDictionary>
Binary file not shown.
6 changes: 3 additions & 3 deletions src/ItemTemplates/MauiViewCS/MauiViewCS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class $safeitemname$ : ContentView
{
public $safeitemname$()
{
BackgroundColor = Colors.White;
BackgroundColor = Colors.White;
Content = new StackLayout
{
Children =
Expand All @@ -22,8 +22,8 @@ public class $safeitemname$ : ContentView
{
Text = "Welcome to .NET MAUI!!!",
TextColor = Colors.Purple,
HorizontalOptions = LayoutOptions.CenterAndExpand,
VerticalOptions = LayoutOptions.CenterAndExpand
HorizontalOptions = LayoutOptions.Center,
VerticalOptions = LayoutOptions.Center
}
}
};
Expand Down
16 changes: 8 additions & 8 deletions src/ItemTemplates/MauiViewXaml/MauiView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:$rootnamespace$"
BackgroundColor="White">
<ContentView.Content>
<StackLayout>
<Label Text="Welcome to .NET MAUI!!!"
HorizontalOptions="CenterAndExpand"
TextColor="Purple"
VerticalOptions="CenterAndExpand"/>
</StackLayout>
</ContentView.Content>
<ContentView.Content>
<StackLayout>
<Label Text="Welcome to .NET MAUI!!!"
HorizontalOptions="Center"
TextColor="Purple"
VerticalOptions="Center"/>
</StackLayout>
</ContentView.Content>
</ContentView>
23 changes: 9 additions & 14 deletions src/ProjectTemplates/MauiApp/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
using Microsoft.Maui;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;
using Application = Microsoft.Maui.Controls.Application;

namespace $safeprojectname$
namespace $safeprojectname$
{
public partial class App : Application
{
public App()
{
InitializeComponent();
public partial class App : Application
{
public App()
{
InitializeComponent();

MainPage = new MainPage();
}
}
MainPage = new MainPage();
}
}
}
Loading

0 comments on commit bf196d0

Please sign in to comment.