--- uid: Uno.Development.AdditionalFeatures --- # Other Uno.UI Features Uno.UI.Toolkit is a set of extension methods or behaviors used to enhance WinUI and activate device/OS specific features. Those methods are built to have no effect on a platform that does not support the enhanced feature: no need to wrap them into conditional code. ## MenuFlyoutItem - Destructive style iOS can display `MenuFlyoutItem` to warn user the action will be "destructive". In that case, the button text is displayed in red. To set a `MenuFlyoutItem` as destructive, add the toolkit namespace to your XAML ```xml xmlns:toolkit="using:Uno.UI.Toolkit" ``` And declare your `MenuFlyoutItem` as follow ```xml ``` ## UICommand - Destructive style iOS can display `UICommand` to warn user the action will be "destructive". In that case, the button text is displayed in red. To set a `UICommand` as destructive, add the toolkit namespace to your code ```csharp using Uno.UI.Toolkit; ``` And declare your `UICommand` as follow ```csharp var uic = new UICommand("Destructive action"); uic.SetDestructive(true); ``` ## FromJson markup extension `FromJson` lets you keep structured sample data in XAML without creating temporary view models. The extension takes a JSON payload, converts it to a dynamic object graph (`ExpandoObject` and nested dictionaries/lists), and assigns it to the consuming property. The conversion follows simple rules so you always know what type a binding receives: - JSON objects → `ExpandoObject` (access through `IDictionary`) - JSON arrays → `List` - JSON numbers → `int` (`Int32`) when the value fits, otherwise `double` - JSON booleans → `bool` - JSON strings → `string` - JSON null → `null` 1. Store the JSON in an `x:String` resource so you can keep it formatted with `xml:space="preserve"`. 2. Use the markup extension to deserialize the resource and set the `DataContext`, `ItemsSource`, or any other property that accepts an arbitrary object. ```xml { "Title": "Runtime Test", "Owner": { "Name": "Uno Platform" }, "Numbers": [ 1, 2, 3 ] } ``` You can also apply `FromJson` directly inside `Page.DataContext`, either by referencing an `x:String` resource or by using its content property to inline JSON: ```xml { "Name": "Inline" } ``` ```xml { "Name": "Inline" } ``` If the JSON string is empty or invalid, the extension throws a `XamlParseException`, allowing issues to surface early during page initialization.