Skip to content

WPF: What is the best way to achieve continuous rendering? #16

Open
@trmcnealy

Description

@trmcnealy

Remove the Timer from the "MainWindow" and replace it with.

private void Checkbox1_Checked(object     sender, RoutedEventArgs e) => CompositionTarget.Rendering += CompositionTarget_Rendering;
private void Checkbox1_Unchecked(object   sender, RoutedEventArgs e) => CompositionTarget.Rendering -= CompositionTarget_Rendering;
private void CompositionTarget_Rendering(object? sender, EventArgs e)
{
    SkElement1.InvalidateVisual();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions