Is there a way to show / hide gui when I click on another GUI element? I am doing MAUI GUI and using CollectionView I generate list of buttons. When I click on one I want to show option 1 and 2 for that item, if I click on another I want to show it´s options and hide the old ones.
I use MVVM, that is why I ask for GUI option only.
Code for list:
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="models:MyItem">
<StackLayout>
<Frame Margin="10,5">
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Label Text="{Binding Name}"/>
<Label Grid.Column="1" Text="{Binding Number}" HorizontalTextAlignment="End"/>
<Label Grid.Row="1" Text="{Binding Description}"/>
</Grid>
</Frame>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Button Grid.Row="2" Text="Option 1" Margin="5"/>
<Button Grid.Row="2" Grid.Column="1" Text="Option 2" Margin="5"/>
</Grid>
</StackLayout>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
As i understand, your case needs to implement behavior which could be expressed by phrase "only one of many".
Jason's solution (bool property bound to IsVisible of your control) will work, however it will get messy along with your button count rising - you would need to handle every single button and it's bound property - why would you want to do that?
In addition i'm sure you will eventually need this again in another View, so you would have to repeat that - it's not really DRY, isn't it?
I would suggest to use more reusable approach.
1. Create a converter class:
[ValueConversion(typeof(object), typeof(bool))]
public class IsEqualConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return targetType == typeof(bool)
? Equals(value, parameter)
: throw new InvalidOperationException("Converter can only convert to value of type bool.");
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new InvalidOperationException("Invalid call - one way only");
}
}
2.Reference your converter in desired View :
<ContentPage.Resources>
<converters:IsEqualConverter x:Key="IsEqualConverter" />
</ContentPage.Resources>
3. Set the SelectionMode of your CollectionView to Single.
<CollectionView SelectionMode="Single">
4. Bind IsVisible of your Grid, to SelectedItem of your CollectionView using syntax below:
<Grid IsVisible="{Binding Name, Converter={StaticResource IsEqualConverter}, ConverterParameter={Binding Source={RelativeSource Mode=FindAncestor, AncestorType={x:Type CollectionView}}, Path=SelectedItem.Name}}">
Assuming Name is unique of course.
[Optional]
5. Create and implement Interface providing unique identification.
public interface IIdentifyUniquely
{
public Guid UniqueIdentifier { get; set; }
}
public class MyItem : IIdentifyUniquely
{
public string Name { get; set; }
public int Number { get; set; }
public Guid UniqueIdentifier { get; }
public MyItem()
{
UniqueIdentifier = Guid.NewGuid();
}
}
Then bind to implemented UniqueIdentifier instead.
I will point out here few options you have, using "MVVM and UI only"
You can use triggers.
https://learn.microsoft.com/en-us/dotnet/maui/fundamentals/triggers?view=net-maui-7.0
With this you can make your UI dependent on properties of your Model.
You can use Styling and VisualStates.
https://learn.microsoft.com/en-us/dotnet/maui/user-interface/visual-states?view=net-maui-7.0
With this you can change the appearance of your UI Elements, depending on their visual state. For example, if you decide make use of "Selected" property of your item.
You can use alternatives for showing additional UI elements for each item. For example - SwipeView.
https://learn.microsoft.com/en-us/dotnet/maui/user-interface/controls/swipeview?view=net-maui-7.0
You can try writing your own, reusable ControlTemplate.
https://learn.microsoft.com/en-us/dotnet/maui/fundamentals/controltemplate?view=net-maui-7.0
You can get 3rd party controls. Here is one of the CommunityToolkit, that does something very similar:
https://learn.microsoft.com/en-us/dotnet/communitytoolkit/maui/views/expander
There are really so many ways to handle your problem. You can also do what Jason said, and just bind to IsVisible and deal with it manually.
You can add a TapGestureRecognizer attached to Frame:
<ScrollView>
<CollectionView>
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="models:MyItem">
<StackLayout>
<Frame Margin="10,5">
<Frame.GestureRecognizers>
<TapGestureRecognizer Tapped="TapGestureRecognizer_Tapped"/>
</Frame.GestureRecognizers>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Label Text="{Binding Name}"/>
<Label Grid.Column="1" Text="{Binding Number}" HorizontalTextAlignment="End"/>
<Label Grid.Row="1" Text="{Binding Description}"/>
</Grid>
</Frame>
<Grid IsVisible="false">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Button Grid.Row="2" Text="Option 1" Margin="5"/>
<Button Grid.Row="2" Grid.Column="1" Text="Option 2" Margin="5"/>
</Grid>
</StackLayout>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</ScrollView>
And Page.xaml.cs:
public partial class NewPage : ContentPage
{
Grid grid = new Grid();
public NewPage()
{
InitializeComponent();
...
}
private void TapGestureRecognizer_Tapped(object sender, TappedEventArgs e)
{
grid.IsVisible = false;
Frame frame = (Frame)sender;
StackLayout stacklayout = (StackLayout)frame.Parent;
grid = (Grid)stacklayout.Children[stacklayout.Children.Count - 1];
grid.IsVisible = true;
}
}
Related
I created a simple program with MAUI to load 2 images, specified as Embedded Resources.
This is the MainPage:
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Surprise.MainPage">
<ScrollView>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="550"/>
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<VerticalStackLayout x:Name="ImageContainer"
Grid.Row="0"
HeightRequest="500"
VerticalOptions="Center"
HorizontalOptions="Center" />
<Grid Grid.Row="1"
HorizontalOptions="Center"
HeightRequest="40">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="30" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Button Text="Image1"
Grid.Column="0"
Clicked="OnImage1ButtonClicked" />
<Button Text="Image2"
Grid.Column="2"
Clicked="OnImage2ButtonClicked" />
</Grid>
</Grid>
</ScrollView>
</ContentPage>
and this is its code behind:
public partial class MainPage : ContentPage
{
private readonly Image _image1;
private readonly Image _image2;
public MainPage()
{
InitializeComponent();
_image1 = new Image()
{
Source = ImageSource.FromResource("Surprise.Resources.Images.image1.jpeg"),
VerticalOptions = LayoutOptions.Center,
HeightRequest = 500
};
_image2 = new Image()
{
Source = ImageSource.FromResource("Surprise.Resources.Images.image2.jpg"),
VerticalOptions = LayoutOptions.Center,
HeightRequest = 500
};
}
private void OnImage1ButtonClicked(object sender, EventArgs e)
{
ImageContainer.Children.Clear();
ImageContainer.Children.Add(_image1);
}
private void OnImage2ButtonClicked(object sender, EventArgs e)
{
ImageContainer.Children.Clear();
ImageContainer.Children.Add(_image2);
}
}
On Windows it works correctly.
On Android sometimes the images are loaded in wrong order or even the same image is loaded when I press each button.
Is it a MAUI bug or I'm missing something?
Thanks in advance.
Well, there are some changes that were made with Maui projects, we now have Maui-specific build actions that you can use to specify to your project/solution what the type of a certain file is.
In your Scenario, you should use the MauiImage build action then just uses the name of the file as shown here: https://learn.microsoft.com/en-us/dotnet/maui/user-interface/controls/image#load-a-local-image should be enough to fix your issue
I have this xaml class:
<ContentView
xmlns="http://xamarin.com/schemas/2014/forms"
HeightRequest="130"
WidthRequest="90"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="InteriorCircle.Pages.MainMenu.CV_PinStyle">
<ContentView.Content>
<StackLayout BackgroundColor="Transparent">
<Frame
HeightRequest="130"
WidthRequest="90"
VerticalOptions="Start"
HasShadow="False"
HorizontalOptions="Start"
BackgroundColor="#565656"
Padding="0"
CornerRadius="25"
IsClippedToBounds="true">
<StackLayout Padding="5">
<Grid VerticalOptions="Center" Margin="10,10,0,0" HorizontalOptions="Center">
<Image x:Name="img_pic"
Margin="3,0,0,0"
HorizontalOptions="Center"
VerticalOptions="Center">
<Image.Clip>
<EllipseGeometry
Center="27,27"
RadiusX="27"
RadiusY="27"/>
</Image.Clip>
</Image>
<Ellipse Stroke="#60CED3"
StrokeThickness="6"
WidthRequest="60"
HeightRequest="60"
HorizontalOptions="Start" />
</Grid>
<Label
Margin="0,0,0,0"
x:Name="label_title"
TextColor="White"
LineBreakMode="TailTruncation"
FontFamily="JakartaReg"
VerticalOptions="Start"
FontSize="12"
HorizontalOptions="Center"/>
<Label
x:Name="label_price"
TextColor="White"
FontFamily="JakartaBold"
VerticalOptions="Start"
FontSize="10"
HorizontalOptions="Center"/>
</StackLayout>
</Frame>
</StackLayout>
</ContentView.Content>
</ContentView>
I retrieve content from another class (event) and set it to the properties from here:
private async Task SetContent(EventType events)
{
InitializeComponent();
byte[] bt = Converters.StringToByteArray(events.eventPictureThumb);
label_title.Text = events.name;
label_price.Text = Converters.GetDecimalPriceFromCents(events.priceInCents) + " €";
Device.BeginInvokeOnMainThread(() =>
{
var source = Converters.ReturnImageSourceFromString(Converters.ByteArrayToString(bt));
img_pic.Source = source;
});
}
However, this does not work sometimes on Android, on iOS not at all.
When I set an image directly in xaml, it is always displayed. On iOS, when the image comes from code, it is never displayed. On Android, it is displayed most of the times, but fails sometimes. When multiple objects load into the view the old ones lose their images.
I am adding the view like so:
var startPin = BitmapDescriptorFactory.FromView(new CV_PinStyle(currentEvent));
Pin pin = new Pin
{
Label = currentEvent.name,
Tag = currentEvent.tblEventID+Constants.DELIMITER+currentEvent.userID,
Icon = startPin,
Type = PinType.Place,
Position = position
};
gMap?.Pins?.Add(pin);
So I am doing somethign wrong here,
can you help me?
I put the SfTreeView inside an SfExpander, and the TreeView takes up a lot of space under it.[enter image description here][1]
I tried to put in into a grid and set the height to Auto but didn't work.
[1]: https://i.stack.imgur.com/kDP3l.png
<expander:SfExpander DynamicSizeMode="Content" IsExpanded="False">
<expander:SfExpander.Header>
<Label TextColor="#495F6E" Text="TreeView list" FontSize="16"
</expander:SfExpander.Header>
<expander:SfExpander.Content>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"></RowDefinition>
</Grid.RowDefinitions>
<treeview:SfTreeView x:Name="treeView2"
ItemHeight="34"
ItemsSource="{Binding ImageNodeInfo}">
<treeview:SfTreeView.ItemTemplate>
<DataTemplate>
<Grid x:Name="grid" Padding="2,2,2,2" RowSpacing="0" >
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1"/>
</Grid.RowDefinitions>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="{Binding Level, Converter={StaticResource IndentationConverter}}" />
<ColumnDefinition Width="30" />
<ColumnDefinition Width="60" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Image Grid.Column="1" Source="{Binding IsExpanded,Converter={StaticResource ExpanderIconConverter}}"
IsVisible="{Binding HasChildNodes,Converter={StaticResource ExpanderIconVisibilityConverter}}"
VerticalOptions="Center"
HorizontalOptions="Center"
HeightRequest="15"
WidthRequest="15"/>
<Image Grid.Column="2" Source="{Binding Content.ImageIcon}" VerticalOptions="Center" HorizontalOptions="Start" HeightRequest="16" WidthRequest="60"/>
<Grid Grid.Column="3" RowSpacing="1" Padding="1,0,0,0" VerticalOptions="Center">
<Label LineBreakMode="NoWrap" Text="{Binding Content.ItemName}" VerticalTextAlignment="Center" FontSize="Body" FontAttributes="Bold"/>
</Grid>
</Grid>
<BoxView HeightRequest="1" BackgroundColor="Gray" Grid.Row="1"/>
</Grid>
</DataTemplate>
</treeview:SfTreeView.ItemTemplate>
</treeview:SfTreeView>
</Grid>
</expander:SfExpander.Content>
</expander:SfExpander>
We have checked the reported query “How to set the dynamic height” from our end. We would like to inform you that TreeView will be loaded with the view size. If you want to customize the height of TreeView, you can set HeightRequest for TreeView based on the item size. Please refer the following code snippet to achieve your requirement,
Xaml: Use EventToCommand behavior for SfTreeView use command for QueryNodeSize event. Bind HeightRequest of TreeView to update the treeview height based on nodes.
<syncfusion:SfTreeView x:Name="treeView"
ItemHeight="40"
HeightRequest="{Binding TreeViewHeight}"
ChildPropertyName="SubFiles"
ItemTemplateContextType="Node"
AutoExpandMode="AllNodesExpanded"
ItemsSource="{Binding ImageNodeInfo}"
BackgroundColor="Beige">
<syncfusion:SfTreeView.Behaviors>
<local:EventToCommandBehavior EventName="QueryNodeSize" Command="{Binding Path=BindingContext.QueryNodeSizeCommand, Source={x:Reference treeView}}"/>
</syncfusion:SfTreeView.Behaviors>
…
</syncfusion:SfTreeView>
ViewModel: Create Command with QueryNodeSizeEventArgs.
private double treeViewHeight = -1;
//Property to set TreeView height.
public double TreeViewHeight
{
get { return treeViewHeight; }
set
{
treeViewHeight = value;
this.RaisedOnPropertyChanged("TreeViewHeight");
}
}
//Command for QueryNodeSize event.
public Command<QueryNodeSizeEventArgs> QueryNodeSizeCommand { get; set; }
public FileManagerViewModel()
{
//Initialize the command.
QueryNodeSizeCommand = new Command<QueryNodeSizeEventArgs>(QueryNodeSizeMethod);
}
/// <summary>
/// Command method to calculate the TreeView height.
/// </summary>
/// <param name="args">Argument which holds the information of the node.</param>
private void QueryNodeSizeMethod(QueryNodeSizeEventArgs args)
{
var item = args.Node.Content as FileManager;
if (!item.IsHandled)
{
this.TreeViewHeight += args.Height;
item.IsHandled = true;
}
}
We have attached the workable sample based on your requirement. You can find them from the following link,
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/TreeViewXamarin-1814245514
Regards,
SaiGanesh Sakthivel
I want to change default background color of display alert,I have tried many questions in different sites
Can anyone help me ?
You can achieve this behaviour using Rg.Plugins.Popup to mimic the default display alert, this gives you more flexibility on how you want it to look.
First read the Getting Started, on Android you will need this in your OnCreate:
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
Rg.Plugins.Popup.Popup.Init(this, bundle); //Initialize the plugin
Xamarin.Forms.Forms.Init(this, bundle);
LoadApplication (new App ());
}
After this, you need to create a View that extends from PopupPage:
Code Behind:
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class AlertPage : PopupPage
{
public AlertPage()
{
InitializeComponent();
}
}
And here is how the Xaml shoul look like (i tried to mimic the default alert as much as possible, you can tweek it to achieve the look you want):
<popup:PopupPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:popup="clr-namespace:Rg.Plugins.Popup.Pages;assembly=Rg.Plugins.Popup"
xmlns:animations="clr-namespace:Rg.Plugins.Popup.Animations;assembly=Rg.Plugins.Popup"
x:Class="BlankAppTest.Views.AlertPage">
<popup:PopupPage.Animation>
<animations:ScaleAnimation
PositionIn="Bottom"
PositionOut="Bottom"
ScaleIn="1.2"
ScaleOut="0.8"
DurationIn="400"
DurationOut="300"
EasingIn="SinOut"
EasingOut="SinIn"
HasBackgroundAnimation="True" />
</popup:PopupPage.Animation>
<StackLayout Margin="30,0,30,0" VerticalOptions="Center" BackgroundColor="#121212">
<Grid VerticalOptions="Fill">
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="50"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="50"></ColumnDefinition>
<ColumnDefinition Width="50"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Label Text="Alert Title" TextColor="White" FontAttributes="Bold" Margin="20,20,20,0"></Label>
<Label Grid.ColumnSpan="3" TextColor="White" Grid.Row="1" VerticalOptions="StartAndExpand" Text="This is a Custom Popup made it Rg.Plugins.Popup to mimic the Default Android Alert" Margin="20,0"></Label>
<Label Margin="0,0,0,20" Grid.Column="2" FontAttributes="Bold" Grid.Row="2" VerticalOptions="End" Text="Yes" TextColor="White"></Label>
<Label Margin="0,0,0,20" Grid.Column="1" FontAttributes="Bold" Grid.Row="2" VerticalOptions="End" Text="No" TextColor="White"></Label>
</Grid>
</StackLayout>
</popup:PopupPage>
And this will act as a normal page, you can add Gesture Recognizers to the labels, bind the colors so the background color be dinamic, it's all up to you.
The Default Alert:
The Final Result:
If you do not want to use Rg.Plugins.Popup, In the android, you can achieve it with a AlertDialog and custom style.You can call it by DependencyService.
[assembly: Dependency(typeof(DeviceOpenAlertService))]
namespace App2.Droid
{
class DeviceOpenAlertService : IDeviceOpenAlertService
{
public void Open()
{
var alert = new AlertDialog
.Builder(CrossCurrentActivity.Current.Activity, Resource.Style.MyDialogStyle)
.SetTitle("Alert Title")
.SetMessage("Do you want to close this application")
.SetPositiveButton("Yes", new myButtonClicklistener())
.SetNegativeButton("No", new myButtonClicklistener())
.Create();
alert.Show();
}
}
}
Add following style to the styles.xml
<style name="MyDialogStyle" parent="android:Theme.Material.Light.Dialog.NoActionBar">
<!--Dialog Background Color-->
<item name="android:colorBackground">#FF0000</item>
</style>
<style name="MyButtonsStyle" parent="Widget.AppCompat.Button.ButtonBar.AlertDialog">
<!-- text color for the button -->
<item name="android:textColor">#00ff00</item>
</style>
Call it in the PCL.
DependencyService.Get<IDeviceOpenAlertService>().Open();
Here is running GIF.
Im building a cross platform app. I have just finished my prototype and it works well on android. However, i started testing the prototype on iOS and i am getting some problems that i dont know how to solve and i wish you guys can help me.
So, for now i have 2 problems:
1st > On android button inside listview is recognizing its event handler/command and firing the event. But on iPhone, its being ignored.
2nd > IPhone seems to be adding some icons to my view that didnt apear on android and they have no utility for me. Is there any way to remove them ?
Xaml:
<local:CustomListView.ItemTemplate>
<DataTemplate>
<local:CustomViewCell>
<ContentView Padding="10,10,10,0">
<Frame BackgroundColor="{Binding Cor}" CornerRadius="5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="15"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="20"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="20"/>
</Grid.ColumnDefinitions>
<Button Grid.Row="0" Grid.Column="2" Image="{Binding ImageSource}" Rotation="90" BackgroundColor="Transparent" HorizontalOptions="EndAndExpand"
CommandParameter="{Binding .}" Command="{Binding BindingContext.CommandoOpcoes, Source={x:Reference tarefas}}"/>
<Image Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Scale="0.7" Source="{local:ImageResource x.Images.location1.png}"/>
<Label Grid.Row="0" Grid.Column="1" Grid.RowSpan="2" Grid.ColumnSpan="2" Text="{Binding Titulo}" FontAttributes="Bold" FontSize="Medium" VerticalTextAlignment="Center"/>
<Image Grid.Row="2" Grid.Column="0" Scale="0.7" Source="{local:ImageResource x.Images.clock.png}"/>
<Label Text="{Binding Duracao}" Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2" VerticalTextAlignment="Center"/>
<Image Grid.Row="3" Grid.Column="0" Scale="0.7" Source="{local:ImageResource x.Images.location2.png}"/>
<Label Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2" Text="{Binding ObjectivoAno}" VerticalTextAlignment="Center"/>
</Grid>
</Frame>
</ContentView>
View Model :
public Command CommandoOpcoes
{
get;
private set;
}
/*
* Menu de um item da lista clicado
* Apresenta opções de editar, apagar e marcar uma tarefa como concluída
*/
private void MostraOpcoes(object t)
{
var Tarefa = t as Tarefa;
async void apagarTarefa()
{
var res = await App.Current?.MainPage?.DisplayAlert(AppResource.Confirmacao, AppResource.Apagar, AppResource.Nao, AppResource.Sim);
if (res == false)
{
Tarefas.Remove(Tarefa);
NTarefas--;
}
}
async void editarTarefa()
{
var page = new EditarTarefa()
{
BindingContext = Tarefa
};
if (PopupNavigation.Instance.PopupStack.Count > 0)
await PopupNavigation.Instance.PopAllAsync(false);
await PopupNavigation.Instance.PushAsync(page, true);
}
void completarTarefa()
{
if (Tarefa.Cumprido == false)
{
Tarefa.Cumprido = true;
Tarefa.Cor = Color.FromHex("#E5F2E5");
NTarefasConcluidos++;
if (NTarefasNaoConcluidos > 0)
NTarefasNaoConcluidos--;
}
else
{
Tarefa.Cumprido = false;
Tarefa.Cor = Color.FromHex("#FFE5E5");
NTarefasNaoConcluidos++;
if (NTarefasConcluidos > 0)
NTarefasConcluidos--;
}
}
ActionSheetConfig config = new ActionSheetConfig();
if (Tarefa.Cumprido)
config.Add(AppResource.nCompleto, completarTarefa, "completo.png");
else
{
config.Add(AppResource.EditarTarefa, editarTarefa, "edit.png");
config.Add(AppResource.Completo, completarTarefa, "completo.png");
}
config.SetDestructive(AppResource.ApagarTarefa, apagarTarefa, "delete.png");
config.UseBottomSheet = true;
UserDialogs.Instance.ActionSheet(config).Dispose();
UserDialogs.Instance.ActionSheet(config);
}
public TarefasViewModel()
{
Tarefas = new ObservableCollection<Tarefa>(App.tarefas.Where(x => x.Data == DateTime.Today).ToList());
NTarefas = Tarefas.Count;
NTarefasConcluidos = Tarefas.Where(x => x.Cumprido == true).Count();
NTarefasNaoConcluidos = Tarefas.Where(x => x.Cumprido == false).Count();
CommandoOpcoes = new Command(q => MostraOpcoes(q));
}
Image of view on iOS with the undesired icons :
https://imgur.com/VTXRXNh
Image on android :
https://imgur.com/v6dfkEW
So, i found the solution. It was quite easy.On ViewCell, the StyleId property can add disclosure buttons to iOS lists.
To not have any of these disclosure buttons, i just made :
<ViewCell StyeleId="none">...</ViewCell>