Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all 58056 articles
Browse latest View live

Brand New Xamarin Forms Project, Visual Studio Crashes if Android is Included

$
0
0

I have the latest VS 2017 (updated today). I tried a new Xamarin Forms project (Cross-Platform > Mobile App (Xamarin.Forms)) which I haven't tried out yet. Whenever I do this and Android is included the projects are created and show up in Solution Explorer but VS is unresponsive and exits after a few seconds. If I launch the newly created solution the same thing happens.

I've tried Shared Project and .NET Standard. Same results.


Using Jenkins on a Mac

$
0
0

I am trying to setup a CI server on a Mac using Jenkins. It will be eventually be building Xamarin solutions. Currently I have it checking code out from our svn server, doing a restore for the Nuget packages, and finally trying to build the projects.

I currently am testing this on a Xamarin .NET 2.0 standard library. The checkout and restore work but on the build step I get errors saying I am missing references to Mscorlib amongst other things. I can build the project in Visual Studio on Mac just fine. What am I doing wrong with the setup?

I have the Jenkins MSBuild plugin setup to run msbuild from /Library/Frameworks/Mono.framework/Commands/msbuild. Below is the console output from Jenkins:

Started by user admin
[EnvInject] - Loading node environment variables.
Building in workspace /Users/MyComp/.jenkins/workspace/MyProjMobile.Xamarin
Cleaning local Directory .
Checking out https://svn.MyComp.net/svn/MyProj/MyProjMobile/MyProjMobile/MyProjMobile at revision '2018-04-05T13:45:47.739 -0700' --quiet
Using sole credentials MyUsername/****** in realm ‘<https://svn.MyComp.net:443> VisualSVN Server’
At revision 62

No changes for https://svn.MyComp.net/svn/MyProj/MyProjMobile/MyProjMobile/MyProjMobile since the previous build
Path To MSBuild.exe: /Library/Frameworks/Mono.framework/Commands/msbuild
FATAL: Unable to use this plugin on this kind of operation system
Executing the command /Library/Frameworks/Mono.framework/Commands/msbuild /t:restore /t:build /p:Configuration=Release /p:RestoreSources=http://192.168.102.158/MyCompNuget/nuget%3Bhttps://api.nuget.org/v3/index.json /Users/MyComp/.jenkins/workspace/MyProjMobile.Xamarin/MyProjMobile.csproj from /Users/MyComp/.jenkins/workspace/MyProjMobile.Xamarin
[MyProjMobile.Xamarin] $ /Library/Frameworks/Mono.framework/Commands/msbuild /t:restore /t:build /p:Configuration=Release /p:RestoreSources=http://192.168.102.158/MyCompNuget/nuget%3Bhttps://api.nuget.org/v3/index.json /Users/MyComp/.jenkins/workspace/MyProjMobile.Xamarin/MyProjMobile.csproj
Microsoft (R) Build Engine version 15.4.0.0 (xplat-master/67e8006d Thu Mar  8 17:15:24 EST 2018) for Mono
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 4/5/2018 1:45:51 PM.
Project "/Users/MyComp/.jenkins/workspace/MyProjMobile.Xamarin/MyProjMobile.csproj" on node 1 (restore;build target(s)).
Restore:
  Restoring packages for /Users/MyComp/.jenkins/workspace/MyProjMobile.Xamarin/MyProjMobile.csproj...
  Committing restore...
  Generating MSBuild file /Users/MyComp/.jenkins/workspace/MyProjMobile.Xamarin/obj/MyProjMobile.csproj.nuget.g.props.
  Generating MSBuild file /Users/MyComp/.jenkins/workspace/MyProjMobile.Xamarin/obj/MyProjMobile.csproj.nuget.g.targets.
  Writing lock file to disk. Path: /Users/MyComp/.jenkins/workspace/MyProjMobile.Xamarin/obj/project.assets.json
  Restore completed in 855.8 ms for /Users/MyComp/.jenkins/workspace/MyProjMobile.Xamarin/MyProjMobile.csproj.

  NuGet Config files used:
      /Users/MyComp/.config/NuGet/NuGet.Config

  Feeds used:
      http://192.168.102.158/MyCompNuget/nuget
      https://api.nuget.org/v3/index.json
PrepareForBuild:
  Creating directory "bin/Release/netstandard2.0/".
  Creating directory "obj/Release/netstandard2.0/".
GenerateTargetFrameworkMonikerAttribute:
Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
CoreCompile:
  /Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/4.5/csc.exe /noconfig /unsafe- /checked- /nowarn:1701,1702,1705,1701,1702 /nostdlib+ /errorreport:prompt /warn:4 /define:TRACE;RELEASE;NETSTANDARD2_0 /reference:/Users/MyComp/.nuget/packages/bcrypt.net-next/2.1.3/lib/netstandard2.0/BCrypt.Net-Next.dll /reference:/Users/MyComp/.nuget/packages/MyComp.encryptionservice/1.0.1/lib/netstandard1.3/EncryptionService.dll /reference:/Users/MyComp/.nuget/packages/freshmvvm/2.2.4/lib/netstandard1.0/FreshIOC.dll /reference:/Users/MyComp/.nuget/packages/freshmvvm/2.2.4/lib/netstandard1.0/FreshMvvm.dll /reference:/Users/MyComp/.nuget/packages/microsoft.csharp/4.0.1/ref/netstandard1.0/Microsoft.CSharp.dll /reference:/Users/MyComp/.nuget/packages/microsoft.win32.primitives/4.3.0/ref/netstandard1.3/Microsoft.Win32.Primitives.dll /reference:/Users/MyComp/.nuget/packages/modernhttpclient-updated/2.6.1/lib/netstandard2.0/ModernHttpClient.dll /reference:/Users/MyComp/.nuget/packages/newtonsoft.json/9.0.1/lib/netstandard1.0/Newtonsoft.Json.dll /reference:/Users/MyComp/.nuget/packages/pclcrypto/2.1.17-alpha-g5b1e8dff8c/lib/netstandard1.0/pclcrypto.dll /reference:/Users/MyComp/.nuget/packages/pinvoke.kernel32/0.5.126/lib/netstandard1.1/PInvoke.Kernel32.dll /reference:/Users/MyComp/.nuget/packages/pinvoke.windows.core/0.5.126/lib/netstandard1.1/PInvoke.Windows.Core.dll /reference:/Users/MyComp/.nuget/packages/sqlite-net-pcl/1.4.118/lib/netstandard1.1/SQLite-net.dll /reference:/Users/MyComp/.nuget/packages/MyComp.sqlite.net.cipher.std/1.0.0/lib/netstandard1.3/SQLite.Net.Cipher.dll /reference:/Users/MyComp/.nuget/packages/MyComp.sqlitenetextensions.std/1.0.0/lib/netstandard1.3/SQLiteNetExtensions.dll /reference:/Users/MyComp/.nuget/packages/MyComp.sqlitenetextensionsasync.std/1.0.0/lib/netstandard1.3/SQLiteNetExtensionsAsync.dll /reference:/Users/MyComp/.nuget/packages/sqlitepclraw.bundle_green/1.1.9/lib/netstandard1.1/SQLitePCLRaw.batteries_green.dll /reference:/Users/MyComp/.nuget/packages/sqlitepclraw.bundle_green/1.1.9/lib/netstandard1.1/SQLitePCLRaw.batteries_v2.dll /reference:/Users/MyComp/.nuget/packages/sqlitepclraw.core/1.1.9/lib/netstandard1.1/SQLitePCLRaw.core.dll /reference:/Users/MyComp/.nuget/packages/system.appcontext/4.3.0/ref/netstandard1.6/System.AppContext.dll /reference:/Users/MyComp/.nuget/packages/system.collections.concurrent/4.3.0/ref/netstandard1.3/System.Collections.Concurrent.dll /reference:/Users/MyComp/.nuget/packages/system.collections/4.3.0/ref/netstandard1.3/System.Collections.dll /reference:/Users/MyComp/.nuget/packages/system.console/4.3.0/ref/netstandard1.3/System.Console.dll /reference:/Users/MyComp/.nuget/packages/system.diagnostics.debug/4.3.0/ref/netstandard1.3/System.Diagnostics.Debug.dll /reference:/Users/MyComp/.nuget/packages/system.diagnostics.tools/4.3.0/ref/netstandard1.0/System.Diagnostics.Tools.dll /reference:/Users/MyComp/.nuget/packages/system.diagnostics.tracing/4.3.0/ref/netstandard1.5/System.Diagnostics.Tracing.dll /reference:/Users/MyComp/.nuget/packages/system.dynamic.runtime/4.0.11/ref/netstandard1.3/System.Dynamic.Runtime.dll /reference:/Users/MyComp/.nuget/packages/system.globalization.calendars/4.3.0/ref/netstandard1.3/System.Globalization.Calendars.dll /reference:/Users/MyComp/.nuget/packages/system.globalization/4.3.0/ref/netstandard1.3/System.Globalization.dll /reference:/Users/MyComp/.nuget/packages/system.io.compression/4.3.0/ref/netstandard1.3/System.IO.Compression.dll /reference:/Users/MyComp/.nuget/packages/system.io.compression.zipfile/4.3.0/ref/netstandard1.3/System.IO.Compression.ZipFile.dll /reference:/Users/MyComp/.nuget/packages/system.io/4.3.0/ref/netstandard1.5/System.IO.dll /reference:/Users/MyComp/.nuget/packages/system.io.filesystem/4.3.0/ref/netstandard1.3/System.IO.FileSystem.dll /reference:/Users/MyComp/.nuget/packages/system.io.filesystem.primitives/4.3.0/ref/netstandard1.3/System.IO.FileSystem.Primitives.dll /reference:/Users/MyComp/.nuget/packages/system.linq/4.3.0/ref/netstandard1.6/System.Linq.dll /reference:/Users/MyComp/.nuget/packages/system.linq.expressions/4.3.0/ref/netstandard1.6/System.Linq.Expressions.dll /reference:/Users/MyComp/.nuget/packages/system.net.http/4.3.0/ref/netstandard1.3/System.Net.Http.dll /reference:/Users/MyComp/.nuget/packages/system.net.primitives/4.3.0/ref/netstandard1.3/System.Net.Primitives.dll /reference:/Users/MyComp/.nuget/packages/system.net.sockets/4.3.0/ref/netstandard1.3/System.Net.Sockets.dll /reference:/Users/MyComp/.nuget/packages/system.objectmodel/4.3.0/ref/netstandard1.3/System.ObjectModel.dll /reference:/Users/MyComp/.nuget/packages/system.reflection/4.3.0/ref/netstandard1.5/System.Reflection.dll /reference:/Users/MyComp/.nuget/packages/system.reflection.extensions/4.3.0/ref/netstandard1.0/System.Reflection.Extensions.dll /reference:/Users/MyComp/.nuget/packages/system.reflection.primitives/4.3.0/ref/netstandard1.0/System.Reflection.Primitives.dll /reference:/Users/MyComp/.nuget/packages/system.resources.resourcemanager/4.3.0/ref/netstandard1.0/System.Resources.ResourceManager.dll /reference:/Users/MyComp/.nuget/packages/system.runtime/4.3.0/ref/netstandard1.5/System.Runtime.dll /reference:/Users/MyComp/.nuget/packages/system.runtime.extensions/4.3.0/ref/netstandard1.5/System.Runtime.Extensions.dll /reference:/Users/MyComp/.nuget/packages/system.runtime.handles/4.3.0/ref/netstandard1.3/System.Runtime.Handles.dll /reference:/Users/MyComp/.nuget/packages/system.runtime.interopservices/4.3.0/ref/netstandard1.5/System.Runtime.InteropServices.dll /reference:/Users/MyComp/.nuget/packages/system.runtime.interopservices.runtimeinformation/4.3.0/ref/netstandard1.1/System.Runtime.InteropServices.RuntimeInformation.dll /reference:/Users/MyComp/.nuget/packages/system.runtime.numerics/4.3.0/ref/netstandard1.1/System.Runtime.Numerics.dll /reference:/Users/MyComp/.nuget/packages/system.runtime.serialization.primitives/4.1.1/ref/netstandard1.3/System.Runtime.Serialization.Primitives.dll /reference:/Users/MyComp/.nuget/packages/system.security.cryptography.algorithms/4.3.0/ref/netstandard1.6/System.Security.Cryptography.Algorithms.dll /reference:/Users/MyComp/.nuget/packages/system.security.cryptography.encoding/4.3.0/ref/netstandard1.3/System.Security.Cryptography.Encoding.dll /reference:/Users/MyComp/.nuget/packages/system.security.cryptography.primitives/4.3.0/ref/netstandard1.3/System.Security.Cryptography.Primitives.dll /reference:/Users/MyComp/.nuget/packages/system.security.cryptography.x509certificates/4.3.0/ref/netstandard1.4/System.Security.Cryptography.X509Certificates.dll /reference:/Users/MyComp/.nuget/packages/system.text.encoding/4.3.0/ref/netstandard1.3/System.Text.Encoding.dll /reference:/Users/MyComp/.nuget/packages/system.text.encoding.extensions/4.3.0/ref/netstandard1.3/System.Text.Encoding.Extensions.dll /reference:/Users/MyComp/.nuget/packages/system.text.regularexpressions/4.3.0/ref/netstandard1.6/System.Text.RegularExpressions.dll /reference:/Users/MyComp/.nuget/packages/system.threading/4.3.0/ref/netstandard1.3/System.Threading.dll /reference:/Users/MyComp/.nuget/packages/system.threading.tasks/4.3.0/ref/netstandard1.3/System.Threading.Tasks.dll /reference:/Users/MyComp/.nuget/packages/system.threading.timer/4.3.0/ref/netstandard1.2/System.Threading.Timer.dll /reference:/Users/MyComp/.nuget/packages/system.xml.readerwriter/4.3.0/ref/netstandard1.3/System.Xml.ReaderWriter.dll /reference:/Users/MyComp/.nuget/packages/system.xml.xdocument/4.3.0/ref/netstandard1.3/System.Xml.XDocument.dll /reference:/Users/MyComp/.nuget/packages/validation/2.4.18/lib/netstandard1.3/Validation.dll /reference:/Users/MyComp/.nuget/packages/xamarin.auth/1.6.0.1/lib/netstandard1.6/Xamarin.Auth.dll /reference:/Users/MyComp/.nuget/packages/xamarin.forms/2.5.0.280555/lib/netstandard1.0/Xamarin.Forms.Core.dll /reference:/Users/MyComp/.nuget/packages/xamarin.forms/2.5.0.280555/lib/netstandard1.0/Xamarin.Forms.Platform.dll /reference:/Users/MyComp/.nuget/packages/xamarin.forms/2.5.0.280555/lib/netstandard1.0/Xamarin.Forms.Xaml.dll /debug- /debug:portable /filealign:512 /nologo /optimize+ /out:obj/Release/netstandard2.0/MyProjMobile.dll /target:library /warnaserror- /utf8output /deterministic+ App.xaml.cs Auth/AuthCompletedEvent.cs Auth/AuthenticationState.cs Auth/AuthErrorEvent.cs Auth/AuthExtensions.cs Auth/Constants.cs Auth/MyCompOAuth2Authenticator.cs Data/MyProjUser.cs Data/GoogleUser.cs Data/Grade.cs Data/Role.cs Data/SampleUser.cs Database/AsyncDatabase.cs Database/Database.cs Database/DependencyServiceWrapper.cs Database/IDependencyService.cs Database/ISqLite.cs Model/BaseModel.cs Page/LoginPage.xaml.cs ServicePointConfiguration.cs SSLHttpClient.cs ViewModel/Page/LoginPageViewModel.cs ViewModel/PageModelMapper.cs "/var/folders/dj/zhmtcqbn60xccl1b1lghkdcr0000gn/T/.NETStandard,Version=v2.0.AssemblyAttributes.cs" obj/Release/netstandard2.0/MyProjMobile.AssemblyInfo.cs /warnaserror+:NU1605
App.xaml.cs(35,13): error CS0103: The name 'InitializeComponent' does not exist in the current context [/Users/MyComp/.jenkins/workspace/MyProjMobile.Xamarin/MyProjMobile.csproj]
Page/LoginPage.xaml.cs(17,4): error CS0103: The name 'InitializeComponent' does not exist in the current context [/Users/MyComp/.jenkins/workspace/MyProjMobile.Xamarin/MyProjMobile.csproj]
ServicePointConfiguration.cs(17,13): error CS0103: The name 'ServicePointManager' does not exist in the current context [/Users/MyComp/.jenkins/workspace/MyProjMobile.Xamarin/MyProjMobile.csproj]
ServicePointConfiguration.cs(17,52): error CS0103: The name 'SecurityProtocolType' does not exist in the current context [/Users/MyComp/.jenkins/workspace/MyProjMobile.Xamarin/MyProjMobile.csproj]
ServicePointConfiguration.cs(18,13): error CS0103: The name 'ServicePointManager' does not exist in the current context [/Users/MyComp/.jenkins/workspace/MyProjMobile.Xamarin/MyProjMobile.csproj]
SSLHttpClient.cs(9,68): error CS0012: The type 'HttpClientHandler' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. [/Users/MyComp/.jenkins/workspace/MyProjMobile.Xamarin/MyProjMobile.csproj]
SSLHttpClient.cs(9,73): error CS1503: Argument 1: cannot convert from 'ModernHttpClient.NativeMessageHandler' to 'System.Net.Http.HttpMessageHandler' [/Users/MyComp/.jenkins/workspace/MyProjMobile.Xamarin/MyProjMobile.csproj]
ServicePointConfiguration.cs(37,61): error CS1061: 'X509Certificate' does not contain a definition for 'GetPublicKeyString' and no extension method 'GetPublicKeyString' accepting a first argument of type 'X509Certificate' could be found (are you missing a using directive or an assembly reference?) [/Users/MyComp/.jenkins/workspace/MyProjMobile.Xamarin/MyProjMobile.csproj]
SSLHttpClient.cs(15,74): error CS0012: The type 'HttpClientHandler' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. [/Users/MyComp/.jenkins/workspace/MyProjMobile.Xamarin/MyProjMobile.csproj]
SSLHttpClient.cs(15,74): error CS0117: 'NativeMessageHandler' does not contain a definition for 'Credentials' [/Users/MyComp/.jenkins/workspace/MyProjMobile.Xamarin/MyProjMobile.csproj]
SSLHttpClient.cs(15,13): error CS0012: The type 'HttpClientHandler' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. [/Users/MyComp/.jenkins/workspace/MyProjMobile.Xamarin/MyProjMobile.csproj]
Done Building Project "/Users/MyComp/.jenkins/workspace/MyProjMobile.Xamarin/MyProjMobile.csproj" (restore;build target(s)) -- FAILED.

Build FAILED.

Change colour of Hamburger Icon for Android

$
0
0

I have a MasterDetail page that that has a dark background for the Bar Background. I want the Hamburger icon to be white but I cant find the setting to change the colour. iOS seems to do it automatically but not Android.

I have tried

this.BarTextColor = Color.White; this.BarBackgroundColor = Color.FromHex ("00385E"); this.BackgroundColor = Color.White;

But nothing is working. Where am I going wrong?

Master Detail Page change menu button color

$
0
0

Hi, I'm trying to change the color of the button that open the menu in a MasterDetailPage when I receive a message from MessagingCenter...
Right now for iOS with the code that I'm using the icon is changed but the color is blue, but I'd like to use the original color of the image, meanwhile on Android nothing happens.

public class MenuView : ContentPage
    {
        public Action<MenuItem> MenuItemSelected;

        public MenuView()
        {
            Title = "Maester!!";
            Icon = "slideout.png";

            var header = SetupHeader();
            var menuItems = SetupMenuItems();
            var listView = SetupMenuList(menuItems);

            Content = new StackLayout {
                Spacing = 1,
                Children = {
                    header,
                    listView
                }
            };

            MessagingCenter.Subscribe<CommunicationHelper> (this, Messages.NotificationNumber, (sender) => {
                Icon = "NotificationBadge.png";
            });
        }

Someone can give me a hand on how to solve this problems?

help with the use of the vize.ai and nanonets.com APIs

$
0
0

greetings friends, I'm starting to use services for my app and I have the task of creating an app that uses the API of vizen.ai and nanonets.com someone will have some examples of app that use these services that can facilitate or know of some Where I can find them, I thank them

How can I get data from rss feed for my app?

Adding PanGestureRecognizer in ListView Item

$
0
0

In Xamarin.Forms I have a ListView which I could remove the items by swiping left or right. Adding a PanGestureRecognizer works, I can swipe the items left or right but the problem is when I deploy it to iOS, I cannot scroll vertically anymore but in Android, it was working.

I am using Xamarin.Forms pre5

Below is my actual implementation of the ListView and the PanGestureRecognizer

How can I implement localization in Xamarin.Forms Shared project in VS2017

$
0
0

I downloaded the samples provided by Xamarin docs and followed the tutorial but couldn't apply it to my VS17 shared project.
I can only add .resw resource files from VS17 to my Shared Project. I Also tried adding existing .resx files. Both formats are not recognized in my Shared Project where I need to set the culture and use them in my .xaml files.
Any idea on how to get localization working? Please share some code or sample in VS17 Xamarin.Forms Shared project.


PopUp a Modalpage over a tabbed page with Prism

$
0
0

Hi,
I have a MasterDetailPage like this

<?xml version="1.0" encoding="utf-8" ?>
    <MasterDetailPage xmlns="http://xamarin.com/schemas/2014/forms"
                                    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                                    xmlns:views="clr-namespace:Fake.Views"
                                    xmlns:prism="clr-namespace:Prism.Mvvm;assembly=Prism.Forms"
                                    prism:ViewModelLocator.AutowireViewModel="True" 
                                    MasterBehavior="Popover"
                                    Icon="hamburger"        x:Class="Fake.Views.MainView">

    <MasterDetailPage.Master>

                <views:MenuView BindingContext="{Binding MenuViewModel}" />

    </MasterDetailPage.Master>
    <MasterDetailPage.Detail>


        <views:NavigationPage >
            <x:Arguments>
                <views:ContentTabbedPageView  BindingContext="{Binding ContentTabbedPageViewModel}" />
            </x:Arguments>
        </views:NavigationPage>

    </MasterDetailPage.Detail>

</MasterDetailPage>

And the ContentTabbedPageView is:

<?xml version="1.0" encoding="utf-8" ?>
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
            xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
            xmlns:prism="clr-namespace:Prism.Mvvm;assembly=Prism.Forms"
            xmlns:views="clr-namespace:Fake.Views"
            xmlns:extensions="clr-namespace:Fake.Core.MarkupExtensions;assembly=Fake"
            prism:ViewModelLocator.AutowireViewModel="True"
            x:Class="Fake.Views.ContentTabbedPageView" 
            BarBackgroundColor="{StaticResource BackgroundColor}" 
            BarTextColor="{StaticResource BlackColor}" 
            BackgroundColor="{StaticResource BackgroundColor}" >

    <TabbedPage.ToolbarItems>
        <ToolbarItem 
            Command="{Binding OpenDoorCommand}">
            <ToolbarItem.Icon>
                <OnPlatform x:TypeArguments="FileImageSource">
                    <On Platform="Android, iOS" Value="search" />
                </OnPlatform>
            </ToolbarItem.Icon>
        </ToolbarItem>
    </TabbedPage.ToolbarItems>
    <TabbedPage.Children>
        <NavigationPage Title="{extensions:Translate Chat, IsUpper=True}" >
            <x:Arguments>
                <views:ChatView />
            </x:Arguments>
        </NavigationPage>
        <NavigationPage Title="{extensions:Translate Social, IsUpper=True}" >
            <x:Arguments>
                <views:SocialView  />
            </x:Arguments>
        </NavigationPage>
        <NavigationPage Title="{extensions:Translate Cash, IsUpper=True}" >
            <x:Arguments>
                <views:CashView  />
            </x:Arguments>
        </NavigationPage>

    </TabbedPage.Children>
</TabbedPage>

Now I'd like from the SocialView to open a modal page with a navigation bar. The SocialView is:

    <?xml version="1.0" encoding="utf-8" ?>
    <ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                 xmlns:prism="clr-namespace:Prism.Mvvm;assembly=Prism.Forms"
                 xmlns:controls="clr-namespace:ImageCircle.Forms.Plugin.Abstractions;assembly=ImageCircle.Forms.Plugin.Abstractions"
                 xmlns:ctrls="clr-namespace:Fake.Core.Controls;assembly=Fake"
                 xmlns:markupExtensions="clr-namespace:Fake.Core.MarkupExtensions;assembly=Fake"
                 prism:ViewModelLocator.AutowireViewModel="True"
                 x:Class="Genuiny.Views.SocialView" Title="Social">
        <ContentPage.Resources>
            <ResourceDictionary>
                <Style x:Key="TooltipTextStyle" 
                       TargetType="Label"
                       BasedOn="{StaticResource TooltipLabelStyle}">
                    <Setter Property="TextColor" 
                            Value="{StaticResource BlackColor}" />
                    <Setter Property="HorizontalOptions" 
                            Value="FillAndExpand" />
                    <Setter Property="FontSize" 
                            Value="{StaticResource LittleSize}" />
                </Style>   
            </ResourceDictionary>
        </ContentPage.Resources>
        <Grid BackgroundColor="{StaticResource BackgroundColor}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition  Width="20"/> 
                    <ColumnDefinition  Width="*"/>
                    <ColumnDefinition Width="20"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="50" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>

                <Grid Grid.Column="1" Margin="0,20,0,10">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="42" />
                    </Grid.RowDefinitions>
                    <Image Source="add.png" WidthRequest="32" Margin="10,0,0,0" x:Name="addPostButton">
                        <Image.GestureRecognizers>
                            <TapGestureRecognizer Command="{Binding BindingContext.AddPostCommand, Source={x:Reference addPostButton}}"  />
                        </Image.GestureRecognizers>
                    </Image>
                    <ctrls:RoundedEntry Margin="0,0,0,0" Grid.Column="1" BorderColor="{StaticResource GrayColor}" BorderWidth="0.5" BorderRadius="20"
                                         Style="{StaticResource TooltipLabelEntryStyle}"
                                         Placeholder="{markupExtensions:Translate Share, IsUpper=True}" HorizontalOptions="FillAndExpand">

                    </ctrls:RoundedEntry>
                </Grid>
        </Grid>
    </ContentPage>

On the ViewModel, in the AddPostCommand I do this:

await _navigationService.NavigateAsync("AddPostView", useModalNavigation:true);

The expected behaviours is to view the new page with a navigation bar, but the new page appears without a navigation bar and if i don't use modalnavigation the page appears inside the current tab.
What am i wrong? Thanks for any kind of help.

I'm using:
Prism 7.1.0.123 pre
Xamarin.Forms 3.0 pre2

Francesco

NavigationPage title text centered?

$
0
0

NavigationPage title text centered?

How to disable double tap on a button into android

$
0
0

Hello all,

i develop an cross mobile application and i have a problem, when a user tap twice on a button which launch a contentPage to scanner a QRCode my application crash. I understrand why, but how can i disable a double tap on this button ? I've try to disable this button, to remove delegate but it's always the same problem and i don't found any solution at my issue....so, if you've some idea to solve my problem... Thanks :)

How to Change layout Xaml to Axml?

$
0
0

I want make page that using Pinch Zoom and Pan Gestures.

so i have to change layout from xaml to axml.

I want change layout xamarin.Android cs, there is class recived Activity inheritance and in oncreate override, SetContentView(axml Layout).

How can i change layout??

Application in release mode is missing localization languages.

$
0
0

I have an issue with localization. Application I'm currently developing supports six different languages (with en-US being fallback and default language):

  • en-US
  • pl-PL
  • it-IT
  • nl-NL
  • de-DE
  • fr-FR

I'm using this platform specific method (android one in this case) to get list of all specific culture infos supported by the application:

  List<CultureInfo> supportedCultures = new List<CultureInfo>();
  ResourceManager resourceManager = new ResourceManager(typeof(AppSpedResources));
  CultureInfo[] cultureInfos = CultureInfo.GetCultures(CultureTypes.SpecificCultures);
  ResourceSet cultureSet = null;
  CultureInfo currentCulture = null;

  for (int i = 0; i < cultureInfos.Count(); i++)
  {
    currentCulture = cultureInfos[i];
    cultureSet = resourceManager.GetResourceSet(currentCulture, true, false);
    if (cultureSet != null && !currentCulture.Name.Equals(string.Empty))
      supportedCultures.Add(currentCulture);
  }

  return supportedCultures;

After that I'm displaying list of all languages in the picker and let user change them at the runtime. The problem is that this solution works correctly only in the debug mode. I'm getting list of all culture info objects that application has support for in RESX files. In release mode I'm only getting two languages (de-DE and en-US). Setting language explicitly to (it-IT for example) will result in default fallback language which is en-US. It looks like release apk doesn't have correct RESX files. Anyone has idea what could cause this?

How To covered space of hide control in cardview layout?

$
0
0

hi!!! All

I am working on card view in which I fetch data from SQLite.
on card view there is some controls are hide and some are show according to condition.

I need help how to covered hide space on screen after deployed.

Along with card view I have use Relative layout for set control as per design.

and Still I'm not using any code or condition for this, Any body have any idea or any suggestion for this?

Changing MasterDetail Height With A Custom Renderer

$
0
0

Hello,

I am currently trying to change the height of the default MasterDetailPage using the material design with FormsAppCompatActivity.
So basically I got the custom renderer to work, however I am trying to resize it dynamically based on toolbar size. The reason being is that different devices have different sized toolbars, furthermore I got the resizing to work however the black shadow that comes with the MasterDetailPage stays in place and does not seem to pass through the AddView function.

bool firstDone;
        public override void AddView(Android.Views.View child)//Android.Views.View
        {
            var padding = child.GetType().GetRuntimeProperty("TopPadding").GetValue(child);//tried padding but did not work
            if (firstDone)
            {
                LayoutParams p = (LayoutParams)child.LayoutParameters;
                //p.TopMargin = padding;
                p.TopMargin = 200;// Need this to be dynamic for different devices
                base.AddView(child, p);
            }
            else
            {
                firstDone = true;
                base.AddView(child);
            }
        }

Any help, or advice is welcomed!

htt ps://us.v-cdn.net/5019960/uploads/editor/9c/lxbjyiiwmi0t.png


Best practices when Xamarin.Forms UWP application has to run also on HoloLens ?

$
0
0

Besides structuring the Xamarin.Forms applications to target Android, iOS and UWP, sometims there is also the requirement that the UWP application should run not only on a Windows 10 tablet, but also on HoloLens, Are there any issues that have to be taken care of for this purpose, about the structure of the UWP code of the Xamarin.Forms projects ? (for instance the UrhoSharp samples have separate handling when meant to run on HoloLens)
Are there any Xamarin.Forms samples available for such scenarios, showing the best practices about how to organize the code ?

Expandable View (Autocomplete style)

$
0
0

I want to have an Editor, that displas a Layout with Buttons below itself, while being focused.
Clicking one of the buttons, is supposed to add the buttons text to the editor text.
Clicking one of the buttons should NOT unfocus the editor, the layout with buttons should remain visible after clicking a button.

Do you have any basic approach in mind? How would I achieve this?

Consume Web API XML instead of JSON

$
0
0

Web API returns result in XML format. I want to consume that web api and store the result in Picker. Here is the code:

XAML.cs

           Uri geturi = new Uri(URL);   
                HttpClient client = new HttpClient();
                HttpResponseMessage responseGet = await client.GetAsync(geturi);
            //    string response = await responseGet.Content.ReadAsStringAsync();

                //Xml Parsing  
                List<AClass> obj = new List<AClass>(); 
                XDocument doc = XDocument.Parse(responseGet.Content.ReadAsStringAsync().Result);
                foreach (var item in doc.Descendants("row")) //see XML
                {
                    AClass dis = new AClass();
                    dis.name = item.Element("name").Value.ToString(); //see XML
                    obj.Add(dis);
                }
                //Binding listview with server response  
                picker.ItemsSource = obj;

XML

<row>
    <id>1</id>
    <name>A</name>
</row>
<row>
    <id>2</id>
    <name>B</name>
</row>

Error:
Data at the root level is invalid. Line 1, position 1.

Logging with Xamarin PCL

$
0
0

I'd like to incorporate some logging into my Xamarin app, and I'm having trouble understanding the options available and how best to leverage them. I've seen examples that use System.Console and System.Diagnostics to write log messages that appear in the Application Output window in Xamarin Studio when debugging. However those classes don't appear to be available from within a PCL project. Am I missing something or do I have to roll my own cross-platform Console abstraction?

It's also not clear to me what relationship, if any, Console logging has with the native logging implementations. On iOS NSLog and asl_log are available to write to the system log. On android there is android.util.Log. Is there a cross platform logging framework available that can write to the appropriate platform-specific API?

Replace reference to a class by a string value

$
0
0

Hi everybody,

I have a class:
public ErrorCodeOverview(ErrorCode errorCode = null, Symptom symptom = null) {...

What I want is if errorCode != null that all the reference in my code e.g. this.ErrorCode.Name remains this.ErrorCode.Name.
But if errorCode == null and symptom != null then all the this.ErrorCode.Name should become this.Symptom.Name.

Is there a way to replace the this.ErrorCode with a global variable or a string? Something like {Reference to variable}.Name.

Viewing all 58056 articles
Browse latest View live


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