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

Error: Device could not find component named

$
0
0

I cannot install the application on device no longer.

I have tried:

  • change the package name, application name & version number.
  • adb uninstall com.myapp.name.
  • reboot my physical device
  • try to delete manually in Android application manager
  • I've tried to search the device files but couldn't find any related information - i have looked for "ExternalStorageDirectory", "com.myapp.namexxx", "com.myapp.name"

this is the Error:
Error: Device could not find component named: com.myapp.name/md5aa90eac5c6d14c19e9c8e7ab0853061c.SplashActivity
The application could not be started. Ensure that the application has been installed to the target device and has a launchable activity (MainLauncher = true).
Additionally, check Build->Configuration Manager to ensure this project is set to Deploy for this configuration.
Couldn't connect debugger. You can see more details in Xamarin Diagnostic output and the full exception on logs.

this is the Diagnostic output end (too long for the post):

D:RunShellCommand: 87899689 am broadcast -a "mono.android.intent.action.PACKAGE_VERSIONS" -e "packages" "Mono.Android.DebugRuntime,Mono.Android.Platform.ApiLevel_28,com.myapp.name" -n "Mono.Android.DebugRuntime/com.xamarin.mono.android.PackageVersions"
D:RunShellCommand: 87899689 setprop "debug.mono.extra" ""
D:RunShellCommand: 87899689 getprop
D:RunShellCommand: 87899689 am start -a "android.intent.action.MAIN" -c "android.intent.category.LAUNCHER" -n "com.myapp.name/md5aa90eac5c6d14c19e9c8e7ab0853061c.SplashActivity"
D:RunShellCommand: 87899689 am broadcast -a "mono.android.intent.action.EXTERNAL_STORAGE_DIRECTORY" -n "Mono.Android.DebugRuntime/com.xamarin.mono.android.ExternalStorageDirectory"
D:RunShellCommand: 87899689 rm -f "/storage/emulated/0/Android/data/com.myapp.name/files/.override/debug.mono.extra"
D:RunShellCommand: 87899689 am broadcast -a "mono.android.intent.action.PACKAGE_VERSIONS" -e "packages" "Mono.Android.DebugRuntime,Mono.Android.Platform.ApiLevel_28,com.myapp.name888" -n "Mono.Android.DebugRuntime/com.xamarin.mono.android.PackageVersions"
D:RunShellCommand: 87899689 date +%s
D:RunShellCommand: 87899689 setprop "debug.mono.extra" "debug=127.0.0.1:29312:29313,timeout=1571762599,loglevel=0,server=y"
D:RunShellCommand: 87899689 getprop
D:RunShellCommand: 87899689 am broadcast -a "mono.android.intent.action.EXTERNAL_STORAGE_DIRECTORY" -n "Mono.Android.DebugRuntime/com.xamarin.mono.android.ExternalStorageDirectory"
D:RunShellCommand: 87899689 am start -a "android.intent.action.MAIN" -c "android.intent.category.LAUNCHER" -n "com.myapp.name888/md5aa90eac5c6d14c19e9c8e7ab0853061c.SplashActivity"
D:RunShellCommand: 87899689 am force-stop com.myapp.name888
D:RunShellCommand: 87899689 setprop "debug.mono.connect" ""
[D:]: TrackDeviceTask got:
[I:]: Got new device list from adb with 0 devices
[D:]: TrackDeviceTask got: 87899689 offline
[I:]: Got new device list from adb with 1 devices
[D:]: TrackDeviceTask got: 87899689 device
[I:]: Got new device list from adb with 1 devices
D:RunShellCommand: 87899689 getprop
D:RunShellCommand: 87899689 am broadcast -a "mono.android.intent.action.PACKAGE_VERSIONS" -e "packages" "Mono.Android.DebugRuntime,Mono.Android.Platform.ApiLevel_28,com.myapp.name" -n "Mono.Android.DebugRuntime/com.xamarin.mono.android.PackageVersions"
D:RunShellCommand: 87899689 date +%s
D:RunShellCommand: 87899689 setprop "debug.mono.extra" "debug=127.0.0.1:29314:29315,timeout=1571762881,loglevel=0,server=y"
D:RunShellCommand: 87899689 getprop
D:RunShellCommand: 87899689 am broadcast -a "mono.android.intent.action.EXTERNAL_STORAGE_DIRECTORY" -n "Mono.Android.DebugRuntime/com.xamarin.mono.android.ExternalStorageDirectory"
D:RunShellCommand: 87899689 am start -a "android.intent.action.MAIN" -c "android.intent.category.LAUNCHER" -n "com.myapp.name/md5aa90eac5c6d14c19e9c8e7ab0853061c.SplashActivity"
D:RunShellCommand: 87899689 am force-stop com.myapp.name
D:RunShellCommand: 87899689 setprop "debug.mono.connect" ""
[D:]: TrackDeviceTask got:
[I:]: Got new device list from adb with 0 devices
[D:]: TrackDeviceTask got: 87899689 offline
[I:]: Got new device list from adb with 1 devices
[D:]: TrackDeviceTask got: 87899689 device
[I:]: Got new device list from adb with 1 devices
D:RunShellCommand: 87899689 getprop
D:RunShellCommand: 87899689 date +%s
D:RunShellCommand: 87899689 setprop "debug.mono.extra" "debug=127.0.0.1:29316:29317,timeout=1571763626,loglevel=0,server=y"
D:RunShellCommand: 87899689 getprop
D:RunShellCommand: 87899689 am broadcast -a "mono.android.intent.action.EXTERNAL_STORAGE_DIRECTORY" -n "Mono.Android.DebugRuntime/com.xamarin.mono.android.ExternalStorageDirectory"
D:RunShellCommand: 87899689 am start -a "android.intent.action.MAIN" -c "android.intent.category.LAUNCHER" -n "com.myapp.name/md5aa90eac5c6d14c19e9c8e7ab0853061c.SplashActivity"
D:RunShellCommand: 87899689 am force-stop com.myapp.name
D:RunShellCommand: 87899689 setprop "debug.mono.connect" ""
D:RunShellCommand: 87899689 setprop "debug.mono.extra" ""
D:RunShellCommand: 87899689 getprop
D:RunShellCommand: 87899689 am start -a "android.intent.action.MAIN" -c "android.intent.category.LAUNCHER" -n "com.myapp.name/md5aa90eac5c6d14c19e9c8e7ab0853061c.SplashActivity"
D:RunShellCommand: 87899689 am broadcast -a "mono.android.intent.action.EXTERNAL_STORAGE_DIRECTORY" -n "Mono.Android.DebugRuntime/com.xamarin.mono.android.ExternalStorageDirectory"
D:RunShellCommand: 87899689 rm -f "/storage/emulated/0/Android/data/com.myapp.name/files/.override/debug.mono.extra"
[D:]: TrackDeviceTask got:
[I:]: Got new device list from adb with 0 devices
[D:]: TrackDeviceTask got: 87899689 offline
[I:]: Got new device list from adb with 1 devices
[D:]: TrackDeviceTask got: 87899689 device
[I:]: Got new device list from adb with 1 devices
D:RunShellCommand: 87899689 getprop
D:RunShellCommand: 87899689 date +%s
D:RunShellCommand: 87899689 setprop "debug.mono.extra" "debug=127.0.0.1:29318:29319,timeout=1571764490,loglevel=0,server=y"
D:RunShellCommand: 87899689 getprop
D:RunShellCommand: 87899689 am broadcast -a "mono.android.intent.action.EXTERNAL_STORAGE_DIRECTORY" -n "Mono.Android.DebugRuntime/com.xamarin.mono.android.ExternalStorageDirectory"
D:RunShellCommand: 87899689 am start -a "android.intent.action.MAIN" -c "android.intent.category.LAUNCHER" -n "com.myapp.name/md5aa90eac5c6d14c19e9c8e7ab0853061c.SplashActivity"
D:RunShellCommand: 87899689 am force-stop com.myapp.name
D:RunShellCommand: 87899689 setprop "debug.mono.connect" ""


Items scrolled through

$
0
0

I have a collection view with rss items with property

public string Id { get; set; }
public bool IsReaded { get; set; }

I need to set IsReaded property to true as scrolled through the items

I thought of using LastVisibleItemIndex so for every 5 items set there IsReaded property to true but how to get these items ids?

or if there are another suggested approaches

Navigation back button accessibility name

$
0
0

If you have enabled the navigation page, with the back button (the "<" icon) and the title, when the screen reader focus is on the back button it read "unlabeled button". Is there a way to change is Accessibility name to a proper "back button" or whatever else? Either in Android and iOS

MVVM XAMARIN FORMS

$
0
0
hello friends, I can have an example of mvvm xamarin forms which takes the data of a remaining API, the examples that I find allude to the display in a listeview but I want to display it in labels which are in frames . Thank you

Entry does not accept decimals from Keyboard

$
0
0

Hi, I have a field called Size and it's a decimal field so I expect user to enter decimal values but when I tried to debug and enter the decimal value, emulator does not accept decimals. I can enter the whole number but not the decimal. Any suggestions? TIA.

Display Xamarin Font Icons From Stored Data

$
0
0

Hello! What is the best way to display font icons with data being pulled from a web service? I want to store the value of the icon and display the icon similar to the rest of the information, but with a custom font icon.

I have a xamarin forms app working with data from a webservice successfully. Here is my model.

public class TypeModel
{
    [PrimaryKey]
    public int pType { get; set; }

    public int fDepartment { get; set; }

    public string Title { get; set; }

    public string Description { get; set; }

    public string Icon { get; set; }

    public string Version { get; set; }

}

I also got the font icons working successfully like the tutorial at [1]: https://montemagno.com/using-font-icons-in-xamarin-forms-goodbye-images-hello-fonts/ I got my icons stored under this class. Trying to transition to managing these values with web service or array if I have too now.

public const string IconCheckMark = "\uf12c";

public const string IconSearchGlass = "\uf349";

public const string IconQuestionMark = "\uf2d6";

public const string IconQuestionCircle = "\uf2d7";

But here is where my problem starts. My ViewModel is doing the work to create the collection. How do I assign a value that will display and match correctly.

public ObservableCollection<TypeModel> TypesCollection { get; set; }

TypesCollection.Clear();

IEnumerable<TypeModel> types = await DataSource.GetTypes();

foreach (var key in types)
{
    \\Original value doesn't display correctly, shows like \U f 1 2 c when debugging on emulator
    \\key.Icon = key.Icon;

    \\Works and displays correctly but static data displays one icons for all
    \\key.Icon = "\uf12c";

    \\Works and displays correctly but static data displays one icons for all
    \\key.Icon = FontClass.IconCheckMark;

    TypesCollection.Add(key);    
}

Nice and simple after that for the xaml files.

<ResourceDictionary>

    <OnPlatform x:Key="IconFonts" x:TypeArguments="x:String">

        <On Platform="iOS" Value="Material Design Icons"></On>

        <On Platform="Android" Value="IconFonts.ttf#Material Design Icons"></On>

        <On Platform="UWP" Value="/Assets/IconFonts.ttf#Material Design Icons"></On>

    </OnPlatform>

</ResourceDictionary>

<Label FontFamily="{StaticResource IconFonts}" Text="{Binding Icon}"></Label>

TextBlobbed List store in sqlite deserialize null

$
0
0

Hello

I want to store List DayOfWeek list in sqlite. Its working well, but when i want to use the blobbed parts containn the data, but the list is always null

[TextBlob(nameof(RepetitonDaysBlobbed))] 
public List<DayOfWeek> RepetitonDays { get; set; }
public string RepetitonDaysBlobbed { get; set; }

Its strange. When i check it with the debugger, i see data in the Blobbed property (example: "[0,6]" -> represent monday and sunday) but the list empty. Do you have any solution?

How can I share an image to instagram in iOS?

$
0
0

I only open instagram, but I want to share the photo of the uri

path = http://pic3.zhimg.com/8161ba9638273e0fb1a0201789d22d8e_m.jpg

public string ObtainURL(string path)
        {
            var imageURL = FromUrl(path);
            var returnMessage = "";

            try
            {
                NSString documentDirectory = (new NSString(Environment.GetFolderPath(Environment.SpecialFolder.Personal)));
                //string saveImagePath = documentDirectory.AppendPathComponent(new NSString(@"Image.igo"));
                string saveImagePath = documentDirectory.AppendPathComponent(new NSString(@"Image.ig"));
                NSData imageData = imageURL.AsPNG();
                imageData.Save(saveImagePath, true);
                NSUrl imageURLfinal = NSUrl.FromFilename(saveImagePath);
                NSUrl instagramURL = NSUrl.FromString("instagram://app");

                if (UIApplication.SharedApplication.OpenUrl(instagramURL)) //check for App is install or not
                {
                    var DocumentController = UIDocumentInteractionController.FromUrl(imageURLfinal);
                    var dicDel = new UIDocumentInteractionControllerDelegateClass();
                    DocumentController.Delegate = dicDel;
                    DocumentController.Uti = "com.instagram.photo";
                    //DocumentController.Delegate = new IUIDocumentInteractionControllerDelegate(this);
                    //DocumentController.Uti = "com.instagram.exlusivegram";

                    CGRect rect = new CGRect(0, 0, 612, 612);

                    DocumentController.PresentOpenInMenu(new RectangleF(1, 1, 1, 1), View, true);

                    DocumentController.PresentOpenInMenu(rect, this.View, true);

                    InvokeOnMainThread(delegate {
                        DocumentController.PresentOpenInMenu(new RectangleF(1, 1, 1, 1), View, true);
                        DocumentController.PresentOpenInMenu(rect, this.View, true);
                    });

                    returnMessage = "NSURL: " + imageURLfinal;
                }
                else
                {
                    returnMessage = "Instagram Not Found";
                }
            }
            catch (Exception ex)
            {
                returnMessage = ex.Message;
            }

            //return imageURL.ToString()+" NSURL: "+ imageURLfinal;
            return returnMessage;
        }

--

public static UIImage FromUrl(string uri)
        {
            var imageName = uri.Substring(uri.LastIndexOf('/') + 1);

            if (File.Exists(Path.Combine(NativeImagesPath, imageName)))
                return UIImage.FromFile(Path.Combine(NativeImagesPath, imageName));

            if (File.Exists(Path.Combine(ImagesCachePath, imageName)))
                return UIImage.FromFile(Path.Combine(ImagesCachePath, imageName));

            if (Items.ContainsKey(uri))
                return Items[uri];

            using (var url = new NSUrl(uri))
            using (var data = NSData.FromUrl(url))
            {
                var image = UIImage.LoadFromData(data);

                if (!NSFileManager.DefaultManager.FileExists(ImagesCachePath))
                    NSFileManager.DefaultManager.CreateDirectory(ImagesCachePath, false, null);

                var result = NSFileManager.DefaultManager.CreateFile(Path.Combine(ImagesCachePath, imageName), data, new NSFileAttributes());
                if (!result)
                    Items[uri] = image;

                return image;
            }
        }

--

public class UIDocumentInteractionControllerDelegateClass : UIDocumentInteractionControllerDelegate
        {

            UIViewController viewC;

            public UIDocumentInteractionControllerDelegateClass(UIViewController controller)
            {
                viewC = controller;
            }

            public UIDocumentInteractionControllerDelegateClass()
            {
            }

            public override UIViewController ViewControllerForPreview(UIDocumentInteractionController controller)
            {
                return viewC;
            }

            public override UIView ViewForPreview(UIDocumentInteractionController controller)
            {
                return viewC.View;
            }


            public override CGRect RectangleForPreview(UIDocumentInteractionController controller)
            {
                return viewC.View.Frame;
            }          

        }

Master Detail Default Example

$
0
0

Hey guys, I want to know why in the new project with the master detail template there is a delay for android in the MainPage.xaml.cs and some especific code for iOS in the MainPage.xaml. I'm using the most updated version of visual studio 2019.

Here is the portion of MainPage.xaml:

<MasterDetailPage.Detail>
    <NavigationPage>
        <NavigationPage.Icon>
            <OnPlatform x:TypeArguments="FileImageSource">
                <On Platform="iOS" Value="tab_feed.png"/>
            </OnPlatform>
        </NavigationPage.Icon>
        <x:Arguments>
            <views:ItemsPage />
        </x:Arguments>
    </NavigationPage>
</MasterDetailPage.Detail>

Here is the portion of MainPage.xaml.cs:

public async Task NavigateFromMenu(int id)
{
    if (!MenuPages.ContainsKey(id))
    {
        switch (id)
        {
            case (int)MenuItemType.Browse:
                MenuPages.Add(id, new NavigationPage(new ItemsPage()));
                break;
            case (int)MenuItemType.About:
                MenuPages.Add(id, new NavigationPage(new AboutPage()));
                break;
        }
    }

    var newPage = MenuPages[id];

    if (newPage != null && Detail != newPage)
    {
        Detail = newPage;

        if (Device.RuntimePlatform == Device.Android)
            await Task.Delay(100);

        IsPresented = false;
    }
}

Xamarin Forms: sets text and display size to default while device it is configured large

$
0
0

Hi all,
I'm having a problem on xamarin ios and android. if the device has set the text and display size to large, all the sizes in my app become enlarged.
how can I set the default when opening the app?
I have no idea where to put or disable the system configuration of the text or display size. I have tried using this help:

    using Xamarin.Forms;
    using Xamarin.Forms.Platform.Android;

    [assembly: ExportRenderer(typeof(Label), typeof(MyApp.Droid.Renderers.LabelRendererDroid))]
    namespace MyApp.Droid.Renderers
    {
        class LabelRendererDroid : LabelRenderer
        {
            protected override void OnElementChanged(ElementChangedEventArgs<Label> e)
            {
                base.OnElementChanged(e);
                if (e.NewElement == null) return;
                Control.SetTextSize(Android.Util.ComplexUnitType.Dip, (float)e.NewElement.FontSize);
            }
        }
    }

but besides being obsolete, it is only for android.

Could not resolve type with token 01000012

$
0
0

I've been developing my app now for at least 5 months. I've been wanting to try the xamarin previewer so i updates visual studio xamarin forms and then i updated my nuget xamarin forms for my portable, ios and android.

now when i try to debug the application on the device i get

System.TypeLoadException: Could not resolve type with token 01000012

on this line

global::Xamarin.Forms.Forms.Init(this, bundle);

which i find very odd

origionally my xamarin forms nuget version was 2.3.3.168

so i thought id update to the stable version which was the same version number 2.3.3.168 but it had "stable" beside it

i've downgraded again but still get the same error.

any thoughts

thanks

Extremely long build with xamarin forms android

$
0
0

Hi,

I have a xamarin forms project with Xamarin.Forms v4.5 with Vs 2019.

And I compile with using Android 10.0 Q.

When I build in debug mode it's extremely long.

In my output it hangs 10 minutes on the line:

1>------ Build started: Project: Dev.Mobile.Android, Configuration: Debug Any CPU ------

Once it passes this step it's quite fast.

My setup for the build is:

What could bhe the issue? How can I investigate?

Thanks,

Consuming Stand-alone Resource Dictionaries

$
0
0

https://docs.microsoft.com/en-us/xamarin/xamarin-forms/xaml/resource-dictionaries#stand-alone-resource-dictionaries

According to this documentation, it's possible to split the app styling into individual resources Dictionary, by modifying a content page /view .

I have done this, and moved a section of styling to this Dictionary, my problem is then access these resources from other content.

Normally I would define it in the App level resource Dictionary, and then consume by

Style="{StaticResource HeaderBackGround}"

This of course can't be resolved.

So how do you consume a Stand-alone Resource Dictionary?

Java.Lang.IllegalStateException: FragmentManager is already executing transactions

$
0
0

I want to add a TabbedPage as a child of another TabbedPage, it works fine for me, but when I press the back button the application throws me an exception: Java.Lang.IllegalStateException: 'FragmentManager is already executing transactions'

checkbox checked change event throws exception

$
0
0

at Xamarin.Forms.Platform.iOS.CheckBoxRendererBase1[T].OnElementCheckedChanged (System.Object sender, System.EventArgs e) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\CheckBoxRendererBase.cs:138 at (wrapper delegate-invoke) System.EventHandler1[Xamarin.Forms.CheckedChangedEventArgs].invoke_void_object_TEventArgs(object,Xamarin.Forms.CheckedChangedEventArgs)
at Xamarin.Forms.CheckBox+<>c.<.cctor>b__33_0 (Xamarin.Forms.BindableObject bindable, System.Object oldValue, System.Object newValue) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\CheckBox.cs:15
at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) [0x00120] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:463
at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x00173] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:397
at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value, System.Boolean fromStyle, System.Boolean checkAccess) [0x00042] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:334
at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:311
at Xamarin.Forms.CheckBox.set_IsChecked (System.Boolean value) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\CheckBox.cs:33
at Xamarin.Forms.Platform.iOS.CheckBoxRendererBase`1[T].OnControlCheckedChanged (System.Object sender, System.EventArgs e) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\CheckBoxRendererBase.cs:133
at Xamarin.Forms.Platform.iOS.FormsCheckBox.OnTouchUpInside (System.Object sender, System.EventArgs e) [0x0000f] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\FormsCheckBox.cs:47
at UIKit.UIControlEventProxy.Activated () [0x00004] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.18.1.31/src/Xamarin.iOS/UIKit/UIControl.cs:38
--- End of stack trace from previous location where exception was thrown ---

at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.18.1.31/src/Xamarin.iOS/UIKit/UIApplication.cs:86
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.18.1.31/src/Xamarin.iOS/UIKit/UIApplication.cs:65
at ControladorMovil.iOS.Application.Main (System.String[] args) [0x00001] in /Main.cs:17


Binding text label on a home page to a timer

$
0
0

We have a really simple app, the idea is the timer will update a label on the home screen depending on different configuration within the mobile app. I have created the binding and can update the homepage from it's self but not from the timer. I think what is missing is a OnChange within the home page to detect if the string has changed.

Display layout code, bind the label to the name "LabelText"

<Label                
Text = "{Binding LabelText, Mode=TwoWay}"
x:Name="MainPageStatusText"
HorizontalOptions="CenterAndExpand"
Grid.Row="2"
Grid.Column="0" 
Grid.ColumnSpan="6"
VerticalOptions="CenterAndExpand"
TextColor="White"
FontSize="Medium"/>

=====
This is the class file to link the text string to the label, I can see it been called from the different places but when it's called from the app.cs it does not work

using System;
using System.Collections.Generic;
using System.ComponentModel;
using Xamarin.Forms;

namespace Binding_Demo
{
    public class MyClass : INotifyPropertyChanged
    {
        protected void OnPropertyChanged(PropertyChangedEventArgs e)
       { PropertyChanged?.Invoke(this, e); }

       protected void OnPropertyChanged(string propertyName)
       { OnPropertyChanged(new PropertyChangedEventArgs(propertyName)); }

       public event PropertyChangedEventHandler PropertyChanged;

      private string labelText;

      public string LabelText
      {
         get {
            return labelText;
            }


        set
        {
            labelText = value;
            OnPropertyChanged("LabelText");

         }
      }
   } 
}

=====
This is the code inside the homepage, this works and I can see it sending data to the text label

    public static MyClass _myClass = new MyClass();
    public Homepage()
    {

        BindingContext = _myClass;
        _myClass.LabelText = "Inside the home page";

    }

======

This is the App.cs code, we start the timer and then want to set the text on the Homepage label. I can see the class been called, but it does not set the text.

 using System;
 using System.Diagnostics;
 using System.Threading.Tasks;
 using Xamarin.Forms;
 using Xamarin.Forms.Xaml;

 namespace Binding_Demo
 {
 public partial class App : Application
{
    public static MyClass _myClass = new MyClass();

    public App()
    {
        //InitializeComponent();

        Device.StartTimer(TimeSpan.FromSeconds(10), () =>
        {

            Task.Run(() =>
            {
                Debug.WriteLine("Timer has been triggered");

                // !!!!! This is not setting the text in the label !!!!!
                BindingContext = _myClass;
                _myClass.LabelText = "Inside the timer app";

            });
            return true; //use this to run continuously
        });

        MainPage = new NavigationPage(new MainPage());
    }

    protected override void OnStart()
    {
        //

    }

    protected override void OnSleep()
    {
    }

    protected override void OnResume()
    {
        // force app to mainpage and clear the token  


    }
}

}

I am trying to display icon in my tabbed page but tutorials aint helping, Need Help.

$
0
0

I couldnt find Icon Property inside my toolbar and IconImageSource is not helping,
I have created icons from android assest and had all icon inside mipmap according to resoulation,
{

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

<TabbedPage.ToolbarItems>

</TabbedPage.ToolbarItems>

<Local:PaProfile Title="Profile"
                 IconImageSource="Profile.png"/>


}
Same Problem for Profile PAge Also.

SetFlag not work in android?

$
0
0

The class, property, or method you are attempting to use ('.ctor') is part of IndicatorView; to use it, you must opt-in by calling Forms.SetFlags("IndicatorView_Experimental") before calling Forms.Init().

but in the ManActivity.cs I have set the flag:
`base.OnCreate(savedInstanceState);

        global::Xamarin.Forms.Forms.SetFlags("CollectionView_Experimental");
        global::Xamarin.Forms.Forms.SetFlags("IndicatorView_Experimental");
        Xamarin.Essentials.Platform.Init(this, savedInstanceState);
        global::Xamarin.Forms.Forms.Init(this, savedInstanceState);`

it still give an error?

integrate an image editor

$
0
0

Hi,

I want to integrate an image editor (similar to adobe creative SDK or Img.ly SDK) into xamarin.forms app, can anyone please suggest me a cross platform image editor?

NavigationBar.TitleView does not hide menu icon in UWP.

$
0
0

This is my NavBar title view:

<NavigationPage.TitleView>
        <StackLayout Margin="0" Padding="6,0,6,0" BackgroundColor="Yellow"
                     Orientation="Horizontal">
            <Button VerticalOptions="Center" ImageSource="backArrow_icon.png"
                    HorizontalOptions="Start"
                    HeightRequest="30" MinimumHeightRequest="30"
                    WidthRequest="30" MinimumWidthRequest="30"/>
            <Label VerticalOptions="Center"
                   HorizontalOptions="StartAndExpand"
                   Text="{x:Static resources:AppResources.Share}"/>
            <Button VerticalOptions="Center" ImageSource="Check_Icon.png"
                    HorizontalOptions="Start"
                    HeightRequest="30" MinimumHeightRequest="30"
                    WidthRequest="30" MinimumWidthRequest="30"/>
        </StackLayout>
    </NavigationPage.TitleView>

How do I make the menu icon marked in red, invisible? or get rid of it?

Viewing all 89864 articles
Browse latest View live


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