public class FullScreenEventArgs : RoutedEventArgs
{
public Boolean Status { get; set; }
}
[Serializable]
[ComVisible(true)]
public delegate void FullScreenEventHandler(object sender, FullScreenEventArgs e);
#region event
public static readonly RoutedEvent OnFullScreenEvent = EventManager.RegisterRoutedEvent("OnFullScreen", RoutingStrategy.Bubble, typeof(FullScreenEventArgs), typeof(EnergyDiagram));
/// <summary>
/// 处理各种路由事件的方法
/// </summary>
public event FullScreenEventHandler OnFullScreen
{
//将路由事件添加路由事件处理程序
add { AddHandler(OnFullScreenEvent, value, false); }
//从路由事件处理程序中移除路由事件
remove { RemoveHandler(OnFullScreenEvent, value); }
}
/// <summary>
/// 响应全屏事件
/// </summary>
internal void FullScreen(Boolean Status)
{
var param = new FullScreenEventArgs();
param.Status = Status;
param.RoutedEvent = OnFullScreenEvent;
param.Source = this;
RaiseEvent(param);
}
#endregion