Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="utf-8" ?>
- <ContentView
- x:Class="DemyAI.Controls.UserDetailsExpander"
- xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
- xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
- xmlns:chechbox="clr-namespace:Syncfusion.Maui.Buttons;assembly=Syncfusion.Maui.Buttons"
- xmlns:expander="clr-namespace:Syncfusion.Maui.Expander;assembly=Syncfusion.Maui.Expander"
- xmlns:helpers="clr-namespace:DemyAI.Helpers"
- xmlns:inputLayout="clr-namespace:Syncfusion.Maui.Core;assembly=Syncfusion.Maui.Core"
- x:Name="UserExpander">
- <StackLayout>
- <inputLayout:SfTextInputLayout
- Hint="{Binding Hint, Source={x:Reference UserExpander}}"
- HorizontalOptions="StartAndExpand"
- OutlineCornerRadius="8">
- <Entry Text="{Binding RomeName, Source={x:Reference UserExpander}}" />
- </inputLayout:SfTextInputLayout>
- <expander:SfExpander>
- <expander:SfExpander.Header>
- <Grid
- ColumnDefinitions="50,60"
- ColumnSpacing="10">
- <Label
- FontFamily="Mat"
- FontSize="Header"
- HorizontalTextAlignment="Center"
- Text="{Static helpers:IconFont.Group}"
- VerticalTextAlignment="Center" />
- <Label
- Grid.Column="1"
- Text="Students" />
- </Grid>
- </expander:SfExpander.Header>
- <expander:SfExpander.Content>
- <CollectionView
- ItemsSource="{Binding Users, Source={x:Reference UserExpander}}"
- SelectionMode="None">
- <CollectionView.ItemTemplate>
- <DataTemplate>
- <Border Margin="2">
- <Border.StrokeShape>
- <RoundRectangle CornerRadius="8" />
- </Border.StrokeShape>
- <Grid
- Margin="5,5,5,0"
- ColumnDefinitions="40,*"
- RowDefinitions="*,*">
- <Label
- Grid.Column="1"
- Text="{Binding Name}" />
- <Label
- Grid.Row="3"
- Grid.Column="1"
- Text="{Binding Email}" />
- <chechbox:SfCheckBox
- Grid.RowSpan="3"
- HorizontalOptions="End"
- IsChecked="{Binding IsParticipant}"
- VerticalOptions="End">
- <chechbox:SfCheckBox.GestureRecognizers>
- <TapGestureRecognizer
- Command="{Binding Source={x:Reference UserExpander}, Path=HandleCheckBox}"
- CommandParameter="{Binding .}" />
- </chechbox:SfCheckBox.GestureRecognizers>
- </chechbox:SfCheckBox>
- </Grid>
- </Border>
- </DataTemplate>
- </CollectionView.ItemTemplate>
- </CollectionView>
- </expander:SfExpander.Content>
- </expander:SfExpander>
- </StackLayout>
- </>
- public partial class UserDetailsExpander : ContentView {
- public UserDetailsExpander() {
- InitializeComponent();
- }
- public static readonly BindableProperty HintProperty = BindableProperty.Create(
- nameof(Hint), typeof(string), typeof(UserDetailsExpander);
- public string Hint {
- get => (string)GetValue(HintProperty);
- set => SetValue(HintProperty, value);
- }
- public static readonly BindableProperty RomeNameProperty = BindableProperty.Create(
- nameof(RomeName), typeof(string), typeof(UserDetailsExpander));
- public string RomeName {
- get => (string)GetValue(RomeNameProperty);
- set => SetValue(RomeNameProperty, value);
- }
- public static readonly BindableProperty UsersProperty = BindableProperty.Create(
- nameof(Users), typeof(IEnumerable), typeof(UserDetailsExpander));
- public IEnumerable Users {
- get => (IEnumerable)GetValue(UsersProperty);
- set => SetValue(UsersProperty, value);
- }
- public static readonly BindableProperty HandleCheckBoxCommandProperty = BindableProperty.Create(
- nameof(HandleCheckBoxCommand), typeof(RelayCommand), typeof(UserDetailsExpander));
- public RelayCommand HandleCheckBoxCommand {
- get => (RelayCommand)GetValue(HandleCheckBoxCommandProperty);
- set => SetValue(HandleCheckBoxCommandProperty, value);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement