Skip to content

Commit

Permalink
🔥 Change structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Strypper committed Jul 21, 2023
1 parent e655d6f commit ba71c9a
Show file tree
Hide file tree
Showing 278 changed files with 1,301 additions and 802 deletions.
8 changes: 4 additions & 4 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Task("BuiltInControlPage")

Information($"\n>> Generate >> {name}ControlInfo.cs");
FileWriteText($"{controlFolderPath}/{name}ControlInfo.cs", $@"namespace MAUIsland.Gallery.{group};
class {name}ControlInfo : IControlInfo
class {name}ControlInfo : IGalleryCardInfo
{{
public string ControlName => nameof({name});
public string ControlRoute => typeof({name}Page).FullName;
Expand Down Expand Up @@ -111,7 +111,7 @@ class {name}ControlInfo : IControlInfo

Information($"\n>> Generate >> {name}Page.xaml.cs");
FileWriteText($"{controlFolderPath}/{name}Page.xaml.cs", $@"namespace MAUIsland;
public partial class {name}Page : IControlPage
public partial class {name}Page : IGalleryPage
{{
#region [CTor]
public {name}Page({name}PageViewModel vm)
Expand All @@ -137,15 +137,15 @@ public partial class {name}PageViewModel : NavigationAwareBaseViewModel
#region [Properties]
[ObservableProperty]
IControlInfo controlInformation;
IGalleryCardInfo controlInformation;
#endregion
#region [Overrides]
protected override void OnInit(IDictionary<string, object> query)
{{
base.OnInit(query);
ControlInformation = query.GetData<IControlInfo>();
ControlInformation = query.GetData<IGalleryCardInfo>();
}}
#endregion
Expand Down
2 changes: 1 addition & 1 deletion src/.meteor/generated/MAUIsland.json

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions src/AppRoutes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ public static class AppRoutes
public const string HomePage = "homePage";
public const string GalleryPage = "galleryPage";
public const string ChatPage = "chatPage";

public const string SignUp = "signUp";

public const string ControlsByGroupPage = nameof(ControlsByGroupPage);
public const string CardsByGroupPage = nameof(CardsByGroupPage);
}
4 changes: 2 additions & 2 deletions src/AppShell.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace MAUIsland;

public partial class AppShell : Shell
{
#region [Services]
#region [ Fields ]
private readonly IAppInfo appInfo;

private readonly AppSettings appSettings;
Expand All @@ -30,7 +30,7 @@ public AppShell()
#region [Methods]
void RegisterRoutes()
{
Routing.RegisterRoute(nameof(ControlsByGroupPage), typeof(ControlsByGroupPage));
Routing.RegisterRoute(nameof(CardsByGroupPage), typeof(CardsByGroupPage));
}
void WriteAppVersion()
{
Expand Down
12 changes: 6 additions & 6 deletions src/Features/Gallery/ContentViews/ControlCardContentView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ public ControlCardContentView()
#endregion

#region [Delegates]
public delegate void DetailEventHandler(IControlInfo control);
public delegate void DetailEventHandler(IGalleryCardInfo control);

public delegate void DetailInNewWindowEventHandler(IControlInfo control);
public delegate void DetailInNewWindowEventHandler(IGalleryCardInfo control);
#endregion

#region [Event Handlers]
Expand All @@ -26,18 +26,18 @@ public ControlCardContentView()
#region [Bindable Properties]
public static readonly BindableProperty ComponentDataProperty = BindableProperty.Create(
nameof(ComponentData),
typeof(IControlInfo),
typeof(IGalleryCardInfo),
typeof(ControlCardContentView),
default(IControlInfo)
default(IGalleryCardInfo)
);

public ICommand TapCommand => new Command<string>(async (url) => await Launcher.OpenAsync(url));
#endregion

#region [Properties]
public IControlInfo ComponentData
public IGalleryCardInfo ComponentData
{
get => (IControlInfo)GetValue(ComponentDataProperty);
get => (IGalleryCardInfo)GetValue(ComponentDataProperty);
set => SetValue(ComponentDataProperty, value);
}
#endregion
Expand Down
14 changes: 7 additions & 7 deletions src/Features/Gallery/ContentViews/GithubCardContentView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ public GithubCardContentView()
#endregion

#region [Delegates]
public delegate void DetailEventHandler(IGithubControlInfo control);
public delegate void DetailEventHandler(IGithubGalleryCardInfo control);

public delegate void DetailInNewWindowEventHandler(IGithubControlInfo control);
public delegate void DetailInNewWindowEventHandler(IGithubGalleryCardInfo control);
#endregion

#region [Event Handlers]
#region [ Events ]
public event DetailEventHandler DetailClicked;

public event DetailInNewWindowEventHandler DetailInNewWindowClicked;
Expand All @@ -24,18 +24,18 @@ public GithubCardContentView()
#region [Bindable Properties]
public static readonly BindableProperty ComponentDataProperty = BindableProperty.Create(
nameof(ComponentData),
typeof(IGithubControlInfo),
typeof(IGithubGalleryCardInfo),
typeof(GithubCardContentView),
default(IGithubControlInfo)
default(IGithubGalleryCardInfo)
);

public ICommand TapCommand => new Command<string>(async (url) => await Launcher.OpenAsync(url));
#endregion

#region [Properties]
public IGithubControlInfo ComponentData
public IGithubGalleryCardInfo ComponentData
{
get => (IGithubControlInfo)GetValue(ComponentDataProperty);
get => (IGithubGalleryCardInfo)GetValue(ComponentDataProperty);
set => SetValue(ComponentDataProperty, value);
}
#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ public MaterialUICardContentView()
#endregion

#region [Delegates]
public delegate void DetailEventHandler(IMaterialUIControlInfo control);
public delegate void DetailEventHandler(IMaterialUIGalleryCardInfo control);

public delegate void DetailInNewWindowEventHandler(IMaterialUIControlInfo control);
public delegate void DetailInNewWindowEventHandler(IMaterialUIGalleryCardInfo control);
#endregion

#region [Event Handlers]
Expand All @@ -25,14 +25,14 @@ public MaterialUICardContentView()
#region [ Properties ]
public static readonly BindableProperty ComponentDataProperty = BindableProperty.Create(
nameof(ComponentData),
typeof(IMaterialUIControlInfo),
typeof(IMaterialUIGalleryCardInfo),
typeof(MaterialUICardContentView),
default(IMaterialUIControlInfo)
default(IMaterialUIGalleryCardInfo)
);

public IMaterialUIControlInfo ComponentData
public IMaterialUIGalleryCardInfo ComponentData
{
get => (IMaterialUIControlInfo)GetValue(ComponentDataProperty);
get => (IMaterialUIGalleryCardInfo)GetValue(ComponentDataProperty);
set => SetValue(ComponentDataProperty, value);
}
#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ public SyncfusionCardContentView()
#endregion

#region [Delegates]
public delegate void DetailEventHandler(IControlInfo control);
public delegate void DetailEventHandler(IGalleryCardInfo control);

public delegate void DetailInNewWindowEventHandler(IControlInfo control);
public delegate void DetailInNewWindowEventHandler(IGalleryCardInfo control);
#endregion

#region [Event Handlers]
Expand All @@ -24,18 +24,18 @@ public SyncfusionCardContentView()
#region [Bindable Properties]
public static readonly BindableProperty ComponentDataProperty = BindableProperty.Create(
nameof(ComponentData),
typeof(IControlInfo),
typeof(IGalleryCardInfo),
typeof(ControlCardContentView),
default(IControlInfo)
default(IGalleryCardInfo)
);

public ICommand TapCommand => new Command<string>(async (url) => await Launcher.OpenAsync(url));
#endregion

#region [Properties]
public IControlInfo ComponentData
public IGalleryCardInfo ComponentData
{
get => (IControlInfo)GetValue(ComponentDataProperty);
get => (IGalleryCardInfo)GetValue(ComponentDataProperty);
set => SetValue(ComponentDataProperty, value);
}
#endregion
Expand Down
6 changes: 6 additions & 0 deletions src/Features/Gallery/Core/IBuiltInGalleryCardInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace MAUIsland;

public interface IBuiltInGalleryCardInfo : IGalleryCardInfo
{
BuiltInGalleryCardStatus Status { get; }
}
5 changes: 5 additions & 0 deletions src/Features/Gallery/Core/ICommunityToolkitGalleryCardInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
namespace MAUIsland;

interface ICommunityToolkitGalleryCardInfo : IGalleryCardInfo
{
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace MAUIsland;

public interface IControlInfo
public interface IGalleryCardInfo
{
ImageSource ControlIcon { get; }
string ControlName { get; }
Expand All @@ -9,4 +9,10 @@ public interface IControlInfo
string GitHubUrl { get; }
string DocumentUrl { get; }
string GroupName { get; }
GalleryCardType CardType { get; }
GalleryCardStatus CardStatus { get; }
DateTime LastUpdate { get; }
List<string> DoList { get; }
List<string> DontList { get; }
}

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace MAUIsland;

public interface IControlPage
public interface IGalleryPage
{
}

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace MAUIsland;

public interface IGithubControlInfo : IControlInfo
public interface IGithubGalleryCardInfo : IGalleryCardInfo
{
string RepositoryUrl { get; }
string AuthorUrl { get; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace MAUIsland;

public interface IMaterialUIControlInfo : IControlInfo
public interface IMaterialUIGalleryCardInfo : IGalleryCardInfo
{
IconKind MaterialIcon { get; }
List<PlatformInfo> SupportedPlatformsInfo { get; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class BrandCardTemplateSelector : DataTemplateSelector
public DataTemplate SyncfustionCardTemplate { get; set; }
protected override DataTemplate OnSelectTemplate(object item, BindableObject container)
{
var controlGroup = ((IControlInfo)item).GroupName;
var controlGroup = ((IGalleryCardInfo)item).GroupName;
switch (controlGroup)
{
case ControlGroupInfo.SyncfusionControls:
Expand Down
6 changes: 6 additions & 0 deletions src/Features/Gallery/Enums/BuiltInGalleryCardStatus.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace MAUIsland;

public enum BuiltInGalleryCardStatus
{
All, Stable, Buggy, ExtremelyBuggy, Experimental, Deprecated, Unverified
}
6 changes: 6 additions & 0 deletions src/Features/Gallery/Enums/GalleryCardStatus.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace MAUIsland;

public enum GalleryCardStatus
{
Completed, NotCompleted
}
6 changes: 6 additions & 0 deletions src/Features/Gallery/Enums/GalleryCardType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace MAUIsland;

public enum GalleryCardType
{
Control, Converter, Layout, Behavior, Extensions, Helper, Other
}
12 changes: 6 additions & 6 deletions src/Features/Gallery/Handlers/CardsSearchHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@ public CardsSearchHandler()

#region [Bindable Properties]
public static readonly BindableProperty CardsProperty = BindableProperty.Create(nameof(Cards),
typeof(ObservableCollection<IControlInfo>),
typeof(ObservableCollection<IGalleryCardInfo>),
typeof(CardsSearchHandler),
new ObservableCollection<IControlInfo>(),
new ObservableCollection<IGalleryCardInfo>(),
BindingMode.OneWay);
#endregion

#region [Properties]
public ObservableCollection<IControlInfo> Cards
public ObservableCollection<IGalleryCardInfo> Cards
{
get => (ObservableCollection<IControlInfo>)GetValue(CardsProperty);
get => (ObservableCollection<IGalleryCardInfo>)GetValue(CardsProperty);
set => SetValue(CardsProperty, value);
}
#endregion

#region [Delegates]
public delegate void SelectCardEventHandler(IControlInfo control);
public delegate void SelectCardEventHandler(IGalleryCardInfo control);
#endregion

#region [Event Handlers]
Expand All @@ -51,7 +51,7 @@ protected override void OnQueryChanged(string oldValue, string newValue)
protected override async void OnItemSelected(object item)
{
base.OnItemSelected(item);
var selectedCard = item as IControlInfo;
var selectedCard = item as IGalleryCardInfo;
SelectCard?.Invoke(selectedCard);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace MAUIsland.Gallery.BuiltIn;
namespace MAUIsland;

class ActivityIndicatorControlInfo : IControlInfo
class ActivityIndicatorControlInfo : IBuiltInGalleryCardInfo
{
public string ControlName => nameof(ActivityIndicator);
public string ControlRoute => typeof(ActivityIndicatorPage).FullName;
Expand All @@ -14,4 +14,10 @@ class ActivityIndicatorControlInfo : IControlInfo
public string GitHubUrl => $"https://github.com/Strypper/mauisland/tree/main/src/Features/Gallery/Pages/BuiltIn/{ControlName}";
public string DocumentUrl => $"https://learn.microsoft.com/en-us/dotnet/maui/user-interface/controls/{ControlName}/?view=net-maui-7.0";
public string GroupName => ControlGroupInfo.BuiltInControls;
public BuiltInGalleryCardStatus Status => BuiltInGalleryCardStatus.Stable;
public GalleryCardType CardType => GalleryCardType.Control;
public GalleryCardStatus CardStatus => throw new NotImplementedException();
public DateTime LastUpdate => throw new NotImplementedException();
public List<string> DoList => throw new NotImplementedException();
public List<string> DontList => throw new NotImplementedException();
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace MAUIsland;

public partial class ActivityIndicatorPage : IControlPage
public partial class ActivityIndicatorPage : IGalleryPage
{
public ActivityIndicatorPage(ActivityIndicatorPageViewModel vm)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public ActivityIndicatorPageViewModel(IAppNavigator appNavigator)

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

[ObservableProperty]
string groupOfActivityIndicators = "<HorizontalStackLayout HorizontalOptions=\"Start\" Spacing=\"10\">\r\n <ActivityIndicator IsRunning=\"True\" />\r\n\r\n <ActivityIndicator IsRunning=\"True\" Color=\"Green\" />\r\n\r\n <ActivityIndicator IsRunning=\"True\" Color=\"Red\" />\r\n\r\n <ActivityIndicator IsRunning=\"true\" Color=\"Aqua\" />\r\n </HorizontalStackLayout>";
Expand All @@ -26,7 +26,7 @@ protected override void OnInit(IDictionary<string, object> query)
{
base.OnInit(query);

ControlInformation = query.GetData<IControlInfo>();
ControlInformation = query.GetData<IGalleryCardInfo>();

}
#endregion
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace MAUIsland;

class ButtonControlInfo : IControlInfo
class ButtonControlInfo : IBuiltInGalleryCardInfo
{
public ImageSource ControlIcon => new FontImageSource()
{
Expand All @@ -14,4 +14,10 @@ class ButtonControlInfo : IControlInfo
public string GitHubUrl => $"https://github.com/Strypper/mauisland/tree/main/src/Features/Gallery/Pages/BuiltIn/{ControlName}";
public string DocumentUrl => $"https://learn.microsoft.com/en-us/dotnet/maui/user-interface/controls/{ControlName}/?view=net-maui-7.0";
public string GroupName => ControlGroupInfo.BuiltInControls;
public BuiltInGalleryCardStatus Status => BuiltInGalleryCardStatus.Buggy;
public GalleryCardType CardType => GalleryCardType.Control;
public GalleryCardStatus CardStatus => throw new NotImplementedException();
public DateTime LastUpdate => throw new NotImplementedException();
public List<string> DoList => throw new NotImplementedException();
public List<string> DontList => throw new NotImplementedException();
}
Loading

0 comments on commit ba71c9a

Please sign in to comment.