Skip to content

Commit

Permalink
Merge pull request #33 from egvijayanand/working
Browse files Browse the repository at this point in the history
Maps package and auto xmlns scope for XCT
  • Loading branch information
egvijayanand authored Jun 25, 2024
2 parents 3055465 + 43d15e6 commit b592ad0
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 10 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ namespace VijayAnand.XFormsTemplates
{
public class CustomActionWizard : IWizard
{
const string Colon = ":";

bool xamlOnly;
bool userCancel;

Expand Down Expand Up @@ -60,14 +62,26 @@ public async void RunStarted(object automationObject,

var baseType = window.BaseType;
var genericType = window.GenericType;
var baseTypeCS = baseType.Contains(":") ? baseType.Substring(baseType.IndexOf(':') + 1) : baseType;
var genericTypeCS = genericType.Contains(":") ? genericType.Substring(genericType.IndexOf(':') + 1) : genericType;
var baseTypeCS = baseType.Contains(Colon) ? baseType.Substring(baseType.IndexOf(':') + 1) : baseType;
var genericTypeCS = genericType.Contains(Colon) ? genericType.Substring(genericType.IndexOf(':') + 1) : genericType;

if (!string.IsNullOrEmpty(baseType))
{
if (xamlItem)
{
string toolkit;

if (baseType.Contains(Colon) && string.Equals(baseType.Substring(0, baseType.IndexOf(':')), "xct", StringComparison.OrdinalIgnoreCase))
{
toolkit = bool.TrueString.ToLowerInvariant();
}
else
{
toolkit = bool.FalseString.ToLowerInvariant();
}

replacementsDictionary["$basetype$"] = baseType;
replacementsDictionary["$toolkit$"] = toolkit;

if (string.IsNullOrEmpty(genericTypeCS))
{
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[$RootKey$\TemplateEngine\Templates\VijayAnand.FormsTemplates\1.8.0]
[$RootKey$\TemplateEngine\Templates\VijayAnand.FormsTemplates\1.9.0]
"InstalledPath"="$PackageFolder$\ProjectTemplates"
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
[assembly: ComVisible(false)]

[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.1")]
[assembly: AssemblyInformationalVersion("1.0.0.1")]

namespace System.Runtime.CompilerServices
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
<IncludeInVSIX>true</IncludeInVSIX>
<VSIXSubPath>ItemTemplates\Xamarin.Forms</VSIXSubPath>
</Content>
<None Include="Assets\VijayAnand.FormsTemplates.1.8.0.nupkg" />
<None Include="Assets\VijayAnand.FormsTemplates.1.9.0.nupkg" />
<Content Include="ItemTemplates\FormsItem.zip">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
Join me on Developer Thoughts (https://egvijayanand.in/), an exclusive blog for articles on Xamarin.Forms, .NET MAUI, and Blazor.

What's new in ver. 1.8.0.0:
What's new in ver. 1.9.0.0:
---------------------------
Introduced an option to reference Xamarin.Forms.Maps NuGet package.

While using the generic item template, support for adding Xamarin Community Toolkit namespace while defining base types with that particular xmlns scope (xct).

v1.8.0.0:

Introduced using the NuGet CPM feature from within Visual Studio IDE.

v1.7.0.0:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ internal sealed partial class Vsix
public const string Name = "Xamarin.Forms Project and Item Templates";
public const string Description = @"Xamarin.Forms Project and Item Templates for building native apps for iOS, Android, UWP, macOS, Tizen from a single, shared C# codebase.";
public const string Language = "en-US";
public const string Version = "1.8.0.0";
public const string Version = "1.9.0.0";
public const string Author = "Vijay Anand E G";
public const string Tags = "Xamarin.Forms, Mobile, iOS, Android, UWP, Desktop, Windows, Templates, Shell, Library, Visual Studio, Resource Dictionary, Xamarin, macOS, Tizen";
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="XFormsTemplates.2924dcc2-7ffd-4b48-8828-c830a2fab6e0" Version="1.8.0.0" Language="en-US" Publisher="Vijay Anand E G" />
<Identity Id="XFormsTemplates.2924dcc2-7ffd-4b48-8828-c830a2fab6e0" Version="1.9.0.0" Language="en-US" Publisher="Vijay Anand E G" />
<DisplayName>Xamarin.Forms Project and Item Templates</DisplayName>
<Description xml:space="preserve">Xamarin.Forms Project and Item Templates for building native apps for iOS, Android, UWP, macOS, Tizen from a single, shared C# codebase.</Description>
<MoreInfo>https://egvijayanand.in/category/xamarin/</MoreInfo>
Expand All @@ -10,7 +10,7 @@
<ReleaseNotes>release-notes.txt</ReleaseNotes>
<Icon>Resources\Icon.png</Icon>
<PreviewImage>Resources\Icon.png</PreviewImage>
<Tags>Xamarin.Forms, Mobile, iOS, Android, UWP, Desktop, Windows, Templates, Shell, Library, Visual Studio, Resource Dictionary, Xamarin, macOS, Tizen</Tags>
<Tags>Xamarin.Forms, Mobile, iOS, Android, UWP, Desktop, Windows, Templates, Shell, Library, Visual Studio, Resource Dictionary, Xamarin, macOS, Tizen, Maps, Cross Platform, Cross-Platform, Xamarin</Tags>
</Metadata>
<Installation>
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[17.0,18.0)">
Expand Down
1 change: 1 addition & 0 deletions src/ItemTemplates/FormsItem/FormsItem.vstemplate
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<ProjectItem TargetFileName="$fileinputname$.xaml.cs" ReplaceParameters="true">FormsItem.xaml.cs</ProjectItem>
<CustomParameters>
<CustomParameter Name="$generic$" Value="" />
<CustomParameter Name="$toolkit$" Value="" />
<CustomParameter Name="$xaml$" Value="" />
<CustomParameter Name="$basetype$" Value="" />
<CustomParameter Name="$csbasetype$" Value="" />
Expand Down
3 changes: 3 additions & 0 deletions src/ItemTemplates/FormsItem/FormsItem.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ $endif$
xmlns:d="http://xamarin.com/schemas/2014/forms/design"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:$rootnamespace$"
$if$ ($toolkit$ == true)
xmlns:xct="http://xamarin.com/schemas/2020/toolkit"
$endif$
$if$ ($generic$ == true)
x:TypeArguments="$typearg$"
$endif$
Expand Down
5 changes: 5 additions & 0 deletions src/ItemTemplates/FormsItem/FormsItem.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Xamarin.Forms;
using Xamarin.Forms.Xaml;
$if$ ($toolkit$ == true)

using Xamarin.CommunityToolkit.UI.Views;
$endif$

namespace $rootnamespace$
{
Expand Down

0 comments on commit b592ad0

Please sign in to comment.