### Convert Method Example Source: https://github.com/devexpress-examples/maui-bottom-sheet/blob/24.2.3+/_autodocs/api-reference/status-to-color-converter.md Demonstrates how to instantiate and use the StatusToColorConverter to get a color for the 'New' order status. ```csharp var converter = new StatusToColorConverter(); var lightColor = converter.Convert(OrderStatus.New, typeof(Color), null, null); // Returns #60BA07 in light theme, #A0CD73 in dark theme ``` -------------------------------- ### OrderItemAction Method Example Source: https://github.com/devexpress-examples/maui-bottom-sheet/blob/24.2.3+/_autodocs/api-reference/main-view-model-master-detail.md Shows an example implementation of the OrderItemAction method, which logs a debug message indicating the caption of the clicked action item. ```csharp // When user taps the "Share" button, this method is called public void OrderItemAction(ActionItem actionItem) { Debug.WriteLine(actionItem.Caption + " click"); // Output: "Share click" } ``` -------------------------------- ### ActionItem Initialization Example Source: https://github.com/devexpress-examples/maui-bottom-sheet/blob/24.2.3+/_autodocs/api-reference/action-item.md Demonstrates how to create an instance of the ActionItem class with specific caption, icon, and command. ```csharp var actionItem = new ActionItem( "Share", "share", new Command(OrderItemAction) ); ``` -------------------------------- ### CreateOrders Example Usage Source: https://github.com/devexpress-examples/maui-bottom-sheet/blob/24.2.3+/_autodocs/api-reference/data-generator.md Demonstrates how to call the CreateOrders method and iterate through the generated orders. ```csharp var orders = DataGenerator.CreateOrders(); // Returns a collection with 20 pre-populated orders foreach (var order in orders) { Console.WriteLine($"{order.OrderID}: {order.Status}"); } ``` -------------------------------- ### Product Class Usage Example Source: https://github.com/devexpress-examples/maui-bottom-sheet/blob/24.2.3+/_autodocs/api-reference/product.md Demonstrates how to create a Product instance and use it within an OrderDetails object to calculate the total price. ```csharp var product = new Product { ProductName = "Sasquatch Ale", ImagePath = "beverages", UnitPrice = 10.25m }; // Use in an order detail var item = new OrderDetails { Product = product, Quantity = 2 }; // Total for 2 units decimal total = item.ProductTotal; // 20.50m ``` -------------------------------- ### AppShell Class Definition Source: https://github.com/devexpress-examples/maui-bottom-sheet/blob/24.2.3+/_autodocs/code-behind-reference.md Defines the AppShell class for shell navigation setup. This example uses a minimal code-behind implementation. ```csharp public partial class AppShell : Shell { } ``` -------------------------------- ### MAUI FlexLayout Grid of Buttons Example Source: https://github.com/devexpress-examples/maui-bottom-sheet/blob/24.2.3+/_autodocs/xaml-controls-reference.md A flexible layout container that supports wrapping and alignment. This example shows a grid of action buttons using FlexLayout. ```xml ``` -------------------------------- ### MainViewModel with ActionItems Source: https://github.com/devexpress-examples/maui-bottom-sheet/blob/24.2.3+/_autodocs/api-reference/action-item.md Example ViewModel demonstrating how to populate an ObservableCollection of ActionItems for use in a bottom sheet. Includes a command handler for item clicks. ```csharp public class MainViewModel : BindableBase { public ObservableCollection ActionItems { get; set; } public MainViewModel() { var command = new Command(OrderItemAction); ActionItems = new ObservableCollection { new ActionItem("Share", "share", command), new ActionItem("Print", "print", command), new ActionItem("Repeat", "repeat", command), new ActionItem("Feedback", "feedback", command), new ActionItem("Bookmark", "bookmark", command), }; } public void OrderItemAction(ActionItem actionItem) { Debug.WriteLine(actionItem.Caption + " click"); } } ``` -------------------------------- ### MainViewModel for Master-Detail Example Source: https://github.com/devexpress-examples/maui-bottom-sheet/blob/24.2.3+/_autodocs/types.md The view model for the Master-Detail bottom sheet example. It manages a collection of orders, the selected order, and a list of action items. Use this for scenarios involving lists and item-specific actions. ```csharp public class MainViewModel : BindableBase { public ObservableCollection Orders { get; set; } public Order SelectedOrder { get; set; } public ObservableCollection ActionItems { get; set; } public MainViewModel(); public void OrderItemAction(ActionItem actionItem); } ``` -------------------------------- ### XAML BindingContext Setup Source: https://github.com/devexpress-examples/maui-bottom-sheet/blob/24.2.3+/_autodocs/api-reference/main-view-model-master-detail.md Illustrates how to set the BindingContext of a ContentPage to an instance of MainViewModel in XAML. ```xml ``` -------------------------------- ### MasterDetail Example Data Flow Source: https://github.com/devexpress-examples/maui-bottom-sheet/blob/24.2.3+/_autodocs/architecture.md Illustrates the data flow between the View, ViewModel, and Model layers in the MasterDetail example. This diagram shows how data is structured and passed between components. ```text ┌─────────────────────────────────────────────────────────────────┐ │ View Layer (MainPage.xaml) │ ├─────────────────────────────────────────────────────────────────┤ │ │ │ CollectionView BottomSheet │ │ ItemsSource="{Binding Orders}" Content bound to │ │ SelectedItem="{Binding SelectedOrder │ │ SelectedOrder}" Details │ │ │ │ SelectionChanged event ──────┐ │ │ │ │ │ CollectionView_SelectionChanged │ │ │ ├─ bottomSheet.State ←────────┘ │ │ └─ bottomSheet.HalfExpandedRatio │ │ │ ├─────────────────────────────────────────────────────────────────┤ │ ViewModel Layer (MainViewModel) │ ├─────────────────────────────────────────────────────────────────┤ │ │ │ Orders (ObservableCollection) │ │ SelectedOrder (Order) ───────┐ │ │ │ PropertyChanged event │ │ ActionItems (ObservableCollection) │ │ │ ├─────────────────────────────────────────────────────────────────┤ │ Model Layer (DataGenerator) │ ├─────────────────────────────────────────────────────────────────┤ │ │ │ CreateOrders() │ │ └─ Order[20] │ │ ├─ OrderDetails[3-8] │ │ │ └─ Product (from AllProducts) │ │ └─ OrderStatus │ │ │ └─────────────────────────────────────────────────────────────────┘ ``` -------------------------------- ### XAML Binding Example for Orders Source: https://github.com/devexpress-examples/maui-bottom-sheet/blob/24.2.3+/_autodocs/api-reference/data-generator.md Demonstrates how to bind a CollectionView's ItemsSource to the Orders collection in XAML. ```xml ``` -------------------------------- ### Order Status Usage Example Source: https://github.com/devexpress-examples/maui-bottom-sheet/blob/24.2.3+/_autodocs/api-reference/order-status.md Demonstrates how to create an order with an initial status and how to check or update the order's status using the OrderStatus enum. ```csharp var order = new Order { OrderID = "OD0001", OrderDate = DateTime.Now, Status = OrderStatus.New // Start with New status }; // Check status if (order.Status == OrderStatus.Shipping) { // Order is currently in transit } // Update status order.Status = OrderStatus.Finished; ``` -------------------------------- ### DataGenerator Usage in ViewModel Source: https://github.com/devexpress-examples/maui-bottom-sheet/blob/24.2.3+/_autodocs/api-reference/data-generator.md Example of initializing the Orders collection in a ViewModel using DataGenerator.CreateOrders(). ```csharp public class MainViewModel : BindableBase { public ObservableCollection Orders { get; set; } public MainViewModel() { // Generate sample data on initialization Orders = DataGenerator.CreateOrders(); } } ``` -------------------------------- ### MAUI Image Usage Example Source: https://github.com/devexpress-examples/maui-bottom-sheet/blob/24.2.3+/_autodocs/xaml-controls-reference.md Displays an image from a specified source. Use for showing images within your application. ```xml ``` -------------------------------- ### Order Class Usage Example Source: https://github.com/devexpress-examples/maui-bottom-sheet/blob/24.2.3+/_autodocs/api-reference/order.md Demonstrates how to create a new Order object, initialize its properties including the Details collection, and access the computed TotalAmount. Ensure OrderStatus and OrderDetails are defined elsewhere. ```csharp // Creating an order var order = new Order { OrderID = "OD0042", OrderDate = DateTime.Now, Status = OrderStatus.New, Details = new ObservableCollection { new OrderDetails { Product = new Product { ProductName = "Chai", UnitPrice = 4.4m }, Quantity = 2 } } }; // Accessing the calculated total decimal total = order.TotalAmount; // 8.8m ``` -------------------------------- ### MainViewModel for Google Maps Example Source: https://github.com/devexpress-examples/maui-bottom-sheet/blob/24.2.3+/_autodocs/types.md The view model for the Google Maps bottom sheet example. It holds the currently selected city and a collection of all cities. This is suitable for map-centric UIs displaying locations. ```csharp public class MainViewModel : BaseViewModel { public CityItem SelectedCity { get; set; } public ObservableCollection Cities { get; set; } public MainViewModel(); } ``` -------------------------------- ### DXSeparator Usage Example Source: https://github.com/devexpress-examples/maui-bottom-sheet/blob/24.2.3+/_autodocs/xaml-controls-reference.md Add a DXSeparator to visually divide content. Customize its height, color, and margins for appropriate spacing. ```xml ``` -------------------------------- ### MAUI Grid Layout Example Source: https://github.com/devexpress-examples/maui-bottom-sheet/blob/24.2.3+/_autodocs/xaml-controls-reference.md A layout container that arranges elements in rows and columns. Use for structured layouts with precise element positioning. ```xml ``` -------------------------------- ### MAUI ScrollView Horizontal Example Source: https://github.com/devexpress-examples/maui-bottom-sheet/blob/24.2.3+/_autodocs/xaml-controls-reference.md Enables scrolling for content that exceeds the available space. This example demonstrates horizontal scrolling for an image gallery. ```xml ``` -------------------------------- ### Configure DevExpress Controls in MauiProgram.cs Source: https://github.com/devexpress-examples/maui-bottom-sheet/blob/24.2.3+/_autodocs/getting-started.md Initialize the DevExpress MAUI controls and related components in your application's `MauiProgram.cs` file. This setup is required for all DevExpress MAUI components to function correctly. ```csharp builder .UseMauiApp() .UseDevExpressControls() .UseDevExpressCollectionView() .UseDevExpress(useLocalization: true) ``` -------------------------------- ### MAUI Label Usage Example Source: https://github.com/devexpress-examples/maui-bottom-sheet/blob/24.2.3+/_autodocs/xaml-controls-reference.md Displays text content with options for font size, color, and attributes. Use for displaying static or bound text. ```xml