I am attempting to convert a string value passed along with the "Tag" property of a button to custom type "DialogClosingEventArgs" as shown:
var converted = (DialogClosingEventArgs)((Button)sender).Tag;
However during runtime I get the following exception: "Unable to cast object of type 'System.String' to type 'MaterialDesignThemes.Wpf.DialogClosingEventArgs'"
How can I force this conversion?