Writing layer to a class?
I have a Class that contains: A DataGrid, A Pager
I am trying to make User Control that contains both of them and have all property that links to both of them.
So something:
public class MyGridViewPager : ltcGrid
{
public GridView aGridView;
public DataPager aDataPager;
public bool AutoGenerateColumns {
get { return this.aGridView.AutoGenerateColumns; }
set { this.aGridView.AutoGenerateColumns = value; } }
}
So I can use the property from them in my MyGridViewPager UserControl and in case of any choice change on the GridView or DataPager I can modify only the layer...or is it called wrapper-class? Not so sure about the naming...
But... how do I do the same thing for EventHandler? I can see it defines in:
public delegate void Select开发者_开发技巧ionChangedEventHandler(object sender, SelectionChangedEventArgs e);
How can I expose this handler from my user control?
Note: I don't really want to do MyGridViewPager.aGridView.SelectionChangedEventArgs.
There is a myriad of ways to do this:
- Exposing events of underlying control
- Event Bubbling in C#
精彩评论