Skip to content

Commit

Permalink
Working on StartupSample template
Browse files Browse the repository at this point in the history
  • Loading branch information
adospace committed Nov 20, 2024
1 parent ecbed6d commit 1d048ac
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 35 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using MauiReactor.Internals;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MauiReactorTemplate.StartupSampleXaml.Framework;

Expand Down Expand Up @@ -61,44 +56,53 @@ partial class SfShimmer
{

}
//partial interface ISfShimmer
//{
// public VisualNode CustomView { get; set; }
//}

partial interface ISfShimmer
{
public VisualNode? CustomView { get; set; }
}

//partial class SfShimmer<T>
//{
// VisualNode ISfShimmer.CustomView { get; set; }
partial class SfShimmer<T>
{
VisualNode? ISfShimmer.CustomView { get; set; }

// protected override IEnumerable<VisualNode> RenderChildren()
// {
// var thisAsISfShimmer = (ISfShimmer)this;
protected override IEnumerable<VisualNode> RenderChildren()
{
var thisAsISfShimmer = (ISfShimmer)this;

// var children = base.RenderChildren();
var children = base.RenderChildren();

// if (thisAsISfShimmer.CustomView != null)
// {
// children = children.Concat(new[] { thisAsISfShimmer.CustomView });
// }
if (thisAsISfShimmer.CustomView != null)
{
children = children.Concat([thisAsISfShimmer.CustomView]);
}

// return children;
// }
return children;
}

// protected override void OnAddChild(VisualNode widget, BindableObject childControl)
// {
// Validate.EnsureNotNull(NativeControl);
protected override void OnAddChild(VisualNode widget, BindableObject childControl)
{
Validate.EnsureNotNull(NativeControl);

// var thisAsISfShimmer = (ISfShimmer)this;
var thisAsISfShimmer = (ISfShimmer)this;

// if (widget == thisAsISfShimmer.CustomView)
// {
// NativeControl.CustomView = (View)childControl;
// }
if (widget == thisAsISfShimmer.CustomView)
{
NativeControl.CustomView = (View)childControl;
}

base.OnAddChild(widget, childControl);
}
}

// base.OnAddChild(widget, childControl);
// }
//}
partial class SfShimmerExtensions
{
public static T CustomView<T>(this T shimmer, VisualNode? customView) where T : ISfShimmer
{
shimmer.CustomView = customView;
return shimmer;
}
}

[Scaffold(typeof(Syncfusion.Maui.Toolkit.Shimmer.ShimmerView))]
partial class ShimmerView
Expand All @@ -112,7 +116,6 @@ partial class SfEffectsView

}


[Scaffold(typeof(Syncfusion.Maui.Toolkit.SegmentedControl.SfSegmentedControl))]
partial class SfSegmentedControl
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.Maui.Controls" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.0" />
<PackageReference Include="Reactor.Maui" Version="3.0.3-beta" />
<PackageReference Include="Reactor.Maui" Version="3.0.4-beta" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 1d048ac

Please sign in to comment.