xamarin.forms

How to update badge counter in Parent tab page xamarin forms

佐手、 提交于 2021-01-29 12:53:43
问题 I have a App that uses tabbed pages, In the xaml of the Parent tab page I populate all my other tab pages, I have a viewmodel that binds to the Parent tab page and viewmodels for each of the other Tab pages. I have a badge on one of the tabs that has a counter which shows how many messages there are. I am having trouble updating the counter. So I have a call to retrieve the amount of unread messages from the database which is populating into the counter on app load. When i Navigate to view

Collection.Find(…), Collection.FindAll() All throwing exception with message “value can not be null parameter name method”

孤街醉人 提交于 2021-01-29 12:50:31
问题 Person Model: public class Person { public Int32 Id { get; set; } public String Name { get; set; } } Find Person from DB: public List<Person> find() { using (var db = new LiteDatabase(DatabasePathProvider.CacheLiteDbPath)) { var col = db.GetCollection<Person>("Person"); var list = col.FindOne(m => m.Name != null); return list; } } On executing the find query on the database as shown in the code, This exception is thrown with stack trace: at System.Dynamic.Utils.ContractUtils.RequiresNotNull

Can't find an element on iOS in my xamarin ui tests

这一生的挚爱 提交于 2021-01-29 12:41:00
问题 I wrote some tests on android and now I'm trying to make it compatible to iOS too. I have some picker : enter image description here I gave the picker automation id and also to the label inside him so I can read it text, in android I succeed but in iOS I can't even see the label. tree repl in iOS : Ios repl tree tree repl in android: android repl tree the xaml code: <scrControls:ScrPickerWithBorder x:Name="SleepStartPicker" Grid.Row="1" Grid.Column="1" Margin="0" ArrowColor="{StaticResource

Bind Plugin.Media fromViewModel

本小妞迷上赌 提交于 2021-01-29 12:37:44
问题 I have a view model that handles the Plugin.Media to take a picture from the phone. The image will not show unless I have the code below (View Model) in the code-behind, then it works fine, which is defeating the object of me learning MVVM. I have also tried ' FileImageSource ' and used ' Source' in its various ways.' Can anyone explain what I am doing wrong? View Model: public string FilePath { get => _filepath; set { _filepath = value; OnPropertyChanged(); } } private string _filepath;

Xamarin.Forms, XAML, Bindings and isVisible

喜欢而已 提交于 2021-01-29 12:30:33
问题 I am (obviously, regarding the question) new to this, so thanks in advance for any help! As I am trying my current best on this for hours now, I hope, someone can accelerate my learning curve :) Addendum: I also posted on the Xamarin Forum, however this seems to be rather dead regarding the amount of answers to questions. Therefore I hope no one takes offense. So, I have my XAML MainPage: <?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="cant post links" xmlns:x="cant post links"

In Xamarin.Forms Shell How do I add menuitems programatically

£可爱£侵袭症+ 提交于 2021-01-29 12:27:05
问题 In Xamarin Forms v4.0.0.394984 pre10 using Visual Studio 2017 I was able to add MenuItems to the Shell programatically in the constructor of the Shell using the MenuItemsCollection MenuItems. Here is the code that works in v4.0.0.394984 pre10 (simplified it for this question to add a single hard-coded menuitem and function LoadView is not shown here) public partial class Shell : Xamarin.Forms.Shell { public ICommand cmdLoadView { get; } = new Command(LoadView); public Shell() {

Xamarin Forms iOS AdMobViewRenderer VS2019

て烟熏妆下的殇ゞ 提交于 2021-01-29 12:14:25
问题 Things were working fine for both my Android and iOS versions of the app, then I updated VS2019 to 16.1.2 which brought along Xamarin 16.1 I can move forward in the app and it seems that all is well, but when I move backward (one step or PopToRoot), the Element is null in the AdMobViewRenderer. Any ideas? I am using Xamarin.Firebase.iOS.Admob 7.27.0.3 because that is the one version that would work properly without error. In anticipation of the "update" reply, I updated to the latest AdMob

How to hide task bar and maximize window using WPF through Xamarin Forms

夙愿已清 提交于 2021-01-29 11:46:37
问题 I have already tried different options including info in this question Make my wpf application Full Screen (Cover taskbar and title bar of window), but nothing helped me Only IgnoreTaskbarOnMaximize property works correct, but it is used from the MahApps, which is not compatible with Xamarin Forms. Maybe you know how to implement IgnoreTaskbarOnMaximize manually? 回答1: As far as I can tell from this tutorial on using Xamarin.Forms with WPF, the Xamarin.Forms application is created from a

How to Refresh the Bindings on HomePageViewModel when some data has been changed in Navigated Page2

眉间皱痕 提交于 2021-01-29 11:29:47
问题 I have some property which I am using from Page2 in HomePageViewModel, When I navigate to Page2 I have changed that property and on coming back by doing NavigiationPop. HomePage is not re-loaded/ refreshed at all as I have set the BindingContext in the constructor of HomePage, which is loaded only once. The solution which is working for me is Setting the BindingContext to the ViewModel on "onAppearing()", usually its not consider the best practice. But I also need to refresh the values which

How to delete files using xamarin forms

柔情痞子 提交于 2021-01-29 11:28:39
问题 I tried to delete file from specific directory(Folder) but it doesn't work for me this is my code DeletePhoto.Clicked += async (sender, args) => { var file = await Plugin.Media.CrossMedia.Current.PickPhotoAsync(new Plugin.Media.Abstractions.PickMediaOptions { PhotoSize = Plugin.Media.Abstractions.PhotoSize.Medium, }); if ( file != null) { if (File.Exists(file.Path)) { DependencyService.Get<IFileManager>().DeleteFile(file.Path); } file.Dispose(); } }; In android public class FileManager :