Skip to content

Commit

Permalink
- remove defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
PureWeen committed Jul 1, 2021
1 parent 9cabc82 commit 19133bc
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 57 deletions.
4 changes: 1 addition & 3 deletions src/Core/src/Handlers/DatePicker/DatePickerHandler.iOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,9 @@ protected override void DisconnectHandler(MauiDatePicker nativeView)
base.DisconnectHandler(nativeView);
}

protected override void SetupDefaults(MauiDatePicker nativeView)
void SetupDefaults(MauiDatePicker nativeView)
{
_defaultTextColor = nativeView.TextColor;

base.SetupDefaults(nativeView);
}

public static void MapFormat(DatePickerHandler handler, IDatePicker datePicker)
Expand Down
7 changes: 0 additions & 7 deletions src/Core/src/Handlers/Defaults.cs

This file was deleted.

14 changes: 0 additions & 14 deletions src/Core/src/Handlers/Element/ElementHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ public abstract partial class ElementHandler : IElementHandler
{
};

protected abstract bool HasSetDefaults { get; set; }

protected PropertyMapper _mapper;
protected readonly PropertyMapper _defaultMapper;

Expand Down Expand Up @@ -54,13 +52,6 @@ public virtual void SetVirtualView(IElement view)
ConnectHandler(NativeView);
}

if (!HasSetDefaults)
{
SetupDefaults(NativeView);

HasSetDefaults = true;
}

_mapper = _defaultMapper;

if (VirtualView is IPropertyMapperView imv)
Expand Down Expand Up @@ -89,11 +80,6 @@ public virtual void UpdateValue(string property)
object CreateNativeElement() =>
OnCreateNativeElement();

private protected abstract void OnSetupDefaults(object nativeView);

void SetupDefaults(object nativeView) =>
OnSetupDefaults(nativeView);

private protected abstract void OnConnectHandler(object nativeView);

void ConnectHandler(object nativeView) =>
Expand Down
14 changes: 0 additions & 14 deletions src/Core/src/Handlers/Element/ElementHandlerOfT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ public abstract partial class ElementHandler<TVirtualView, TNativeView> : Elemen
[HotReload.OnHotReload]
internal static void OnHotReload()
{
Defaults<ElementHandler<TVirtualView, TNativeView>>.HasSetDefaults = false;
}

protected ElementHandler(PropertyMapper mapper)
Expand All @@ -33,18 +32,8 @@ public new TVirtualView VirtualView

object? IElementHandler.NativeView => base.NativeView;

protected override bool HasSetDefaults
{
get => Defaults<ElementHandler<TVirtualView, TNativeView>>.HasSetDefaults;
set => Defaults<ElementHandler<TVirtualView, TNativeView>>.HasSetDefaults = value;
}

protected abstract TNativeView CreateNativeElement();

protected virtual void SetupDefaults(TNativeView nativeView)
{
}

protected virtual void ConnectHandler(TNativeView nativeView)
{
}
Expand All @@ -56,9 +45,6 @@ protected virtual void DisconnectHandler(TNativeView nativeView)
private protected override object OnCreateNativeElement() =>
CreateNativeElement();

private protected override void OnSetupDefaults(object nativeView) =>
SetupDefaults((TNativeView)nativeView);

private protected override void OnConnectHandler(object nativeView) =>
ConnectHandler((TNativeView)nativeView);

Expand Down
5 changes: 0 additions & 5 deletions src/Core/src/Handlers/View/ViewHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,6 @@ public bool HasContainer
OnCreateNativeView();

#if !NETSTANDARD
private protected abstract void OnSetupDefaults(NativeView nativeView);

private protected sealed override void OnSetupDefaults(object nativeView) =>
OnSetupDefaults((NativeView)nativeView);

private protected abstract void OnConnectHandler(NativeView nativeView);

partial void ConnectingHandler(NativeView? nativeView);
Expand Down
14 changes: 0 additions & 14 deletions src/Core/src/Handlers/View/ViewHandlerOfT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public abstract partial class ViewHandler<TVirtualView, TNativeView> : ViewHandl
[HotReload.OnHotReload]
internal static void OnHotReload()
{
Defaults<ViewHandler<TVirtualView, TNativeView>>.HasSetDefaults = false;
}

protected ViewHandler(PropertyMapper mapper)
Expand All @@ -48,12 +47,6 @@ public new TVirtualView VirtualView

object? IElementHandler.NativeView => base.NativeView;

protected override bool HasSetDefaults
{
get => Defaults<ViewHandler<TVirtualView, TNativeView>>.HasSetDefaults;
set => Defaults<ViewHandler<TVirtualView, TNativeView>>.HasSetDefaults = value;
}

public virtual void SetVirtualView(IView view) =>
base.SetVirtualView(view);

Expand All @@ -62,10 +55,6 @@ protected override bool HasSetDefaults

protected abstract TNativeView CreateNativeView();

protected virtual void SetupDefaults(TNativeView nativeView)
{
}

protected virtual void ConnectHandler(TNativeView nativeView)
{
}
Expand All @@ -77,9 +66,6 @@ protected virtual void DisconnectHandler(TNativeView nativeView)
private protected override NativeView OnCreateNativeView() =>
CreateNativeView();

private protected override void OnSetupDefaults(NativeView nativeView) =>
SetupDefaults((TNativeView)nativeView);

private protected override void OnConnectHandler(NativeView nativeView) =>
ConnectHandler((TNativeView)nativeView);

Expand Down

0 comments on commit 19133bc

Please sign in to comment.