Kippachu
❔ Need help with WPF Prism app
Then, within the OnPreviewContentPropertyChanged method, I have to use a switch statement based on the key value and update the corresponding property in the PreviewTextService dictionary. This means that every time I create a new form implementing Preview Text, I have to manually add all cases inside the switch statement. I am unsure how to replace this code with a more efficient pattern. If anyone could help me improve my code, I would greatly appreciate it!
5 replies
Problem with my project
There are many ways of doing this, the simplest way would be to create a private field inside the class (outside the methods)
Change timeOfFlight to _timeOfFlight inside NoHorizontalAccelerationCalculation() method this way you are setting the value outside your method and so it becomes usable in others methods of the same class (private field)
This means now you can do
Note : This will work but is totally not the best way to do, you'll have to change this behaviour later., just gave you an easy solution in many solutions.
Is it ok for you ?
3 replies
❔ Illuminate buttons pressing a row of a DataGrid
Basically when you select a row then your variable "selectedPerson" in DataGrid_SelectedCellsChanged will not be null, so inside UpdateButtonColors the else case will be run, changing the color of every people in your MyPeopleList, and as you binded the buttons colors to your people color, it will also change, else if unselect the row the selectedPerson will be null and will set the buttons color back to grey
20 replies