Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8832077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:27:05+00:00 2026-06-14T08:27:05+00:00

Essentially what I’m trying to do is trigger a sort of ‘dirty’ state for

  • 0

Essentially what I’m trying to do is trigger a sort of ‘dirty’ state for my canvas, so that I know if there are unsaved changes.

Is there an event in the WPF InkCanvas that I can use to handle any time when the strokes change?

If there isn’t, what events should I listen to for the equivalent? My first guess would be these:

StrokeCollected
StrokeErased
StrokesReplaced

Though I could be wrong, and be missing an edge case.

Note: It’s not a big deal if I get false positives (marked dirty when it is in fact not), but I don’t want false negatives.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T08:27:06+00:00Added an answer on June 14, 2026 at 8:27 am

    It seems like these events will do the job:

    • InkCanvas.StrokesReplaced (occurs when the Strokes property is set)
    • StrokeCollection.StrokesChanged (occurs when a stroke is added or removed)
    • Stroke.StylusPointsChanged (occurs when the shape of a stroke is changed)
    • Stroke.StylusPointsReplaced (occurs when the StylusPoints property is set)
    • Stroke.DrawingAttributesChanged (occurs when the attributes of a stroke are changed)
    • Stroke.DrawingAttributesReplaced (occurs when the DrawingAttributes property is set)

    In my case, I never replace properties, or change drawing attributes, so I only use StrokeCollection.StrokesChanged and Stroke.StylusPointsChanged. Here is a snippet of my code.

    public MainWindow()
    {
        inkCanvas.Strokes.StrokesChanged += Strokes_StrokesChanged;
    }
    
    private void Strokes_StrokesChanged(object sender, StrokeCollectionChangedEventArgs e)
    {
        // Mark dirty
        foreach (Stroke stroke in e.Added)
        {
            stroke.StylusPointsChanged += stroke_StylusPointsChanged;
        }
        foreach (Stroke stroke in e.Removed)
        {
            stroke.StylusPointsChanged -= stroke_StylusPointsChanged;
        }
    }
    
    private void stroke_StylusPointsChanged(object sender, System.EventArgs e)
    {
        // Mark dirty
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Essentially, my question is this: There are two ways that I have experienced setting
Essentially, I'm looking for a 1D bar-code scanner that I can program, either through
Essentially, is there any way to make this code legal? main = print .
Essentially I'd like to know just how compatible are the iPhone and the iPod
Essentially I want to store a variable in the client that I don't want
Essentially, I need to know how to make a UIWebView erase everything when you
Essentially, I'd like a special form of an Interface for Exceptions that requires anyone
Essentially, I have a dynamically generated local HTML form that I would like to
Essentially, what I'm trying to do is to load/draw a map from a Tiled
Essentially, what I'm looking for is a function that would allow me to do

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.