Quantcast
Viewing all 204402 articles
Browse latest View live

FreshMVVM Master detail with custom MasterPage

Hello
I use FRESHMVVM in my app.
I created a massterdetail page as well:

var masterPage = FreshPageModelResolver.ResolvePageModel();
var detailPage = FreshPageModelResolver.ResolvePageModel();
var masterDetailNav = new FreshMasterDetailNavigationContainer();
masterDetailNav.Init("Menu");
masterDetailNav.Master = masterPage;
masterDetailNav.Detail = detailPage;
MainPage = masterDetailNav;
}

I would like that when a MenuItem is pressed it is navigated to the new page keeping the menu present.

I am doing this way but the new page is opened without menu.

await CoreMethods.PushPageModel(item.ViewModelType);

Can you help me?
Thank you


Xamarin Forms Ondisappearing() called soon after Onappearing()

Ondisappearing() called soon after Onappearing() and onappearing called right after ondisappearing..i had this issue only on one page. other pages do not have this issue.i found this when i tap on navbar back button, it does not navigate to previous page, i had to tap twice to navigate back on this particular page..then i found this problem.degraded forms version 4.0 to 3.5 and recreated new page did not solve this issue..help need...

public Cart_Page2 ()
        {
            InitializeComponent ();
        }

        protected override void OnAppearing()
        {
            base.OnAppearing();

            var vm = new Cart_page_vm();
            vm.Navigation = Navigation;
            BindingContext = vm;    
        }

        protected override void OnDisappearing()
        {
            //  MessagingCenter.Send<Cart_page>(this, "cart_page_disappear");
            //  Navigation.PopAsync();       
        }

How to make the MasterDetail page in iOS slideover the content Page instead of Pushing

How to make the MasterDetail page in iOS slideover the content Page instead of Pushing...?

MasterBehaviour=PopOver is not working

xamarin studio 5.9.5 menus grayed out

Please can someone tell me what is wrong here as i have just installed xamarine studio on my aptop using a windows10 64bit operating system but cant run my project as the run menu is grayed out ,please what is the way foreward ?

App not working in release mode

Hi all, I need some help figuring out what the problem is.

I have a brand new installation of VS2017 fully updated

When I run my app in debug mode it works, when I run the app in release mode it would just hung at the splash screen, I tried to check the device log but I can only see IlligalStateException

I changed the Java Heap to 1G, but it did not solve the problem
I am upgraded to Xamarin.Forms 3.0 and I am compiling using Android 8.1, that did not solve the problem (also tried to lower the version)

I set the Linking to None, that only increased the app size and did not solve the problem

When I uncheck the "Bundle assemblies into native code" it then works but I have always been compiling my apps with this.
I checked the version of the NDK it is currently set to "C:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r15c" Not sure if the version is incorrect that I am using since this is also a new laptop (my other laptop was stolen where everything compiled and worked perfectly)

It also seem that the Device Log is lagging and doesn't want to filter. Device Monitor seems to be crashing aswell.

Is there a 'wake on movement' API?

I want to write an app that will basically sleep (to extend battery life) and somehow wake up when some movement (more of a vibration detection than physically moving metres).

Is there an API that can do this, or will I have to make some sort of 'wake on timer, check position etc'. The device will by physically static until something happens, so there isn't any need for GPS until it wakes up.

Interop to 32-bit and 64-bit C++ libraries in same project?

My Xamarin project for ARM devices is built for AnyCPU mode. At runtime, depending on Android device, it seems to run in 32 or 64 bit mode. For C++ interop I then need my shared library present in 32 and 64 bit builds depending on if Xamarin decides to run my app in 32/64 bit mode.

Are there best practices WRT project configuration and building for this scenario?

One alternative is to force 32-bit mode, but as this is a photo app, more memory is better so if 64-bit mode is available then it will be gladly consumed.

I did something similar for Windows, detecting mode at runtime and invoking different interop DLLs depending on bit depth. I am however a novice with Xamarin.

ListView with MVVM - TapGestureRecognizer command is not working

I'm using MVVM, I'm finding that trying to detect a row being clicked to invoke a command painful to implement. It would seem that there's no ItemSelected that takes a Command, so I've tried to use the TapGestureRecognizer with no success..
my viewcell is in c# as its bit complex to convert into xaml.

InSide ViewCell---

TapGestureRecognizer taponimgcheckuncheck = new TapGestureRecognizer();
taponimgcheckuncheck.SetBinding(TapGestureRecognizer.CommandProperty,"TapOnLogo");
imgcheckuncheck.GestureRecognizers.Add(taponimgcheckuncheck);

And my viewmodel is like---
public ICommand TapOnLogo{

        get{
            return new Command(() =>
            {
                Application.Current.MainPage.DisplayAlert("TapOnLogo","TapOnLogo","ok");
            });
        }
    }

The “XamlCTask” task failed unexpectedly Error

I'm currently using Xamarin.forms and i'm trying to build but i keep getting this error :

Error MSB4018: The "XamlCTask" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. Le fichier spécifié est introuvable.
File name: 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
at Xamarin.Forms.Build.Tasks.XamlCTask.Execute(IList`1& thrownExceptions)
at Xamarin.Forms.Build.Tasks.XamlTask.Execute()
at Microsoft.Build.Framework.ITask.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext()

I already saw some posts but any of them is resolving this problem and i can't start working because of this issue . Any help .. ? Thank you .

Xamarin Carousel not binding to ViewModel

I've got a Carousel page, where I use a XAML page as the template, however, while static text works fine, binding that page to a ViewModel, doesn't show my data correctly on the page:

My Carousel XAML page:

<?xml version="1.0" encoding="utf-8" ?>

<CarouselPage.ItemTemplate>


</CarouselPage.ItemTemplate>

Code behind:

using TestProject.ViewModels.Budget;
using System;
using System.Collections.ObjectModel;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;

namespace TestProject.Views.Budget
{
public partial class CustomerListPage : CarouselPage
{
public int CurrentIndex;

    public CustomerListPage()
    {
        InitializeComponent();

        ItemTemplate = new DataTemplate(typeof(CustomerListItemPage));

        ItemsSource = new ObservableCollection<ContentPage>
        {
            new CustomerListItemPage(){BindingContext = new CustomerListItemViewModel(DateTime.Now) },
            new CustomerListItemPage(){BindingContext = new CustomerListItemViewModel(DateTime.Now.AddMonths(-1)) },
            new CustomerListItemPage(){BindingContext = new CustomerListItemViewModel(DateTime.Now.AddMonths(-2)) },
            new CustomerListItemPage(){BindingContext = new CustomerListItemViewModel(DateTime.Now.AddMonths(-3)) },
        };
    }
}

}

My template page:

<?xml version="1.0" encoding="utf-8" ?>

<ContentPage.Content>

        <Label  Text="{Binding CurrentDate}" VerticalOptions="Start" HorizontalOptions="Center" BackgroundColor="Red" />
    </StackLayout>
</ContentPage.Content>

My ViewModel:

using System;

namespace TestProject.ViewModels.Budget
{
public class CustomerListItemViewModel : SyncableViewModel
{
private string currentDate { get; set; }

    public string CurrentDate
    {
        get
        {
            return currentDate;
        }

        set
        {
            currentDate = value;
            OnPropertyChanged(nameof(CurrentDate));
        }
    }

    public CustomerListItemViewModel(DateTime date)
    {
        CurrentDate = date.ToString();
    }
}

}
I thought I had everything wired up correctly, however, when I go to the carousel, the CurrentDate field is not showing up at all, even though when debugging, it is setting it correctly in the ViewModel.

How to get CommandParameter in Tapped Event.

Hi I am using GestureRecognizers in a lable and pass a parameter in CommandParameter but i didn't get in code behind.

private void OnListTapped(object sender, EventArgs e)
{
}

VPN with Android

Hello,

did somebody have any experience with the new VPNServer Class in Android 4.x and use it with Xamarin?

http://developer.android.com/reference/android/net/VpnService.html

There is an example, called: ToyVPN in the android sdk examples.
But there is nothing about the use of IPSEC/L2PT and PSK.

So maybe have somebody an better example how i can connect to such a service.
Or how to use the IPSec/L2PT functionality of Android with Xamarin (because there is a VPN Wizard on Android itself, maybe i can use it from code too?).

Thank you Image may be NSFW.
Clik here to view.
:)

Trust anchor for certification path not found.

Hi there,

I'm currently developing an app where (working with a third party) I make calls to their web service.

As part of this, I make a HttpClient (initialised with a new Xamarin.Android.NetAndroidClientHandler() for my Android testing), and after tweaking some request headers, await a response with client.GetStringAsync(targetURL).

With this all in a try catch, it get's caught in a catch with a java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.

From what I can gather online, this means that the server is replying with an authentication certificate that isn't trusted. However, I know that the server has been issued with a certificate from a trusted CA, and have found the same type of certificate in the Android device's trusted CA Certificates.

Can someone assist me in getting this working? Some things I've been trying to work out that could help include:
1) Does a Xamarin cross-platform application use the Android devices trusted certificates, or (as it's built with Mono) does it have it's own certificate store somewhere?
2) Am I able to install a trusted certificate as part of the application?

Using the same HttpClient implementation as above, I am able to connect to generic sites like Google and Microsoft. So I don't think it's an issue with implementation, especially as the java exception seems to indicate is is connecting to the web service, just not with a trusted certificate.

Thanks

Xamarin forms Open map location on external app

Helo,
I'm using xamarin forms and by

Device.OpenUri (new Uri ($ "geo: {Latitud}, {Longitude}"));

I'm opening and external gps navigation. It works for android 9. Application waze start navigate to this position, google mpas appears that position. But on lower android it only open a map application on my current position. (Samsung galaxy s7 android 8, huaway p8 android 6).
Can you help me how to solve this?

CSOM SharePoint

Hi
In VS2017, after adding CSOM SharePoint Online nuget package, my app stops

In output windows i can see : Could not load assembly 'Microsoft.SharePoint.Client.Publishing.Portable' during startup registration

Can you give me some help ?


Skipped XX frames! The application may be doing too much work on its main thread.

Hi,

when scrolling ListView (debug mode) on the Samsung device, the list sometimes skips to some elements (not always) then I get in VS output:

02-04 08:28:51.904 I/zygote64(30968): Explicit concurrent copying GC freed 4452(221KB) AllocSpace objects, 0(0B) LOS objects, 49% free, 6MB/12MB, paused 290us total 66.611ms
02-04 08:28:51.907 D/Mono    (30968): GC_NEW_BRIDGE num-objects 527 num_hash_entries 52442 sccs size 16277 init 0.00ms df1 318.51ms sort 20.11ms dfs2 23.75ms setup-cb 2.68ms free-data 91.18ms links 189251/189251/251888/16 dfs passes 326491/205528 ignored 73055
02-04 08:28:51.907 D/Mono    (30968): GC_BRIDGE: Complete, was running for 209.50ms
02-04 08:28:51.907 D/Mono    (30968): GC_MINOR: (Nursery full) time 334.37ms, stw 335.39ms promoted 543K major size: 19312K in use: 17510K los size: 4096K in use: 850K
02-04 08:28:51.917 I/Choreographer(30968): Skipped 34 frames!  The application may be doing too much work on its main thread.

data is not downloaded when scrolling the list because everything is in the Binding in the listView.

After adding CSOM SharePoint Online nuget package, my app stops

Hi
In VS2017, after adding CSOM SharePoint Online nuget package, my app stops

In output windows i can see : Could not load assembly 'Microsoft.SharePoint.Client.Publishing.Portable' during startup registration

Can you give me some help ?

Xamarin Websocket: Native vs Managed

We're planning on integrating websockets into our Xamarin (Xamarin.iOS and Xamarin.Android) application.

We're seeing two possible options for doing this:

  1. Go with the native approach by creating (using existing) bindings for popular iOS / Android websocket frameworks such as SocketRocket and nv-websocket-client or any other for that matter
  2. Go with the managed implementation - System.Net.WebSockets, which until recently had some issues supporting wss but those were fixed.

My main concerns are not related to code sharing but rather to standard conformance and security issues.

Any suggestions would be appreciated.

Thank you, Cosmin

VS for Mac - files visible in IDE not in .csproj file

I'm probably going mad/senile but I've got a problem with my .csproj file seemingly not being updated when files are added to the project.

Some background
The background to this is that in our Xamarin.Forms project, a colleague copied/pasted and then reused a XAML page and code-behind. If you don't do it right, you get the

ListButtonControl.xaml

and

ListButtonControl.xaml.cs

files appearing next to each other in the project, rather than the xaml.cs being nested under the xaml. This also causes pages using the control not to disply - so it's not just a cosmetic IDE thing. The solution is to remove them (but not delete them) and then add a file of the same name and take the prompt to add the existing file.

The Problem
So, having done this, I noticed that no changes were flagged in SourceTree (our Git client) for the .csproj file.

Looking inside the .csproj file, there is no mention of ListButtonControl or even the folder they're contained in.

The project is a .Net Standard 2.0 library holding the cross-platform elements for a Xamarin.Forms project.

The upshot is that fixing the files in the solution is not going to get pushed to Git, because the .csproj file hasn't changed.

Am I forgetting/missing something regarding where this project metadata is stored?

Version information:

=== Visual Studio Community 2017 for Mac ===

Version 7.7.3 (build 43)
Installation UUID: 650b4c91-c7f5-4ee5-ad70-6f178f314906
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 4.4.1.178 (master / eeaeb7e6)

Package version: 516000221

=== Mono Framework MDK ===

Runtime:
Mono 5.16.0.221 (2018-06/b63e5378e38) (64-bit)
Package version: 516000221

=== NuGet ===

Version: 4.8.0.5385

=== .NET Core ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
2.1.5
2.1.2
2.1.1
2.0.5
SDK: /usr/local/share/dotnet/sdk/2.1.403/Sdks
SDK Versions:
2.1.403
2.1.302
2.1.301
2.1.4
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.16.0/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

Version: 1.6.4
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Updater ===

Version: 11

=== Apple Developer Tools ===

Xcode 10.1 (14460.46)
Build 10B61

=== Xamarin.Mac ===

Version: 5.2.1.13 (Visual Studio Community)
Hash: a4332c90
Branch:
Build date: 2019-01-11 13:08:10-0500

=== Xamarin.iOS ===

Version: 12.2.1.13 (Visual Studio Community)
Hash: a4332c90
Branch: d15-9
Build date: 2019-01-11 13:08:09-0500

=== Xamarin.Android ===

Version: 9.1.5.1 (Visual Studio Community)
Android SDK: /Users/jameslavery/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
2.3 (API level 10)
4.0.3 (API level 15)
4.1 (API level 16)
4.3 (API level 18)
4.4 (API level 19)
5.0 (API level 21)
5.1 (API level 22)
6.0 (API level 23)
7.0 (API level 24)
7.1 (API level 25)
8.0 (API level 26)
8.1 (API level 27)

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 28.0.0
SDK Build Tools Version: 26.0.2

=== Microsoft Mobile OpenJDK ===

Java SDK: /Users/jameslavery/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_1.8.0.9
openjdk version "1.8.0-9"
OpenJDK Runtime Environment (build 1.8.0-9-microsoft-b00)
OpenJDK 64-Bit Server VM (build 25.71-b00, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Android Device Manager ===

Version: 7.7.1.0
Hash: 06ceaea1

=== Xamarin Inspector ===

Version: 1.4.3
Hash: db27525
Branch: 1.4-release
Build date: Mon, 09 Jul 2018 21:20:18 GMT
Client compatibility: 1

=== Build Information ===

Release ID: 707030043
Git revision: 5896ab2acba037c62271742e9e56b900c96c1d8f
Build date: 2019-01-15 21:18:33+00
Build branch: release-7.7
Xamarin extensions: e5b43ba963b7b407aa5b9f2c59018c32a709e6ab

=== Operating System ===

Mac OS X 10.13.6
Darwin 17.7.0 Darwin Kernel Version 17.7.0
Fri Nov 2 20:43:16 PDT 2018
root:xnu-4570.71.17~1/RELEASE_X86_64 x86_64

=== Enabled user installed extensions ===

LiveXAML 1.3.31
MFractor 3.7.5
MvvmCross Template pack 2.0.1
NuGet Package Management Extensions 0.14
Template Creator 0.4
Redth's Addins 1.0.9
Internet of Things (IoT) development (Preview) 7.5

Tabbed Bar Tricks for iOS

Hello,

I am using a Tabbed Page for my main page and added icons for each content page. On Android those icons looks very nice, but same Icons on iOS looks awful.

For those icons, I am using png files. What types of image / icon types are you using and which can you recommend?

What does mean iOS Icons look awful?

Here is it in android:
Image may be NSFW.
Clik here to view.

You can see, icons are white and even other colors are displayed.

How it looks on iOS:
Image may be NSFW.
Clik here to view.

I am using xaml xml to specify the source of those icons.

<ContentPage x:Name="contentPage_ABC" BackgroundColor="White" Icon="MyIcon.png">

Thanks for all tipps !

Viewing all 204402 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>