Emelie
Emelie
CC#
Created by Emelie on 10/19/2023 in #help
❔ How do I initialize a static list with objects? (Quidditch app)
No description
8 replies
CC#
Created by Emelie on 10/9/2023 in #help
❔ Trying to a initialize a list of objects, but keep getting this error:
I´ve been googling around how I can solve it, but its not working out very well... does someone here know why I get this?
69 replies
CC#
Created by Emelie on 10/6/2023 in #help
❔ WHY is my app not running?
https://github.com/EmelieH-cloud/WPF-timer This is driving me nuts. I have created a grid with a timer, and on run, the grid should be filled with generated buttons and the timer start. But when I try to run it, I get no window and no errors. Just completely blank. What am I doing wrong?
24 replies
CC#
Created by Emelie on 10/5/2023 in #help
✅ Help understanding WPF (XAML)
No description
11 replies
CC#
Created by Emelie on 10/4/2023 in #help
✅ Im very(!) confused about the typeof method(not even sure if method is the correct name)
No description
222 replies
CC#
Created by Emelie on 9/26/2023 in #help
❔ Property vs field?
Hi everyone, I have a really basic but also really important question regarding C#. I have been coding for some time now, and I am using properties and fields as I have been instructed to in my classes, but still I don´t really grasp the difference. What is actually the difference? been reading online but these explanations don´t seem to do it for me :/
54 replies
CC#
Created by Emelie on 9/23/2023 in #help
❔ Why is destructuring used like this?
No description
12 replies
CC#
Created by Emelie on 9/19/2023 in #help
❔ I don´t understand this line of code at all (random char letter)
Hi, I am finding it really hard to understand how its possible to randomize a letter like this: Random rnd = new Random(); char randomChar = (char)rnd.Next('a', 'z'); I thought that the Next() method only could take int's as a parameter?
20 replies
CC#
Created by Emelie on 9/14/2023 in #help
✅ What is IEnumerable<out T> ?
Hi! I have written this code which works, but I dont understand what type of value 'var myQuery' actually is. Is it an array containing the filtered values? // Data source. int[] numbers = new int[] { 34, 57, 89, 12, 4, 6, 7, 123 }; // Data query. <---MY QUESTION var myQuery = numbers.Where(number => number < 10); // Data Execution. foreach (var number in myQuery) { Console.WriteLine(number); }
175 replies
CC#
Created by Emelie on 9/12/2023 in #help
❔ Help me understand this lambda expression
var myKey = availableProducts.FirstOrDefault(x => x.Value == input).Key; Console.WriteLine("Quantity: left " + myKey); Im trying to understand how this code works (how it gets the key for the input value in a dictionary). Been searching the web but not really getting more clear.. mostly I dont understand the use of "x". Many thanks for any help!
105 replies
CC#
Created by Emelie on 9/6/2023 in #help
✅ Newbie question - what exactly does return do?
11 replies
CC#
Created by Emelie on 9/5/2023 in #help
❔ How do I take textbox input and make an object out of it, then add it to an array?
32 replies