Skip to content

Commit

Permalink
[Bug]: cake build missing property and app bar buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
Strypper committed Feb 11, 2023
1 parent 0fcb0e0 commit 6bad677
Show file tree
Hide file tree
Showing 6 changed files with 134 additions and 0 deletions.
14 changes: 14 additions & 0 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,23 @@ class {name}ControlInfo : IControlInfo
xmlns=""http://schemas.microsoft.com/dotnet/2021/maui""
xmlns:x=""http://schemas.microsoft.com/winfx/2009/xaml""
xmlns:app=""clr-namespace:MAUIsland""
Padding=""10""
x:Class=""MAUIsland.{name}Page""
x:DataType=""app:{name}PageViewModel""
Title=""{name}"">
<app:BasePage.ToolbarItems>
<ToolbarItem
Command=""{{x:Binding OpenUrlCommand}}""
CommandParameter=""{{x:Binding ControlInformation.GitHubUrl}}""
IconImageSource=""github.png""
Text=""Source code"" />
<ToolbarItem
Command=""{{x:Binding OpenUrlCommand}}""
CommandParameter=""{{x:Binding ControlInformation.DocumentUrl}}""
IconImageSource=""microsoft.png""
Text=""Original Document"" />
</app:BasePage.ToolbarItems>
<app:BasePage.Resources>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using Syncfusion.Maui.Core;

namespace MAUIsland.Gallery.Syncfusion;
class SfBadgeViewControlInfo : IControlInfo
{
public string ControlName => nameof(SfBadgeView);
public string ControlRoute => typeof(SfBadgeViewPage).FullName;
public ImageSource ControlIcon => new FontImageSource()
{
FontFamily = FontNames.FluentSystemIconsRegular,
Glyph = FluentUIIcon.Ic_fluent_mail_alert_24_regular
};
public string ControlDetail => "Badges are used to notify users of new or unread messages, notifications, or the status of something.";
public string GitHubUrl => $"https://github.com/Strypper/mauisland/tree/main/src/Features/Gallery/Pages/Syncfusion/{ControlName}";
public string DocumentUrl => $"https://help.syncfusion.com/maui/badge-view/overview";
public string GroupName => ControlGroupInfo.SyncfusionControls;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8" ?>
<app:BasePage
x:Class="MAUIsland.SfBadgeViewPage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:app="clr-namespace:MAUIsland"
Title="SfBadgeView"
Padding="10"
x:DataType="app:SfBadgeViewPageViewModel">

<app:BasePage.ToolbarItems>
<ToolbarItem
Command="{x:Binding OpenUrlCommand}"
CommandParameter="{x:Binding ControlInformation.GitHubUrl}"
IconImageSource="github.png"
Text="Source code" />
<ToolbarItem
Command="{x:Binding OpenUrlCommand}"
CommandParameter="{x:Binding ControlInformation.DocumentUrl}"
IconImageSource="syncfusion_logo.png"
Text="Original Document" />
</app:BasePage.ToolbarItems>

<app:BasePage.Resources>

<x:String x:Key="PropertiesListHeader">
SfBadgeView defines the following properties:
</x:String>

<x:String x:Key="PropertiesListFooter">
These properties are backed by BindableProperty objects, which means that they can be targets of data bindings, and styled.
</x:String>

<x:Array x:Key="PropertiesItemsSource" Type="{x:Type x:String}">
<x:String>
<![CDATA[
<strong style="color:blue">Color</strong>, of type <strong style="color:blue">Color </strong>, value that defines the color of the ActivityIndicator.
]]>
</x:String>
<x:String>
<![CDATA[
<strong style="color:blue">IsRunning</strong>, of type <strong style="color:blue">bool</strong>,value that indicates whether the ActivityIndicator should be visible and animating, or hidden. The default value of this property is false, which indicates that the ActivityIndicator isn't visible.
]]>
</x:String>
</x:Array>


</app:BasePage.Resources>

<ScrollView>
<VerticalStackLayout Spacing="20">
<Frame Style="{x:StaticResource DocumentContentFrameStyle}">
<Label Text="{x:Binding ControlInformation.ControlDetail}" />
</Frame>
<Frame Style="{x:StaticResource DocumentContentFrameStyle}">
<CollectionView
Footer="{x:StaticResource PropertiesListFooter}"
Header="{x:StaticResource PropertiesListHeader}"
ItemsSource="{x:StaticResource PropertiesItemsSource}"
Style="{x:StaticResource PropertiesListStyle}" />
</Frame>
</VerticalStackLayout>
</ScrollView>
</app:BasePage>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace MAUIsland;
public partial class SfBadgeViewPage : IControlPage
{
#region [CTor]
public SfBadgeViewPage(SfBadgeViewPageViewModel vm)
{
InitializeComponent();

BindingContext = vm;
}
#endregion
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
namespace MAUIsland;
public partial class SfBadgeViewPageViewModel : NavigationAwareBaseViewModel
{
#region [CTor]
public SfBadgeViewPageViewModel(
IAppNavigator appNavigator
) : base(appNavigator)
{
}
#endregion

#region [Properties]
[ObservableProperty]
IControlInfo controlInformation;
#endregion

#region [Overrides]
protected override void OnInit(IDictionary<string, object> query)
{
base.OnInit(query);

ControlInformation = query.GetData<IControlInfo>();

}
#endregion
}
1 change: 1 addition & 0 deletions src/MauiProgram.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using CommunityToolkit.Maui;
using CommunityToolkit.Maui.Core;
using CommunityToolkit.Maui.Storage;
using Microsoft.Extensions.Logging;
using Microsoft.Maui.Handlers;
using Refit;
using SkiaSharp.Views.Maui.Controls.Hosting;
Expand Down

0 comments on commit 6bad677

Please sign in to comment.