This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VerticalStackLayout Spacing="18"> | |
<BindableLayout.ItemsSource> | |
<x:Array Type="{x:Type xs:SelectableModel}"> | |
<xs:SelectableModel Description="Headache"/> | |
<xs:SelectableModel Description="Weakness"/> | |
</x:Array> | |
</BindableLayout.ItemsSource> | |
<BindableLayout.ItemTemplate> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void TapGestureRecognizer_Tapped(System.Object sender, Microsoft.Maui.Controls.TappedEventArgs e) | |
{ | |
if (e.Parameter is SelectableModel selectable) | |
{ | |
selectable.IsSelected = !selectable.IsSelected; | |
} | |
else if (e.Parameter is QuestionableModel questionable) | |
{ | |
var frame = sender as Frame; | |
var label = frame.Children.First() as Label; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--List of ages--> | |
<ScrollView Orientation="Horizontal" | |
Margin="0,18" | |
HorizontalScrollBarVisibility="Never"> | |
<HorizontalStackLayout Spacing="8"> | |
<BindableLayout.ItemsSource> | |
<x:Array Type="{x:Type xs:SelectableModel}"> | |
<xs:SelectableModel Description="0-15"/> | |
<xs:SelectableModel Description="15-25"/> | |
<xs:SelectableModel Description="25-35"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SelectedToTextColorConverter : IValueConverter | |
{ | |
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | |
{ | |
return bool.TryParse(value?.ToString(), out var selected) && selected | |
? Color.FromArgb("#F4FCFF") | |
: Color.FromArgb("#777777"); | |
} | |
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Simple Selectable Model | |
public partial class SelectableModel : ObservableObject | |
{ | |
[ObservableProperty] private string _description; | |
[ObservableProperty] private bool _isSelected; | |
} | |
public enum Answer | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Grid ColumnDefinitions="*, 4*" | |
Padding="20,12" | |
ColumnSpacing="8"> | |
<Frame CornerRadius="10" | |
Grid.ColumnSpan="2" | |
Margin="-20,-12" | |
HasShadow="False" | |
BackgroundColor="#6073E7"/> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--Header Section--> | |
<Grid ColumnDefinitions="auto,*,auto"> | |
<Image Source="profile_image.png" | |
HeightRequest="60" | |
WidthRequest="60" | |
Aspect="AspectFill"> | |
<Image.Clip> | |
<EllipseGeometry Center="30,30" RadiusX="30" RadiusY="30"/> | |
</Image.Clip> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<TargetFrameworks>net7.0-android;net7.0-ios</TargetFrameworks> | |
<OutputType>Exe</OutputType> | |
<RootNamespace>TheLordOfTheRings</RootNamespace> | |
<UseMaui>true</UseMaui> | |
<SingleProject>true</SingleProject> | |
<ImplicitUsings>enable</ImplicitUsings> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Sound Service | |
/// </summary> | |
public interface ISoundService | |
{ | |
/// <summary> | |
/// Play Embedded Sound from Resources | |
/// Usage example: ISoundService.PlaySound("success.mp3"); | |
/// </summary> | |
/// <param name="sound">sound resource name with extension</param> |
NewerOlder