public object Convert(object value, Type targetType, object parameter, string language) { ThemeSendingArgs sendingArgs = null; if (value != null) { var p = value as Windows.UI.Xaml.FrameworkElement; string Theme = p?.Tag.ToString(); sendingArgs = new ThemeSendingArgs() { sender = p, Selection = Theme }; } return(sendingArgs); }
/// <summary> /// Imlemented switching between <see cref="ElementTheme"/> . /// </summary> /// <param name="obj">Object of button that is clicked and its tag property as a string.</param> internal static void DefineClickedThemeExecute(ThemeSendingArgs obj) { ((obj.sender as Button).XamlRoot.Content as Frame).RequestedTheme = obj.Selection == "Default" ? EnumHelper.GetEnum <ElementTheme>(GetDefaulTheme()) : EnumHelper.GetEnum <ElementTheme>(obj.Selection); }