public class ButtonClickEventArgs : FxEventArgs { public int ClickCount { get; set; } } public class Button { public event ActionClick; public void OnClick() { var args = new ButtonClickEventArgs { ClickCount = 1 }; Click?.Invoke(args); } }
public class FileSavedEventArgs : FxEventArgs { public string FileName { get; set; } } public class FileManager { public event ActionIn this example, we define a custom `FileSavedEventArgs` class that inherits from `FxEventArgs`. The `FileManager` class has an event called `FileSaved`, which takes the custom event arguments. When a file is saved, the `SaveFile()` method is fired and the `FileSaved` event is triggered with the custom `FileSavedEventArgs` argument. Overall, Touryo.Infrastructure.Framework.Presentation is a package library that provides a useful generic event argument class called FxEventArgs. This class can be used to handle a variety of event arguments safely and efficiently within C# applications.FileSaved; public void SaveFile(string fileName) { // save the file here var args = new FileSavedEventArgs { FileName = fileName }; FileSaved?.Invoke(args); } }