Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Samantha Houts
    @samhouts

    xamarin-forms now :smile:

    Mark Wardell
    @BicycleMark
    @PureWeen - I have heard the gitter is no longer the "Xamarin.Forms official home" yet gitter header says this is the "Xamarin.Forms official home" Get it together kids :(
    Gerald Versluis
    @jfversluis
    Changed it @BicycleMark
    Rui Marinho
    @rmarinho
    We should archive this channel
    can someone also post the discord url .. not sure how we get one
    Shane Neuville
    @PureWeen
    yea it's already pinned and included in my first comment
    is the link

    if we can put up a permanent response thing on gitter so anyone going there knows to go to discord then I think we can archive this channel

    Otherwise probably good to keep open for a bit just to guide people

    IoTFier
    @IoTFier

    if we can put up a permanent response thing on gitter so anyone going there knows to go to discord then I think we can archive this channel

    Otherwise probably good to keep open for a bit just to guide people

    Keep it open till everyone figures out their path to Discord

    Vishnu Kumar
    @sasivishnu

    Hi anyone have an idea about this bug? microsoft/appcenter#1451

    Whats the workaround for entering text in search bar? Xamarin.UITest are failing in Android 10

    Rui Marinho
    @rmarinho
    Please perform this command before running your tests and everything should be just fine =)
    adb shell settings put global hidden_api_policy 1
    Stefan Cvetkovic
    @stefancvetkovic
    Hello, I have a question regardin custom callout in xamarin forms maps in iOS renderer
    from my CustomPin model, I have alist of strings and I want to represent them as UIStackView ina right section
    and in the left section of the callout to be a image
    I make it work in android, but in ios I done as far as I could this
    Durgesh Khandal
    @techduggu
    Hi @jfversluis /Xamarin.Forms team,
    Need one help. I am working on an X.F issue and I noticed that Xamarin.Forms repo is using the 'main' branch as a default branch. I tried to take the latest (Fetch) from upstream (Xamarin.Forms) to my forked branch but it doesn't fetch the 'main' branch and still using the master as default branch.
    Any ideas around how can we get this to forked repo? Should I create a new fork (just don't want to lose any work in my existing fork repo)?
    2 replies
    Gerald Versluis
    @jfversluis
    Hey everyone, just a friendly reminder that you can best reach us on Discord now: https://aka.ms/dotnet-discord @techduggu @stefancvetkovic @sasivishnu
    pm64
    @pm64
    In my Xamarin.Forms Android project, I have this line of code:
    var textView = new TextView(Forms.Context);
    It generates this warning:
    "Context is obsolete as of version 2.5. Please use a local context instead."
    How do I address this?
    Shane Neuville
    @PureWeen

    access the context from a static instance in android isn't recommended
    you should access the context from whatever context that text view is instantiated from

    you should be able to do this.Context

    if you can't do this.Context then you need to pass in the Context from whatever is calling the code to instantiate the TextView

    pm64
    @pm64
    Thanks @PureWeen! This code is actually in a custom renderer, so sounds like I need to update the interface.
    Do you happen to know the type of Context? Intellisense is saying it's a type that doesn't appear to exist, Xamarin.Forms.Context..?
    pm64
    @pm64
    The calling code is in a class that inherits from Grid, and there's no this.Context for me to pass..
    Shane Neuville
    @PureWeen

    can you post the whole class into a gist where this code exists?

    var textView = new TextView(Forms.Context);

    pm64
    @pm64
    @PureWeen sure, here you go:
    @PureWeen above is from the Android project .. the following is from the Xamarin.Forms project:
    And sorry, "custom renderer" was inaccurate. I meant "platform-specific implementation of a shared interface".
    Shane Neuville
    @PureWeen

    that's a tricky one :confused:

    I would use this plugin

    https://github.com/jamesmontemagno/CurrentActivityPlugin
    And retrieve the current Context from that

    Which should be fine

    technically what you should do is retrieve the Context from the renderer associated with the Grid but that will only matter if you're using material or if your Grid has a different activity context

    pm64
    @pm64
    So best, best practice would be to use CurrentActivityPlugin within the Grid to obtain the Context from the renderer associated with the Grid, then pass that Context to my method?
    Shane Neuville
    @PureWeen

    yea but that might be overkill :smile: it's hard to know from the scenario

    in theory the Context on the Grid is just going to be your FormsAppCompatActivity

    it would only change if for some reason you are instantiating a new context for some reason
    like a different themed context or something like that
    pm64
    @pm64
    Ok, I'll need to read up on that to better understand the implications.
    Thanks man! Much appreciated.
    Shane Neuville
    @PureWeen

    yea with android the styles/themes etc.. are all stored inside the context so that's what android native views use to know how to make themselves look a certain way

    So, for material what we do is instantiate a new Context with material themes and then that gets passed through to all the children which then style based on that new context

    What you could also do (which would probably be fine) is register the concrete type yourself in MainActivity

                PaintUtils utils = new PaintUtils(this);
                DependencyService.RegisterSingleton<ICalculateTextWidth>(utils);

    or you could even just register a static TextView

    Because you are only using it to measure you don't really need to instantiate a new one everytime

    pm64
    @pm64
    Ah yes, great point
    Hey @PureWeen while I've got your ear, let me run one more thing by you that's been bugging me for ages. When I build my Android project, I get these warnings:
    Found conflicts between different versions of "Microsoft.CSharp" that could not be resolved.
    Found conflicts between different versions of "System.Numerics.Vectors" that could not be resolved.
    This project is referencing all of the latest bits, but it's been updated over time and I'm thinking these warnings might relate to some lingering artifact from the past. But I'm not able to identify it. Any thoughts?
    Shane Neuville
    @PureWeen

    that one I'm not super sure

    Your best bet for an answer there would be to hop in here
    https://aka.ms/dotnet-discord

    And ask the android team...

    My guess there is that that's a conflict between the mono version of those and the .net version of those

    you might have a nuget pulling in net47 or something versions of those

    in your obj folder there's a file called project.assets.json that you MIGHT be able to mine through to find where those are coming from

    pm64
    @pm64
    Ok gotcha, will check it out
    ron
    @dan_ron_gitlab
    Hello I am new to xamarin coming from WPF. This StringFormat={}{0:#,0.##} string format worked in wpf but not in Xamarin am I missing something?
    intelesens showing "expecting ┌" and "The type " was not found verify that you are not missing an assmebly refrence and that all refrenced assemblies have been built"
    (trying to display 2 floating points only when it different from 0)
    IoTFier
    @IoTFier

    Hello I am new to xamarin coming from WPF. This StringFormat={}{0:#,0.##} string format worked in wpf but not in Xamarin am I missing something?

    please, post your queries at https://aka.ms/dotnet-discord #xamarin-forms channel