I have tabbed page, Onclick of tab new page will be open, which contains menu list with subitems. For that which control is proper and how to use?
Which one is proper control for creating list menu & Sub menu in xamarin forms pcl?
WTF error?
I very hate Xamarin.Forms because it's have a lot of shit error?
I try with New Empty Project
1. Install Plugin.Permission of James Montemagno
2. I get this error "java.lang.IllegalArgumentException: already added : Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat;"
3. I try Enable Multi-Dex
4. I get this error "Can't write [C:\Users\nguye\AppData\Local\Temp\mainDexClasses-11498.tmp.jar] (Can't read [C:\Users\nguye\AppData\Local\Xamarin\Xamarin.Android.Support.v4\23.3.0.0\embedded\classes.jar] (Duplicate zip entry [classes.jar:android/support/v4/view/ViewCompat$JbMr1ViewCompatImpl.class]))"
5. No comment!
Thinking of purchasing a MAC Mini to test apps for iOS, what else do I need?
I honestly have no idea what I need. Do I literally just buy a MAC mini and connect it to my windows PC and I'll be able to run the Visual Studio Xamarin iOS simulator? Or do I actually need to do stuff on the actual MAC Mini?
Also, is a REALLY cheap mac mini like this going to be suitable for this task?
https://www.amazon.com/Apple-MB463LL-Desktop-Discontinued-Manufacturer/dp/B001U0OFKU/ref=sr_1_9?s=pc&ie=UTF8&qid=1501316258&sr=1-9&keywords=Mac+Mini
Preview: Xamarin.Forms for macOS
I hope you are taking an opportunity with the latest pre-release 2.3.5.233-pre1 to experience your Xamarin.Forms apps running on macOS. It's a trip.
We want to kick off a thread to have some ongoing discussion about what's missing, what's not working, and where you'd like to see this go.
Please keep the discussion here on topic: macOS.
Getting Error: java.lang.IllegalArgumentException: already added : Landroid/support/v4/accessibility
Getting error
"/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(3,3): Error: java.lang.IllegalArgumentException: already added : Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat; (App2.Droid)"
Here is the build
Touching "obj/Debug/android/bin/packaged_resources".
Target _CompileJava:
/usr/bin/javac -J-Dfile.encoding=UTF8 -d obj/Debug/android/bin/classes -classpath /Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v7.1/mono.android.jar:obj/Debug/library_projects/FormsViewGroup/library_project_imports/formsviewgroup.jar:obj/Debug/library_projects/OkHttp/library_project_imports/okhttp-2.3.0-jar-with-dependencies.jar:obj/Debug/library_projects/Xamarin.Android.Support.Compat/library_project_imports/classes.jar:obj/Debug/library_projects/Xamarin.Android.Support.CustomTabs/library_project_imports/classes.jar:obj/Debug/library_projects/Xamarin.Azure.NotificationHubs.Android/library_project_imports/bin/classes.jar:obj/Debug/library_projects/Xamarin.Facebook/library_project_imports/AudienceNetwork.jar:obj/Debug/library_projects/Xamarin.Facebook/library_project_imports/bolts.jar:obj/Debug/library_projects/Xamarin.Facebook/library_project_imports/bin/classes.jar:/Users/apple/.local/share/Xamarin/Xamarin.Android.Support.Animated.Vector.Drawable/23.3.0.0/embedded/classes.jar:/Users/apple/.local/share/Xamarin/Xamarin.Android.Support.Design/23.3.0.0/embedded/classes.jar:/Users/apple/.local/share/Xamarin/Xamarin.Android.Support.v4/23.3.0.0/embedded/classes.jar:/Users/apple/.local/share/Xamarin/Xamarin.Android.Support.v4/23.3.0.0/embedded/libs/internal_impl-23.3.0.jar:/Users/apple/.local/share/Xamarin/Xamarin.Android.Support.v7.AppCompat/23.3.0.0/embedded/classes.jar:/Users/apple/.local/share/Xamarin/Xamarin.Android.Support.v7.CardView/23.3.0.0/embedded/classes.jar:/Users/apple/.local/share/Xamarin/Xamarin.Android.Support.v7.MediaRouter/23.3.0.0/embedded/classes.jar:/Users/apple/.local/share/Xamarin/Xamarin.Android.Support.v7.MediaRouter/23.3.0.0/embedded/libs/internal_impl-23.3.0.jar:/Users/apple/.local/share/Xamarin/Xamarin.Android.Support.v7.RecyclerView/23.3.0.0/embedded/classes.jar:/Users/apple/.local/share/Xamarin/Xamarin.Android.Support.Vector.Drawable/23.3.0.0/embedded/classes.jar:/Users/apple/.local/share/Xamarin/Xamarin.GooglePlayServices.Ads/8.4.0/embedded/classes.jar:/Users/apple/.local/share/Xamarin/Xamarin.GooglePlayServices.Base/8.4.0/embedded/classes.jar:/Users/apple/.local/share/Xamarin/Xamarin.GooglePlayServices.Basement/8.4.0/embedded/classes.jar:/Users/apple/.local/share/Xamarin/Xamarin.GooglePlayServices.Gcm/8.4.0/embedded/classes.jar:/Users/apple/.local/share/Xamarin/Xamarin.GooglePlayServices.Measurement/8.4.0/embedded/classes.jar:obj/Debug/library_projects/Xamarin.Android.Support.Annotations/library_project_imports/support-annotations.jar -bootclasspath /Library/android-sdk-mac/platforms/android-25/android.jar -encoding UTF-8 "@/var/folders/7t/xrtdy5dn3fb9_gr6p8xyfknc0000gn/T/tmp41afb3a7.tmp"
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Creating "obj/Debug/_javac.stamp" because "AlwaysCreate" was specified.
Target _CompileToDalvikWithDx:
Creating directory "obj/Debug/proguard".
/usr/bin/java -Xmx1024m -jar /Library/android-sdk-mac/build-tools/25.0.2/lib/dx.jar --no-strict --dex --output=obj/Debug/android/bin obj/Debug/android/bin/classes /Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v7.1/mono.android.jar obj/Debug/library_projects/FormsViewGroup/library_project_imports/formsviewgroup.jar obj/Debug/library_projects/OkHttp/library_project_imports/okhttp-2.3.0-jar-with-dependencies.jar obj/Debug/library_projects/Xamarin.Android.Support.Compat/library_project_imports/classes.jar obj/Debug/library_projects/Xamarin.Android.Support.CustomTabs/library_project_imports/classes.jar obj/Debug/library_projects/Xamarin.Azure.NotificationHubs.Android/library_project_imports/bin/classes.jar obj/Debug/library_projects/Xamarin.Facebook/library_project_imports/AudienceNetwork.jar obj/Debug/library_projects/Xamarin.Facebook/library_project_imports/bolts.jar obj/Debug/library_projects/Xamarin.Facebook/library_project_imports/bin/classes.jar /Users/apple/.local/share/Xamarin/Xamarin.Android.Support.Animated.Vector.Drawable/23.3.0.0/embedded/classes.jar /Users/apple/.local/share/Xamarin/Xamarin.Android.Support.Design/23.3.0.0/embedded/classes.jar /Users/apple/.local/share/Xamarin/Xamarin.Android.Support.v4/23.3.0.0/embedded/classes.jar /Users/apple/.local/share/Xamarin/Xamarin.Android.Support.v4/23.3.0.0/embedded/libs/internal_impl-23.3.0.jar /Users/apple/.local/share/Xamarin/Xamarin.Android.Support.v7.AppCompat/23.3.0.0/embedded/classes.jar /Users/apple/.local/share/Xamarin/Xamarin.Android.Support.v7.CardView/23.3.0.0/embedded/classes.jar /Users/apple/.local/share/Xamarin/Xamarin.Android.Support.v7.MediaRouter/23.3.0.0/embedded/classes.jar /Users/apple/.local/share/Xamarin/Xamarin.Android.Support.v7.MediaRouter/23.3.0.0/embedded/libs/internal_impl-23.3.0.jar /Users/apple/.local/share/Xamarin/Xamarin.Android.Support.v7.RecyclerView/23.3.0.0/embedded/classes.jar /Users/apple/.local/share/Xamarin/Xamarin.Android.Support.Vector.Drawable/23.3.0.0/embedded/classes.jar /Users/apple/.local/share/Xamarin/Xamarin.GooglePlayServices.Ads/8.4.0/embedded/classes.jar /Users/apple/.local/share/Xamarin/Xamarin.GooglePlayServices.Base/8.4.0/embedded/classes.jar /Users/apple/.local/share/Xamarin/Xamarin.GooglePlayServices.Basement/8.4.0/embedded/classes.jar /Users/apple/.local/share/Xamarin/Xamarin.GooglePlayServices.Gcm/8.4.0/embedded/classes.jar /Users/apple/.local/share/Xamarin/Xamarin.GooglePlayServices.Measurement/8.4.0/embedded/classes.jar
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoIcsImpl;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoStubImpl;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompatIcs;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompatJellyBeanMr2;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/animation/AnimatorCompatHelper;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/animation/AnimatorListenerCompat;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/animation/AnimatorProvider;
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: Translation has been interrupted
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:613)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:311)
at com.android.dx.command.dexer.Main.run(Main.java:277)
at com.android.dx.command.dexer.Main.main(Main.java:245)
at com.android.dx.command.Main.main(Main.java:106)
Caused by: java.lang.InterruptedException: Too many errors
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:605)
... 4 more
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1965,3): error : java.lang.IllegalArgumentException: already added : Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat;
Done building target "_CompileToDalvikWithDx" in project "App2.Droid.csproj" -- FAILED.
Done building project "App2.Droid.csproj" -- FAILED.
Build FAILED.
layout1.xml : warning XA0101: @(Content) build action is not supported
/Users/apple/Projects/WeAtApps IOS/Backup/App2 - Android/App2/App2.Droid/App2.Droid.csproj(677,5): warning : App2.Droid.csproj is Multilingual build enabled, but the Multilingual App Toolkit is unavailable during the build. If building with Visual Studio, please check to ensure that toolkit is properly installed.
AdViewRenderer.cs(26,16,26,35): warning CS0114: 'AdViewRenderer.CreateNativeControl()' hides inherited member 'ViewRenderer<View, View>.CreateNativeControl()'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword.
MainActivity.cs(47,13,47,95): warning CS0618: 'MobileAds.Initialize(Context, string)' is obsolete: 'deprecated'
MainActivity.cs(114,30,114,37): warning CS0168: The variable 'ignored' is declared but never used
RegistrationIntentService.cs(69,30,69,31): warning CS0168: The variable 'e' is declared but never used
NotificationHubImpl.cs(149,34,149,35): warning CS0168: The variable 'e' is declared but never used
NotificationHubImpl.cs(182,34,182,35): warning CS0168: The variable 'e' is declared but never used
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2021,3): warning MSB3247: Found conflicts between different versions of the same dependent assembly. In Visual Studio, double-click this warning (or select it and press Enter) to fix the conflicts; otherwise, add the following binding redirects to the "runtime" node in the application configuration file:
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1668,3): warning : Duplicate managed type found! Mappings between managed types and Java types must be unique. First Type: 'Android.Support.V4.OS.CancellationSignal+IOnCancelListenerImplementor, Xamarin.Android.Support.Compat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'; Second Type: 'Android.Support.V4.OS.CancellationSignal+IOnCancelListenerImplementor, Xamarin.Android.Support.v4, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1668,3): warning : References to the type 'Android.Support.V4.OS.CancellationSignal.IOnCancelListenerImplementor' will refer to 'Android.Support.V4.OS.CancellationSignal+IOnCancelListenerImplementor, Xamarin.Android.Support.Compat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1668,3): warning : Duplicate managed type found! Mappings between managed types and Java types must be unique. First Type: 'Android.Support.V4.View.ActionProvider+ISubUiVisibilityListenerImplementor, Xamarin.Android.Support.Compat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'; Second Type: 'Android.Support.V4.View.ActionProvider+ISubUiVisibilityListenerImplementor, Xamarin.Android.Support.v4, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1668,3): warning : References to the type 'Android.Support.V4.View.ActionProvider.ISubUiVisibilityListenerImplementor' will refer to 'Android.Support.V4.View.ActionProvider+ISubUiVisibilityListenerImplementor, Xamarin.Android.Support.Compat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1668,3): warning : Duplicate managed type found! Mappings between managed types and Java types must be unique. First Type: 'Android.Support.V4.View.ActionProvider+IVisibilityListenerImplementor, Xamarin.Android.Support.Compat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'; Second Type: 'Android.Support.V4.View.ActionProvider+IVisibilityListenerImplementor, Xamarin.Android.Support.v4, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1668,3): warning : References to the type 'Android.Support.V4.View.ActionProvider.IVisibilityListenerImplementor' will refer to 'Android.Support.V4.View.ActionProvider+IVisibilityListenerImplementor, Xamarin.Android.Support.Compat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1668,3): warning : Duplicate managed type found! Mappings between managed types and Java types must be unique. First Type: 'Android.Support.V4.View.IOnApplyWindowInsetsListenerImplementor, Xamarin.Android.Support.Compat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'; Second Type: 'Android.Support.V4.View.IOnApplyWindowInsetsListenerImplementor, Xamarin.Android.Support.v4, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1668,3): warning : References to the type 'Android.Support.V4.View.IOnApplyWindowInsetsListenerImplementor' will refer to 'Android.Support.V4.View.IOnApplyWindowInsetsListenerImplementor, Xamarin.Android.Support.Compat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1668,3): warning : Duplicate managed type found! Mappings between managed types and Java types must be unique. First Type: 'Android.Support.V4.View.IViewPropertyAnimatorListenerImplementor, Xamarin.Android.Support.Compat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'; Second Type: 'Android.Support.V4.View.IViewPropertyAnimatorListenerImplementor, Xamarin.Android.Support.v4, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1668,3): warning : References to the type 'Android.Support.V4.View.IViewPropertyAnimatorListenerImplementor' will refer to 'Android.Support.V4.View.IViewPropertyAnimatorListenerImplementor, Xamarin.Android.Support.Compat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1668,3): warning : Duplicate managed type found! Mappings between managed types and Java types must be unique. First Type: 'Android.Support.V4.View.IViewPropertyAnimatorUpdateListenerImplementor, Xamarin.Android.Support.Compat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'; Second Type: 'Android.Support.V4.View.IViewPropertyAnimatorUpdateListenerImplementor, Xamarin.Android.Support.v4, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1668,3): warning : References to the type 'Android.Support.V4.View.IViewPropertyAnimatorUpdateListenerImplementor' will refer to 'Android.Support.V4.View.IViewPropertyAnimatorUpdateListenerImplementor, Xamarin.Android.Support.Compat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1668,3): warning : Duplicate managed type found! Mappings between managed types and Java types must be unique. First Type: 'Android.Support.V4.View.MenuItemCompat+IOnActionExpandListenerImplementor, Xamarin.Android.Support.Compat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'; Second Type: 'Android.Support.V4.View.MenuItemCompat+IOnActionExpandListenerImplementor, Xamarin.Android.Support.v4, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1668,3): warning : References to the type 'Android.Support.V4.View.MenuItemCompat.IOnActionExpandListenerImplementor' will refer to 'Android.Support.V4.View.MenuItemCompat+IOnActionExpandListenerImplementor, Xamarin.Android.Support.Compat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1965,3): error : java.lang.IllegalArgumentException: already added : Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat;
493 Warning(s)
1 Error(s)
Time Elapsed 00:01:01.76
---------------------- Done ----------------------
Error: The given key was not present in the dictionary.
Just went to Xamarin.Forms 1.3.4.6328-pre2 and now get the error "The given key was not present in the dictionary." How can find in my xaml what may be causing the problem? I attached the xaml in a text file.
Error About XamlC
Hi.. I'm updated to xamarin.forms packages 2.3.4.247 version when I try to build the app it becomes error the result is "The target "XamlC" does not exist in the project."
Can someone help?
Xamarin.Forms Shared Projects Problems
Does anyone actually use shared projects in Xamarin.Forms? I'm not new to XAML, MVVM or even shared projects, just new to Xamarin. And I'm having problems with the simplest things - leading me to think I must have fallen on my head in my sleep last night. At first I tried some fairly complex solutions and had so many issues that I've reduced it to utter simplicity by reading the "Introduction to Xamarin.Forms" and "Getting Started with XAML" articles on the Xamarin site. Here's what I've reduced it to:
- I create a new solution (in Xamarin Studio 5.2 build (386) using the Blank App template. I've done both Portable and Shared - more on that in a bit.
- Without touching a line of code I run the app on an Android 4.0.3 emulator. So far so good.
- I click on either the shared or portable project and add a new file using the Forms ContentPage XAML template and accept the default name of MyPage.
- I alter the GetMainPage method of App to "return new MyPage();" That's it - nothing else.
Here's where things get weird. If I have used the Portable template it runs just fine. But if I've used a Shared template I get a compiler error that the type or namespace MyPage can't be found. Yes, I've checked the references and they are identical in both solutions.
What am I missing? What's the secret handshake? How can something as simple as following the most rudimentary of tutorials on Xamarin's Web Site fail so miserably so early?
Thanks for any insights.
ListView rendering after reappearing after Detail Page PopAsync
Hi - Newb to C# / Xamarin / Forums (There are things I am expert at)
I have a Content page (Master) with a ListView (itemsource is observablecollection of Objects) that opens a Content page (Detail) to edit Object properties.
Once the save is made (back to SQLite) - Detail VM sends a messagecenter message with the updated Object. Master Page VM Subscribes and replaces the original Object in the observablecollection with the Updated Object. Detail Page PopAsync's after the save.
Now Master Page reappears. The bindingcontext is updated as expected, but the listview does not render the updated Object. It is there, and can be selected to open the Details page again, but Text & Detail (set through binding to VM) are blank.
I know I could requery SQLite on reappearing - but I am trying to keep the View (MVVM) light. I am completing the Object swap through finding the index, then overwriting the Object in the observablecollection. I have also tried removing the object and adding the new object. Similar result. The only thing that works is a straight up removal of an Object in the collection - they disappear from the ListView as expected - using the same messaging scheme to trigger the collection update.
My preference would be to send Details Page a reference to the Object that is still in Master page, and change properties through the reference. It seems I am sending an object -editing it, and returning an object.
Some Code:
Details Page VIEWModel
public async void SavePlant()
{
await App.Database.SavePlantAsync(Plant);
MessagingCenter.Send(this.Plant, "PlantUpdated");
await App.Current.MainPage.Navigation.PopAsync();
}
Master Page VIEWModel in CTOR
MessagingCenter.Subscribe<PlantModel>(this, "PlantUpdated", (sender) =>
{
//Update the Plant in the list if it was edited elsewhere
PlantModel p = sender;
var plantToUpdate = Plants.SingleOrDefault(r => r.PlantID == p.PlantID);
if (plantToUpdate != null)
{
var index = Plants.IndexOf(plantToUpdate);
Plants[index] = p;
OnPropertyChanged("Plants");
}
});
Unrelated - but this is Master Page View
protected override void OnAppearing()
{
base.OnAppearing();
PlantSizeListViewModel vm = (PlantSizeListViewModel)BindingContext;
if (vm.Plants.Count == 0) { Navigation.PopAsync(); }
if (PlantLV != null)
{
PlantLV.ClearValue(ListView.SelectedItemProperty);
}
}
Forms frame isn't the same on iOS
I was using Xamarin Forms to create Android version with frames without any custom renderer of frame, it's fine. But when I use it on iOS, all frames are shadowed and separated to each other, it's weird. Should I make a custom renderer for iOS or it should be the same without any modification?
How to design beautiful UI for E-Commerce App in Xamarin.Forms?
Hi Folks,
How are you doing? I am going to develop an Ecommerce Xamarin.Forms App that I expect to look similar to the one in the picture above. I need your help in designing its UI for Items catalog Page. From the picture, I guess to have a MasterDetailPage , a master page for categories of products and a Detail page for Items of Respective category.
App will fetch data from Sql Azure Database hosted on Microsoft Azure via Asp.Net Web API and I want UI to be automatically updated (New boxes, Item templates or in simple words, Items to be added /shown in the page upon screen refresh) if database has got some new products/items in it. Problem that I have is that I am not sure how to make these products boxes, divide them in 2 columns and two products in each row as shown in the picture.
Kindly guide me on how can I achieve this and which UI controls should I use?
Thanks
Xaml Pass Binding as argument
Is there a way to pass a binding or similar as an argument to a non-default constructor in xaml?
like:
<MyClass>
<x:Arguments>
<x:Boolean>true</x:Boolean>
<x:Boolean>Binding="{Binding bindingName}"</x:Boolean>
<x:Double>90</x:Double>
</x:Arguments>
</MyClass>
Best way to create Thumbnails of images
Hi,
I need the function in my app, that the user can pick an image from the image gallery and a Thumbnail of this Image should the be stored in a Zip-File.
I have no problem accesing a stream of the just picked image through the MediaPlugin and I can write into a ZIP-File via a Stream.
What's the easiest way to get a Thumbnail image from the selected image?
All the best
Thomas
Pb with Slider
Hello,
I use Valuechanged but it is call during the moving of the slider.
I would like to call a function when the user is at the end of its moving on the Slider.
When he stop to move the slider.
How to do that ?
Thank you,
Christophe
How to change a property in a controltemplate
I'm currently trying to create a side menu for my app. It is my very first Xamarin project so it is mostly trial and error.. This was my idea of how to create my menu:
So, I have created a controlTemplate in my app.xaml which is a basic grid with 1 row and 2 columns. The first column is hidden (width set to 0) and contains the menu, and the other column contains another grid with two rows with the first one a containing a button and the second one holding the contentPresenter. The idea was that the once the button is pressed the hidden column will be visible by setting the width to 200 (for example).
Any idea how I can do the following:
- Bind an OnClicked method to a controlTemplate button
- Change the width value of the column
Xamarin Live and RESTful Services
Any Idea why Xamarin Live does not bring data from RESTful Service ? instead it brings empty fields.
below i attached a photo from the device showing searchbar to search a list of certain objects using HttpClient ...
The result shown accurately in win phone and andriod but in Xamarin Live (iOS) nothing appear as attached photo.
android deploy error undiscernable
Can't figure out to proceed with the only error I see in my vs2017 pro android deploy. Deploy output result is attached as well as an avd log pop-up error.
My vs2017 ide is on a win10 pro laptop and I have an android phone and an android tablet connected via bluetooth and usb. They both show as connected in the windows file explorer window. Besides the avd pop-up error the only deploy error I see is:
"****1> No way to resolve conflict between "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" and "mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e". Choosing "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" arbitrarily.****"
Is there some android install problem on my win10pro or a vs2017 nuget package problem?????????????????????????
I have no native code in any of my android, ios or windows uwp projects. All my code is in my shared project and it builds, deploys and tests good on laptop, windows phone and windows tablet.
My vs2017 about window shows:
Microsoft Visual Studio Professional 2017 (2)
Version 15.2 (26430.15) Release
VisualStudio.15.Release/15.2.0+26430.15
Microsoft .NET Framework
Version 4.7.02046
Installed Version: Professional
Visual Basic 2017 00369-60000-00001-AA510
Microsoft Visual Basic 2017
Visual C# 2017 00369-60000-00001-AA510
Microsoft Visual C# 2017
Visual C++ 2017 00369-60000-00001-AA510
Microsoft Visual C++ 2017
Application Insights Tools for Visual Studio Package 8.6.00404.2
Application Insights Tools for Visual Studio
ASP.NET and Web Tools 2017 15.0.30503.0
ASP.NET and Web Tools 2017
ASP.NET Web Frameworks and Tools 2012 4.0.11203.0
For additional information, visit https://www.asp.net/
ASP.NET Web Frameworks and Tools 2017 5.2.50303.0
For additional information, visit https://www.asp.net/
Azure App Service Tools v3.0.0 15.0.30209.0
Azure App Service Tools v3.0.0
Common Azure Tools 1.9
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.
JavaScript Language Service 2.0
JavaScript Language Service
JavaScript Project System 2.0
JavaScript Project System
JavaScript UWP Project System 2.0
JavaScript UWP Project System
KofePackagePackage Extension 1.0
KofePackagePackage Visual Studio Extension Detailed Info
Merq 1.1.17-rc (cba4571)
Command Bus, Event Stream and Async Manager for Visual Studio extensions.
Microsoft Azure Tools 2.9
Microsoft Azure Tools for Microsoft Visual Studio 2017 - v2.9.50131.1
Microsoft MI-Based Debugger 1.0
Provides support for connecting Visual Studio to MI compatible debuggers
Microsoft Visual Studio VC Package 1.0
Microsoft Visual Studio VC Package
Mono Debugging for Visual Studio Mono.Debugging.VisualStudio
Support for debugging Mono processes with Visual Studio.
NuGet Package Manager 4.2.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.
SQL Server Data Tools 15.1.61702.140
Microsoft SQL Server Data Tools
TypeScript 2.2.2.0
TypeScript tools for Visual Studio
Visual Studio tools for CMake 1.0
Visual Studio tools for CMake
Visual Studio Tools for Universal Windows Apps 15.0.26430.06
The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.
Xamarin 4.5.0.486 (fec6f88)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.
Xamarin.Android SDK 7.3.1.2 (9dbc4c5)
Xamarin.Android Reference Assemblies and MSBuild support.
Xamarin.iOS and Xamarin.Mac SDK 10.10.0.37 (ad35de4)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.
ValueConverter - binding to self
I need to bind a label to a composite value - made up of a couple of values in the model. I'm trying to use a ValueConverter to do so, but I can't figure out how to pass the object itself to the ValueConverter. Here's my code:
in XAML:
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:MyApp;assembly=MyApp"
x:Class="MyApp.SavedDetailsPage">
<ContentPage.Resources>
<ResourceDictionary>
<local:DetailsConverter x:Key="detailsCvt" />
</ResourceDictionary>
</ContentPage.Resources>
...
<Label Text="{Binding ???, Converter={StaticResource detailsCvt}}" FontSize="Small" TextColor="Gray" />
...
in DetailsConverter.cs:
class DetailsConverter : IValueConverter
{
object IValueConverter.Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
MyModel myModel = (MyModel)value;
return (myModel.FirstName + " " + myModel.LastName);
}
...
I tried using '.' for binding to self, but that didn't work.
I found a way around it by adding a .This property to MyModel, that gives access to the object itself, so I can pass 'This' in the XAML binding, but not sure if that's the best way.
Thanks in advance!
How to get INotifyPropertyChanged for the whole object
I have a listview of event items. In the viewcell I use a binding on the item with a converter like that:
<Image Source="{Binding ., Converter={StaticResource eventToImage}}" />
The image is dynamically chosen according to the type of event and an "is attending" property.
In a first version the binding was done on property "Attending" and the image was properly updated whenever the property changed thanks to this in my domain object:
private string attending;
public string Attending {
get { return attending; }
set {
if (value.Equals(attending))
return;
attending = value;
OnPropertyChanged ("Attending");
}
}
But since I now choose the image based on multiple attributes and I thus bind on the object itself, the notification is not listened to anymore.
If I remember correctly from XAML/WPF, I should use an additional attribute for my binding:
<Image Source="{Binding ., Converter={StaticResource eventToImage}, UpdateSourceTrigger=PropertyChanged}" />
However this breaks since UpdateSourceTrigger
is not a recognized attribute in Xamarin.Forms.
Any idea how to deal with that? I could add another property being the object itself, bind on it and notify that it changed but it would be really really ugly.
PanUpdated Up/Down and Left/Right
Hello guys,
I use Xamarin Forms for iOS.
In an application I am introducing sound volume, when I drag my finger up the volume increases and without lifting my finger while dragging down the volume does not decrease.
How to make this code (mathematical code)
var pan = new PanGestureRecognizer();
pan.PanUpdated += (sender, args) =>
{
switch (args.StatusType)
{
case GestureStatus.Started:
Debug.WriteLine("Started");
break;
case GestureStatus.Running:
Debug.WriteLine("Running");
if (?) // If only drag up
{
DependencyService.Get<IMusicManagerIOS>().VolumeUp();
}
else // If only drag down
{
DependencyService.Get<IMusicManagerIOS>().VolumeDown();
}
// left and right?
break;
case GestureStatus.Completed:
Debug.WriteLine("Completed");
break;
case GestureStatus.Canceled:
Debug.WriteLine("Canceled");
break;
}
}