Hi,
Please suggest any method to implement rounded corner frame without using custom renderers.
Thanks & Regards,
Kavya
Hi,
Please suggest any method to implement rounded corner frame without using custom renderers.
Thanks & Regards,
Kavya
Using Prism 7.0, I'm trying to navigate from ContentPage to a MasterDetailPage. I want to delete the current ContentPage from the navigation stack and go to the MasterDetailPage (Like a login function) like this:
_navigationService.NavigateAsync("../MyMasterDetailPage/MyNavigationPage/ViewB");
This works succesfully. Now, I want to make a logout function that goes back to first page with this:
_navigationService.NavigateAsync("../../../MyNavigationPage/ViewA");
This gives the following error:
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
But I'm quite sure there are three elements in this list, MyMasterDetailPage, MyNavigationPage and ViewB. So I tried to use an absolute URI, like this:
_navigationService.NavigateAsync("myapp:///MyNavigationPage/ViewA");
Which results in the error message:
System.Exception: Cannot destroy MyApp.Views.MyNavigationPage
What happens under water when calling an absolute URI in Prism 7.0 to create this error? And is only ViewB counted as an entry and that's why I cannot navigate three steps back?
For developers who love Xamarin.iOS or Xamarin.Android but struggled enough with Xamarin.Forms...
I just open-sourced 4 years of extensive work resulted in a creation of Fusion framework which is now available under Apache license, version 2.0.
The main idea of the framework was to build a tool that you can learn how to use once and then be able to apply everywhere (iOS and Android, for now) - "Learn once, code everywhere" principle, rather than "Code once, run everywhere". The framework doesn't strictly follow any standard architectural patterns (MVC, MVVM, etc.) but rather violate them as the focus here is on simplifying the development of common tasks.
You can download it from GitHub: https://github.com/altavant/Fusion
Take a look at the ItemList example and if you like what you see and get the idea, then drop me a line at info@altavant.com, so i'd keep adding new examples and the documentation.
Here is an example of an app built with the Fusion framework:
Hi, all. I want to create custom renderer with native layout and import multiple Xamarin.Forms pages.
Basically I want to use something like CreateFragment from here link
but in custom renderer. Is it possible?
Hi,
I would like get list of background apps running on UWP platform.
So i have - sharedProject and UWP project.
In SharedProject I created a DependencyService which is calling method in UWP project to get list of apps:
DependencyService:
DependencyService.Get<IBackgroundAppsInfo>().GetBeackgroundProcesses();
Method in UWPProject :
`public BatteryMobileSaver.ViewModels.SharedViewModel GetBeackgroundProcesses()
{
GetAppInfo();
LoadProcesses();
foreach(var process in uwpNativeViewModel.ProcessList)
{
sharedViewModel.ProcessList.Add(new BatteryMobileSaver.Models.ProcessInfoModel
{
CpuUsageTime = process.CpuUsageTime,
DiskBytesCount = process.DiskBytesCount,
ExeName = process.ExeName,
PageFileSize = process.PageFileSize,
ProcessId = process.ProcessId,
WorkingSetSize = process.WorkingSetSize
});
}
return sharedViewModel;
}
public async void GetAppInfo()
{
IList<AppDiagnosticInfo> list = await AppDiagnosticInfo.RequestInfoAsync();
list.ToList().ForEach(o => sharedViewModel.AppInfoList.Add(new BatteryMobileSaver.Models.AppInfoModel
{
DisplayName = o.AppInfo.PackageFamilyName,
}));
}`
Data are returned correctly, but then i get Exception:
Exception = {System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccess...
Is that problem with async/await operation ?
Could You please post a solution for that problem ?
Thanks, a lot
There is no section for Xamarin.WPF yet apparently but I need to know how to use a PageRenderer in Xamarin.WPF. I have a ContentPage in my Xamarin.Forms PCL and I am using a PageRenderer in my Xamarin.WPF project but I cannot figure out how to set its content. Can anyone please help?
I have been modifying the Todo app that uses Forms and replaced the note Entry class with the Editor class, so the todo can hold multiline notes. However the editor does not expand as new lines are entered. I have a Forms Editor Control nested inside a stack layout / scroll view - how do I allow the editor to grow each time the user enters another line of data? I had some success by count the '\n' characters in the text each time it changes and making a HeightRequest to the Editor, but I don't know how to calculate the exact extra height to add for each row in a reliable way. This process also feels clunky too. Can the editor control not be told to simply grow as new content is added by the user?
Hi. Our app needs to download (or upload) say, between 1 and 50 images at a time. We create a list of all the images that have not been downloaded yet and then download them. We would like this to be able to continue downloading when the app is in the background.
I have found some sample programs that do this, but only for 1 image.
https://developer.xamarin.com/samples/monotouch/SimpleBackgroundTransfer/
and
https://github.com/RobGibbens/XamarinFormsBackgrounding
What I can't figure out is how to add more images to download to the Session. (I expect it is easy - once I know).
I'd appreciate any insight on how to accomplish that - or being directed to some sample code that does it.
Thanks!
Have a project uses Xamarin.Forms 2.3+ with Xamarin Android Support Nuget 2.3+, and tries to update to Xamarin.Forms 3.0, the Visual Studio 15 complain about MSBuild, then I tried to update to Xamarin.Forms 2.5 by deleting whole project and redownload the source code.
With Xamarin.Forms 2.5, Android support Nuget is unable to update due to "Unable to resolve dependencies. 'Xamarin.Android.Support.Design 27.0.2' is not compatible with 'Xamarin.Forms 3.0.0.482510 constraint: Xamarin.Android.Support.Design (= 23.3.0)'." but clearly I have installed 2.5.1.52, and not 3.0. Why does it complain about 3.0?
Are we getting forced to buy Visual Studio 17 to update now?
(Note: I have tried doing this on an existing machine for Xamarin and a clean machine, with the same result.)
Im learning Xamarin, when I try to create a project and build it, it gives me this error:
The "Xamarin.Forms.Build.Tasks.GetTasksAbi" task could not be loaded from the assembly , C:\Users\XXXX.nuget\packages\xamarin.forms\3.0.0.482510\build\netstandard2.0\Xamarin.Forms.Build.Tasks.dll. Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral
I really dont know how to solve it. I also tried: docs.microsoft.com/en-us/xamarin/xamarin-forms/internals/net-standard
hi,
there is' some way to be able to find an item in ControlTemplate?
Br
Max
Hello,
I have started a new Xamarin.Forms project and after upgraded Xamarin.Forms package (3.0.0.446417), I got this warning on InitializeComponent method call in App.xaml.cs (The call is ambiguous between the following methods or properties: 'App.InitializeComponent()' and 'App.InitializeComponent()') or in pages ((The call is ambiguous between the following methods or properties: 'MyPage.InitializeComponent()' and 'MyPage.InitializeComponent()')).
This warning doesn't appear for next pages I have newly created.
Any idea?
Thanks.
Hi Xamarin Community
How come my app doesn't launch / run in my android phone? it will install on the phone with no problem then when it is done installing I choose Open but it will just throw me back to my Download folder where the .apk file resides
Anyway Here is the specs of the phone and the Build properties of my program
Im using Huawei phone with Nougat(7.0) Android on it
my Build properties as follows
Compile using Android version Android 8.1(Oreo)
Android Manifest Minimum Android Version Android 4.4(Kit Kat)
Target Android Version Android 8.1(Oreo)
Im using Visual Studio 2017 and Xamarin Platform
I have restarted my phone after it throws me back to the folder I did that method when I was still on Kitkat plus I tried building a new blank project untouched and deploying it on the nougat phone and it works but my written program does not work by the way no Errors on my Error List of Visual Studio
Hello, I'm using Xamarin Forms for develop Android and iOS app. My app it's working in Android, but when i compile the iOS version (project) the error "CS0103 The name 'InitializeComponent' does not exist in the current context" appears. I'm updated the Forms nugget package, but not happens and the error occurs every time. Can anyone help me?
I'm working on a Xamarin forms application and not sure if this is an error triggered by C#/HttpClient or by Xamarin Forms.
In my Xamarin Forms application, I have a RequestService class that contains the following code:
public class RequestService : IRequestService
{
private static HttpClient instance;
private static HttpClient HttpClientInstance => instance ?? (instance = new HttpClient(new NativeMessageHandler() { EnableUntrustedCertificates = true, DisableCaching = true }));
public async Task<TResult> GetAsync<TResult>(string uri, string token = "")
{
setupHttpClient(token);
HttpResponseMessage response = await HttpClientInstance.GetAsync(uri).ConfigureAwait(false);
await HandleResponse(response);
string responseData = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
return await Task.Run(() => JsonConvert.DeserializeObject<TResult>(responseData));
}
private void setupHttpClient(string token = "")
{
HttpClientInstance.DefaultRequestHeaders.Accept.Clear();
HttpClientInstance.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
if (!string.IsNullOrWhiteSpace(token))
{
HttpClientInstance.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", token);
}
}
private async Task HandleResponse(HttpResponseMessage response)
{
if (!response.IsSuccessStatusCode)
{
var content = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
if (response.StatusCode == HttpStatusCode.Forbidden || response.StatusCode == HttpStatusCode.Unauthorized)
{
throw new Exception(content);
}
throw new HttpRequestException(content);
}
}
}
It has been working quite well for the last 5 to 7 days but today it started crashing without any errors.Any request just exits the application.
I managed to debug and trace successful execution until the line:
HttpResponseMessage response = await HttpClientInstance.GetAsync(uri).ConfigureAwait(false);
It is on this line that it tries to do something and then just exits the app. The Debug console for that line shows the following:
Thread started: #3
05-14 10:20:51.974 D/Mono (20217): Assembly Ref addref ModernHttpClient[0x7028fef180] -> System[0x701365c000]: 15
05-14 10:20:51.986 D/Mono (20217): Assembly Ref addref ModernHttpClient[0x7028fef180] -> System.Core[0x701439c500]: 10
05-14 10:20:52.098 D/Mono (20217): DllImport searching in: '__Internal' ('(null)').
05-14 10:20:52.098 D/Mono (20217): Searching for 'java_interop_jnienv_new_object_array'.
05-14 10:20:52.098 D/Mono (20217): Probing 'java_interop_jnienv_new_object_array'.
05-14 10:20:52.098 D/Mono (20217): Found as 'java_interop_jnienv_new_object_array'.
05-14 10:20:52.101 D/Mono (20217): DllImport searching in: '__Internal' ('(null)').
05-14 10:20:52.101 D/Mono (20217): Searching for 'java_interop_jnienv_set_object_array_element'.
05-14 10:20:52.101 D/Mono (20217): Probing 'java_interop_jnienv_set_object_array_element'.
05-14 10:20:52.101 D/Mono (20217): Found as 'java_interop_jnienv_set_object_array_element'.
05-14 10:20:52.107 D/Mono (20217): DllImport searching in: '__Internal' ('(null)').
05-14 10:20:52.107 D/Mono (20217): Searching for 'java_interop_jnienv_get_object_array_element'.
05-14 10:20:52.107 D/Mono (20217): Probing 'java_interop_jnienv_get_object_array_element'.
05-14 10:20:52.107 D/Mono (20217): Found as 'java_interop_jnienv_get_object_array_element'.
05-14 10:20:52.213 D/Mono (20217): DllImport searching in: '__Internal' ('(null)').
05-14 10:20:52.214 D/Mono (20217): Searching for 'java_interop_jnienv_call_boolean_method'.
05-14 10:20:52.214 D/Mono (20217): Probing 'java_interop_jnienv_call_boolean_method'.
05-14 10:20:52.214 D/Mono (20217): Found as 'java_interop_jnienv_call_boolean_method'.
05-14 10:20:52.348 F/ (20217): /Users/builder/jenkins/workspace/xamarin-android-d15-6/xamarin-android/external/mono/mono/mini/debugger-agent.c:4846: (null) assembly:mscorlib.dll type:BadImageFormatException member:<none>
A few things to note here are as follows:
I have reproduced the issue in a simple solution hosted here.
Has anybody come across this issue? Any assistance would be greatly appreciated.
Thanks
The StackLayout in my ControlTemplage:
<StackLayout Grid.Row="0" Grid.Column="0" Style="{StaticResource NavigationBarLayoutStyle}" BackgroundColor="TemplateBinding Parent.HomeBackgroundColor"> ...... </StackLayout>
I want to change its background color in the behind code of Home page by using a bindable property
public static readonly BindableProperty HomeBackgroundColorProperty = BindableProperty.Create("HomeBackgroundColor", typeof(Color), typeof(HomePage), Color.Red); public Color HomeBackgroundColor { get { return (Color)GetValue(HomeBackgroundColorProperty); } }
The error message is
System.InvalidOperationException: Cannot convert "TemplateBinding Parent.HomeBackgroundColor" into Xamarin.Forms.Color
The same way works very well for Label.Text property but the background color. Thanks for your help
Hi,
I am developing a prayer time app which will send push notifications on prayer times.
Prayer times for Muslims is 5 times a day and it depends on the local time
So I am checking the current location using latitude and longitude and then checking the prayer times using a web service.
My question is what's the best way to do it?
Let the app connect to the the web service every minute and check if there is a pray then send a push notifications?
Thanks,
Jassim
I'm using MVVM approach described here.
To control a button behaviour I use ICommand binding with CanExecute flag. Everything works.
But how can I control disabled button style (background color and text color) in XAML?
I have the following XAML:
<Switch
IsToggled="{Binding IsChecked}"
IsEnabled="true"
Toggled="MyToggledEventHandler"
VerticalOptions="CenterAndExpand"
HorizontalOptions="EndAndExpand" />
This switch exists as part of a custom listview viewcell template, and the records that supply the listview elements are loaded asynchronously as part of the ContentPage's OnAppearing()
method. The ListView is hidden until these records have been loaded, as part of some MultiTriggers I have setup on the ListView to determine its IsVisible
property. When the records get set into the BindableProperty
to feed the listview, MyToggledEventHandler
gets called for each record where IsChecked
is true. This is not desirable because I have a server-side HTTP call that takes place as part of that event handler. How can I avoid this event being thrown while still taking advantage of XAML-only binding?
I should point out that I am not programmatically changing the IsChecked
property at any point - it is true/false at the point that it gets set into the ListView ItemsSource
property.
EDIT:
At the moment I am able to get around this with a secondary "checked" property in the record that is not a BindableProperty
- when it doesn't match the bound property, then I know it was hand-toggled; when they do match, it's on init. I can use that trick to return early from MyToggledEventHandler
. Definitely a hack, but it'll work until I get a better response.
hi,
How can I provide control (change) of my dynamic images created in xamarin forms by clicking .
sample ;
Image ggImage = new Image(); ggImage.Source = otoTip.imagex; ggImage.AutomationId = "seat_" +otoTip.num; ggImage.WidthRequest = imageWidth; ggImage.HeightRequest = 50; ggImage.VerticalOptions = LayoutOptions.Start; ggImage.HorizontalOptions = LayoutOptions.Start;
ggImage.GestureRecognizers.Add(tapGestureRecognizer);
for example, I just want to change a resume source