Giter Site home page Giter Site logo

Comments (5)

tisis2 avatar tisis2 commented on June 1, 2024

i figured out that the issue only happens on properties that are edited via a textbox
additionally i was able to isolate the issue to a point where our applications sets the OverrideDefaultStyle property for textboxes in a default style. when i comment this setter, the crash does not happen.
still if i do the same in a small example project the crash does not happen yet

from snoopwpf.

batzen avatar batzen commented on June 1, 2024

A repro would be very nice in this case.

from snoopwpf.

tisis2 avatar tisis2 commented on June 1, 2024

issue is reproducable with the following example:
SnoopCrashOnPropertyEdit.zip

i figured out that in the past the line FrameworkElement.StyleProperty.OverrideMetadata(typeof(TextBox), new FrameworkPropertyMetadata { DefaultValue = FindResource(typeof(TextBox)) }); was added in our App.xaml.cs. and the style sets the OverridesDefaultStyle Property to true. i have no idea why exactly this was done in the past but this is the cause of the crash

from snoopwpf.

batzen avatar batzen commented on June 1, 2024

The crash in Snoop just reveals that your code is wrong.
You can test that by using my modified version of your repro.
SnoopCrashOnPropertyEdit.zip

The problem with your code is that you overwrite the default style, by changing the default metadata of the style property, and then also set OverridesDefaultStyle to true.
Which is something that's not allowed in WPF, at least if you want to also use controls inheriting from the same type.

from snoopwpf.

tisis2 avatar tisis2 commented on June 1, 2024

ok thanks i see. i removed the changing of the metadata in this case to fix that issue. i was just a bit confused because with older versions there was no crash

from snoopwpf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.