Click here to Skip to main content
15,887,485 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Binding from a lookup Pin
cjb11031-Oct-12 1:10
cjb11031-Oct-12 1:10 
QuestionNeed assistance on WPF Pin
Hema Bairavan27-Oct-12 6:56
Hema Bairavan27-Oct-12 6:56 
AnswerRe: Need assistance on WPF Pin
Abhinav S30-Oct-12 6:40
Abhinav S30-Oct-12 6:40 
GeneralRe: Need assistance on WPF Pin
Hema Bairavan4-Nov-12 18:21
Hema Bairavan4-Nov-12 18:21 
GeneralHow to Print & Export Search Results in WPF using MVVM? Pin
Satheeskumar Manickam25-Oct-12 7:18
Satheeskumar Manickam25-Oct-12 7:18 
AnswerRe: How to Print & Export Search Results in WPF using MVVM? Pin
Richard MacCutchan25-Oct-12 22:26
mveRichard MacCutchan25-Oct-12 22:26 
AnswerRe: How to Print & Export Search Results in WPF using MVVM? Pin
Mycroft Holmes26-Oct-12 0:58
professionalMycroft Holmes26-Oct-12 0:58 
QuestionFrom WinForms to WPF and XAML problem with properties (not Dependency)... Pin
User 224816825-Oct-12 1:59
User 224816825-Oct-12 1:59 
I'm pretty new with WPF and XAML so keep answers asap (as simple as possible). Wink | ;)

I have this chart component that is programmed using Visual Studio 2008 (C#). It works fine on WinForms and can also be configured using property grid in designer. I have modified it so that it can be used in a WPF application, too.

The chart has View property that contains a list of X axes (the list is a property of View class). When a new chart instance is created one X axis is created automatically in View class' constructor so that user don't have to create any if one X axis is sufficient. Same goes with Y axes. When chart is dropped on a Form (or a Window in WPF) you can see a chart that has one Y and one X axis.

In designer property grid (WPF): when I open the list of X axes, add second X axis and try to modify the properties of the first X-axis (let's say its color) I get an exception saying "Exception of typ 'MS.Internal.Validate+ValidationFailure' was thrown.". The original X-axis isn't even there (on the chart) anymore. When I press "Cancel" there isn't an object selected anymore in the property grid. When I try to select on from the drop down menu, that chart goes weird. A lot of XAML code is also added to XAML editor (View classes properties with default values).

I have studied Dependency Properties a bit and I know they should be used in WPF application. At the moment I cannot change every property to dependency property. My boss would go berserk. Smile | :) Also, we cannot sacrifice performance. Dependency Properties seem to be a bit slower in a fast data processing.

Does this sound familiar to anyone? I have debugged the designer and noticed that a new View instance is created when I open the X axis list (the button with three dots). That's kind weird but like I said, I'm new with WPF and XAML. Smile | :)

There is also a owner field in each chart's property so that those classes know which chart owns them. The owner field is provided as parameter to constructor. Same goes with each charts sub property and their properties. WPF seens to call the default constructor of classes so owner cannot set this way. I have also tried several different things to set the owner to objects (using static lists etc...) but no perfect sollution yet.

Does Dependecy Properties fix this problem automatically? If WPF calls each class' default constructor how is any possibly ownership handled. Is DependencyObject combined with XAML code structure (logical tree?) the answer? I no one references to an object it's garbage collected, right? So does WPF handel this and how? Is this the reason that WPF does not support Dispose method anymore?

I have googled my butt off trying to solve this problem. I have found some bits of valuable information but maybe I'm using wrong search words. Some say that the exception I mentioned earlier is a bug in Visual Studio 2010 (which I'm using now). I suspect that the normal properties (not dependency) are the problem. Perhaps there's another thing that I'm not aware of...

If you have a sollution, links to arcticles about this matter or even some tips for this problem, I would greatly appreciate them.

Best regards,

-J-

modified 15-Dec-21 21:01pm.

AnswerRe: From WinForms to WPF and XAML problem with properties (not Dependency)... Pin
Pete O'Hanlon25-Oct-12 2:11
mvePete O'Hanlon25-Oct-12 2:11 
GeneralRe: From WinForms to WPF and XAML problem with properties (not Dependency)... Pin
User 224816825-Oct-12 2:51
User 224816825-Oct-12 2:51 
GeneralRe: From WinForms to WPF and XAML problem with properties (not Dependency)... Pin
Pete O'Hanlon25-Oct-12 3:01
mvePete O'Hanlon25-Oct-12 3:01 
GeneralRe: From WinForms to WPF and XAML problem with properties (not Dependency)... Pin
User 224816825-Oct-12 3:14
User 224816825-Oct-12 3:14 
GeneralRe: From WinForms to WPF and XAML problem with properties (not Dependency)... Pin
Pete O'Hanlon25-Oct-12 3:32
mvePete O'Hanlon25-Oct-12 3:32 
GeneralRe: From WinForms to WPF and XAML problem with properties (not Dependency)... Pin
User 224816825-Oct-12 3:58
User 224816825-Oct-12 3:58 
GeneralRe: From WinForms to WPF and XAML problem with properties (not Dependency)... Pin
Pete O'Hanlon25-Oct-12 4:33
mvePete O'Hanlon25-Oct-12 4:33 
GeneralRe: From WinForms to WPF and XAML problem with properties (not Dependency)... Pin
User 224816825-Oct-12 22:03
User 224816825-Oct-12 22:03 
GeneralRe: From WinForms to WPF and XAML problem with properties (not Dependency)... Pin
Pete O'Hanlon25-Oct-12 22:09
mvePete O'Hanlon25-Oct-12 22:09 
GeneralRe: From WinForms to WPF and XAML problem with properties (not Dependency)... Pin
User 224816825-Oct-12 22:35
User 224816825-Oct-12 22:35 
AnswerRe: From WinForms to WPF and XAML problem with properties (not Dependency)... Pin
User 224816825-Oct-12 4:00
User 224816825-Oct-12 4:00 
AnswerRe: From WinForms to WPF and XAML problem with properties (not Dependency)... Pin
User 224816829-Oct-12 22:59
User 224816829-Oct-12 22:59 
QuestionCollectionViewSource filteration Pin
Member 787462222-Oct-12 22:57
Member 787462222-Oct-12 22:57 
AnswerRe: CollectionViewSource filteration Pin
Mycroft Holmes23-Oct-12 0:38
professionalMycroft Holmes23-Oct-12 0:38 
QuestionTrouble decoding an image Pin
MitchG92_2422-Oct-12 22:56
MitchG92_2422-Oct-12 22:56 
AnswerRe: Trouble decoding an image Pin
Bernhard Hiller26-Oct-12 2:33
Bernhard Hiller26-Oct-12 2:33 
GeneralRe: Trouble decoding an image Pin
MitchG92_2429-Oct-12 4:11
MitchG92_2429-Oct-12 4:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.