MY USER CONTROL XAML
<UserControl x:Class="CommonControl.PagingBar"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:PagingBar="clr-namespace:CommonControl;assembly=CommonControl"
Height="38" Width="304" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
<StackPanel Height="34" Width="300">
<telerik:RadButton Name="btnPaginStart" Click="btnPaginStart_Click" HorizontalAlignment="Left" Margin="5,5,0,-24" Height="24" Width="24" >|<</telerik:RadButton>
<telerik:RadButton Name="btnPaginEnd" Click="btnPaginEnd_Click" HorizontalAlignment="Left" Margin="220,0,0,-24" Height="24" Width="24" >>|</telerik:RadButton>
<telerik:RadButton Name="btnPaginPrevious" Click="btnPaginPrevious_Click" HorizontalAlignment="Left" Margin="35,0,0,-24" Height="24" Width="24" ><</telerik:RadButton>
<telerik:RadButton Name="btnPaginNext" Click="btnPaginNext_Click" Margin="190,0,0,0" HorizontalAlignment="Left" Height="24" Width="24">></telerik:RadButton>
<my:IntegerInput Height="18" Margin="-50,-20,0,0" Name="integerInput1" ValueChanged="integerInput1_ValueChanged" Width="120" xmlns:my="clr-namespace:DevComponents.WpfEditors;assembly=DevComponents.WpfEditors" />
</StackPanel>
</UserControl>
XAML.CS
public event EventHandler pgnPaging_EventExecuteLoad;
private void btnPaginEnd_Click(object sender, RoutedEventArgs e)
{
// WANT TO CALL EVENT IN BUTTON CLICK
pgnPaging_EventExecuteLoad(NULL,NULL);
}
USER CONTROL USE IN
<PagingBar:PagingBar Height="38" VerticalAlignment="Top" HorizontalAlignment="Left" Width="256" ></PagingBar:PagingBar>
WANT TO CALL
public void pgnPaging_EventExecuteLoad(object sender, System.EventArgs e)
{
loadGroup(2, 1, 20);
}
ERROR IS - Object reference not set to an instance of an object
<UserControl x:Class="CommonControl.PagingBar"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:PagingBar="clr-namespace:CommonControl;assembly=CommonControl"
Height="38" Width="304" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
<StackPanel Height="34" Width="300">
<telerik:RadButton Name="btnPaginStart" Click="btnPaginStart_Click" HorizontalAlignment="Left" Margin="5,5,0,-24" Height="24" Width="24" >|<</telerik:RadButton>
<telerik:RadButton Name="btnPaginEnd" Click="btnPaginEnd_Click" HorizontalAlignment="Left" Margin="220,0,0,-24" Height="24" Width="24" >>|</telerik:RadButton>
<telerik:RadButton Name="btnPaginPrevious" Click="btnPaginPrevious_Click" HorizontalAlignment="Left" Margin="35,0,0,-24" Height="24" Width="24" ><</telerik:RadButton>
<telerik:RadButton Name="btnPaginNext" Click="btnPaginNext_Click" Margin="190,0,0,0" HorizontalAlignment="Left" Height="24" Width="24">></telerik:RadButton>
<my:IntegerInput Height="18" Margin="-50,-20,0,0" Name="integerInput1" ValueChanged="integerInput1_ValueChanged" Width="120" xmlns:my="clr-namespace:DevComponents.WpfEditors;assembly=DevComponents.WpfEditors" />
</StackPanel>
</UserControl>
XAML.CS
public event EventHandler pgnPaging_EventExecuteLoad;
private void btnPaginEnd_Click(object sender, RoutedEventArgs e)
{
// WANT TO CALL EVENT IN BUTTON CLICK
pgnPaging_EventExecuteLoad(NULL,NULL);
}
USER CONTROL USE IN
<PagingBar:PagingBar Height="38" VerticalAlignment="Top" HorizontalAlignment="Left" Width="256" ></PagingBar:PagingBar>
WANT TO CALL
public void pgnPaging_EventExecuteLoad(object sender, System.EventArgs e)
{
loadGroup(2, 1, 20);
}
ERROR IS - Object reference not set to an instance of an object