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

What is a good library to use for MVVM with Xamarin Forms

$
0
0

Hi,

I am getting started on Xamarin and decided to use Xamarin Forms. What is the good MVVM library to use for Xamarin.Forms?


Update language translation on the fly using TranslateExtension

$
0
0

Following this guide I'm trying to localize my app. I don't want to get system language. I have 3 resx files for the 3 languages that I want to support. I'm able to set the current culture at start and the strings are displayed correctly.

My goal is to change the language while you are using the app. TranslateExtension class is in MyApp.Resources PCL library and this is my page to select the language.

    <?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:vm="clr-namespace:MyApp"
                 xmlns:t="clr-namespace:MyApp.Resources;assembly=MyApp.Resources"
                 x:Class="MyApp.Pages.LanguagePage"
                 BindingContext="{Binding Source={x:Static vm:App.Locator}, Path=Language}">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="*"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <ListView x:Name="contactsListView" Grid.Row="0" ItemsSource="{Binding Languages}" SelectedItem="{Binding SelectedLanguage}">
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <TextCell Text="{Binding Value}" Detail="{Binding Key}"  />
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>
            <Button Grid.Row="1" Text="{t:Translate Accept}" Clicked="OkButtonClicked" Command="{Binding SaveLanguageCommand}"/>
        </Grid>
    </ContentPage>

When a item in the ListView is selected the accept button should change the text (this is what I want). How can I do that?

Is this possible? Fetching images from ios album as UI image.

$
0
0

I worked on Android, which is very easy. Add file path for images, and if images not there, it won't error, and it will display icons etc when images are there.

However, in iOS seems to be a completely different story.

I found a couple of examples on line, but all seems too old, still using ALAsset which is obsolete.

Is there any updated examples of this?

how iOS handle when the images not there?

Can iOS locate images to load by "file name"? for example, app only knows file name, not file location or id. After user copied images with certain filenames into album, app will automatically pick them up.

Thanks in advance.

Back button from causes crash on Android when page is MasterDetail

$
0
0

I'm seeing a crash on Android when the user presses the back button on their device while on the root MainPage of the application which happens to be a MasterDetail page. It looks to be the disposing of the Detail page that is the issue.

I'm using Xamarin.Forms 2.3.3-pre3 and building using Android 7.0 SDK.

Here is the stack trace:

  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143
  at Java.Interop.JniEnvironment+InstanceMethods.CallIntMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method) [0x00084] in /Users/builder/data/lanes/3819/5a02b032/source/Java.Interop/src/Java.Interop/Java.Interop/JniEnvironment.g.cs:11464
  at Android.Runtime.JNIEnv.CallIntMethod (System.IntPtr jobject, System.IntPtr jmethod) [0x00000] in /Users/builder/data/lanes/3819/5a02b032/source/monodroid/src/Mono.Android/JNIEnv.g.cs:186
  at Android.Support.V4.App.FragmentTransactionInvoker.CommitAllowingStateLoss () [0x00033] in <27c17fe440cf491ba8255bcefade6e02>:0
  at Xamarin.Forms.Platform.Android.AppCompat.MasterDetailContainer.Dispose (System.Boolean disposing) [0x00042] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\MasterDetailContainer.cs:130
  at Java.Lang.Object.Dispose () [0x00000] in /Users/builder/data/lanes/3819/5a02b032/source/xamarin-android/src/Mono.Android/Java.Lang/Object.cs:203
  at Xamarin.Forms.Platform.Android.AppCompat.MasterDetailPageRenderer.Dispose (System.Boolean disposing) [0x00046] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\MasterDetailPageRenderer.cs:192
  at Java.Lang.Object.Dispose () [0x00000] in /Users/builder/data/lanes/3819/5a02b032/source/xamarin-android/src/Mono.Android/Java.Lang/Object.cs:203
  at Xamarin.Forms.Platform.Android.AppCompat.Platform.SetPage (Xamarin.Forms.Page newRoot) [0x0003f] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:226
  at Xamarin.Forms.Platform.Android.AppCompat.Platform.Dispose () [0x00010] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:52
  at Xamarin.Forms.Platform.Android.FormsAppCompatActivity.OnDestroy () [0x0002f] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\FormsAppCompatActivity.cs:195
  at Android.App.Activity.n_OnDestroy (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in /Users/builder/data/lanes/3819/5a02b032/source/monodroid/src/Mono.Android/platforms/android-24/src/generated/Android.App.Activity.cs:2981
  at (wrapper dynamic-method) System.Object:b4f537f5-a711-449c-9bf3-d2540956cdc2 (intptr,intptr)
  --- End of managed Java.Lang.IllegalStateException stack trace ---
java.lang.IllegalStateException: Activity has been destroyed
    at android.support.v4.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:1515)
    at android.support.v4.app.BackStackRecord.commitInternal(BackStackRecord.java:638)
    at android.support.v4.app.BackStackRecord.commitAllowingStateLoss(BackStackRecord.java:621)
    at md5b60ffeb829f638581ab2bb9b1a7f4f3f.FormsAppCompatActivity.n_onDestroy(Native Method)
    at md5b60ffeb829f638581ab2bb9b1a7f4f3f.FormsAppCompatActivity.onDestroy(FormsAppCompatActivity.java:80)
    at android.app.Activity.performDestroy(Activity.java:6866)
    at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1153)
    at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4154)
    at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4185)
    at android.app.ActivityThread.-wrap6(ActivityThread.java)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1521)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6077)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)

How to work with Validator Behaviour attached to Bindable Entry?

$
0
0

Hi All,

I set entry text as a bindable property with ViewModel with TwoWay mode. Any idea how to configure it with a validator behavior so only when text is valid then binding would be enabled?

Right now I have following:

<Entry Text="{Binding Zone, Mode=TwoWay}" Placeholder="Type zone area">
    <Entry.Behaviors>
        <behaviors:ZoneValidatorBehavior x:Name="zoneValidator" />
    </Entry.Behaviors>
</Entry>

-iKK

How can we change color of Progressbar?

$
0
0

This is my code :

< ProgressBar Progress="0.5" WidthRequest="500" HeightRequest="15" HorizontalOptions="StartAndExpand" / >

Try and background, but I want to change the indicator color line progress

Xamarin Forms using Socket Plugin - UDP send and receive example

$
0
0

Hi there,

Has anyone used socket plugin from @RyanDavis to send and receive UDP packets? We have a requirement to use it to broadcast and receive data via UDP sockets on Xamarin Forms.

If anyone has used it in the above mentioned situation, kindly advice how to do this with socket plugin (sockets-to-pci) from @RyanDavis.

Essential I have been able to do this with python sockets (code below):

broadcast_ip = "192.168.1.255"
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
print('sending to: ', broadcast_ip, ' on: ', broadcast_port)
print('sending command: ', command)
s.sendto(command, (broadcast_ip, broadcast_port))
data = s.recvfrom(32) # buffer size is 1024 bytes
s.close()
print('data recv: ', data)

Need it to be find an equivalent for Xamarin Forms C#. Thank you.

JD

DisplayActionSheet

$
0
0

Hi All,

Please see my below code.

async void OnActionSheetSimpleClicked (object sender, EventArgs e)
{
  var action = await DisplayActionSheet ("ActionSheet: Send to?", "Cancel", null, "Email", "Twitter", "Facebook");
  Debug.WriteLine ("Action: " + action);
}

When I select Email I want to that selected value when DisplayActionSheet is close.

Can any one suggest how can i do that.


Capture image from camera in background

$
0
0

Hey, is it possible to capture photo from camera in background without showing it in application like redrawing from textureView? I mean to do something like notification or sth like this.

Thanks :)

Order of execution when using Behaviors, DataTriggers and Bindings

$
0
0

Hello,

What is the order of execution of Behaviors, DataTriggers and Binding in Xamarin?

In one view I have:
1. Editor with custom behavior that implements some entered data validation
2. Data triggers that are bound to properties of custom behavior in order to change background color of Editor
3. Two way Binding that also shall change background of Editor from the View model.

I have unexpected behavior, and I can not tell for sure what is the order of execution of above mentioned.

Regards,
Novak

How often doe you call GC.Collect

$
0
0

Hi,

I'm hunting memory leaks at the moment (in C++ time you knew you had to care for everything, now it's no longer clear)

On a 1GB Android Phone my App crashes with abouzt 70MB allocated private bytes. Is this normal?

I have read that you should call GC.Collect from time to time. How do you handle this?

Best
Thomas

Invalid IL

$
0
0

Hi All,

Am getting the below error when trying some Forms2Native and Native2Forms witchcraft. Works OK elsewhere but was just wondering if anything jumps out at you that I may be doing incorrectly?

Essentially I need to have a Xamarin.Froms page, with a button that shows a Popover menu to select a user that is bound to the button on the toolbar. Then when clicked it should dismiss and change the data to the newly selected user.

Error is:
System.InvalidProgramException: Invalid IL code in ProjectName.vwClientMenu/c__AnonStorey7:<>m__0 (object,System.EventArgs): IL_0008: stfld 0x04000333

Code is:
`
btnDiary.TouchUpInside += (object sender, EventArgs e) => {
var pgDiary = App.GetCalendarPage(clsGlobal._clsLogin);
var vwDiary = pgDiary.CreateViewController();
vwDiary.Title = "Diary";

            List<User> lstUsers = GetUserList();
            List<string> lstUserCodes = GetUserCodeList(lstUsers);
            List<string> lstUserNames = GetUserNameList(lstUsers);

            clsGlobal.TrackEvent("Enter Diary (Forms)", pgDiary.DiaryAppointmentCount);

            var bbiAdd = new UIBarButtonItem(UIBarButtonSystemItem.Add, (s, e1) =>{
            })
            { Enabled = true };

            var bbiUser = new UIBarButtonItem(UIBarButtonSystemItem.Organize);
            bbiUser.Clicked += (object sender3, EventArgs e3) =>
            {
                pgListSelection pgForm = App.GetListSelection(lstUserNames);
                var pgViewController = pgForm.CreateViewController();
                pgViewController.ModalPresentationStyle = UIModalPresentationStyle.Popover;
                pgViewController.PopoverPresentationController.BarButtonItem = bbiUser;

                pgForm.ItemSelected += (int index) =>
                {
                    pgViewController.DismissModalViewController(true);
                    bbiUser.Title = lstUserNames[index];
                    pgDiary.ChangeUser(lstUserCodes[index], lstUserNames[index]);
                };

                this.PresentViewController(pgViewController, true, null);
            };


            UIBarButtonItem[] bbis = new UIBarButtonItem[] { bbiUser, bbiAdd };
            vwDiary.NavigationItem.RightBarButtonItems = bbis;

            this.NavigationController.PushViewController(vwDiary, true);
        };`

Exception thrown when instantiating a Map in Xamarin.Forms 2.0 on Android

$
0
0

After upgrading my Xamarin.Forms 1.5.2 project to Xamarin.Forms 2.0.0.6484, I
keep getting the following exception whenever I try to access a page with a
Xamarin.Forms Map instance. See below.

I have tried to clean my project, deploying to a fresh Android emulator image
and debugging on a separate device. But it does not seem to be an issue related
to the platform running the app.

Is there any known solution to this isse?

Exception: Java.Lang.NoSuchMethodError:
com.google.android.gms.common.internal.zzx.zzv
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c]
in
/Users/builder/data/lanes/2098/3efa14c4/source/mono/external/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143
  at Android.Runtime.JNIEnv.CallStaticIntMethod (IntPtr jclass, IntPtr jmethod,
Android.Runtime.JValue* parms) [0x00064] in
/Users/builder/data/lanes/2098/3efa14c4/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:1501
  at Android.Gms.Maps.MapsInitializer.Initialize (Android.Content.Context
context) [0x00049] in <filename unknown>:0
  at Xamarin.FormsMaps.Init (Android.App.Activity activity, Android.OS.Bundle
bundle) [0x0002b] in <filename unknown>:0
  --- End of managed exception stack trace ---
java.lang.NoSuchMethodError: com.google.android.gms.common.internal.zzx.zzv
    at com.google.android.gms.maps.internal.zzy.zzaF(Unknown Source)
    at com.google.android.gms.maps.MapsInitializer.initialize(Unknown Source)
    at md5470ba2f9164bfdf1461f905e050302df.MainActivity.n_onCre
ate(Native Method)
    at
md5470ba2f9164bfdf1461f905e050302df.MainActivity.onCreate(MainActivity.java:28)
    at android.app.Activity.performCreate(Activity.java:5231)
    at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
    at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)
    at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
    at android.app.ActivityThread.access$800(ActivityThread.java:135)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:136)
    at android.app.ActivityThread.main(ActivityThread.java:5001)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:515)
    at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
    at dalvik.system.NativeStart.main(Native Method)

Unhandled Exception:

Java.Lang.NoSuchMethodError: com.google.android.gms.maps.MapView$zzb.zzrn

Using ListView with MVVM pattern I get InvalidCastException: Specified cast is not valid

$
0
0

Hello,

I have a problem with ListView and MVVM pattern. This is my environment:

  • Windows 8.1 Pro (x64)
  • Visual Studio Enterprise 2015 Update 3
  • Xamarin 4.2.2.6
  • Xamarin.Forms 2.3.3.180
  • MvvmLight 5.3.0

I started new Blank Xaml App (Xamarin.Forms Portable) and then I uncheck Windows Phone Silverlight 8.1 from portable library targets.

This is my model, RssSchema.cs (nothing special, only some properties):

namespace Rss.Model
{
    public class RssSchema
    {
        public string Id { get; set; }
        public string Title { get; set; }
        public string Summary { get; set; }
        public string Content { get; set; }
        public string ImageUrl { get; set; }
        public string ExtraImageUrl { get; set; }
        public string MediaUrl { get; set; }
        public string FeedUrl { get; set; }
        public string Author { get; set; }
        public DateTime PublishDate { get; set; }
    }
}

My view model, FeedViewModel.cs with FeedTitle and Items properties. To test, in the constructor I fill Items property with 3 RssSchema objects:

namespace Rss.ViewModel
{
    public class FeedViewModel : ViewModelBase
    {
        private ObservableCollection<RssSchema> items = null;
        public ObservableCollection<RssSchema> Items
        {
            get { return this.items; }
            set
            {
                if (this.items == value) { return; }
                this.items = value;
                this.RaisePropertyChanged(nameof(this.Items));
            }
        }

        private string feedTitle = string.Empty;
        public string FeedTitle
        {
            get { return this.feedTitle; }
            set
            {
                if (this.feedTitle == value) { return; }
                this.feedTitle = value;
                this.RaisePropertyChanged(nameof(this.FeedTitle));
            }
        }

        public FeedViewModel()
        {
            List<RssSchema> list = new List<RssSchema>();
            for (int i = 0; i < 3; i++)
            {
                RssSchema item = new RssSchema();
                item.Title = $"Title {i}";
                list.Add(item);
            }
            this.Items = new ObservableCollection<RssSchema>(list);
            this.FeedTitle = "My blog feed";
        }
    }
}

As I'm using MVVM Light I have a ViewModelLocator.cs (nothing special, only Feed property):

namespace Rss.ViewModel
{
    public class ViewModelLocator
    {
        public ViewModelLocator()
        {
            ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default);
            SimpleIoc.Default.Register<FeedViewModel>();
        }

        public FeedViewModel Feed
        {
            get
            {
                return ServiceLocator.Current.GetInstance<FeedViewModel>();
            }
        }

        public static void Cleanup() { }
    }
}

And I create an instace of it in App.xaml:

<?xml version="1.0" encoding="utf-8"?>
<Application xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="Rss.App"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             d1p1:Ignorable="d"
             xmlns:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006">
  <Application.Resources>
    <ResourceDictionary>
      <vm:ViewModelLocator x:Key="Locator" d:IsDataSource="True" xmlns:d4p1="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:vm="clr-namespace:Rss.ViewModel" />
    </ResourceDictionary>
  </Application.Resources>
</Application>

Finally, this is my view, FeedPage.xaml with one Label and one ListView:

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="Rss.Pages.FeedPage"
             BindingContext="{Binding Source={StaticResource Locator}, Path=Feed}">
  <Grid>
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto"/>
      <RowDefinition Height="*"/>
    </Grid.RowDefinitions>
    <Label Grid.Row="0" Text="{Binding FeedTitle}" HorizontalOptions="Center"/>
    <ScrollView Grid.Row="1" Padding="10">
      <ListView ItemsSource="{Binding Items}" VerticalOptions="Start">
        <!--<ListView.ItemTemplate>
          <DataTemplate>
            <Grid>
              <Label Text="{Binding Title}"/>
            </Grid>
          </DataTemplate>
        </ListView.ItemTemplate>-->
      </ListView>
    </ScrollView>
  </Grid>
</ContentPage>

The Label shows the feed title, so the BindingContext is properly set. As you can see I have the ListView.ItemTemplate in comments. In this way when I run the app I see the 3 items with the default ToString() value (the class complete name):

Rss.Model.RssSchema
Rss.Model.RssSchema
Rss.Model.RssSchema

You can imagine that I don't want to see this content, but if I uncomment the ListView.ItemTemplate part and run the app I get this exception in runtime:

Unhandled Exception:
System.InvalidCastException: Specified cast is not valid.

Do you know what is happening?

DependencyService not working (iOS 10.2, XF v2.3.3.180)

$
0
0

Hi,
I have an issue that the DependencyService is not working in iOS, while the same works perfectly in Andorid and UWP.

Example code:

using System.IO;
using Foundation;

[assembly: Xamarin.Forms.Dependency(typeof(FontHelper))]

namespace Controls.iOS
{
    public sealed class FontHelper : IFontHelper
    {
        public string GetFontPath(string fontName)
        {
            var fileName = Path.GetFileNameWithoutExtension(fontName);
            var extension = Path.GetExtension(fontName);
            return NSBundle.MainBundle.PathForResource(fileName, extension);
        }
    }
}

When calling var fontHelper = DependencyService.Get<IFontHelper>(); I only get a null result.

Registering the service manually in AppDelegate.OnActivated(UIApplication uiApplication) did not help either. I tried this variants:

DependencyService.Register<IFontHelper, FontHelper>();
DependencyService.Register<FontHelper>();

The same problem applies to ViewRenderer, which are declared as follows:

[assembly: Xamarin.Forms.ExportRenderer(typeof(TestView), typeof(TestViewRenderer))]

namespace Controls.iOS
{
    [Preserve(AllMembers = true, Conditional = false)]
    public sealed class TestViewRenderer : ViewRenderer<TestView, UIView>
    {
        [Preserve]
        public TestViewRenderer()
        {
        }
    }
}
  • According to the documentation this can happen in UWP when using Native Compilation, but shouldn't happen in iOS.
  • The setting Linker behavior is set to Don't link.
  • A Xamarin.Forms.Forms.Init(string[] assemblies) method seems to be missing. However, the Application Output (NSLog) confirms that all necessarily assemblies got loaded.
  • A imperatively method for registering ViewRenderer and EntryRenderer seems to be missing. There is only the declarative method using the ExportRendererAttribute.
  • When resolving the renderer, I get the Xamarin-renderer for the base class. So the resolving appears to work, while the registering of custom types seems to be the problem.

I am wondering if this is a problem with the DependencyService or an mistake in the documentation.


Tap Gesture not working when set to a view with nested elements

$
0
0

Hi guys!

Well, here is my problem: I have a View containing some element whose type and number varry during the runtime. I want to set a tap gesture recognizer which would work no matter what's inside the view. For this reason I want to add a tap gesture recognizer to the "super" view, but, it seems to work properly only when I click outside the child views (in the margin and so on) which made me think that children's TapGestureRecognizers would not let the tap arrive to the parent...

Any ideas?

fimageloading:CachedImage not rendering images

$
0
0

Hi

I have a listview with which should display a list of data, but for each view i have added an image to be added as a background.

I am using ffimageloading:CachedImage, with a URL source. It is rendering the images for some cells, but not others.

Below is a screenshot of what I am getting:

<ViewCell>
            <ViewCell.View>
              <Grid Padding="5, 0, 5, 10">
                 <Grid.HeightRequest>
                    <helpers:OnCustomPlatform
                        x:TypeArguments="x:Double"
                        iOS="180"
                        Android="200"
                        WinPhone="150"
                        Windows="160"/>
                </Grid.HeightRequest>
                <AbsoluteLayout>
                   <ffimageloading:CachedImage
                      Source="http://assets.fodors.com/destinations/1128/central-park-manhattan-new-york-city-new-york-usa_main.jpg"
                      Aspect="AspectFill"
                      CacheDuration="30"
                      CacheType="Disk"
                      DownsampleToViewSize="True"
                      AbsoluteLayout.LayoutFlags="All"
                      AbsoluteLayout.LayoutBounds="0, 0, 1.0, 1.0">
                  </ffimageloading:CachedImage>
                </AbsoluteLayout>
    </ViewCell.View>
</ViewCell>

Any ideas as to why this is happening?

zxing scanner

$
0
0

I am Use Zxing for scanner the QR the Problem is Why the Button Text and Top Text is not show

Xamarin.Forms 2.3.3.180

$
0
0

Important notes

  • Xamarin.Forms 2.3.3 depends on a Xamarin installation of Cycle 8. Users upgrading from Xamarin.Forms 2.3.2 (or earlier) will experience numerous compile errors if they attempt to build without first upgrading their Xamarin installation.

  • When upgrading Xamarin.Forms take care not to simply "update all" as that will update the Xamarin.Android.Support packages to an incompatible version. More info here.

  • In 2.3.3 we are deprecating Classic support (More info here).

Breaking changes

  • [UWP] TabbedPage ContentPresenter is now of type FormsPresenter instead of TabbedPagePresenter. This is an internal change only that will only affect users explicitly targeting TabbedPagePresenter in the UWP project.

2.3.3.180

Nuget package here.

Release Notes

Add authenticode signing.
No other changes.

2.3.3 sr1

Nuget package here.

Bug Fixes

  • 47707 - "47707 – Page.Toolbar is covering page.content with XF.UWP on Windows 10 phone" (PR)

  • 47295 - "[UWP] Toolbar is Clipped When Using a NavigationPage" (PR)

  • 47950 - "2.3.3 Regression: XAML compilation fails with behavior property and StaticResource" (PR)
  • 47971 - "XF UWP ListView Items no longer display" (PR)
  • 48105 - "Xamarin.Forms.Theme ResourceDictionary MergedWith fails in current build" (PR)
  • 48158 - "Hidden controls become transparent, static property does not bind" (PR)
  • 48242 - "Binding to constants not working any more in Xamarin Forms 2.3.3" (PR)
  • 48554 - "Bound static property does not call setter in custom view" (PR)
  • 48726 - "[UWP] Toolbar Covering Page Content" (PR)
  • [XamlC] assigned derived type to generic BP (PR)
  • [Xaml] support non-int enums (PR)

2.3.3 stable

Nuget package here.

Bug Fixes

  • 46195 - "Navigation Stack Errors in Xamarin.Forms.2.3.3.163-pre3" (PR)

2.3.3-pre4

Nuget package here.

Bug Fixes

  • 44338 - "Displaying context action causes ArgumentNullException when another item's context actions are already displayed on iOS10." (PR)

  • "[Win] Toolbar placement works with initial value" (PR)

  • "[Android] SoftInputMode works with initial value" (PR)

2.3.3-pre3

Nuget package here.

Bug Fixes

  • 44129 - "[Forms Android] Removing and adding items to TabbedPage BindingContext crashes the app when VM uses MvvmLight property Set()-method" (PR)

  • 44166 - "41166 - Fix MasterDetailPage/NavigationPage leaks on iPad" (PR)

  • 44596 - "Grey/Blank Screen when switching MainPage to MasterDetail with TabbedPage" (PR)
  • 45010 - "[2.3.3] 45010 – Forms Sample "WorkingWithListview" throw exception with WinPhone8.1" (PR)
  • 44166 - "MasterDetailPage instances do not get disposed upon GC; instance accumulation crashes app with OOM error using Forms 2.3.2.118-pre1 and AppCompat" (PR)
  • Don't unsubscribe/resubscribe the listener to the same INPC (PR)
  • 44886 - "UWP Listview ItemSelected event triggered twice for each selection" (PR)
  • [iOS] Fixes KVO native binding (PR)
  • Make CreateNativeControl virtual instead of abstract (PR)
  • 43993 - "iOS: ListView size does not return to normal after keyboard disappears" (PR)

  • 39768 - "PanGestureRecognizer sometimes won't fire completed event when dragging very slowly" (PR)

  • 42602 - "Custom BoxView Renderer Does Not Render All Its Children Elements" (PR)
  • [Xaml] Xaml native views and bindings for WP8.1 (PR)
  • [XamlC] Compiled converters (PR)
  • [Xaml] allow compatible arguments for x:Factory (PR)
  • [XAMLC] specify type and default value for native bindings (PR)
  • [2.3.3-pre2] [XamlC] supports enum and consts in x:Static (PR)
  • Reuse Handler when invoking on main thread (PR)

2.3.3-pre2

Nuget package here.

New Features

Support native view declaration in Xaml, and native Bindings

The following Xaml is valid, and works as expected:

<?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:ios="clr-namespace:UIKit;assembly=Xamarin.iOS;targetPlatform=iOS"
             xmlns:androidWidget="clr-namespace:Android.Widget;assembly=Mono.Android;targetPlatform=Android"
             xmlns:formsandroid="clr-namespace:Xamarin.Forms;assembly=Xamarin.Forms.Platform.Android;targetPlatform=Android"
             xmlns:win="clr-namespace:Windows.UI.Xaml.Controls;assembly=Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime;targetPlatform=Windows"
       x:Class="Xamarin.Forms.Controls.XamlNativeViews">
    <ContentPage.Content>
        <ios:UILabel Text="{Binding NativeText}" View.HorizontalOptions="Start"/>
        <androidWidget:TextView Text="{Binding NativeText}" x:Arguments="{x:Static formsandroid:Forms.Context}" />
        <win:TextBlock Text="Foo"/>
    </ContentPage.Content>
</ContentPage>
  • native views are automagically wrapped into the appropriate wrapper
  • xmlns defined on a non-matching targetPlatform (see TargetPlatform enumeration) are ignored
  • you can bind to property of native views. A proxy is created on the fly for supporting 2-Way bindings if possible. If the native property doesn't implements INPC, or support Observable (on iOS), or is a DependencyProperty (on UWP), you can pass an UpdateSourceEventName parameter to the binding expression.
  • if you set, or bind to, attached BindableProperty to a native view that will be wrapped in a X.F.View, those property values and binding are transferred to the wrapper. See HorizontalOptions in the sample above.

Platform Specifics

Introducing Platform Specifics! Features or behaviors that apply to one platform only can now be implemented without requiring custom renderers. These new features/behaviors can then be accessed easily via a fluent code API or XAML.

Vendors can easily add their own Platform Specifics by attaching Effects to them (see 63a924d and 1f9482e for complete example).

This feature implements the framework that enables the new API and also includes several examples of platform specific features, which can be previewed using the Platform Specifics gallery page:

  • Blur support for any VisualElement on iOS

  • Translucent navigation bar on iOS

  • Partially collapsed navigation bar (with icons!) on MasterDetailPage on Windows
  • Toolbar placement options on Windows
  • AdjustResize/AdjustPan on Android (known issue: AdjustResize disables status bar color)

Bug Fixes

  • 32733 - "32733 – Switching Activity crash in 1.4.4.6392" (PR)

  • 35132 - "35132 – Pages are not collected when using a Navigationpage"

  • 39768 - "PanGestureRecognizer sometimes won't fire completed event when dragging very slowly" (PR)
  • 39908 - "Back button hit quickly results in jumbled pages" (PR)
  • 41463 - "CarouselView Crashes with "Sequence Does not Contain a Matching Element""
  • 42061 - "App crashes when registering an app link entry with invalid thumbnail url" (PR)
  • 42112 - "42112 - CarouselView throws error on Android while moving"
  • 42341 - "Page not removed from NavigationStack when hit Back quickly on iOS" (PR)
  • 42519 - "Text Truncation in UWP"
  • 42697 - "Slow swipe - System.InvalidOperationException: Sequence contains more than one element [CarouselView]"
  • 43230 - "DisplayAlert returns unexpected value when Escape key hit on UWP" (PR)
  • 43328 - "DisplayActionSheet() double-tap NullReferenceException crash Win8.1" (PR)
  • 43354 - "Button IsEnabled binding is position dependent" (PR)
  • 43450 - "Faulty syntax of Grid.RowDefinition wasn't caught with XamlC"
  • 43516 - "[UWP] Changing FontAttribute on a label to NONE changes font size as well" (PR)
  • 43530 - "[Android] Resuming app throws IllegalStateException from fragment manager"
  • 43726 - "Setting TabbedPage.ItemsSource to Null Causes Crash" (PR)
  • 43774 - "Appearing does not trigger for the first time for Tabpages in Android" (PR)
  • 43892 - "Xamarin.Forms.TabbedPage with FormsAppCompatActivity OnAppearing Troubles"
  • 44056 - "Picker Focused/Unfocused events not fired on iOS 10 preview" (PR)

Other fixes

  • iOS10 fixes

2.3.3-pre1

Only internal. There were no public artifacts/nuget packages for pre1.

Print in bluetooth printer

$
0
0

Hello all.

I have the following code, this one does not present errors, but it does not perform as desired, it connects in a good way to the bluetooth device but at the time of printing it does not, someone can tell me what to change or what to do to make this code Print me on my Intermec PR2 printer.

            try
            {
                string bt_printer = (from d in adapter.BondedDevices
                                     where d.Name == pStrNomBluetooth
                                     select d).FirstOrDefault().ToString();

                device = adapter.GetRemoteDevice(bt_printer);

                UUID applicationUUID = device.GetUuids()[0].Uuid;

                socket = device.CreateRfcommSocketToServiceRecord(applicationUUID);

                socket.Connect();

                outReader = new BufferedWriter(new OutputStreamWriter(socket.OutputStream));

                outReader.Write(pStrTextoImprimir);

                return "True";
            }
            catch (Exception ex)
            {
                return ex.Message;
            }
            finally
            {
                socket.Close();
            }
Viewing all 91519 articles
Browse latest View live


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