I'm developping a page tabbedPage and i want to show contentPage other than tabs inside tabbedpage without adding in childrens.
i did add the contentpage in xamal but it's not the solution because it add it in childrens
can you help me ?
I'm developping a page tabbedPage and i want to show contentPage other than tabs inside tabbedpage without adding in childrens.
i did add the contentpage in xamal but it's not the solution because it add it in childrens
can you help me ?
Thank you in advance,
shreyanka
I have a HybridWebView in my app and i need to change the uri dynamically (When the user click at some menu the uri changes), but it does not change at all... I use WebView and it works great, but when I use the HybridWebView the Uri is not changing.
Hey!
I have an app (Android & iOS) with a camera function. With this function, the user can simply click on a button to open te camera app, take a picture and this picture is then send to the server with an API:
Now I have a new camera function with an in-app camera (so that the camera app isn't needed anymore). Now the user can take a picture, which is then showed in Syncfusion image editor (rotation and cropping). This image should then be send to the API:
Now I have the following problem: the picture size is too big and the system rejects pictures which are too big.
You can see in the first image that I resize the picture to medium so that the system can handle the image. If I don't do this, the image will simply not be send to the server. Problem is that I have no idea how to do this resizing in the new camera function.
Anyone that can help?
Best regards,
Ganesh
Trying to understand what's going on here.
Here's what's going on.
The application starts normally,
1. registers all dependency services
2. register/subscribe push notification events from Plugin.FirebasePushNotification library
Now when I receive a push notification and tap on the notification box. The app re-launches again and repeats the flow above, but now the problem comes in #2 where I subscribed to the "event"s because now it's triggering twice.
Got a push notification, I tap on it, it's now triggering 3x, 4x, 5x and so on..
One specific event I use is the OnNotificationOpened. That triggers when I tap on the notification box and it will open a specific page. Right now, what's going on is, after tapping on the notification box for the 3rd time for example, it will launch that page 3x as well so when I press the back button, I get back to the same page 2x.
How do you prevent these? How to tell the app that it's already running, so please do not re-register all the services that has been registerd and re-subscribe to the events that has already been subscribed to?
Thanks!
Long story short ...
I've been working on a Xamarin Forms app since December 2019, an i've been updating my Xamaring Forms so I can keep it up running with the latest features so far so good until Xamarin 5 came in. This version asks me to change my compileskdversion from 9 or lower to at least 10, so I did.
My app runs smoothly with android 9.0 (Pie) and Xamarin Forms 4.8.0.1821 (latest before 5.0.0.1874 official realese version) The moment I change my SDK and try to run it on my physical phone it throws me this 2 errors:
Gravedad Código Descripción Proyecto Archivo Línea Estado suprimido Error XARDF7023: System.IO.DirectoryNotFoundException: No se puede encontrar una parte de la ruta de acceso 'AccessibilityManagerCompat_AccessibilityStateChangeListenerImplementor.class'. en System.IO.Directory.DeleteHelper(String fullPath, String userPath, Boolean recursive, Boolean throwOnTopLevelDirectoryNotFound, WIN32_FIND_DATA& data) en System.IO.Directory.Delete(String fullPath, String userPath, Boolean recursive, Boolean checkHost) en Xamarin.Android.Tasks.RemoveDirFixed.RunTask()
Gravedad Código Descripción Proyecto Archivo Línea Estado suprimido Error XARDF7024: System.IO.IOException: El nombre de archivo, el nombre de directorio o la sintaxis de la etiqueta del volumen no son correctos. en System.IO.Error.WinIOError(Int32 errorCode, String maybeFullPath) en System.IO.Directory.DeleteHelper(String fullPath, String userPath, Boolean recursive, Boolean throwOnTopLevelDirectoryNotFound, WIN32_FIND_DATA& data) en System.IO.Directory.Delete(String fullPath, String userPath, Boolean recursive, Boolean checkHost) en Xamarin.Android.Tasks.RemoveDirFixed.RunTask()
(sorry if some parts of the error comes in spanish).
The thing here is only when I change mi SDK, I've tried to
1. Clean and rebuilt
2. Install some .NET Compilers in my Xamarin Android Project
3. Install the Xamarin.AndroidX dependencies (That works fine with Android 9 (Pie))
4. Use another machine to compile
5. Change phone
6. Remove old dependencies
I've to say I don't even know where to look with this error.
Please if anyone can help me solve this.
Thank you very much everyone!
Hi,
I need to get every VisualElement implementing ITextElement within my layout in order to change the TextColor. But this interface is internal, is there any reasons why? Maybe there is another way to achieve what I want? At this moment from my View I test if Content is an ILayoutController, if it is I get every Label (but I would like every ITextElement) to change the TextColor.
Thanks.
Max
I want to load http(not secure link).Showing this error. How can I do?
public int Position => Convert.ToInt32(players.Position.TotalSeconds); CrossMediaManager.Current.PositionChanged += (sender, e) => { slider.Maximum = e.Position.TotalSeconds; slider.Value = e.Position.TotalSeconds; }; private void Slider_ValueChanged(object sender, ValueChangedEventArgs e) { slider.Value = CrossMediaManager.Current.Position.Seconds; //if (slider.Value != CrossMediaManager.Current.Duration.TotalSeconds) //{ // CrossMediaManager.Current.SeekTo(TimeSpan.FromSeconds(slider.Value)); //} } private bool UpdatePosition() { //slider.ValueChanged -= Slider_ValueChanged; slider.Value = CrossMediaManager.Current.Position.TotalSeconds; //slider.ValueChanged += Slider_ValueChanged; return CrossMediaManager.Current.IsPlaying(); }
ive tried to use fill,aspect fill and aspect fit buy they don't change anything. and I'm wondering how to get the picture to fill the screen
Hello guys,
I'm struggling to change the Button visibility when the ListView is not empty. I have tried to create an ValueConvertor to return false when my list is empty and true when the list has 1 or more items. The thing is that after the ListView gets 1 or more elements the IsVisible property of the button is not binding anymore. At the start of the application the "Convert" method of the ValueConverter is executed and the button visibility is set to false.
This is my xaml code :
<ContentPage.BindingContext> <viewModels:OrdersPageViewModel/> </ContentPage.BindingContext> <StackLayout> <ListView x:Name="OdersViewList"> ... </ListView> <Button Text="Commit" Clicked="Button_CommitClicked" HorizontalOptions="Center" IsVisible="{Binding OrderListItems, Converter={StaticResource ListIsNull}}"/> </StackLayout>
This is my ViewModel:
public class OrdersPageViewModel : INotifyPropertyChanged { public ObservableCollection<OrderListItem> OrderListItems {get; set;} public event PropertyChangedEventHandler PropertyChanged; public OrdersPageViewModel() { OrderListItems = new ObservableCollection<OrderListItem>(); OrderListItems.CollectionChanged += OrderListItems_CollectionChanged; } void OnPropertyChanged([CallerMemberName] string propertyName = null) { var handler = PropertyChanged; if (handler != null) { handler(this, new PropertyChangedEventArgs(propertyName)); } } private void OrderListItems_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { OnPropertyChanged("OrderListItems"); } }
This is my ValueConverter:
public class ListIsNullConvert : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { ObservableCollection<OrderListItem> list = (ObservableCollection<OrderListItem>)value; if (list.Count == 0) { return false; } return true; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); } }
Hello all,
I am trying to fork this open source project and test it on VS19(Xamarin): XamFood (search it on github, I can't post links yet)
The app seems ok, and there are not errors in compilation.
When I try to boot it on my device, using Debug or Release, the App does not run, and I get no errors about it.
There are App and Appshell.xaml/xaml.cs files inside the project, so the main booting project should be already declared.
Also there are Android and IOS Projects, but I want just to test it in android.
I am using:
VS19
Pixel 9 Pie(Android 9, Api 28) as emulated device, also tried with Android 6.0 Api 23-24 Nexus S
Could anyone help me? Thanks in advance
I have a xamarin forms page where the user can update some data in a form. I need to intercept the Navigation Bar Back Button Clicked to warn the user if some data have not been saved.How to do it?
I'm able to intercept the hardware Bar Back Button Clicked in Android using the Android.MainActivity.OnBackPressed(), but that event is raised only on hardware Bar Back Button Clicked, not on Navigation Bar Back Button Clicked.
I tried also to override Xamarin.Forms.NavigationPageOnBackButtonPressed() but it not works. Why? Any one have already solved that issue?
I also tried by overriding OnDisappear, there are two problems:
The page has already visually disappeared so the "Are you sure?" dialog appears over the previous page.
Cannot cancel the back action.
So,is it possible to intercept the navigation bar back button press?
Thanks for any help on this.
Hi
I have an Xamarin.Forms project targeting Android, iOS and UWP.
In my Android-App, the hardware backbuttons of my phone are not working (back button and also the menu button).
Why is that? Did I forgot something?
Thanks
Hi All,
I'm having a random weird issue with Geolocation.GetLocationAsync.
When I am calling var getLastKnownLocation = await geoLocation.GetLastKnownLocation(); within an action on some devices, it constantly hangs on Geolocation.GetLocationAsync(request); without anytime or Exception and doesnt move!
One device this does this on is a Huawei P30 Pro, Android Version 9.
My code is below.
public async Task<LocationViewModel> GetLastKnownLocation() { try { var mn = new LocationViewModel(); var request = new GeolocationRequest(GeolocationAccuracy.Medium, TimeSpan.FromSeconds(5)); var location = await Geolocation.GetLocationAsync(request); if (location != null) { mn.Latitude = location.Latitude.ToString(); mn.Longitude = location.Longitude.ToString(); return mn; } return new LocationViewModel() { Longitude = "", Latitude = "" }; } catch (FeatureNotSupportedException fnsEx) { return new LocationViewModel() { Longitude = "", Latitude = "" }; } catch (FeatureNotEnabledException fneEx) { return new LocationViewModel() { Longitude = "", Latitude = "" }; } catch (PermissionException pEx) { return new LocationViewModel() { Longitude = "", Latitude = "" }; } catch (Exception ex) { return new LocationViewModel() { Longitude = "", Latitude = "" }; } }
Thanks,
Dane
Hi guys,
I'm creating a project where I have to take a lot of pictures. In my previous project on iOS all are working fine. I'm using the same code for a new project for all platforms.
When I take a photo on Android the stream is empty.
var file = await CrossMedia.Current.TakePhotoAsync(new Plugin.Media.Abstractions.StoreCameraMediaOptions()); if (file == null) return; byte[] imageAsBytes = null; using (var memoryStream = new MemoryStream()) { file.GetStream().CopyTo(memoryStream); file.Dispose(); imageAsBytes = memoryStream.ToArray(); }
Any ideas?
Thank you in advance
This code from https://docs.microsoft.com/en-us/samples/xamarin/xamarin-forms-samples/getstarted-notes-database/
Then on NotesPage.Xaml, I added 2 buttons above the <ListView ..
<ContentPage .. <StackLayout> <Button Text="DateFirstFromListViewItem" Clicked="OnClickFilterListViewBetwenBtn1TextAndBtn2" x:Name="Button1"/> <Button Text="DateLaststFromListViewItem" Clicked="OnClickFilterListViewBetwenBtn2TextAndBtn1" x:Name="Button2"/> <ListView x:Name="listView" ItemSelected="OnListViewItemSelected"> <ListView.ItemTemplate> <DataTemplate> <TextCell Text="{Binding Text}" TextColor="Black" Detail="{Binding Date}" /> <!-- THIS DATE --> </DataTemplate> ... </StackLayout> </ContentPage>
I have 2 questions, assuming Notes is already filled with data:
1. How do we send Date from the first ListView item to Button1 and the last Date to Button2.
2. When button1 or button2 is clicked, listView will automatically adjust between button1 and button2 date.
Hopefully this can be resolved. Thank you.
I know that async functions are great because they don't block your UI thread, so the app can continue running while some long process is running.
Here's the problem my data repositories are all async. So I have functions like
public async Task<ObservableCollection<Categories>> GetItems() { CreateConnection(); return new ObservableCollection<Categories>(await connection.Table<Categories>().ToListAsync()); }
I then use the code like this
//List of categories public ObservableCollection<Cagegories> ocCategories; //List of categories public ObservableCollection<Products> ocProducts; //build an accessor for the repo public CategoriesRepository CategoryRepo => new CategoriesRepository(); public ProductsRepository ProductRepo => new ProductsRepository (); //Constuctor for page public ShowCategoryTable() { LoadTableData(); //combo box of categories cbCategories.DataSource = ocCategories; dtProducts.DataSource = ocProcucts; } public async void LoadTableData() { ocCategories = await CategoryRepo.GetItems(); ocProducts = await ProductRepo.GetItems(); }
When this code is called, it spawns off on another thread, as it should.
Here's the rub, the code that uses the result is executed before this call is finished, which will in turn cause a NullException
to be thrown, because the thread that is getting the data still has not returned yet.
I was under the impression that this is what the await
call was for. That this would in effect make an async
function become synchronous (but using a backing thread for the process).
I've already tried this too.
//Constuctor for page public ShowCategoryTable() { Initialize(); ConsumeData(); } public async void Initialize() { await LoadTableData(); // I've tried even using ConfigureAwait for this and still had the same results. } public void ConsumeData() { //combo box of categories cbCategories.DataSource = ocCategories; dtProducts.DataSource = ocProcucts; }
When this runs it reaches the await
it starts that thread, and immediately attempts to use the data, even when I have tried breaking it into separate async functions and calling them independently
I have tried the code with both ConfigureAwait
and even using true
and false
. But no matter what I do, it seems that my thread is not waiting for the data to return. I can write some really unpleasant code and use Task.Wait(xxx)
and make it wait 200ms or so. But that is really bad coding in my experience, and should be avoided like the plague.
The hard part becomes, how can I make these async DB calls execute and return before the UI consumes the data? effectively, how can I make async DB functions perform synchronously?
From what I've read it sounds like that's what await
is supposed to do, but it's failing to do so for me.
Hi All,
I have three page like login_page, dashboard_page and list_page
I have implemented OnBackButtonPressed event in dashboard_page and display alert message when press back button from device.
When I press twice back-button from list_page it will redirect to login_page. it will not call OnBackButtonPressed from dashboard_page,
Please suggest me how to I call OnBackButtonPressed event when back from list_page.
How to show thumbnail image when mediaelement loads on page?