✅ .NET MAUI Layout

I am trying to create a password field with the show icon to the right of the password field, when i run the application using a windows machine, it seems fine, but then when i try to run it on an android device i get the below
No description
11 Replies
Buddy
Buddy5mo ago
$rulesofwpf
MODiX
MODiX5mo ago
Rules of WPF:

❌ Avoid the WPF Designer to eliminate a category of confusing bugs
❌ Don't rely on Margin as the primary tool for layouts
❌ Avoid writing UserControls or subclassing to extend a default control -- use Behaviors instead (Microsoft.Xaml.Behaviors.Wpf)

✅ Write XAML by hand and autoformat with "Ctrl K,D" or XAML Styler
✅ Rely upon XAML Hot Reload to design your app's UI at runtime
✅ Use layout controls (Grid, DockPanel, etc) to support proper resizing
✅ Use data binding to eliminate glue code and state synchronization issues
✅ Use collection controls and DataTemplate to dynamically create lists of controls
✅ Learn MVVM to create maintainable apps
✅ Use the Dispatcher to update controls from non-UI threads
✅ WPF's default controls can be easily modernized via $wpfuilibs
✅ Include relevant XAML, code-behind, and ViewModel code for questions when possible
Rules of WPF:

❌ Avoid the WPF Designer to eliminate a category of confusing bugs
❌ Don't rely on Margin as the primary tool for layouts
❌ Avoid writing UserControls or subclassing to extend a default control -- use Behaviors instead (Microsoft.Xaml.Behaviors.Wpf)

✅ Write XAML by hand and autoformat with "Ctrl K,D" or XAML Styler
✅ Rely upon XAML Hot Reload to design your app's UI at runtime
✅ Use layout controls (Grid, DockPanel, etc) to support proper resizing
✅ Use data binding to eliminate glue code and state synchronization issues
✅ Use collection controls and DataTemplate to dynamically create lists of controls
✅ Learn MVVM to create maintainable apps
✅ Use the Dispatcher to update controls from non-UI threads
✅ WPF's default controls can be easily modernized via $wpfuilibs
✅ Include relevant XAML, code-behind, and ViewModel code for questions when possible
Buddy
Buddy5mo ago
Do not use Margin for layout, use a StackPanel (or what the hell it is called in MAUI)
willCodeforFood
willCodeforFood5mo ago
okay, lemme try this
Buddy
Buddy5mo ago
Margin is the spacing between elements It should not be used for layouting
SG97
SG975mo ago
you may want to use row-/columndefinitions on your Grid as it seems to behave the same as in WPF
Zubair
Zubair5mo ago
in entry use horizental option fill
willCodeforFood
willCodeforFood5mo ago
Thanks this worked. Do you also know how I can enable hot reload for an Android Emulator? currently when I make changes, i have to rebuild my entire solution
Zubair
Zubair5mo ago
Hot reload enable by default. Just make source in preference hot reload enabled
willCodeforFood
willCodeforFood5mo ago
Thanks, I think I can close this question now
MODiX
MODiX5mo ago
Use the /close command to mark a forum thread as answered