Comments (5)
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.
A repro would be very nice in this case.
from snoopwpf.
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.
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.
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)
- Feature Request: For inherited values, show what provided the value
- How to view attached properties? HOT 1
- 没有足够的内存继续执行程序。 HOT 2
- Unhandled InvalidCastException when running on .NET 7 HOT 2
- Invoke Button Click and Fill TextBox HOT 1
- Cannot attach to WPF self-contained single file app HOT 8
- .net 7 support HOT 2
- Error snooping .NET 7 app HOT 4
- tracking options "Highlight Selected Item" not working HOT 2
- Missing TextBlock.LineHeight HOT 4
- This type of CollectionView does not support changes to its SourceCollection from a thread different from the Dispatcher thread. HOT 1
- Light mode broken HOT 22
- Cannot attach the snoop to the .net framework 4.5 single app HOT 8
- Save the Current Preview to file does not work all the time HOT 5
- Snoop does not show version HOT 1
- After upgrading my app to .net 8 snoop no longer works with it
- Change key for Ctrl-Shift-MouseOver HOT 4
- Add mention about SignPath Foundation and free code certificate in Readme.md HOT 2
- Feature Request: Option to snoop without activating snoop on global shortcut HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from snoopwpf.