Skip to content

benoitjadinon/SkiaSharp-CoachMarks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

iOS

public override void ViewDidLayoutSubviews()
{
    base.ViewDidLayoutSubviews();

    viewModel.CoachMarks
        .Add(Button, viewModel.SomeText)
        .Show(this);
}

Android

public override void OnWindowFocusChanged(bool hasFocus)
{
    base.OnWindowFocusChanged(hasFocus);

    viewModel.CoachMarks
        .Add(button, viewModel.SomeText)
        .Show(this);
}

ViewModel

public CoachMarksInstance CoachMarks { get; } 
    = new CoachMarks()
        .Create(bgColor:0x88000000);

public string SomeText { get; } = "test";

// also, to avoid duplicating text references inside views,
// use the extension method inside view controllers
//    viewModel.AddButton(myButton.WindowPosition());
// it makes the view code copy-pastable through platforms
public void AddButton(SKRect rect)
	=> CoachMarks.Add(rect, SomeText);