Code with C | Programming: Projects & Source Codes › Forums › C# Programming › C# and XAMAL
September 27, 2016 at 5:08 pm #10493
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 way12345Private Sub radAddition_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles radAddition.Click//display the plus sign and random numberspicOperator.Image = picPlus.ImageCall GenerateAndDisplayIntegers()End Sub
September 27, 2016 at 5:09 pm #10494
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.
You must be logged in to reply to this topic.