I am using Converters in my WPF application. They are called innumerous times whenever the application is loaded. Is there any way where I could increase the performance of my application
Asked
Active
Viewed 257 times
0
-
Do you want the converters to convert stuff, if not remove them, otherwise they will be called, I guess you could check that you are not calling PropertyChanged when its not required – sa_ddam213 Oct 01 '14 at 09:41
-
Yes I am using converters to convert stuff and I am not calling PropertyChanged when its not required. – Srinivas Oct 01 '14 at 11:51
-
Sorry, your question is VERY poor. How are you so certain that converters are causing performance problem. Do you EVEN have a performance problem to begin with? Also, you don't do converters to do 2+2 in WPF, you only do converters to do reusable logic such as `BoolToVisibilityConverter` and the like. People can't just "guess" what your code is and where your problem lies, unless you post a specific question this is completely off-topic for SO. – Federico Berasategui Oct 01 '14 at 13:35
-
Mr. HighCore, People have understood my question and they have answered it as well. And I am not someone who does 2+2 using converters, my application has 57 projects and I have a 100+ generic converters which are written as reusable ones. If u can't understand my question don't answer I will not mind, but people have answered it, so please understand that my question has some meaning. And it is not me who says converters cause performance issues,Laurent Bugnion creator of MVVM Light says that. – Srinivas Oct 03 '14 at 05:45
2 Answers
1
There are at least two things that can increase performance of your application:
1) optimize performance of your converters
2) provide converted values in ViewModel
Hope this help.

Community
- 1
- 1

Alex Erygin
- 3,161
- 1
- 22
- 22
1
Put your converters into App.xaml file. In this way you have only one instance of each converter and access them from every view.

Abdurrahman Alp Köken
- 1,236
- 1
- 13
- 12
-
I have around 100 converters in my application. I think its not possible to put them all in App.xaml – Srinivas Oct 01 '14 at 11:32
-
Put them all to resource dictionaries and merge them in App.xaml. – Abdurrahman Alp Köken Oct 01 '14 at 11:37