Click here to Skip to main content
15,889,200 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello, how can I pass values from xaml.cs to class? In my MainWindow.xaml.cs I choose two properties and then I want to pass them to the properties.cs.

What I have tried:

MainWIndow.xaml.cs:
C#
else if (deleni.IsChecked.HasValue == true && deleni.IsChecked.Value == true && high.IsChecked.HasValue == true && vhigh.IsChecked.Value == true)
            {
                hra lvl = new hra();
                Deleni del = new Deleni();
                properties prop = new properties(del);
                lvl.Show();
                this.Close();
            }


here I got information that it will be a division with high difficulty

properties.cs:
C#
class properties
    {
        public void deleni(Deleni del)
    }

this is my attempt that leads to nothing


Thank you for any advice!!!
Posted
Comments
[no name] 23-Apr-21 12:53pm    
Use a parameterized constructor.

https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/using-constructors

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900