Kippachu
Kippachu
CC#
Created by Kippachu on 5/3/2023 in #help
❔ Need help with WPF Prism app
🆙 Thanks in advance !
5 replies
CC#
Created by Kippachu on 5/3/2023 in #help
❔ Need help with WPF Prism app
Hello, I didn't get an answer so I'm doing a little up, thanks in advance !
5 replies
CC#
Created by Abderahman Magdy on 5/3/2023 in #help
✅ Converting project
Why ? Isn't GPT good to understand the context and give advices on top of converting a code snippet, it's not as good as a professional that knows the languages perfectly but it can help a beginner
17 replies
CC#
Created by Abderahman Magdy on 5/3/2023 in #help
✅ Converting project
You could ask GPT to convert C code snippets to C++
17 replies
CC#
Created by Kippachu on 5/3/2023 in #help
❔ 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
CC#
Created by BambiAria on 4/12/2023 in #help
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)
private double _timeOfFlight;
private double _timeOfFlight;
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
private double _timeOfFlight;

private void GraphPanel_Click(object sender, EventArgs e)
{
NoHorizontalAccelerationCalculation() //This will set the _timeofFlight value
var drawingGraphLogic = DrawingGraphLogic(_timeOfFlight, 1, 1) //here you use the method from your first attachment, using the timeOfFlight value set inside NoHorizontalAccelerationCalculation() ie third attachment
[...] //continue your code
}
private double _timeOfFlight;

private void GraphPanel_Click(object sender, EventArgs e)
{
NoHorizontalAccelerationCalculation() //This will set the _timeofFlight value
var drawingGraphLogic = DrawingGraphLogic(_timeOfFlight, 1, 1) //here you use the method from your first attachment, using the timeOfFlight value set inside NoHorizontalAccelerationCalculation() ie third attachment
[...] //continue your code
}
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
CC#
Created by mblla on 4/12/2023 in #help
❔ Illuminate buttons pressing a row of a DataGrid
Hey I just came back, I'm glad to hear you made it If you don't understand something in the code you can ask me
20 replies
CC#
Created by mblla on 4/12/2023 in #help
❔ Illuminate buttons pressing a row of a DataGrid
No problem, tell me if it worked, now i can go to eat ^^
20 replies
CC#
Created by mblla on 4/12/2023 in #help
❔ Illuminate buttons pressing a row of a DataGrid
I'm still learning also
20 replies
CC#
Created by mblla on 4/12/2023 in #help
❔ Illuminate buttons pressing a row of a DataGrid
Maybe the triggers way was better and it does everything you need in two lines, but i don't know i did it like this
20 replies
CC#
Created by mblla on 4/12/2023 in #help
❔ 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
CC#
Created by mblla on 4/12/2023 in #help
❔ Illuminate buttons pressing a row of a DataGrid
I don't know if my solution is the best, maybe it's bad idk but it works, tell me if you succeeded
20 replies