Hey guys,
actually Im using Azure NotificationHub to send Push for iOS und Android. Is there another way for sending without costs for like Azure?
Best regards
Chris
Hey guys,
actually Im using Azure NotificationHub to send Push for iOS und Android. Is there another way for sending without costs for like Azure?
Best regards
Chris
Hi everyone !
The texbox area is too below, when I click on the texbox, the keyboard opens and the texbox area does not appear because the keyboard occupies the texbox area. Normally, the textbox should be down because there is video in the background. That's why it's down there.
How do I make the textbox visible when the keyboard opens? .How do you find a solution to this?
Thanks in advance
Hey all,
I just updated my xamarin forms version from 4.2 to 4.3.
When I try to run my UWP application, I get a splash screen and I get the following exception
$exception {"Could not find Windows Runtime type 'Microsoft.UI.Xaml.Controls.XamlControlsResources'.":"Microsoft.UI.Xaml.Controls.XamlControlsResources"} System.TypeLoadException
in my uwp's app.xaml.cs Xamarin.Forms.Forms.Init(e)
I went through the process of cleaning my solution, reinstalled the nugut packages, and deleting my bin and object folders. Still no luck.
After some research, this is from the Microsoft.UI.Xaml.dll which should be packaged in UWP by default.
Has anyone experience this issue before?
Hello,
So far, i got only trouble from this DataGrid Plugin, is there a Free alternative to it?
Hello , everyone
I apologize for my inexperienced English skills.
I use Xamarin to create two apps for Windows and Android.
To summarize my question, there are two things.
1.How to read a txt file from Xamarin
2.Expressed like Datagrid in Xamarin
I am sorry that English is poor.
Thank you,
What are the best options for displaying tabular, row/column data in Xamarin.Forms? I saw there were a couple components from Zumero and DevExpress for a forms data grid but these appear to have issues in Xamarin.Forms 2.2. How are others approaching a solution to this?
So on my app.xaml.cs I have
CrossPushNotification.Current.OnNotificationReceived += (s, p) =>
{
//something like Navigation.PushAsync(new Page(Data from the notification));
}
How can I open 'Page' and give the data of the notification as an argoument?
Thanks to all.
Hi,
I'm using the new ImageButton to implement a ToggleButton which switches between a "Locked" and "Unlocked" state.
The "Source"-Property is bound to a bool-Property in the ViewModel and using a ValueConverter to set the name of the according image:
<ImageButton
Command="{Binding ToggleLockStateCommand}"
BackgroundColor="Transparent"
Source="{Binding Locked, Converter={StaticResource cnvLockStateToImage}}">
Changing the images works as expected but after changing the image is not correctly sized, it randomly switches between "very small" and the original size.
I already verified that the ImageButton doesn't change its size when the Source is changed (which is expected as the two images are of the same size).
Anybody has an idea how to fix this (or maybe it's a bug?) My target-platform is Android.
-Michael
Hi, I am a newbie. I would like to design an app which the main menu will be used Master Detail Page,and in one of the detail page will be shown a Listview (with detail page from the list view). I am struggling how to do that? Am I need to use Navigation Page to include a list view? How to add a Navigation Page in the Master Detail Page?
It is hard to find the code sample for this layout, many thanks for your help!!!
My ideal workflow are as follows:
1. My main menu will use Master Detail Page
One of the menu will show the list view (in the example is a card view, but I use list view is enough)
When the user click the list view, it will show the detail page.
I am new in Xamarin.Forms. I want to ask for the location permission to the user, then if user allows it, get his location. The problem is RequestPermissionAsyn
and GetLastKnownLocationAsync
, both are async operations. Hence I want to wait till user grants permission and then call the GetLastKnownLocationAsync
.
Here is the code I am using
async void AskPermission(object sender, EventArgs e)
{
await Task.Run(async () =>
{
var permissionStatus = await CrossPermissions.Current.CheckPermissionStatusAsync(Permission.Location);
if (permissionStatus != PermissionStatus.Granted)
{
var response = await CrossPermissions.Current.RequestPermissionsAsync(Permission.Location);
var userResponse = response[Permission.Location];
Debug.WriteLine($"Permission {Permission.Location} {permissionStatus}");
}
else
Debug.WriteLine($"Permission is finally {Permission.Location} {permissionStatus}");
});
// Call the GetLocation if user allowed the permission.
}
async void GetLocation()
{
Location location;
location = await Geolocation.GetLastKnownLocationAsync();
Location.Text = location.Latitude.ToString();
}
I can successfully prompt the user for allowing permission, but GetLocation()
is not executing. That means even if I write Debug.WriteLine("");
whether permission granted?, I am not getting anything in the output Window. Any Help would be much appreciated. Basically I want to run both the asynchronous operations one after the other. I do not understand whether the problem is with asynchronous operations or whether it needs to run from UI Thread.
I have a ContentPage defined in .xaml that contains a ListView.
<ListView ItemsSource="{Binding Groups}"
IsGroupingEnabled="true"
GroupDisplayBinding="{Binding Title}"
HasUnevenRows="true">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<yds:ZonesPagesItem/>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
This ListView contains items that are ContentViews (see above : yds.ZonesPagesItem), defined in another xaml :
<ContentView (...)>
<StackLayout Orientation="Horizontal" >
<Image Source="{Binding ImageUrl}" />
<Label Text="{Binding Title}"></Label>
</StackLayout>
</ContentView>
In my Xaml ContentView, I can "bind" to bound object properties succesfully.
But I also need to manipulate programatically the bound object in c# code behind code. My problem is that I don't know how to get instance of bound object in C# side.
public partial class ZonesPagesItem : ContentView
{
public ZonesPagesItem()
{
InitializeComponent();
var boundObject = this.GetBoundObject();
// Do some business logic job wih boundObject...
// It does not compile! GetBoundObject() does not exist.
}
}
See upper, I wish GetBoundObject() method exists!
This is what I'm looking for.
Any idea?
The following is a snippet from my XAML:
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.7*" />
<ColumnDefinition Width="0.3*" />
</Grid.ColumnDefinitions>
<Label Text="{Binding AddressTypeName}" Grid.Column="0"/>
<Label Text=""
Grid.Column="1"
FontFamily="{StaticResource SegoeMDL2Assets}" FontSize="Medium" HorizontalOptions="End">
<Label.GestureRecognizers>
<TapGestureRecognizer Command="{Binding DeleteCommand}" CommandParameter="{Binding .}"/>
</Label.GestureRecognizers>
</Label>
</Grid>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
Basically, I am adding a trash can icon on every row and Binding the method DeleteCommand passing the parameter of the object on that row (which is actually a class for AddressType.
In my ViewModel, the following is where I wire up the commands. Snippet:
void DeleteCommandExecute(AddressType address)
{
if (IsBusy)
return;
IsBusy = true;
try
{
DataStore.DeleteAddressTypeAsync(address.Id);
}
catch (Exception ex)
{
Debug.WriteLine(ex);
}
finally
{
IsBusy = false;
}
}
In my codebehind file, I set the BindingContext to the viewmodel
private AddressTypeViewModel viewModel;
public AddressTypes()
{
InitializeComponent();
BindingContext = viewModel = new AddressTypeViewModel();
stack = Addresspopup.PopupView.ContentTemplate.CreateContent() as StackLayout;
}
The DeleteCommand never executes. It appears no binding occured (even though the {Binding AddressTypeName} works as expected.
I have no idea why.
I also tried just catching the Tap event in my code behind by doing this in my XAML:
<Label Text=""
Grid.Column="1"
FontFamily="{StaticResource SegoeMDL2Assets}" FontSize="Medium" HorizontalOptions="End">
<Label.GestureRecognizers>
<TapGestureRecognizer Tapped="OnDelete_Tapped" CommandParameter="{Binding .}"/>
</Label.GestureRecognizers>
</Label>
I added this to my code behind:
public void OnDelete_Tapped(object sender, EventArgs e)
{
viewModel.DeleteCommand.Execute(e); //deletes the item
viewModel.LoadAddressTypesCommand.Execute(true); //reload the addresstypes
}
The DeleteCommand does NOT execute! I put a breakpoint in that method in my view model - nothing happens - never hits it.
Can someone shed any light on this? Thanks in advance!
Hi all, this is my first question on this forum (and also I am still not very practile in Xamarin) so please be patient with me.
In Visual Studio on Mac I have a class library project (Multiplatform -> Libraray) called my.cool.lib. I have also platform specific code for this library in my.cool.lib.Android (Library) and my.cool.lib.iOS (Library). When compiled these product my.cool.lib.dll, my.cool.lib.Android.dll and my.cool.lib.iOS.dll inside their own build dirs.
When I try to use this library inside my "main" multiplatform xamarin.forms app project the code complains that is cannot find my.cool.lib.dll although I have included a dependency for my.cool.lib project in the "Dependencies -> Projects" of my main app...
Anyone can maybe shed some light on this?
Otherwise how to accomplish the following :
1. Have a library containing genral code for xamarin.forms + iOS and Android specific code (i.e. renderers)
2. Include that library project in a "main" app multiplatform project.
Thanks in advance,
Tod
Hi, I am working on the xamarin form. My requirement is to bind navigation menus at the bottom like
once I click on the more navigation pop up or sidebar should appear like
and I want to hide the hamburger menu button
How to achieve this?
i have a social media feed im working on and i want each post tile to take about about .66* maybe more of the screen without an white space at the bottom of the tile.i just need it to be the same throughout all displays. at the moment im using height requests but i dont think it will transfer to all displays. i will attach xamal and 2 pictures in the scroll feed . if it is needed i can provide model and view model.
also im new if i made any obvious mistakes in my code plz specify
<?xml version="1.0" encoding="utf-
8" ?>
<ContentPage.BindingContext>
</ContentPage.BindingContext>
<ContentPage.Content>
<CollectionView ItemsSource="{Binding SocialFeedTiles}">
<CollectionView.ItemTemplate>
<DataTemplate>
<StackLayout Padding="0,0,0,5">
<Frame BackgroundColor="#82D5FF" Padding="0" HeightRequest="55" >
<Grid Padding="0" ColumnSpacing="5" Margin="0,2,0,2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width=".15*"/>
<ColumnDefinition Width=".75*"/>
</Grid.ColumnDefinitions>
<Image Grid.Column="0" Source="{Binding ProfilePhotoUrl} "/>
<StackLayout VerticalOptions="Center" Grid.Column="1">
<Label Text="{Binding Username}" FontSize="10" />
<Label Text="{Binding FullName}" FontSize="15" />
</StackLayout>
</Grid>
</Frame>
<Image Source="{Binding PostUrl}" />
<Frame BackgroundColor="#82D5FF" Padding="0" HeightRequest="52.5" >
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width=".12*"/>
<ColumnDefinition Width=".12*"/>
<ColumnDefinition Width=".12*"/>
<ColumnDefinition Width=".64*"/>
</Grid.ColumnDefinitions>
<Grid Grid.Column="0" Padding="0" RowSpacing="0">
<Grid.RowDefinitions>
<RowDefinition Height=".75*"/>
<RowDefinition Height=".25*"/>
</Grid.RowDefinitions>
<ImageButton Grid.Row="0"/>
<Label Text="likes" FontSize="Micro" Grid.Row="1" HorizontalOptions="Center" />
</Grid>
<Grid Grid.Column="1" RowSpacing="0">
<Grid.RowDefinitions>
<RowDefinition Height=".75*"/>
<RowDefinition Height=".25*"/>
</Grid.RowDefinitions>
<ImageButton Grid.Row="0"/>
<Label Text="likes" FontSize="Micro" Grid.Row="1" HorizontalOptions="Center" />
</Grid>
<Grid Grid.Column="2" RowSpacing="0" >
<Grid.RowDefinitions>
<RowDefinition Height=".75*"/>
<RowDefinition Height=".25*"/>
</Grid.RowDefinitions>
<ImageButton Grid.Row="0" Padding="0" />
<Label Text="likes" FontSize="Micro" Grid.Row="1" HorizontalOptions="Center" />
</Grid>
</Grid>
</Frame>
</StackLayout>
<!--<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Image Source="{Binding ProfilePhotoUrl}" Grid.Column="0"/>
<StackLayout Orientation="Vertical" Grid.Column="1">
<Label Text="{Binding Username}" FontSize="Title"/>
<Label Text="{Binding FullName}" FontSize="Subtitle"/>
</StackLayout>
</Grid>-->
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</ContentPage.Content>
Is there any way to create this kind of UI (Like spinner) ?
Any idea would be appreciated.
Thanks.
Hi to everyone!
I do not know if is a problem or a misunderstanding by me (maybe the second one) but I can not success to set any height size to my CollectionView.
I am starting to use Xamarin and I was trying to use the CollectionView object when I realized that the height of this View is very large (and other View Objects had an addecuate size, for example Label Views).
The height is more or less like the height Page.
Firstly I think that was a problem with the inside objects. I tried with strings and custom objects without success.
After a lot of tests, I tried with an empty CollectionView (with the BackgroundColor set in LightBlue) and I realized that my problem is not in the collectionView objects, but is in the CollectionView object itself.
When I was trying to reproduce the problem to publish it here I realized that the CollectionView was fitting its own size to the page size (the height is still very big but less than the height Page).
So, finally, I checked my code and found that the CollectionView is inside a StackLayout and this StackLayout is in a ScrollView.
I mean:
<ScrollView>
<StackLayout>
<CollectionView>
</CollectionView>
</StackLayout>
</ScrollView>
When I wrap the StackLayout in a ScrollView, the CollectionView height increase (I didn't measure it, but the height is more or less like the height page).
This height is very large and I didn't find an option to change its height.
I am using the latest stable version of Xamarin (3.6.0.344457). But I also checked the latest preliminar version (4.0.0.394984-pre) without success.
To test the program I am using an emulator with Android 9.0 (Api 28) and my own smartphone (Nexus 5X with Android 8.1, Api 27).
To reproduce the problem I created a new Mobile Application (Xamarin.Forms) project, select a Shell template and, in ItemDetailPage.xaml, I added the ScrollView, two labels and the CollectionView.
This is the full code of ItemDetailPage.xaml with my own modifications:
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http: //xamarin.com/schemas/2014/forms"<!-- Here I added a space between "http:" and "//" because I can not publish urls in the forum-->
xmlns:x="http: //schemas.microsoft.com/winfx/2009/xaml"<!-- The same here-->
x:Class="XamarinTest.Views.ItemDetailPage"
Title="{Binding Title}">
<ScrollView>
<StackLayout Spacing="20" Padding="15">
<Label Text="Text:" FontSize="Medium" />
<Label Text="{Binding Item.Text}" FontSize="Small"/>
<Label Text="Description:" FontSize="Medium" />
<Label Text="{Binding Item.Description}" FontSize="Small"/>
<Label Text="CollectionView:"></Label>
<CollectionView BackgroundColor="LightBlue">
</CollectionView>
<Label Text="End CollectionView"></Label>
</StackLayout>
</ScrollView>
</ContentPage>
I only want a CollectionView that it only has the necessary height, the enough to wrap it's own children.
Thanks in advance!
To be my knowledge we can change the complete application language using localization , But i want to change keyboard when i enter specific language.
Example : default is English. but when i enter Dutch word keypad should appear as dutch.
class AndroidShell : ShellRenderer
{
public AndroidShell(Context context) : base(context)
{
}
protected override IShellToolbarAppearanceTracker CreateToolbarAppearanceTracker()
{
return new MyShellToolbarAppearanceTracker(this);
}
protected override IShellTabLayoutAppearanceTracker CreateTabLayoutAppearanceTracker(ShellSection shellSection)
{
return new MyTabLayoutAppearanceTracker(this);
}
}
internal class MyTabLayoutAppearanceTracker : IShellTabLayoutAppearanceTracker
{
private AndroidShell _tabBarShellRenderer;
public MyTabLayoutAppearanceTracker(AndroidShell tabBarShellRenderer)
{
_tabBarShellRenderer = tabBarShellRenderer;
}
public void SetAppearance(TabLayout tabLayout, ShellAppearance appearance)
{
// tabLayout.GetChildAt(1).SetPadding(10, 10, 10, 10);
Typeface typeface = Typeface.CreateFromAsset(Android.App.Application.Context.Assets, "BBCReithSerif_W_Bd.otf");
}
public void ResetAppearance(TabLayout tabLayout)
{
}
public void Dispose()
{
}
}
Hi everyone !
My app is on play store and app store.But, i dowloading my app in appstore, But not all the pictures, icons and videos in my ios project are visible. I mean, the pictures from api look but the pictures, icons and videos I put into my project don't.
Normally there are images in the resources folder in the ios layer of my project. But it does not display them. Normally it was appear in the simulator.
What do you think might be the source of this problem? How can i solve it ?
Thanks in advance !