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

Get Phone Number (SIM GSM)

$
0
0

I have 1 Solution run cross platform with 3 project (android, IOS and cross platform)
1. I created 1 inteface on Cross Platform Project
public interface IDeviceInfo {
string GetMyPhoneNumber();
}
2. On Adnroid Project i create 1 class IDeviceInfo with function
public string GetMyPhoneNumber()
{

            TelephonyManager mTelephonyMgr;

            mTelephonyMgr = (TelephonyManager)Android.App.Application.Context.GetSystemService(Context.TelephonyService);

            string Number = mTelephonyMgr.Line1Number.ToString();
            TelephonyManager mgr = (TelephonyManager)Android.App.Application.Context.GetSystemService(Context.TelephonyService);
            //Android.Telephony.TelephonyManager tMgr = (Android.Telephony.TelephonyManager)Android.App.Application.Context.GetSystemService(Android.Content.Context.TelephonyService);
            return Number;

    }

3. On Cross Platform i add some code to get on file App.xaml.cs
public App()
{
InitializeComponent();
Context ct = Android.App.Application.Context;
string numbers;
var deviceInfo = Xamarin.Forms.DependencyService.Get<My_Name_Space.IDeviceInfo>();
var number = deviceInfo.GetMyPhoneNumber();
Toast.MakeText(ct, number, ToastLength.Long).Show();
MainPage = new Main_Page();
}
I config on cross platform and android project have permission (READ_PHONE_STATE, READ_PHONE_NUMBERS)
Build and deloy on Xiaomi Redmi 5A then run it can't get phone number.
Please guide e how to get it from android and IOS.


Check box tristate

$
0
0

Xamarin forms 4.1 introduce checkbox default control for xamarin forms .Can you please any suggest the sample for checkbox tristate using xamarin forms without using third party controls.

How to resolve errors in Resource.designer.cs when building for Android

$
0
0

My Android build has been reporting errors in Resource.designer.cs, an automatically generated file. The errors result from a full-stop (aka period) being in a couple of entries in the .cs file, as per the image below.

If I look in G:\tfs\myapp\myapp\AndroidForForms\AndroidForForms.Android\Resources\Resource.designer.cs
I see:

            // aapt resource value: 0x7f0b008c
            public const int bottomtab_navarea = 2131427468;

            // aapt resource value: 0x7f0b008d
            public const int bottomtab_tabbar = 2131427469;

But if I look in G:\tfs\myapp\myapp\AndroidForForms\AndroidForForms.Android\obj\Debug\81\designtime\Resource.designer.cs
I see the erroneous

            // aapt resource value: 0x7F030180
            public const int bottomtab.navarea = 2130903424;

            // aapt resource value: 0x7F030181
            public const int bottomtab.tabbar = 2130903425;

Any idea what might be causing this, and how I can fix it? (it was happening before I changed my PCLs to .Net Standard 2, and is still happening afterwards)

Implementing INotifyPropertyChanged for an OS-related value

$
0
0

I'm trying to implement INotifyPropChanged for a volume level property, which is required to be set and updated dynamically (i.e., the label should change as the user presses up and down volume keys). I can get the value, flawlessly, and I can get it to update too, but it seems to notify the change way too many times, even though I've tried using a backing store field too.

code sample below:
{
get
{
if (volumeLevel != null)
{
return volumeLevel;
}
var sound = DependencyService.Get();
OnPropertyChanged(nameof(VolumeLevel));
return sound.GetCurrentRingtoneLevel();

        }

what am I doing wrong? Many thanks in advance

Store a push notification

$
0
0

Hello Xamarin forums am working with xamarin forms for the past four months and now am working with push notification, is there any method that can i store the notifications that i received from GCM to store in local machine using sqlite for future use. Am looking for your suggestions.

Basic UI architecture: prompting for information

$
0
0

I'm trying to create a music player app with a playlist.

Part of this exercise is that I want to use commands for my interface. I've made a playlist page that shows a list of playlists (now empty) and a create playlist button with a command property of my viewmodel wired to it.

When the user clicks the Create button, I want to prompt him for the playlist name. To do this I've made a PlaylistPropertiesPage, but it seems I have to navigate to this page in the PlaylistsPage and not the Playlists viewmodel.

How would a Xamarin expert set this up? I don't like how the viewmodel needs to know about any pages.

PlaylistsPage.xaml:

<?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:d="http://xamarin.com/schemas/2014/forms/design"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:vm="clr-namespace:MusicPlayer.ViewModels"
             mc:Ignorable="d"
             x:Class="MusicPlayer.Views.PlaylistsPage"
             >
  <ContentPage.Content>

    <StackLayout Orientation="Vertical">
      <ListView x:Name="_playlistLv"
                Header="Playlists"
                ItemsSource="{Binding Playlists}"
                >
        <ListView.HeaderTemplate>
          <DataTemplate>
            <StackLayout Orientation="Horizontal">
              <Label Text="Playlists" />
              <Button Text="Create"
                      Command="{Binding CreatePlaylistCmd}"
                      CommandParameter="{Binding}"
                      />
            </StackLayout>
          </DataTemplate>
        </ListView.HeaderTemplate>
        <ListView.ItemTemplate>
          <DataTemplate>
            <StackLayout>
              <Label Text="{Binding Name}" />
            </StackLayout>
          </DataTemplate>
        </ListView.ItemTemplate>
      </ListView>
    </StackLayout>

  </ContentPage.Content>
</ContentPage>

PlaylistsPage.xaml.cs:

using Xamarin.Forms;
using Xamarin.Forms.Xaml;
using MusicPlayer.ViewModels;

namespace MusicPlayer.Views
{
    [XamlCompilation(XamlCompilationOptions.Compile)]
    public partial class PlaylistsPage : ContentPage
    {
        public PlaylistsPage()
        {
            InitializeComponent();
            BindingContext = new PlaylistsVm
            {
                PlaylistsPage = this
            };
        }

        public async void CreatePlaylist()
        {
            await Navigation.PushAsync(new PlaylistPropertiesPage
            {
            });
        }
    }
}

PlaylistsVm.cs:

using System.Collections.Generic;
using System.Windows.Input;
using Xamarin.Forms;
using MusicPlayer.Data;
using MusicPlayer.Models;
using MusicPlayer.Views;

namespace MusicPlayer.ViewModels
{
    internal class PlaylistsVm
    {
        public List<Playlist> Playlists { get; set; }
        public PlaylistsPage PlaylistsPage { get; set; }

        private PlaylistsTl _playlistsTl;

        public PlaylistsVm()
        {
            _playlistsTl = new PlaylistsTl();

            CreatePlaylistCmd = new Command(() => PlaylistsPage.CreatePlaylist());
        }

        public async void Fetch()
        {
            Playlists = await _playlistsTl.GetItemsAsync();
        }

        public ICommand CreatePlaylistCmd { get; private set; }
    }
}

How to call PCL service from background service?

$
0
0

Hello,

I have a Xamarin Forms android application.
With with background service that checks every 10 seconds current time and user configs to notify the user that he should drink the medicine.

When I tried to send a message from PeriaodicBackgroundService to PCL

MessagingCenter.Send<string, string>("APP", "PROCESS_TIMING", DateTime.Now.ToString());

it does not get it in PCL.
Is it possible to call the PCL method from the Background Service?

Here is the code of Background Service

 [Service(Name = "com.xamarin.TimestampService",
         Process = ":timestampservice_process",
         Exported = true)]
    class PeriodicBackgroundService : Service
    {
        private const string Tag = "[PeriodicBackgroundService]";

        private bool _isRunning;
        private Context _context;
        private Task _task;

        #region overrides

        public override IBinder OnBind(Intent intent)
        {
            return null;
        }

        public override void OnCreate()
        {
            _context = this;
            _isRunning = false;
            _task = new Task(DoWork);
        }

        public override void OnDestroy()
        {
            _isRunning = false;

            if (_task != null && _task.Status == TaskStatus.RanToCompletion)
            {
                _task.Dispose();
            }
        }

        public override StartCommandResult OnStartCommand(Intent intent, StartCommandFlags flags, int startId)
        {
            if (!_isRunning)
            {
                _isRunning = true;
                _task.Start();
            }
            return StartCommandResult.Sticky;
        }

        #endregion

        private void DoWork()
        {
            try
            {
                MessagingCenter.Send<string, string>("APP", "PROCESS_TIMING", DateTime.Now.ToString());
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
            finally
            {
                StopSelf();
            }
        }
    }

In MainActivity

 public static void SetAlarmForBackgroundServices(Context context)
        {
            var alarmIntent = new Intent(context.ApplicationContext, typeof(AlarmReceiver));
            var broadcast = PendingIntent.GetBroadcast(context.ApplicationContext, 0, alarmIntent, PendingIntentFlags.NoCreate);
            if (broadcast == null)
            {
                var pendingIntent = PendingIntent.GetBroadcast(context.ApplicationContext, 0, alarmIntent, 0);
                var alarmManager = (AlarmManager)context.GetSystemService(Context.AlarmService);
                alarmManager.SetRepeating(AlarmType.ElapsedRealtimeWakeup, SystemClock.ElapsedRealtime(), 10000, pendingIntent);
            }
        }

In App.cs (PCL)

protected override async void OnStart()
        {
       base.OnStart();

            ITranslationService translationService = ViewModelLocator.Resolve<ITranslationService>();
            translationService.LoadLocalizations();

            drugService = ViewModelLocator.Resolve<IDrugService>();
            dependencyService = ViewModelLocator.Resolve<IDependencyService>();

            MessagingCenter.Subscribe<string, string>("APP", "PROCESS_TIMING", async (sender, args) =>
            {
                DrugServiceResult processed = await this.drugService .ProceedTime();

                if (processed.NextDrunk >= DateTime.Now)
                {
                    this.notifiyed = false;
                }
            });

            await InitNavigation();

            base.OnResume();
        }

Using Grouping in listview, whose content is saved in an SQLite database

$
0
0

I want to group the data I have saved in an SQLite database by the content of one column from this database and load them in a listview. I have partly figured out how to load a column. I used this function but it only returned the 3 entries I have and not the right dates. It instead returned 01/01/01/0001 00:00:00.
public Task<List> GetCalendarEntriesStartDates()
{
return calendarentrydatabase.QueryAsync("SELECT DISTINCT [CalendarEntryStartDate],[CalendarEntryId] FROM [CalendarEntry] ORDER BY [CalendarEntryStartDate]");
}
I also find out how to create a class for the grouped content, but I don't know how to load the content in these groups.
public class CalendarGroup : IEnumerable
{
public DateTime CalendarEntryStartDate { get; set; }
public ObservableCollection CalendarEntries { get; set; }
IEnumerator IEnumerable.GetEnumerator()
{
return CalendarEntries.GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()
{
return CalendarEntries.GetEnumerator();
}
}
Can someone explain to me how to do this, by using SQLite-net-plc?


Strange warning when loading Xamarin.Forms project. How to get rid of it.

$
0
0

Hello,

When opening a project, these warnings are shown in the error list window in Visual Studio 2019:

El paquete "Plugin.MediaManager 0.4.5" se restauró con ".NETFramework,Version=v4.6.1" en lugar de la plataforma de destino del proyecto ".NETStandard,Version=v2.0". Puede que el paquete no sea totalmente compatible con el proyecto.

El paquete "Plugin.MediaManager.Forms 0.4.5" se restauró con ".NETFramework,Version=v4.6.1" en lugar de la plataforma de destino del proyecto ".NETStandard,Version=v2.0". Puede que el paquete no sea totalmente compatible con el proyecto.

Translation:

The "Plugin.MediaManager 0.4.5" package was restored with ".NETFramework, Version = v4.6.1" instead of the project target platform ".NETStandard, Version = v2.0". The package may not be fully compatible with the project.

The package "Plugin.MediaManager.Forms 0.4.5" was restored with ".NETFramework, Version = v4.6.1" instead of the target platform of the project ".NETStandard, Version = v2.0". The package may not be fully compatible with the project.

This is the csproj file:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
    <ProduceAssemblyReference>true</ProduceAssemblyReference>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
    <DebugType>pdbonly</DebugType>
    <DebugSymbols>true</DebugSymbols>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Plugin.MediaManager" Version="0.4.5" />
    <PackageReference Include="Plugin.MediaManager.Forms" Version="0.4.5" />
    <PackageReference Include="Xamarin.Forms" Version="4.1.0.555618" />  
    <PackageReference Include="Xamarin.Essentials" Version="1.1.0" />  
    <PackageReference Include="ZXing.Net.Mobile" Version="2.3.2" />  
    <PackageReference Include="ZXing.Net.Mobile.Forms" Version="2.3.2" />
  </ItemGroup>
</Project>

Xamarin projects allow only .NET version up to 2.0, so I have no idea why those warnings are shown.

Regards
Jaime

System.ObjectDisposedException Can't access disposed Xamarin.Forms.Platform.Android.ImageRenderer

$
0
0

Hi Xamarian,

Hope you all are doing good.

Please help me out . I'm facing one issue with grouped Listview . i.e.

System.ObjectDisposedException: Cannot access a disposed object. Object name: 'Xamarin.Forms.Platform.Android.ImageRenderer'.

Below is my UI code


<ListView.Behaviors>

                </b:EventToCommandBehavior>
            </ListView.Behaviors>
            <ListView.GroupHeaderTemplate>
                <DataTemplate>
                    <ViewCell >
                        <ViewCell.Height>
                            <OnPlatform x:TypeArguments="x:Double" iOS="60"/>
                        </ViewCell.Height>
                        <Frame  IsClippedToBounds="True"
                            HasShadow="True"
                            Margin="{OnPlatform Android='0,3',iOS='0,0,0,6'}"
                            Padding="0"
                            CornerRadius="3"
                            BackgroundColor="{StaticResource AppSubThemeColor}">
                            <Frame IsClippedToBounds="True"
                               HasShadow="True"
                               BorderColor="{Binding GroupSelectedColor}"
                               BackgroundColor="{Binding GroupSelectedColor}"
                               Padding="10"
                               CornerRadius="0"
                               Margin="0">
                                <StackLayout Spacing="0"
                                     Orientation="Horizontal">
                                    <!--<ff:CachedImage x:Name="ffStateIicon"
                                            HeightRequest="20"
                                            WidthRequest="20"
                                            Margin="5"
                                            VerticalOptions="CenterAndExpand"
                                            HorizontalOptions="Start"
                                            Source="{Binding StateIcon}"/>-->
                                    <Image x:Name="ffStateIicon"
                                            HeightRequest="20"
                                            WidthRequest="20"
                                            Margin="5"
                                            VerticalOptions="CenterAndExpand"
                                            HorizontalOptions="Start"
                                            Source="{Binding StateIcon}"/>
                                    <Label Text="{Binding TitleWithItemCount}" 
                                           HorizontalOptions="StartAndExpand"
                                           HorizontalTextAlignment="Start"
                                           VerticalOptions="Center"
                                           TextColor="Black"
                                           Style="{StaticResource Key=lblCardValue}"
                                          >
                                    </Label>
                                    <StackLayout.GestureRecognizers>
                                        <TapGestureRecognizer 
                                        Command="{Binding Source={x:Reference ProductFilterPage}, 
                                        Path=BindingContext.FacetSelectedCommand}" 
                                        NumberOfTapsRequired="1"
                                        CommandParameter="{Binding .}"/>
                                    </StackLayout.GestureRecognizers>
                                </StackLayout>
                                <!--,Converter={StaticResource NameConverter}-->
                            </Frame>
                        </Frame>
                    </ViewCell>
                </DataTemplate>
            </ListView.GroupHeaderTemplate>
            <ListView.ItemTemplate>
                <DataTemplate>
                    <ViewCell>
                        <Frame  IsClippedToBounds="True"
                            HasShadow="True"
                            Margin="0"
                            Padding="10"
                            CornerRadius="0"
                            BackgroundColor="#FFFFFF">
                            <StackLayout Spacing="0"
                                     Orientation="Horizontal">
                                <!--<ff:CachedImage x:Name="ffCheck"
                                            HeightRequest="30"
                                            WidthRequest="30"
                                            Margin="5"
                                            VerticalOptions="CenterAndExpand"
                                            HorizontalOptions="Start"
                                            Source="{Binding ImgSource}"/>-->
                                <Image x:Name="ffCheck"
                                            HeightRequest="30"
                                            WidthRequest="30"
                                            Margin="5"
                                            VerticalOptions="CenterAndExpand"
                                            HorizontalOptions="Start"
                                            Source="{Binding ImgSource}"/>
                                <Label Text="{Binding FacetValue}"
                                   HorizontalOptions="StartAndExpand"
                                   HorizontalTextAlignment="Start"
                                   VerticalOptions="Center"
                                   >
                                    <Label.FormattedText>
                                        <FormattedString>
                                            <Span Text="{Binding FacetValue}" Style="{StaticResource Key=spnNormal}"/>
                                            <Span Text="{Binding ValueCount}" Style="{StaticResource Key=spnNormal}"/>
                                        </FormattedString>
                                    </Label.FormattedText>
                                </Label>
                            </StackLayout>
                        </Frame>
                    </ViewCell>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>

On clicking item i'm changing image from checked to unchecked and vice versa. sometime i'm getting crash on scroll and sometime on item tapped.
Below is my stack traces

JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable self)
JniPeerMembers+JniInstanceMethods.InvokeNonvirtualObjectMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters)
View.get_Context ()
Platform.GetNativeSize (Xamarin.Forms.VisualElement view, System.Double widthConstraint, System.Double heightConstraint) D:\a\1\s\Xamarin.Forms.Platform.Android\Platform.cs:1307
Forms+AndroidPlatformServices.GetNativeSize (Xamarin.Forms.VisualElement view, System.Double widthConstraint, System.Double heightConstraint) D:\a\1\s\Xamarin.Forms.Platform.Android\Forms.cs:599
VisualElement.OnSizeRequest (System.Double widthConstraint, System.Double heightConstraint) D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:788
Image.OnSizeRequest (System.Double widthConstraint, System.Double heightConstraint) D:\a\1\s\Xamarin.Forms.Core\Image.cs:64
VisualElement.OnMeasure (System.Double widthConstraint, System.Double heightConstraint) D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:771
VisualElement.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:653
VisualElement.Measure (System.Double widthConstraint, System.Double heightConstraint, Xamarin.Forms.MeasureFlags flags) D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:711
StackLayout.CalculateNaiveLayout (Xamarin.Forms.StackLayout+LayoutInformation layout, Xamarin.Forms.StackOrientation orientation, System.Double x, System.Double y, System.Double widthConstraint, System.Double heightConstraint) D:\a\1\s\Xamarin.Forms.Core\StackLayout.cs:199
StackLayout.CalculateLayout (Xamarin.Forms.StackLayout+LayoutInformation layout, System.Double x, System.Double y, System.Double widthConstraint, System.Double heightConstraint, System.Boolean processExpanders) D:\a\1\s\Xamarin.Forms.Core\StackLayout.cs:124
StackLayout.LayoutChildren (System.Double x, System.Double y, System.Double width, System.Double height) D:\a\1\s\Xamarin.Forms.Core\StackLayout.cs:57
Layout.UpdateChildrenLayout () D:\a\1\s\Xamarin.Forms.Core\Layout.cs:264
Layout.OnSizeAllocated (System.Double width, System.Double height) D:\a\1\s\Xamarin.Forms.Core\Layout.cs:224
VisualElement.SizeAllocated (System.Double width, System.Double height) D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:793
Layout+<>c.b__45_0 () D:\a\1\s\Xamarin.Forms.Core\Layout.cs:381
Thread+RunnableImplementor.Run ()
IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this)
(wrapper dynamic-method) System.Object.44(intptr,intptr)

Alternative Float Button ISO and Android

$
0
0

Searching I could not find a floating button that works just like Ios and Android, all failed in something, so I decided to create one, and compare the code. Easy to use.

project XamarinFloatButton in github, user jarbol16

How to add accesibility for blind user

$
0
0

Please give me answer within one day

Disable listview animation on selected

$
0
0

How can I disable the animation of listviews/cellview when they are clicked on. The animation is fine on Android, but on iOS, when the listview item is selected, there is a grey background as well as lines that animate and don't look good at all. I have fixed the grey background by creating a custom renderer for iOS, but cannot figure out how to remove the animation of lines when an item is clicked.

Style OnPlatform and DynamicResource

$
0
0

I have defined a style , but I'd like to set the Android and iOS values to a DynamicResource - What's the syntax?

<Style
    TargetType="SearchBar"         ApplyToDerivedTypes="true">
    <Setter Property="BackgroundColor" Value="{OnPlatform Android='White', iOS='#4F8BBF'}"/>
</Style>

Play local file with MedaiManager

$
0
0

Hi, I'm trying to play a video stored locally using MedaiManager. Do I need to put it in the PCL project or in the iOS > Resources folder? And is this set to Content or Embedded in the properties of the file?

I took a look through the samples but couldn't see anything specific to playing a local video file:

https://forums.xamarin.com/discussion/94847/play-video-pcl-project

Any suggestions? TIA


Xamarin Forms how to add behaviors to custom control

$
0
0

I have created a custom control,which is a ContentView with a Label and an Entry

The xaml of the custom controls looks like this:

<Label Text="{Binding Source={x:Reference ValidationControl}, Path=Caption}"/>
<Entry Text="{Binding Source={x:Reference ValidationControl}, Path=Value, Mode=TwoWay}" />

The code behind of the custom control looks like this:

public static readonly BindableProperty CaptionProperty = BindableProperty.Create(
    nameof(Caption), typeof(string), typeof(ValidationEntry), default(string));

public string Caption
{
    get => (string)GetValue(CaptionProperty);
    set => SetValue(CaptionProperty, value);
}

public static readonly BindableProperty ValueProperty = BindableProperty.Create(
    nameof(Value), typeof(string), typeof(ValidationEntry), default(string));

public string Value
{
    get => (string)GetValue(ValueProperty);
    set => SetValue(ValueProperty, value);
}

I’m using the custom control in the following way

<controls:ValidationEntry Caption=”Name:” Value="{Binding FullName, Mode=TwoWay}" />

My question is how to add behaviors to the custom control?
I would like to add them in the place that I’m using the control. i.e.

<controls:ValidationEntry Caption="Name:"
                          Value="{Binding FullName, Mode=TwoWay}">
    <controls:ValidationEntry.EntryBehaviors>
        <behaviors:EntryLengthValidatorBehavior IgnoreSpaces="True"/>
    </controls:ValidationEntry.EntryBehaviors>
</controls:ValidationEntry>

Xamarin.iOS.dll not found on Mac or Azure DevOps

$
0
0

I currently have a Xamarin.Forms project that gets automatically built using Azure DevOps after each code commit. It usually had no problems building until recently, now the issue is that Xamarin.iOS.dll could not be found. This is the exact error I get in DevOps:

/Library/Frameworks/Mono.framework/Versions/5.18.1/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(2130,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Xamarin.iOS". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

I decided to try to build it on my work MacBook as well using Visual Studio 2019 for Mac. This one is also having trouble finding Xamarin.iOS.dll. It is searching for it at ~/Library/Frameworks/Xamarin.iOS.Frameworks/Versions/Current/mono/Xamarin.iOS/Xamarin.iOS.dll.

Building the iOS project with Visual Studio 2017 on Windows still works.

Everything was recently updated to the latest versions of Xamarin and Visual Studio. Was the Xamarin.iOS.dll for Mac moved on the latest update? How would I go about fixing this issue?

Finding the toolbar of a modal NavigationPage in Xamarin.forms >> Android

$
0
0

I've asked this a couple of weeks ago on stack overflow, but with no success, so I try here.

My intention is to get a handle to the toolbar in Android native (on a xamarin forms Project). This, in order to be able to do some custom painting (a badge) on an Icon.

So... I have an Android native method doing this
var toolbar = CrossCurrentActivity.Current.Activity.FindViewById(Resource.Id.toolbar) as Android.Support.V7.Widget.Toolbar;
It works fine, as long as it's the toolbar of my main page I'm after. It also works fine if I, from my main page do something like
Navigation.PushAsync(new MySecondPage());
Then it will find the correct toolbar for the second page.
My problem comes when I push a Modal page, with a toolbar, like this
Navigation.PushModalAsync(new NavigationPage(new MySecondPage()));
Now, if the native Android code is called, the toolbar returned is STILL the one from my main page. (Not the one currently showing on screen).
So, my question: Is there a way to find the toolbar of a modal pushed navigationpage?

App is not filling up screen in iOS

$
0
0

I have thick black bands above and below the app in iOS--the app is only partially filling the screen. It looks fine in Android, so I assume I am missing a iOS setting somewhere, but which one? I've been looking for hours.

Does anyone know complete Xamarin Forms and ASP.NET Core tutorials or courses for Web Development?

$
0
0

I am interested in learning Xamarin Forms and ASP.NET Core 2.2 ( I think that's the latest update of ASP.NET Core ) as well as how those two frameworks work together in full-stack Web Development. I've done some research and Google mentioned Blazor, Razor Pages, or bootstrap 4 for the ASP.NET Core front-end (client-side) and Ajax for ASP.NET Core back-end (server-side). Also are databases client-side or back-end or is it its own category? I don't want to learn azure at all I would prefer to experience the free approach of web development and just buy an affordable hosting web service to allow my website to be live on the internet. Thank you for your time. Cheers! =)

Viewing all 77050 articles
Browse latest View live