maui-linux/samples/TodoApp
logikonline 1d55ac672a Preview 3: Complete control implementation with XAML data binding
Major milestone adding full control functionality:

Controls Enhanced:
- Entry/Editor: Full keyboard input, cursor navigation, selection, clipboard
- CollectionView: Data binding, selection highlighting, scrolling
- CheckBox/Switch/Slider: Interactive state management
- Picker/DatePicker/TimePicker: Dropdown selection with popup overlays
- ProgressBar/ActivityIndicator: Animated progress display
- Button: Press/release visual states
- Border/Frame: Rounded corners, stroke styling
- Label: Text wrapping, alignment, decorations
- Grid/StackLayout: Margin and padding support

Features Added:
- DisplayAlert dialogs with button actions
- NavigationPage with toolbar and back navigation
- Shell with flyout menu navigation
- XAML value converters for data binding
- Margin support in all layout containers
- Popup overlay system for pickers

New Samples:
- TodoApp: Full CRUD task manager with NavigationPage
- ShellDemo: Comprehensive control showcase

Removed:
- ControlGallery (replaced by ShellDemo)
- LinuxDemo (replaced by TodoApp)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 13:26:56 -05:00
..
App.cs Preview 3: Complete control implementation with XAML data binding 2025-12-21 13:26:56 -05:00
MauiProgram.cs Preview 3: Complete control implementation with XAML data binding 2025-12-21 13:26:56 -05:00
NewTodoPage.xaml Preview 3: Complete control implementation with XAML data binding 2025-12-21 13:26:56 -05:00
NewTodoPage.xaml.cs Preview 3: Complete control implementation with XAML data binding 2025-12-21 13:26:56 -05:00
Program.cs Preview 3: Complete control implementation with XAML data binding 2025-12-21 13:26:56 -05:00
README.md Preview 3: Complete control implementation with XAML data binding 2025-12-21 13:26:56 -05:00
TodoApp.csproj Preview 3: Complete control implementation with XAML data binding 2025-12-21 13:26:56 -05:00
TodoDetailPage.xaml Preview 3: Complete control implementation with XAML data binding 2025-12-21 13:26:56 -05:00
TodoDetailPage.xaml.cs Preview 3: Complete control implementation with XAML data binding 2025-12-21 13:26:56 -05:00
TodoItem.cs Preview 3: Complete control implementation with XAML data binding 2025-12-21 13:26:56 -05:00
TodoListPage.xaml Preview 3: Complete control implementation with XAML data binding 2025-12-21 13:26:56 -05:00
TodoListPage.xaml.cs Preview 3: Complete control implementation with XAML data binding 2025-12-21 13:26:56 -05:00
TodoService.cs Preview 3: Complete control implementation with XAML data binding 2025-12-21 13:26:56 -05:00

README.md

TodoApp Sample

A complete task management application demonstrating OpenMaui Linux capabilities with real-world XAML patterns.

Features

  • NavigationPage - Full page navigation with back button support
  • CollectionView - Scrollable list with data binding and selection
  • XAML Data Binding - Value converters for dynamic styling
  • DisplayAlert Dialogs - Confirmation dialogs for delete actions
  • Grid Layouts - Complex layouts with star sizing for expanding content
  • Entry & Editor - Single and multi-line text input
  • Border with RoundRectangle - Modern card-style UI
  • ToolbarItems - Navigation bar actions

Screenshots

The app consists of three pages:

  1. TodoListPage - Shows all tasks with completion status indicators
  2. NewTodoPage - Create a new task with title and notes
  3. TodoDetailPage - View/edit task details, mark complete, or delete

Architecture

TodoApp/
├── App.cs                    # Application entry with NavigationPage
├── Program.cs                # Linux platform bootstrap
├── MauiProgram.cs            # MAUI app builder
├── TodoItem.cs               # Data model
├── TodoService.cs            # In-memory data store
├── TodoListPage.xaml(.cs)    # Main list view
├── NewTodoPage.xaml(.cs)     # Create task page
└── TodoDetailPage.xaml(.cs)  # Task detail/edit page

XAML Highlights

Value Converters

The app uses custom converters for dynamic styling based on completion status:

  • CompletedToColorConverter - Gray text for completed items
  • CompletedToTextDecorationsConverter - Strikethrough for completed items
  • CompletedToOpacityConverter - Fade completed items
  • AlternatingRowColorConverter - Alternating background colors

ResourceDictionary

<ContentPage.Resources>
    <Color x:Key="PrimaryColor">#5C6BC0</Color>
    <Color x:Key="AccentColor">#26A69A</Color>
    <Color x:Key="TextPrimary">#212121</Color>
</ContentPage.Resources>

CollectionView with DataTemplate

<CollectionView SelectionMode="Single" SelectionChanged="OnSelectionChanged">
    <CollectionView.ItemTemplate>
        <DataTemplate x:DataType="local:TodoItem">
            <Border BackgroundColor="{StaticResource CardBackground}">
                <Label Text="{Binding Title}" />
            </Border>
        </DataTemplate>
    </CollectionView.ItemTemplate>
</CollectionView>

Grid with Star Rows (Expanding Editor)

<Grid RowDefinitions="Auto,Auto,*,Auto,Auto" Padding="20">
    <!-- Row 0: Title section (Auto) -->
    <!-- Row 1: Notes label (Auto) -->
    <!-- Row 2: Editor - expands to fill (*) -->
    <!-- Row 3: Status section (Auto) -->
    <!-- Row 4: Created date (Auto) -->
</Grid>

Building and Running

# From the maui-linux-push directory
cd samples/TodoApp
dotnet publish -c Release -r linux-arm64

# Run on Linux
./bin/Release/net9.0/linux-arm64/publish/TodoApp

Controls Demonstrated

Control Usage
NavigationPage App navigation container
ContentPage Individual screens
CollectionView Task list with selection
Grid Page layouts
VerticalStackLayout Vertical grouping
HorizontalStackLayout Horizontal grouping
Label Text display
Entry Single-line input
Editor Multi-line input
Button Toolbar actions
Border Card styling with rounded corners
CheckBox Completion toggle
BoxView Visual separators

License

MIT License - See repository root for details.