Click here to Skip to main content
15,897,147 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello Frnds,

I want to Initialize the object. and I want to create generic function for that. so I call thet and pass the type perameter and initialize the object

mainWindowViewModel.HideOtherScreens();
mainWindowViewModel.menu = new Menu() { DataContext = new MenuViewModel(_mainWindowViewModel) }; ;
mainWindowViewModel.menu.Visibility = Visibility.Visible;                mainWindowViewModel._perentWindow.maincanvas.Children.Add(mainWindowViewModel.menu);



I have this type of code in many viewmodels i.e. classes but the initilizing object is diffrunt i.e. Menu here so I need to create generic function for this


can you help me

Thanks in Advance
Posted
Updated 18-Jun-14 22:33pm
v2
Comments
anup.bhunia 19-Jun-14 10:10am    
What do you expect from that generic function. What signature you expect, could you please elaborate?
Sergey Alexandrovich Kryukov 19-Jun-14 12:46pm    
Generic function? Not even trying to use generics? What are you talking about? :-)
—SA

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