Table of Contents

Class SkiaViewSwitcher

Namespace
DrawnUi.Controls
Assembly
DrawnUi.Maui.dll

Display and hide views, eventually animating them

public class SkiaViewSwitcher : SkiaLayout, INotifyPropertyChanged, IEffectControlProvider, IToolTipElement, IContextFlyoutElement, IAnimatable, IVisualElementController, IElementController, IView, ITransform, IElement, IVisualTreeElement, IContainer, IList<IView>, ICollection<IView>, IEnumerable<IView>, IEnumerable, ISkiaGestureListener, IHasAfterEffects, ISkiaDisposable, ISkiaGridLayout, ISkiaLayout, ISkiaControl, IDrawnBase, ICanBeUpdatedWithContext, ICanBeUpdated, ILayoutInsideViewport, IInsideViewport, IDisposable, IDefinesViewport, IVisibilityAware
Inheritance
SkiaViewSwitcher
Implements
Inherited Members
Extension Methods

Constructors

SkiaViewSwitcher()

public SkiaViewSwitcher()

Fields

Custom

public static readonly Easing Custom

Field Value

Easing

DisplayingIndexProperty

public static readonly BindableProperty DisplayingIndexProperty

Field Value

BindableProperty

FirstViewAppeared

protected bool FirstViewAppeared

Field Value

bool

IsAnimatingProperty

public static readonly BindableProperty IsAnimatingProperty

Field Value

BindableProperty

IsApplyingIdex

protected bool IsApplyingIdex

Field Value

bool

IsRendered

public bool IsRendered

Field Value

bool

NavigationBusyProperty

public static readonly BindableProperty NavigationBusyProperty

Field Value

BindableProperty

NavigationStacks

for navigation inside pseudo tabs

public Dictionary<int, List<SkiaViewSwitcher.NavigationStackEntry>> NavigationStacks

Field Value

Dictionary<int, List<SkiaViewSwitcher.NavigationStackEntry>>

PagesAnimationEasingProperty

public static readonly BindableProperty PagesAnimationEasingProperty

Field Value

BindableProperty

PagesAnimationSpeedProperty

public static readonly BindableProperty PagesAnimationSpeedProperty

Field Value

BindableProperty

PreviousVisibleViewIndex

protected int PreviousVisibleViewIndex

Field Value

int

SelectedIndexProperty

public static readonly BindableProperty SelectedIndexProperty

Field Value

BindableProperty

SemaphoreNavigationStack

protected SemaphoreSlim SemaphoreNavigationStack

Field Value

SemaphoreSlim

TabsAnimationEasingProperty

public static readonly BindableProperty TabsAnimationEasingProperty

Field Value

BindableProperty

TabsAnimationSpeedProperty

public static readonly BindableProperty TabsAnimationSpeedProperty

Field Value

BindableProperty

TimerUpdateLocked

protected RestartingTimer<(int, bool)> TimerUpdateLocked

Field Value

RestartingTimer<(int, bool)>

Properties

ActiveView

public SkiaViewSwitcher.NavigationStackEntry ActiveView { get; set; }

Property Value

SkiaViewSwitcher.NavigationStackEntry

AnimatePages

public bool AnimatePages { get; set; }

Property Value

bool

AnimateTabs

public bool AnimateTabs { get; set; }

Property Value

bool

DisplayingIndex

public int DisplayingIndex { get; set; }

Property Value

int

IsAnimating

public bool IsAnimating { get; set; }

Property Value

bool

IsPopping

public bool IsPopping { get; protected set; }

Property Value

bool

IsPushing

public bool IsPushing { get; protected set; }

Property Value

bool

NavigationBusy

public bool NavigationBusy { get; set; }

Property Value

bool

PagesAnimationEasing

public Easing PagesAnimationEasing { get; set; }

Property Value

Easing

PagesAnimationSpeed

public int PagesAnimationSpeed { get; set; }

Property Value

int

PreviousVisibleView

public SkiaViewSwitcher.NavigationStackEntry PreviousVisibleView { get; set; }

Property Value

SkiaViewSwitcher.NavigationStackEntry

SelectedIndex

public int SelectedIndex { get; set; }

Property Value

int

TabsAnimationEasing

public Easing TabsAnimationEasing { get; set; }

Property Value

Easing

TabsAnimationSpeed

public int TabsAnimationSpeed { get; set; }

Property Value

int

TopView

public SkiaControl TopView { get; protected set; }

Property Value

SkiaControl

TrackIndexPosition

public RelativePositionType TrackIndexPosition { get; }

Property Value

RelativePositionType

Viewport

public ScaledRect Viewport { get; }

Property Value

ScaledRect

Methods

ApplyBindingContext()

public override void ApplyBindingContext()

ApplySelectedIndex(OrderedIndex)

protected virtual Task ApplySelectedIndex(OrderedIndex index)

Parameters

index OrderedIndex

Returns

Task

BringPageToFront(Type, int)

public bool BringPageToFront(Type type, int tab = -1)

Parameters

type Type
tab int

Returns

bool

ChangeViewVisibility(SkiaControl, bool)

protected void ChangeViewVisibility(SkiaControl view, bool state)

Parameters

view SkiaControl
state bool

DebugAction()

public void DebugAction()

Draw(DrawingContext)

protected override void Draw(DrawingContext context)

Parameters

context DrawingContext

ExecuteTransitionAnimation(DoubleViewTransitionType, SkiaControl?, SkiaControl)

protected virtual Task ExecuteTransitionAnimation(DoubleViewTransitionType doubleViewTransitionType, SkiaControl? previousVisibleView, SkiaControl newVisibleView)

Parameters

doubleViewTransitionType DoubleViewTransitionType
previousVisibleView SkiaControl
newVisibleView SkiaControl

Returns

Task

FindPageInStack<T>(int)

public T FindPageInStack<T>(int tab = -1) where T : SkiaControl

Parameters

tab int

Returns

T

Type Parameters

T

GetCurrentPage(int)

public SkiaControl GetCurrentPage(int tab = -1)

Parameters

tab int

Returns

SkiaControl

GetCurrentTabNavigationIndex()

public int GetCurrentTabNavigationIndex()

Returns

int

GetNavigationStack(int)

public List<SkiaViewSwitcher.NavigationStackEntry> GetNavigationStack(int index)

Parameters

index int

Returns

List<SkiaViewSwitcher.NavigationStackEntry>

GetRootView(int)

public SkiaViewSwitcher.NavigationStackEntry GetRootView(int selectedIndex)

Parameters

selectedIndex int

Returns

SkiaViewSwitcher.NavigationStackEntry

GetTopView(int)

Get tab view or tab top subview if has navigation stack

public SkiaViewSwitcher.NavigationStackEntry GetTopView(int selectedIndex)

Parameters

selectedIndex int

Returns

SkiaViewSwitcher.NavigationStackEntry

LauchTimerOnLock(int, (int index, bool animate))

protected void LauchTimerOnLock(int seconds, (int index, bool animate) args)

Parameters

seconds int
args (int index, bool animate)

OnAppeared()

This event can sometimes be called without prior OnAppearing

public override void OnAppeared()

OnAppearing()

This can sometimes be omitted,

public override void OnAppearing()

OnChildAdded(SkiaControl)

public override void OnChildAdded(SkiaControl view)

Parameters

view SkiaControl

OnDisappearing()

public override void OnDisappearing()

OnDisposing()

Base performs some cleanup actions with Superview

public override void OnDisposing()

OnLayoutChanged()

DrawingRect size changed

protected override void OnLayoutChanged()

OnSelectedIndexApplied()

protected virtual void OnSelectedIndexApplied()

PopAllTabsToRoot()

public void PopAllTabsToRoot()

PopModal(bool)

public void PopModal(bool animated)

Parameters

animated bool

PopPage(int)

public Task PopPage(int tab = -1)

Parameters

tab int

Returns

Task

PopTabToRoot()

Must be launched on main thread only !!!

public Task PopTabToRoot()

Returns

Task

ProcessIndexBufferAsync()

public Task ProcessIndexBufferAsync()

Returns

Task

PushIndex(OrderedIndex)

public void PushIndex(OrderedIndex index)

Parameters

index OrderedIndex

PushView(SkiaControl, bool, bool, int)

public void PushView(SkiaControl view, bool animated, bool preserve = false, int tab = -1)

Parameters

view SkiaControl
animated bool
preserve bool
tab int

RemovePageFromStack<T>(int)

public void RemovePageFromStack<T>(int tab = -1) where T : SkiaControl

Parameters

tab int

Type Parameters

T

Reset()

public void Reset()

RevealNavigationView(NavigationStackEntry)

Set IsVisible, reset transforms and opacity and send OnAppeared event

protected virtual void RevealNavigationView(SkiaViewSwitcher.NavigationStackEntry newVisibleView)

Parameters

newVisibleView SkiaViewSwitcher.NavigationStackEntry

ScrollTo(float, float, float, bool)

public void ScrollTo(float x, float y, float maxTimeSecs, bool clamp)

Parameters

x float
y float
maxTimeSecs float
clamp bool

SendOnAppeared(SkiaControl)

public void SendOnAppeared(SkiaControl view)

Parameters

view SkiaControl

SendOnAppearing(SkiaControl)

public void SendOnAppearing(SkiaControl view)

Parameters

view SkiaControl

SendOnDisappeared(SkiaControl)

public void SendOnDisappeared(SkiaControl view)

Parameters

view SkiaControl

SendOnDisappearing(SkiaControl)

public void SendOnDisappearing(SkiaControl view)

Parameters

view SkiaControl

SendOnLoaded(SkiaControl)

public void SendOnLoaded(SkiaControl view)

Parameters

view SkiaControl

SetChildren(IEnumerable<SkiaControl>)

public override void SetChildren(IEnumerable<SkiaControl> views)

Parameters

views IEnumerable<SkiaControl>

SetupTransitionAnimation(DoubleViewTransitionType, SkiaControl, SkiaControl)

protected virtual Task SetupTransitionAnimation(DoubleViewTransitionType doubleViewTransitionType, SkiaControl previousVisibleView, SkiaControl newVisibleView)

Parameters

doubleViewTransitionType DoubleViewTransitionType
previousVisibleView SkiaControl
newVisibleView SkiaControl

Returns

Task

UnloadView(NavigationStackEntry)

protected void UnloadView(SkiaViewSwitcher.NavigationStackEntry view)

Parameters

view SkiaViewSwitcher.NavigationStackEntry

UpdateVisibleIndex()

public void UpdateVisibleIndex()

Events

BusyChanged

public event EventHandler<bool> BusyChanged

Event Type

EventHandler<bool>

LoadedLazyView

public event EventHandler<SkiaControl> LoadedLazyView

Event Type

EventHandler<SkiaControl>