TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sky Alexander
NA
1
819
C# event handler question
Aug 11 2014 9:42 PM
So I built a simple program where the user will enter the pet's name and age and when they click the button it will simply grab that information and display it in the label fields but i am so confused. Can anyone help me out?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace Pet_s_Name
{
public partial class MainWindow : Window
{
private void Click_Click(object sender, RoutedEventArgs e)
{
//Fields should always be private
private string _name;
private int _age;
//Properties
public string Name
{
get { return _name; }
set { _name = value; }
}
public int Age
{
get{ return _age;}
set { _age = value; }
}
//Constructor
public Pet(string nam, int ag)
{
_name = nam;
_age = ag;
}
}
}
}
}
}
Reply
Answers (
2
)
returning mutiple models to a single view MVC
Client Cache Not Working for StaticContent