The Way to Programming
The Way to Programming
I need a little and maybe you guys/girls can point to me in the right direction.
I am creating a Windows 8 application in Visual Studio using C# and XAMAL.
I am having problem with loading an image once you click on a radio button. Then, if you click another radio button, the image change. Any help?
Not sure if this is the correct way
Private Sub radAddition_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles radAddition.Click //display the plus sign and random numbers picOperator.Image = picPlus.Image Call GenerateAndDisplayIntegers() End Sub
The above code is one of the ways you can do it, but for a starters that looks like VB.NET not C#. Once you have your XAML though, if you double click the control in Visual Studio it’ll automatically create the method for you to put your code in.
However, the preferred way to do it in WPF is through the Model-View-View-Model (MVVM) pattern, which uses the concept of bindings. Basically, your View is the XAML and the View Model contains properties to store things like commands, text in text fields and selected values, which are binded to the controls in your XAML. The Model is basically the logic of the program and the classes that contain the functionality of your program.
Check out the following link. I found the video at “Jason Dolinger’s presentation on the Model-View-ViewModel” extremely useful personally, but I learn better from videos.
http://stackoverflow.com/questions/1405739/mvvm-tutorial-from-start-to-finish
Sign in to your account